/* RemBrowse site, in an Apple-like style: one sans-serif face with large, tight headlines,
 * centred statements, a bento of highlights, pill buttons and generous space.
 *
 * Follows the system's dark or light setting. Every component uses the semantic tokens below,
 * never raw colours, so both themes stay paired; gold (from the logo) is the one accent. The
 * app window in the demo keeps the app's own dark colours (--app-*) in both themes.
 * Spacing is a 4/8 px scale; breakpoints 480, 768, 1024, 1440. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark light;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem; /* 17 px body, as Apple's pages use */
  --fs-lg: 1.1875rem;
  --fs-xl: 1.3125rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fs-tile: clamp(1.75rem, 2.8vw, 2.5rem);
  --fs-section: clamp(2.5rem, 6vw, 4rem);
  --fs-display: clamp(3.5rem, 11vw, 7rem);
  --fs-sub: clamp(1.25rem, 2.6vw, 1.75rem);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-tile: 28px;
  --r-pill: 980px;
  --z-grip: 3;
  --z-nav: 40;
  --z-skip: 100;
  --nav-h: 52px;
  --gutter: var(--s-4);
  --wrap: 1080px;
  --wrap-wide: 1200px;
  --dur-press: 120ms;
  --dur-state: 200ms;
  --dur-reveal: 800ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: var(--font);
  /* Only for the web page shown inside the demo window */
  --serif: Georgia, "Times New Roman", serif;

  /* Dark */
  --bg: #000000;
  --bg-alt: #0b0b0c;
  --nav-bg: rgb(0 0 0 / 0.86);
  --tile: #1c1c1e;
  --card: #1c1c1e;
  --raised: #2c2c2e;
  --line: rgb(255 255 255 / 0.12);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #86868b;
  --accent: #e2b36d;
  --accent-strong: #f2d08f;
  --gold-gradient: linear-gradient(95deg, #f6dca8 0%, #e2b36d 45%, #b9823a 100%);
  --pill-bg: linear-gradient(180deg, #f0cd8a, #dcaa5e);
  --pill-bg-hover: linear-gradient(180deg, #f6d99c, #e3b46a);
  --on-pill: #1d1206;
  --pill-2-line: rgb(226 179 109 / 0.6);
  --seg-bg: #1c1c1e;
  --seg-text: #a1a1a6;
  --seg-on: #f5f5f7;
  --on-seg-on: #000000;
  --glow: rgb(108 32 56 / 0.5);
  --shadow-win: 0 0 0 1px rgb(255 255 255 / 0.1), 0 50px 100px -40px rgb(0 0 0 / 0.9), 0 30px 140px -40px rgb(108 32 56 / 0.55);
  --shadow-shot: 0 30px 60px -30px rgb(0 0 0 / 0.8);

  /* The app itself (demo window, terminal, phone): dark in both themes */
  --app-chrome: #14161b;
  --app-surface: #1c1f26;
  --app-surface-high: #2d323d;
  --app-line: #2e323c;
  --app-line-strong: #3d4250;
  --app-text: #f2f3f5;
  --app-muted: #a7adb8;
  --app-rose: #d9a3b3;
  --app-maroon: #6c2038;
  --app-maroon-2: #8c3d58;
  --app-on-maroon: #ffe9ee;
  --phone-bezel: #07080a;
  --grip-dot: #f4cbd7;
  --paper: #f5f4f1;
  --paper-line: #e2dfda;
  --ink: #1d1e22;
  --ink-muted: #4a4c53;
  --ink-accent: #8a2846;
  --navy: #0a1322;
  --navy-line: #1b2840;
  --term: #7ee2a8;
  --term-text: #b9f1d0;
  --term-head: #e6edf7;
  --term-dim: #8796ad;
  --term-path: #8fb6ff;
  --term-warn: #f2c37a;
  --video-bg: #050506;
  --start-text: #f6f1f3;
  --start-muted: #e3d3d9;
  --elev-3: var(--shadow-win);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --nav-bg: rgb(255 255 255 / 0.88);
    --tile: #ffffff;
    --card: #f5f5f7;
    --raised: #e8e8ed;
    --line: rgb(0 0 0 / 0.1);
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #6e6e73;
    --accent: #85591a;
    --accent-strong: #6e4a12;
    --gold-gradient: linear-gradient(95deg, #a8742c 0%, #85591a 50%, #5f3f0e 100%);
    --pill-2-line: rgb(133 89 26 / 0.6);
    --seg-bg: #e8e8ed;
    --seg-text: #5f6066;
    --seg-on: #1d1d1f;
    --on-seg-on: #ffffff;
    --glow: rgb(138 40 70 / 0.16);
    --shadow-win: 0 50px 100px -40px rgb(0 0 0 / 0.45), 0 30px 140px -50px rgb(138 40 70 / 0.35);
    --shadow-shot: 0 24px 48px -24px rgb(0 0 0 / 0.35);
  }
}

@media (min-width: 768px) {
  :root {
    --gutter: var(--s-5);
  }
}
@media (min-width: 1024px) {
  :root {
    --gutter: var(--s-6);
  }
}

/* ---------- Base ---------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchors and focused controls are never hidden under the sticky bar */
  scroll-padding-top: calc(var(--nav-h) + var(--s-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base) / 1.47 var(--font);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a,
button,
summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code,
kbd,
pre {
  font-family: var(--mono);
  letter-spacing: 0;
}

.ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: var(--z-skip);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-pill);
  background: var(--pill-bg);
  color: var(--on-pill);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: var(--s-2);
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap-wide {
  max-width: calc(var(--wrap-wide) + 2 * var(--gutter));
}
.center {
  text-align: center;
}

/* ---------- Buttons ---------- */

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--pill-bg);
  color: var(--on-pill);
  font: 600 var(--fs-base) / 1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background var(--dur-state) var(--ease-out);
}
.pill:hover {
  background: var(--pill-bg-hover);
}
.pill:active,
.seg:active,
.round-btn:active,
.copy-btn:active {
  transform: scale(0.97);
}
.pill .ic {
  width: 18px;
  height: 18px;
}
/* Small pill in the bar: drawn 32 px tall, but its hit area is 44 px */
.pill-sm {
  min-height: 32px;
  padding: 0 var(--s-4);
  font-size: var(--fs-sm);
}
.pill-sm::after {
  content: "";
  position: absolute;
  inset: -6px -4px;
}
.pill-block {
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 0 var(--s-2);
  color: var(--accent);
  font-size: var(--fs-lg);
  text-decoration: none;
}
.link-more:hover {
  text-decoration: underline;
}
.link-more .ic {
  width: 18px;
  height: 18px;
}

