/* ============================================================================
   kb — marketing site styles (site.css)

   Loads AFTER css/tokens.css. Every color / size / radius / motion value that
   exists as a design token is referenced via var(--token); this file never
   hardcodes a brand color. Covers index.html and app-store.html.

   Aesthetic contract: first-party Apple utility page. Calm, lots of whitespace,
   FLAT — content cards carry NO shadow. The only elevation is .app-window
   (var(--shadow-window)) and the nav's 1px separator. The only color story is
   the red->green heatmap keyboard + the single sky-blue accent.

   Table of contents:
     1.  Reset / base
     2.  Layout primitives (.container, section rhythm)
     3.  Typography helpers (eyebrow / heads / lead / mono numbers)
     4.  Buttons + links
     5.  Navigation (sticky translucent)
     6.  Hero
     7.  Hero keyboard (frozen contract)
     8.  Heatmap explainer (key strip + legend)
     9.  Feature grid
     10. Dark showcase band + .app-window frame
     11. Stat callouts
     12. CTA tint band
     13. Footer
     14. Motion (.fade-up)
     15. App Store page components
     16. Responsive (mobile rhythm, nav, grids)
     17. Reduced motion
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. Reset / base
   ------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky nav is ~64px tall; offset in-page anchors so heads aren't hidden. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-web-body);
  line-height: var(--lh-web-body);
  font-weight: var(--fw-web-body);
  color: var(--fg1);
  background: var(--window-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Theme + surface swaps glide rather than snap when toggling dark mode. */
  transition: background-color var(--fade-medium), color var(--fade-medium);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ----------------------------------------------------------------------------
   2. Layout primitives
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Section vertical rhythm: 120px desktop, 72px mobile (see media query). */
section {
  padding-block: var(--space-120);
}

/* Centered intro stack (eyebrow + head + lead) used at the top of sections. */
.section-head {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}
.section-head .lead { margin-top: var(--space-16); }

/* ----------------------------------------------------------------------------
   3. Typography helpers
   ------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-eyebrow);
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-16);
}

h1, .h-display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  font-weight: var(--fw-display);
  letter-spacing: -0.03em;
}

h2, .h-section {
  font-size: var(--fs-section);
  line-height: var(--lh-section);
  font-weight: var(--fw-section);
  letter-spacing: -0.02em;
}

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  font-weight: var(--fw-lead);
  color: var(--fg2);
}

/* Mono, tabular numerals — every wpm / % / count / version on the page. */
.num,
.stat-value,
.kb-key span,
.legend-key {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ----------------------------------------------------------------------------
   4. Buttons + links
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--fs-web-body);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--fade-quick),
              color var(--fade-quick),
              transform var(--fade-quick),
              border-color var(--fade-quick);
}

.btn-primary {
  background: var(--accent);
  color: var(--fg-on-accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--accent-tint-08);
  color: var(--accent);
  border-color: transparent;
}
.btn-secondary:hover { background: var(--accent-tint-15); }
.btn-secondary:active { transform: scale(0.97); }

/* On the dark showcase band a secondary button needs a visible edge. */
.is-dark .btn-secondary {
  border-color: var(--separator);
}

/* Inline text links: accent, underline on hover only. */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--fade-quick);
}
a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------------------
   5. Navigation — sticky translucent
   ------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--window-bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--fade-medium), background-color var(--fade-medium);
}
/* main.js adds .is-scrolled past a small scroll — subtle separator only. */
.nav.is-scrolled { border-bottom-color: var(--separator); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  height: 64px;
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg1);
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }

/* Links container — flexes to fill, pushing actions to the right. */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-24);
  margin-left: var(--space-16);
  flex: 1;
}
.nav-link {
  color: var(--fg2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { color: var(--fg1); text-decoration: none; }

/* Right-aligned action cluster (theme toggle + CTA). */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-left: auto;
}

.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg2);
  cursor: pointer;
  transition: background-color var(--fade-quick), color var(--fade-quick);
}
.theme-toggle:hover,
.nav-toggle:hover { background: var(--control-bg); color: var(--fg1); }
.theme-toggle svg,
.nav-toggle svg { width: 18px; height: 18px; }

/* Hamburger is hidden on desktop, shown at the mobile breakpoint. */
.nav-toggle { display: none; }

