/* =============================================================================
   Orange — Zlaté návyky / Golden Habits
   One stylesheet: tokens · base · type · layout · components · motion states
   Built on Orange brand foundations: #FF7900, Helvetica Neue, the square mark.
   Orange is a spotlight on the journey; the footer plate is its payoff.
   ========================================================================== */

/* ----------------------------------------------------------------- TOKENS -- */
:root {
  /* brand colour */
  --orange:  #FF7900;

  --black:   #000000;
  --ink:     #0D0D0D;
  --line:    #2A2A2A;
  --white:   #FFFFFF;
  --smoke:   #B3B3B3;
  --mute:    #767676;   /* nudged from brand #666 to clear WCAG AA on black */

  /* type — Orange's system: one family, personality from scale/weight/tracking.
     Stack stops at Arial: the metrically safe Helvetica neighbour. */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --fs-display-xl: clamp(3rem, 9vw, 8.5rem);
  --fs-display-l:  clamp(2.4rem, 6vw, 5rem);
  --fs-h-mid:      clamp(1.85rem, 4vw, 3rem);
  --fs-lead:       clamp(1.2rem, 2.1vw, 1.6rem);
  --fs-row:        clamp(1.25rem, 1.75vw, 1.55rem);
  --fs-body:       1.0625rem;
  --fs-label:      0.75rem;

  /* one tracking for every caps microlabel — Helvetica caps blur past ~.16em */
  --track-caps: .14em;

  /* layout */
  --maxw:   1320px;
  --gutter: clamp(20px, 6vw, 120px);
  --pad-y:  clamp(80px, 12vh, 180px);

  /* the square through-line */
  --sq:  min(42vw, 440px);
  --sep: 2px;             /* gap between quadrants; grows on "split" */

  --ease: cubic-bezier(.22,.61,.36,1);
}

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

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

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

::selection { background: var(--orange); color: var(--black); }

/* Lenis smooth-scroll plumbing */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* --------------------------------------------------------- A11Y HELPERS --- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 2000;
  background: var(--orange); color: var(--black);
  padding: .65rem 1rem; font-weight: 700; transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* --------------------------------------------------------------- LAYOUT --- */
.eyebrow {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--smoke);
  display: inline-flex;
  align-items: center;
  gap: .7em;
  font-variant-numeric: tabular-nums;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--orange);
  flex: none;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.4;
  color: var(--smoke);
  max-width: 30ch;
}

/* ================================================================ HEADER == */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
/* solid black, no glass — flat is the brand */
.site-header.is-solid {
  background: var(--black);
  border-bottom-color: var(--line);
}
.site-header__inner {
  position: relative;              /* anchor for the docked mini square */
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(14px, 2.2vh, 24px) var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  transition: padding .4s var(--ease);
}
.site-header.is-solid .site-header__inner { padding-top: 12px; padding-bottom: 12px; }

.brand { display: inline-flex; }
.brand__logo {
  width: clamp(38px, 4vw, 46px); height: auto;
  transition: width .4s var(--ease);
}
.site-header.is-solid .brand__logo { width: 38px; }

/* quadrant nav (desktop) */
.quad-nav { display: none; }
@media (min-width: 1200px) {
  .quad-nav { display: flex; gap: clamp(1.1rem, 2.4vw, 2.6rem); align-items: center; }
  .quad-nav__link {
    position: relative;
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
    color: var(--smoke);
    padding: .55rem 0;
    transition: color .25s var(--ease);
    display: inline-flex; align-items: center; gap: .55em;
  }
  .quad-nav__link::before {
    content: ""; width: 6px; height: 6px; background: var(--orange);
    transform: scale(0); transition: transform .25s var(--ease);
  }
  .quad-nav__link:hover { color: var(--white); }
  .quad-nav__link.is-active { color: var(--orange); }
  .quad-nav__link.is-active::before { transform: scale(1); }
}

/* right cluster: language switch + menu button */
.site-header__end { display: flex; align-items: center; gap: clamp(.4rem, 1.6vw, 1.4rem); }

.lang { display: inline-flex; align-items: center; gap: .55em; }
.lang__btn {
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--mute);
  padding: .55rem .15rem;
  transition: color .25s var(--ease);
}
.lang__btn:hover { color: var(--white); }
.lang__btn.is-active { color: var(--orange); }
.lang__sep { width: 1px; height: 12px; background: var(--line); }

