/* SSH Actions: site styles. Tokens first; components use them and nothing else.
   Colours are the app's (shared/design-tokens.json): neutral canvas and cards, Clear Blue for the main
   action and key highlights only. Type is the system font, as in the app. */

/* ---------- Tokens ---------- */
:root {
  /* Colour */
  --canvas: #F6F8FC;
  --surface: #FFFFFF;
  --subtle: #EEF2F8;
  --text: #111827;
  --muted: #4A515F;
  --accent: #124698;        /* links and blue text: 7:1 on the canvas */
  --brand: #1B67E0;         /* Clear Blue: shapes, symbols, the icon */
  --control: #1653B6;       /* behind white text: 7:1 */
  --control-hover: #124698;
  --on-control: #FFFFFF;
  --success: #115532;
  --danger: #8B2316;
  --warning: #6C4000;
  /* The app's own surfaces, for the snapshots (ssh_automation_app DESIGN.md). Console is dark in both modes. */
  --console: #1C1C1E;
  --console-text: #E5E5EA;
  --console-muted: #A1A1A8;
  --console-user: #6DD69B;
  --console-cursor: #8EBBFF;
  --wash: #E7F0FD;
  --stop-wash: #FBEAE7;
  --stop: #A0311C;
  --tile-purple: #6E44E8;
  --tile-teal: #0F8577;
  --tile-green: #115532;
  --code-bg: #F6F8FC;
  /* Syntax: Xcode's default light theme, as the app's file viewer. */
  --syn-keyword: #9B2393;
  --syn-string: #C41A16;
  --syn-comment: #5D6C79;
  --syn-variable: #326D74;
  --line: rgba(17, 24, 39, 0.10);
  --mark-lo: #D9E5FA;
  --bezel: #000;
  --band: linear-gradient(150deg, #E3E6EB 0%, #9AA1AB 22%, #F1F3F6 46%, #868D97 70%, #D7DBE1 100%);
  --shadow-card: 0 1px 2px rgba(15, 30, 60, 0.04), 0 8px 24px -12px rgba(15, 30, 60, 0.10);
  --shadow-phone: 0 1px 1px rgba(255, 255, 255, 0.5) inset, 0 50px 80px -30px rgba(15, 30, 60, 0.42), 0 20px 30px -18px rgba(15, 30, 60, 0.30);

  /* Space: one 8 px grid */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s8: 64px; --s10: 80px; --s12: 96px; --s16: 128px;
  --section: var(--s16);
  --gutter: var(--s3);
  --content: 1120px;
  --measure: 40rem;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-display: clamp(44px, 6vw, 68px);
  --t-h2: clamp(32px, 4vw, 44px);
  --t-h3: 20px;
  --t-lede: clamp(19px, 2vw, 21px);
  --t-body: 17px;
  --t-caption: 14px;

  /* Shape: the app's corners */
  --r-card: 16px;
  --r-control: 12px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --d-fast: 180ms;
  --d-base: 500ms;
  --d-slow: 800ms;
  --rise: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0E1420;
    --surface: #172033;
    --subtle: #1E2A40;
    --text: #E8EEF8;
    --muted: #ABB7CA;
    --accent: #8EBBFF;
    --brand: #4C9AFF;
    --control: #134DCC;
    --control-hover: #1653B6;
    --success: #6DD69B;
    --danger: #FFA095;
    --warning: #F2C46B;
    --console: #111113;
    --wash: #1A2B4A;
    --stop-wash: #332A2C;
    --tile-purple: #6640D6;
    --tile-teal: #0E7A6D;
    --tile-green: #6DD69B;
    --code-bg: #111113;
    --syn-keyword: #FF7AB2;
    --syn-string: #FF8170;
    --syn-comment: #7F8C98;
    --syn-variable: #67B7A4;
    --line: rgba(232, 238, 248, 0.12);
    --mark-lo: #17305A;
    --band: linear-gradient(150deg, #4A5160 0%, #262B35 25%, #5B6372 48%, #20252E 72%, #3D4452 100%);
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-phone: 0 1px 1px rgba(255, 255, 255, 0.12) inset, 0 50px 90px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--canvas); color: var(--text); font: var(--t-body)/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }
.wrap { max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--s2); top: -100px; z-index: 50; padding: var(--s1) var(--s2); background: var(--control); color: var(--on-control); border-radius: var(--r-control); }
.skip:focus { top: var(--s2); }

