/* ============================================================
   FRENCH NARRATIVE — one-pager
   Fonts: PP Formula (sans), Nocturne Serif (serif)
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "PP Formula";
  src: url("assets/fonts/ppformula-light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Formula";
  src: url("assets/fonts/ppformula-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* Logo face. Drop the file at assets/fonts/ppneuemachina-regular.woff
     (or .woff2 — update the url) to activate it; until then the logo
     gracefully falls back to PP Formula. */
  font-family: "PP Neue Machina";
  src: url("assets/fonts/ppneuemachina-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nocturne Serif";
  src: url("assets/fonts/nocturne-serif-light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nocturne Serif";
  src: url("assets/fonts/nocturne-serif-light-italic.woff") format("woff");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Nocturne Serif";
  src: url("assets/fonts/nocturne-serif-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f8f6ed;
  --ink: #15140f;
  --ink-strong: #0a0a08;
  --muted: #7c7b75;

  --sans: "PP Formula", "Helvetica Neue", Arial, sans-serif;
  --serif: "Nocturne Serif", Georgia, "Times New Roman", serif;
  --logo-font: "PP Neue Machina", "PP Formula", "Helvetica Neue", Arial, sans-serif;

  --pad-h: clamp(14px, 3vw, 48px);
  --pad-v: clamp(18px, 2.2vw, 32px);
  --footer-h: 54px;

  /* Set by JS */
  --logo-h: 120px;
  --content-inset: 160px;
  --logo-travel: 0px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p { margin: 0 0 1.05em; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
a { color: inherit; text-decoration: none; }

/* ---------- Typography helpers ---------- */
.lede {
  font-family: var(--serif);
  /* Weight 400 = Nocturne Serif Regular, the only UPRIGHT Nocturne cut in the
     font set. (The "Light" woff is actually Light Italic, which is why the
     lede was rendering slanted.) */
  font-weight: 400;
  font-size: clamp(18px, 2vw, 27px);
  line-height: 1.22;
  margin-bottom: 1.3em;
}
.name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 1.9vw, 27px);
  line-height: 1.1;
  margin-bottom: 0.9em;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.01em;
  margin: 1.8em 0 0.5em;
}
.link {
  display: inline-block;
  position: relative;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 2vw, 27px); /* mirrors the lede */
  line-height: 1.22;
  /* Mobile: always underlined — the only clear affordance without hover. */
  border-bottom: 1px solid currentColor;
}
.link__arrow { display: inline-block; margin-right: 0.3em; }

/* ---------- Credits / phases ---------- */
.credit { margin-bottom: 1.15em; }
.credit__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(17px, 1.6vw, 24px);
  line-height: 1.12;
  margin-bottom: 0.2em;
}
.credit__meta { color: var(--muted); margin: 0; }

.phase { margin-bottom: 2.4em; }
.phase__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 1.9vw, 27px);
  line-height: 1.1;
}

/* ---------- Logo ---------- */
.logo {
  margin: 0;
  padding: var(--pad-v) var(--pad-h) 0;
  z-index: 30;
  pointer-events: none;
}
.logo__text {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--logo-font);
  font-weight: 400; /* PP Neue Machina Regular; PP Formula fallback resolves to Medium */
  line-height: 0.82;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
  font-size: 12vw; /* replaced by JS fit */
}

/* ---------- Footer ---------- */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--footer-h);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px var(--pad-h) 10px;
  background: var(--bg);
  font-size: 11px;
}
.footer__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Keep the left block on its own lines; the right block wraps if needed. */
.footer__group .footer__item { white-space: nowrap; }
.footer__item--end { margin-left: auto; text-align: right; white-space: nowrap; }
.footer__link {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s ease;
}
.footer__link:hover { opacity: 0.65; }

@media (min-width: 769px) {
  .footer {
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 14px;
  }
  .footer__group {
    flex-direction: row;
    gap: clamp(24px, 6vw, 120px);
  }
}

/* =====================================================================
   BASE = MOBILE  (single continuous scroll, fixed hide-on-scroll logo)
   ===================================================================== */
.logo {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.logo.is-hidden { transform: translateY(-115%); }

.stage {
  /* Extra space below the fixed logo before the content starts (mobile). */
  padding-top: calc(var(--logo-h) + 24px);
  padding-bottom: calc(var(--footer-h) + 30px);
}

.layer { padding: 8px var(--pad-h) 0; }
.layer--method { padding-top: 28px; }

.home-grid,
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(18px, 5vw, 32px);
}

/* Mobile placement: intro + body + projets full width, names two-up */
.col--intro,
.col--body,
.col--projets,
.col--method-intro,
.col--method-body { grid-column: 1 / -1; }

.col--intro { margin-bottom: 1.4em; }
.col--body { margin-bottom: 1.6em; }
.col--projets { margin-bottom: 1.6em; }
.col--nancy { grid-column: 1; }
.col--brice { grid-column: 2; }

/* Mobile: balance the space below "Back to homepage" with the gap above it
   (the lede's 1.3em margin-bottom). The link now mirrors the lede size,
   so the same 1.3em matches that gap. */
