/* Colours are defined once, here. Dark mode will add a second set of the job values. */
:root {
  /* Palette (light) */
  --cream: #EEE4D7;
  --rust: #9A2D19;
  --ink: #1A190B;
  --brown: #42240F;

  /* Ember rose: every glow on the page, the same as the logo's glow and the pill's
     (docs/specs/logo.md, PillStyle.glowColor). */
  --rose-glow: #D9776B;   /* the wide light */
  --rose-edge: #F2A496;   /* the close, paler edge; also the "Coming soon" badge (brown text 7.1:1) */

  /* Jobs */
  --bg: var(--cream);
  --surface: color-mix(in srgb, var(--cream), white 45%);
  --text: var(--ink);
  --text-secondary: var(--brown);
  /* Clay rose: the page's one accent colour, chosen by the user. Headings and "spark"
     (4.2:1 on cream, large text), the nav hover line and Download buttons. */
  --clay-rose: #A8524A;
  --clay-rose-text: color-mix(in srgb, var(--clay-rose), var(--ink) 10%);   /* #9A4C44, 4.8:1: for small text */
  --heading-accent: var(--clay-rose);
  --link: var(--rust);
  /* GitHub buttons are a small piece of the logo: its graphite ground (docs/specs/logo.md),
     warm-white text like the E, a thin pale-rose edge and a soft rose glow. They stand
     apart from the fact chips, which are plain pills. */
  --github-ground-top: #26262A;
  --github-ground-bottom: #111114;
  --github-text: #FFF1E2;   /* the logo E's warm white: about 16:1 on graphite */
  /* Download buttons: one distinct, muted brand colour, like the reference site's. Clay
     rose, with the label in the logo E's warm white (4.8:1). */
  --download-bg: var(--clay-rose);
  --download-text: #FFF1E2;
  --line: color-mix(in srgb, var(--brown), transparent 82%);
  --screen-shadow: var(--brown);
  --badge-bg: var(--rose-edge);
  --badge-text: var(--brown);
  --halo-1: color-mix(in srgb, var(--rose-edge), transparent 45%);
  --halo-2: color-mix(in srgb, var(--rose-glow), transparent 70%);
  --halo-3: color-mix(in srgb, var(--clay-rose), transparent 88%);
  /* "Light up your notch." on fire (motion item 10): the core of each ember, and the
     light on the letters where one lifts off. */
  --ember-core: var(--rose-glow);
  --ember-hot: var(--rose-edge);

  /* The app's own colours, used only in the pill demo. They match
     Ember/Pill/PillStyle.swift, Ember/Timer/TimerLook.swift and
     Ember/Battery/BatteryAlerts.swift, in both themes. */
  --app-glow: #D9776B;   /* Ember rose, PillStyle.glowColor */
  --app-timer: #FF7A1E;  /* the timer's orange, TimerLook.color */
  --app-green: #30D158;
  /* The demo songs' glows: what the app's CoverColor gives each cover
     (docs/specs/landing-page.md, "The pill demo"). Song A's cover is mostly white with red bars,
     so it glows red; song B's is black and white, so it glows the app's soft white. */
  --song-a: #FF4C53;
  --song-b: #E6E6E6;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* Dark mode (spec: "Dark mode"): Graphite, the logo's ground. Only the jobs change; the
   pill, the glows and the buttons keep their colours. The page follows the system's
   setting, also without JavaScript, unless the switch chose a mode (data-theme on <html>,
   theme.js). The two rules hold the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121214;
    --surface: #1C1C20;
    --text: #FFF1E2;
    --text-secondary: #BDB4AB;
    --heading-accent: #E38A7E;
    --clay-rose-text: #E38A7E;
    --link: #F2A496;
    --line: rgb(255 241 226 / 0.12);
    --screen-shadow: #000;
    --ember-core: var(--rose-edge);
    --ember-hot: #FFD9CC;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121214;
  --surface: #1C1C20;
  --text: #FFF1E2;
  --text-secondary: #BDB4AB;
  --heading-accent: #E38A7E;
  --clay-rose-text: #E38A7E;
  --link: #F2A496;
  --line: rgb(255 241 226 / 0.12);
  --screen-shadow: #000;
  --ember-core: var(--rose-edge);
  --ember-hot: #FFD9CC;
}

/* Switching cross-fades the page (theme.js), a touch slower than the browser's default. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.3s; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
h1, h2, h3 { margin: 0; line-height: 1.15; }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Navigation bar: pinned to the top, see-through and blurred like macOS menus. */

html { scroll-padding-top: 76px; }   /* section links land below the bar */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg), transparent 25%);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

/* Where supported, the line under the bar fades in over the first 40 px of scrolling.
   Elsewhere it is always shown. */
@supports (animation-timeline: scroll()) {
  .nav {
    animation: nav-line linear both;
    animation-timeline: scroll();
    animation-range: 0 40px;
  }
  @keyframes nav-line {
    from { border-bottom-color: transparent; }
  }
}

/* Wider than the page's content, like the reference site's nav. */
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 1280px;
  height: 76px;
  padding: 0 24px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  font-size: 25px;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
}

.nav-links { display: flex; gap: 40px; margin: 0; padding: 0; list-style: none; }