/* touch sizing: below 1200 every header control is a real 44px target.
   Desktop keeps its tighter optical spacing — pointers do not need 44px. */
@media (max-width: 1199.98px) {
  .brand { align-items: center; min-width: 44px; min-height: 44px; }
  .lang { gap: .1em; }
  .lang__btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; padding: 0;
  }
}

/* menu button (mobile) */
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: var(--white);
}
.menu-btn__icon { width: 24px; height: 24px; display: block; }
.menu-btn__icon svg { width: 100%; height: 100%; }
@media (min-width: 1200px) { .menu-btn { display: none; } }

/* mobile nav overlay */
.nav-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: flex; align-items: center;
  padding: var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }
.nav-overlay__list { display: flex; flex-direction: column; gap: clamp(1rem, 4vh, 2rem); }
.nav-overlay__link {
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 700; letter-spacing: -.02em; color: var(--white);
  display: inline-flex; align-items: baseline; gap: .6em;
}
.nav-overlay__link .idx {
  font-size: var(--fs-label); letter-spacing: var(--track-caps); color: var(--mute);
  transform: translateY(-.2em);
}
.nav-overlay__link:active { color: var(--orange); }
.nav-flag {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5px;
  width: 22px; height: 22px; flex: none; align-self: center;
}
.nav-flag span { background: transparent; border: 1.5px solid var(--line); }
.nav-flag span.is-active { background: var(--orange); border-color: var(--orange); }

html.menu-open, html.menu-open body { overflow: hidden; }

/* ===================================================== SQUARE (through-line) */
/* Decorative geometry, NOT the logo. Fixed on desktop only. */
.square-stage {
  position: fixed; inset: 0; z-index: 1;
  display: none;                /* shown ≥1200 */
  align-items: center; justify-content: flex-end;
  padding-right: clamp(40px, 6vw, 120px);
  pointer-events: none;
}
@media (min-width: 1200px) { .square-stage { display: flex; } }

.square {
  position: relative;
  width: var(--sq); height: var(--sq);
  will-change: transform;
}
.quad {
  position: absolute;
  width:  calc((var(--sq) - var(--sep)) / 2);
  height: calc((var(--sq) - var(--sep)) / 2);
  background: var(--orange);
  border: 1.5px solid var(--orange);
  transition: background .55s var(--ease), border-color .55s var(--ease), opacity .55s var(--ease);
}
.quad--tl { top: 0; left: 0; }
.quad--tr { top: 0; right: 0; }
.quad--bl { bottom: 0; left: 0; }
.quad--br { bottom: 0; right: 0; }

/* split state: only the active quarter stays orange, others become outlines */
.square.is-split .quad { background: transparent; border-color: var(--line); }
/* quarters already read keep a ghost of their fill — the mini square doubles
   as a progress figure, which the big desktop stage never needed to be */
.mini-square.is-split .quad.is-seen {
  background: rgba(255,121,0,.30); border-color: rgba(255,121,0,.55);
}
.square.is-split .quad.is-active { background: var(--orange); border-color: var(--orange); }

/* ------------------------------------------ THE DOCKED MINI SQUARE (<1200) */
/* The mobile answer to the fixed stage: the same square, the same states,
   riding in the header so the reader never loses the through-line.
   Centred absolutely so it never collides with the brand or the controls. */
.mini-stage {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;                    /* motion.js reveals it once the hero is past */
  z-index: 0;
}
.mini-square { --sq: 28px; --sep: 1px; will-change: transform, opacity; }
.mini-square .quad { border-width: 1px; }
@media (min-width: 1200px) { .mini-stage { display: none; } }

/* ================================================================== HERO == */
.hero {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--pad-y) + 6vh) var(--gutter) var(--pad-y);
  max-width: var(--maxw); margin: 0 auto;
}
.hero__inner { max-width: 16ch; }
@media (min-width: 1200px) {
  .hero__inner { max-width: none; width: min(48%, 600px); transform: translateY(-6vh); }
}

.hero .eyebrow { margin-bottom: clamp(1.4rem, 3vh, 2.4rem); }