/* Compact nav CTA (smaller than section CTAs). */
.nav .btn { padding: 9px 18px; font-size: 15px; }

/* ----------------------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  text-align: center;
  overflow: hidden;
  /* a touch more breathing room above the fold */
  padding-block: var(--space-120) var(--space-120);
}

/* Faint accent radial wash behind the hero — tasteful, low alpha, no blob. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 12%,
      var(--accent-tint-08) 0%,
      transparent 70%);
  pointer-events: none;
}

.hero .container { position: relative; }

.hero h1 {
  max-width: 22ch;
  margin-inline: auto;
}

.hero .lead {
  max-width: 56ch;
  margin: var(--space-24) auto 0;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-16);
  margin-top: var(--space-32);
}

.hero-microcopy {
  margin-top: var(--space-16);
  font-size: 15px;
  color: var(--fg3);
}

/* ----------------------------------------------------------------------------
   7. Hero keyboard — FROZEN CONTRACT
   keyboard.js builds rows of keys into #hero-keyboard; sets per-key --w and
   inline heat background/color. site.css owns geometry, neutral mods, focus
   ring, and the press transform.
   ------------------------------------------------------------------------- */
.kb-keyboard {
  /* --kb-unit is the width of a 1u key; everything scales from it. */
  --kb-unit: 46px;
  --kb-gap: 6px;
  display: flex;
  flex-direction: column;
  gap: var(--kb-gap);
  align-items: center;
  margin: var(--space-48) auto 0;
  max-width: 100%;
}

.kb-row {
  display: flex;
  gap: var(--kb-gap);
  justify-content: center;
  align-items: stretch;
}

/* The single gap between the left-hand and right-hand groups (split QWERTY). */
.kb-split {
  width: calc(var(--kb-unit) * 0.5);
  flex: 0 0 auto;
}

.kb-key {
  /* width driven by per-key --w unit count from keyboard.js (default 1) */
  width: calc(var(--w, 1) * var(--kb-unit) + (var(--w, 1) - 1) * var(--kb-gap));
  height: var(--kb-unit);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--key-stroke);
  border-radius: var(--radius-sm);
  background: var(--control-bg);
  color: var(--fg1);
  font-family: var(--font-mono);
  font-size: calc(var(--kb-unit) * 0.32);
  line-height: 1;
  cursor: pointer;
  user-select: none;
  /* Heat re-paints are instant; only the press scale animates (rM aside). */
  transition: transform var(--fade-quick), box-shadow var(--fade-quick);
}
.kb-key span { pointer-events: none; }

/* Pressed (real keydown / tap) — brief springy dip. keyboard.js may toggle
   a transient class; :active covers pointer presses for free. */
.kb-key:active,
.kb-key.is-pressed { transform: scale(0.92); }

/* Modifier / space keys: neutral, never heat-colored. */
.kb-key--mod {
  background: var(--control-bg);
  color: var(--fg2);
  font-size: calc(var(--kb-unit) * 0.26);
  cursor: default;
}

/* Focus / "next" key: 2px accent ring + accent tint, regardless of heat. */
.kb-key.is-focus {
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--accent-tint-15);
  color: var(--fg1);
  z-index: 1;
}

.kb-keyboard-hint {
  margin-top: var(--space-20);
  text-align: center;
  font-size: 15px;
  color: var(--fg3);
  min-height: 1.4em; /* reserve space so the invite text doesn't shift layout */
}

/* Hero mastery bar — fills green as the simulated typist masters the board.
   Mirrors the app's idea: green = you can hit it at your target speed.
   keyboard.js sets .kb-progress-fill width + the % value live; the static
   markup defaults to full so no-JS / reduced-motion shows the mastered state. */
.kb-progress {
  width: 100%;
  max-width: 600px;
  margin: var(--space-24) auto 0;
}
.kb-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}
.kb-progress-label {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-eyebrow);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg2);
}
.kb-progress-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.kb-progress-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--tertiary-bg);
  overflow: hidden;
}
.kb-progress-fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--heat-high), var(--success));
  box-shadow: 0 0 12px rgba(52, 199, 89, 0.45);
}

/* ----------------------------------------------------------------------------
   8. Heatmap explainer — static key strip + legend
   ------------------------------------------------------------------------- */
