/* ==========================================================================
   lensmith.app — one stylesheet for every page.

   It used to be three inline <style> blocks with 47 selectors in common, and
   they had already drifted: index knew a token install did not, and the same
   class carried different values on different pages. One file removes the
   drift by construction.

   The organising idea is `.band-ink`. The identity has two grounds — Paper and
   Ink — and almost every "this page's button is dark, that page's is light"
   difference was really "this control sits on the other ground". So a control
   is written once for Paper, and `.band-ink` states the Ink variant. Nothing
   below needs to know which page it is on.
   ========================================================================== */

/* Archivo, self-hosted: no third-party font request, so the site sets no
   external connections at all. Two static cuts (400 · 600) rather than a
   variable font — those are the only two weights the identity uses, and a
   synthesized weight is what a wordmark cannot afford. The mono labels ride
   the system's own mono (SF Mono on the Macs this app runs on), with
   JetBrains Mono — the identity's data face — used when the visitor has it. */
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/Archivo-Regular.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/Archivo-SemiBold.ttf') format('truetype');
  font-weight: 600; font-display: swap;
}

:root {
  /* Lensmith brand identity v1.0 — paper and ink, three channels, one
     copper. The channel inks ARE the marque's own three bars, taken from
     the artwork (oklch L .63) and lifted to L .70 where they sit on ink. */
  --paper:      #E9E9E6;   /* the ground */
  --paper-2:    #F4F3F1;   /* raised card on paper */
  --paper-3:    #DDD9D2;   /* inset fill */
  --ink:        #121212;   /* the other ground, and every word on paper */
  --ink-2:      #1B1B1A;   /* raised surface on ink */
  --line:       #CFCCC6;   /* rule on paper */
  --line-soft:  #DDD9D2;
  --line-dark:  #2E2D2A;   /* rule on ink */
  --line-dark-2:#3A3833;
  --on-paper-2: #5C5952;   /* body on paper */
  --on-paper-3: #6E6B66;   /* captions on paper */
  --on-ink:     #E9E9E6;
  --on-ink-2:   #A9A29A;   /* body on ink */
  --on-ink-3:   #7E7A73;   /* captions on ink */
  --on-ink-4:   #6E6B66;
  --copper:     #B4501F;   /* the one digital-only accent: links, live state */
  --copper-lit: #D9702E;   /* the same copper, legible on ink */
  --ch-r:       #DA5D25;
  --ch-g:       #00A874;
  --ch-b:       #8D71E6;
  --ch-r-lit:   #F3743F;
  --ch-g-lit:   #00BE8A;
  --ch-b-lit:   #A287FE;
  --sans: 'Archivo', system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
}

/* ── Base ─────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; }
/* A picture is never wider than its box. Every <img> here carries its pixel
   width so nothing reflows while it loads, and without this rule that width
   is also its *minimum*: inside a grid track the 2000 px capture set the
   track, the page laid out at 2000 px, and body's overflow-x hid the
   evidence while the phone showed a page cut off at the right edge. */
img { max-width: 100%; height: auto; }

/* Radius 0 is the identity, not an oversight: nothing on this site is
   rounded except drawings of round things (the marque's ring, a window's
   traffic lights). */