/* ---------- Bar ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  min-height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-brand img {
  width: 28px;
  height: 28px;
}
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-2);
  color: var(--text);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.nav-link:hover {
  text-decoration: underline;
}
@media (max-width: 479px) {
  .nav-link {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 112px) 0 clamp(64px, 9vw, 120px);
  isolation: isolate;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: -1;
  width: min(1400px, 160vw);
  height: 900px;
  background: radial-gradient(closest-side, var(--glow), transparent);
  transform: translateX(-50%);
  pointer-events: none;
}
.eyebrow {
  color: var(--accent);
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.hero h1 {
  margin-top: var(--s-3);
  font-size: var(--fs-display);
  line-height: 1;
  letter-spacing: -0.045em;
}
.gradient {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.04em;
}
.subhead {
  max-width: 30ch;
  margin: var(--s-5) auto 0;
  font-size: var(--fs-sub);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-3) var(--s-5);
  margin-top: var(--s-6);
}
.fineprint {
  margin-top: var(--s-3);
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

/* ---------- The split-view demo ---------- */

.demo {
  margin-top: clamp(48px, 7vw, 88px);
}
.win {
  --rail: 52px;
  --bar: 52px;
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: var(--bar) minmax(0, 1fr);
  aspect-ratio: 16 / 9.4;
  min-height: 300px;
  border-radius: var(--r-xl);
  background: var(--app-chrome);
  border: 1px solid var(--app-line-strong);
  box-shadow: var(--elev-3);
  overflow: hidden;
  color: var(--app-text);
}
.win-rail {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) 0;
  border-right: 1px solid var(--app-line);
}
.rail-chip {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  color: var(--app-muted);
  font: 600 var(--fs-xs) var(--sans);
}
.rail-chip.is-on {
  position: relative;
  background: var(--app-surface-high);
  color: var(--app-text);
}
.rail-chip.is-on::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--app-rose);
}
.rail-chip img {
  width: 20px;
  height: 20px;
}
.rail-chip .ic {
  width: 16px;
  height: 16px;
}
.rail-sep {
  width: 20px;
  height: 1px;
  background: var(--app-line);
  margin: var(--s-1) 0;
}
.win-bar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-3) 0 var(--s-2);
  color: var(--app-muted);
}
.win-bar .ic {
  width: 18px;
  height: 18px;
}
.addr {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  height: 32px;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  color: var(--app-text);
  font-size: var(--fs-sm);
}
.addr .ic {
  width: 14px;
  height: 14px;
  color: var(--app-muted);
}
.addr span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.split-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  height: 32px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  background: var(--app-maroon);
  border: 1px solid var(--app-maroon-2);
  color: var(--app-on-maroon);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.split-pill .ic {
  width: 16px;
  height: 16px;
}