.nav-links a {
  position: relative;
  padding: 6px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

/* On hover (and keyboard focus) a short glowing Ember line grows from the centre under
   the link, like the pill's bright edge line. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--clay-rose);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--clay-rose), transparent 45%);
  scale: 0 1;
  transition: scale 0.25s ease-out;
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--clay-rose-text); }
.nav-links a:hover::after,
.nav-links a:focus-visible::after { scale: 1 1; }
.nav-links a:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .nav-links a::after { transition: none; }
}

.nav-actions { display: flex; align-items: center; gap: 12px; justify-self: end; }

/* The light/dark switch: a sun and a moon; a clay rose dot with the pill's soft glow sits
   under the one that is on and slides across. Hidden until theme.js runs. */
.theme-switch {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-switch[hidden] { display: none; }
.theme-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--clay-rose);
  box-shadow: 0 0 10px -2px var(--rose-glow);
  transition: translate 0.25s ease;
}
.theme-switch[aria-checked="true"]::before { translate: 32px 0; }
.theme-switch svg {
  position: relative;
  box-sizing: content-box;
  width: 16px;
  height: 16px;
  padding: 5px;
  opacity: 0.55;
  transition: color 0.25s, opacity 0.25s;
}
.theme-switch[aria-checked="false"] .theme-sun,
.theme-switch[aria-checked="true"] .theme-moon { color: var(--download-text); opacity: 1; }
.theme-switch:focus-visible { outline: 3px solid var(--clay-rose); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .theme-switch::before, .theme-switch svg { transition: none; }
}

/* Phones up to 400 px: the bar tightens so the switch fits beside Download. */
@media (max-width: 400px) {
  .nav-inner { padding: 0 16px; }
  .nav-brand { font-size: 20px; }
  .nav-brand img { width: 40px; height: 40px; }
  .nav-actions { gap: 8px; }
  .nav-actions .button-small { padding: 0 14px; }
}

/* On phones the section links go; the name and Download stay. */
@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-inner { grid-template-columns: 1fr auto; }
}

/* Buttons */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.button:focus-visible { outline: 3px solid var(--clay-rose); outline-offset: 3px; }

.button-small { min-height: 40px; padding: 0 20px; font-size: 15px; }

.button-icon { width: 18px; height: 18px; fill: currentColor; }

.button-github {
  isolation: isolate;
  background: linear-gradient(180deg, var(--github-ground-top), var(--github-ground-bottom));
  color: var(--github-text);
  /* At rest: darker, with a softer rose edge and glow. */
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--rose-edge), transparent 80%),
    0 0 12px 0 color-mix(in srgb, var(--rose-glow), transparent 80%);
  transition: box-shadow 0.25s ease-out;
}
/* The darkening is a layer over the graphite (a gradient can't fade by itself); it sits
   under the label and icon. */
.button-github::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgb(0 0 0 / 0.4);
  transition: opacity 0.25s ease-out;
}
/* Hover brightens it to the full graphite, with the rose edge and glow at full strength. */
.button-github:hover::before { opacity: 0; }
.button-github:hover {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--rose-edge), transparent 65%),
    0 0 14px 0 color-mix(in srgb, var(--rose-glow), transparent 65%);
}

/* The nav's Download: clay rose with a warm-white label, and the pill's resting glow
   (PillStyle rest): a soft Ember rose light around it, always on, and a thin pale-rose
   line on its lower edge that fades out towards the top. */
.button-ember {
  background: var(--download-bg);
  color: var(--download-text);
  box-shadow: 0 0 14px 1px color-mix(in srgb, var(--rose-glow), transparent 45%);
  filter: brightness(1) saturate(1) drop-shadow(0 0 0 color-mix(in srgb, var(--rose-glow), transparent 100%));
  transition: filter 0.25s ease-out, translate 0.2s ease-out;
}
.button-ember::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1.5px solid var(--rose-edge);
  border-radius: inherit;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 30%, #000);
  mask-image: linear-gradient(to bottom, transparent 30%, #000);
}
/* Hover holds the bright peak of its blink (motion item 9): brighter, a touch more colour
   and a rose glow, for as long as the pointer is on it, and rises 2 px. Pressing sets it
   back down and dims it slightly. */
.button-ember:hover {
  translate: 0 -2px;
  filter: brightness(1.12) saturate(1.1) drop-shadow(0 0 14px color-mix(in srgb, var(--rose-glow), transparent 35%));
}
.button-ember:active {
  translate: 0 0;
  filter: brightness(1.04) saturate(1.04) drop-shadow(0 0 8px color-mix(in srgb, var(--rose-glow), transparent 50%));
}
@media (prefers-reduced-motion: reduce) {
  .button-ember:hover { translate: none; }
}

.button-disabled {
  border: 1.5px solid var(--line);
  color: color-mix(in srgb, var(--text-secondary), transparent 45%);
  cursor: not-allowed;
  user-select: none;
}

.badge {
  position: absolute;
  top: -11px;
  right: -12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 16px;
  margin-top: 32px;
}
/* On phones the two buttons stay side by side and keep the full "Download for macOS":
   padding and text shrink with the screen (15 px text at 420 px, 13 px at 360 px). */
@media (max-width: 480px) {
  .actions { gap: 20px 8px; }
  .actions .button { gap: 6px; padding: 0 clamp(12px, 3.6vw, 16px); font-size: clamp(12px, 3.6vw, 15px); }
}

/* Hero: text first, then the screen with the pill demo. */

.hero {
  padding: 72px 0 96px;
  /* Nothing here should be wider than the screen (the glow is capped below), but in case:
     clip where supported, hidden as the fallback for older browsers. */
  overflow-x: hidden;
  overflow-x: clip;
  text-align: center;
}

.hero-title {
  max-width: 820px;
  margin: 0 auto;
  font-size: clamp(40px, 7.5vw, 76px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.sheen { position: relative; color: var(--heading-accent); }
.word-sparks { display: none; }   /* shown by the motion rules */

.lede {
  max-width: 560px;
  margin: 20px auto 0;
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-secondary);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface), transparent 30%);
  font-size: 14px;
  font-weight: 550;
  color: var(--text-secondary);
}

.facts svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--clay-rose);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-visual { position: relative; isolation: isolate; margin-top: 120px; }

/* The brand glow, like the light around the logo's E, centred on the notch. */
.hero-glow {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: -1;
  /* Never wider than the screen, even at its 5% breathing scale: a wider glow made phones
     zoom out to fit the page. */
  width: min(656px, 74vw);    /* 20% smaller than the first 820 × 460, at the user's request */
  height: min(368px, 72vw);
  translate: -50% -45%;
  background: radial-gradient(closest-side, var(--halo-1), var(--halo-2) 50%, var(--halo-3) 75%, transparent);
  pointer-events: none;
}