.hero__title {
  font-size: var(--fs-display-xl);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.035em;
}
/* mask for the line-by-line clip reveal; padding gives Slovak accents headroom,
   negative margin keeps the visual position unchanged */
.hero__title .line { display: block; overflow: hidden; padding: .2em 0 .5em; margin: -.2em 0 -.46em; }
.hero__title .line__in { display: block; }
/* golden: one flat plane of brand orange — no gradients, nothing to misalign */
.hero__title .line__in--gold { color: var(--orange); }
/* tighter leading between the two title lines on large screens */
@media (min-width: 1200px) {
  .hero__title { line-height: .76; }
}
.hero__sub { margin-top: clamp(1.6rem, 3.5vh, 2.6rem); max-width: 36ch; }

/* functional scroll cue: a static hairline + preview of what's next, as a link */
.hero__scroll {
  position: absolute; left: var(--gutter); bottom: clamp(20px, 4vh, 40px);
  display: inline-flex; align-items: center; gap: .9rem;
}
.hero__scroll-line {
  width: 34px; height: 1px; background: var(--line);
  transition: background .25s var(--ease);
}
.hero__scroll-label {
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  transition: color .25s var(--ease);
}
@media (max-width: 1199.98px) {
  /* the hero cue is a link, so it needs a finger-sized band; the negative
     offset keeps its optical position on the baseline it already had */
  .hero__scroll { padding-block: 13px; bottom: calc(clamp(20px, 4vh, 40px) - 13px); }
}
.hero__scroll:hover .hero__scroll-line { background: var(--orange); }
.hero__scroll:hover .hero__scroll-label { color: var(--white); }

/* inline hero square — shown on mobile, and on any device in the no-motion
   fallback (where the fixed through-line square is dropped) */
.hero__square { margin-top: clamp(2.4rem, 6vh, 4rem); }
.hero__square .square { --sq: min(62vw, 320px); }
@media (min-width: 1200px) { .hero__square { display: none; } }

/* no-motion fallback (reduced motion, missing library, or a JS error):
   drop the fixed through-line, lean on the inline squares instead */
.no-motion .square-stage { display: none; }
.no-motion .mini-stage { display: none; }
.no-motion .hero__square { display: block; }

/* ============================================================= MANIFESTO == */
.manifesto {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--pad-y) var(--gutter);
}
.manifesto__text {
  font-size: var(--fs-h-mid);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.02em;
  max-width: 22ch;
}
@media (min-width: 1200px) { .manifesto__text { max-width: 16ch; } }
/* split-words reveal (clip-safe rise, no overflow mask so accents never clip) */
.manifesto__text .word { display: inline-block; }
.manifesto__text .word__in { display: inline-block; will-change: transform, opacity; }

/* ============================================================== CHAPTERS == */
.chapters { position: relative; z-index: 2; }

/* horizontal rules belong to the ledger language — chapters carry none */
.chapter {
  position: relative;
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--pad-y) var(--gutter);
}

.chapter__head { margin-bottom: clamp(2.4rem, 6vh, 4rem); }
.chapter__eyebrow { margin-bottom: 1.4rem; }

.chapter__title {
  font-size: var(--fs-display-l);
  font-weight: 700; line-height: .98; letter-spacing: -.03em;
}
.chapter__intro { margin-top: 1.3rem; max-width: 32ch; }

/* mobile / tablet inline quadrant flag (which quarter this area is) */
.quad-flag {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
  width: 40px; height: 40px; margin-bottom: 1.6rem;
}
.quad-flag span { background: transparent; border: 1.5px solid var(--line); }
.quad-flag span.is-active { background: var(--orange); border-color: var(--orange); }
@media (min-width: 1200px) { .quad-flag { display: none; } }

@media (min-width: 1200px) { .chapter__inner { width: min(50%, 560px); } }

/* ============================================== THE MARKS (Sixteen Machines) */
/* Every habit carries a small mechanism drawn in the square's own grid.
   48×48, 2px stroke, butt caps, miter joins, radius 0 everywhere. Colour is
   inherited (currentColor) so a mark is orange on black and black on the
   orange plate without a second stylesheet. See js/marks.js for the system. */