a { color: var(--copper); text-decoration: none; }
a:hover { color: #8A3C14; }
em { font-style: normal; color: var(--ch-r-lit); }
::selection { background: rgba(180,80,31,.28); }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero * { animation: none !important; opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

.wrap { width: 100%; max-width: 1260px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }

/* Full-bleed bands: the identity alternates ink and paper edge to edge,
   so each band owns its ground and the measure lives inside it. */
.band-ink { background: var(--ink); color: var(--on-ink); }
.band-ink a:not(.btn):not(.brand) { color: #B6B1A9; }
.band-ink a:not(.btn):not(.brand):hover { color: var(--copper-lit); }

/* ── Marque ──────────────────────────────────────────────── */
/* Ring plus three channels, drawn at the artwork's own proportions
   (ring ⌀26 wall 3, bars 30/33/30 at y 9/14/19 in a 44×29 box). The ring
   takes currentColor so one drawing serves ink and paper alike. */
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.marque { width: 44px; height: 29px; flex: none; display: block; }
.wm { font-size: 19px; font-weight: 400; letter-spacing: -.02em; color: inherit; }
.wm b { font-weight: 600; }

/* The mark is always a link, and hovering it goes MONOCHROME rather than
   copper: the one-ink lockup is one of the three official versions in the
   brand kit, where a copper mark is explicitly not — copper says "live
   state", which is not something a logo can be. */
a.brand, a.brand:hover { color: var(--on-ink); }
a.brand .marque .ch { transition: fill .15s ease; }
a.brand:hover .marque .ch { fill: currentColor; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 20px; height: 72px; }
.chip {
  font: 500 10px/1 var(--mono);
  letter-spacing: .16em; color: var(--ch-g-lit);
  border: 1px solid var(--line-dark-2);
  padding: 6px 8px; white-space: nowrap;
}
.topbar nav { margin-left: auto; display: flex; gap: 28px; font-size: 14px; }
.topbar nav a { color: #B6B1A9; }
.topbar nav a:hover { color: var(--on-ink); }
/* The page you are on is named, not linked away from: same row, full ink. */
.topbar nav a[aria-current="page"] { color: var(--on-ink); }

/* The burger: three bars in the marque's own proportions, drawn only where
   the four links no longer fit on the row (see Narrow). Open, the nav drops
   under the bar as a column of finger-sized rows on the same ink. */
.burger {
  display: none; margin-left: auto; flex: none;
  width: 44px; height: 44px; padding: 0;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  background: transparent; border: 0; color: var(--on-ink); cursor: pointer;
}
.burger span { display: block; width: 22px; height: 2px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
.topbar.is-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.is-open .burger span:nth-child(2) { opacity: 0; }
.topbar.is-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Buttons ─────────────────────────────────────────────── */
/* Written once for Paper; `.band-ink` states the Ink variant. */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 15px/1 var(--sans);
  color: var(--paper); background: var(--ink);
  padding: 16px 26px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: #000; color: var(--paper); }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); font-weight: 400; }
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); }

.band-ink .btn { color: var(--ink); background: var(--paper); }
.band-ink .btn:hover { background: #FFFFFF; color: var(--ink); }
.band-ink .btn.ghost { background: transparent; color: #B6B1A9; border-color: var(--line-dark-2); }
.band-ink .btn.ghost:hover { border-color: var(--on-ink-2); color: var(--on-ink); background: transparent; }

.cta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ── Shared type ─────────────────────────────────────────── */
.kicker { display: block; font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--copper); }
h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.0; letter-spacing: -.035em; font-weight: 600; }
h2 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.lede { font-size: 17px; line-height: 1.6; color: var(--on-paper-2); text-wrap: pretty; }
.meta { margin-top: 18px; font: 400 11px/1.7 var(--mono); letter-spacing: .04em; color: var(--on-paper-3); }
.meta a { color: var(--on-paper-2); }
.meta a:hover { color: var(--copper); }
.band-ink .meta { color: var(--on-ink-4); }
.band-ink .meta a { color: var(--on-ink-3); }
.band-ink .meta a:hover { color: var(--copper-lit); }

code {
  font: 400 13px/1 var(--mono); color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line); padding: 3px 6px;
}

/* A prose page: same gutter as the bands above and below, so the site has one
   left edge; the measure is capped on the children rather than by centring
   the column. Index does not use it — its <main> holds full-bleed bands. */
main.page { width: 100%; max-width: 1260px; margin: 0 auto; padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 64px) 8px; }
main.page > * { max-width: 820px; }

/* ── Footer ──────────────────────────────────────────────── */
/* Columns rather than one row of eight: a flat list wraps into an unreadable
   ribbon and says nothing about what belongs with what. The headings use the
   docs sidebar's own small-caps mono, because a footer group and a sidebar
   group are the same kind of label. */
footer { padding: 64px 0 32px; margin-top: 72px; }
.foot-grid {
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(130px, 1fr));
}
footer .who { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
footer .line { margin: 0; font: 400 13px/1.7 var(--sans); color: var(--on-ink-4); max-width: 38ch; }
.foot-h {
  display: block; margin-bottom: 4px;
  font: 500 10px/1 var(--mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--on-ink-4);
}
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 14px; }
.foot-col a, .foot-col .link-btn, footer .social { color: #B6B1A9; text-align: left; }
.foot-col a:hover, .foot-col .link-btn:hover, footer .social:hover { color: var(--copper-lit); }
/* The top bar's rule, one band down: the page you are on is named, not
   linked away from. */
.foot-col a[aria-current="page"] { color: var(--on-ink); }
/* An icon in a row of words has to sit ON the baseline of the word beside
   it, not float in its own box. */
footer .social { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
footer .ico { width: 15px; height: 15px; flex: none; }
/* The line nobody reads until they need it: a rule above it, and the two
   halves pushed apart so neither reads as part of the columns. */
.foot-base {
  margin-top: clamp(40px, 5vw, 64px); padding-top: 22px;
  border-top: 1px solid var(--line-dark-2);
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font: 400 12px/1.7 var(--sans); color: var(--on-ink-4);
}
.foot-note { font: 400 11px/1.7 var(--mono); letter-spacing: .04em; color: var(--on-ink-4); }
/* "Cookie preferences" is a button because it opens something rather than
   going somewhere — screen readers should hear a button. It has to read as
   the links beside it. */
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
@media (max-width: 860px) {
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  footer .who { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .foot-grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { padding: clamp(56px, 8vw, 96px) 0 0; }
/* minmax(0, …) on every track below, not a bare fr: a fr track's automatic
   minimum is its min-content, which a wide child — a capture, a long mono
   line — pushes past the window. */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: end; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); align-items: start; } }
.eyebrow {
  display: block;
  font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  color: var(--ch-g-lit); animation: rise .6s ease both;
}
.hero h1 {
  margin: 26px 0 0;
  font-size: clamp(38px, 5.2vw, 70px);
  line-height: .98; letter-spacing: -.04em;
  text-wrap: pretty;
  animation: rise .7s ease both;
}
.hero p.lede {
  font-size: clamp(16px, 1.4vw, 18px);
  color: var(--on-ink-2); max-width: 46ch;
  animation: rise .8s ease both;
}
.hero .cta-row { margin-top: 30px; animation: rise .9s ease both; }
.hero .meta { animation: rise 1s ease both; }

/* ---- Screenshots ----
   Real captures of the app rather than a drawing of it, so the window's own
   chrome is already in the picture: the page adds a hairline and stays out of
   the way. Width and height are on the <img> so nothing reflows as they load. */
.stage { padding: clamp(48px, 6vw, 80px) 0 clamp(56px, 7vw, 88px); }
.shot { margin: 0; }
/* The one rounded thing on the page, and for the footer's Instagram reason: a
   macOS window IS round-cornered, so a square crop of one prints a black notch
   at each corner. The radius is the window's own ~19pt over the capture's 1512×869
   points, as a percentage of each axis, so it stays right at every display size. */
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line-dark); border-radius: 1.25% / 2.2%;
}
.shot figcaption {
  margin-top: 12px; font: 400 11px/1.6 var(--mono); letter-spacing: .04em; color: var(--on-ink-4);
}
.screens .shot img { border-color: var(--line); }
.screens .shot figcaption { color: var(--on-paper-3); }
.screens h2 { margin: 18px 0 0; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.03em; }
.screens .lede { margin: 16px 0 0; }   /* full width: it runs with the grid under it, not as a column */
.shot-grid { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); }