.sparks { display: none; }   /* shown by the motion rules (Task 3) */

/* Sections */

.section { padding: 88px 0; border-top: 1px solid var(--line); }

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link);
}

.section h2 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading-accent);
}

/* Sections are centred like the hero and Get started: their label, heading and intro. */
.eyebrow, .section h2 { text-align: center; }
.section-intro { max-width: 620px; margin: 14px auto 0; color: var(--text-secondary); text-align: center; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
  margin-top: 36px;
}

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

/* A "Planned" tag sits on its own line under the card's title. */
.card h3 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: 18px;
  font-weight: 650;
}

.card p { margin: 8px 0 0; font-size: 15.5px; color: var(--text-secondary); }

.tag {
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  color: var(--link);
}

/* FAQ: native <details>; opening one closes the others. */

.faq { max-width: 760px; margin: 28px auto 0; }

.faq-item { border-bottom: 1px solid var(--line); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-size: 18px;
  font-weight: 600;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 3px solid var(--clay-rose); outline-offset: 4px; border-radius: 6px; }

/* The chevron. */
.faq-item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--link);
  border-bottom: 2px solid var(--link);
  rotate: 45deg;
  translate: 0 -3px;
  transition: rotate 0.3s, translate 0.3s;
}
.faq-item[open]:not(.is-closing) summary::after { rotate: 225deg; translate: 0 3px; }

.faq-item p { max-width: 680px; margin: 0 0 22px; color: var(--text-secondary); }

/* Get started */

/* Plain inside; the glow surrounds the whole card, like the pill's glow. Same recipe as
   "spark": a clay rose edge, a soft pale-rose light close to it, fading out through clay rose. */
.cta {
  padding: 64px 24px;
  border: 1px solid color-mix(in srgb, var(--clay-rose), transparent 55%);
  border-radius: 28px;
  background: var(--surface);
  box-shadow:
    0 0 24px 0 color-mix(in srgb, var(--rose-edge), transparent 70%),
    0 0 70px 6px color-mix(in srgb, var(--clay-rose), transparent 84%),
    0 0 120px 12px color-mix(in srgb, var(--clay-rose), transparent 93%);
  text-align: center;
}
/* On phones the card's sides slim down, so its two buttons fit side by side from 360 px. */
@media (max-width: 480px) {
  .cta { padding-inline: 16px; }
}

/* "Light up your notch.": lit, with a soft rose glow. The embers and hot spots are in the
   motion rules (item 10); without motion it stays like this. An inline block, so the embers spread
   across the text itself, on one line or two. */
.fire {
  position: relative;
  display: inline-block;
  text-shadow: 0 0 8px color-mix(in srgb, var(--rose-glow), transparent 70%);
}
.embers, .hot-spots { display: none; }

/* The three install steps on a fuse. Drawn here fully lit, which is what you see without
   motion; the motion rules play the spark along it once. */
.fuse-steps { --gap: 20px; position: relative; max-width: 780px; margin: 52px auto 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.step { padding: 0 8px; }
.step h3 { margin: 14px 0 4px; font-size: 18px; font-weight: 650; }
.step p { margin: 0; font-size: 15px; color: var(--text-secondary); }

.step-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 2px solid var(--clay-rose);
  border-radius: 50%;
  background: var(--clay-rose);
  color: var(--download-text);
  font-weight: 700;
}
/* The last step is where the spark lands: it glows. */
.step:last-child .step-node {
  border-color: var(--rose-edge);
  box-shadow:
    0 0 14px 3px color-mix(in srgb, var(--rose-edge), transparent 30%),
    0 0 30px 6px color-mix(in srgb, var(--rose-glow), transparent 65%);
}
.step:last-child h3 { color: var(--clay-rose-text); }

/* The fuse runs from the centre of the first step to the centre of the last. */
.fuse {
  position: absolute;
  top: 21px;
  left: calc((100% - 2 * var(--gap)) / 6);
  right: calc((100% - 2 * var(--gap)) / 6);
  height: 2px;
  background: var(--line);
}
.fuse-burnt {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, var(--clay-rose), var(--rose-edge));
}
.fuse-spark { display: none; }   /* shown by the motion rules */

/* The card's closing line, under the steps. */
.cta-outro { max-width: 560px; margin: 48px auto 0; font-size: 16px; color: var(--text-secondary); }

@media (max-width: 640px) {
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .fuse { display: none; }
}

/* Footer */

/* Footer: brand left, quiet links in the middle, legal lines right. Stacks on phones. */

.footer { padding: 64px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-secondary); }

/* Three columns like the nav, so the links sit in the page's centre. */
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  justify-self: start;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--text); }
.footer-links svg { width: 16px; height: 16px; fill: currentColor; }

.footer-legal { justify-self: end; text-align: right; }
.footer-legal p { margin: 0; font-size: 13px; }

@media (max-width: 760px) {
  .footer-inner { display: flex; flex-direction: column; text-align: center; }
  .footer-legal { text-align: center; }
}

/* The pill demo. Sizes are the app's, 1 CSS px = 1 point: a 14" MacBook Pro notch is
   185 × 32, the pill reaches 1 below it, each wing adds 48 minus the 6-point top flare,
   and the bottom corners have a radius of 14 (Ember/Pill/NotchGeometry.swift and
   PillStyle.swift). */

/* Registered so they animate: the glow changes colour smoothly between songs, and the
   flares grow with the open panel. */
