/* site.css — the whole look of the site, shared by every page.
   ==========================================================================
   The colours and component geometry are the app's, copied from
   waslet-mobile/docs/design-system.md and nothing else. The proportions —
   type scale, spacing, column splits — are one golden-ratio system, defined
   once in :root below. Nothing further down uses a raw pixel size for type,
   spacing or layout: it names a token. If something needs a value the scale
   doesn't have, that's a design question, not a one-off number.

   Colour is a signal, not decoration (design-system §1, §2c–2e):
     lime   money, and the page's one primary action (download)
     peach  a person is holding it, or a clock is running
     seal   blue — a government document was read by Waslet. Verification only.
     rust   a step still owed, that the reader is invited to take. Never "no".
     signal the one red. A refusal.
   No #000 anywhere; the darkest value is --deep. No shadows between surfaces:
   elevation is lightness and a hairline.

   There are no inline styles in the markup, so the CSP can forbid them.
   ========================================================================== */

:root {
  /* surfaces */
  --canvas: #E7E1D1;
  --page: #F0EADA;            /* Bonelight */
  --card: #FFFFFF;
  --bone-card: #FDFBF5;
  --sunken: rgba(20, 55, 49, .06);
  --pine: #143731;            /* the raised step — the button */
  --deep: #08201B;            /* Deep Field */
  --grape: #2B2137;           /* editorial ground — never a card */
  --grape-up: #433455;
  --purple: #432371;          /* the mark's dot on light grounds */

  /* ink */
  --heading: #143731;
  --ink: #1B1110;
  --body: rgba(27, 17, 16, .75);
  --muted: rgba(27, 17, 16, .55);
  --label: rgba(27, 17, 16, .52);
  --bone: #F0EADA;
  --on-dark: rgba(240, 234, 218, .85);
  --on-dark-muted: rgba(240, 234, 218, .60);
  --on-dark-rail: rgba(240, 234, 218, .26);
  --on-grape: rgba(244, 240, 228, .72);
  --on-grape-strong: #F4F0E4;
  --on-grape-muted: rgba(244, 240, 228, .58);
  --on-grape-rail: rgba(244, 240, 228, .26);

  /* lines */
  --hairline: rgba(20, 55, 49, .14);
  --field: rgba(20, 55, 49, .18);
  --strong: rgba(20, 55, 49, .25);

  /* meaning */
  --lime: #CEFF8C;
  --lime-hover: #DDFFA6;
  --lime-ink: #0F2A16;
  --peach: #FAAE7B;
  --seal: #05334A;
  --seal-label: #EAF3F7;
  --seal-tick: #7FC4E4;
  --rust: #8A3F0B;
  --rust-ink: #7A3708;
  --rust-tint: #FBECDD;
  --rust-deep: #5E2A06;
  --signal: #A81E44;

  /* component geometry — the app's, not the golden ratio's (§3). A control
     is 54–56 tall, so it is 55, which is also on the spacing scale below. */
  --r-card: 12px;
  --r-control: 9px;
  --r-chip: 20px;
  --control: 55px;
  --tap: 44px;                /* the smallest thing a finger has to hit */

  /* type families (§4) */
  --f-ar: 'Cairo';
  --f-display: 'Bricolage Grotesque', var(--f-ar), system-ui, sans-serif;
  --f-body: 'Instrument Sans', var(--f-ar), system-ui, sans-serif;
  --f-mono: 'Martian Mono', var(--f-ar), ui-monospace, monospace;

  /* ------------------------------------------------ the golden ratio ----
     φ = 1.618. Every proportion on the site is a power of it.

     SPACING is the Fibonacci run, where each step is the last × φ:
       5 · 8 · 13 · 21 · 34 · 55 · 89 · 144

     LAYOUT splits a primary and a secondary column 1 : φ (61.8% / 38.2%).
     Siblings of equal weight (the four steps, the two reasons, the proof
     cards) stay equal — φ is for things that aren't.

     The page is 1200 wide; a reading block is 1200 / φ = 742 wide.
     The header is one tap target × φ = 71 tall. */
  --phi: 1.618;
  --s1: 5px;
  --s2: 8px;
  --s3: 13px;
  --s4: 21px;
  --s5: 34px;
  --s6: 55px;
  --s7: 89px;
  --s8: 144px;

  --shell: 1200px;
  --measure-wide: calc(var(--shell) / var(--phi));     /* 742 */
  --header-h: calc(var(--tap) * var(--phi));           /* 71 */
  --split: minmax(0, 1.618fr) minmax(0, 1fr);          /* primary : secondary */
  --split-rev: minmax(0, 1fr) minmax(0, 1.618fr);

  /* Fluid rhythm: phone value → desktop value, one Fibonacci step apart or
     more, reaching the desktop value at 1440px. */
  --gutter: clamp(var(--s4), 4.2vw, var(--s6));        /* 21 → 55 */
  --band: clamp(var(--s6), 10vw, var(--s8));           /* 55 → 144 */
  --col-gap: clamp(var(--s5), 6.2vw, var(--s7));       /* 34 → 89 */
  --head-gap: clamp(var(--s5), 3.82vw, var(--s6));     /* 34 → 55 */
  --gap: clamp(var(--s3), 1.5vw, var(--s4));           /* 13 → 21 */
  --pad-card: clamp(var(--s4), 2.4vw, var(--s5));      /* 21 → 34 */

  --k: 1;
}