/* ---- Closing band ---- */
section.band { padding: clamp(64px, 8vw, 104px) 0; }
.closing { text-align: center; display: flex; flex-direction: column; align-items: center; }
.closing .wrap { display: flex; flex-direction: column; align-items: center; }
.closing h2 { margin: 20px 0 0; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.05; letter-spacing: -.03em; max-width: 20ch; }
.closing .sub { margin: 18px 0 0; font-size: 17px; line-height: 1.6; color: var(--on-paper-2); max-width: 58ch; text-wrap: pretty; }
.closing .cta-row { margin-top: 30px; }

/* ==========================================================================
   Install guide
   ========================================================================== */
main.page h1 { margin: 22px 0 0; }
main.page .lede { margin: 20px 0 0; max-width: 56ch; }

/* A step is a card on paper: raised sheet, hairline, square corners, and a
   numeral set as an ink plate — the identity's "chosen" block inverted. */
.steps { list-style: none; margin-top: 48px; display: flex; flex-direction: column; gap: 20px; }
.step {
  position: relative; border: 1px solid var(--line); background: var(--paper-2);
  padding: 30px 32px 30px 76px;
}
.step .num {
  position: absolute; left: 32px; top: 30px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font: 500 12px/1 var(--mono); color: var(--paper); background: var(--ink);
}
.step h2 { font-size: 19px; letter-spacing: -.015em; }
.step p { margin-top: 12px; font-size: 15px; line-height: 1.65; color: var(--on-paper-2); text-wrap: pretty; }
.step strong { color: var(--ink); font-weight: 600; }

