/* ===========================================================================
   Firn — landing page
   Direction I, Expedition Journal. Built from Brand Guidelines v1.0.
   Every value below traces to a numbered section of the guidelines; where this
   file departs from them, the comment says so and the README lists it.
   =========================================================================== */

/* Self-hosted. Newsreader roman: weights 300, 400, 500, optical size kept.
   Newsreader italic: 400. Source Serif 4 roman: 400 and 500, optical size kept.
   Source Serif 4 italic: 400. Latin glyphs only. Georgia in the stack below
   is a local fallback, not a network request. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/newsreader-roman-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-roman-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/newsreader-roman-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-italic-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-roman-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/source-serif-4-roman-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-italic-400-latin.woff2") format("woff2");
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* §04 Colour. Cinnabar is deliberately absent: it marks confirmation only,
     and nothing has been decided on this page. */
  --paper:    #EFE7D6;
  --paper-hi: #F5EFE0;
  --ink:      #1A1916;
  --slate:    #4D5560;   /* 6.13:1 on paper */
  --ochre:    #B58A3D;   /* 2.56:1 on paper — decoration only, never information */

  /* §03 Typography */
  --display: "Newsreader", Georgia, serif;
  --body:    "Source Serif 4", Georgia, serif;

  /* §05 Layout. Three tiers; the values are overridden in the media queries. */
  --margin:      96px;
  --gutter:      24px;
  --content-max: 1248px;   /* 12 × 82 + 11 × 24 */
  --nav-h:       64px;

  --block-gap: 96px;       /* content → next section rule */
  --head-gap:  40px;       /* rule → heading */
  --body-gap:  56px;       /* heading → body */

  /* §05 measure is 60–75 characters. One column width cannot serve both body
     rungs, so the larger rung takes the wider measure; both land near 68ch. */
  --measure-body-l: 612px;
  --measure-body:   506px;
  --step-track:     106px;
}

@media (max-width: 1023px) {
  :root {
    --margin: 48px; --gutter: 20px; --content-max: 672px;
    --block-gap: 80px; --head-gap: 40px; --body-gap: 56px;
    --measure-body-l: 640px; --measure-body: 566px;
  }
}

@media (max-width: 639px) {
  :root {
    --margin: 24px; --gutter: 16px; --content-max: 342px;
    --nav-h: 60px;
    --block-gap: 64px; --head-gap: 32px; --body-gap: 44px;
    /* §05's measure rule is suspended below 640px — honouring 60 characters at
       342px forces a body size under the 14px Body S rung. */
    --measure-body-l: none; --measure-body: none;
    --step-track: 44px;
  }
}

/* --- Reset ---------------------------------------------------------------- */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, figure, ol, li { margin: 0; }
ol { list-style: none; padding: 0; }
img { display: block; width: 100%; height: auto; }

/* --- Paper grain ---------------------------------------------------------- */
/* Two fractal-noise layers in multiply: a fine tooth and a slow mottle. Fixed
   attachment so the page scrolls over the paper rather than dragging it. */

body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  mix-blend-mode: multiply;
  background-attachment: fixed;
}

body::before {
  opacity: 0.42;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

body::after {
  opacity: 0.22;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.30  0 0 0 0 0.24  0 0 0 0 0.16  0 0 0 0.30 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* --- Type rungs ----------------------------------------------------------- */
/* Display tracking of -0.01em applies at 44px and up, where it does something.
   It is NOT applied to the wordmark: §09.1 fixes that at +40 (+0.04em), and a
   blanket display rule silently inverts it. */

.hero__h1 {
  font-family: var(--display);
  font-weight: 300;                /* Display L. Heroes are Light at every tier. */
  font-size: 64px; line-height: 72px;
  letter-spacing: -0.01em;
}
.hero__h1 em { font-weight: 400; font-style: italic; }

.block__head {
  font-family: var(--display);
  font-weight: 400;                /* Display M. Section titles are Regular. */
  font-size: 44px; line-height: 52px;
  letter-spacing: -0.01em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--nav-h) + 32px);
}

.step__title {
  font-family: var(--display);
  font-weight: 500; font-size: 24px; line-height: 32px;   /* Title */
  text-wrap: balance;
}

.body-l { font-size: 19px; line-height: 28px; max-width: var(--measure-body-l); text-wrap: pretty; }
.body   { font-size: 16px; line-height: 26px; max-width: var(--measure-body);   text-wrap: pretty; }

.label {
  font-family: var(--body);
  font-weight: 500; font-size: 11px; line-height: 14px;
  text-transform: uppercase; letter-spacing: 0.22em;
}

