/*
 * Slates site: layout and type.
 * Palette lives in tokens.css. Each band sets a slot (1–8); links, emphasis,
 * and numbered markers inside it pick up that slot's colors.
 */

@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Slots ---------- */

.slot-1 { --accent: var(--slate-1); --chrome: var(--chrome-1); --wash: var(--bg-1); --header: var(--header-1); --digit: var(--digit-1); }
.slot-2 { --accent: var(--slate-2); --chrome: var(--chrome-2); --wash: var(--bg-2); --header: var(--header-2); --digit: var(--digit-2); }
.slot-3 { --accent: var(--slate-3); --chrome: var(--chrome-3); --wash: var(--bg-3); --header: var(--header-3); --digit: var(--digit-3); }
.slot-4 { --accent: var(--slate-4); --chrome: var(--chrome-4); --wash: var(--bg-4); --header: var(--header-4); --digit: var(--digit-4); }
.slot-5 { --accent: var(--slate-5); --chrome: var(--chrome-5); --wash: var(--bg-5); --header: var(--header-5); --digit: var(--digit-5); }
.slot-6 { --accent: var(--slate-6); --chrome: var(--chrome-6); --wash: var(--bg-6); --header: var(--header-6); --digit: var(--digit-6); }
.slot-7 { --accent: var(--slate-7); --chrome: var(--chrome-7); --wash: var(--bg-7); --header: var(--header-7); --digit: var(--digit-7); }
.slot-8 { --accent: var(--slate-8); --chrome: var(--chrome-8); --wash: var(--bg-8); --header: var(--header-8); --digit: var(--digit-8); }