.os { margin-top: 18px; border-left: 2px solid var(--copper); padding-left: 16px; }
.os + .os { margin-top: 16px; }
.os .label { font: 500 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--copper); }
.os p { margin-top: 8px; font-size: 14.5px; }

kbd {
  font: 400 12.5px/1 var(--mono);
  padding: 4px 7px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); white-space: nowrap;
}
.codeblock {
  display: block; margin-top: 14px; padding: 14px 16px;
  background: var(--ink); border: 1px solid var(--ink);
  color: var(--on-ink); font: 400 13px/1.5 var(--mono);
  overflow-x: auto; white-space: pre;
}
.tip { margin-top: 16px; font-size: 14px; color: var(--on-paper-3); line-height: 1.6; }
main.page .cta-row { margin: 48px 0 8px; }

/* ==========================================================================
   Privacy & cookies
   ========================================================================== */
.updated { margin-top: 18px; font: 400 11px/1.7 var(--mono); letter-spacing: .04em; color: var(--on-paper-3); }

/* The summary is the page. Everything under it is the same four facts said
   at greater length, for the reader who needs them said at greater length. */
.summary { margin-top: 44px; border: 1px solid var(--line); background: var(--paper-2); padding: 30px 32px; }
.summary h2 { font-size: 19px; letter-spacing: -.015em; }
.summary ul { margin: 16px 0 0; padding: 0; list-style: none; }
.summary li {
  display: flex; gap: 14px; padding: 11px 0; font-size: 15px; line-height: 1.6;
  color: var(--on-paper-2); border-top: 1px solid var(--line);
}
.summary li:first-child { border-top: 0; padding-top: 0; }
.summary li span { min-width: 0; }
.summary li b { color: var(--ink); font-weight: 600; }
.summary li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; background: var(--copper); }

section.doc { margin-top: 52px; }
section.doc h2 { margin-bottom: 6px; }
section.doc p { margin-top: 14px; font-size: 15.5px; line-height: 1.7; color: var(--on-paper-2); text-wrap: pretty; }
section.doc p strong { color: var(--ink); font-weight: 600; }
section.doc ul { margin: 14px 0 0 0; padding-left: 20px; }
section.doc li { margin-top: 8px; font-size: 15.5px; line-height: 1.7; color: var(--on-paper-2); }
section.doc li strong { color: var(--ink); font-weight: 600; }
section.doc .btn { margin-top: 26px; }