.gh-icon {
  display: block;
  width: 100%; height: 100%;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  stroke-miterlimit: 4;
  overflow: visible;              /* hover overshoots must escape the box */
}
/* Three ink levels, and exactly ONE full-opacity gesture per mark — the
   single restraint that most makes the set read as designed rather than
   downloaded. Tuned for a ~1.7px rendered stroke at 40px on black. */
.gh-icon .ghost { opacity: .42; }
.gh-icon .mid   { opacity: .72; }
.gh-icon .full  { opacity: 1; }
/* the KEY — the one and only fill in the entire set */
.gh-icon .key   { fill: currentColor; stroke: none; }
/* SVG children measure transform-origin from the SVG root, not their own box;
   fill-box fixes that for everything we scale or spin in place */
.gh-icon [data-tr] { transform-box: fill-box; transform-origin: center; }

/* Every mark box is a <span>, and inline boxes ignore width/aspect-ratio —
   which silently renders the SVG at its fallback size. Blockify all of them. */
.hrow__mark, .chapter__mark, .plate__mark, .contact-sheet__cell { display: block; }

/* the mark's box in a ledger row */
.hrow__mark {
  align-self: center;
  width: 44px; height: 44px;
  color: var(--smoke);
  transition: color .3s var(--ease);
  contain: layout paint;          /* bound the repaint region of path draws */
}
@media (max-width: 560px) { .hrow__mark { width: 34px; height: 34px; } }

/* the chapter's parent mark */
.chapter__mark {
  width: clamp(64px, 8vw, 104px); aspect-ratio: 1;
  color: var(--orange);
  margin-bottom: 1.6rem;
}
/* below 1200 the parent mark replaces the inert quad-flag entirely */
@media (min-width: 1200px) { .chapter__mark { margin-bottom: 2rem; } }

/* the mark on the detail plate: black on orange, at reading scale */
.plate__mark {
  width: clamp(88px, 11vw, 132px); aspect-ratio: 1;
  color: var(--black);
  flex: none;
}

/* ------------------------------------------------- THE LEDGER (Register) --- */
/* The brand mark squared: quadrant digit first — 2.3 = top-right, third habit.
   Numbered rows on hairlines; no surface fills, ever — fills collapse this
   back into cards. Rows carry only the point; the detail opens in the plate. */
.ledger {
  list-style: none; padding: 0;
  margin-top: clamp(2.2rem, 5vh, 3.4rem);
}

.hrow { position: relative; }
/* rules are real elements (not borders) so GSAP can draw them */
.hrow__rule {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 1px;
  background: var(--line);
  transform-origin: left center;
}
/* the table's opening rule, Swiss-catalog style */
.hrow:first-child .hrow__rule { background: var(--white); }
/* the orange repaint: drawn left-to-right by hover or the scroll cursor */
.hrow__rule::after {
  content: ""; position: absolute; inset: 0;
  background: var(--orange);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .38s var(--ease);
}

/* the whole row is the control that opens the plate */
.hrow__btn {
  width: 100%;
  display: grid;
  /* v2 drops the per-habit numeral: the mark is the anchor now, not the index */
  grid-template-columns: 44px 1fr auto;
  column-gap: clamp(14px, 1.6vw, 24px);
  align-items: center;
  padding-block: clamp(22px, 3.4vh, 32px);
  text-align: left;
}

.hrow__title {
  font-size: var(--fs-row); font-weight: 700;
  line-height: 1.12; letter-spacing: -.02em;
  color: var(--white);
}
/* the open affordance: a monoline plus that turns × when its plate is open */
.hrow__more {
  align-self: center;
  width: 18px; height: 18px;
  color: var(--mute);
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.hrow__more svg { width: 100%; height: 100%; }

@media (hover: hover) {
  .hrow:hover .hrow__rule::after { transform: scaleX(1); }
  .hrow:hover .hrow__more { color: var(--orange); }
  .hrow:hover .hrow__mark { color: var(--orange); }
}
/* Touch has no hover, so the row would be inert until the plate opens. Give
   the finger the same orange repaint, on press, at half the duration. */
@media (hover: none) {
  .hrow__btn { -webkit-tap-highlight-color: transparent; }
  .hrow:active .hrow__mark { color: var(--orange); }
  .hrow:active .hrow__rule::after { transform: scaleX(1); transition-duration: .2s; }
  .hrow:active .hrow__more { color: var(--orange); }
}
/* keyboard parity: focusing the row lights the mark exactly like hover */
.hrow__btn:focus-visible .hrow__mark { color: var(--orange); }
.hrow.is-open .hrow__rule::after { transform: scaleX(1); }
.hrow.is-open .hrow__more { color: var(--orange); transform: rotate(45deg); }
.hrow.is-open .hrow__mark { color: var(--orange); }

/* ledger foot: closing rule + the page counting itself */
.ledger__foot { position: relative; display: flex; justify-content: flex-end; padding-top: 12px; }
.ledger__count {
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps);
  color: var(--mute); font-variant-numeric: tabular-nums;
}