/* ---------- Components ---------- */
/* Section: one rhythm everywhere. */
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }
/* Features continue the proof above them: one chapter, no divider. */
#how + #features { border-top: 0; padding-top: 0; }
.section-head { max-width: 36rem; margin-bottom: var(--s8); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--t-h2); line-height: 1.08; letter-spacing: -0.03em; }
.section-head p { margin-top: var(--s2); color: var(--muted); font-size: var(--t-lede); line-height: 1.45; }

/* Card: one radius, one hairline, one soft shadow. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-height: 44px;
  padding: 0 var(--s3); border: 0; border-radius: var(--r-control); font: 600 16px/1 var(--font); cursor: pointer;
  background: var(--control); color: var(--on-control); text-decoration: none;
  transition: background var(--d-fast), transform var(--d-fast) var(--ease), box-shadow var(--d-fast);
}
.button:hover { background: var(--control-hover); text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--control) 70%, transparent); }
.button:active { transform: translateY(0) scale(0.98); }
.button.quiet { background: transparent; color: var(--accent); padding-inline: var(--s2); }
.button.quiet:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); box-shadow: none; }
.button.small { min-height: 36px; padding: 0 var(--s2); font-size: 15px; }
/* Apple's App Store badge, unmodified: black in light mode, white in dark. */
.store-badge { display: inline-flex; border-radius: 9px; }
.store-badge img { height: 54px; width: auto; }

/* Phone: titanium band, black border, Dynamic Island, side buttons, a faint glare. Sized by --pw. */
.phone {
  --pw: 270px;
  position: relative; margin: 0; width: var(--pw); flex: none;
  padding: calc(var(--pw) * 0.016); border-radius: 17.5% / 8.1%;
  background: var(--band); box-shadow: var(--shadow-phone);
}
.phone::before, .phone::after, .phone .vol { content: ""; position: absolute; width: 1.2%; border-radius: 2px; background: var(--band); }
.phone::before { left: -1%; top: 17%; height: 5%; }
.phone::after { right: -1%; top: 25%; height: 11%; }
.phone .vol.up { left: -1%; top: 25%; height: 8%; }
.phone .vol.down { left: -1%; top: 35%; height: 8%; }
.phone .screen { position: relative; overflow: hidden; background: var(--bezel); padding: calc(var(--pw) * 0.029); border-radius: 16.2% / 7.5%; }
.phone .screen::before { content: ""; position: absolute; z-index: 3; top: 4.3%; left: 50%; transform: translateX(-50%); width: 30%; height: 3.3%; border-radius: var(--r-pill); background: #000; }
.phone .screen::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 28%, transparent 42%); }
.phone .display { position: relative; border-radius: 13.4% / 6.2%; overflow: hidden; aspect-ratio: 540 / 1174; background: var(--subtle); }
.phone .display img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Several screens in one phone crossfade (the product proof). */
.phone .display picture { position: absolute; inset: 0; opacity: 0; transition: opacity var(--d-base) var(--ease); }
.phone .display picture.on, .phone .display picture:only-child { opacity: 1; }