.stage {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  margin: 0 var(--s-2) var(--s-2) var(--s-1);
}
.pane {
  --x: 0;
  --y: 0;
  --w: 50;
  --h: 100;
  position: absolute;
  left: calc(var(--x) * 1% + 4px);
  top: calc(var(--y) * 1% + 4px);
  width: calc(var(--w) * 1% - 8px);
  height: calc(var(--h) * 1% - 8px);
  border-radius: 10px;
  border: 1px solid var(--app-line);
  overflow: hidden;
  container-type: size;
  /* Moves and fades are animated from script with transforms and opacity (site.js, morph) */
  transform-origin: 0 0;
}
.pane.is-active {
  border-color: var(--app-rose);
  box-shadow: 0 0 0 1px rgb(217 163 179 / 0.35);
}
.grip {
  --gx: 50;
  --gy: 50;
  position: absolute;
  left: calc(var(--gx) * 1%);
  top: calc(var(--gy) * 1%);
  z-index: var(--z-grip);
  display: grid;
  grid-template-columns: repeat(2, 3px);
  gap: 3px;
  place-content: center;
  width: 12px;
  height: 40px;
  border-radius: 6px;
  background: var(--app-maroon);
  border: 1px solid var(--app-maroon-2);
  transform: translate(-50%, -50%);
}
.grip.h {
  grid-template-columns: repeat(3, 3px);
  width: 40px;
  height: 12px;
}
.grip i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--grip-dot);
}

/* Layouts. Panes: 1 article, 2 terminal, 3 video, 4 start page. */
.win[data-layout="side"] .p1 { --x: 0;  --y: 0;  --w: 50;  --h: 100; }
.win[data-layout="side"] .p2 { --x: 50; --y: 0;  --w: 50;  --h: 100; }
.win[data-layout="side"] .p3 { --x: 50; --y: 50; --w: 50;  --h: 50; }
.win[data-layout="side"] .p4 { --x: 50; --y: 50; --w: 50;  --h: 50; }
.win[data-layout="side"] .gv1 { --gx: 50; --gy: 50; }
.win[data-layout="side"] .gv2 { --gx: 50; --gy: 50; }
.win[data-layout="side"] .gh { --gx: 75; --gy: 50; }

.win[data-layout="stacked"] .p1 { --x: 0;  --y: 0;  --w: 100; --h: 50; }
.win[data-layout="stacked"] .p2 { --x: 0;  --y: 50; --w: 100; --h: 50; }
.win[data-layout="stacked"] .p3 { --x: 50; --y: 50; --w: 50;  --h: 50; }
.win[data-layout="stacked"] .p4 { --x: 50; --y: 50; --w: 50;  --h: 50; }
.win[data-layout="stacked"] .gv1 { --gx: 50; --gy: 25; }
.win[data-layout="stacked"] .gv2 { --gx: 50; --gy: 75; }
.win[data-layout="stacked"] .gh { --gx: 50; --gy: 50; }