/* TYPE is a modular scale in steps of √φ (1.272), so every second step is
   exactly φ. Body text is --t0: 16px on a phone, 17px on a desktop.

     --t-1  --t0  --t1   --t2   --t3  --t4   --t5   --t6  --t7   --t8   --t11
      13.4   17   21.6   27.5   35    44.5   56.6   72    91.6   116.5  240   (desktop)

   Headings are fluid between a phone step and a desktop step. A phone gets a
   compressed scale — h1 and h2 are √φ apart instead of φ — because the full
   golden scale at 16px would put a 92px headline on a 390px screen.

   Arabic sets a step larger than Latin throughout (§4): --k is φ^⅛ on any
   element whose lang is Arabic, and the whole scale is recomputed there, so
   an Arabic block inside an English page (the 404) scales on its own. */
[lang|="ar"] { --k: 1.062; }
[lang|="en"] { --k: 1; }
:root, [lang] {
  --t0: calc(clamp(16px, 15.63px + .095vw, 17px) * var(--k));
  --t-1: calc(var(--t0) / 1.272);
  /* Eighth-steps (φ^⅛ = 1.062) for interface chrome that must sit just under
     its neighbour: nav links under body, a counter under a label. */
  --t0s: calc(var(--t0) / 1.062);
  --t-1s: max(12px, calc(var(--t-1) / 1.062));   /* never under 12px on a phone */
  --t1: calc(var(--t0) * 1.272);
  --t2: calc(var(--t0) * 1.618);
  --t3: calc(var(--t0) * 2.058);
  --t4: calc(var(--t0) * 2.618);
  --t5: calc(var(--t0) * 3.330);
  --t7: calc(var(--t0) * 5.388);
  --t8: calc(var(--t0) * 6.854);
  --t11: calc(var(--t0) * 14.09);

  --h1: clamp(var(--t4), calc((23.4px + 4.73vw) * var(--k)), var(--t7));    /* 42 → 92 */
  --h2: clamp(var(--t3), calc((24.1px + 2.26vw) * var(--k)), var(--t5));    /* 33 → 57 */
  --h-article: clamp(var(--t2), calc((19px + 1.77vw) * var(--k)), var(--t4)); /* 26 → 44.5 */
  --h3: var(--t1);                                                           /* 20 → 21.6 */
  --figure: clamp(var(--t8), calc((61.3px + 12.4vw) * var(--k)), var(--t11)); /* 110 → 240 */
}

/* ---------------------------------------------------------------- base -- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--s3));
  -webkit-tap-highlight-color: rgba(20, 55, 49, .12);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t0);
  line-height: var(--phi);    /* body leading is φ */
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* Arabic's taller letterforms need more than φ between lines. */
:lang(ar) body, body:lang(ar) { line-height: 1.8; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--pine);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible, .on-grape :focus-visible { outline-color: var(--bone); }
/* Headings take focus on navigation so a screen reader lands on them; that is
   not a control, so it gets no ring. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

[id] { scroll-margin-top: calc(var(--header-h) + var(--s3)); }

.skip {
  position: absolute; inset-inline-start: var(--s3); top: -100px; z-index: 100;
  background: var(--pine); color: var(--bone); padding: var(--s3) var(--s4); border-radius: var(--r-control);
  font-weight: 600;
}
.skip:focus { top: var(--s3); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* A Latin island inside Arabic: figures, codes, the lockup, emails (brief §8).
   Isolated so an Arabic run can never reorder the digits. */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.shell {
  width: 100%;
  max-width: calc(var(--shell) + 2 * var(--gutter));
  margin-inline: auto;
  /* Physical, not logical, on purpose: the safe areas are the notch and the
     rounded corners of a landscape phone, which are left and right whatever
     the reading direction. */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ---------------------------------------------------------------- type -- */

.display {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--heading);
  text-wrap: balance;
}
.display:lang(ar) { letter-spacing: normal; line-height: 1.3; font-weight: 700; }

.h1 { font-size: var(--h1); }
.h2 { font-size: var(--h2); }
.h3 { font-size: var(--h3); line-height: 1.2; letter-spacing: -0.02em; }
.h3:lang(ar) { letter-spacing: normal; line-height: 1.45; }

.kicker {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: var(--t-1);
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--label);
}
/* Arabic never tracks (§4), and has no mono face: set the whole run in Cairo,
   or the Latin mono's wide space falls between every Arabic word. */
.kicker:lang(ar) { font-family: var(--f-ar), sans-serif; font-size: var(--t0s); letter-spacing: 0; font-weight: 600; text-transform: none; }

.lede {
  font-size: var(--t1);
  line-height: 1.5;
  color: var(--body);
  max-width: var(--measure-wide);
  text-wrap: pretty;
}
.lede:lang(ar) { line-height: 1.8; }

.body { color: var(--body); text-wrap: pretty; }
.small { font-size: var(--t-1); }

.on-dark { color: var(--bone); }
.on-dark .display { color: var(--bone); }
.on-dark .lede, .on-dark .body { color: var(--on-dark); }
.on-dark .kicker { color: var(--on-dark-muted); }