/* --- Navigation ----------------------------------------------------------- */
/* §09.6 rules out tinted bands and §05 rules out shadows and grey lines, so the
   only device available for separating a sticky header is rule weight: 1px
   here against the sections' 0.5px. Both inside §05's 0.5–1px range. */

.nav {
  position: sticky; top: 0; z-index: 10;
  height: var(--nav-h);
  padding: 0 max(var(--margin), calc((100% - var(--content-max)) / 2));
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.nav__mark {
  font-family: var(--display);
  font-weight: 300;
  font-size: 32px; line-height: 40px;
  letter-spacing: 0.04em;          /* §09.1 — the wordmark is +40, always */
  color: var(--ink); text-decoration: none;
  /* The line box is what flex centres. Newsreader keeps 8px of em under the
     baseline and "Firn" draws none of it, so the letters sit 3.5px above the
     bar's midpoint and above Begin. Shift the glyphs, not the line box.
     Measured 22 Nov 2026 at 1440 (32/40) and overridden below 640. */
  position: relative;
  top: 3.5px;
}

.nav__links { display: flex; gap: 40px; align-items: center; }

.nav__link {
  font-family: var(--body);
  font-weight: 500; font-size: 11px; line-height: 14px;
  text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--ink); text-decoration: none;
  white-space: nowrap;
  /* 44px target. The extra 6px of padding is on top so the label's baseline
     meets the shifted wordmark; the box stays centred. */
  display: inline-block; padding: 21px 0 9px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat; background-origin: content-box;
  background-size: 100% 0.5px;
  background-position: 0 calc(100% + 3px);
}
.nav__link:hover { background-size: 100% 1px; }
.nav__link:active { color: rgba(26, 25, 22, 0.6); }

/* --- Page shell ----------------------------------------------------------- */

.page {
  position: relative; z-index: 1;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 88px var(--margin) 96px;
  display: flex; flex-direction: column;
  gap: var(--block-gap);
}
@media (max-width: 1023px) { .page { padding: 72px var(--margin) 64px; } }
@media (max-width: 639px)  { .page { padding: 48px var(--margin) 48px; } }

/* --content-max is the INNER column width; .page's max-width is a border box, so
   each tier caps the box at content + both margins. Below 640 the page simply
   fills the viewport and the margins do the work. */
@media (min-width: 1024px) { .page { max-width: calc(1248px + 2 * 96px); } }
@media (min-width: 640px) and (max-width: 1023px) { .page { max-width: calc(672px + 2 * 48px); } }
@media (max-width: 639px) { .page { max-width: none; } }

/* --- Hero ----------------------------------------------------------------- */
/* Statement at columns 1–7, plate at 8–12. The plate is 4:5 and overhangs the
   statement column by ~70px, which is intended. */

.hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.hero__statement { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: 48px; align-items: flex-start; }
.hero__below { display: flex; flex-direction: column; gap: 40px; align-items: flex-start; }
.hero__copy  { display: flex; flex-direction: column; gap: 24px; }

.plate { grid-column: 8 / span 5; margin-top: 7px; display: flex; flex-direction: column; gap: 16px; }
/* 7px: the measured distance from the h1's box top to its cap-line at 64/72,
   so the plate's top rule aligns optically with "The" rather than with its box. */

.plate__frame { position: relative; aspect-ratio: 4 / 5; border: 1px solid var(--ink); background: var(--paper-hi); overflow: hidden; }
.plate__frame img { height: 100%; object-fit: cover; }

/* §07 registration marks, diagonally opposed. They are drawn on the paper
   OUTSIDE the frame rule, not inside it: inside, a photograph erases them. */
.plate__tick { position: absolute; width: 10px; height: 10px; }
.plate__tick::before, .plate__tick::after { content: ""; position: absolute; background: var(--ochre); }
.plate__tick::before { width: 10px; height: 1px; }
.plate__tick::after  { width: 1px;  height: 10px; }
.plate__tick--tl { top: -1px; left: -1px; }
.plate__tick--tl::before, .plate__tick--tl::after { top: 0; left: 0; }
.plate__tick--br { bottom: -1px; right: -1px; }
.plate__tick--br::before { bottom: 0; right: 0; }
.plate__tick--br::after  { bottom: 0; right: 0; }

.plate__caption {
  font-family: var(--body); font-style: italic; font-weight: 400;
  font-size: 12px; line-height: 18px;        /* Caption rung */
  color: var(--slate); max-width: 420px; text-wrap: pretty;
}

/* --- Sections ------------------------------------------------------------- */
/* The heading hangs at columns 1–3 and the body sets at 4–9, so the block's
   centre of mass lands on the frame's centre. The rule runs the full width. */