@media (max-width: 1199.98px) {
  .chapter__inner { max-width: 860px; }
}
@media (max-width: 560px) {
  .hrow__btn { grid-template-columns: 34px 1fr auto; column-gap: 12px; padding-block: 18px 22px; }
}
/* 360–430px: the plus was eating a third of the title measure — pull it in and
   let the title take the width back. Row height stays well over 44px. */
@media (max-width: 430px) {
  .hrow__btn { grid-template-columns: 30px 1fr 16px; column-gap: 10px; padding-block: 20px 22px; }
  .hrow__mark { width: 30px; height: 30px; }
  .hrow__more { width: 16px; height: 16px; }
  .chapter__intro { max-width: 26ch; }
}

/* ------------------------------------------------ RULE DETAIL PLATE ------- */
/* The active quadrant opens into a reading plate: black on solid #FF7900 —
   the one mid-journey inversion, earned by a click. Bottom sheet under 1200. */
html.plate-open, html.plate-open body { overflow: hidden; }

.plate { position: fixed; inset: 0; z-index: 150; }
.plate[hidden] { display: none; }
.plate__scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.plate.is-open .plate__scrim { opacity: 1; }

.plate__card {
  position: absolute;
  background: var(--orange); color: var(--black);
  padding: clamp(30px, 3.2vw, 52px);
  display: flex; flex-direction: column; gap: 1.15rem;
  /* <1200: bottom sheet */
  left: 0; right: 0; bottom: 0;
  max-height: min(82svh, 640px);
  overflow: auto;
  overscroll-behavior: contain;    /* sheet scroll never leaks to the page */
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(clamp(30px, 3.2vw, 52px) + env(safe-area-inset-bottom));
  transform: translateY(103%);
  transition: transform .5s var(--ease);
}
.plate.is-open .plate__card { transform: translateY(0); }
@media (min-width: 1200px) {
  .plate__card {
    left: auto; right: clamp(40px, 6vw, 120px); bottom: auto; top: 50%;
    width: min(600px, 46vw);
    max-height: min(78vh, 680px);
    padding-bottom: clamp(30px, 3.2vw, 52px);
    opacity: 0;
    transform: translateY(-50%) translateY(14px);
    transition: transform .45s var(--ease), opacity .45s var(--ease);
  }
  .plate.is-open .plate__card { opacity: 1; transform: translateY(-50%); }
}
/* when GSAP morphs the card out of the quadrant, CSS stands down.
   The bottom sheet keeps its own resting box (left/right/bottom) so the morph
   can FLIP into it; >=1200 the card's top is set inline by app.js. */
.plate.is-morph .plate__card { transition: none; opacity: 1; transform: none; }
.plate.is-morph .plate__card.is-morphing { overflow: hidden; }

/* everything on the plate is black — the global orange focus/selection vanish */
.plate ::selection { background: var(--black); color: var(--orange); }
.plate :focus-visible { outline-color: var(--black); }

.plate__close {
  position: absolute; top: clamp(14px, 1.4vw, 22px); right: clamp(14px, 1.4vw, 22px);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--black); color: var(--black);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.plate__close:hover { background: var(--black); color: var(--orange); }
.plate__close-icon { width: 16px; height: 16px; }
.plate__close-icon svg { width: 100%; height: 100%; }

/* the plate's head: the habit's own mark, inverted, beside its index */
.plate__head { display: flex; align-items: flex-start; gap: clamp(16px, 2vw, 28px); }
.plate__head-text { display: flex; flex-direction: column; gap: .9rem; min-width: 0; }