.on-grape { color: var(--on-grape-strong); }
.on-grape .display { color: var(--on-grape-strong); }
.on-grape .lede, .on-grape .body { color: var(--on-grape); }
.on-grape .kicker { color: var(--on-grape-muted); }

.section-head { display: grid; gap: var(--s4); max-width: var(--measure-wide); margin-bottom: var(--head-gap); }
.section-head .kicker { margin-bottom: calc(var(--s2) - var(--s4)); } /* kicker sits 8 above its heading */

/* ------------------------------------------------------------- bands ---- */

.band { padding-block: var(--band); }
.band--page { background: var(--page); }
.band--canvas { background: var(--canvas); }
.band--deep { background: var(--deep); }
.band--pine { background: var(--pine); }
.band--grape { background: var(--grape); }
.band + .band--page, .band--page + .band--page { border-top: 1px solid var(--hairline); }

/* ----------------------------------------------------------- controls --- */

/* The button is Pine (§1), one control tall. One primary action per screen;
   the escape hatch is a text button, never a second filled one (§10.7). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--control); padding: 0 var(--s5);
  border-radius: var(--r-control);
  background: var(--pine); color: var(--bone);
  font-weight: 600; font-size: var(--t0); line-height: 1.2;
  transition: background-color .18s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--deep); }
/* A text button still has a finger-sized target; only the ink is small. */
.btn--text {
  min-height: var(--tap); padding-inline: var(--s1);
  background: none; color: var(--heading);
  text-decoration: underline; text-decoration-color: var(--strong); text-underline-offset: 4px;
  white-space: normal;
}
.btn--text:hover { background: none; text-decoration-color: currentColor; }
.on-dark .btn--text, .on-grape .btn--text { color: var(--bone); text-decoration-color: var(--on-dark-rail); }
/* A link inside a sentence stays inline; vertical padding widens what a
   finger can hit without moving a single line of the paragraph. */
p > a:not(.btn), .prose a { padding-block: .45em; }
p > a.btn--text { display: inline; padding-block: .75em; }

/* The store buttons are the page's primary action, so they are the lime one
   (brief §5.3: lime is money or the primary action — never an accent). */
.stores { display: flex; flex-wrap: wrap; gap: var(--s3); }
.store {
  display: inline-flex; align-items: center; gap: var(--s3);
  min-height: var(--control); padding: var(--s2) var(--s5) var(--s2) var(--s4);
  border-radius: var(--r-control);
  background: var(--lime); color: var(--lime-ink);
  transition: background-color .18s ease;
  direction: ltr; /* the store names are Latin marks; the label keeps its own script */
}
.store:hover { background: var(--lime-hover); }
.store svg { width: var(--s4); height: var(--s4); flex: none; fill: currentColor; }
.store span { display: grid; line-height: 1.15; text-align: start; }
.store small { font-size: var(--t-1s); font-weight: 500; opacity: .78; }
.store b { font-family: var(--f-display); font-size: var(--t1); font-weight: 700; letter-spacing: -0.01em; }
.store b:lang(ar) { letter-spacing: normal; }

/* The phone's own store leads (lang.js sets data-platform on <html>). The
   other stays one tap away, outlined, so a shared link still works for a
   friend on the other platform. A .stores--solo row shows the phone's store
   alone, full width; with no platform known it shows both. */
[data-platform="android"] .stores > [data-link="android"] { order: -1; }
[data-platform="ios"] .on-dark .store[data-link="android"],
[data-platform="android"] .on-dark .store[data-link="ios"] {
  background: none; color: var(--bone); box-shadow: inset 0 0 0 1px var(--on-dark-rail);
}
[data-platform="ios"] .on-dark .store[data-link="android"]:hover,
[data-platform="android"] .on-dark .store[data-link="ios"]:hover { background: rgba(240, 234, 218, .06); }
[data-platform="ios"] .stores--solo [data-link="android"],
[data-platform="android"] .stores--solo [data-link="ios"] { display: none; }
.stores--solo { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s2); }
.stores--solo .store { justify-content: center; padding-inline: var(--s4); }

/* ------------------------------------------------------------ ribbon ---- */

/* Phones only, and only with JavaScript: the download pinned to the bottom
   edge while no other store button is on screen. One header tall (71). */
.ribbon { display: none; }
.ribbon .shell {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  min-height: var(--header-h); padding-block: var(--s2);
}
.ribbon-label { font-weight: 600; font-size: var(--t0s); line-height: 1.3; color: var(--bone); }
.ribbon .stores--solo { flex: none; }
.ribbon .store { min-height: var(--tap); gap: var(--s2); }
.ribbon .store svg { width: var(--s4); height: var(--s4); }
.ribbon .store b { font-size: var(--t0); }
html:not([data-platform]) .ribbon-label { display: none; }
html:not([data-platform]) .ribbon .stores--solo { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: var(--s5); padding: var(--s1) var(--s3);
  border-radius: var(--r-chip);
  border: 1px solid var(--field);
  background: var(--card);
  font-size: var(--t-1); line-height: 1.3; color: var(--ink);
}