/* Icons: one set, 1.75 stroke, round joins. */
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; transition: background var(--d-base), border-color var(--d-base); }
.site-header.scrolled, .doc-page .site-header { background: color-mix(in srgb, var(--canvas) 80%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s3); height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 22.37%; }
.nav { display: flex; align-items: center; gap: var(--s3); font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.site-header .get, .site-header .get:hover { color: var(--on-control); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.menu-button { display: none; width: 44px; height: 44px; border: 0; background: none; color: var(--text); border-radius: var(--r-control); cursor: pointer; place-items: center; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--s6); align-items: center; padding-block: var(--s8); }
.hero h1 { font-size: var(--t-display); line-height: 1.02; letter-spacing: -0.04em; max-width: 11ch; }
.hero .lede { margin-top: var(--s3); font-size: var(--t-lede); line-height: 1.45; color: var(--muted); max-width: 28rem; }
.hero .actions { margin-top: var(--s5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.hero .note { margin-top: var(--s4); display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); font-size: var(--t-caption); color: var(--muted); }
.stage { position: relative; display: grid; place-items: center; padding-block: var(--s4); }
.stage .mark { position: absolute; height: 104%; width: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.stage .mark .lo { fill: var(--mark-lo); }
.stage .mark .hi { fill: var(--brand); }
.stage { --hero-pw: 268px; }
.stage .phone { --pw: var(--hero-pw); }
/* The signature: a command typed out, then its result, beside the phone. */
/* Its right edge meets the phone's left bezel, so it never covers the screen. */
.command { position: absolute; right: calc(50% + var(--hero-pw) / 2 - 12px); bottom: 14%; z-index: 2; display: grid; gap: 6px; min-width: 230px; padding: 12px 16px; font: 14px/1.4 var(--mono); }
.command .line { white-space: nowrap; }
.command .prompt { color: var(--muted); margin-right: 8px; }
.command .cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em; margin-left: 1px; background: var(--brand); }
.command .result { font: 600 14px/1.4 var(--font); color: var(--success); display: flex; align-items: center; gap: 6px; }
.command .result .icon { width: 18px; height: 18px; stroke-width: 2.2; }

/* ---------- Proof: connect, run, result, transfer ---------- */
.proof { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s8); align-items: center; }
.proof .tabs { display: grid; gap: var(--s1); }
.proof .tab {
  display: grid; grid-template-columns: 40px 1fr; gap: var(--s2); align-items: start; text-align: left; width: 100%;
  padding: var(--s2) var(--s3); border: 1px solid transparent; border-radius: var(--r-card); background: none; color: var(--text); font: inherit; cursor: pointer;
  transition: background var(--d-fast), border-color var(--d-fast), box-shadow var(--d-fast);
}
.proof .tab:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.proof .tab[aria-selected="true"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-card); }
.proof .tab .n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--subtle); color: var(--muted); font-weight: 700; font-size: 15px; transition: background var(--d-fast), color var(--d-fast); }
.proof .tab[aria-selected="true"] .n { background: var(--control); color: var(--on-control); }
.proof .tab .tab-title { display: block; font-size: var(--t-h3); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.proof .tab .tab-desc { display: block; margin-top: 4px; color: var(--muted); }
.proof .viewer { display: grid; place-items: center; }
.proof .viewer .phone { --pw: 290px; }
/* On narrow screens the steps sit in a row under the phone, and the chosen step's text shows here. */
.proof-caption { display: none; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.feature { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.feature.wide { grid-column: span 2; display: grid; grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr); align-items: center; gap: var(--s4); }
.feature-copy { display: grid; gap: var(--s1); }
.feature h3 { font-size: var(--t-h3); letter-spacing: -0.015em; }
.feature p { color: var(--muted); }
/* Specimens: what the feature looks like in use, in the hero command's voice. */
.specimen { margin-top: 0; padding: 12px 14px; border-radius: var(--r-control); background: var(--subtle); font: 13px/1.5 var(--mono); color: var(--text); }
.feature.wide .specimen { margin-top: 0; }
.status { display: inline-flex; align-items: center; gap: 4px; font: 600 13px/1.3 var(--font); white-space: nowrap; }
.status .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.status.ok { color: var(--success); }
.status.fail { color: var(--danger); }
.status.unknown { color: var(--warning); }
.runs { list-style: none; margin: 0; padding: 4px 14px; }
.runs li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) max-content; align-items: baseline; gap: var(--s2); padding-block: 9px; }
.runs li + li { border-top: 1px solid var(--line); }
.runs .what { font-family: var(--font); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runs .meta { color: var(--muted); font-size: 12px; }
.specimen .said { font-family: var(--font); font-size: 14px; margin-right: auto; }
.specimen:has(.said) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); }
.steps, .route { display: grid; gap: 10px; }
.steps ol, .route ol { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: flex; align-items: center; gap: 10px; padding-block: 7px; font: 500 14px/1.3 var(--font); }
.steps li + li { border-top: 1px solid var(--line); }
.steps .num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line); font: 600 12px/1 var(--font); color: var(--muted); }
.steps li .status { margin-left: auto; }
/* A route: each hop a node on one dashed line, the server at the end in Clear Blue. */
.route li { position: relative; padding: 0 0 12px 22px; font: 14px/1.3 var(--font); }
.route li::before { content: ""; position: absolute; left: 3px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1.5px var(--muted); }
.route li:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; border-left: 1.5px dashed color-mix(in srgb, var(--muted) 60%, transparent); }
.route li.end::before { background: var(--control); box-shadow: 0 0 0 1.5px var(--control); }
.route b { font-weight: 600; }
.route small { display: block; color: var(--muted); font: 12px/1.3 var(--mono); }