.kv { margin-top: 18px; border: 1px solid var(--line); }
.kv div { display: flex; gap: 16px; padding: 13px 16px; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv div:first-child { border-top: 0; }
.kv dt {
  flex: none; width: 132px; font: 500 10px/1.6 var(--mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--on-paper-3);
}
.kv dd { margin: 0; color: var(--on-paper-2); }
.kv dd strong { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Beta request form

   Fields are the identity's inset fill on the raised sheet: square, hairline,
   copper only when live (a focused field), which is the same rule the app's
   own palette follows — "chosen" is a block of ink, "live" is copper.
   ========================================================================== */
.steps.compact { margin-top: 36px; gap: 12px; }
.steps.compact .step { padding: 20px 24px 20px 66px; }
.steps.compact .step .num { top: 20px; left: 24px; }
.steps.compact .step h2 { font-size: 16px; }
.steps.compact .step p { margin-top: 6px; font-size: 14.5px; }

.form { margin-top: 40px; }
.field { display: block; margin-top: 22px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.field label,
.check > span { font-size: 14.5px; line-height: 1.6; }
.field label {
  display: flex; align-items: baseline; gap: 10px;
  font-weight: 600; color: var(--ink);
}
.req {
  font: 400 9.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--copper);
}
.field input, .field textarea, .field select {
  display: block; width: 100%; margin-top: 8px;
  font: 400 15px/1.5 var(--sans); color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 12px 14px; border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 120px; }
/* appearance: none takes the arrow away with the rounded corners: it comes
   back drawn, so the field still says it opens. */
.field select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23B4501F' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field input::placeholder, .field textarea::placeholder { color: #9C9891; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--copper); background: #FFFFFF;
}
.help { display: block; margin-top: 8px; font-size: 13.5px; line-height: 1.6; color: var(--on-paper-3); }
.field-row + .help { margin-top: 10px; }

/* The checkbox is a real one: a hand-drawn div would lose the keyboard, the
   form validation and every assistive technology in one go. */
.check {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 28px; padding: 18px 20px;
  border: 1px solid var(--line); background: var(--paper-2);
}
.check input { flex: none; width: 17px; height: 17px; margin-top: 2px; accent-color: var(--copper); }
.check > span { color: var(--on-paper-2); }
.check + .check { margin-top: 12px; }

.form-note {
  margin-top: 16px; border-left: 2px solid var(--copper); padding: 2px 0 2px 16px;
}
.form-note p { font-size: 13.5px; line-height: 1.65; color: var(--on-paper-3); }
.form-note b { color: var(--on-paper-2); font-weight: 600; }

.captcha { margin-top: 24px; min-height: 65px; }

.form-actions { margin-top: 22px; }
.form-actions .help { margin-top: 14px; max-width: 56ch; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* The status line is the only place a submission can report anything, so it is
   never allowed to be silent: empty means nothing has happened yet. */
.form-status:empty { display: none; }
.form-status {
  margin-top: 18px; padding: 12px 16px;
  font-size: 14.5px; line-height: 1.6;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--on-paper-2);
}
.form-status.error { border-color: var(--copper); color: var(--ink); }

@media (max-width: 620px) {
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .check { padding: 16px; }
  /* Il numero passa sopra al titolo (regola di .step qui sotto): la rientranza
     che gli faceva posto non serve più. */
  .steps.compact .step { padding: 18px 20px; }
}

/* ==========================================================================
   Narrow
   ========================================================================== */
@media (max-width: 900px) {
  .shot-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .burger { display: flex; }
  .topbar nav { display: none; }
  .topbar.is-open nav {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ink); border-top: 1px solid var(--line-dark-2);
    padding: 8px 0 12px; box-shadow: 0 18px 32px rgba(0,0,0,.35);
  }
  .topbar.is-open nav a { padding: 13px clamp(20px, 4vw, 64px); font-size: 16px; line-height: 1.3; }
}
@media (max-width: 620px) {
  /* The chip has to give way before the wordmark does. */
  .chip { font-size: 9px; letter-spacing: .12em; padding: 5px 6px; }
  .step { padding: 24px 20px; }
  .step .num { position: static; margin-bottom: 14px; }
  .summary { padding: 24px 20px; }
  .kv div { flex-direction: column; gap: 4px; }
  .kv dt { width: auto; }
}
@media (max-width: 480px) {
  /* Two buttons on a phone are two rows; each takes the row rather than
     leaving an L of the pair. */
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 380px) { .chip { display: none; } }

/* ==========================================================================
   Documentation

   A reference section rather than a page: a bar that says where you are, a
   sidebar that shows the whole shape of the manual, the topic in the middle
   and its own headings to the right. Everything below reuses the tokens
   above — the docs are the same site, not a second one bolted on.
   ========================================================================== */