/* The verification chip — the only blue on the site (§2d). */
.seal-chip, .owed-chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: var(--s5); padding: var(--s1) var(--s3);
  border-radius: var(--r-chip);
  font-family: var(--f-mono); font-size: var(--t-1s); font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
}
.seal-chip { background: var(--seal); color: var(--seal-label); padding-inline-start: var(--s2); }
.seal-chip svg { width: var(--s4); height: var(--s4); stroke: var(--seal-tick); fill: none; stroke-width: 2; }
/* A step still owed (§2e): rust tint, rust ink. Never a refusal. */
.owed-chip { background: var(--rust-tint); color: var(--rust-ink); }
.owed-chip::before { content: ""; width: var(--s2); height: var(--s2); border-radius: 50%; background: var(--rust); }
.seal-chip:lang(ar), .owed-chip:lang(ar) { font-family: var(--f-ar), sans-serif; letter-spacing: 0; font-size: var(--t-1); text-transform: none; }

/* --------------------------------------------------------------- mark --- */

.mark-inline { width: 26px; height: 26px; flex: none; }   /* the app's inline size (§7) */
/* Arabic mirrors the mark (RTL.md §3, WasletMark in the app): it turns to
   face its word, the tail still leading in. The lockup stays an ltr Latin
   island, so the mark leads WASLET and follows وصلت. Icons don't mirror —
   only marks of direction do (the list chevron, the loader). */
[dir="rtl"] .mark-inline, [dir="rtl"] .boot svg, [dir="rtl"] .mark-big { transform: scaleX(-1); }
[dir="rtl"] .brand { flex-direction: row-reverse; }
.mark-inline path { stroke: var(--heading); }
.mark-inline circle { fill: var(--purple); }       /* Bonelight alt (§7) */
.on-dark .mark-inline path { stroke: var(--bone); }
.on-dark .mark-inline circle { fill: var(--lime); } /* Primary, on deep */

.wordmark {
  font-family: var(--f-display); font-weight: 800; font-size: var(--t1);
  letter-spacing: -0.03em; color: var(--heading); line-height: 1;
}
.wordmark:lang(ar) { letter-spacing: normal; font-weight: 700; }
.on-dark .wordmark { color: var(--bone); }

/* ------------------------------------------------------------- header --- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: rgba(240, 234, 218, .9);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--hairline);
}
.site-header .shell {
  display: flex; align-items: center; gap: clamp(var(--s3), 2.4vw, var(--s5));
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); direction: ltr; flex: none; }
.nav { display: flex; gap: clamp(var(--s3), 2.37vw, var(--s5)); margin-inline-start: auto; }   /* 13 → 34 at 1440 */
.nav a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  font-size: var(--t0s); font-weight: 500; color: var(--body); white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--heading); }
.header-actions { display: flex; align-items: center; gap: var(--s3); flex: none; }
.header-actions .btn { min-height: var(--tap); padding-inline: var(--s4); font-size: var(--t0s); }

.lang {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: var(--r-control); background: var(--sunken);
}
.lang a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--s5); min-height: var(--s5); padding: 0 var(--s2); border-radius: calc(var(--r-control) - 3px);   /* concentric with the track */
  font-weight: 600; font-size: var(--t-1); color: var(--body);
}
.lang a[lang="ar"] { font-family: var(--f-ar), sans-serif; font-size: var(--t0); }
.lang a[aria-current="true"] { background: var(--card); color: var(--heading); box-shadow: inset 0 0 0 1px var(--hairline); }
/* Finger-sized where the pointer is a finger (brief §6 header). */
@media (pointer: coarse) { .lang a { min-width: var(--tap); min-height: var(--tap); } }

.menu-btn {
  display: none; width: var(--tap); height: var(--tap); border-radius: var(--r-control);
  align-items: center; justify-content: center; margin-inline-start: auto;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: var(--s4); height: 2px; border-radius: 2px; background: var(--heading);
  transition: transform .2s ease, opacity .2s ease; position: relative;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; inset-inline-start: 0; }