.heat-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  margin: var(--space-48) auto 0;
  max-width: 760px;
}

/* Each badge: a small heat-tinted key. Colored inline via --heat-* tokens or
   a data-c handed to keyboard.js. White text reads on the warmer (red) end. */
.legend-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--key-stroke);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-on-accent);
  background: var(--heat-50);
}
/* Higher-confidence badges (green end) carry letter labels meant to be read.
   var(--fg1) is near-white in dark mode and fails WCAG AA on light green, so
   use a FIXED dark text color (var(--ink-bg), dark in BOTH themes) instead.
   keyboard.js mirrors this for any data-c-colored badge it paints. */
.legend-key.is-warm { color: var(--ink-bg); }

.legend-key.is-focus {
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--accent-tint-15);
  color: var(--fg1);
}
/* "Not yet unlocked" — dimmed, neutral, with a faint cross hatch feel. */
.legend-key.is-locked {
  background: var(--key-excluded);
  border-color: var(--separator);
  color: var(--fg3);
}

/* Hero keys at the green end get .is-warm from keyboard.js too; keep their
   glyphs dark in both themes for the same contrast reason as the badges.
   (heat.js returns var(--fg1) inline for c>=0.6; keyboard.js overrides the
   inline color with this fixed dark token, so no !important is needed here —
   this rule documents the intent and covers any non-inline path.) */
.kb-key.is-warm { color: var(--ink-bg); }

/* Horizontal legend: the 5 meaning items with swatches. */
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-24);
  margin: var(--space-32) auto 0;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 15px;
  color: var(--fg2);
}
.legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--key-stroke);
  flex: 0 0 auto;
}
/* Swatch variants — set the actual color inline or via these helpers. */
.legend-swatch.is-low    { background: var(--heat-low); }
.legend-swatch.is-mid    { background: var(--heat-50); }
.legend-swatch.is-high   { background: var(--heat-high); }
.legend-swatch.is-focus  { background: var(--accent-tint-15); box-shadow: inset 0 0 0 2px var(--accent); }
.legend-swatch.is-locked { background: var(--key-excluded); border-color: var(--separator); }

/* ----------------------------------------------------------------------------
   9. Feature grid — flat 2x2 cards
   ------------------------------------------------------------------------- */
.features {
  background: var(--control-bg);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-32);
  margin-top: var(--space-48);
}

.feature-card {
  /* FLAT: 1px separator border, no shadow. Hierarchy from the window-bg fill. */
  background: var(--window-bg);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 30px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-tint-08);
  color: var(--accent);
  margin-bottom: var(--space-20);
}
.feature-icon svg { width: 24px; height: 24px; }

.feature-card h3 {
  font-size: var(--fs-feature);
  font-weight: var(--fw-feature);
  letter-spacing: -0.01em;
  color: var(--fg1);
  margin-bottom: var(--space-8);
}
.feature-card p {
  color: var(--fg2);
  font-size: var(--fs-web-body);
  line-height: var(--lh-web-body);
}

/* ----------------------------------------------------------------------------
   10. Dark showcase band + .app-window frame
   ------------------------------------------------------------------------- */
.showcase {
  background: var(--ink-bg);
  color: #f5f5f7;        /* fixed light text — this band is always dark */
}
.showcase .lead { color: rgba(245, 245, 247, 0.66); }
.showcase .eyebrow { color: var(--accent); }
.showcase h2 { color: #f5f5f7; }

/* Aura backdrop holds the app-in-window screenshot over a soft gradient PNG. */
.showcase-stage {
  position: relative;
  margin-top: var(--space-48);
  padding: clamp(24px, 6vw, 72px);
  border-radius: var(--radius-lg);
  background-image: url("../assets/bg_aurora.png");
  background-size: cover;
  background-position: center;
}

/* The ONLY content-area shadow on the site. Screenshots already include OS
   chrome (traffic lights), so the frame is just rounded corners + shadow. */
.app-window {
  display: block;
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-window);
}
.app-window img { display: block; width: 100%; height: auto; }