/* ---- The bar: where you are, and what build this was checked against ---- */
.docs-bar { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.docs-bar .wrap { display: flex; align-items: center; gap: 20px; min-height: 52px; padding-top: 10px; padding-bottom: 10px; }
.crumbs { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font: 400 12px/1.5 var(--mono); letter-spacing: .03em; color: var(--on-paper-3); }
.crumbs a { color: var(--on-paper-2); }
.crumbs a:hover { color: var(--copper); }
.crumbs .sep { color: #B9B5AE; }
.crumbs b { color: var(--ink); font-weight: 400; }

/* ---- The shell ----
   Three columns past 1320px: the manual, the topic, and the topic's own
   headings. The third is the first to go, then the first — a phone gets the
   sidebar as an ordinary block above the text. */
.docs-shell {
  width: 100%; max-width: 1440px; margin: 0 auto;
  padding: clamp(36px, 4vw, 60px) clamp(20px, 4vw, 64px) 8px;
  display: grid; grid-template-columns: 236px minmax(0, 1fr) 176px;
  gap: clamp(28px, 3.6vw, 60px);
}

/* ---- The sidebar ----
   The whole manual is listed, including the topics not written yet: the shape
   of a reference is information in its own right, and a plain entry says
   "coming" where a dead link says "broken". */
.docs-nav-inner { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow-y: auto; padding-bottom: 24px; }
/* The toggle that folds the manual on a narrow screen: hidden wherever the
   sidebar is a column, because there the list *is* the control. */
.docs-nav-toggle {
  display: none; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: transparent; border: 0; cursor: pointer;
  font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--on-paper-2);
  text-align: left;
}
.docs-nav-toggle svg { width: 12px; height: 12px; flex: none; transition: transform .18s ease; }
.docs-nav.is-open .docs-nav-toggle svg { transform: rotate(180deg); }
.docs-nav h2 {
  margin-top: 30px; padding-bottom: 8px;
  font: 500 10px/1 var(--mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--on-paper-3);
}
.docs-nav h2:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; border-left: 1px solid var(--line); }
.docs-nav li a, .docs-nav li span {
  display: block; padding: 7px 0 7px 15px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.4; color: var(--on-paper-2);
  transition: color .12s ease, border-color .12s ease;
}
.docs-nav li a:hover { color: var(--ink); border-left-color: #BFBBB4; }
.docs-nav li a[aria-current="page"] { color: var(--copper); font-weight: 600; border-left-color: var(--copper); }
.docs-nav li span { color: #AEAAA3; }   /* written, not yet published */

/* ---- The topic's own headings, on the right ---- */
.docs-aside-inner { position: sticky; top: 92px; }
.docs-aside .label { display: block; font: 500 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--on-paper-3); }
.docs-aside ul { list-style: none; margin-top: 12px; border-left: 1px solid var(--line); }
.docs-aside a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13px; line-height: 1.45; color: var(--on-paper-3);
}
.docs-aside a:hover { color: var(--ink); border-left-color: #BFBBB4; }

/* ---- The page ---- */
.docs-page > * { max-width: 800px; }
.docs-page section[id] { scroll-margin-top: 92px; }
/* `em` is a display device in the hero — a coloured word in a headline. In
   running prose it is emphasis, and copper there reads as a link. */
.docs-page em { font-style: italic; color: inherit; }

.docs-page .eyebrow { color: var(--copper); animation: none; }
.docs-page h1 { margin-top: 14px; font-size: clamp(34px, 4.2vw, 50px); line-height: 1.0; letter-spacing: -.035em; }
.docs-page > .lede { margin-top: 22px; font-size: 18px; max-width: 62ch; }
.docs-page > .lede + .rule { display: block; margin-top: 34px; border-top: 1px solid var(--line); }

/* A section opens with a hairline and plenty of air: on a page of twenty
   headings that rule is what makes the eye stop. */
section.doc { margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--line); }
section.doc h2 { font-size: 26px; letter-spacing: -.025em; }
/* The line under a family name: what the family is for, said once. Mono
   because it is a caption rather than the first sentence of the body. */
.docs-page .subtitle { margin-top: 10px; font: 400 13px/1.6 var(--mono); letter-spacing: .02em; color: var(--on-paper-3); }
.docs-page .subtitle + .kv { margin-top: 20px; }

section.doc h3 { margin-top: 30px; font-size: 16.5px; font-weight: 600; letter-spacing: -.005em; }
section.doc h3 + p { margin-top: 8px; }
section.doc p { font-size: 15.5px; line-height: 1.72; }

/* ---- A screenshot is mounted, not pasted ----
   The app is dark and the page is paper: a bare capture floats. The mat is
   the mount a print gets, and it is what the Book module's own frame styles
   do on paper. */
.docs-page .shot { margin-top: 30px; background: var(--paper-2); border: 1px solid var(--line); padding: 14px; }
.docs-page .shot img { border-color: var(--line-dark); }
.docs-page .shot figcaption {
  margin: 12px 2px 2px; color: var(--on-paper-3);
  font: 400 11px/1.6 var(--mono); letter-spacing: .03em;
}

/* A numbered caption under a screenshot: the parts of the window, named in
   the order the eye reads them. */
.callouts { margin-top: 18px; list-style: none; counter-reset: callout; }
.callouts li {
  counter-increment: callout; display: flex; gap: 14px;
  padding: 11px 0; border-top: 1px solid var(--line-soft);
  font-size: 14.5px; line-height: 1.6; color: var(--on-paper-2);
}
.callouts li:first-child { border-top: 0; padding-top: 2px; }
.callouts li::before {
  content: counter(callout); flex: none;
  width: 19px; height: 19px; margin-top: 2px;
  display: grid; place-items: center;
  font: 500 10px/1 var(--mono); color: var(--paper); background: var(--ink);
}
.callouts li span { min-width: 0; }   /* one flex item: see .summary li */
.callouts b { color: var(--ink); font-weight: 600; }