.menu-btn span::before { top: -7px; }
.menu-btn span::after { top: 7px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

.drawer { display: none; border-top: 1px solid var(--hairline); max-height: calc(100svh - var(--header-h)); overflow-y: auto; }
.drawer nav { display: grid; padding-block: var(--s2) var(--s4); }
.drawer a:not(.btn):not(.store) {
  display: flex; align-items: center; min-height: var(--control);
  font-size: var(--t1); font-weight: 500; color: var(--heading);
  border-bottom: 1px solid var(--hairline);
}
/* The drawer's nav is a .shell for its gutters, but a list, not the header row. */
.site-header .drawer .shell { display: grid; gap: 0; min-height: 0; }
.drawer .drawer-foot { display: grid; gap: var(--s3); padding-top: var(--s4); }
.drawer-foot .btn { width: 100%; }

/* ------------------------------------------------------------ hero ------ */

.hero { padding-block: var(--band); overflow: hidden; }
.hero .shell {
  display: grid; grid-template-columns: var(--split);   /* words 61.8% : animated mark 38.2% */
  gap: var(--col-gap); align-items: center;
}
.hero .kicker { margin-bottom: var(--s3); }
/* A hero with words only (route pages): the whole width, a longer headline. */
.hero--text .shell { grid-template-columns: minmax(0, 1fr); }
.hero.hero--text h1, .hero.hero--text h1:lang(ar) { max-width: 20ch; }
.hero h1 { max-width: 12ch; }
.hero h1:lang(ar) { max-width: 14ch; }
.hero .lede { margin-top: var(--s4); max-width: 30em; }
.hero .stores { margin-top: var(--s5); }
.hero-note { margin-top: var(--s4); }
.hero .btn--text { margin-top: var(--s3); }
.boot { width: 100%; margin-inline: auto; }
.boot svg { width: 100%; height: auto; overflow: visible; }
/* The drawing's own geometry stays ltr; Arabic mirrors it whole (below). */
.boot, .boot svg { direction: ltr; }

/* The boot gesture (§8): the dot rides the drawing head along the hook,
   lands at the elbow as the curve completes, the straight run draws out from
   under it, and a lime rule as wide as the mark rises and extends. 2.7s, one
   aligned gesture. Without JavaScript, or with reduced motion, the finished
   frame is what renders — the animation only ever starts from `.play`. */
.boot .hook, .boot .run { stroke: var(--bone); }
.boot .dot { fill: var(--lime); }
.boot .rule { fill: var(--lime); transform-box: fill-box; transform-origin: center; }
.boot.play .hook { stroke-dasharray: 1; animation: draw 1.15s cubic-bezier(.45, 0, .4, 1) both; }
.boot.play .run { stroke-dasharray: 1; animation: draw .7s cubic-bezier(.3, .7, .2, 1) 1.1s both; }
.boot.play .rule { animation: rule-rise .45s cubic-bezier(.2, .9, .3, 1) 1.45s both, rule-extend 1.05s cubic-bezier(.3, .7, .2, 1) 1.65s both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes rule-rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes rule-extend { from { scale: .04 1; } to { scale: 1 1; } }

/* ------------------------------------------------------------ steps ----- */

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); position: relative; }
/* The node is 34 across; the card starts 13 below it. */
.step { position: relative; display: grid; align-content: start; padding-top: calc(var(--s5) + var(--s3)); }
/* The rail is the mark's straight arm, running under every node. */
.step::before {
  content: ""; position: absolute; top: calc(var(--s5) / 2 - 1px); inset-inline: 0 calc(-1 * var(--gap)); height: 2px; background: var(--hairline);
}
.step:last-child::before { inset-inline-end: 0; }
.node {
  position: absolute; top: 0; inset-inline-start: 0;
  width: var(--s5); height: var(--s5); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: var(--t-1s); font-weight: 600;
  background: var(--pine); color: var(--bone);
}
.node:lang(ar) { font-family: var(--f-ar), sans-serif; font-size: var(--t-1); }
/* Colour on a node is what the step is (§1): a person holding it is peach,
   the step where money changes hands is lime. Both are fills, ink on top. */
.node--held { background: var(--peach); color: var(--deep); }
.node--money { background: var(--lime); color: var(--lime-ink); }
.step-card {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: var(--s4); display: grid; gap: var(--s2); align-content: start; height: 100%;
}
.step-card .kicker { color: var(--muted); }
.step-card h3 { margin-bottom: var(--s1); }
.step-card p:not(.kicker) { color: var(--body); }
.steps-foot { margin-top: var(--s5); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; justify-content: space-between; }

/* ------------------------------------------------------------ reasons --- */

.reasons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.reasons--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reason {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: var(--pad-card); display: grid; gap: var(--s3); align-content: start;
}
.reason .ix { font-family: var(--f-mono); font-size: var(--t-1); color: var(--muted); letter-spacing: .1em; }
.categories { margin-top: var(--head-gap); display: grid; gap: var(--s4); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ------------------------------------------------------------- safety --- */

.proofs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.proof {
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: var(--pad-card); display: grid; gap: var(--s3); align-content: start;
}
/* Glyph to tile is 1 : φ (21 in 34). */
.proof .icon {
  width: var(--s5); height: var(--s5); border-radius: var(--r-control); display: grid; place-items: center;
  background: var(--sunken); margin-bottom: var(--s2);
}
.proof .icon svg { width: var(--s4); height: var(--s4); stroke: var(--heading); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.proof .seal-chip { justify-self: start; margin-bottom: var(--s2); }
.plainly {
  margin-top: var(--gap); padding: var(--s4) var(--pad-card); border-radius: var(--r-card);
  background: var(--sunken); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: baseline;
}
.plainly .kicker { color: var(--heading); }
.plainly p { color: var(--body); }

/* ------------------------------------------------------------- carry ---- */

.carry .shell { display: grid; grid-template-columns: var(--split); gap: var(--col-gap); align-items: start; }
.carry .kicker { margin-bottom: var(--s2); }
.carry .lede { margin-top: var(--s4); }
.carry-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--s5); }
.carry-figures div {
  border-top: 1px solid var(--on-grape-rail); padding-top: var(--s3); display: grid; gap: var(--s1);
}
.carry-figures b {
  font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: var(--t3); line-height: 1.05; color: var(--on-grape-strong);
}
.carry-figures b:lang(ar) { letter-spacing: normal; }
.carry-figures div > span { font-size: var(--t-1); color: var(--on-grape-muted); }
.carry-rows { display: grid; border-top: 1px solid var(--on-grape-rail); }
.carry-rows li { display: grid; grid-template-columns: var(--s5) minmax(0, 1fr); gap: var(--s2) var(--s3); padding-block: var(--s4); border-bottom: 1px solid var(--on-grape-rail); }
.carry-rows .n { font-family: var(--f-mono); font-size: var(--t-1); color: var(--on-grape-muted); padding-top: 3px; grid-row: 1 / span 3; }
.carry-rows li > :not(.n) { grid-column: 2; }
.carry-rows .n:lang(ar) { font-family: var(--f-ar), sans-serif; }
.carry-rows h3 { color: var(--on-grape-strong); font-family: var(--f-display); font-weight: 700; font-size: var(--t1); line-height: 1.2; letter-spacing: -0.01em; }
.carry-rows h3:lang(ar) { letter-spacing: normal; line-height: 1.45; }
.carry-rows p { color: var(--on-grape); }
.carry-cta { margin-top: var(--s5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); }
.carry-cta .btn:not(.btn--text) { background: var(--bone); color: var(--grape); }
.carry-cta .btn:not(.btn--text):hover { background: var(--on-grape-strong); }