.win[data-layout="grid"] .p1 { --x: 0;  --y: 0;  --w: 50; --h: 50; }
.win[data-layout="grid"] .p2 { --x: 50; --y: 0;  --w: 50; --h: 50; }
.win[data-layout="grid"] .p3 { --x: 0;  --y: 50; --w: 50; --h: 50; }
.win[data-layout="grid"] .p4 { --x: 50; --y: 50; --w: 50; --h: 50; }
.win[data-layout="grid"] .gv1 { --gx: 50; --gy: 25; }
.win[data-layout="grid"] .gv2 { --gx: 50; --gy: 75; }
.win[data-layout="grid"] .gh { --gx: 50; --gy: 50; }

.win[data-layout="onetwo"] .p1 { --x: 0;  --y: 0;  --w: 50; --h: 100; }
.win[data-layout="onetwo"] .p2 { --x: 50; --y: 0;  --w: 50; --h: 50; }
.win[data-layout="onetwo"] .p3 { --x: 50; --y: 50; --w: 50; --h: 50; }
.win[data-layout="onetwo"] .p4 { --x: 50; --y: 50; --w: 50; --h: 50; }
.win[data-layout="onetwo"] .gv1 { --gx: 50; --gy: 50; }
.win[data-layout="onetwo"] .gv2 { --gx: 50; --gy: 50; }
.win[data-layout="onetwo"] .gh { --gx: 75; --gy: 50; }