/* Snapshots: the app's own views, redrawn from its reference screens and tokens. */
.snap { margin-top: 0; border-radius: var(--r-control); overflow: hidden; font: 12px/1.45 var(--mono); }
.snap b { font-weight: 600; }
.snap small { display: block; font: 12px/1.35 var(--font); color: var(--muted); }
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tile-purple); }
.dot.teal { background: var(--tile-teal); }
/* Terminal: two sessions split, the key bar under them. */
.term { background: var(--console); color: var(--console-text); padding: 6px; box-shadow: 0 0 0 1px var(--line); }
.term .pane { border: 1.5px solid transparent; border-radius: 8px; padding: 0 8px 8px; }
.term .pane.on { border-color: var(--control); }
.term .pane + .pane { margin-top: 4px; border-top-color: rgba(229, 229, 234, 0.12); border-radius: 0 0 8px 8px; }
.term .pane-head { display: flex; align-items: center; justify-content: center; gap: 2px; padding-block: 6px; font: 600 12px/1.2 var(--font); }
.term .pane:not(.on) .pane-head { color: var(--console-muted); }
.term .pane-head .icon { width: 14px; height: 14px; color: var(--console-muted); }
.term pre { margin: 0; font: inherit; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.term .who { color: var(--console-user); }
.term .block { display: inline-block; width: 0.62em; height: 1.15em; vertical-align: -0.25em; border: 1.5px solid var(--console-cursor); border-radius: 1px; }
.keybar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 6px; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.keybar span { display: grid; place-items: center; height: 28px; border-radius: 7px; background: rgba(255, 255, 255, 0.12); font: 500 12px/1 var(--font); }
.keybar .icon { width: 14px; height: 14px; stroke-width: 2; }
/* Files: the split view, a file open in the viewer, a transfer under way. */
.feature.full { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.1fr) minmax(0, 1.2fr); align-items: stretch; gap: var(--s4); }
.feature.full .feature-copy { align-self: center; }
.feature.full .snap { margin-top: 0; }
.files { display: grid; background: var(--canvas); box-shadow: 0 0 0 1px var(--line); }
.fpane + .fpane { border-top: 1px solid var(--line); }
.fhead { display: flex; align-items: center; gap: 6px; padding: 10px 12px 4px; font: 13px/1.3 var(--font); white-space: nowrap; }
.fhead span { overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; }
.files ul { list-style: none; margin: 0; padding: 0 12px 6px; }
.files li { display: flex; align-items: center; gap: 10px; padding-block: 6px; font: 13px/1.25 var(--font); }
.files li b { font-weight: 500; }
.ficon { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ficon.folder { fill: var(--accent); stroke: none; }
.ficon.script { color: var(--tile-green); }
.ficon.file { color: var(--muted); }
.snap-stack { display: grid; grid-template-rows: 1fr auto; gap: var(--s2); }
.code { background: var(--code-bg); box-shadow: 0 0 0 1px var(--line); }
.code-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s1); padding: 10px 12px 0; font: 13px/1.3 var(--font); }
.code-head span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.code pre { margin: 0; padding: 8px 12px 12px; font: inherit; white-space: pre; overflow-x: auto; color: var(--text); }
.code .k { color: var(--syn-keyword); font-weight: 600; }
.code .s { color: var(--syn-string); }
.code .c { color: var(--syn-comment); }
.code .v { color: var(--syn-variable); }
.transfer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.transfer .badge { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--wash); color: var(--accent); }
.transfer .badge .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.transfer b { display: block; font: 600 14px/1.3 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer .bar { display: block; height: 4px; margin: 8px 0 6px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 18%, transparent); overflow: hidden; }
.transfer .bar i { display: block; width: var(--p); height: 100%; border-radius: inherit; background: var(--control); }
.transfer .t-foot { display: flex; justify-content: space-between; gap: var(--s1); font-variant-numeric: tabular-nums; }
.transfer .t-side { display: grid; justify-items: end; gap: 22px; }
.transfer .t-side small { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.transfer .stop { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--stop-wash); }
.transfer .stop::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--stop); }
.pro-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; vertical-align: 2px; }