.plate__kicker {
  display: inline-flex; align-items: center; gap: .7em;
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.plate__kicker-sep { width: 7px; height: 7px; background: var(--black); flex: none; }
.plate__title {
  font-size: var(--fs-h-mid); font-weight: 700;
  line-height: 1.05; letter-spacing: -.02em;
  padding-right: 52px;               /* clear the close button */
  max-width: 18ch;
}
.plate__body {
  font-size: 1.125rem; line-height: 1.5;
  max-width: 46ch;
}
.plate__foot {
  margin-top: .5rem;
  border-top: 1px solid var(--black); padding-top: 1rem;
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
}

/* graceful message when data/content.json cannot be fetched (file:// etc.) */
.load-error {
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--pad-y) var(--gutter);
  color: var(--smoke); max-width: 60ch;
}

/* =============================================================== CLOSING == */
.closing {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: var(--pad-y) var(--gutter);
}
.closing__square {
  position: relative;                /* the contact sheet's anchor */
  margin-bottom: clamp(2.6rem, 7vh, 5rem);
}
.closing__square .square { --sq: min(64vw, 300px); }

/* ---- the contact sheet: all sixteen marks, then the collapse -------------
   The payoff shot. Every mark the reader has met, laid out 4×4 — the whole
   system visible at once — which then retracts into the closing square.
   Sits behind the square in the same stacking context; motion.js runs the
   handoff (and simply leaves this hidden when motion is off). */
/* Sits ON the closing square rather than above it — so the marks converge
   exactly onto the figure they resolve into, and the sheet costs zero
   layout height on short screens. */
.contact-sheet {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 1.8vw, 22px);
  width: min(80vw, 360px);
  color: var(--orange);
  pointer-events: none;
}
.contact-sheet__cell { aspect-ratio: 1; }
/* no motion ⇒ no collapse ⇒ the sheet would duplicate the closing square */
.no-motion .contact-sheet { display: none; }
.closing__eyebrow { justify-content: center; margin-bottom: clamp(1.6rem, 4vh, 2.4rem); }
.closing__line {
  font-size: var(--fs-display-l);
  font-weight: 700; line-height: 1.0; letter-spacing: -.03em;
  max-width: 16ch;
}
.closing__sub { margin-top: 1.4rem; color: var(--smoke); max-width: none; }

/* ================================================================ FOOTER == */
/* Inverzia: the one and only place the ratio flips — black on solid #FF7900.
   Hard cut against the closing section: no border, no gradient, no hairline. */
.site-footer { background: var(--orange); color: var(--black); }
.site-footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(64px, 10vh, 128px) var(--gutter)
           calc(clamp(28px, 4vh, 44px) + env(safe-area-inset-bottom));
}

/* local inversions — the global orange selection/focus vanishes on orange */
.site-footer ::selection { background: var(--black); color: var(--orange); }
.site-footer :focus-visible { outline-color: var(--black); }

/* row 1 — resolved quadrant mark + tag */
.site-footer__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-mark {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
  width: clamp(44px, 4.5vw, 54px); aspect-ratio: 1;
  transition: gap .25s var(--ease);
}
.footer-mark span { background: var(--black); }
@media (hover: hover) { .footer-mark:hover { gap: 5px; } } /* memory of the split */
.footer-tag {
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .7em;
}
.footer-tag::before { content: ""; width: 7px; height: 7px; background: var(--black); flex: none; }

/* row 2 — title + the one action share a band: title left, CTA bottom-right ≥1200 */
.footer-body {
  margin-top: clamp(2.6rem, 7vh, 5rem);
  display: flex; flex-direction: column; align-items: flex-start;
  gap: clamp(2.2rem, 5vh, 3.6rem);
}
@media (min-width: 1200px) {
  .footer-body {
    flex-direction: row; align-items: flex-end; justify-content: space-between;
    gap: clamp(2rem, 4vw, 4rem);
  }
}

/* the bookend: the hero title, ground inverted, closed by a full stop */
.footer-display {
  font-size: var(--fs-display-xl);
  font-weight: 700; line-height: .92; letter-spacing: -.035em;
  flex: 1 1 auto; min-width: 0;
}
@media (min-width: 1200px) { .footer-display { line-height: .8; } }
/* same accent-safe mask as the hero (ý/á headroom) */
.footer-display .line { display: block; overflow: hidden; padding: .2em 0 .5em; margin: -.2em 0 -.46em; }
.footer-display .line__in { display: block; }
/* the through-line square lands one last time — as punctuation */
.footer-display__dot {
  display: inline-block; width: .13em; height: .13em;
  background: var(--black); margin-left: .08em;
}