/* What each layout hides (the script fades parts in and out). Keep in step with SHOWN in site.js. */
.win[data-layout="side"] :is(.p3, .p4, .gv2, .gh),
.win[data-layout="stacked"] :is(.p3, .p4, .gv1, .gv2),
.win[data-layout="onetwo"] :is(.p4, .gv2) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Page contents, sized to their pane */
.pg {
  position: absolute;
  inset: 0;
  padding: clamp(8px, 6cqi, 26px);
  overflow: hidden;
}
.pg-doc {
  background: var(--paper);
  color: var(--ink);
}
.pg-kicker {
  font: 600 clamp(7px, 2.6cqi, 12px) / 1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-accent);
}
.pg-title {
  margin-top: 0.4em;
  font: 600 clamp(11px, 6.2cqi, 30px) / 1.1 var(--serif);
  letter-spacing: -0.01em;
}
.pg-text {
  margin-top: 0.6em;
  font-size: clamp(7px, 2.8cqi, 14px);
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 36em;
}
.pg-bars {
  display: grid;
  gap: clamp(4px, 1.8cqh, 10px);
  margin-top: clamp(8px, 4cqh, 20px);
}
.pg-bars span {
  height: clamp(5px, 2.4cqh, 11px);
  border-radius: 6px;
  background: var(--paper-line);
}
.pg-bars span:nth-child(2n) {
  width: 78%;
}
.pg-bars span:nth-child(3n) {
  width: 90%;
}
.pg-art {
  margin-top: clamp(8px, 4cqh, 20px);
  height: 26cqh;
  border-radius: var(--r-sm);
  background:
    radial-gradient(60% 90% at 20% 30%, #e8c27a 0, transparent 60%),
    radial-gradient(60% 90% at 85% 70%, #8c3d58 0, transparent 60%),
    #3e0a0e;
}

.pg-term {
  background: var(--navy);
  color: var(--term);
  padding: 0;
  font-family: var(--mono);
}
.term-head {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: clamp(5px, 2.6cqi, 12px) clamp(8px, 4cqi, 18px);
  border-bottom: 1px solid var(--navy-line);
  color: var(--term-head);
  font: 600 clamp(7px, 2.7cqi, 13px) var(--sans);
}
.term-head .dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--term);
}
.term-head span:last-child {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--term-dim);
}
.term-body {
  margin: 0;
  padding: clamp(5px, 3cqi, 16px) clamp(8px, 4cqi, 18px);
  font-size: clamp(6.5px, 2.75cqi, 13px);
  line-height: 1.55;
  white-space: pre;
  color: var(--term-text);
}
.term-body b {
  font-weight: 600;
  color: var(--term);
}
.term-body .path {
  color: var(--term-path);
}
.term-body .warn {
  color: var(--term-warn);
}
.term-body .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: -0.2em;
  background: var(--term);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.pg-video {
  background: var(--video-bg);
  padding: 0;
}
.video-art {
  position: absolute;
  inset: 0 0 18% 0;
  background:
    radial-gradient(45% 70% at 30% 40%, rgb(217 168 95 / 0.85), transparent 70%),
    radial-gradient(50% 80% at 75% 60%, rgb(140 61 88 / 0.9), transparent 70%),
    linear-gradient(160deg, #2a0710, #0b0b10);
}
.video-play {
  position: absolute;
  left: 50%;
  top: 41%;
  display: grid;
  place-items: center;
  width: clamp(22px, 14cqi, 56px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.45);
  border: 1px solid rgb(255 255 255 / 0.4);
  transform: translate(-50%, -50%);
  color: #fff;
}
.video-play .ic {
  width: 45%;
  height: 45%;
  fill: currentColor;
  stroke: none;
  margin-left: 8%;
}
.video-bar {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 7%;
  height: clamp(2px, 1.2cqh, 4px);
  border-radius: 2px;
  background: rgb(255 255 255 / 0.2);
}
.video-bar::before {
  content: "";
  position: absolute;
  inset: 0 62% 0 0;
  border-radius: inherit;
  background: var(--app-rose);
}

.pg-start {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(90% 80% at 20% 10%, rgb(108 32 56 / 0.85), transparent 70%),
    linear-gradient(150deg, #2a0d18, #141118 70%);
  color: var(--start-text);
}
.clock {
  font: 300 clamp(18px, 20cqi, 92px) / 1 var(--sans);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.clock-date {
  margin-top: 0.5em;
  font: 500 clamp(7px, 3.4cqi, 16px) var(--sans);
  color: var(--start-muted);
}

.demo-controls {
  /* Above the window's shadow, which would otherwise tint them */
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-6);
}
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-1);
  border-radius: var(--r-pill);
  background: var(--seg-bg);
}
.seg,
.round-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--seg-text);
  font: 500 var(--fs-sm) var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    transform var(--dur-press) var(--ease-out),
    color var(--dur-state) var(--ease-out),
    background-color var(--dur-state) var(--ease-out);
}
.seg:hover,
.round-btn:hover {
  color: var(--text);
}
.seg[aria-pressed="true"] {
  background: var(--seg-on);
  color: var(--on-seg-on);
}
.seg .ic {
  width: 18px;
  height: 18px;
}
.round-btn {
  padding: 0;
  background: var(--seg-bg);
}
.demo-note {
  position: relative;
  margin: var(--s-4) auto 0;
  max-width: 40rem;
  text-align: center;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

@media (max-width: 767px) {
  .win {
    --rail: 0px;
    --bar: 46px;
    aspect-ratio: 3 / 4;
    min-height: 0;
    /* Wide phones and small tablets: never taller than most of the screen. The explicit width
       keeps the height cap from narrowing the window through its aspect ratio. */
    width: 100%;
    max-height: min(78vh, 640px);
  }
  .win-rail,
  .win-bar .opt,
  .split-pill span,
  .seg span {
    display: none;
  }
  .seg {
    padding: 0 var(--s-3);
  }
}
/* A phone on its side: keep the whole window in view */
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 520px) {
  .win {
    aspect-ratio: auto;
    height: 72vh;
    min-height: 0;
  }
}

/* ---------- Numbers ---------- */