/* --------------------------------------------------------------- get ---- */

.get { text-align: center; position: relative; overflow: hidden; }
.get .shell { display: grid; justify-items: center; gap: var(--s4); }
.get .mark-big { width: var(--s7); height: auto; margin-bottom: var(--s3); }
.get h2 { max-width: 14ch; }
.get .stores { justify-content: center; margin-top: var(--s3); }
.get .fine { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s4); }

/* ------------------------------------------------------------ footer ---- */

.site-footer { background: var(--deep); color: var(--bone); border-top: 1px solid rgba(240, 234, 218, .08); }
.site-footer .shell { padding-block: var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); }
.footer-legal a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--on-dark-muted); }
.footer-legal a:hover { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.footer-base {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; justify-content: space-between;
  font-size: var(--t-1); color: var(--on-dark-muted);
}

/* ------------------------------------------------------------- reveal --- */

.js [data-reveal] { opacity: 0; translate: 0 var(--s4); transition: opacity .7s cubic-bezier(.2, .7, .3, 1), translate .7s cubic-bezier(.2, .7, .3, 1); }
.js [data-reveal].in { opacity: 1; translate: 0 0; }

/* ====================================================== help centre ===== */

.help-header .shell { gap: var(--s3); }
.help-tag {
  display: inline-flex; align-items: center; min-height: var(--tap);
  padding-inline-start: var(--s3); border-inline-start: 1px solid var(--strong);
}
.help-hero { padding-block: clamp(var(--s5), 6.19vw, var(--s7)) var(--s5); }   /* 34 → 89 at 1440 */
.help-hero h1 { font-size: var(--h2); max-width: 16ch; }
.help-hero .lede { margin-top: var(--s3); }

.search {
  display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); max-width: var(--measure-wide);
  min-height: var(--control); padding-inline: var(--s4); border-radius: var(--r-control);
  background: var(--card); border: 1px solid var(--field); cursor: text;
}
.search:focus-within { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(20, 55, 49, .12); }
.search svg { width: var(--s4); height: var(--s4); stroke: var(--muted); fill: none; stroke-width: 2; flex: none; }
/* 16px, never less: iOS zooms the viewport on a smaller focused field and
   does not zoom back out on blur (brief §9). */
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: max(16px, var(--t0)); color: var(--ink); padding-block: var(--s3); outline: none; }
.search input::placeholder { color: rgba(27, 17, 16, .34); }
.search .count { font-family: var(--f-mono); font-size: var(--t-1s); color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.search .count:lang(ar) { letter-spacing: 0; font-family: var(--f-ar), sans-serif; font-size: var(--t-1); }

.help-main { padding-block: 0 var(--band); }
/* The search runs in help.js; without it the box would do nothing. */
html:not(.js) .search { display: none; }
.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.cat {
  display: grid; gap: var(--s3); align-content: start;
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r-card);
  padding: var(--pad-card); transition: border-color .18s ease;
}
.cat:hover { border-color: var(--strong); }
.cat .top { display: flex; align-items: center; justify-content: space-between; }
.cat .glyph {
  width: var(--s5); height: var(--s5); border-radius: 50%; display: grid; place-items: center;
  background: var(--sunken); color: var(--heading); font-family: var(--f-display); font-weight: 700; font-size: var(--t-1);
}
.cat h2 { font-family: var(--f-display); font-weight: 700; font-size: var(--t1); letter-spacing: -0.02em; color: var(--heading); line-height: 1.2; }
.cat h2:lang(ar) { letter-spacing: normal; line-height: 1.5; }
.cat p { color: var(--body); }
.cat ul { display: grid; gap: var(--s1); padding-top: var(--s3); border-top: 1px solid var(--hairline); }
.cat li { font-size: var(--t-1); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sidebar to article is 1 : φ² — the sidebar is a map, the article is the
   point, and the article's own width is capped by its reading measure. */
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.618fr); gap: var(--col-gap); align-items: start; }
.help-side { position: sticky; top: calc(var(--header-h) + var(--s4)); display: grid; gap: 2px; }
.help-side .kicker { margin-bottom: var(--s2); }
.help-side a {
  display: flex; align-items: center; min-height: var(--tap); padding: var(--s1) var(--s3); border-radius: var(--s2);
  color: var(--body); font-size: var(--t0s); line-height: 1.35;
}
.help-side a:hover { background: var(--sunken); color: var(--heading); }
.help-side a[aria-current="page"] { background: var(--card); color: var(--heading); font-weight: 600; box-shadow: inset 0 0 0 1px var(--hairline); }
.help-side hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--s2) 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 0 var(--s3); align-items: center; margin-bottom: var(--s3); font-size: var(--t-1); color: var(--muted); }
.crumbs a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--heading); text-decoration: underline; text-decoration-color: var(--strong); text-underline-offset: 3px;
}