/* the one action: underline grows into a black slab, text flips orange */
.footer-cta {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: .85rem;
  flex: 0 0 auto;
}
@media (min-width: 1200px) {
  .footer-cta { align-items: flex-end; text-align: right; }
}
.footer-cta__label {
  font-size: var(--fs-h-mid); font-weight: 700; letter-spacing: -.02em;
  padding: .08em .14em .16em 0;
  background-image: linear-gradient(var(--black), var(--black));
  background-repeat: no-repeat; background-size: 100% 3px; background-position: 0 100%;
  transition: background-size .3s var(--ease), color .3s var(--ease), padding .3s var(--ease);
}
.footer-cta:hover .footer-cta__label,
.footer-cta:focus-visible .footer-cta__label {
  background-size: 100% 100%; color: var(--orange); padding-left: .14em;
}
@media (min-width: 1200px) {
  .footer-cta__label { padding: .08em 0 .16em .14em; background-position: 100% 100%; }
  .footer-cta:hover .footer-cta__label,
  .footer-cta:focus-visible .footer-cta__label {
    padding-left: 0; padding-right: .14em;
  }
}
.footer-cta__mail {
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
}

/* row 4 — hairline meta; pure black, no gray (muted tones look dirty on orange) */
.footer-meta {
  margin-top: clamp(4rem, 9vh, 6.5rem);
  border-top: 1px solid var(--black); padding-top: 1.05rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .55rem 2rem;
  font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.footer-meta a {
  padding: .1em .4em; margin: -.1em -.4em;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.footer-meta a:hover, .footer-meta a:focus-visible { background: var(--black); color: var(--orange); }

/* below 1200 the fixed square never existed — the meta row becomes the page's
   final quadrant figure: a 2×2 with a black hairline cross */
@media (max-width: 1199.98px) {
  .footer-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--black); padding-top: 0;
  }
  .footer-meta > *, .footer-meta > a { background: var(--orange); padding: 1.05rem 1rem 1.15rem 0; margin: 0; }
  .footer-meta > *:nth-child(even) { padding-left: 1rem; }
  .footer-meta a:hover, .footer-meta a:focus-visible { background: var(--black); }
}

/* ============================================================= PRELOADER == */
/* Large centred brand square (not full-bleed) that cracks, then travels into
   the on-screen through-line / hero square via a FLIP handoff. */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  pointer-events: none;
}
.preloader[hidden] { display: none; }
.preloader__square {
  --psq: min(72vmin, 560px);
  --sep: 2px;
  position: relative;
  width: var(--psq);
  height: var(--psq);
  transform-origin: center center;
  will-change: transform, opacity;
}
.pq {
  position: absolute;
  width:  calc((var(--psq) - var(--sep)) / 2);
  height: calc((var(--psq) - var(--sep)) / 2);
  background: var(--orange);
  will-change: transform;
}
.pq--tl { top: 0; left: 0; } .pq--tr { top: 0; right: 0; }
.pq--bl { bottom: 0; left: 0; } .pq--br { bottom: 0; right: 0; }

/* ===================================================== MOBILE (<1200) ====== */
/* One editorial voice at every width: flush left, ragged right — the ledger
   demands a left axis, so hero, manifesto, chapters and footer all share it. */
@media (max-width: 1199.98px) {
  .hero__inner { max-width: none; }

  /* mobile menu: index column gives every label the same start; align-items
     centres the mini-square on the text baseline */
  .nav-overlay__list { counter-reset: navidx; gap: clamp(1.4rem, 5vh, 2.4rem); }
  .nav-overlay__link { align-items: center; gap: .75em; }
  .nav-overlay__link::before {
    counter-increment: navidx;
    content: counter(navidx, decimal-leading-zero);
    min-width: 2ch;
    font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-caps);
    color: var(--mute);
  }
  .nav-flag {
    width: clamp(28px, 7vw, 34px); height: clamp(28px, 7vw, 34px);
    gap: 2px; align-self: center;
  }
}