.numbers {
  padding: 0 0 clamp(80px, 11vw, 140px);
}
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}
@media (min-width: 768px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-6);
  }
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}
.stat-big {
  font-size: clamp(4rem, 9vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 0.04em;
}
.stat-text {
  max-width: 22ch;
  color: var(--text-2);
  font-size: var(--fs-lg);
  font-weight: 500;
  line-height: 1.35;
}
.stat-text kbd {
  font-size: 0.8em;
}

/* ---------- Highlights ---------- */

.highlights {
  padding: clamp(80px, 11vw, 140px) 0;
  background: var(--bg-alt);
}
.section-title {
  font-size: var(--fs-section);
  letter-spacing: -0.04em;
}
.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-top: clamp(32px, 5vw, 56px);
}
.tile {
  --pad: clamp(28px, 3.4vw, 40px);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  min-width: 0;
  padding: var(--pad);
  border-radius: var(--r-tile);
  background: var(--tile);
  overflow: hidden;
}
.tile-copy {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.tile-eyebrow {
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tile h3 {
  font-size: var(--fs-tile);
  letter-spacing: -0.035em;
}
.tile-copy > p:last-child {
  max-width: 36ch;
  margin-top: var(--s-1);
  color: var(--text-2);
}

/* Screenshot that runs off the tile's bottom and right edges */
.tile-shot {
  margin: auto calc(var(--pad) * -1) calc(var(--pad) * -1) 0;
}
.tile-shot img {
  width: 100%;
  height: auto;
  border-radius: var(--r-md) 0 0 0;
  border-top: 1px solid var(--app-line-strong);
  border-left: 1px solid var(--app-line-strong);
  box-shadow: var(--shadow-shot);
}

.term-card {
  margin-top: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--navy-line);
  background: var(--navy);
  overflow: hidden;
  container-type: inline-size;
}
.t-term .term-card {
  flex: 1;
  min-height: 200px;
}
.term-card .term-head {
  font-size: var(--fs-sm);
  padding: var(--s-3) var(--s-4);
}
.term-card .term-body {
  font-size: clamp(0.6875rem, 4.4cqi, 0.875rem);
  padding: var(--s-3) var(--s-4) var(--s-4);
  overflow: hidden;
}

.keycaps {
  display: flex;
  gap: var(--s-3);
  margin-top: auto;
}
.cap {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: var(--r-lg);
  background: var(--raised);
  color: var(--text);
  font: 600 var(--fs-xl) var(--font);
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.25), 0 1px 0 var(--line);
}
.cap-wide {
  width: 116px;
  font-size: var(--fs-lg);
}
.cap-hot {
  color: var(--on-pill);
  background: var(--pill-bg);
}
.mini-keys {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 2em;
  height: 1.8em;
  padding: 0 0.45em;
  border-radius: 6px;
  background: var(--raised);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 600;
  vertical-align: 0.1em;
}

