/* ==========================================================================
   MARKING STUDIO · BASE
   "Studio Noir" — charcoal paper, ivory ink, orange signature.
   Bricolage Grotesque display over Inter body. Recto/verso = two shades of dark.
   ========================================================================== */

/* ==========================================================================
   FONTS — self-hosted variable woff2 (no Google Fonts CDN: RGPD + perf).
   latin covers French incl. œ (U+0152-0153); latin-ext loads only if needed.
   ========================================================================== */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Type scale — editorial, generous (smaller floors for mobile) */
  --text-xs:    clamp(0.68rem, 0.64rem + 0.18vw, 0.78rem);
  --text-sm:    clamp(0.78rem, 0.74rem + 0.2vw, 0.92rem);
  --text-base:  clamp(0.95rem, 0.9rem + 0.25vw, 1.1rem);
  --text-lg:    clamp(1.05rem, 0.98rem + 0.45vw, 1.35rem);
  --text-xl:    clamp(1.25rem, 1.1rem + 1vw, 2rem);
  --text-2xl:   clamp(1.7rem, 1.3rem + 2.2vw, 3.25rem);
  --text-3xl:   clamp(2rem, 1.3rem + 4vw, 4.75rem);
  --text-hero:  clamp(2.5rem, 0.6rem + 8vw, 8.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Radius — kept tight; the studio brand is paper, not pillows */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms var(--ease);
  --t-med:  280ms var(--ease);
  --t-slow: 600ms var(--ease);

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 960px;
  --content-wide: 1280px;
  --content-full: 100%;

  /* Fonts */
  --font-display: "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-italic:  "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Tracking helpers */
  --track-label: 0.16em;
  --track-mini:  0.22em;
}

/* ==========================================================================
   PALETTE — light "recto" (default)
   ========================================================================== */
:root {
  /* Paper tones — charcoal "recto" */
  --paper:        #111316;   /* main charcoal sheet */
  --paper-soft:   #191C20;   /* raised surface: marquee, cards, forms */
  --paper-deep:   #21252B;   /* deeper: gradients, wireframe blocks */
  --paper-bright: #F5F3EC;   /* IVORY — light text/element on dark (photos, chips) */

  --ink:          #F5F3EC;   /* ivory — the strong contrast (buttons, featured, blocks) */
  --ink-soft:     #E7E3D6;
  --ink-2:        #C9C4B4;

  --text:         #F1EFE7;   /* ivory body text on charcoal */
  --text-muted:   #A6A196;   /* AA on charcoal (~7:1) */
  --text-faint:   #837E72;   /* AA: ~4.8:1 on #111316. Discrétion = taille + tracking, pas le contraste */
  --text-inverse: #111316;   /* charcoal — for text on ivory / orange */

  --rule:         #2B2F35;   /* hairline on charcoal */
  --rule-soft:    #21252B;

  /* Orange signature — "studio" + "Créateur" + § */
  --accent:       #FF6D14;
  --accent-hover: #FF8A3D;
  --accent-soft:  #4A2A13;   /* muted orange wash for the marker-highlight on dark */

  /* Shadows — deep, since we sit on near-black */
  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   PALETTE — dark "verso" — applied per-section only
   (NOT page-wide; recto/verso lives in <section data-section="verso">)
   ========================================================================== */
[data-section='verso'] {
  --paper:        #0A0B0D;   /* near-black "verso" — the card's back */
  --paper-soft:   #121417;
  --paper-deep:   #181B1F;
  --paper-bright: #F5F3EC;   /* ivory light element */

  --ink:          #F5F3EC;
  --ink-soft:     #E7E3D6;
  --ink-2:        #C9C4B4;

  --text:         #F1EFE7;
  --text-muted:   #A6A196;
  --text-faint:   #837E72;   /* AA on near-black */
  --text-inverse: #0A0B0D;

  --rule:         #24282E;
  --rule-soft:    #181B1F;

  --accent:       #FF6D14;
  --accent-hover: #FF8A3D;
  --accent-soft:  #3E2410;

  color: var(--text);
  background: var(--paper);
}

/* ==========================================================================
   RESET
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  /* Volontairement < hauteur du header : le padding-top des sections glisse
     sous le header fixe, le titre atterrit juste en dessous. */
  scroll-padding-top: 24px;
}