/* Phones only: the desktop vertical rhythm leaves ~200px of black between
   chapters at 390px wide, which reads as the page having stopped. Tighten it
   so the ledger keeps its momentum; >=768 (tablet, desktop) is untouched. */
@media (max-width: 767.98px) {
  :root {
    --pad-y: clamp(56px, 8vh, 120px);
    --fs-lead: clamp(1.1rem, 4.4vw, 1.35rem);
  }
  .chapter__head { margin-bottom: clamp(1.8rem, 4vh, 2.6rem); }
  .chapter__eyebrow { margin-bottom: 1.1rem; }
  .chapter__title { line-height: 1.02; }
  .chapter__mark { margin-bottom: 1.2rem; }
  .ledger { margin-top: clamp(1.6rem, 4vh, 2.4rem); }
}

/* =================================================== MOTION INITIAL STATES = */
/* Applied only when JS will animate (html.js-motion). Without JS everything
   is visible by default — the page is "finished" with zero motion. */
.js-motion .reveal { opacity: 0; transform: translateY(22px); }
.js-motion .hero__title .line__in { transform: translateY(140%); }
.js-motion .hero__sub,
.js-motion .hero .eyebrow,
.js-motion .hero__scroll { opacity: 0; }
.js-motion .manifesto__text .word__in { opacity: 0; transform: translateY(.55em); }
.js-motion .square-stage { opacity: 0; }
.js-motion .hrow__rule { transform: scaleX(0); }
.js-motion .hrow__title,
.js-motion .hrow__more,
.js-motion .ledger__count { opacity: 0; transform: translateY(14px); }
.js-motion .footer-display .line__in { transform: translateY(120%); }
.js-motion .footer-display__dot { transform: scale(0); }

/* ---- the [data-anim] contract -------------------------------------------
   ONE place declares "starts hidden", ONE place undoes it. An enumerated
   list of class selectors inevitably drifts out of sync with its reduced-
   motion reset, and the failure mode is permanently invisible content — a
   content failure, not a degraded animation. An attribute selector cannot
   drift. Every new animated element in v2 uses this instead. */
.js-motion [data-anim="rise"]  { opacity: 0; transform: translateY(22px); }
.js-motion [data-anim="scale"] { opacity: 0; transform: scale(.94); }
/* marks: pathLength="100" makes dasharray units percentages, so this hides
   every stroke regardless of its real geometry — and it applies before the
   first paint, so a mark is never briefly visible fully drawn. */
.js-motion [data-anim="mark"] .draw { stroke-dasharray: 100; stroke-dashoffset: 100; }
.js-motion [data-anim="mark"] .key  { opacity: 0; }
/* Once a mark has finished drawing, motion.js adds .is-drawn and clears the
   inline dash props. Without this rule the CSS above would immediately
   re-hide the mark the moment those inline values are released. */
.js-motion [data-anim="mark"].is-drawn .draw {
  stroke-dasharray: none; stroke-dashoffset: 0;
}

/* =================================================== REDUCED MOTION ======== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; scroll-behavior: auto !important; }
  /* ensure nothing is left hidden by motion classes */
  .js-motion .reveal,
  .js-motion .hero__sub, .js-motion .hero .eyebrow, .js-motion .hero__scroll,
  .js-motion .hrow__title,
  .js-motion .hrow__more, .js-motion .ledger__count { opacity: 1; transform: none; }
  .js-motion .hero__title .line__in,
  .js-motion .manifesto__text .word__in,
  .js-motion .footer-display .line__in { transform: none; opacity: 1; }
  .js-motion .hrow__rule { transform: scaleX(1); }
  .js-motion .footer-display__dot { transform: scale(1); }
  .js-motion .square-stage { opacity: 1; }
  /* the docked mini square is scroll-driven decoration only — with no scroll
     choreography it would sit there meaning nothing, so it stays away */
  .mini-stage { display: none; }

  /* the other half of the [data-anim] contract — unconditional, so nothing
     can ever be left hidden by a motion state we forgot to reset */
  .js-motion [data-anim] { opacity: 1 !important; transform: none !important; }
  .js-motion [data-anim="mark"] .draw {
    stroke-dashoffset: 0 !important; stroke-dasharray: none !important;
  }
  .js-motion [data-anim="mark"] .key { opacity: 1 !important; }
}
