/*
 * The site's one stylesheet: the home page, the three documents (privacy,
 * terms, support), 404.html, and the clip page the `share` function renders
 * (functions/src/sharePage.ts). The clip page's Content-Security-Policy
 * allows styles from this file and nowhere else (`style-src 'self'`): no
 * inline style, no <style>, so everything it shows is a class here.
 *
 * Dark only, like the app (apps/mobile/src/theme). Every Wave has its own
 * colour, and whatever sits inside a `.wave-*` element wears it: `--accent`
 * is the Wave's bright colour, `--wave-1` to `--wave-3` its dark backdrop.
 */

/* Registered so that a change of Wave on the home page fades the accent
   rather than switching it. A browser without @property switches; nothing
   else about the page depends on it. */
@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #4FD1FF;
}

:root {
  --bg: #07070B;
  --surface: #12121B;
  --label: #FFFFFF;
  /* 8.2:1 and 7.3:1 on --bg, as the app's secondary and tertiary labels.
     The tertiary was 40% (3.7:1), under AA for the 14px notes it carries. */
  --secondary: rgba(255, 255, 255, 0.64);
  --tertiary: rgba(255, 255, 255, 0.60);
  --separator: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.10);
  --scrim: rgba(7, 7, 11, 0.32);
  --gradient: linear-gradient(100deg, #4FD1FF 0%, #6D8BFF 50%, #8B5CF6 100%);

  /* The app's motion tokens (theme/motion.ts): EASE_OUT, and DURATION.moment
     for a Wave's colour sweeping in. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --moment: 420ms;

  /* Outside any Wave: the brand. The cyan, the cyan-to-violet gradient on
     buttons, and For You's backdrop, which is that gradient in the dark. */
  --accent: #4FD1FF;
  --fill: var(--gradient);
  --wave-1: #123A57;
  --wave-2: #1E2A6B;
  --wave-3: #3B1A5C;

  color-scheme: dark;
}

/* The Waves. Copies of WAVE_ACCENTS and WAVE_GRADIENTS in
   apps/mobile/src/theme/gradients.ts: functions/src/__tests__/sharePage.test.ts
   reads both files and fails when they differ. The class is `wave-` and the
   Wave's name in lower case with spaces as hyphens (`waveClassOf` in
   sharePage.ts). Every accent is at least 4.5:1 on --bg, so the ink text on
   a Wave's button stays legible. */