.glyph {
  order: -1;
  width: 56px;
  height: 56px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.points {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  margin: auto 0 0;
  padding: var(--s-5) 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.points li {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.points .ic {
  width: 28px;
  height: 28px;
  color: var(--accent);
  stroke-width: 1.75;
}
.points h4 {
  margin: var(--s-1) 0 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.points p {
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
@media (min-width: 768px) {
  .points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.t-phone {
  padding-bottom: 0;
}
.phone {
  align-self: center;
  width: min(300px, 86%);
  margin: auto 0 0;
  padding: var(--s-2) var(--s-2) 0;
  border-radius: 34px 34px 0 0;
  background: var(--phone-bezel);
  border: 1px solid var(--app-line-strong);
  border-bottom: 0;
}
.phone img {
  width: 100%;
  height: auto;
  border-radius: 26px 26px 0 0;
  /* Show the top of the screen; the tile's edge crops the rest */
  aspect-ratio: 360 / 560;
  object-fit: cover;
  object-position: top;
}

@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-5);
  }
  .t-ext,
  .t-private,
  .t-update {
    grid-column: 1 / -1;
  }
}
@media (min-width: 1024px) {
  .bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .t-ext {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  .t-term {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  .t-keys {
    grid-column: 1;
    grid-row: 2;
  }
  .t-touch {
    grid-column: 2;
    grid-row: 2;
  }
  .t-phone {
    grid-column: 1;
    grid-row: 3 / 5;
  }
  .t-private {
    grid-column: 2 / 4;
    grid-row: 3;
  }
  .t-update {
    grid-column: 2 / 4;
    grid-row: 4;
  }
  .t-ext .tile-copy > p:last-child {
    max-width: 44ch;
  }
}

/* ---------- Download ---------- */

.download {
  padding: clamp(80px, 11vw, 140px) 0;
}
.download .subhead {
  max-width: 32ch;
  color: var(--text-2);
  font-weight: 500;
}
.release-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--s-2) var(--s-3);
  margin-top: var(--s-5);
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.version-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--pill-2-line);
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.release-status {
  min-height: 1.5em;
  margin-top: var(--s-2);
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  max-width: 880px;
  margin: var(--s-6) auto 0;
}
@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-5);
  }
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  padding: var(--s-6) clamp(24px, 3vw, 36px);
  border-radius: var(--r-tile);
  background: var(--card);
  text-align: center;
  box-shadow: 0 0 0 1px transparent;
  transition: box-shadow var(--dur-state) var(--ease-out);
}
.card.is-recommended {
  box-shadow: 0 0 0 2px var(--accent);
}
.card-badge {
  display: none;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--pill-bg);
  color: var(--on-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0;
}
.card.is-recommended .card-badge {
  display: inline-block;
}
.card h3 {
  font-size: var(--fs-3xl);
}
.card-abi {
  color: var(--text-3);
  font: 500 var(--fs-sm) var(--mono);
}
.card-desc {
  color: var(--text-2);
}
.card .pill {
  margin-top: var(--s-4);
}
/* With a pick for this device, the other file's button steps back */
.cards.has-pick .card:not(.is-recommended) .pill {
  background: transparent;
  border-color: var(--pill-2-line);
  color: var(--accent);
}
.sha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  width: 100%;
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  text-align: left;
}
.sha-label {
  grid-column: 1 / -1;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sha code {
  min-width: 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.5;
  /* A hash is one long token: wrap it anywhere rather than hide part of it */
  overflow-wrap: anywhere;
}
.vt {
  margin: var(--s-3) 0 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.5;
  text-align: left;
}
.vt a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -12px 0; /* a 44 px tap area that doesn't push the line apart */
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--raised);
  color: var(--text);
  font: 500 var(--fs-sm) var(--font);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out);
}
.copy-btn .ic {
  width: 16px;
  height: 16px;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  max-width: 880px;
  margin: clamp(56px, 8vw, 96px) auto 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.step {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}
.step-n {
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  align-self: flex-start;
  padding-right: 0.05em;
}
.step h3 {
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
}
.step p {
  color: var(--text-2);
}

.notes {
  display: grid;
  gap: var(--s-3);
  max-width: 680px;
  margin: clamp(48px, 7vw, 72px) auto 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-align: center;
}
.notes strong {
  color: var(--text);
  font-weight: 600;
}

details.verify {
  max-width: 680px;
  margin: var(--s-6) auto 0;
  border-radius: var(--r-lg);
  background: var(--card);
}
details.verify summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 52px;
  padding: 0 var(--s-5);
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
details.verify summary::-webkit-details-marker {
  display: none;
}
details.verify summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-3px);
  transition: transform var(--dur-state) var(--ease-out);
}
details.verify[open] summary::after {
  transform: rotate(-135deg) translateY(-1px);
}
.verify-body {
  padding: 0 var(--s-5) var(--s-5);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.verify-body > * + * {
  margin-top: var(--s-3);
}
.verify-body pre {
  margin-bottom: 0;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-xs);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- FAQ (reuses the details.verify look) ---------- */

.faq {
  padding: 0 0 clamp(80px, 11vw, 140px);
}
.faq-list {
  display: grid;
  gap: var(--s-3);
  max-width: 680px;
  margin: clamp(32px, 5vw, 48px) auto 0;
}
.faq-item {
  margin: 0;
}
details.faq-item summary {
  justify-content: space-between;
  min-height: 56px;
  padding: var(--s-3) var(--s-5);
  color: var(--text);
  text-align: left;
}
details.faq-item summary::after {
  flex: none;
  color: var(--accent);
}

/* ---------- Footer ---------- */

.footer {
  padding: var(--s-6) 0 var(--s-7);
  background: var(--bg-alt);
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.footer > .wrap > p {
  max-width: 80ch;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-5);
  margin-top: var(--s-3);
}
.footer .nav-brand {
  font-size: var(--fs-sm);
}
.footer .nav-brand img {
  width: 24px;
  height: 24px;
}
.footer-links {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-4);
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ---------- Scroll reveal (only set up by site.js, never with reduced motion) ---------- */

.reveal {
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out),
    box-shadow var(--dur-state) var(--ease-out);
}
.reveal.is-pending {
  opacity: 0;
  transform: translateY(32px);
}

/* Printing or saving as PDF shows every section, scrolled past or not */
@media print {
  .reveal.is-pending {
    opacity: 1;
    transform: none;
  }
  .nav {
    position: static;
  }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
  .reveal.is-pending {
    opacity: 1;
    transform: none;
  }
}