@property --glow { syntax: '<color>'; inherits: true; initial-value: #D9776B; }
@property --flare { syntax: '<length>'; inherits: true; initial-value: 6px; }

/* The hero's screen sits below the text in a wider container, up to 1280 px (the nav's
   width). */
.container-wide { max-width: 1312px; margin: 0 auto; padding: 0 16px; }

/* The screen is drawn at 1280 px wide on a stage (bezel and wallpaper) and scaled down
   with it to fit narrower windows (screen.js sets --screen-scale), so the open panel keeps
   its true share of the width: 620 of 1280, close to a 14" MacBook's 620 of 1512.
   Without JavaScript it shows its middle at 1:1. */
.screen {
  --screen-scale: 1;
  height: calc(312px * var(--screen-scale));
  overflow: hidden;
  border-radius: calc(24px * var(--screen-scale)) calc(24px * var(--screen-scale)) 0 0;
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--screen-shadow), transparent 55%);
}
.screen-stage {
  position: relative;
  left: 50%;
  width: 1280px;
  padding: 12px 12px 0;
  border-radius: 24px 24px 0 0;
  background: #000;
  translate: -50% 0;
  transform-origin: top center;
  scale: var(--screen-scale);
}

.wallpaper {
  position: relative;
  height: 300px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  /* Neutral graphite, so the only colour on the screen is Ember's own glow. */
  background: radial-gradient(120% 140% at 50% 0%, #232326 0%, #141416 70%);
}

/* The menu bar: Finder's menus on the left; Wi-Fi, battery and the visitor's own time on
   the right (screen.js). No Apple logo: the site uses none of Apple's assets. */
.menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 16px;
  background: rgb(255 255 255 / 0.06);
  color: rgb(255 255 255 / 0.92);
  font: 500 13px/1 var(--font);
  white-space: nowrap;
}
.menu-items { display: flex; align-items: center; gap: 20px; fill: currentColor; }
.menu-items b { font-weight: 700; }

/* Phones and narrow windows: scaled, everything would be tiny, so the screen is a
   close-up around the notch instead, at 1:1, without the menus. */
@media (max-width: 799px) {
  .screen { height: auto; border-radius: 24px 24px 0 0; }
  .screen-stage { left: 0; width: auto; translate: none; scale: none; }
  /* Just taller than the open panel, which shrinks with the screen: the space below it is
     60% of what a fixed 220 px left (117 → 70 px at 390 px wide). */
  .wallpaper { height: calc(132px + 80px * var(--open-scale, 1)); }
  .menu-items { display: none; }
}

.pill {
  --glow: var(--app-glow);
  --edge: color-mix(in oklab, var(--glow), white 45%);
  --notch-width: 185px;
  --wing: 42px;
  --flare: 6px;

  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  width: var(--notch-width);
  height: 33px;
  border-radius: 0 0 14px 14px;
  background: #000;
  transform-origin: top center;
  /* At rest: a soft glow, centred (PillStyle rest: opacity 0.6, radius 8, offset 0). */
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--glow) 60%, transparent));
}

/* On narrow phones the wide pill (269 + flares) would fill the whole mock screen, so the
   pill is drawn at 80%, scaled from its top centre so it stays on the notch. */
@media (max-width: 420px) {
  .pill { scale: 0.8; }
}

/* The top corners flare outward where the pill meets the top of the screen. */
.flare { position: absolute; top: 0; width: var(--flare); height: var(--flare); }
.flare-left {
  left: calc(-1 * var(--flare));
  background: radial-gradient(circle at 0 100%, transparent var(--flare), #000 calc(var(--flare) + 0.5px));
}
.flare-right {
  right: calc(-1 * var(--flare));
  background: radial-gradient(circle at 100% 100%, transparent var(--flare), #000 calc(var(--flare) + 0.5px));
}

/* The bright edge line. At rest: 2 wide, fading in from the top to full at 60%. */
.edge {
  position: absolute;
  inset: 0 -1px -1px;
  border: 2px solid var(--edge);
  border-top: 0;
  border-radius: 0 0 15px 15px;
  opacity: 0.6;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 60%);
  mask-image: linear-gradient(to bottom, transparent, #000 60%);
}

/* Holds the wings; clipped to the pill so they are uncovered as it grows. */
.pill-body { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }

.wings {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  opacity: 0;
}

/* Active: the pill widens into wings and glows brighter, pushed down
   (PillStyle active: opacity 0.85, radius 10, offset 5). The spring roughly matches
   PillStyle.animation (response 0.38, damping 0.8). */
.pill {
  transition: width 0.45s cubic-bezier(0.3, 1.2, 0.5, 1), height 0.45s cubic-bezier(0.3, 1.2, 0.5, 1),
    border-radius 0.45s ease, --flare 0.45s ease, scale 0.45s ease, filter 0.45s ease, --glow 0.4s ease;
}
.pill[data-state="active"] {
  width: calc(var(--notch-width) + 2 * var(--wing));
  filter: drop-shadow(0 5px 10px color-mix(in srgb, var(--glow) 85%, transparent));
}

/* Active edge line: 1 wide on the edge, fading in from the middle to the bottom. */
.edge { transition: opacity 0.45s ease; }
.pill:is([data-state="active"], [data-state="open"]) .edge {
  inset: 0 -0.5px -0.5px;
  border-width: 0 1px 1px;
  border-radius: 0 0 14.5px 14.5px;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(to bottom, transparent 50%, #000);
  mask-image: linear-gradient(to bottom, transparent 50%, #000);
}

/* Open: the app's panel, 620 × 200, with rounder corners and a wider glow pushed down
   (PillStyle open: flares 19, bottom corners 24, glow opacity 0.55, radius 16, offset 8).
   Scaled down to fit narrow screens (screen.js sets --open-scale). */
.pill[data-state="open"] {
  --flare: 19px;
  width: 620px;
  height: 200px;
  border-radius: 0 0 24px 24px;
  scale: var(--open-scale, 1);
  filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--glow) 55%, transparent));
}
.pill[data-state="open"] .edge { border-radius: 0 0 24.5px 24.5px; opacity: 0.55; }

/* The wings sharpen out of a blur just after the pill starts to grow, and leave quickly
   (PillStyle.contentTransition: in 0.3 s after 0.1 s, out 0.15 s). */
.wings { filter: blur(3px); transition: opacity 0.15s ease, filter 0.15s ease; }
.pill[data-state="active"] .wings {
  opacity: 1;
  filter: none;
  transition: opacity 0.3s ease 0.1s, filter 0.3s ease 0.1s;
}

.wing {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--wing);
  height: 32px;
}