.list { display: grid; border-top: 1px solid var(--hairline); }
.list a {
  display: grid; grid-template-columns: var(--s5) minmax(0, 1fr) var(--s4); gap: var(--s3); align-items: center;
  min-height: var(--control); padding-block: var(--s3); border-bottom: 1px solid var(--hairline);
  color: var(--heading); font-weight: 500; font-size: var(--t0);
}
.list a:hover .t { text-decoration: underline; text-decoration-color: var(--strong); text-underline-offset: 3px; }
.list .n { font-family: var(--f-mono); font-size: var(--t-1s); color: var(--muted); }
.list .n:lang(ar) { font-family: var(--f-ar), sans-serif; font-size: var(--t-1); }
.list .s { display: block; font-size: var(--t-1); font-weight: 400; color: var(--muted); }
.list .chev { width: var(--s3); height: var(--s3); stroke: var(--muted); fill: none; stroke-width: 2.4; }
[dir="rtl"] .list .chev { transform: scaleX(-1); }

.article h1 { font-size: var(--h-article); line-height: 1.1; }
.article h1:lang(ar) { line-height: 1.4; }
/* The reading measure is the usual 60–75 characters, not a φ fraction of the
   page: at 17px that is 36em, about 70 characters a line. */
.prose { margin-top: var(--s4); max-width: 36em; color: var(--body); font-size: var(--t0); line-height: 1.7; }
.prose:lang(ar) { line-height: 1.85; }
.prose > * + * { margin-top: 1em; }                 /* paragraph space = leading ÷ φ */
.prose h2 { font-family: var(--f-display); font-weight: 700; font-size: var(--t1); letter-spacing: -0.02em; color: var(--heading); margin-top: 1.618em; line-height: 1.25; }
.prose h2:lang(ar) { letter-spacing: normal; line-height: 1.5; }
.prose h3 { font-weight: 600; font-size: var(--t0); color: var(--heading); margin-top: 1.618em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--heading); text-decoration: underline; text-decoration-color: var(--strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { display: grid; gap: .618em; padding-inline-start: 1.272em; }   /* 1/φ between items, √φ indent */
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--muted); }
.prose .callout {
  padding: var(--s3) var(--s4); border-radius: var(--r-card); background: var(--card); border: 1px solid var(--hairline);
  color: var(--ink);
}
.prose .callout--owed { background: var(--rust-tint); border-color: transparent; color: var(--rust-deep); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t0s); }
.prose th, .prose td { text-align: start; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose th { font-weight: 600; color: var(--heading); }
.article-foot {
  margin-top: var(--s5); padding: var(--s4); border-radius: var(--r-card); background: var(--sunken);
  display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; justify-content: space-between;
}
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.article-nav a {
  display: grid; gap: 2px; padding: var(--s3) var(--s4); border-radius: var(--r-card); border: 1px solid var(--hairline);
  background: var(--card); color: var(--heading); font-weight: 600;
}
.article-nav a:hover { border-color: var(--strong); }
.article-nav .next { text-align: end; grid-column: 2; }
.empty { padding: var(--pad-card); border-radius: var(--r-card); background: var(--card); border: 1px solid var(--hairline); color: var(--body); }
.help-loading { display: grid; place-items: center; min-height: calc(var(--s8) + var(--s7)); }

/* The loader (§9a): the mark's straight arm with the dot running it. There
   is no spinner anywhere in this system. */
.loader { width: 64px; height: 26px; }
.loader .track { stroke: rgba(8, 32, 27, .16); stroke-width: 5; stroke-linecap: round; }
.loader .dot { fill: var(--deep); animation: loader-run 1.8s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes loader-run { 0% { translate: 0 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { translate: 38px 0; opacity: 0; } }
[dir="rtl"] .loader { transform: scaleX(-1); }

/* ============================================================ routes ==== */

a.chip { min-height: var(--tap); }
a.chip:hover { border-color: var(--strong); color: var(--heading); }
.route-help { max-width: var(--measure-wide); display: grid; gap: var(--s3); }
.route-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--col-gap); align-items: start; }
.route-group { display: grid; gap: var(--s3); }

/* ========================================================= 404 / invite = */

.lost { min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding-block: var(--band); }
.lost .shell { display: grid; gap: var(--s4); justify-items: start; }
.lost .code { font-family: var(--f-mono); font-size: var(--t-1); letter-spacing: .1em; color: var(--on-dark-muted); }
.lost .lang-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--col-gap); width: 100%; }
.lost .lang-blocks--single { grid-template-columns: minmax(0, 1fr); max-width: var(--measure-wide); }
.lost .lang-blocks > div { display: grid; gap: var(--s4); align-content: start; }
.lost .actions { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; }
.lost .btn:not(.btn--text) { background: var(--bone); color: var(--deep); }
.lost .btn:not(.btn--text):hover { background: var(--lime-hover); }