/* ----------------------------------------------------------------------------
   11. Stat callouts
   ------------------------------------------------------------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-32);
  margin-top: var(--space-48);
}
.stat {
  text-align: center;
}
.stat-value {
  font-size: var(--fs-stat);
  font-weight: var(--fw-stat);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}
/* Optional semantic recolor of an individual stat number. */
.stat-value.is-success { color: var(--success); }
.stat-value.is-fg1 { color: var(--fg1); }

.stat-label {
  margin-top: var(--space-12);
  font-size: 15px;
  color: var(--fg2);
}

.stat-note {
  margin-top: var(--space-32);
  text-align: center;
  color: var(--fg3);
  font-size: 15px;
}

/* ----------------------------------------------------------------------------
   12. CTA tint band
   ------------------------------------------------------------------------- */
.cta-band {
  background: var(--accent-tint-08);
  text-align: center;
}
.cta-band .btn { margin-top: var(--space-24); }
.cta-band .cta-microcopy {
  margin-top: var(--space-16);
  color: var(--fg2);
  font-size: 15px;
}

/* ----------------------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--separator);
  padding-block: var(--space-48);
  color: var(--fg2);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-24);
}
.footer-brand {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--fg1);
  text-decoration: none;
}
.footer-brand:hover { text-decoration: none; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-24);
}
.footer-links a {
  color: var(--fg2);
  font-size: 15px;
  text-decoration: none;
}
.footer-links a:hover { color: var(--fg1); text-decoration: underline; }
.footer-copy {
  margin-left: auto;
  font-size: 15px;
  color: var(--fg3);
}

/* ----------------------------------------------------------------------------
   14. Motion — fade-up on scroll (the only general motion)
   ------------------------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms ease, transform 400ms ease;
  will-change: opacity, transform;
}
.fade-up.is-visible {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------------------------------------------
   15. App Store page components (app-store.html)
   Shares the nav/footer/tokens; these classes recreate a calm Mac App Store
   product page. Prefix: .as-
   ------------------------------------------------------------------------- */
.as-page section { padding-block: var(--space-48); }
.as-page section:first-of-type { padding-top: var(--space-72); }

/* Header: icon + identity + Get button + price/compat line. */
.as-header {
  display: flex;
  align-items: center;
  gap: var(--space-32);
  flex-wrap: wrap;
}
.as-icon {
  width: 120px;
  height: 120px;
  border-radius: 22%;     /* App Store "squircle"-ish corner */
  flex: 0 0 auto;
}
.as-identity { flex: 1; min-width: 240px; }
/* The app name is the page's <h1> (h1.as-name). It must NOT inherit the hero
   --fs-display sizing from the bare `h1` rule; this rule wins on specificity
   (.as-name + element) and restores the App Store-product 32px wordmark. */
.as-name,
h1.as-name {
  font-family: var(--font-mono);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg1);
}
.as-subtitle {
  margin-top: var(--space-4);
  font-size: var(--fs-lead);
  color: var(--fg2);
}
.as-developer {
  margin-top: var(--space-8);
  font-size: 15px;
  color: var(--accent);
}
.as-actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin-top: var(--space-16);
}
.as-price {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--fg3);
}

/* Meta strip: 5 cells separated by 1px dividers. */
.as-meta {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
  margin-top: var(--space-32);
}
.as-meta-cell {
  flex: 1;
  min-width: 120px;
  padding: var(--space-16) var(--space-12);
  text-align: center;
  border-left: 1px solid var(--separator);
}
.as-meta-cell:first-child { border-left: 0; }
.as-meta-cell .as-meta-value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--fg1);
}
.as-meta-cell .as-meta-label {
  margin-top: var(--space-4);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg3);
}

/* Horizontal scrolling screenshot gallery (16:10 mac frames). */
.as-gallery {
  display: flex;
  gap: var(--space-16);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--space-12);
  -webkit-overflow-scrolling: touch;
}
.as-shot {
  flex: 0 0 auto;
  width: min(560px, 80vw);
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--separator);
  background: var(--control-bg);
}
.as-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Generic App-Store text section (What's New, Description). */
.as-section { border-top: 1px solid var(--separator); }
.as-section h2 {
  font-size: var(--fs-feature);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg1);
  margin-bottom: var(--space-16);
}
.as-version {
  display: flex;
  gap: var(--space-16);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--fg3);
  margin-bottom: var(--space-12);
}
.as-body p {
  color: var(--fg2);
  font-size: var(--fs-web-body);
  line-height: var(--lh-web-body);
  max-width: 64ch;
}
.as-body p + p { margin-top: var(--space-16); }