.wing-icon { color: var(--glow); fill: currentColor; }
.wing-icon[data-icon="battery-bolt"] { width: 22px; height: 11px; }
.wing-icon[data-icon="timer"] { width: 14px; height: 14px; }

.wing-text {
  color: #FFFFFF;
  font: 600 12px/1 var(--font);
  font-variant-numeric: tabular-nums;
}

/* Now Playing (Ember/Pill/PillView.swift, EqualizerView.swift): a 20 × 20 cover with
   rounded corners in the left wing, and an equalizer of four bars in the cover's colour in
   the right. The covers are below. */
.wing-cover { width: 20px; height: 20px; border-radius: 5px; }
.wing-eq { display: flex; align-items: center; gap: 2px; height: 12px; }
.wing-eq i { width: 2.5px; height: 8px; border-radius: 2px; background: var(--glow); }

/* Which wing content shows: a symbol and text, or (for music) the cover and equalizer. */
.wing-cover, .wing-eq { display: none; }
.pill[data-kind="music"] .wing-icon,
.pill[data-kind="music"] .wing-text { display: none; }
.pill[data-kind="music"] .wing-cover { display: block; }
.pill[data-kind="music"] .wing-eq { display: flex; }

/* The open panel (Ember/Panel/PanelView.swift, NowPlayingPanelView.swift): a top row
   beside the notch, then the player; 32 px at the sides clears the open corners. Centred,
   so it is uncovered from the middle, and shown like the wings: out of a blur just after
   the pill starts to grow, gone quickly. */
.panel {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  width: 620px;
  height: 200px;
  padding: 0 32px;
  color: #FFFFFF;
  font-family: var(--font);
  text-align: left;
  opacity: 0;
  filter: blur(3px);
  transition: opacity 0.15s ease, filter 0.15s ease;
}
.pill[data-state="open"] .panel {
  opacity: 1;
  filter: none;
  transition: opacity 0.3s ease 0.1s, filter 0.3s ease 0.1s;
}

.panel-top { display: flex; align-items: center; justify-content: space-between; height: 32px; }
.panel-tabs { display: flex; gap: 4px; }
.panel-tab { display: flex; padding: 4px 8px; border-radius: 999px; color: rgb(255 255 255 / 0.55); fill: currentColor; }
.pill:not([data-tab="timer"]) .panel-tab-music,
.pill[data-tab="timer"] .panel-tab-timer { background: rgb(255 255 255 / 0.15); color: #FFFFFF; }
.panel-battery { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; fill: currentColor; }

.player { display: flex; flex: 1; align-items: center; gap: 18px; }
.panel-cover { width: 96px; height: 96px; border-radius: 12px; }
.player-info { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.song-title { display: block; font-size: 15px; font-weight: 600; }
.song-artist { display: block; margin-top: 6px; font-size: 13px; color: rgb(255 255 255 / 0.6); }

/* The scrubber: a thin white track with a round knob. demo.js moves it as the song plays
   and sets it back on the new song. */
.scrubber { height: 4px; margin-top: 6px; border-radius: 2px; background: rgb(255 255 255 / 0.2); }
.scrubber-fill {
  position: relative;
  display: block;
  width: 27%;
  height: 100%;
  border-radius: inherit;
  background: #FFFFFF;
}
.scrubber-fill::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FFFFFF;
}
.times {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgb(255 255 255 / 0.5);
}

.controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 2px; fill: currentColor; }
/* The Timer tab (Ember/Timer/TimerPanelView.swift): the digits with arrows on the left,
   the presets above Start and Reset on the right, 48 apart. Shown instead of the player. */