.block { display: flex; flex-direction: column; gap: var(--head-gap); }
.rule  { height: 0.5px; background: var(--ink); border: 0; margin: 0; width: 100%; }

.block__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.block__head { grid-column: 1 / span 3; }
.block__body { grid-column: 4 / span 6; display: flex; flex-direction: column; gap: var(--body-gap); align-items: flex-start; }

.stack-32 { display: flex; flex-direction: column; gap: 32px; }
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }

/* --- Steps ---------------------------------------------------------------- */

.steps { display: flex; flex-direction: column; gap: 56px; width: 100%; }
.step  { display: grid; grid-template-columns: var(--step-track) minmax(0, 1fr); align-items: start; }

.step__n {
  font-family: var(--display); font-weight: 500;
  font-size: 24px; line-height: 32px;
  color: var(--slate);              /* ochre fails at 2.56:1; slate is 6.13:1 */
  font-variant-numeric: tabular-nums;
}
.step__text { display: flex; flex-direction: column; gap: 16px; }

/* --- Action --------------------------------------------------------------- */

.action {
  font-family: var(--display); font-weight: 500;
  font-size: 24px; line-height: 32px;
  color: var(--ink); text-decoration: none;
  display: inline-block; padding: 12px 0;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat; background-origin: content-box;
  background-size: 100% 0.5px; background-position: 0 calc(100% + 4px);
}
.action:hover { background-size: 100% 1px; }

/* --- Footer --------------------------------------------------------------- */

.foot { display: flex; flex-direction: column; gap: 24px; }
.foot__row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.foot__mark { font-family: var(--display); font-weight: 300; font-size: 32px; line-height: 40px; letter-spacing: 0.04em; }
.foot__links { display: flex; gap: 16px; font-family: var(--body); font-weight: 500; font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--slate); }
.foot__links a { color: var(--slate); text-decoration: none; }
.foot__links a:hover { color: var(--ink); }

/* --- Focus ---------------------------------------------------------------- */
/* Ink, not ochre: an ochre ring is 2.56:1 and fails the 3:1 non-text floor. */

a:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px;
  font-family: var(--body); font-size: 14px;
}
.skip:focus {
  left: var(--margin); top: 8px; z-index: 20;
  background: var(--paper); color: var(--ink);
  padding: 8px 12px; border: 1px solid var(--ink);
}

/* --- Tablet: 640–1023 ----------------------------------------------------- */

@media (max-width: 1023px) {
  .hero { display: flex; flex-direction: column; gap: 48px; align-items: flex-start; }
  .plate { margin-top: 0; width: 441px; max-width: 100%; order: 2; }
  .plate__frame { aspect-ratio: 3 / 2; }
  .hero__statement { gap: 48px; }

  /* The statement, plate, copy and action stack in document order; the plate is
     pulled between the h1 and the deck so the image follows the statement. */
  .hero__statement { order: 1; display: contents; }
  .hero__h1 { order: 1; }
  .hero__below { order: 3; }

  .block__grid { display: flex; flex-direction: column; gap: var(--body-gap); align-items: flex-start; }
  .block__body { width: 100%; }
}

/* --- Phone: below 640 ----------------------------------------------------- */

@media (max-width: 639px) {
  /* Size steps down, weight does not: Display M's size at Display L's weight. */
  .hero__h1    { font-size: 44px; line-height: 52px; }
  .block__head { font-size: 32px; line-height: 40px; }   /* Display S */

  .plate { width: 100%; }
  .hero { gap: 32px; }
  .hero__copy { gap: 20px; }
  .steps { gap: 44px; }
  .step__text { gap: 12px; }
  .step__dash { display: none; }       /* no track to bridge at 44px */
  .br-wide { display: none; }          /* duration line, and "about / for" in the hero, wrap naturally */

  /* Three Label links plus the mark measure 344.7px inside 342px. */
  .nav__link--anchor { display: none; }
  .nav__mark { font-size: 22px; line-height: 30px; top: 3px; }   /* §10F floor */
  .nav__link { padding: 17.5px 0 12.5px; }   /* same 44px box, baseline dropped 2.5px */
  .foot__mark { font-size: 22px; line-height: 30px; }
}

/* --- Motion --------------------------------------------------------------- */
/* This page declares no transitions. The block is here so that anything added
   later inherits §08's reduced-motion rule rather than re-deciding it. */

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

/* --- Legal pages ---------------------------------------------------------- */
/* The landing does not use .prose. Links in the terms and privacy text take
   ink, per the focus rule: ink, not ochre. */

.prose a {
  color: var(--ink);
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
}
.prose a:hover { text-decoration-thickness: 1px; }