/* Information table: 2-column rows. */
.as-info {
  width: 100%;
  border-collapse: collapse;
}
.as-info tr { border-top: 1px solid var(--separator); }
.as-info tr:first-child { border-top: 0; }
.as-info th,
.as-info td {
  padding: var(--space-12) 0;
  text-align: left;
  vertical-align: top;
  font-weight: 400;
  font-size: var(--fs-web-body);
}
.as-info th {
  color: var(--fg2);
  width: 40%;
}
.as-info td {
  color: var(--fg1);
  text-align: right;
}

/* App Privacy "Data Not Collected" card — flat, 1px border, no shadow. */
.as-privacy {
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 30px;
  background: var(--window-bg);
}
.as-privacy-title {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  font-size: var(--fs-feature);
  font-weight: 600;
  color: var(--fg1);
  margin-bottom: var(--space-12);
}
.as-privacy-title svg { width: 24px; height: 24px; color: var(--success); flex: 0 0 auto; }
.as-privacy p {
  color: var(--fg2);
  font-size: var(--fs-web-body);
  line-height: var(--lh-web-body);
  max-width: 64ch;
}

/* Small disclaimer footnote. */
.as-footnote {
  font-size: 13px;
  color: var(--fg3);
  max-width: 64ch;
}

/* ----------------------------------------------------------------------------
   16. Responsive
   ------------------------------------------------------------------------- */

/* --- Tablet / small desktop: shrink the hero keyboard unit --- */
@media (max-width: 880px) {
  .kb-keyboard { --kb-unit: 38px; }
}

/* --- Mobile (<= 720px) --- */
@media (max-width: 720px) {
  /* Section rhythm 120 -> 72 */
  section { padding-block: var(--space-72); }
  .hero { padding-block: var(--space-72); }
  .as-page section { padding-block: var(--space-32); }

  /* Type scale steps down so the hero fits a 375px viewport */
  h1, .h-display { font-size: 40px; }
  h2, .h-section { font-size: 30px; }
  .lead { font-size: 18px; }
  .stat-value { font-size: 40px; }
  .as-name,
  h1.as-name { font-size: 26px; }

  /* Mobile nav: hide inline links, reveal hamburger; links drop into a panel */
  .nav-toggle { display: inline-flex; }
  .nav .btn { display: none; }            /* CTA lives in the open panel */
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: var(--space-8) var(--gutter) var(--space-16);
    background: var(--window-bg);
    border-bottom: 1px solid var(--separator);
    /* collapsed by default; main.js adds .is-open */
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-link {
    padding: var(--space-12) 0;
    border-bottom: 1px solid var(--separator);
    font-size: 17px;
  }
  /* Show a full-width CTA at the bottom of the open mobile panel. */
  .nav-links .btn {
    display: inline-flex;
    margin-top: var(--space-16);
    width: 100%;
  }

  /* Feature grid + stats collapse to one column */
  .feature-grid { grid-template-columns: 1fr; gap: var(--space-20); }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: var(--space-32); }

  /* Hero keyboard scales further on phones */
  .kb-keyboard { --kb-unit: 26px; --kb-gap: 4px; }
  .legend-key { width: 32px; height: 32px; }

  /* Footer stacks */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--space-16); }
  .footer-copy { margin-left: 0; }

  /* App Store header centers and stacks */
  .as-header { flex-direction: column; text-align: center; }
  .as-actions { justify-content: center; }
  .as-meta-cell { min-width: 50%; border-left: 0; border-top: 1px solid var(--separator); }
  .as-meta-cell:first-child,
  .as-meta-cell:nth-child(2) { border-top: 0; }
  .as-info th, .as-info td { font-size: 15px; }
}

/* --- Very narrow phones (~375 and below): single-column stats --- */
@media (max-width: 420px) {
  .stat-row { grid-template-columns: 1fr; gap: var(--space-24); }
}

/* ----------------------------------------------------------------------------
   17. Reduced motion — honor the OS preference
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
  .fade-up { opacity: 1; transform: none; transition: none; }
  .kb-key:active,
  .kb-key.is-pressed { transform: none; }
}