.pill:not([data-tab="timer"]) .timer-view,
.pill[data-tab="timer"] .player { display: none; }
.timer-view { display: flex; flex: 1; align-items: center; justify-content: center; gap: 48px; }
.timer-digits { display: flex; align-items: center; gap: 4px; }
.timer-unit { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.timer-unit svg { margin: 4.5px 0; color: rgb(255 255 255 / 0.7); transition: opacity 0.2s ease; }
.timer-value, .timer-colon { font-size: 36px; font-weight: 500; line-height: 1.2; }
.timer-value { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.timer-colon { color: rgb(255 255 255 / 0.5); }
.timer-side { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.timer-row { display: flex; justify-content: center; gap: 8px; transition: opacity 0.2s ease; }
/* macOS's bordered buttons, on the always-dark panel. */
.timer-button { padding: 3px 10px; border-radius: 6px; background: rgb(255 255 255 / 0.14); font-size: 13px; line-height: 16px; }
/* What can't be used is dimmed, like the app's disabled controls: Start and Reset until a
   time is set; the presets and arrows while the timer runs. Start and Reset become Pause
   and Cancel once it runs. */
.pill[data-timer="empty"] .when-stopped,
.pill[data-timer="running"] .timer-presets,
.pill[data-timer="running"] .timer-unit svg { opacity: 0.4; }
.pill[data-timer="running"] .when-stopped,
.pill:not([data-timer="running"]) .when-running { visibility: hidden; }

/* A press, on the buttons the demo "clicks" (⏭, the Timer tab, 25m, Start, Cancel): it shrinks and dims, then
   springs back when released. A text button lights up instead of dimming. */
[data-press] { transition: scale 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.25s ease, background-color 0.25s ease; }
[data-press].is-pressed { scale: 0.8; opacity: 0.55; transition-duration: 0.12s; }
.timer-button[data-press].is-pressed { scale: 0.9; opacity: 1; background: rgb(255 255 255 / 0.3); }

/* Both songs' covers and texts are always there; the pill's data-song shows one, and they
   crossfade when it changes. */
.stack { display: grid; }
.stack > * { grid-area: 1 / 1; }
.for-a, .for-b, .cover::before, .cover::after { transition: opacity 0.4s ease; }
.pill[data-song="b"] .for-a,
.pill:not([data-song="b"]) .for-b { opacity: 0; }

.cover { position: relative; flex: none; overflow: hidden; }
.cover::before, .cover::after { content: ""; position: absolute; inset: 0; }
/* The songs' real covers, 192 px for sharp 96 px panels on Retina screens. */
.cover::before { background: url("assets/covers/empire-state-of-mind.jpg") center / cover; }
.cover::after { background: url("assets/covers/ultraviolence.jpg") center / cover; opacity: 0; }
.pill[data-song="b"] .cover::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  /* As specific as the active rules above, so it wins over their transitions. */
  .pill, .pill[data-state] .edge, .pill[data-state] .wings, .pill[data-state] .panel { transition: none; }
}

/* Motion (spec: "Motion"). All of it is inside prefers-reduced-motion: no-preference,
   so with Reduce Motion on the page is still and everything is visible. Reveals also
   need html.js, so without JavaScript nothing is hidden. */

/* 2. Cards catch the light: a soft glow follows the pointer (mouse and trackpad only).
   Not movement on its own, so it stays on with Reduce Motion. */
@media (hover: hover) and (pointer: fine) {
  .card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(39px circle at var(--light-x, 50%) var(--light-y, 50%),
      color-mix(in srgb, var(--rose-edge), transparent 65%), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
  }
  .card:hover::before { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* 1. Elements fade up as they scroll into view, one after another; cards warm with a
     brief ember glow as they settle. */
  .js [data-reveal] {
    opacity: 0;
    translate: 0 24px;
    transition: opacity 0.5s ease-out, translate 0.5s ease-out;
    transition-delay: calc(var(--reveal-order, 0) * 80ms);
  }
  .js [data-reveal].is-visible { opacity: 1; translate: 0 0; }

  .js .card.is-visible {
    animation: ignite 1.4s ease-out both;
    animation-delay: calc(var(--reveal-order, 0) * 80ms + 0.15s);
  }
  @keyframes ignite {
    0%   { box-shadow: 0 0 0 0 transparent; }
    35%  { box-shadow: 0 12px 40px -8px color-mix(in srgb, var(--rose-glow), transparent 45%); }
    100% { box-shadow: 0 0 0 0 transparent; }
  }

  /* 3. The hero glow breathes. */
  .hero-glow { animation: breathe 6s ease-in-out infinite; }
  @keyframes breathe {
    0%, 100% { opacity: 0.8; scale: 1; }
    50%      { opacity: 1;   scale: 1.05; }
  }

  /* 4. Sparks drift up from the notch and fade. Each has its own place, speed and drift. */
  .sparks { display: block; position: absolute; top: 0; left: 50%; z-index: 1; }
  .sparks span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--rose-edge);
    box-shadow: 0 0 6px 1px var(--rose-glow);
    opacity: 0;
    animation: rise var(--time) ease-out var(--delay) infinite;
  }
  .sparks span:nth-child(1) { left: -70px; --time: 3.6s; --delay: 0s;   --drift: -10px; }
  .sparks span:nth-child(2) { left: -30px; --time: 4.2s; --delay: 1.1s; --drift: 8px; }
  .sparks span:nth-child(3) { left: 10px;  --time: 3.2s; --delay: 2.3s; --drift: -6px; }
  .sparks span:nth-child(4) { left: 40px;  --time: 4.8s; --delay: 0.6s; --drift: 12px; }
  .sparks span:nth-child(5) { left: 75px;  --time: 3.9s; --delay: 1.8s; --drift: -14px; }
  .sparks span:nth-child(6) { left: -5px;  --time: 4.4s; --delay: 3s;   --drift: 4px; }
  @keyframes rise {
    0%   { opacity: 0; translate: 0 0; }
    15%  { opacity: 1; }
    100% { opacity: 0; translate: var(--drift) -70px; }
  }

  /* 5. A warm sheen sweeps across "spark" every 6 seconds. */
  @supports (background-clip: text) or (-webkit-background-clip: text) {
    .sheen {
      background: linear-gradient(100deg, var(--heading-accent) 40%, var(--rose-glow) 50%, var(--heading-accent) 60%)
        100% 0 / 250% 100%;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      animation:
        sheen 3s ease-in-out infinite,
        spark-breathe 6s ease-in-out infinite;
    }
    @keyframes sheen {
      0%        { background-position: 100% 0; }
      25%, 100% { background-position: 0 0; }
    }
  }

  /* "spark" keeps a soft glow around its letters that breathes. (A filter glow, because a
     text-shadow would cover the sheen's text fill.) */
  @keyframes spark-breathe {
    0%, 100% { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--rose-edge), transparent 65%)); }
    50%      { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--rose-edge), transparent 40%)); }
  }

  /* Every 3 seconds three tiny sparks pop off the top of the "k" and fade (each flies for
     about 1.1 s). */
  .word-sparks { display: block; position: absolute; top: 0.12em; right: 0.04em; }
  .word-sparks i {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--rose-edge);
    box-shadow: 0 0 6px 1px var(--rose-glow);
    opacity: 0;
    animation: word-spark 3s ease-out infinite;
  }
  .word-sparks i:nth-child(1) { --dx: 10px;  --dy: -26px; animation-delay: 0.6s; }
  .word-sparks i:nth-child(2) { --dx: 22px;  --dy: -14px; animation-delay: 0.85s; }
  .word-sparks i:nth-child(3) { --dx: -4px;  --dy: -32px; animation-delay: 1.2s; }
  @keyframes word-spark {
    0%   { opacity: 0; translate: 0 0; scale: 1; }
    5%   { opacity: 1; }
    37%  { opacity: 0; translate: var(--dx) var(--dy); scale: 0.4; }
    100% { opacity: 0; translate: var(--dx) var(--dy); }
  }

  /* 8. Light the fuse, on a loop of 6 s once Get started appears: a spark starts at step 1
     and stops there, runs to step 2 (which lights) and stops, runs to step 3, which flares
     bright rose (0-3.6 s); everything stays lit (to 5.4 s), then fades back to unlit and the
     spark starts again. Each stop swells the spark slightly. */
  .fuse-spark {
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--download-text);
    box-shadow: 0 0 6px 2px var(--rose-edge), 0 0 16px 4px color-mix(in srgb, var(--rose-glow), transparent 40%);
    opacity: 0;
  }
  .js .cta.is-visible .fuse-spark { animation: fuse-spark 6s ease-in-out 0.6s infinite both; }
  .js .cta.is-visible .fuse-burnt { animation: fuse-burn 6s ease-in-out 0.6s infinite both; }
  .js .cta.is-visible .step:nth-child(1) .step-node { animation: node-1 6s linear 0.6s infinite both; }
  .js .cta.is-visible .step:nth-child(2) .step-node { animation: node-2 6s linear 0.6s infinite both; }
  .js .cta.is-visible .step:nth-child(3) .step-node { animation: node-3 6s linear 0.6s infinite both; }
  .js .cta.is-visible .step:nth-child(3) h3 { animation: node-3-title 6s linear 0.6s infinite both; }

  @keyframes fuse-spark {
    0%        { left: 0;    opacity: 1; scale: 1.5; }
    9%        { left: 0;    scale: 1; }
    27%       { left: 50%;  scale: 1.5; }
    36%       { left: 50%;  scale: 1; }
    54%       { left: 100%; opacity: 1; scale: 1.6; }
    60%, 100% { left: 100%; opacity: 0; scale: 1; }
  }
  @keyframes fuse-burn {
    0%, 9%    { width: 0;    opacity: 1; }
    27%, 36%  { width: 50%; }
    54%, 90%  { width: 100%; opacity: 1; }
    98%       { width: 100%; opacity: 0; }
    100%      { width: 0;    opacity: 0; }
  }
  /* Unlit: an empty ring. Lit: filled clay rose (the base style). */
  @keyframes node-1 {
    0%, 98%, 100% { border-color: var(--line); background: var(--surface); color: var(--text-secondary); }
    2%, 90%       { border-color: var(--clay-rose); background: var(--clay-rose); color: var(--download-text); }
  }
  @keyframes node-2 {
    0%, 26%, 98%, 100% { border-color: var(--line); background: var(--surface); color: var(--text-secondary); }
    28%, 90%           { border-color: var(--clay-rose); background: var(--clay-rose); color: var(--download-text); }
  }
  @keyframes node-3 {
    0%, 53%, 98%, 100% {
      border-color: var(--line); background: var(--surface); color: var(--text-secondary);
      /* Transparent rose, not "transparent", so the flare doesn't fade in through grey. */
      box-shadow: 0 0 0 0 color-mix(in srgb, var(--rose-edge), transparent 100%), 0 0 0 0 color-mix(in srgb, var(--rose-glow), transparent 100%);
    }
    56% {
      border-color: var(--rose-edge); background: var(--clay-rose); color: var(--download-text);
      box-shadow:
        0 0 22px 6px color-mix(in srgb, var(--rose-edge), transparent 10%),
        0 0 44px 10px color-mix(in srgb, var(--rose-glow), transparent 45%);
    }
    62%, 90% {
      border-color: var(--rose-edge); background: var(--clay-rose); color: var(--download-text);
      box-shadow:
        0 0 14px 3px color-mix(in srgb, var(--rose-edge), transparent 30%),
        0 0 30px 6px color-mix(in srgb, var(--rose-glow), transparent 65%);
    }
  }
  @keyframes node-3-title {
    0%, 53%, 98%, 100% { color: var(--text); }
    56%, 90%           { color: var(--clay-rose-text); }
  }

  /* 9. The nav's Download blinks softly every 4 s: it brightens and flares with a rose glow,
     then settles, on top of its resting glow. It only ever gets brighter, never darker. The same blink "spark" once had when the
     page opened, at about half its strength (a fifth was too faint to notice). (Starts from transparent rose, not
     "transparent", which would fade through grey.) */
  .button-ember { animation: download-blink 4s ease-in-out 1s infinite; }
  .button-ember:hover, .button-ember:active { animation: none; }   /* hover holds the lit state */
  @keyframes download-blink {
    0%, 40%, 100% { filter: brightness(1) saturate(1) drop-shadow(0 0 0 color-mix(in srgb, var(--rose-glow), transparent 100%)); }
    22%           { filter: brightness(1.12) saturate(1.1) drop-shadow(0 0 14px color-mix(in srgb, var(--rose-glow), transparent 35%)); }
  }

  /* 10. The demo's equalizer: each bar rises and falls at its own speed, like the app's
     (height 4 + 8 × |sin|, at 2.2, 2.9, 3.6 and 4.3 rad/s: half-periods of 1.43, 1.08,
     0.87 and 0.73 s). */
  .wing-eq i { animation: eq-bar 1.43s ease-in-out infinite alternate; }
  .wing-eq i:nth-child(2) { animation-duration: 1.08s; animation-delay: -0.3s; }
  .wing-eq i:nth-child(3) { animation-duration: 0.87s; animation-delay: -0.5s; }
  .wing-eq i:nth-child(4) { animation-duration: 0.73s; animation-delay: -0.2s; }
  @keyframes eq-bar {
    from { height: 4px; }
    to   { height: 12px; }
  }

  /* 6. The "Coming soon" badge pulses softly with an Ember rose glow, which shows on cream
     (a pale glow and a cream ring around the badge read as white-on-white). Starts from
     transparent rose, not "transparent", which would fade through grey. */
  .badge { animation: badge-pulse 2.4s ease-in-out infinite; }
  @keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rose-glow), transparent 100%); }
    50%      { box-shadow: 0 0 12px 2px color-mix(in srgb, var(--rose-glow), transparent 40%); }
  }

  /* "Light up your notch." on fire (spec: Motion item 10), once Get started appears, like
     the fuse: the glow breathes, embers keep rising from all of the heading, swaying,
     fading and fanning out, and where each one lifts off the letters under it flash
     brighter for a moment. */
  .embers, .hot-spots { display: block; position: absolute; inset: 0; pointer-events: none; }
  .embers i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ember-core);
    box-shadow: 0 0 6px 2px color-mix(in srgb, var(--rose-glow), transparent 15%);
    opacity: 0;
  }
  /* A hot spot is a copy of the heading's text (motion.js), laid over it and filled only
     with a small pale light where its ember starts, so just those letters brighten. No
     glow of its own: a text-shadow would show around the invisible copy. */
  .hot-spots > span {
    position: absolute;
    inset: 0;
    color: transparent;
    text-shadow: none;
    background: radial-gradient(circle 0.8em at var(--x) calc(var(--y) + 0.25em), var(--ember-hot), transparent);
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0;
  }
  .js .cta.is-visible .fire { animation: fire-warm 5s ease-in-out infinite; }
  .js .cta.is-visible .embers i { animation: ember-rise var(--t) ease-out var(--d) infinite; }
  .js .cta.is-visible .hot-spots > span { animation: hot-spot var(--t) ease-out var(--d) infinite; }

  /* Each ember and its hot spot: where it starts (--x, --y), how long it rises, when it
     starts, which way it sways and how far it leans out to its side. Four in each third of
     the heading, all starting near the top of the letters (on one line, 0.1-0.4em from its
     top), so the centre shows as many as the sides. The middle four are placed from the
     bottom line and the others from the top line: when the heading wraps on a small phone,
     embers rise from both lines, the middle ones from "notch." (h2 lines are 1.15em tall;
     a bottom-placed ember's 4 px are about 0.1em). */
  :is(.embers, .hot-spots) > :nth-child(1) { --x: 4%; --y: 0.3em; --t: 3.4s; --d: 0s; --sway: 3px; --lean: -34px; }
  :is(.embers, .hot-spots) > :nth-child(2) { --x: 12%; --y: 0.1em; --t: 4.2s; --d: 1.1s; --sway: -4px; --lean: -28px; }
  :is(.embers, .hot-spots) > :nth-child(3) { --x: 20%; --y: 0.35em; --t: 3.8s; --d: 2.3s; --sway: 3px; --lean: -22px; }
  :is(.embers, .hot-spots) > :nth-child(4) { --x: 28%; --y: 0.2em; --t: 4.5s; --d: 3.1s; --sway: -3px; --lean: -16px; }
  :is(.embers, .hot-spots) > :nth-child(5) { --x: 38%; --y: calc(100% - 0.95em); --t: 4.6s; --d: 0.6s; --sway: -3px; --lean: -9px; }
  :is(.embers, .hot-spots) > :nth-child(6) { --x: 46%; --y: calc(100% - 1.1em); --t: 3.9s; --d: 2s; --sway: 4px; --lean: -3px; }
  :is(.embers, .hot-spots) > :nth-child(7) { --x: 54%; --y: calc(100% - 0.9em); --t: 4.3s; --d: 3.4s; --sway: -2px; --lean: 3px; }
  :is(.embers, .hot-spots) > :nth-child(8) { --x: 62%; --y: calc(100% - 1.05em); --t: 3.6s; --d: 1.4s; --sway: 3px; --lean: 9px; }
  :is(.embers, .hot-spots) > :nth-child(9) { --x: 72%; --y: 0.25em; --t: 4.4s; --d: 2.9s; --sway: -3px; --lean: 16px; }
  :is(.embers, .hot-spots) > :nth-child(10) { --x: 80%; --y: 0.1em; --t: 3.9s; --d: 0.3s; --sway: 4px; --lean: 22px; }
  :is(.embers, .hot-spots) > :nth-child(11) { --x: 88%; --y: 0.35em; --t: 4.1s; --d: 1.7s; --sway: -4px; --lean: 28px; }
  :is(.embers, .hot-spots) > :nth-child(12) { --x: 96%; --y: 0.2em; --t: 3.5s; --d: 2.6s; --sway: 2px; --lean: 34px; }

  @keyframes fire-warm {
    0%, 100% { text-shadow: 0 0 8px color-mix(in srgb, var(--rose-glow), transparent 70%); }
    50%      { text-shadow: 0 0 14px color-mix(in srgb, var(--rose-glow), transparent 50%); }
  }
  /* Each ember rises 62 px, swaying, and leans out towards its own side (--lean): the
     ones at the edges drift out about 34 px, the middle ones go almost straight up, so
     the fire fans out. The sway is small, so it doesn't hide the lean. */
  @keyframes ember-rise {
    0%   { opacity: 0; translate: 0 0; scale: 1; }
    10%  { opacity: 1; }
    50%  { translate: calc(var(--sway) + var(--lean) * 0.4) -30px; }
    100% { opacity: 0; translate: calc(var(--sway) * -0.5 + var(--lean)) -62px; scale: 0.5; }
  }
  /* The letters flash as the ember lifts off, and fade before it is far away. */
  @keyframes hot-spot {
    0%        { opacity: 0; }
    4%        { opacity: 0.9; }
    22%, 100% { opacity: 0; }
  }

  /* 7. FAQ answers open smoothly. Where the browser can't animate to "auto" here (Safari),
     motion.js animates them instead. */
  @supports (interpolate-size: allow-keywords) {
    .faq { interpolate-size: allow-keywords; }
    .faq-item::details-content {
      block-size: 0;
      overflow: hidden;
      transition: block-size 0.35s cubic-bezier(0.3, 1.1, 0.5, 1), content-visibility 0.35s allow-discrete;
    }
    .faq-item[open]::details-content { block-size: auto; }
  }
}