/* Reading an article or a topic, the hero shrinks to just the search box so
   the answer starts above the fold. */
.help-reading .help-hero { padding-block: var(--s4) var(--s5); }
.help-reading .help-hero h1, .help-reading .help-hero .lede { display: none; }
.help-reading .search { margin-top: 0; }

/* ========================================================= responsive === */
/* Breakpoints are where the content stops fitting, not φ multiples — that's
   the standard way to set them. What changes at each one is which φ split
   still has room to be a split. */

@media (max-width: 1080px) {
  .route-groups { grid-template-columns: minmax(0, 1fr); }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .reasons--3 { grid-template-columns: minmax(0, 1fr); }
  /* Four steps become 2 × 2 */
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s5); }
  .step:nth-child(2)::before { inset-inline-end: 0; }
  /* 1 : φ needs about 900px to leave the narrow column readable; below that
     the columns stack, primary first. */
  .carry .shell { grid-template-columns: minmax(0, 1fr); }
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-side { position: static; order: 2; margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--hairline); }
  /* The header collapses into a drawer. Without JavaScript the drawer can't
     open, so the links stay visible as a second, scrollable row instead. */
  .js .nav, .js .header-actions > .btn { display: none; }
  .js .header-actions { display: flex; margin-inline-start: auto; }
  .js .menu-btn { display: inline-flex; }
  .js .drawer[data-open="true"] { display: block; }
  html:not(.js) .site-header .shell { flex-wrap: wrap; padding-block: var(--s2); }
  html:not(.js) .nav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .help-tag { display: none; }
}

@media (max-width: 860px) {
  /* Stacked, the words lead and the mark sits centred just under them, above
     the store buttons, so both are in the first screen. The words' wrapper
     steps aside (display: contents) so the mark can slot between its lines. */
  .hero .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero .shell > div:first-child { display: contents; }
  .hero .boot { order: 1; width: var(--s8); margin: var(--s5) auto 0; }
  .hero .stores, .hero-note, .hero .btn--text { order: 2; }
  .hero .btn--text { justify-self: start; }

  .js .ribbon {
    display: block; position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--deep); border-top: 1px solid var(--on-dark-rail);
    translate: 0 100%; visibility: hidden;
    transition: translate .3s cubic-bezier(.2, .7, .3, 1), visibility 0s .3s;
  }
  .js .ribbon[data-show="true"] { translate: 0 0; visibility: visible; transition: translate .3s cubic-bezier(.2, .7, .3, 1); }
}
/* A short phone: one Fibonacci step less above the words and one smaller
   mark, so the mark still lands in the first screen. */
@media (max-width: 860px) and (max-height: 700px) {
  .hero { padding-top: var(--s5); }
  .hero .boot { width: var(--s7); margin-top: var(--s4); }
}

@media (max-width: 720px) {
  .reasons, .proofs { grid-template-columns: minmax(0, 1fr); }
  .cats { grid-template-columns: minmax(0, 1fr); }
  .lost .lang-blocks { grid-template-columns: minmax(0, 1fr); }
  .plainly { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  /* Stacked, the rail runs down the start edge rather than across. */
  .step { padding-top: 0; padding-inline-start: calc(var(--s5) + var(--s3)); padding-bottom: var(--s4); }
  .step::before { top: var(--s5); bottom: 0; inset-inline: calc(var(--s5) / 2 - 1px) auto; width: 2px; height: auto; }
  .step:last-child::before { display: none; }
  .carry-figures { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .carry-figures div { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--s3); padding-block: var(--s3); }
  .stores:not(.stores--solo) { flex-direction: column; align-items: stretch; }
  .get .stores { align-items: stretch; width: 100%; }
  .store { justify-content: center; }
  .footer-base { flex-direction: column-reverse; align-items: flex-start; }
  .article-nav { grid-template-columns: minmax(0, 1fr); }
  .article-nav .next { grid-column: 1; }
  .list a { grid-template-columns: var(--s4) minmax(0, 1fr) var(--s3); }
}

/* ----------------------------------------------------- reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js [data-reveal] { opacity: 1; translate: none; }
  .loader .dot { animation: none; opacity: 1; }
}

/* --------------------------------------------------------------- print -- */

@media print {
  .site-header { position: static; backdrop-filter: none; }
  .menu-btn, .drawer, .lang, .skip, .search { display: none !important; }
  .band { padding-block: var(--s5); }
  .js [data-reveal] { opacity: 1; translate: none; }
  .band--deep, .band--pine, .band--grape, .site-footer { background: none; }
  .on-dark, .on-grape, .on-dark .display, .on-grape .display { color: var(--ink); }
}