body {
  min-height: 100dvh;
  line-height: 1.55;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text);
  background: var(--paper);
  overflow-x: hidden;
  font-feature-settings: "ss01", "cv11", "kern";
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }

ul[role='list'], ol[role='list'] { list-style: none; }

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.05;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

p, li, figcaption { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

button { cursor: pointer; background: none; border: none; font-family: inherit; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a, button, [role='button'], input, textarea, select {
  transition: color var(--t-fast), background var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast),
              transform var(--t-fast), opacity var(--t-fast);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-12));
}

/* ==========================================================================
   EDITORIAL PRIMITIVES — pulled straight from the card
   ========================================================================== */

/* Tracked uppercase label, like "MARKING — STUDIO · EST 2024" */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.label--mini {
  font-size: 0.62rem;
  letter-spacing: var(--track-mini);
}
.label--ink { color: var(--text); }

/* Section ornament — fleur-de-lis (custom SVG, colored via currentColor) */
.pilcrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  line-height: 1;
  vertical-align: middle;
}
.fleur {
  display: block;
  width: 0.78em;
  height: 1em;
  fill: currentColor;
}

/* "N°01 / Série A" style numbering */
.folio {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Italic serif accent — "studio." "sur mesure" "Créateur" */
.em-italic {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* Hairline rule */
.rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--rule);
  border: 0;
}

/* Section header (eyebrow + title + lead) */
.section {
  padding-block: clamp(var(--space-20), 12vh, var(--space-32));
  position: relative;
}
.section--tight { padding-block: clamp(var(--space-16), 9vh, var(--space-24)); }

.section__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
  margin-bottom: clamp(var(--space-10), 6vh, var(--space-16));
  border-bottom: 1px solid var(--rule);
}
.section__top-left { display: flex; align-items: baseline; gap: var(--space-3); }

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-top: var(--space-6);
}
.section__title .em-italic { color: var(--accent); }
.section__lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 52ch;
  margin-top: var(--space-5);
  line-height: 1.45;
}

/* Reveal-on-scroll — bidirectionnel (façon Wibify) : l'élément se révèle à
   l'entrée du viewport et se range quand il en sort, par le haut comme par
   le bas, pour rejouer au scroll inverse. L'état caché pointe vers le bord
   de sortie : par défaut vers le bas (avant première entrée / sortie basse),
   `.is-above` après une sortie par le haut. La sortie est plus rapide que
   l'entrée et sans délai (les délais d'entrée sont scopés sur .is-visible). */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
}
.reveal.is-above { transform: translateY(-18px); }
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition-duration: 800ms;
}
html:not(.js) .reveal { opacity: 1; transform: none; }

/* Reveal-words — apparition des titres mot à mot : chaque mot monte d'un
   demi-cadratin en passant du flou au net (blur 6px → 0), en cascade.
   Le découpage en spans .rw est fait par main.js ; sans JS ou sous
   prefers-reduced-motion les spans n'existent pas, donc rien n'est masqué. */
.reveal-words .rw {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.45em);
  filter: blur(6px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease), filter 420ms var(--ease);
}
.reveal-words.is-above .rw { transform: translateY(-0.3em); }
.reveal-words.is-visible .rw {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition-duration: 900ms;
  transition-delay: calc(var(--wi, 0) * 70ms);
}

/* ==========================================================================
   PAPER GRAIN — faint filmic tooth over the whole sheet (recto + verso),
   so flat cream sections read like printed stock rather than screen-flat.
   ========================================================================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.045;
  mix-blend-mode: overlay;
}