.col--method-intro .link { margin-bottom: 1.3em; }

.col--phases {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(14px, 4vw, 28px);
  margin-top: 1.4em;
}
.col--phases .phase { margin-bottom: 0; }

@media (max-width: 520px) {
  /* Keep the two bio columns (Nancy | Brice) side-by-side, as in the
     reference. Only the 3-up methodology phases collapse to one column. */
  .col--phases { grid-template-columns: 1fr; row-gap: 1.6em; }
}

/* =====================================================================
   DESKTOP  (shared-logo reveal, fixed viewport, footer pinned)
   ===================================================================== */
@media (min-width: 769px) {
  .stage {
    position: relative;
    height: calc(100svh - var(--footer-h));
    overflow: hidden;
    padding: 0;
  }

  /* Logo absolute inside stage; glides to bottom on methodology view */
  .logo {
    position: absolute;
    top: 0;
    background: transparent;
    transition: transform 0.95s cubic-bezier(0.76, 0, 0.18, 1);
  }
  .logo.is-hidden { transform: none; } /* disable mobile hide */
  body.show-method .logo { transform: translateY(var(--logo-travel)); }

  /* Layers stacked; they slide vertically in step with the logo (no fade).
     Same duration + easing as the logo so the text tracks its movement. */
  .layer {
    position: absolute;
    left: 0;
    right: 0;
    padding: 0 var(--pad-h);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    transition: transform 0.95s cubic-bezier(0.76, 0, 0.18, 1);
  }

  .layer--home {
    top: var(--content-inset);
    bottom: 0;
    z-index: 20;
    transform: translateY(0);
  }
  .layer--method {
    top: var(--pad-v);
    bottom: var(--content-inset);
    z-index: 10;
    transform: translateY(-130%); /* parked above, clipped out of view */
    pointer-events: none;
  }

  /* Click: everything glides DOWN together — logo, home content, and the
     incoming methodology content all travel the same direction. */
  body.show-method .layer--home {
    transform: translateY(130%); /* slides down and out the bottom */
    pointer-events: none;
  }
  body.show-method .layer--method {
    transform: translateY(0); /* slides down into place */
    pointer-events: auto;
  }

  /* Desktop home (per FNv2): intro+body stacked | projets | gap | nancy | brice.
     minmax(0, …fr) lets the fr ratios win over content min-widths, so the empty
     spacer keeps its share and pushes Nancy/Brice to the right as in the PDF. */
  .home-grid {
    grid-template-columns:
      minmax(0, 1.5fr)
      minmax(0, 1.4fr)
      minmax(0, 1.4fr)
      minmax(0, 1.05fr)
      minmax(0, 1.05fr);
    column-gap: clamp(20px, 2vw, 40px);
    row-gap: 2.2em;
    align-items: start;
  }
  .col--intro   { grid-column: 1; grid-row: 1; margin: 0; }
  .col--body    { grid-column: 1; grid-row: 2; margin: 0; }
  .col--projets { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  /* column 3 is an empty spacer track */
  .col--nancy   { grid-column: 4; grid-row: 1 / 3; }
  .col--brice   { grid-column: 5; grid-row: 1 / 3; }

  /* Desktop methodology: intro | body | gap | projet1 | projet2 | projet3 */
  .method-grid {
    grid-template-columns: 1.05fr 1.25fr 0.5fr 1fr 1fr 1fr;
    column-gap: clamp(24px, 2.2vw, 44px);
    align-items: start;
  }
  .col--method-intro { grid-column: 1; }
  .col--method-intro .link { margin-bottom: 0; } /* mobile-only spacing */
  .col--method-body  { grid-column: 2; }
  .col--phases {
    grid-column: 4 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: clamp(24px, 2.2vw, 44px);
    margin: 0;
  }
  .col--phases .phase { margin: 0; }

  .lede { margin-bottom: 1.5em; }
}

/* =====================================================================
   DESKTOP TYPE + LINK INTERACTION  (FNv2: small, dense editorial type)
   ===================================================================== */
@media (min-width: 769px) {
  body { font-size: clamp(10px, 0.72vw, 12px); }

  .lede,
  .link,
  .name,
  .credit__title,
  .phase__title { font-size: clamp(16px, 1.15vw, 19px); }
  .eyebrow { font-size: 9px; }

  /* No static underline on desktop — an underline draws in on hover, and a
     subtle periodic arrow nudge hints that the link is interactive. */
  .link { border-bottom: none; }
  .link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.12em;
    height: 1px;
    width: 100%;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.76, 0, 0.18, 1);
  }
  .link:hover::after { transform: scaleX(1); }

  .link__arrow { animation: arrow-hint 3s ease-in-out infinite; }
  .link:hover .link__arrow {
    animation: none;
    transform: translateX(5px);
    transition: transform 0.25s ease;
  }
}

/* Subtle "click me" nudge: mostly still, a small rightward bob each cycle. */
@keyframes arrow-hint {
  0%, 65%, 100% { transform: translateX(0); }
  80% { transform: translateX(3px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .logo,
  .layer { transition-duration: 0.001s; }
  .link__arrow { animation: none; }
}