.wave-for-you { --accent: #4FD1FF; --wave-1: #123A57; --wave-2: #1E2A6B; --wave-3: #3B1A5C; }
.wave-chill { --accent: #2DD4BF; --wave-1: #0E3B3E; --wave-2: #12314F; --wave-3: #1B2450; }
.wave-stories { --accent: #F59E0B; --wave-1: #4A2410; --wave-2: #5C1F35; --wave-3: #31163F; }
.wave-mindblow { --accent: #E879F9; --wave-1: #3A1358; --wave-2: #5B1750; --wave-3: #7A1B3D; }
.wave-comedy { --accent: #A3E635; --wave-1: #5A3410; --wave-2: #6B1F3C; --wave-3: #3D1650; }
.wave-newslite { --accent: #60A5FA; --wave-1: #16283D; --wave-2: #1B3350; --wave-3: #243A57; }
.wave-following { --accent: #F9A8D4; --wave-1: #451136; --wave-2: #531839; --wave-3: #49182C; }
.wave-science { --accent: #3B82F6; --wave-1: #0C1C39; --wave-2: #162E5C; --wave-3: #221853; }
.wave-biology { --accent: #22C55E; --wave-1: #0D351C; --wave-2: #144341; --wave-3: #182F49; }
.wave-chemistry { --accent: #F0ABFC; --wave-1: #3E1145; --wave-2: #531846; --wave-3: #49182C; }
.wave-tech { --accent: #E2E8F0; --wave-1: #1A1E26; --wave-2: #20262F; --wave-3: #2A303B; }
.wave-ai { --accent: #A855F7; --wave-1: #1F0C30; --wave-2: #1F1853; --wave-3: #122A49; }
.wave-gaming { --accent: #EC4899; --wave-1: #3E0F1F; --wave-2: #53184B; --wave-3: #341849; }
.wave-internet-stories { --accent: #FF8A5B; --wave-1: #452011; --wave-2: #53182A; --wave-3: #491843; }
.wave-true-crime { --accent: #A8A29E; --wave-1: #241F1D; --wave-2: #2E2423; --wave-3: #3A1F24; }
.wave-history { --accent: #FED7AA; --wave-1: #452D11; --wave-2: #53181B; --wave-3: #491837; }
.wave-books { --accent: #E9D5FF; --wave-1: #2A1145; --wave-2: #3A1853; --wave-3: #1E2049; }
.wave-podcasts { --accent: #A78BFA; --wave-1: #1E1145; --wave-2: #491853; --wave-3: #491834; }
.wave-learn { --accent: #FEF08A; --wave-1: #453F11; --wave-2: #532A18; --wave-3: #491826; }
.wave-languages { --accent: #BBF7D0; --wave-1: #0D3513; --wave-2: #144336; --wave-3: #183949; }
.wave-wellness { --accent: #86EFAC; --wave-1: #0D352A; --wave-2: #143443; --wave-3: #181D49; }
.wave-motivation { --accent: #F97316; --wave-1: #452711; --wave-2: #531822; --wave-3: #49183D; }
.wave-money { --accent: #10B981; --wave-1: #0D352E; --wave-2: #142F43; --wave-3: #181849; }
.wave-food { --accent: #FCA5A5; --wave-1: #45160F; --wave-2: #532A18; --wave-3: #4A1830; }
.wave-travel { --accent: #A5F3FC; --wave-1: #0D3135; --wave-2: #142243; --wave-3: #251849; }
.wave-relationships { --accent: #FB7185; --wave-1: #451119; --wave-2: #531843; --wave-3: #3A1849; }
.wave-music { --accent: #7073F4; --wave-1: #111345; --wave-2: #291853; --wave-3: #341849; }
.wave-culture { --accent: #FECDD3; --wave-1: #451511; --wave-2: #531836; --wave-3: #441849; }
.wave-sports { --accent: #FDBA74; --wave-1: #3F2810; --wave-2: #3A4012; --wave-3: #1B3A1C; }

/* Inside a Wave its buttons take its colour; outside one they keep the brand
   gradient. A gradient cannot fade into a colour, so the home page, whose
   Wave changes, is always inside one. */
.wave-for-you, .wave-chill, .wave-stories, .wave-mindblow, .wave-comedy, .wave-newslite,
.wave-following, .wave-science, .wave-biology, .wave-chemistry, .wave-tech, .wave-ai, .wave-gaming,
.wave-internet-stories, .wave-true-crime, .wave-history, .wave-books, .wave-podcasts, .wave-learn,
.wave-languages, .wave-wellness, .wave-motivation, .wave-money, .wave-food, .wave-travel,
.wave-relationships, .wave-music, .wave-culture, .wave-sports {
  --fill: var(--accent);
}

/* The home page draws For You on black: its phone screen, and the page behind
   it while For You is the Wave showing. Its accent, and For You everywhere
   else (a clip page, the app), keep the colours above. Written with the Wave
   class second, so the copy of the app's colours above stays the rule a
   `.wave-for-you {` lookup finds (sharePage.test.ts). */
.home .screen.wave-for-you,
.home .tint-layer.wave-for-you { --wave-1: #07070B; --wave-2: #07070B; --wave-3: #07070B; }

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  transition: --accent var(--moment) var(--ease-out);
}

body {
  margin: 0;
  background: radial-gradient(120% 70% at 50% 0%, #17172C 0%, #0B0B14 45%, var(--bg) 100%) no-repeat, var(--bg);
  color: var(--label);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The app's icons (index.html's sprite): outlines unless the symbol fills. */
.icon {
  display: block; flex: none; width: 1em; height: 1em;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Side gutters only, so a section that is also a .wrap keeps its own top and bottom. */
.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.wrap-wide { max-width: 1200px; }

header.site {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0;
}
header.site a.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--label); text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -0.02em;
  border-radius: 10px;
}
/* The mark's square at 40 px: the wave is four times as wide as it is tall, so this shows it as tall as the
   old W stood in 30 px. The negative margins keep the header's 30 px line, and the nudge sets it on the word's x-height. */
header.site a.brand img { width: 40px; height: 40px; margin: -5px 0; position: relative; top: 2px; }
header.site nav { display: flex; }
header.site nav a {
  color: var(--secondary); text-decoration: none; font-size: 15px;
  padding: 10px 9px; border-radius: 10px;
}
header.site nav a:hover { color: var(--label); }

footer.site {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px;
  border-top: 1px solid var(--separator); padding: 20px 0 36px;
  color: var(--tertiary); font-size: 14px;
}
footer.site p { margin: 0; }
footer.site nav { display: flex; flex-wrap: wrap; margin: 0 -8px; }
footer.site nav a { color: var(--tertiary); text-decoration: none; padding: 10px 8px; border-radius: 8px; }
footer.site nav a:hover { color: var(--label); }

/* ------------------------------------------------------------- buttons */

.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 28px; border-radius: 999px;
  background: var(--fill); color: #07070B;
  font-weight: 700; font-size: 17px; line-height: 1.4; text-decoration: none;
  transition: transform 120ms var(--ease-out);
}
.cta:active { transform: scale(0.97); }
.cta:focus-visible { outline-color: var(--label); }
.cta-secondary {
  background: var(--scrim); color: var(--label);
  border: 1px solid var(--border); padding: 13px 27px;
}
.cta-note { color: var(--tertiary); font-size: 14px; margin: 12px 0 0; }

/* ---------------------------------------------------- the Wave backdrop */

/* A Wave's three dark colours, lit from the top corners and run down into
   ink, so text lower on the page sits on near-black. The home page stacks
   two of these and fades the upper one as the phone moves between Waves;
   the clip page and the 404s have one, behind everything. */
.tint-layer, .page-tint::before {
  background:
    linear-gradient(180deg, rgba(7, 7, 11, 0) 0%, rgba(7, 7, 11, 0.45) 55%, #07070B 100%),
    radial-gradient(110% 65% at 0% 0%, var(--wave-1) 0%, rgba(7, 7, 11, 0) 70%),
    radial-gradient(90% 60% at 100% 0%, var(--wave-3) 0%, rgba(7, 7, 11, 0) 70%),
    linear-gradient(180deg, var(--wave-2) 0%, #07070B 90%);
}

.home, .page-tint { background: none; }

.tint, .page-tint::before {
  position: fixed; top: 0; left: 0; right: 0; height: 100vh;
  z-index: -1; pointer-events: none;
}
.page-tint::before { content: ''; }
.tint-layer { position: absolute; inset: 0; }
.tint-layer + .tint-layer { opacity: 0; }
/* The one layer that fades on every frame of a drag gets its own. */
.js .tint-layer + .tint-layer { will-change: opacity; }

/* ----------------------------------------------------------- home: hero */

/* `clip`, not `hidden`: a hidden overflow is still a scroll box, and focusing
   a Wave button would scroll the hero sideways to the name behind the phone.
   `hidden` stays for browsers without `clip` (site.js holds that box still). */
.hero { position: relative; overflow: hidden; overflow: clip; padding: 12px 0 calc(var(--band) + 24px); --band: 96px; }

.hero-grid { display: grid; gap: 40px; align-items: center; }

.hero-copy h1 {
  margin: 20px 0 18px;
  font-size: clamp(48px, 13vw, 108px); line-height: 0.92; letter-spacing: -0.05em; font-weight: 800;
  text-wrap: balance;
}
.hero-copy .lede { margin: 0 0 30px; max-width: 30em; color: var(--secondary); font-size: 19px; line-height: 1.55; }

/* The stage: the phone, the Wave's name set huge behind it, and the controls.
   --pw is the phone's width; on a wide screen it follows the window's height,
   so the phone and its controls fit above the fold. */
.stage {
  --pw: clamp(232px, 66vw, 296px);
  position: relative; display: grid; justify-items: center; gap: 22px; padding: 12px 0 4px;
}

.stage-words {
  /* As tall as the phone, so the word centres on it and a mask has a box to clip. */
  position: absolute; left: -60%; right: -60%; top: 12px; height: calc(var(--pw) * 19.5 / 9);
  display: grid; place-items: center;
  opacity: 0.2; pointer-events: none; z-index: -1;
}
.stage-word {
  grid-area: 1 / 1;
  color: var(--accent); white-space: nowrap;
  font-size: clamp(96px, 30vw, 240px); font-weight: 900; letter-spacing: -0.065em; line-height: 0.8;
}
.stage-word ~ .stage-word { opacity: 0; }

/* The phone. Everything inside is sized in em from its width, so it scales
   as one drawing. */
.phone {
  position: relative; width: var(--pw); aspect-ratio: 9 / 19.5;
  padding: calc(var(--pw) * 0.03);
  border-radius: calc(var(--pw) * 0.165);
  background: linear-gradient(150deg, #34343F 0%, #101016 30%, #0A0A0F 70%, #24242E 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 50px 90px -30px rgba(0, 0, 0, 0.85),
    0 0 140px -40px var(--accent);
  font-size: calc(var(--pw) / 25);
  line-height: 1.3;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.js .phone { cursor: grab; }
.js.is-dragging .phone { cursor: grabbing; }

.phone-screen {
  position: relative; height: 100%; overflow: hidden;
  border-radius: calc(var(--pw) * 0.135);
  background: var(--bg);
  /* Safari lets transformed children escape a rounded overflow clip unless
     the clipping box is its own layer. */
  isolation: isolate; transform: translateZ(0);
}

.phone-island {
  position: absolute; z-index: 3; top: 0.85em; left: 50%;
  width: 7.6em; height: 2.1em; margin-left: -3.8em;
  border-radius: 1.05em; background: #000;
}

.phone-pills { position: absolute; z-index: 2; top: 4em; left: 0; right: 0; overflow: hidden; }
.phone-pills-track {
  display: inline-flex; gap: 0.5em; width: max-content; padding: 0 1.2em;
  transition: transform 220ms var(--ease-out);
}
.pill {
  padding: 0.5em 1em; border-radius: 999px;
  background: rgba(0, 0, 0, 0.28); color: var(--secondary);
  font-size: 0.95em; font-weight: 600; white-space: nowrap;
  transition: background-color 150ms, color 150ms;
}
.pill.is-active { background: #FFFFFF; color: #040407; font-weight: 700; }

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 7.2em 1.3em 2.2em;
  background: linear-gradient(165deg, var(--wave-1) 0%, var(--wave-2) 55%, var(--wave-3) 100%);
  color: var(--label);
}
.screen ~ .screen { visibility: hidden; }

.screen-hero { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6em; }

.screen-hint {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 0.3em; white-space: nowrap;
  padding: 0.4em 0.9em; border-radius: 999px; background: rgba(0, 0, 0, 0.28);
  color: var(--secondary); font-size: 0.85em;
}
.screen-hint .icon { width: 1.1em; height: 1.1em; }
.screen-hint .icon + span { margin-right: 0.5em; }

.ring { position: relative; width: 9.4em; height: 9.4em; display: grid; place-items: center; }
.ring-arc { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 3.2; }
.ring-arc circle { stroke: rgba(255, 255, 255, 0.16); }
.ring-arc .ring-progress {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: 289; stroke-dashoffset: 190;
}
.ring-play { position: relative; display: block; width: 3.4em; height: 3.4em; margin-left: 0.3em; color: var(--label); }

.bars { display: flex; align-items: center; gap: 0.26em; height: 2.6em; }
.bars i { display: block; width: 0.26em; height: 30%; border-radius: 0.13em; background: rgba(255, 255, 255, 0.85); transform-origin: center; }

/* Bar heights without inline styles: overlapping nth-child steps read as a
   voice's uneven levels. The clip page and the drawings reuse them. */
.bars i:nth-child(2n) { height: 55%; }
.bars i:nth-child(3n) { height: 82%; }
.bars i:nth-child(5n) { height: 42%; }
.bars i:nth-child(7n) { height: 100%; }
.bars i:nth-child(4n+1) { height: 64%; }
.bars i:nth-child(11n) { height: 24%; }
.bars i:nth-child(13n+2) { height: 90%; }

.screen-info { display: grid; gap: 0.55em; padding-right: 3.6em; }
.screen-creator { display: inline-flex; align-items: center; gap: 0.55em; font-weight: 600; font-size: 1.05em; }
.avatar {
  display: inline-grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: 50%;
  font-size: 0.85em; font-weight: 700; color: #FFFFFF;
}
/* Copies of PERSON_GRADIENTS (theme/gradients.ts), one per drawn person:
   sharePage.test.ts fails when one is not the app's. Each stop keeps the
   white initial at 4.5:1, as in the app. */
.person-1 { background: linear-gradient(135deg, #0370B0, #4C63D9, #7C3AED); }
.person-2 { background: linear-gradient(135deg, #15803D, #0F7A66, #0E7490); }
.person-3 { background: linear-gradient(135deg, #C2410C, #D0304F, #DB2777); }
.person-4 { background: linear-gradient(135deg, #9333EA, #B935B4, #DB2777); }
.person-5 { background: linear-gradient(135deg, #B45309, #C2416F, #C026D3); }
.person-6 { background: linear-gradient(135deg, #2563EB, #0F72B8, #0E7490); }

.screen-title { font-size: 1.55em; font-weight: 700; line-height: 1.18; letter-spacing: -0.01em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.screen-tags { display: flex; gap: 0.4em; }
.screen-tags span { padding: 0.2em 0.6em; border-radius: 0.5em; background: var(--glass); color: var(--secondary); font-size: 0.85em; }

.screen-rail {
  position: absolute; right: 0.9em; bottom: 2.2em;
  display: grid; gap: 1.3em; justify-items: center;
}
.screen-rail .icon { width: 2.1em; height: 2.1em; color: var(--label); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35)); }

.home-bar {
  position: absolute; bottom: 0.6em; left: 50%; width: 9em; height: 0.36em; margin-left: -4.5em;
  border-radius: 1em; background: rgba(255, 255, 255, 0.7);
}

/* Under the phone: the controls once the script runs, the Waves in words
   until then. Both sit in one cell, so the swap moves nothing. */
.stage-foot { display: grid; justify-items: center; text-align: center; }
.stage-foot > * { grid-area: 1 / 1; }
.stage-ui { display: grid; justify-items: center; gap: 10px; visibility: hidden; }
.js .stage-ui { visibility: visible; }
.js .stage-legend { visibility: hidden; }

.stage-controls { display: flex; align-items: center; gap: 14px; }
.stage-arrow {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border-radius: 50%; border: 1px solid var(--border); background: var(--scrim);
  color: var(--label); cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 150ms;
}
.stage-arrow:hover { background: rgba(255, 255, 255, 0.08); }
.stage-arrow:active { transform: scale(0.95); }
.stage-arrow .icon { width: 22px; height: 22px; }

.stage-name {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 8.5em; margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
}
.stage-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.stage-hint { margin: 0; color: var(--tertiary); font-size: 14px; }

.stage-legend { max-width: 24em; margin: 0; color: var(--secondary); font-size: 15px; }
.legend-name { color: var(--accent); font-weight: 700; }

/* The waveform along the bottom of the hero (site.js draws it). */
.wave-band { position: absolute; left: 0; right: 0; bottom: 8px; height: var(--band); touch-action: pan-y; }
.wave-band canvas { display: block; width: 100%; height: 100%; }

/* -------------------------------------------------------- home: features */

.features { padding-top: 72px; padding-bottom: 24px; }
.features h2, .join h2 {
  margin: 0 0 40px; max-width: 13em;
  font-size: clamp(32px, 6vw, 52px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800;
  text-wrap: balance;
}

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 36px 56px; }
.feature { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 20px; align-items: start; }
.feature h3 {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  margin: 6px 0 6px; font-size: 20px; line-height: 1.25; letter-spacing: -0.01em;
}
.feature p { margin: 0; color: var(--secondary); font-size: 16px; line-height: 1.55; }

/* The drawings. Each tells its feature in a few seconds and rests; they run
   only while on screen (site.js), and stand still under Reduce Motion. */
.sketch {
  position: relative; width: 104px; height: 104px; overflow: hidden;
  border-radius: 26px; border: 1px solid var(--separator);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
}
.sketch .icon { color: var(--label); }

/* Hands-free: headphones pressed twice, and the feed moves on one clip. */
.sketch .sk-phones { position: absolute; left: 8px; top: 32px; width: 40px; height: 40px; }
.sk-press {
  position: absolute; left: 28px; top: 49px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0;
}
.sk-feed {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 76px; overflow: hidden; border-radius: 9px;
}
.sk-feed-track { display: grid; gap: 4px; }
.sk-feed i { display: block; height: 76px; border-radius: 9px; background: linear-gradient(165deg, var(--wave-1), var(--wave-3)); border: 1px solid rgba(255, 255, 255, 0.14); }
.sk-feed i::after { content: ''; display: block; width: 14px; height: 14px; margin: 30px auto 0; border-radius: 50%; border: 2px solid var(--accent); }

/* Waves: the row of Waves, and the drawing wears each one in turn. */
.sk-waves i { position: absolute; inset: 0; opacity: 0; background: linear-gradient(165deg, var(--wave-1), var(--wave-2) 55%, var(--wave-3)); }
.sk-waves i:first-child { opacity: 1; }
.sk-dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 6px; }
.sk-dots b { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); opacity: 0.45; }
.sk-dots b:first-child { opacity: 1; }
.sk-waves .icon { position: absolute; left: 50%; top: 26px; width: 34px; height: 34px; margin-left: -17px; }

/* Voice replies: the clip slides left and its replies are behind it. */
.sk-reply { position: absolute; left: 12px; right: 12px; height: 26px; display: flex; align-items: center; gap: 5px; padding: 0 7px; border-radius: 13px; background: var(--glass); }
.sk-reply:nth-of-type(1) { top: 26px; }
.sk-reply:nth-of-type(2) { top: 58px; }
.sk-reply .icon { width: 13px; height: 13px; flex: none; }
.sk-reply .bars { height: 14px; gap: 2px; }
.sk-reply .bars i { width: 2px; background: var(--accent); }
.sk-card {
  position: absolute; inset: 10px; border-radius: 16px;
  background: linear-gradient(165deg, var(--wave-1), var(--wave-2) 55%, var(--wave-3));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 8px 0 20px -6px rgba(0, 0, 0, 0.6);
}
.sk-card::before { content: ''; position: absolute; left: 50%; top: 26px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; border: 3px solid var(--accent); }
.sk-card::after { content: ''; position: absolute; left: 12px; right: 22px; bottom: 14px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.5); }

/* Record: the record button, its levels, and the ring filling. */
.sk-record { display: grid; place-items: center; }
.sk-record .ring-arc { inset: 18px; width: auto; height: auto; stroke-width: 6; }
.sk-record .ring-arc .ring-progress { stroke-dasharray: 289; stroke-dashoffset: 120; }
.sk-mic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gradient); }
.sk-mic .icon { width: 22px; height: 22px; color: #07070B; }

/* Friends and an Inbox: two people's clips, and the streak between them. */
.sk-chat { position: absolute; height: 22px; display: flex; align-items: center; padding: 0 8px; border-radius: 11px; }
.sk-chat .bars { height: 12px; gap: 2px; }
.sk-chat .bars i { width: 2px; }
.sk-chat.theirs { left: 10px; top: 18px; width: 58px; background: var(--glass); }
.sk-chat.theirs .bars i { background: var(--label); }
.sk-chat.mine { right: 10px; top: 46px; width: 58px; background: var(--accent); }
.sk-chat.mine .bars i { background: #07070B; }
.sk-streak { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 800; }
.sk-streak .icon { width: 18px; height: 18px; color: #FF9F45; }

/* ------------------------------------------------------------ home: join */

.join { padding-top: 72px; padding-bottom: 88px; text-align: center; }
.join h2 { margin: 0 auto 28px; }

/* ----------------------------------------------------------- documents */

article.doc { padding: 24px 0 64px; }
article.doc h1 { font-size: 34px; letter-spacing: -0.02em; margin: 24px 0 4px; }
article.doc .updated { color: var(--tertiary); font-size: 14px; margin: 0 0 28px; }
article.doc h2 { font-size: 21px; margin: 36px 0 8px; letter-spacing: -0.01em; }
article.doc p, article.doc li { color: var(--secondary); }
article.doc strong { color: var(--label); }
article.doc ul { padding-left: 22px; }
article.doc li { margin: 6px 0; }
article.doc .callout {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin: 20px 0;
}
article.doc .callout p { margin: 0; }

/* ----------------------------------------------- clip page and the 404s */

/* The card is drawn as the feed card is in the app: the clip's Wave behind
   it (the brand when the clip is in none), the waveform in its colour. */
.share { padding: 28px 0 64px; }
.share-card {
  position: relative; overflow: hidden;
  padding: 26px 22px 24px; border-radius: 28px;
  background: linear-gradient(165deg, var(--wave-1) 0%, var(--wave-2) 55%, var(--wave-3) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}
.share-wave {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  color: var(--accent); font-size: 15px; font-weight: 700;
}
.share-wave::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.share-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin: 0 0 10px; color: var(--secondary); font-size: 15px;
}
.share-handle { color: var(--label); font-weight: 600; overflow-wrap: anywhere; }
.share-avatar {
  width: 28px; height: 28px; flex: none; margin-right: -6px; border-radius: 50%;
  object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.16); background: var(--surface);
}
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--accent);
  background: rgba(7, 7, 11, 0.25); color: var(--label); font-size: 13px; font-weight: 700; line-height: 1.5;
}
.share-card h1 {
  font-size: clamp(28px, 7vw, 40px); line-height: 1.12; letter-spacing: -0.025em;
  margin: 0 0 22px; overflow-wrap: anywhere; text-wrap: balance;
}
.share-card .bars {
  height: 56px; gap: 4px; margin: 0 0 22px; overflow: hidden;
  /* It runs on past the card's edge rather than stopping on half a bar. */
  -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent);
  mask-image: linear-gradient(90deg, #000 80%, transparent);
}
.share-card .bars i { flex: none; width: 4px; border-radius: 2px; background: var(--accent); }
.share-card .bars.is-flat { height: 12px; }
.share-card .bars.is-flat i { height: 4px; opacity: 0.5; }
.share-card audio { display: block; width: 100%; margin: 0 0 22px; color-scheme: dark; }
.share-note { color: var(--secondary); margin: 0 0 22px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* The words an AI voice read (a Write clip, a Wavy Radio episode), under the
   card's actions: listening stays the first thing the page offers. */
.share-transcript { margin: 26px 0 0; padding: 20px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.share-transcript h2 {
  margin: 0 0 10px; color: var(--secondary); font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.share-transcript p { margin: 0 0 12px; color: var(--label); font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.share-transcript p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  /* On a phone, and anywhere the hero is stacked, it is there at once: the
     words and the phone come in together in one short fade, with nothing
     held back. A page opened from a link on a phone is read straight away,
     and words still rising after half a second read as a slow page. */
  .hero-copy > *, .stage { animation: fade 160ms var(--ease-out) both; }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 960px) {
  /* The one entrance, where the words and the phone stand side by side:
     the words, then the phone arriving from slightly small, never from
     nothing. */
  .hero-copy > * { animation: rise 640ms var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: 50ms; }
  .hero-copy > :nth-child(3) { animation-delay: 100ms; }
  .hero-copy > :nth-child(4) { animation-delay: 140ms; }
  .stage { animation: arrive 760ms var(--ease-out) 120ms both; }
}

@media (prefers-reduced-motion: no-preference) {
  /* The playing card: its ring fills and its levels move. */
  .screen.is-current .ring-progress { animation: progress 40s linear both; }
  .screen.is-current .bars i { animation: level 1.1s ease-in-out infinite alternate; }
  .screen.is-current .bars i:nth-child(2n) { animation-duration: 0.8s; }
  .screen.is-current .bars i:nth-child(3n) { animation-duration: 1.4s; animation-delay: -0.3s; }
  .screen.is-current .bars i:nth-child(5n+1) { animation-duration: 0.95s; animation-delay: -0.6s; }

  .sk-press { animation: press 4s var(--ease-out) infinite; }
  .sk-press + .sk-press { animation-delay: 0.28s; }
  .sk-feed-track { animation: next-clip 4s var(--ease-out) infinite; }

  .sk-waves i { animation: wear 9s infinite; }
  .sk-waves i:nth-child(2) { animation-delay: 1.5s; }
  .sk-waves i:nth-child(3) { animation-delay: 3s; }
  .sk-waves i:nth-child(4) { animation-delay: 4.5s; }
  .sk-waves i:nth-child(5) { animation-delay: 6s; }
  .sk-waves i:nth-child(6) { animation-delay: 7.5s; }
  .sk-waves i:first-child { opacity: 0; }
  .sk-dots b { animation: dot 9s infinite; }
  .sk-dots b:nth-child(2) { animation-delay: 1.5s; }
  .sk-dots b:nth-child(3) { animation-delay: 3s; }
  .sk-dots b:nth-child(4) { animation-delay: 4.5s; }
  .sk-dots b:nth-child(5) { animation-delay: 6s; }
  .sk-dots b:nth-child(6) { animation-delay: 7.5s; }
  .sk-dots b:first-child { opacity: 0.45; }

  .sk-card { animation: swipe-left 5s var(--ease-out) infinite; }
  .sk-reply .bars i { animation: level 0.9s ease-in-out infinite alternate; }
  .sk-reply .bars i:nth-child(2n) { animation-duration: 0.7s; }

  .sk-record .ring-progress { animation: record 5s linear infinite; }
  .sk-mic { animation: breathe 2.5s ease-in-out infinite alternate; }

  .sk-chat { animation: arrive-chat 5s var(--ease-out) infinite both; }
  .sk-chat.mine { animation-delay: 0.6s; }
  .sk-streak .icon { animation: flicker 1.6s ease-in-out infinite alternate; transform-origin: 50% 90%; }

  /* Paused off screen, and until site.js has looked. */
  .js [data-live]:not(.is-live) *,
  .js [data-live]:not(.is-live) *::before,
  .js [data-live]:not(.is-live) *::after { animation-play-state: paused !important; }

  /* The clip page runs no script, so its waveform moves only where the
     browser can say the clip is playing (Safari's :playing). */
  @supports selector(:has(audio:playing)) {
    .share-card .bars i { animation: level 1s ease-in-out infinite alternate paused; }
    .share-card .bars i:nth-child(2n) { animation-duration: 0.75s; }
    .share-card .bars i:nth-child(3n) { animation-duration: 1.3s; animation-delay: -0.4s; }
    .share-card:has(audio:playing) .bars i { animation-play-state: running; }
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Still pictures: each drawing stops at the moment that explains it. */
  html { transition-duration: 180ms; }
  /* The hero is simply there: no entrance at all. */
  .hero-copy > *, .stage { animation: none; }
  .phone-pills-track { transition: none; }
  .sk-press { opacity: 0.6; }
  .sk-press + .sk-press { opacity: 0; }
  .sk-card { transform: translateX(-62%); }
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes arrive { from { opacity: 0; transform: translateY(18px) scale(0.95); } }
@keyframes fade { from { opacity: 0; } }
@keyframes progress { from { stroke-dashoffset: 250; } to { stroke-dashoffset: 30; } }
@keyframes level { to { transform: scaleY(0.4); } }
@keyframes press {
  0%, 6% { opacity: 0; transform: scale(0.95); }
  9% { opacity: 1; }
  20%, 100% { opacity: 0; transform: scale(1.7); }
}
@keyframes next-clip {
  0%, 26% { transform: translateY(0); opacity: 1; }
  40%, 80% { transform: translateY(-80px); opacity: 1; }
  88% { transform: translateY(-80px); opacity: 0; }
  89% { transform: translateY(0); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes wear {
  0% { opacity: 0; }
  4%, 17% { opacity: 1; }
  21%, 100% { opacity: 0; }
}
@keyframes dot {
  0% { opacity: 0.45; }
  4%, 17% { opacity: 1; }
  21%, 100% { opacity: 0.45; }
}
@keyframes swipe-left {
  0%, 22% { transform: translateX(0); }
  36%, 78% { transform: translateX(-62%); }
  92%, 100% { transform: translateX(0); }
}
@keyframes record { from { stroke-dashoffset: 289; } to { stroke-dashoffset: 0; } }
@keyframes breathe { to { transform: scale(1.06); } }
@keyframes arrive-chat {
  0%, 8% { opacity: 0; transform: translateY(6px); }
  18%, 86% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; }
}
@keyframes flicker { to { transform: scale(1.12) rotate(-4deg); } }

/* ------------------------------------------------------------- layout */

@media (min-width: 700px) {
  .feature-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (min-width: 960px) {
  .wrap-wide { padding-left: 32px; padding-right: 32px; }
  .hero { --band: 104px; padding-top: 20px; padding-bottom: var(--band); }
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; }
  .hero-copy h1 { margin-top: 0; }
  .stage { --pw: clamp(220px, calc((100vh - 340px) * 0.4615), 300px); }
  /* Beside the words, the name behind the phone fades out before it
     reaches them. */
  .stage-words {
    left: -45%; right: -45%;
    -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 30%, #000 80%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 4%, #000 30%, #000 80%, transparent 100%);
  }
  .stage-word { font-size: clamp(150px, 16vw, 240px); }
  .features { padding-top: 96px; }
}

@media (max-width: 480px) {
  header.site nav a { padding: 10px 6px; font-size: 14px; }
  .hero-copy .lede { font-size: 18px; }
  /* The drawings are laid out in px at 104; on a phone they are drawn at 88,
     scaled as a whole, with the space they no longer take given back. */
  .feature { grid-template-columns: 88px minmax(0, 1fr); gap: 16px; }
  .sketch { transform: scale(0.846); transform-origin: 0 0; margin: 0 -16px -16px 0; }
}