/* ---- An aside, for the thing that is true but is not the next sentence ---- */
.note {
  margin-top: 22px; border: 1px solid var(--line); border-left: 2px solid var(--copper);
  background: var(--paper-2); padding: 16px 18px;
}
.note .label { display: block; font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--copper); }
.note p { margin-top: 9px; font-size: 14.5px; line-height: 1.65; color: var(--on-paper-2); }

/* ---- Named lists: the app's own label on the left, what it does on the
   right. `.kv`'s term is a mono field label — right for "Lifetime", wrong for
   the name of a tool, which is a proper noun in the interface. ---- */
.kv.names dt {
  width: 176px; font: 600 14.5px/1.55 var(--sans);
  letter-spacing: 0; text-transform: none; color: var(--ink);
}
.kv.names dd { font-size: 14.5px; line-height: 1.6; }
.kv.names div { padding: 15px 18px; transition: background .12s ease; }
.kv.names div:hover { background: var(--paper-2); }
.kv dt .key { font: 400 11px/1 var(--mono); color: var(--on-paper-3); letter-spacing: .06em; }

/* The keyboard table: one row per shortcut, caps on the right. */
.keys { margin-top: 18px; border: 1px solid var(--line); }
.keys div { display: flex; align-items: baseline; gap: 16px; padding: 11px 18px; border-top: 1px solid var(--line); font-size: 14.5px; }
.keys div:first-child { border-top: 0; }
.keys dt { flex: 1; color: var(--on-paper-2); }
.keys dd { margin: 0; display: flex; gap: 4px; flex: none; }

/* ---- The index: the manual as a wall of cards ---- */
.cards { margin-top: 30px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.cards a, .cards div {
  display: block; border: 1px solid var(--line); background: var(--paper-2);
  padding: 22px 24px 24px; transition: border-color .12s ease, background .12s ease;
}
/* A section with no page yet is a card that does not pretend to be a door. */
.cards div { background: transparent; }
.cards a:hover { border-color: var(--ink); background: #FFFFFF; }
.cards .num { font: 500 10px/1 var(--mono); letter-spacing: .16em; color: var(--copper); }
.cards h3 { margin-top: 12px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.cards p { margin-top: 9px; font-size: 14px; line-height: 1.6; color: var(--on-paper-2); }
.cards .soon { margin-top: 14px; display: inline-block; font: 500 9.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--on-paper-3); border: 1px solid var(--line); padding: 5px 7px; }

/* ---- Foot of a page: where to go next ---- */
.pager { margin: 64px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pager a { border: 1px solid var(--line); background: var(--paper-2); padding: 17px 20px; transition: border-color .12s ease, background .12s ease; }
.pager a:hover { border-color: var(--ink); background: #FFFFFF; }
.pager .dir { display: block; font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--on-paper-3); }
.pager .name { display: block; margin-top: 9px; font-size: 15px; font-weight: 600; color: var(--ink); }
.pager .next { text-align: right; grid-column: 2; }

@media (max-width: 1320px) {
  .docs-shell { grid-template-columns: 236px minmax(0, 1fr); }
  .docs-aside { display: none; }
}
@media (max-width: 1000px) {
  /* minmax(0,…) rather than a bare 1fr, as in the rule above: a 1fr track's
     automatic minimum is its min-content, which a wide child can push past
     the window. */
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* One column: the manual folds into a bar above the topic, closed until
     asked. It used to be the whole list, open, above every page — a screen
     and a half of links before the first word of the topic you had opened. */
  .docs-nav { margin-bottom: 28px; border: 1px solid var(--line); background: var(--paper-2); }
  .docs-nav-toggle { display: flex; }
  .docs-nav-inner { display: none; position: static; max-height: none; overflow: visible; padding: 4px 18px 18px; border-top: 1px solid var(--line); }
  .docs-nav.is-open .docs-nav-inner { display: block; }
  .docs-nav li a, .docs-nav li span { padding-top: 10px; padding-bottom: 10px; font-size: 15px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .kv.names dt { width: auto; }
  .kv.names div { padding: 14px 16px; }
  .keys div { flex-direction: column; gap: 6px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; grid-column: 1; }
  .docs-page .shot { padding: 8px; }
}