/* ---------- Security ---------- */
.security { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--s10); align-items: center; }
.security .phone { --pw: 250px; justify-self: center; }
.key-stage { position: relative; display: grid; place-items: center; }
/* The trust moment the copy promises: the host key checked before anything is sent. */
.keycheck { right: auto; left: -8%; top: auto; bottom: 20%; min-width: 260px; }
.keycheck .fp { color: var(--muted); font-size: 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s4); }
.facts .icon { color: var(--brand); margin-bottom: var(--s1); }
.facts h3 { font-size: 17px; letter-spacing: -0.01em; }
.facts p { margin-top: 4px; color: var(--muted); font-size: 16px; }
.security .more { margin-top: var(--s5); }

/* ---------- Pro ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); max-width: 880px; margin-inline: auto; }
.plan { padding: var(--s5); display: flex; flex-direction: column; }
.plan.pro { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent), var(--shadow-card); }
.plan h3 { font-size: 24px; letter-spacing: -0.02em; }
.plan .sub { margin-top: 4px; color: var(--muted); }
.plan .plus { margin-top: var(--s3); font-weight: 600; }
.plan .plus + .ticks { margin-top: 12px; }
.plan .foot { margin-top: auto; padding-top: var(--s3); font-size: var(--t-caption); color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: 12px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.ticks li::before {
  content: ""; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%;
  background: var(--control) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.3l2.6 2.6L14 7.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.plans-note { margin-top: var(--s3); text-align: center; color: var(--muted); font-size: var(--t-caption); }
.plan .price { font-size: 16px; color: var(--text); }
.plans-cta { margin-top: var(--s4); display: flex; justify-content: center; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 64px; padding-block: var(--s2); cursor: pointer; list-style: none; font-weight: 600; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { flex: none; color: var(--muted); transition: transform var(--d-fast) var(--ease); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq .answer { padding-bottom: var(--s3); color: var(--muted); max-width: 62ch; }
/* Smooth height where the browser can animate details; elsewhere it opens at once. */
@supports (interpolate-size: allow-keywords) {
  .faq { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: clip; transition: height var(--d-base) var(--ease), content-visibility var(--d-base) allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}

/* ---------- Closing call ---------- */
.closing { text-align: center; padding-block: calc(var(--section) * 1.25); }
.closing .app-icon { width: 88px; height: 88px; margin: 0 auto var(--s3); border-radius: 22.37%; filter: drop-shadow(0 10px 24px rgba(15, 30, 60, 0.18)); }
.closing h2 { font-size: var(--t-h2); letter-spacing: -0.03em; line-height: 1.08; }
.closing .actions { margin-top: var(--s3); display: flex; justify-content: center; align-items: center; gap: var(--s4); }
/* On a computer, the App Store link can't install an iPhone app: the QR code hands it to the phone. Hidden on phones. */
.store-qr { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s1); font-size: var(--t-caption); color: var(--muted); }
.store-qr img { width: 112px; height: 112px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.closing .promise { margin-top: var(--s2); font-size: var(--t-caption); color: var(--muted); line-height: 1.6; }

/* The app icon keeps its corner; in dark mode a hairline keeps the dark icon's edge. */
@media (prefers-color-scheme: dark) { .brand img, .closing .app-icon { box-shadow: 0 0 0 1px var(--line); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: var(--t-caption); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); justify-content: space-between; align-items: center; padding-block: var(--s4) var(--s5); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.site-footer a { color: var(--muted); }

/* ---------- Reading pages: privacy, support, terms, contact ---------- */
.doc { max-width: var(--measure); margin: 0 auto; padding-block: var(--s8) var(--s12); }
.doc h1 { font-size: clamp(32px, 5vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: var(--s1); }
.doc .updated { color: var(--muted); font-size: 15px; margin-bottom: var(--s5); }
.doc .summary { font-size: 19px; margin-bottom: var(--s5); }
.doc h2 { font-size: 20px; letter-spacing: -0.01em; margin: var(--s5) 0 var(--s1); }
.doc p { margin-bottom: 14px; }
.doc ul { padding-left: 1.2em; margin: 0 0 14px; }
.doc li { margin-bottom: 6px; }
.doc .path { font-weight: 600; }
.doc .contact { margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--line); }
/* Links inside text are underlined, so colour isn't the only cue. */
.doc p a, .doc li a { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.18em; }
.not-found { text-align: center; padding-block: var(--s16); }
.not-found h1 { font-size: var(--t-h2); letter-spacing: -0.03em; }
.not-found p { margin: var(--s2) auto var(--s4); color: var(--muted); max-width: 30rem; }

/* Contact: the form writes an email for the visitor's mail app. */
.contact-form { display: grid; gap: var(--s3); }
.contact-form .topics { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-form legend { font-weight: 600; margin: 0 0 10px; padding: 0; }
.contact-form .topics label { position: relative; }
.contact-form .topics input { position: absolute; opacity: 0; }
.contact-form .topics span { display: block; padding: 14px 16px; border-radius: var(--r-control); background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color var(--d-fast), background var(--d-fast); }
.contact-form .topics span:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.contact-form .topics input:checked + span { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: color-mix(in srgb, var(--brand) 8%, var(--surface)); font-weight: 600; }
.contact-form .topics input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.contact-form .field { display: grid; gap: var(--s1); }
.contact-form .field > span { font-weight: 600; }
.contact-form .field em { font-style: normal; font-weight: 400; color: var(--muted); }
.contact-form input[type="text"], .contact-form textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control); padding: 12px 14px; resize: vertical; }
.contact-form input[type="text"]:focus, .contact-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.contact-form ::placeholder { color: var(--muted); opacity: 0.8; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.contact-form .error { color: var(--danger); font-size: 15px; }
.contact-form .hint { margin: 0; padding: 14px 16px; border-radius: var(--r-control); background: color-mix(in srgb, var(--brand) 9%, transparent); font-size: 16px; }
.contact-form .hint a, .contact-form .fallback a { text-decoration: underline; text-underline-offset: 0.18em; }
.contact-form .button { justify-self: start; }
.contact-form .fallback { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --section: var(--s12); }
  .hero { grid-template-columns: 1fr; gap: var(--s5); padding-block: var(--s5) var(--s10); }
  .hero h1 { max-width: 13ch; }
  .proof { grid-template-columns: 1fr; gap: var(--s3); }
  .proof .viewer { order: -1; }
  .proof .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; max-width: 32rem; width: 100%; margin-inline: auto; }
  .proof .tab { grid-template-columns: 1fr; justify-items: center; gap: 6px; padding: 10px 4px; text-align: center; }
  .proof .tab .tab-title { font-size: 15px; }
  .proof .tab .tab-desc { display: none; }
  .proof-caption { display: block; max-width: 30rem; min-height: 4.65em; margin-inline: auto; text-align: center; color: var(--muted); }
  .features { grid-template-columns: 1fr 1fr; }
  .feature.full { grid-template-columns: 1fr 1fr; }
  .feature.full .feature-copy { grid-column: 1 / -1; }
  .keycheck { left: calc(50% - 250px); }
  .security { grid-template-columns: 1fr; gap: var(--s6); }
  .security .key-stage { order: 2; }
}
@media (max-width: 720px) {
  .store-qr { display: none; }
  :root { --section: var(--s8); --gutter: var(--s2); }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: var(--s1) var(--gutter) var(--s2); background: var(--canvas); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding-block: 12px; font-size: 17px; color: var(--text); }
  /* "Get the app" stays in the bar on phones; the menu holds the rest. */
  .site-header .wrap { gap: var(--s1); }
  .menu-button { display: grid; order: 1; }
  .hero { padding-top: var(--s3); }
  .stage { --hero-pw: 228px; }
  .command { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin-top: var(--s2); min-width: 0; font-size: 13px; padding: 10px 12px; }
  .hero .actions { flex-direction: column; align-items: flex-start; gap: var(--s1); }
  .hero .actions .quiet { margin-left: calc(-1 * var(--s2)); }
  .proof .viewer .phone { --pw: 240px; }
  .proof .tab { padding: 14px var(--s2); }
  .features { grid-template-columns: 1fr; }
  .feature { padding: var(--s3); }
  .feature.wide, .feature.full { grid-column: auto; grid-template-columns: 1fr; gap: var(--s3); }
  .runs li { grid-template-columns: 6.25rem minmax(0, 1fr); row-gap: 0; }
  .runs .what { white-space: normal; }
  .runs .meta { grid-column: 2; }
  .code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .facts { grid-template-columns: 1fr; gap: var(--s3); }
  .plans { grid-template-columns: 1fr; }
  .plan { padding: var(--s3); }
  .contact-form .topics, .contact-form .row { grid-template-columns: 1fr; }
  .contact-form .button { justify-self: stretch; }
}