/* Slates Light, for long reading on /privacy */
.light { color: var(--ink-dark); }
.light.slot-1 { --wash: var(--light-bg-1); --header: var(--light-header-1); --chrome: var(--light-chrome-1); }
.light.slot-2 { --wash: var(--light-bg-2); --header: var(--light-header-2); --chrome: var(--light-chrome-2); }
.light.slot-3 { --wash: var(--light-bg-3); --header: var(--light-header-3); --chrome: var(--light-chrome-3); }
.light.slot-4 { --wash: var(--light-bg-4); --header: var(--light-header-4); --chrome: var(--light-chrome-4); }
.light.slot-5 { --wash: var(--light-bg-5); --header: var(--light-header-5); --chrome: var(--light-chrome-5); }
.light.slot-6 { --wash: var(--light-bg-6); --header: var(--light-header-6); --chrome: var(--light-chrome-6); }
.light.slot-7 { --wash: var(--light-bg-7); --header: var(--light-header-7); --chrome: var(--light-chrome-7); }
.light.slot-8 { --wash: var(--light-bg-8); --header: #ececec; --chrome: #5f5f5f; }

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

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

html {
  --accent: var(--slate-8);
  --chrome: var(--chrome-8);
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
}

h3 {
  font-size: 1.35rem;
  font-weight: 400;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

em {
  font-style: normal;
  color: var(--chrome);
}

strong {
  font-weight: 600;
}

a {
  color: var(--chrome);
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.12em;
}

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

kbd {
  font-family: var(--font-body);
  font-size: 0.85em;
  white-space: nowrap;
  padding: 0.05em 0.35em;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 0.3em;
}

/* Menu and setting names, as they read in the app */
.ui {
  font-weight: 600;
}

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

main {
  flex: 1;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--ground);
  border-radius: 0.5rem;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

/* ---------- Numbered markers ---------- */

.dot {
  --size: 1.6rem;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 26%;
  background: var(--accent);
  color: var(--digit);
  font-family: var(--font-display);
  font-size: calc(var(--size) * 0.62);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.strip {
  display: flex;
  justify-content: center;
  gap: clamp(0.4rem, 1.4vw, 0.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.strip .dot {
  --size: clamp(2.2rem, 7vw, 3.25rem);
}

/* ---------- Site bar ---------- */

.site-bar {
  background: var(--ground);
}

.site-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 300;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--slate-8);
}

/* ---------- Bands: each section is a slate ---------- */

.band {
  background: var(--wash);
}

.band-head {
  background: var(--header);
  color: var(--chrome);
}

.band-head-inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: var(--wide);
  min-height: 2.75rem;
  margin: 0 auto;
  padding: 0.45rem var(--gutter);
  font-size: 0.95rem;
}

.band-head .dot {
  --size: 1.55rem;
}

.band-body {
  padding: var(--band-pad) var(--gutter);
}

.measure {
  max-width: var(--measure);
  margin: 0 auto;
}

.wide {
  max-width: var(--wide);
  margin: 0 auto;
}

.lead {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 300;
  line-height: 1.3;
}

.note {
  color: color-mix(in srgb, currentColor 72%, transparent);
  font-size: 1rem;
}

/* ---------- Hero: the Stage ---------- */

/*
 * A MacBook Pro on stage, driven by the 1–8 glyph toolbar under it. Every
 * state comes from radio inputs and :has(), so it works without JavaScript.
 *   hover glyph N  → preview slate N (hover wins over the pinned choice)
 *   check glyph N  → pin slate N (click, tap, arrows, or digits via JS)
 *   check ‹        → all slates, the list (the app's ⌘\)
 */

@property --hero-accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #ffd600;
}

.hero {
  --hero-accent: var(--slate-1);
  --stage-w: min(100%, 68rem, max(22rem, calc((100vh - 21rem) * 1.6)));
  position: relative;
  padding: clamp(1rem, 2.5vw, 1.75rem) var(--gutter) clamp(4rem, 9vw, 6rem);
  text-align: center;
  background:
    radial-gradient(
      44rem 30rem at 50% 58%,
      color-mix(in srgb, var(--hero-accent) 9%, transparent),
      transparent 70%
    ),
    var(--ground);
  transition: --hero-accent var(--t-stage) var(--ease-out);
}

@supports (height: 100svh) {
  .hero {
    --stage-w: min(100%, 68rem, max(22rem, calc((100svh - 21rem) * 1.6)));
  }
}

.hero-head {
  position: relative;
  z-index: 2;
}

.hero-icon {
  width: clamp(3rem, 6vw, 3.75rem);
  height: auto;
  margin: 0 auto 0.4rem;
}

.hero-icon-button {
  display: block;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 24%;
  transition: transform var(--t-quick) var(--ease-spring);
}

.hero-icon-button:active {
  transform: scale(0.94);
}

.hero h1 {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.pitch {
  max-width: 16em;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  font-weight: 250;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero em {
  color: color-mix(in oklab, var(--hero-accent) 72%, #fff);
}

/* The photograph, with the screen rectangle stacked on top of it */

.stage-frame {
  position: relative;
  width: var(--stage-w);
  margin: -1.5% auto 0;
  aspect-ratio: 2000 / 1250;
}

/* The studio backdrop dissolves into the page on eased ramps (no banding);
   the laptop itself stays fully opaque. */
.stage-photo img {
  --fade-x: linear-gradient(to right,
    transparent, rgb(0 0 0 / 0.06) 1.2%, rgb(0 0 0 / 0.2) 2.6%, rgb(0 0 0 / 0.42) 4%,
    rgb(0 0 0 / 0.66) 5.4%, rgb(0 0 0 / 0.86) 6.8%, #000 8.4%,
    #000 91.6%, rgb(0 0 0 / 0.86) 93.2%, rgb(0 0 0 / 0.66) 94.6%,
    rgb(0 0 0 / 0.42) 96%, rgb(0 0 0 / 0.2) 97.4%, rgb(0 0 0 / 0.06) 98.8%, transparent);
  --fade-y: linear-gradient(to bottom,
    transparent, rgb(0 0 0 / 0.08) 2%, rgb(0 0 0 / 0.26) 4.5%, rgb(0 0 0 / 0.52) 7%,
    rgb(0 0 0 / 0.78) 9%, #000 11%,
    #000 84%, rgb(0 0 0 / 0.7) 88%, rgb(0 0 0 / 0.36) 92%, rgb(0 0 0 / 0.12) 96%, transparent);
  width: 100%;
  -webkit-mask-image: var(--fade-x), var(--fade-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade-x), var(--fade-y);
  mask-composite: intersect;
}

/*
 * Screen rectangle inside the stage photo. Both come from the 6400×4800
 * MacBook Pro 16" renders: the photo is the crop 5760×3600+320+560, each
 * screen image the crop 3968×2560+1216+960. Everything outside the screen
 * is pixel-identical across renders, so the seams are invisible.
 */
.screen {
  position: absolute;
  left: 15.5556%;
  top: 11.1111%;
  width: 68.8889%;
  height: 71.1111%;
}

.layer,
.scr,
.scr-list {
  position: absolute;
  inset: 0;
}

/* Each layer is its own stacking context; Light always paints above Dark */
.layer-dark,
.mode-layer-dark {
  z-index: 1;
}

.layer-light,
.mode-layer-light {
  z-index: 2;
}

.scr img,
.scr-list img {
  width: 100%;
  height: 100%;
}

/*
 * Rise: a slate fills the screen. List and focus windows differ in size, so
 * a plain cross-fade would show two windows at once. Instead the incoming
 * frame arrives dimmed, covers the old one, then brightens; leaving reverses
 * that. Leaving also waits briefly, so sweeping across glyphs never drops
 * back to the list in between.
 */
.scr {
  display: none;
  opacity: 0;
  filter: brightness(0.3);
  z-index: 1;
  transition:
    filter 160ms ease-in 180ms,
    opacity 200ms var(--ease-out) 320ms,
    display 0s linear 520ms allow-discrete;
}

/* Spill: the screen's light on the reflective surface */
.spill {
  position: absolute;
  left: 0;
  right: 0;
  top: 80%;
  height: 20%;
  pointer-events: none;
  background: radial-gradient(
    38% 52% at 50% 42%,
    color-mix(in srgb, var(--spill, var(--hero-accent)) 60%, transparent),
    transparent 100%
  );
  mix-blend-mode: screen;
  opacity: 0.35;
  transition: opacity var(--t-stage) var(--ease-out);
}

/* The toolbar: ‹ and glyphs 1–8, then the appearance switch */

.stage-bar {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: var(--stage-w);
  margin: -5% auto 0;
}

.picker,
.seg {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.picker input,
.seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.picks,
.seg {
  display: flex;
  align-items: center;
  border-radius: 0.8rem;
  background: #161616;
  box-shadow:
    inset 0 0 0 1px #2b2b2b,
    0 0.75rem 2rem rgba(0, 0, 0, 0.6);
}

.picks {
  padding: 0.2rem 0.35rem;
}

.pick {
  display: grid;
  place-items: center;
  padding: 0.35rem 0.2rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pick-0 {
  padding-inline: 0.45rem 0.6rem;
  color: #a0a0a0;
  opacity: 0.45;
  transition: opacity var(--t-quick) var(--ease-out);
}

.pick-0:hover,
.stage:has(#s1:checked, #s2:checked, #s3:checked, #s4:checked, #s5:checked, #s6:checked, #s7:checked, #s8:checked) .pick-0 {
  opacity: 1;
}

.chev {
  width: 1.1rem;
  height: 1.1rem;
}

.pick .dot {
  --size: clamp(1.75rem, 5.2vw, 2.35rem);
  position: relative;
  opacity: 0.42;
  transition:
    opacity var(--t-quick) var(--ease-out),
    transform var(--t-quick) var(--ease-spring);
}

/* Glow like the app's selected glyph: a soft halo and a faint top highlight */
.pick .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0.35rem color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 1.3rem color-mix(in srgb, var(--accent) 55%, transparent);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
}

.pick:hover .dot {
  opacity: 0.8;
}

.pick:active .dot {
  transform: scale(0.94);
}

.picker input:focus-visible + .pick {
  outline: 3px solid var(--hero-accent);
  outline-offset: -1px;
  border-radius: 0.55rem;
}

/* Idle, the list: glyph 1 softly lit, as in the app */
.stage:has(.pick-0:hover) .pick-1 .dot,
.stage:not(:has(.pick:hover)):has(#s0:checked) .pick-1 .dot {
  opacity: 0.75;
}

/* Segmented control: the appearance switch, and the demos on /features */
.seg {
  padding: 0.2rem;
  font-size: 0.9rem;
}

.seg label {
  padding: 0.45rem 0.85rem;
  border-radius: 0.6rem;
  color: #a0a0a0;
  cursor: pointer;
  transition:
    background-color var(--t-quick) var(--ease-out),
    color var(--t-quick) var(--ease-out);
}

.seg label:hover {
  color: var(--ink);
}

.seg input:focus-visible + label {
  outline: 3px solid var(--hero-accent, var(--accent));
  outline-offset: -1px;
}

/* An untouched Dark | Light switch shows the appearance the demo follows */
.seg input:checked + label,
.look:not(:has(:checked)) label:first-of-type {
  background: #333;
  color: var(--ink);
}

/* The status line, in the app's footer style */
.stage-status {
  min-height: 1.5em;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.stage-status kbd {
  border: 0;
  padding: 0;
  font-size: 1em;
}

.st {
  display: none;
}

/* ----- State: which slate is on screen ----- */

.stage:has(.pick-0:hover) .st-0,
.stage:not(:has(.pick:hover)):has(#s0:checked) .st-0 {
  display: inline;
}

.stage:has(.pick-1:hover) .scr-1,
.stage:not(:has(.pick:hover)):has(#s1:checked) .scr-1,
.stage:has(.pick-2:hover) .scr-2,
.stage:not(:has(.pick:hover)):has(#s2:checked) .scr-2,
.stage:has(.pick-3:hover) .scr-3,
.stage:not(:has(.pick:hover)):has(#s3:checked) .scr-3,
.stage:has(.pick-4:hover) .scr-4,
.stage:not(:has(.pick:hover)):has(#s4:checked) .scr-4,
.stage:has(.pick-5:hover) .scr-5,
.stage:not(:has(.pick:hover)):has(#s5:checked) .scr-5,
.stage:has(.pick-6:hover) .scr-6,
.stage:not(:has(.pick:hover)):has(#s6:checked) .scr-6,
.stage:has(.pick-7:hover) .scr-7,
.stage:not(:has(.pick:hover)):has(#s7:checked) .scr-7,
.stage:has(.pick-8:hover) .scr-8,
.stage:not(:has(.pick:hover)):has(#s8:checked) .scr-8 {
  display: block;
  opacity: 1;
  filter: none;
  z-index: 2;
  transition:
    opacity 160ms var(--ease-out),
    filter var(--t-base) var(--ease-out) 110ms,
    display 0s allow-discrete;
}

@starting-style {
  .stage:has(.pick-1:hover) .scr-1,
  .stage:not(:has(.pick:hover)):has(#s1:checked) .scr-1,
  .stage:has(.pick-2:hover) .scr-2,
  .stage:not(:has(.pick:hover)):has(#s2:checked) .scr-2,
  .stage:has(.pick-3:hover) .scr-3,
  .stage:not(:has(.pick:hover)):has(#s3:checked) .scr-3,
  .stage:has(.pick-4:hover) .scr-4,
  .stage:not(:has(.pick:hover)):has(#s4:checked) .scr-4,
  .stage:has(.pick-5:hover) .scr-5,
  .stage:not(:has(.pick:hover)):has(#s5:checked) .scr-5,
  .stage:has(.pick-6:hover) .scr-6,
  .stage:not(:has(.pick:hover)):has(#s6:checked) .scr-6,
  .stage:has(.pick-7:hover) .scr-7,
  .stage:not(:has(.pick:hover)):has(#s7:checked) .scr-7,
  .stage:has(.pick-8:hover) .scr-8,
  .stage:not(:has(.pick:hover)):has(#s8:checked) .scr-8 {
    opacity: 0;
    filter: brightness(0.3);
  }
}

.stage:has(.pick-1:hover) .pick-1 .dot,
.stage:not(:has(.pick:hover)):has(#s1:checked) .pick-1 .dot,
.stage:has(.pick-2:hover) .pick-2 .dot,
.stage:not(:has(.pick:hover)):has(#s2:checked) .pick-2 .dot,
.stage:has(.pick-3:hover) .pick-3 .dot,
.stage:not(:has(.pick:hover)):has(#s3:checked) .pick-3 .dot,
.stage:has(.pick-4:hover) .pick-4 .dot,
.stage:not(:has(.pick:hover)):has(#s4:checked) .pick-4 .dot,
.stage:has(.pick-5:hover) .pick-5 .dot,
.stage:not(:has(.pick:hover)):has(#s5:checked) .pick-5 .dot,
.stage:has(.pick-6:hover) .pick-6 .dot,
.stage:not(:has(.pick:hover)):has(#s6:checked) .pick-6 .dot,
.stage:has(.pick-7:hover) .pick-7 .dot,
.stage:not(:has(.pick:hover)):has(#s7:checked) .pick-7 .dot,
.stage:has(.pick-8:hover) .pick-8 .dot,
.stage:not(:has(.pick:hover)):has(#s8:checked) .pick-8 .dot {
  opacity: 1;
  transform: translateY(-1px);
}

.stage:has(.pick-1:hover) .pick-1 .dot::after,
.stage:not(:has(.pick:hover)):has(#s1:checked) .pick-1 .dot::after,
.stage:has(.pick-2:hover) .pick-2 .dot::after,
.stage:not(:has(.pick:hover)):has(#s2:checked) .pick-2 .dot::after,
.stage:has(.pick-3:hover) .pick-3 .dot::after,
.stage:not(:has(.pick:hover)):has(#s3:checked) .pick-3 .dot::after,
.stage:has(.pick-4:hover) .pick-4 .dot::after,
.stage:not(:has(.pick:hover)):has(#s4:checked) .pick-4 .dot::after,
.stage:has(.pick-5:hover) .pick-5 .dot::after,
.stage:not(:has(.pick:hover)):has(#s5:checked) .pick-5 .dot::after,
.stage:has(.pick-6:hover) .pick-6 .dot::after,
.stage:not(:has(.pick:hover)):has(#s6:checked) .pick-6 .dot::after,
.stage:has(.pick-7:hover) .pick-7 .dot::after,
.stage:not(:has(.pick:hover)):has(#s7:checked) .pick-7 .dot::after,
.stage:has(.pick-8:hover) .pick-8 .dot::after,
.stage:not(:has(.pick:hover)):has(#s8:checked) .pick-8 .dot::after {
  opacity: 1;
}

.stage:has(.pick-1:hover) .st-1,
.stage:not(:has(.pick:hover)):has(#s1:checked) .st-1,
.stage:has(.pick-2:hover) .st-2,
.stage:not(:has(.pick:hover)):has(#s2:checked) .st-2,
.stage:has(.pick-3:hover) .st-3,
.stage:not(:has(.pick:hover)):has(#s3:checked) .st-3,
.stage:has(.pick-4:hover) .st-4,
.stage:not(:has(.pick:hover)):has(#s4:checked) .st-4,
.stage:has(.pick-5:hover) .st-5,
.stage:not(:has(.pick:hover)):has(#s5:checked) .st-5,
.stage:has(.pick-6:hover) .st-6,
.stage:not(:has(.pick:hover)):has(#s6:checked) .st-6,
.stage:has(.pick-7:hover) .st-7,
.stage:not(:has(.pick:hover)):has(#s7:checked) .st-7,
.stage:has(.pick-8:hover) .st-8,
.stage:not(:has(.pick:hover)):has(#s8:checked) .st-8 {
  display: inline;
}

.stage:has(.pick-1:hover, .pick-2:hover, .pick-3:hover, .pick-4:hover, .pick-5:hover, .pick-6:hover, .pick-7:hover, .pick-8:hover) .spill,
.stage:not(:has(.pick:hover)):has(#s1:checked, #s2:checked, #s3:checked, #s4:checked, #s5:checked, #s6:checked, #s7:checked, #s8:checked) .spill {
  opacity: 0.9;
}

.stage:has(.pick-2:hover), .stage:not(:has(.pick:hover)):has(#s2:checked) { --hero-accent: var(--slate-2); }
.stage:has(.pick-3:hover), .stage:not(:has(.pick:hover)):has(#s3:checked) { --hero-accent: var(--slate-3); }
.stage:has(.pick-4:hover), .stage:not(:has(.pick:hover)):has(#s4:checked) { --hero-accent: var(--slate-4); }
.stage:has(.pick-5:hover), .stage:not(:has(.pick:hover)):has(#s5:checked) { --hero-accent: var(--slate-5); }
.stage:has(.pick-6:hover), .stage:not(:has(.pick:hover)):has(#s6:checked) { --hero-accent: var(--slate-6); }
.stage:has(.pick-7:hover), .stage:not(:has(.pick:hover)):has(#s7:checked) { --hero-accent: var(--slate-7); }
.stage:has(.pick-8:hover), .stage:not(:has(.pick:hover)):has(#s8:checked) { --hero-accent: var(--slate-8); }

/* ----- State: appearance (View → Theme) ----- */

/*
 * Sweep: Light is revealed left to right, and so is Dark on the way back.
 * Until the visitor picks, the Stage follows prefers-color-scheme; the page
 * ground stays dark either way.
 */
.layer-light {
  display: none;
  clip-path: inset(0 0 0 100%);
  transition:
    clip-path var(--t-sweep) var(--ease-out),
    display 0s linear var(--t-sweep) allow-discrete;
}

.layer-dark {
  transition: display 0s allow-discrete;
}

.stage:has(#look-light:checked) .layer-light {
  display: block;
  clip-path: inset(0);
  transition:
    clip-path var(--t-sweep) var(--ease-out),
    display 0s allow-discrete;
}

@starting-style {
  .stage:has(#look-light:checked) .layer-light {
    clip-path: inset(0 100% 0 0);
  }
}

.stage:has(#look-light:checked) .layer-dark {
  display: none;
  transition: display 0s linear var(--t-sweep) allow-discrete;
}

.stage:has(#look-light:checked) {
  --spill: color-mix(in srgb, var(--hero-accent) 22%, #fff3dc);
}

@media (prefers-color-scheme: light) {
  .stage:not(:has(#look-dark:checked)) .layer-light {
    display: block;
    clip-path: inset(0);
    transition:
      clip-path var(--t-sweep) var(--ease-out),
      display 0s allow-discrete;
  }

  .stage:not(:has(#look-dark:checked)) .layer-dark {
    display: none;
    transition: display 0s linear var(--t-sweep) allow-discrete;
  }

  .stage:not(:has(#look-dark:checked)) {
    --spill: color-mix(in srgb, var(--hero-accent) 22%, #fff3dc);
  }

  .look:not(:has(:checked)) label:first-of-type {
    background: none;
    color: #a0a0a0;
  }

  .look:not(:has(:checked)) label:last-of-type {
    background: #333;
    color: var(--ink);
  }
}

.hero-sub {
  max-width: 30rem;
  margin: 1.75rem auto 1.75rem;
  color: var(--ink-soft);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}

.req {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 1.25rem 0 0;
}

.req a {
  color: var(--ink-soft);
}

/* ---------- App Store button ---------- */

.store {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  padding: 0.7rem 1.4rem 0.75rem;
  border-radius: 0.85rem;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--font-display);
  line-height: 1.1;
  text-align: left;
  text-decoration: none;
  transition: transform 0.18s ease;
}

.store small {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.store span {
  font-size: 1.2rem;
  font-weight: 500;
}

a.store:hover {
  transform: scale(1.03);
}

a.store:focus-visible {
  outline-color: var(--ink);
  outline-offset: 4px;
}

/* Until the listing is live: not a link, and does not pretend to be one */
.store-soon {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 35%, transparent);
}

.light .store-soon {
  color: var(--ink-dark);
}

/* ---------- Photography ---------- */

.shot {
  margin: 0;
}

.shot img {
  width: 100%;
  border-radius: 2.5% / 2.4%;
  box-shadow:
    0 2.5rem 6rem rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.shot figcaption {
  max-width: var(--measure);
  margin: 1.5rem auto 0;
  color: var(--chrome);
  font-size: 1rem;
  text-align: center;
}

.shot-hero {
  max-width: 56rem;
  margin: 3rem auto 0;
}

.shot-focus img {
  border-radius: 2.2% / 2.4%;
}

/* ---------- Platform band: photo + copy ---------- */

.platform {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  max-width: var(--wide);
  margin: 0 auto;
}

.platform .cta {
  justify-content: flex-start;
  margin-top: 1.75rem;
}

@media (min-width: 56rem) {
  .platform {
    grid-template-columns: 1.15fr 1fr;
    gap: 4.5rem;
  }
}

/* ---------- Same desk, lights up: Dark / Light compare ---------- */

/* Without JavaScript the pair sits side by side. With it, the two stack
   and a range input sets --split: Light on the left, Dark on the right. */
.compare {
  display: grid;
  gap: 1.25rem;
  max-width: 60rem;
  margin: 3rem auto 0;
}

@media (min-width: 48rem) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.compare figure {
  margin: 0;
}

.compare img {
  width: 100%;
  border-radius: 3.4% / 5%;
  box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, 0.55);
}

.compare figcaption {
  margin-top: 0.75rem;
  color: var(--chrome);
  font-size: 0.95rem;
  text-align: center;
}

.compare-hint {
  display: none;
}

.compare.is-live {
  display: block;
  position: relative;
  touch-action: pan-y;
}

.band:has(.compare.is-live) .compare-hint {
  display: inline;
}

.compare.is-live .compare-light {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.compare.is-live .compare-light img {
  box-shadow: none;
}

.compare.is-live figcaption {
  position: absolute;
  top: 7%;
  margin: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.85rem;
}

.compare.is-live .compare-dark figcaption {
  right: 5%;
}

.compare.is-live .compare-light figcaption {
  left: 5%;
}

/* The native slider covers the picture: drag anywhere, or use the arrows */
.compare-range {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.compare.is-live::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 4%;
  bottom: 4%;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.compare.is-live::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: var(--split);
  width: 2.5rem;
  height: 2.5rem;
  margin: -1.25rem 0 0 -1.25rem;
  border-radius: 50%;
  background:
    linear-gradient(90deg, #f0ece0 50%, #1c1b14 50%);
  box-shadow:
    0 0 0 2px #fff,
    0 0.4rem 1.2rem rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.compare.is-live:has(.compare-range:focus-visible)::before {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- In the world: a sideways film strip ---------- */

.world {
  display: flex;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  margin: 3rem calc(-1 * var(--gutter)) 0;
  padding: 0.5rem var(--gutter) 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--chrome) 40%, transparent) transparent;
}

.world:focus-visible {
  outline-offset: -3px;
}

.world li {
  flex: none;
  scroll-snap-align: start;
}

.world figure {
  margin: 0;
}

.world picture {
  display: block;
  overflow: hidden;
  height: clamp(15rem, 42vw, 26rem);
  border-radius: 0.9rem;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.5);
}

.world img {
  width: auto;
  max-width: none;
  height: 100%;
}

.world figcaption {
  margin-top: 0.8rem;
  color: var(--chrome);
  font-size: 0.95rem;
}

/* A gentle parallax as each frame crosses the strip */
@supports (animation-timeline: view(inline)) {
  @media (prefers-reduced-motion: no-preference) {
    .world img {
      animation: pan linear both;
      animation-timeline: view(inline);
      transform-origin: 50% 50%;
    }
  }
}

@keyframes pan {
  from { transform: scale(1.08) translateX(3.5%); }
  to { transform: scale(1.08) translateX(-3.5%); }
}

/* ---------- Feature eight ---------- */

.features-band {
  background: var(--ground);
  padding: var(--band-pad) var(--gutter);
}

.features-band > header {
  max-width: var(--measure);
  margin: 0 auto 3rem;
  text-align: center;
}

.features {
  display: grid;
  gap: 1rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .features {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.feature {
  overflow: hidden;
  border-radius: 0.9rem;
  background: var(--wash);
}

.feature h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.6rem 1rem;
  background: var(--header);
  color: var(--chrome);
  font-size: 1.2rem;
}

.feature p {
  margin: 0;
  padding: 1.1rem 1.25rem 1.35rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.features-more {
  margin: 2.5rem 0 0;
  text-align: center;
}

.features-more a {
  color: var(--ink);
  text-decoration-color: var(--slate-8);
}

.features-more a::after {
  content: " →";
}

/* ---------- Home: help, closing ---------- */

.teasers {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--chrome) 25%, transparent);
}

.teasers li {
  border-bottom: 1px solid color-mix(in srgb, var(--chrome) 25%, transparent);
}

.teasers a {
  display: block;
  padding: 0.9rem 0;
  color: var(--ink);
  text-decoration: none;
}

.teasers a:hover {
  color: var(--chrome);
}

.teasers a::after {
  content: " →";
  color: var(--chrome);
}

.closing {
  text-align: center;
}

.closing img {
  width: 6.5rem;
  margin: 0 auto 1.5rem;
}

.closing h2 {
  margin-bottom: 1.75rem;
}

.colophon {
  margin-top: 0.65rem;
}

/* ---------- Page title band (support, history, privacy) ---------- */

.page-title {
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter) clamp(3rem, 7vw, 4.5rem);
  background: var(--ground);
}

.page-title h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 250;
  letter-spacing: -0.02em;
}

.page-title .strip {
  justify-content: flex-start;
  margin-bottom: 1.75rem;
}

.page-title .strip .dot {
  --size: 1.4rem;
}

/* ---------- Support ---------- */

.contact {
  margin: 2rem 0 0;
  padding: 1.5rem 1.5rem 1.6rem;
  border-radius: 0.9rem;
  background: var(--wash);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.contact h2 {
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
}

.mail {
  display: inline-block;
  margin: 0.2rem 0 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.5vw, 2.3rem);
  font-weight: 300;
  overflow-wrap: anywhere;
}

.copy-mail {
  margin: 0 0 0.8rem 0.9rem;
  padding: 0.35rem 0.8rem;
  border: 0;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--chrome) 16%, transparent);
  color: var(--chrome);
  font: inherit;
  font-size: 0.9rem;
  vertical-align: 0.35em;
  cursor: pointer;
  transition: transform var(--t-quick) var(--ease-spring);
}

.copy-mail:hover {
  background: color-mix(in srgb, var(--chrome) 26%, transparent);
}

.copy-mail:active {
  transform: scale(0.94);
}

.contact-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-list li + li {
  margin-top: 0.6rem;
}

.qa + .qa {
  margin-top: 2.75rem;
}

.qa h3 {
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.light .qa h3 {
  color: var(--ink-dark);
}

.qa p,
.qa li {
  color: var(--ink-soft);
}

.light .qa p,
.light .qa li {
  color: #2b2b2b;
}

.qa ul {
  padding-left: 1.2em;
}

.qa li + li {
  margin-top: 0.35em;
}

.faq-index {
  columns: 2 16rem;
  column-gap: 2rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.faq-index li {
  break-inside: avoid;
  padding: 0.3rem 0;
}

.faq-index a {
  color: var(--ink-soft);
}

.back-top {
  margin-top: 3rem;
  font-size: 1rem;
}

/* ---------- History ---------- */

.release h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
}

.release h2 small {
  color: var(--chrome);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
}

.release ul {
  padding-left: 1.2em;
  color: var(--ink-soft);
}

.release li + li {
  margin-top: 0.45em;
}

/* ---------- Features: chapters ---------- */

/*
 * Chapter text reads --band-ink / --band-soft so the palette wall can
 * re-theme a band with a light palette and keep the text legible.
 */
.chapter {
  color: var(--band-ink, var(--ink));
  transition: background-color var(--t-base) var(--ease-out);
}

.chapter .band-head {
  transition:
    background-color var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out);
}

.chapter p,
.chapter dd {
  color: var(--band-soft, var(--ink-soft));
}

.chapter h3 {
  color: var(--band-ink, var(--ink));
}

.chapter .band-body > * + * {
  margin-top: clamp(2.75rem, 6vw, 4.25rem);
}

.chapter code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--chrome);
}

.showcase {
  max-width: 64rem;
  margin-inline: auto;
}

.showcase h3 {
  margin-bottom: 0.4rem;
}

.subs {
  display: grid;
  gap: 3rem 3.5rem;
  max-width: 64rem;
  margin-inline: auto;
  padding: 0;
  list-style: none;
}

@media (min-width: 52rem) {
  .subs {
    grid-template-columns: 1fr 1fr;
  }

  .subs > li:has(.clip-wide) {
    grid-column: 1 / -1;
  }
}

.subs picture,
.subs .clip {
  display: block;
  margin: 0 0 1.25rem;
}

.subs h3 {
  margin-bottom: 0.4rem;
}

.subs p {
  font-size: 1.05rem;
}

.win-shot img,
.panel-shot img,
.tall-shot img {
  border-radius: 0.9rem;
  box-shadow:
    0 1.5rem 4rem rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.panel-shot img {
  border-radius: 0.7rem;
}

.tall-shot img {
  max-width: 15rem;
  margin-inline: auto;
}

.pair {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .pair {
    grid-template-columns: 1fr 1fr;
  }
}

.pair-shot {
  margin: 0;
}

.pair-shot figcaption {
  margin-top: 0.9rem;
  color: var(--chrome);
  font-size: 0.95rem;
  text-align: center;
}

.js-only {
  display: none;
}

.has-js .js-only {
  display: inline;
}

/* A shared toolbar row above a demo */
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.25rem;
  margin-bottom: 1.75rem;
}

.demo-key {
  color: var(--chrome);
  font-size: 0.9rem;
}

/* ----- The rail: a sticky glyph toolbar that tracks the chapter ----- */

.chapters {
  position: relative;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ground);
  border-bottom: 1px solid var(--header-8);
}

.chapter {
  scroll-margin-top: 3rem;
}

.rail ol {
  display: flex;
  justify-content: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.45rem var(--gutter);
  list-style: none;
}

.rail a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 0.55rem;
  color: var(--chrome);
  text-decoration: none;
}

.rail .dot {
  --size: 1.7rem;
  position: relative;
  opacity: 0.45;
  transition:
    opacity var(--t-quick) var(--ease-out),
    transform var(--t-quick) var(--ease-spring);
}

.rail .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0.3rem color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 1.1rem color-mix(in srgb, var(--accent) 55%, transparent);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
}

.rail a:hover .dot {
  opacity: 0.85;
}

.rail a:active .dot {
  transform: scale(0.94);
}

.rail a[aria-current] .dot {
  opacity: 1;
  transform: translateY(-1px);
}

.rail a[aria-current] .dot::after {
  opacity: 1;
}

.rail-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 80rem) {
  /* A zero-height sticky anchor holds the vertical rail near mid-screen
     (the rail is about 20rem tall) and never above the first chapter */
  .chapter {
    scroll-margin-top: 0;
  }

  .rail {
    top: calc(50vh - 10rem);
    height: 0;
    background: none;
    border: 0;
  }

  .rail ol {
    position: absolute;
    left: 1rem;
    top: 3.5rem;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.4rem;
    border-radius: 0.9rem;
    background: #161616;
    box-shadow:
      inset 0 0 0 1px #2b2b2b,
      0 1rem 2.5rem rgba(0, 0, 0, 0.5);
  }

  .rail-label {
    left: calc(100% + 0.75rem);
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    padding: 0.3rem 0.65rem;
    border-radius: 0.45rem;
    background: #161616;
    box-shadow: inset 0 0 0 1px #2b2b2b;
    font-size: 0.85rem;
    opacity: 0;
    transform: translateX(-4px);
    pointer-events: none;
    transition:
      opacity var(--t-quick) var(--ease-out),
      transform var(--t-quick) var(--ease-out);
  }

  .rail a:hover .rail-label,
  .rail a:focus-visible .rail-label {
    opacity: 1;
    transform: none;
  }
}

/* Without JavaScript, view timelines light the chapter in view */
@supports (timeline-scope: --ch1) and (animation-timeline: view()) {
  .chapters {
    timeline-scope: --ch1, --ch2, --ch3, --ch4, --ch5, --ch6, --ch7, --ch8;
  }

  #color { view-timeline-name: --ch1; }
  #copy { view-timeline-name: --ch2; }
  #modes { view-timeline-name: --ch3; }
  #code { view-timeline-name: --ch4; }
  #bullets { view-timeline-name: --ch5; }
  #layout { view-timeline-name: --ch6; }
  #anywhere { view-timeline-name: --ch7; }
  #private { view-timeline-name: --ch8; }

  .rail .dot {
    animation: rail-lit linear none;
    animation-range: cover 50vh cover calc(100% - 50vh);
  }

  .rail .slot-1 .dot { animation-timeline: --ch1; }
  .rail .slot-2 .dot { animation-timeline: --ch2; }
  .rail .slot-3 .dot { animation-timeline: --ch3; }
  .rail .slot-4 .dot { animation-timeline: --ch4; }
  .rail .slot-5 .dot { animation-timeline: --ch5; }
  .rail .slot-6 .dot { animation-timeline: --ch6; }
  .rail .slot-7 .dot { animation-timeline: --ch7; }
  .rail .slot-8 .dot { animation-timeline: --ch8; }
}

@keyframes rail-lit {
  from, to { opacity: 1; }
}

/* ----- 1 · Palette wall ----- */

.palette-row {
  display: flex;
  gap: 0.9rem;
  margin: 1.75rem 0 0;
  padding: 0.5rem 0.25rem 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
  scrollbar-width: thin;
}

.palette-row li {
  flex: none;
  width: 7.25rem;
  scroll-snap-align: start;
  text-align: center;
}

.palette-row img {
  width: 100%;
  border-radius: 0.6rem;
  box-shadow: 0 0.6rem 1.5rem rgba(0, 0, 0, 0.45);
  transition: transform var(--t-quick) var(--ease-spring);
}

.palette-row span {
  display: block;
  margin-top: 0.55rem;
  color: var(--band-soft, var(--ink-soft));
  font-size: 0.85rem;
}

.palette-row button {
  display: block;
  width: 100%;
  padding: 0.3rem;
  border: 0;
  border-radius: 0.8rem;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.palette-row button:hover img {
  transform: translateY(-4px);
}

.palette-row button:active img {
  transform: scale(0.96);
}

.palette-row button[aria-pressed="true"] img {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.palette-row button[aria-pressed="true"] span {
  color: var(--chrome);
}

/* ----- 2 · A live mini slate ----- */

.mini-slate {
  overflow: hidden;
  border-radius: 0.9rem;
  background: var(--wash);
  color: var(--band-ink, var(--ink));
  box-shadow:
    0 1.5rem 4rem rgba(0, 0, 0, 0.45),
    0 0 0 1px color-mix(in srgb, var(--chrome) 22%, transparent);
  transition: background-color var(--t-base) var(--ease-out);
}

.mini-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.6rem;
  padding: 0.4rem 0.6rem 0.4rem 0.75rem;
  background: var(--header);
  color: var(--chrome);
  font-size: 0.9rem;
  transition: background-color var(--t-base) var(--ease-out);
}

.mini-head .dot {
  --size: 1.35rem;
}

.mini-actions {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}

.mini-actions button {
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--chrome) 16%, transparent);
  color: var(--chrome);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform var(--t-quick) var(--ease-spring);
}

.mini-actions button:hover {
  background: color-mix(in srgb, var(--chrome) 26%, transparent);
}

.mini-actions button:active {
  transform: scale(0.94);
}

.mini-slate textarea {
  display: block;
  width: 100%;
  min-height: 15rem;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 0;
  resize: vertical;
  background: transparent;
  color: inherit;
  font: 1rem/1.5 var(--font-mono);
  caret-color: var(--accent);
}

.mini-slate textarea:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.chapter .mini-foot {
  margin: 0;
  padding: 0.45rem 0.9rem;
  border-top: 1px solid color-mix(in srgb, var(--chrome) 18%, transparent);
  color: var(--chrome);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.mini-status:not(:empty)::before {
  content: "· ";
}

/* ----- 3 · Mode tabs over real captures ----- */

.mode-stage,
.lang-stage,
.layout-stage {
  position: relative;
  margin-inline: auto;
}

.mode-stage {
  max-width: 34rem;
  aspect-ratio: 1000 / 1029;
}

.mode-layer,
.m,
.code,
.lay {
  position: absolute;
  inset: 0;
}

.m img,
.code img,
.lay img {
  width: 100%;
  height: 100%;
  border-radius: 0.9rem;
  box-shadow:
    0 1.5rem 4rem rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Same window frame, so the outgoing capture waits under the incoming one */
.m,
.code {
  display: none;
  opacity: 0;
  transition:
    opacity 0s var(--t-base),
    display 0s var(--t-base) allow-discrete;
}

.modes:has(#mode-plain:checked) .m-plain,
.modes:has(#mode-rich:checked) .m-rich,
.modes:has(#mode-code:checked) .m-code,
.langs:has(#lang-swift:checked) .l-swift,
.langs:has(#lang-rust:checked) .l-rust,
.langs:has(#lang-cpp:checked) .l-cpp,
.langs:has(#lang-javascriptreact:checked) .l-javascriptreact,
.langs:has(#lang-php:checked) .l-php,
.langs:has(#lang-ruby:checked) .l-ruby,
.langs:has(#lang-scss:checked) .l-scss,
.langs:has(#lang-html:checked) .l-html {
  display: block;
  opacity: 1;
  z-index: 1;
  transition:
    opacity var(--t-base) var(--ease-out),
    display 0s allow-discrete;
}

@starting-style {
  .modes:has(#mode-plain:checked) .m-plain,
  .modes:has(#mode-rich:checked) .m-rich,
  .modes:has(#mode-code:checked) .m-code,
  .langs:has(#lang-swift:checked) .l-swift,
  .langs:has(#lang-rust:checked) .l-rust,
  .langs:has(#lang-cpp:checked) .l-cpp,
  .langs:has(#lang-javascriptreact:checked) .l-javascriptreact,
  .langs:has(#lang-php:checked) .l-php,
  .langs:has(#lang-ruby:checked) .l-ruby,
  .langs:has(#lang-scss:checked) .l-scss,
  .langs:has(#lang-html:checked) .l-html {
    opacity: 0;
  }
}

/* Sweep to Light, as on the Stage; follows prefers-color-scheme until picked */
.mode-layer-light {
  display: none;
  clip-path: inset(0 0 0 100%);
  transition:
    clip-path var(--t-sweep) var(--ease-out),
    display 0s linear var(--t-sweep) allow-discrete;
}

.modes:has(#mode-light:checked) .mode-layer-light {
  display: block;
  clip-path: inset(0);
  transition:
    clip-path var(--t-sweep) var(--ease-out),
    display 0s allow-discrete;
}

@starting-style {
  .modes:has(#mode-light:checked) .mode-layer-light {
    clip-path: inset(0 100% 0 0);
  }
}

@media (prefers-color-scheme: light) {
  .modes:not(:has(#mode-dark:checked)) .mode-layer-light {
    display: block;
    clip-path: inset(0);
  }
}

.mode-keys {
  min-height: 1.5em;
  margin: 1.5rem 0 0;
  text-align: center;
}

.chapter .mode-keys {
  color: var(--chrome);
  font-size: 0.95rem;
}

.mk {
  display: none;
}

.modes:has(#mode-plain:checked) .mk-plain,
.modes:has(#mode-rich:checked) .mk-rich,
.modes:has(#mode-code:checked) .mk-code {
  display: inline;
}

/* ----- 4 · The language picker ----- */

.langs {
  display: grid;
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .langs {
    grid-template-columns: 13rem 1fr;
    gap: 3rem;
  }
}

/* Styled like the app's language menu */
.lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  min-width: 0;
  margin: 0;
  padding: 0.35rem;
  border: 0;
  border-radius: 0.75rem;
  background: #1e1e1e;
  box-shadow:
    inset 0 0 0 1px #333,
    0 1rem 2.5rem rgba(0, 0, 0, 0.5);
  font-size: 0.95rem;
}

@media (min-width: 52rem) {
  .lang-list {
    flex-direction: column;
    flex-wrap: nowrap;
  }
}

.lang-list legend {
  float: left;
  width: 100%;
  padding: 0.3rem 0.6rem 0.4rem 1.7rem;
  color: #8a8a8a;
  font-size: 0.8rem;
}

.lang-list input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lang-list label {
  position: relative;
  padding: 0.3rem 0.7rem 0.3rem 1.7rem;
  border-radius: 0.4rem;
  color: #e7e7e7;
  cursor: pointer;
}

.lang-list label:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lang-list input:checked + label {
  background: color-mix(in srgb, var(--accent) 78%, #000);
  color: #fff;
}

.lang-list input:checked + label::before {
  content: "✓";
  position: absolute;
  left: 0.6rem;
}

.lang-list input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.lang-stage {
  width: 100%;
  max-width: 36rem;
  aspect-ratio: 900 / 958;
}

.lang-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: color-mix(in srgb, var(--band-ink, #fff) 58%, transparent);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
}

.lang-cloud .shown {
  color: var(--chrome);
}

/* ----- 5 · Clickable cycle bullets ----- */

.cycles-demo {
  align-items: start;
}

.bullets {
  margin: 0;
  padding: 0.9rem 1.1rem 1rem;
  list-style: none;
  font-size: 1.02rem;
  line-height: 1.55;
}

.bullets li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  transition: color var(--t-base) var(--ease-out);
}

.bullets li.is-done {
  color: color-mix(in srgb, currentColor 55%, transparent);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, currentColor 60%, transparent);
}

.bullet {
  flex: none;
  width: 1.5em;
  text-align: center;
}

button.bullet {
  padding: 0;
  border: 0;
  border-radius: 0.35rem;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-quick) var(--ease-spring);
}

button.bullet:active {
  transform: scale(0.82);
}

.dash {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cycles,
.keys {
  margin: 1.25rem 0 0;
}

.cycles div,
.keys div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--chrome) 20%, transparent);
}

.cycles dd,
.keys dd {
  margin: 0;
}

.cycles dd {
  letter-spacing: 0.18em;
}

.keys dt {
  color: var(--band-ink, var(--ink));
}

/* ----- 6 · Layout toggle ----- */

.layout-stage {
  max-width: 60rem;
  aspect-ratio: 1400 / 905;
}

/* List and strip differ in shape: fade out, then fade in */
.lay {
  display: none;
  opacity: 0;
  transition:
    opacity 140ms ease-in,
    display 0s 140ms allow-discrete;
}

.layout-demo:has(#layout-v:checked) .lay-v,
.layout-demo:has(#layout-h:checked) .lay-h {
  display: block;
  opacity: 1;
  transition:
    opacity 240ms var(--ease-out) 140ms,
    display 0s allow-discrete;
}

@starting-style {
  .layout-demo:has(#layout-v:checked) .lay-v,
  .layout-demo:has(#layout-h:checked) .lay-h {
    opacity: 0;
  }
}

/* ----- Recordings: click to play ----- */

.clip {
  margin: 0;
}

.clip video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.9rem;
  background: var(--header);
  box-shadow:
    0 1.5rem 4rem rgba(0, 0, 0, 0.5),
    0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.clip figcaption {
  margin-top: 0.75rem;
  color: var(--band-soft, var(--ink-soft));
  font-size: 0.9rem;
}

/* ----- 8 · Private by design ----- */

.vows {
  margin: 1.5rem 0 2.25rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  font-weight: 250;
  line-height: 1.2;
}

.chapter .vows li {
  color: var(--band-ink, var(--ink));
}

.chapter .vows li:last-child {
  margin-top: 0.75rem;
  color: var(--chrome);
  font-size: 0.6em;
}

.chapter .cta {
  justify-content: flex-start;
  margin-top: 2rem;
}

/* ---------- Privacy (Slates Light) ---------- */

.light a {
  color: var(--chrome);
  text-decoration-color: color-mix(in srgb, var(--chrome) 55%, transparent);
}

.light a:hover {
  text-decoration-color: var(--chrome);
}

.light .band-head {
  color: var(--ink-dark);
}

.light .band-body {
  padding-block: clamp(3rem, 7vw, 4.5rem);
}

.light h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.2rem);
  font-weight: 350;
}

.light p,
.light li {
  color: #2b2b2b;
}

.light :focus-visible {
  outline-color: var(--chrome);
}

.dated {
  color: var(--ink-soft);
}

/* ---------- 404 ---------- */

.lost {
  min-height: 60vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.lost .strip {
  justify-content: center;
  margin-bottom: 2.5rem;
}

.lost .strip .dot {
  --size: 2.2rem;
}

/* The missing page is slate 8, left blank as in the app. Hover, focus, or
   toggle it and the empty window rises out of the gap. */
.peek {
  position: relative;
}

.peek input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lost .strip .blank {
  color: transparent;
  cursor: pointer;
  transition: transform var(--t-quick) var(--ease-spring);
}

.lost .strip .blank:active {
  transform: scale(0.94);
}

.peek input:focus-visible + .strip .blank {
  outline: 3px solid var(--slate-8);
  outline-offset: 3px;
}

.empty-window {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: calc(100% - 1.25rem);
  width: min(16rem, 72vw);
  margin: 0 0 0 calc(min(16rem, 72vw) / -2);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transition:
    opacity var(--t-base) var(--ease-out),
    transform var(--t-stage) var(--ease-spring),
    visibility 0s var(--t-stage);
}

.empty-window img {
  border-radius: 0.9rem;
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.lost .peek ~ * {
  transition: opacity var(--t-base) var(--ease-out);
}

.lost:has(.blank:hover, #peek:checked, #peek:focus-visible) .peek ~ * {
  opacity: 0.12;
}

.peek:has(.blank:hover) .empty-window,
.peek:has(#peek:checked) .empty-window,
.peek:has(#peek:focus-visible) .empty-window {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition:
    opacity var(--t-base) var(--ease-out),
    transform var(--t-stage) var(--ease-spring),
    visibility 0s;
}

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

.site-foot {
  background: var(--ground-raised);
  border-top: 1px solid var(--header-8);
  color: var(--muted);
  font-size: 1rem;
}

.site-foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.25rem var(--gutter) 2.5rem;
}

.site-foot nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-foot nav li + li::before {
  content: "·";
  margin-right: 0.5rem;
  color: var(--muted);
}

.site-foot a {
  color: var(--chrome-8);
  text-decoration-color: var(--slate-8);
}

.site-foot p {
  margin: 0;
}

.foot-strip {
  display: flex;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-strip .dot {
  --size: 0.9rem;
}

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

/* Cross-page transitions: the site bar and footer hold still, content fades */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

.site-bar {
  view-transition-name: site-bar;
}

.site-foot {
  view-transition-name: site-foot;
}

::view-transition-group(root) {
  animation-duration: var(--t-base);
}

/*
 * Scroll-driven patterns. Browsers without view timelines get the finished
 * layout; nothing here carries information.
 */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Settle: a band's header slides in and its glyph pops as it enters */
    .band-head-inner {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 90%;
    }

    .band-head .dot {
      animation: pop linear both;
      animation-timeline: view();
      animation-range: entry 30% entry 100%;
    }

    /* Stagger: feature cards arrive one after another, 1 to 8 */
    .features .feature {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 85%;
    }

    .features .feature:nth-child(even) {
      animation-range: entry 15% entry 95%;
    }

    /* Drift: large photographs scale in slightly */
    .drift {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }
  }
}

@keyframes settle {
  from { opacity: 0; transform: translateX(-24px); }
}

@keyframes pop {
  from { transform: scale(0.8); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1.5rem); }
}

@keyframes drift {
  from { opacity: 0.55; transform: scale(0.96); }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  a.store:hover {
    transform: none;
  }
}