/* ---------- Motion: only when allowed, only with JavaScript ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(var(--rise)); transition: opacity var(--d-slow) var(--ease), transform var(--d-slow) var(--ease); transition-delay: var(--delay, 0ms); }
  .js [data-reveal].in { opacity: 1; transform: none; }
  .hero-copy > * { animation: rise var(--d-base) var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: 70ms; }
  .hero-copy > :nth-child(3) { animation-delay: 140ms; }
  .hero-copy > :nth-child(4) { animation-delay: 210ms; }
  .stage .phone { animation: settle var(--d-slow) var(--ease) 150ms both; }
  .stage .mark .lo { animation: fade var(--d-slow) ease-out both; }
  .stage .mark .hi { animation: launch 1000ms var(--ease) 350ms both; }
  .stage .command { animation: rise var(--d-base) var(--ease) 700ms both; }
  .stage .command .cursor { animation: blink 1s steps(1) infinite; }
  .js .stage .command .result { opacity: 0; transform: translateY(4px); transition: opacity var(--d-base) var(--ease), transform var(--d-base) var(--ease); }
  .js .stage .command.done .result { opacity: 1; transform: none; }
  .js .stage .command.done .cursor { animation: none; opacity: 0; }
  /* The hero phone moves a few pixels slower than the page (site.js sets --drift). */
  .stage .phone-wrap { transform: translateY(var(--drift, 0px)); }
  @keyframes rise { from { opacity: 0; transform: translateY(var(--rise)); } }
  @keyframes settle { from { opacity: 0; transform: translateY(40px) scale(0.98); } }
  @keyframes fade { from { opacity: 0; } }
  @keyframes launch { from { opacity: 0; transform: translate(-60px, 42px); } }
  @keyframes blink { 50% { opacity: 0; } }
}
/* Reduced motion, or no JavaScript: the command shows complete and nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .command .cursor { display: none; }
  .phone .display picture { transition: none; }
}
