/* perchsocial.app
   Colors are the app's (lib/theme.dart). Lime is too faint for text on light
   backgrounds, so light-mode links use forest. */

:root {
  --forest: #2e4600;
  --olive: #486b00;
  --lime: #a2c523;
  --earth: #7d4427;
  --night: #1a2408;
  --amber: #e0a35c;

  --bg: #f8f8f3;
  --surface: #ffffff;
  --surface-2: #f2f2ed;
  --line: rgba(0, 0, 0, 0.09);
  --text: #1a1a1a;
  --text-2: #5c5c57;
  --link: var(--forest);
  --accent-text: var(--olive);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 22px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Default bird palette: Mountain Bluebird. */
  --h1: #86aeff; --h2: #7aa5ff; --h3: #5b8aff; --h4: #4f7ff0;
  --w1: #4574e6; --w2: #3a63c9; --w3: #3459bb; --w4: #2a478a;
  --l1: #c9dbfb; --l2: #b6cdf8; --l3: #a7c3f7; --l4: #8fb2fb;
  --k: #262626;

  /* Sections that change between themes. */
  --page-hero-bg: linear-gradient(180deg, #8fbcdc 0%, #b5d4e7 50%, #d6e7f0 100%);
  --page-hero-text: #1a2408;
  --page-hero-text-2: #3b4a26;
  --page-hero-eyebrow: var(--olive);
  --statement-text: #1a2408;
  /* The app's own colors (lib/theme.dart), for the phone screens. */
  --app-bg: #f8f8f3; --app-surface: #ffffff; --app-surface-2: #f2f2ed; --app-surface-3: #e8e8e3;
  --app-text: #1a1a1a; --app-text-2: #6b6b6b; --app-text-3: #ababab;
  --app-border: rgba(0, 0, 0, 0.07); --app-border-2: rgba(0, 0, 0, 0.11);
  --app-nav-bg: rgba(255, 255, 255, 0.94); --app-nav-btn: rgba(0, 0, 0, 0.28); --app-accent: var(--olive);

  color-scheme: light;
}

/* Dark mode: only when the visitor picks it with the switch in the header
   (theme.js sets data-theme on <html>). The site opens in light mode. */
:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --surface: #171717;
  --surface-2: #202020;
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-2: #a3a39c;
  --link: var(--lime);
  --accent-text: var(--lime);
  /* The same deep blue sky the home page opens with. */
  --page-hero-bg: var(--sky-deep);
  --page-hero-text: #fff;
  --page-hero-text-2: #dfe5cf;
  --page-hero-eyebrow: var(--lime);
  --statement-text: #fff;
  --app-bg: #0d0d0d; --app-surface: #171717; --app-surface-2: #202020; --app-surface-3: #2a2a2a;
  --app-text: #ffffff; --app-text-2: #9a9a9a; --app-text-3: #555555;
  --app-border: rgba(255, 255, 255, 0.07); --app-border-2: rgba(255, 255, 255, 0.14);
  --app-nav-bg: #191919; --app-nav-btn: #555555; --app-accent: var(--lime);
  color-scheme: dark;
}

.bird--sparrow {
  --h1: #c49a6c; --h2: #b08658; --h3: #8f6a45; --h4: #74553a;
  --w1: #7a5a3b; --w2: #66492f; --w3: #543c27; --w4: #402e1f;
  --l1: #f1e8d8; --l2: #e4d7c1; --l3: #d6c5a9; --l4: #c7b08b;
  --k: #4a3b2c;
}
.bird--meadowlark {
  --h1: #d1ad72; --h2: #bd975e; --h3: #9f7c4b; --h4: #85663b;
  --w1: #7d5f3a; --w2: #6b5032; --w3: #5a432a; --w4: #463420;
  --l1: #f8e27a; --l2: #f2d55b; --l3: #ebc944; --l4: #e0b92f;
  --k: #3a3a3a;
}
/* Birds from beyond Denver, for "See birds beyond your backyard". */
.bird--bunting { /* Painted Bunting: blue head, green back, red below. */
  --h1: #6f8cff; --h2: #5b78f0; --h3: #4a64dd; --h4: #3f58c9;
  --w1: #a5d43f; --w2: #7fb236; --w3: #5d8c2a; --w4: #476b20;
  --l1: #ff5a4e; --l2: #f04438; --l3: #dc3a30; --l4: #c8322a;
  --k: #5a5a5a;
}
.bird--tanager { /* Scarlet Tanager: red, with black wings and tail. */
  --h1: #ff4a4a; --h2: #ee3b3b; --h3: #d93030; --h4: #c42828;
  --w1: #d22c2c; --w2: #2a2a2a; --w3: #1f1f1f; --w4: #161616;
  --l1: #ff5c5c; --l2: #f04545; --l3: #e03a3a; --l4: #ff6b6b;
  --k: #8f927e;
}
.bird--oriole { /* Hooded Oriole: orange, black bib, back and wings. */
  --h1: #ffb43a; --h2: #f9a62a; --h3: #ee9a20; --h4: #e08c18;
  --w1: #222222; --w2: #e9e4d8; --w3: #2e2e2e; --w4: #1a1a1a;
  --l1: #ffc04a; --l2: #ffb43a; --l3: #f5a52c; --l4: #1c1c1c;
  --k: #333333;
}

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

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--lime); color: var(--night); padding: 10px 16px; border-radius: 12px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.draft-banner {
  position: fixed; left: 16px; bottom: 16px; z-index: 80; max-width: calc(100vw - 110px);
  background: #f6d27a; color: #1a1a1a; border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 0.8rem; font-weight: 700; padding: 8px 14px;
}

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 700;
  color: var(--accent-text); margin-bottom: 0.9em;
}
.text-link { font-weight: 700; }
.text-link::after { content: " →"; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--lime); color: var(--night);
  font-weight: 800; text-decoration: none;
  padding: 13px 22px; border-radius: 999px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(162, 197, 35, 0.35); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.header-inner {
  max-width: var(--max); margin: 0 auto; height: 100%;
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em;
}
.brand img { border-radius: 9px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.header-end { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
.header-nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; margin-right: -6px;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
  transition: background 0.2s;
}
.theme-toggle:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* The button shows the theme it switches to. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.header-nav a { color: inherit; text-decoration: none; font-weight: 600; opacity: 0.85; }
.header-nav a:hover, .header-nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; }

/* Over the home page's hero, the header starts clear and fills in once the
   hero has scrolled past (motion.js sets .is-solid). */
.site-header.over-hero {
  position: fixed; left: 0; right: 0;
  background: transparent; border-color: transparent; color: #fff;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* A soft shadow keeps the white words readable over the light morning sky. */
.site-header.over-hero:not(.is-solid) :is(.brand, .header-nav a) {
  text-shadow: 0 1px 2px rgba(4, 14, 30, 0.5), 0 1px 12px rgba(4, 14, 30, 0.4);
}
.site-header.over-hero.is-solid {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-color: var(--line); color: var(--text);
}

/* ---------- Home: hero ---------- */

/* The stage is as tall as the screen with the browser's address bar hidden
   (lvh), not shown (svh). Phone browsers hide the bar as you scroll down;
   an svh stage then stopped short of the bottom of the screen and left a
   band of plain blue under the hills. With the bar showing, the bottom of
   the stage sits just below the screen, where only hillside is. */
.hero { position: relative; height: 100vh; height: 100lvh; min-height: 560px; background: #2b6fae; }
.motion .page-home .hero { height: 300svh; }
.hero-stage {
  position: sticky; top: 0; height: 100vh; height: 100lvh; min-height: 560px; overflow: hidden;
  color: #fff;
}
/* The sky starts a clear blue (--sky-top) and turns to the light morning
   sky (.sky-day) as you scroll. --sky-deep is the darker night-side blue used
   by dark mode's page headers, the chat header and the finale. */
:root {
  --sky-top: linear-gradient(180deg, #2b6fae 0%, #3d86c2 40%, #63a3d4 72%, #93c2e2 100%);
  --sky-deep: linear-gradient(180deg, #0a1f3c 0%, #113764 38%, #1c5791 70%, #3a77ad 100%);
}
.sky { position: absolute; inset: 0; background: var(--sky-top); }
:root[data-theme="dark"] .sky { background: var(--sky-deep); }
.sky-day {
  position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(180deg, #5f8fae 0%, #9cc0cf 34%, #d8e6d2 66%, #f3f0d4 100%);
}
/* The sun starts behind the far mountains and rises as you scroll
   (motion.js). */
.sun {
  position: absolute; left: 58%; top: 48%;
  width: clamp(120px, 22vmin, 260px); aspect-ratio: 1; border-radius: 50%;
  translate: -50% -50%;
  background: radial-gradient(circle, #fffbe8 0%, #fde8a8 38%, rgba(253, 232, 168, 0.45) 56%, rgba(253, 232, 168, 0) 72%);
}
.layer { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; will-change: transform; }
.layer svg, .layer img { display: block; width: 100%; height: 100%; }
/* A layer drawn as two files (rock, then snow on top). */
.layer img + img { position: absolute; inset: 0; }

/* Depth. Once the bird has landed and the picture scrolls away, each plane
   moves by its distance: --speed is how much of the scroll it follows. The
   sky and sun barely move, the mountains linger, the hills nearly keep up,
   and the near ground and the branch (with the bird on it) move faster than
   the page. While the hero is pinned, motion.js drifts the same planes up in
   the same order. The Denver skyline works the same way (.sl, below). */
.depth { position: absolute; inset: 0; pointer-events: none; }
/* Much slower than about half speed and the next section rises over a
   layer sooner than the layer would have scrolled off the top: it sinks out
   of sight instead of staying longer. */
.depth-sky { --speed: 0.2; }
.depth-far { --speed: 0.55; }
.depth-mid { --speed: 0.65; }
.depth-hills { --speed: 0.85; }
.depth-near { --speed: 1.04; }
.depth-perch { --speed: 1.2; }
/* The browser runs these off the scroll position itself (scroll-driven
   animations), so they stay in step with a phone's scrolling, where a
   script would lag a frame behind and judder. Browsers without them, and
   "reduce motion", get the picture scrolling away whole, as before. */
@keyframes trail { to { translate: 0 calc((1 - var(--speed)) * 100vh); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* From the moment the stage stops being pinned until it has gone. */
    .motion .page-home .hero { view-timeline: --hero block; }
    .motion .page-home .depth {
      animation: trail linear both;
      animation-timeline: --hero;
      animation-range: exit 0% exit 100%;
    }
  }
}
/* Kept low, so the headline and the line under it sit in open sky. */
.layer-far { height: 46%; bottom: 4%; }
.layer-mid { height: 40%; bottom: 1%; }
.layer-hills { height: 34%; bottom: 0; }
.layer-near { height: 28%; bottom: -7%; }
/* Each range rises at its own speed (motion.js), so a nearer, slower layer
   could lift its bottom edge above the ridge of the one in front and let
   the pale sky show through between them. A block of the layer's own base
   color hangs under it and moves with it, so there's never a gap. The
   colors match the bottom row of each range in scene.js. */
.layer-far { --base: hsl(95 14% 57%); }
.layer-mid { --base: hsl(82 32% 35%); }
.layer-hills { --base: hsl(84 62% 17%); }
.layer-near { --base: hsl(85 55% 6%); }
.layer-far::after, .layer-mid::after, .layer-hills::after, .layer-near::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: 100%;
  background: var(--base);
}
/* The near ground rises furthest (about a third of the screen by the time
   the hero has gone), so its drawing carries on below its box in rows of
   facets (scene.js groundBelow), with a taller block behind those. */
.layer-near svg { overflow: visible; }
.layer-near::after { height: 220%; z-index: -1; }

/* Tall, narrow screens: lower mountains, so the headline sits in open sky. */
@media (max-aspect-ratio: 4/5) {
  .layer-far { height: 40%; bottom: 10%; }
  .layer-mid { height: 34%; bottom: 6%; }
  .layer-hills { height: 30%; }
  .layer-near { height: 26%; bottom: -7%; }
  .hero-copy { top: clamp(84px, 13vh, 130px); }
}

.hero-copy {
  --h1: clamp(4.2rem, min(15vw, 19vh), 10.5rem);
  position: absolute; left: 0; right: 0; top: clamp(88px, 14vh, 150px);
  text-align: center; padding: 0 var(--gutter);
  text-shadow: 0 2px 24px rgba(4, 14, 30, 0.45);
}
.hero-copy .eyebrow { color: #e8f2c4; }
.hero-copy h1 {
  font-size: var(--h1); font-weight: 800; letter-spacing: -0.045em;
  margin: 0; line-height: 0.95; color: #fff;
}
/* The app icon, above the name on phones. It's part of .hero-copy, so it
   slides up and fades with the name as you scroll. Short screens shrink it
   (svh), so the lede always clears the mountains. */
.hero-logo {
  display: block; width: min(calc(var(--h1) * 1.6), 14svh); height: auto; aspect-ratio: 1;
  margin: 0 auto clamp(12px, 2.2svh, 22px); border-radius: 22.37%;
  box-shadow: 0 14px 34px rgba(4, 14, 30, 0.38), 0 2px 6px rgba(4, 14, 30, 0.2);
}
/* Wide screens: the icon on the left, the words on the right. */
@media (min-width: 720px) and (min-aspect-ratio: 1/1) {
  .hero-copy { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 3vw, 48px); text-align: left; }
  .hero-logo { flex: none; width: calc(var(--h1) * 1.3); margin: 0; }
  .hero-copy .lede { margin: 0; }
}
.hero-copy .tagline { font-size: clamp(1.3rem, 3.2vw, 2rem); font-weight: 700; margin: 0.35em 0 0.4em; color: #f6f8ec; }
.hero-copy .lede {
  max-width: 34ch; margin: 0 auto; font-size: clamp(1.05rem, 2.1vw, 1.25rem); font-weight: 600; color: #fff;
  text-shadow: 0 1px 2px rgba(4, 14, 30, 0.6), 0 2px 14px rgba(4, 14, 30, 0.5);
}

.perch-scene { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flyer { opacity: 0; }
.bird-flying .wing { transform-box: fill-box; transform-origin: 85% 95%; animation: flap 0.34s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-0.75); } }

/* "Find your perch." Light mode: white, like the words above it, with the
   same shadow so it stands off the pale morning sky. Dark mode: deep green. */
/* It rides with the branch (.depth-perch), which has risen about a fifth of
   the screen when the bird lands, so it shows at about 30% from the top. */
.hero-landing {
  position: absolute; left: var(--gutter); right: var(--gutter); top: 50%;
  text-align: center; margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; color: #fff;
  text-shadow: 0 1px 2px rgba(4, 14, 30, 0.55), 0 2px 18px rgba(4, 14, 30, 0.5);
  opacity: 0;
}
:root[data-theme="dark"] .hero-landing { color: #1d2c0b; text-shadow: none; }

.flock { position: absolute; inset: 0; pointer-events: none; }
.flock-bird {
  position: absolute; left: var(--x); top: var(--y);
  width: calc(46px * var(--s)); height: auto; fill: #1d2a0c; opacity: 0.9;
}
.flock-wings { transform-box: fill-box; transform-origin: 50% 70%; animation: flock-flap 0.5s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes flock-flap { from { transform: scaleY(1); } to { transform: scaleY(-0.4); } }

/* Kept above the address bar when it's showing (the stage is lvh tall). */
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; bottom: calc(22px + 100lvh - 100svh); translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, 0.75); border-radius: 16px;
  display: none;
}
.motion .scroll-cue { display: block; }
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  background: #fff; border-radius: 2px; animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Without motion (no JS, or "reduce motion" on), the hero is one still
   picture: morning light, the bird already on its branch. */
.hero:not(.is-animated) .sky-day { opacity: 0.55; }
.hero:not(.is-animated) .sun { top: 54%; }
.hero:not(.is-animated) .hero-landing { display: none; }

/* ---------- Home: statement ---------- */

.statement {
  background: var(--bg); color: var(--statement-text);
  padding: clamp(96px, 18vh, 200px) var(--gutter);
}
.statement-text {
  max-width: 980px; margin: 0 auto;
  font-size: clamp(1.9rem, 5.2vw, 3.9rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.03em;
}
.statement-text .w { transition: opacity 0.2s linear; }
.motion .statement-text .w { opacity: 0.18; }
.statement-text .w.is-lit { opacity: 1; }

/* ---------- Home: "Coming soon" under the statement ---------- */

/* A card in the page headers' sky: light blue in light mode, the deep blue
   in dark mode. Stacked on phones; one row on wide screens. */
.statement:has(+ .launch) { padding-bottom: clamp(56px, 10vh, 120px); }
/* Above the story, so the card's shadow isn't hidden under its background. */
.launch { position: relative; z-index: 1; padding: 0 var(--gutter); background: var(--bg); }
.launch-card {
  max-width: var(--max); margin: 0 auto; padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 52px);
  border-radius: var(--radius); background: var(--page-hero-bg); color: var(--page-hero-text);
  display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center;
  box-shadow: 0 30px 60px -36px rgba(10, 31, 60, 0.55);
}
.launch-card h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: -0.035em; margin: 0; }
.launch-card .store-badges { margin: 0; }
@media (min-width: 900px) {
  .launch-card { flex-direction: row; justify-content: space-between; text-align: left; }
  .launch-card .store-badges { margin-left: auto; }
}

/* ---------- Home: feature story ---------- */

.story { padding: clamp(64px, 10vh, 120px) 0; background: var(--bg); }
.story-grid {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr; gap: 40px;
}
.story-phone { display: none; }
.step { padding: 32px 0 56px; }
.step-kicker { font-weight: 800; color: var(--accent-text); letter-spacing: 0.12em; font-size: 0.85rem; margin-bottom: 0.6em; }
.step h3 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.035em; }
.step p { color: var(--text-2); font-size: 1.12rem; max-width: 36ch; }
.step-phone { margin-top: 28px; display: flex; justify-content: center; }

@media (min-width: 900px) {
  .story-grid { grid-template-columns: 1fr 1fr; gap: 64px; }
  .story-phone { display: block; }
  .step-phone { display: none; }
  .step { min-height: 92vh; display: flex; align-items: center; padding: 0; }
  .step:first-child { min-height: 70vh; }
  .story-phone .phone--sticky { position: sticky; top: max(calc(var(--header-h) + 16px), calc(50vh - 310px)); }
}

/* The phone frame. */
.phone {
  --pw: min(300px, 78vw);
  width: var(--pw); aspect-ratio: 300 / 620; margin: 0 auto;
  border-radius: calc(var(--pw) * 0.15); padding: calc(var(--pw) * 0.035);
  background: linear-gradient(145deg, #2a2a2a, #0c0c0c);
  box-shadow: 0 40px 80px -30px rgba(26, 36, 8, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  position: relative;
}
.phone-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: calc(var(--pw) * 0.12); background: var(--app-bg);
}
.screen { position: absolute; inset: 0; opacity: 0; transform: scale(0.97); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.screen.is-active { opacity: 1; transform: none; }
/* Phones inline with each step always show their screen. .is-active only
   starts its demo (motion.js), once the phone is well up the screen. */
.step-phone .screen { position: absolute; opacity: 1; transform: none; }

/* ---------- App UI inside the phone ---------- */

.app {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  color: var(--app-text); font-size: 12px; line-height: 1.35;
}
.app-status { display: flex; justify-content: space-between; padding: 12px 22px 6px; font-weight: 700; font-size: 11px; }
.app-status-icons { display: inline-flex; gap: 4px; align-items: center; }
.app-status-icons i { display: block; width: 14px; height: 8px; border-radius: 2px; background: currentColor; opacity: 0.85; }
.app-status-icons i:first-child { width: 10px; }
.app-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 10px; }
.app-logo { font-weight: 800; font-size: 17px; color: var(--app-accent); letter-spacing: -0.02em; }
.app-tabs { display: inline-flex; gap: 10px; color: var(--app-text-2); font-size: 11px; }
.app-tabs b { color: var(--app-text); border-bottom: 2px solid var(--lime); padding-bottom: 2px; }
.app-post { margin: 0 10px; background: var(--app-surface); box-shadow: 0 0 0 1px var(--app-border); border-radius: 16px; overflow: hidden; }
.app-post-head { display: flex; align-items: center; gap: 8px; padding: 10px; }
.app-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 10px;
  background: var(--av); color: #fff;
}
.app-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.app-who b { font-size: 12px; }
.app-who small { color: var(--app-text-2); font-size: 10px; }
.app-dots { color: var(--app-text-2); font-weight: 800; }
.app-photo { position: relative; }
.app-photo svg { display: block; width: 100%; height: auto; }
.app-photo--sky { background: linear-gradient(180deg, #8fb7cc 0%, #cfe0d4 60%, #eef0d6 100%); }
.app-photo--meadow { background: linear-gradient(180deg, #d9c48d 0%, #e9dcae 55%, #f3ead0 100%); }
.app-photo--dusk { background: linear-gradient(180deg, #4b3a5e 0%, #b07a5a 60%, #e9b17a 100%); }
.app-pill {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(13, 13, 13, 0.72); color: #fff; border: 1px solid rgba(162, 197, 35, 0.6);
  font-weight: 700; font-size: 10px; padding: 4px 9px; border-radius: 999px;
}
.app-pill--amber { border-color: rgba(224, 163, 92, 0.85); color: #f6c98d; }
.app-actions { display: flex; gap: 14px; align-items: center; padding: 10px 12px 4px; color: var(--app-text-2); font-size: 11px; }
.app-like { display: inline-flex; align-items: center; gap: 5px; color: var(--app-text); }
.app-heart { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: fill 0.3s, stroke 0.3s, transform 0.3s var(--ease); }
.is-active .app-heart { fill: #e05252; stroke: #e05252; animation: pop 0.5s var(--ease) 0.5s both; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
.app-count { position: relative; display: inline-block; width: 2.2ch; height: 1.3em; overflow: hidden; }
.app-count b { position: absolute; left: 0; transition: transform 0.4s var(--ease) 0.55s; }
.app-count .n1 { transform: translateY(110%); }
.is-active .app-count .n0 { transform: translateY(-110%); }
.is-active .app-count .n1 { transform: none; }
.app-caption { padding: 4px 12px 12px; margin: 0; color: var(--app-text); font-size: 11px; }
.app-poll { padding: 10px 12px 12px; }
.app-poll-q { font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.app-poll-opt {
  position: relative; display: flex; justify-content: space-between; align-items: center;
  height: 30px; padding: 0 10px; margin-bottom: 6px; border-radius: 10px;
  background: var(--app-surface-2); overflow: hidden; font-weight: 700;
}
/* The bar grows by scaling from the left, not by changing its width, so it
   doesn't re-lay out the page on every frame of a scroll. */
.app-poll-opt::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct);
  background: linear-gradient(90deg, rgba(72, 107, 0, 0.9), rgba(162, 197, 35, 0.85));
  transform: scaleX(0); transform-origin: left center;
  transition: transform 1s var(--ease) 0.3s;
}
.app-poll-opt:first-of-type::before { background: linear-gradient(90deg, #486b00, #a2c523); }
.is-active .app-poll-opt::before { transform: none; }
.app-poll-opt span, .app-poll-opt b { position: relative; }
.app-poll small { color: var(--app-text-2); }
.app-people { list-style: none; margin: 0 10px; padding: 0; display: grid; gap: 8px; }
.app-people li { display: flex; align-items: center; gap: 9px; background: var(--app-surface); box-shadow: 0 0 0 1px var(--app-border); border-radius: 14px; padding: 9px 10px; }
.app-follow {
  flex: none; font-weight: 800; font-size: 10px; padding: 6px 10px; border-radius: 999px;
  background: var(--lime); color: #1a2408; position: relative; overflow: hidden; display: inline-grid;
}
.app-follow--on { background: transparent; color: var(--app-text); box-shadow: 0 0 0 1px var(--app-border-2) inset; }
/* The demo Follow button (motion.js): pressed, then it turns into
   "Following" and resizes to fit, like the real one. */
[data-follow-demo] { white-space: nowrap; text-align: center; transition: transform 0.12s ease, width 0.25s var(--ease), background 0.2s, color 0.2s, box-shadow 0.2s; }
[data-follow-demo].is-pressed { transform: scale(0.88); }
.is-active .app-follow--toggle em:first-child { opacity: 0; transform: translateY(-8px); }
.is-active .app-follow--toggle em + em { opacity: 1; transform: none; }
.app-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 10px 0; }
.app-thumb { border-radius: 10px; overflow: hidden; aspect-ratio: 1; display: block; }
.app-thumb svg { display: block; width: 100%; height: 100%; }
/* Life List: level card, daily tasks, badges (lib/screens/life_list_screen.dart). */
.app-title { font-weight: 800; font-size: 15px; }
.lucide { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-level { margin: 0 10px; padding: 11px 12px 10px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--forest), var(--olive)); }
.app-level-top { display: flex; justify-content: space-between; align-items: center; }
.app-level-text { display: flex; flex-direction: column; line-height: 1.15; }
.app-level-text small { font-size: 8px; font-weight: 700; letter-spacing: 0.06em; color: rgba(162, 197, 35, 0.75); }
.app-level-text b { font-size: 21px; font-weight: 900; }
.app-level-text em { font-style: normal; font-weight: 700; color: var(--lime); font-size: 11px; }
.app-level-ring { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: var(--lime); border: 2px solid var(--lime); background: rgba(162, 197, 35, 0.2); }
.app-level-xp { display: flex; justify-content: space-between; margin-top: 8px; font-size: 9px; color: rgba(255, 255, 255, 0.72); }
.app-level-xp .app-count { width: 9ch; }
.app-level-bar { height: 6px; margin-top: 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.25); overflow: hidden; }
.app-level-bar i { display: block; height: 100%; width: 66%; border-radius: 3px; background: var(--lime); transition: width 1s var(--ease) 0.9s; }
.is-active .app-level-bar i { width: 68.4%; }
.app-level-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 9px; text-align: center; font-size: 8px; color: rgba(255, 255, 255, 0.72); }
.app-level-stats span + span { border-left: 1px solid rgba(255, 255, 255, 0.15); }
.app-level-stats b { display: block; font-size: 14px; font-weight: 900; color: #fff; }
.app-level-stats .app-count { display: block; width: auto; margin: 0 auto; height: 1.25em; }
.app-level-stats .app-count b { left: 0; right: 0; }
.app-section { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px 6px; font-size: 10px; color: var(--app-text-2); }
.app-section > b { font-size: 12.5px; color: var(--app-text); }
.app-section .app-count { width: 13ch; text-align: right; }
.app-section .app-count b { right: 0; left: auto; font-weight: 400; }
.app-section-link { color: var(--app-accent); }
.app-tasks { list-style: none; margin: 0 10px; padding: 0 10px; border-radius: 12px; background: var(--app-surface); border: 1px solid var(--app-border); }
.app-tasks li { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.app-tasks li + li { border-top: 1px solid var(--app-border); }
.app-task-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--app-surface-2); }
.app-task-icon .lucide { width: 12px; height: 12px; }
.app-task-text { flex: 1; min-width: 0; font-size: 10px; font-weight: 600; }
.app-task-text i { display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: var(--app-surface-3); position: relative; overflow: hidden; }
.app-task-text i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--from); background: var(--lime); border-radius: 2px; transition: width 0.8s var(--ease) 0.3s; }
.is-active .app-task-text i::after { width: var(--to); }
.app-task-xp { flex: none; font-size: 10px; font-weight: 700; }
.app-task-xp.is-done { color: var(--app-accent); }
.app-task-xp .app-count { width: 5ch; text-align: right; }
.app-task-xp .app-count b { right: 0; left: auto; }
.is-active .app-task--live .app-task-xp { color: var(--app-accent); transition: color 0.3s 0.55s; }
.app-badges { list-style: none; margin: 0 10px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px 4px; }
.app-badge { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 7.5px; color: var(--app-text-2); text-align: center; line-height: 1.1; }
.app-badge > span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--olive); background: rgba(72, 107, 0, 0.22); border: 1.5px solid var(--olive); }
.app-badge .lucide { width: 17px; height: 17px; }
.app-badge--locked, .app-badge--unlock { color: var(--app-text-3); }
.app-badge--locked > span, .app-badge--unlock > span { color: var(--app-text-3); background: var(--app-surface-2); border-color: var(--app-surface-3); }
.app-badge--locked .lucide, .app-badge--unlock .lucide { opacity: 0.35; }
.app-badge--unlock > span, .app-badge--unlock .lucide { transition: color 0.3s 1.5s, background 0.3s 1.5s, border-color 0.3s 1.5s, opacity 0.3s 1.5s; }
.is-active .app-badge--unlock { color: var(--app-text-2); transition: color 0.3s 1.5s; }
.is-active .app-badge--unlock > span { color: var(--app-accent); background: rgba(162, 197, 35, 0.22); border-color: var(--lime); animation: pop 0.55s var(--ease) 1.5s both; }
.is-active .app-badge--unlock .lucide { opacity: 1; }
.step .preview-tag, .preview-tag {
  display: inline-block; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px;
  background: #f6d27a; color: #1a1a1a; font-size: 0.8rem; font-weight: 700;
}
/* The map fills the whole screen, edge to edge, like the app's map tab, in
   light or dark map colors. The status bar and nav float over it. */
.app--map .app-status { position: relative; z-index: 1; }
.app-map {
  position: absolute; inset: 0; overflow: hidden;
  background:
    linear-gradient(115deg, transparent 46%, var(--map-road) 47%, var(--map-road) 49%, transparent 50%),
    linear-gradient(25deg, transparent 60%, var(--map-road) 61%, var(--map-road) 63%, transparent 64%),
    radial-gradient(circle at 70% 30%, var(--map-park) 0, transparent 40%),
    var(--map-land);
  --map-land: #e6ead8; --map-park: #cfe0b4; --map-road: rgba(255, 255, 255, 0.9);
}
:root[data-theme="dark"] .app-map { --map-land: #1c2a12; --map-park: #26381a; --map-road: rgba(255, 255, 255, 0.08); }
:root:not([data-theme="dark"]) .app-pin { background: var(--olive); box-shadow: 0 0 0 3px rgba(72, 107, 0, 0.25); }
.app-pin { position: absolute; left: var(--x); top: var(--y); width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(162, 197, 35, 0.3); }
.app-pin--blur i {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-radius: 50%;
  translate: -50% -50%; background: rgba(162, 197, 35, 0.22); box-shadow: 0 0 0 1px rgba(162, 197, 35, 0.6);
  transition: width 0.9s var(--ease) 0.4s, height 0.9s var(--ease) 0.4s;
}
.is-active .app-pin--blur i { width: 110px; height: 110px; }
/* The app's bottom nav at phone scale: 325px wide in the app, here ~80%. */
.app-nav {
  position: absolute; left: 50%; bottom: 12px; translate: -50% 0;
  width: 84%; display: flex; justify-content: space-between; align-items: center;
  background: var(--app-nav-bg); border: 1px solid var(--app-border); border-radius: 999px; padding: 5px 8px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}
.app-nav-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.app-nav-btn svg { width: 17px; height: 17px; fill: var(--app-nav-btn); }
.app-nav-btn.is-current { background: var(--forest); }
.app-nav-btn.is-current svg { fill: var(--lime); }

/* ---------- Home: the sections between the steps ---------- */

/* "Enthusiasts from all walks" (partials/home-gear.njk), "See birds beyond
   your backyard" (home-explore) and "Love birds? Try Perch" (home-share),
   each after a step. Phones: the words, then the picture. Wide screens: the
   picture on the left, the words on the right. */
.story:has(+ .band) { padding-bottom: 0; }
.band + .story { padding-top: 0; }
.band { padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(72px, 12vh, 140px); background: var(--bg); }
.band-inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) {
  .band-inner { grid-template-columns: 1.3fr 1fr; gap: 64px; }
  .band-art { grid-column: 1; grid-row: 1; }
  .band-copy { grid-column: 2; grid-row: 1; }
}
.band-copy h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; }
.band-copy p { color: var(--text-2); font-size: 1.12rem; max-width: 40ch; }
.band-copy .button { margin-top: 0.4em; }
/* Each picture is a still background (.band-bg) with the pieces that move
   laid over it, each in its own <svg> (macros/art.njk `layer`). All motion
   is transforms and opacity on whole pieces, so a moving piece is its own
   GPU layer and the browser only slides finished images around instead of
   redrawing the picture. A piece is a layer only while it moves: GSAP holds
   one for the reveal and lets it go after, and the looping pieces keep
   theirs. (Holding every piece as a layer all the time cost more per frame
   than it saved.) */
.band-art { position: relative; aspect-ratio: 800 / 520; border-radius: var(--radius); overflow: hidden; box-shadow: 0 40px 80px -40px rgba(26, 36, 8, 0.55); }
.band-bg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.band-piece { position: absolute; }
.band-piece > svg { display: block; width: 100%; height: 100%; }
.band-art text { font-family: var(--font); }
.band-night { display: none; }
.gear-shadow { fill: rgba(40, 46, 12, 0.24); }
/* Looping motion, run by the browser off the main thread. It moves each
   piece by picture units: --h is the piece's height in them, so a share of
   100% of its height is one unit. */
/* The phone and the shared photo bob gently, as if held up. */
.band-float { animation: band-float 4.8s ease-in-out infinite; }
@keyframes band-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(-8 * 100% / var(--h)); } }
/* The long-lens camera pans slowly on its tripod head, as if following a bird. */
.gear-pan { transform-origin: var(--ox) var(--oy); animation: gear-pan 7s ease-in-out infinite alternate; }
@keyframes gear-pan { from { rotate: -4deg; } to { rotate: 3deg; } }

/* Printed photos, pills, captions and chat bubbles inside the pictures. */
.photo-frame { fill: #fbfaf6; }
.photo-shadow { fill: rgba(30, 40, 20, 0.2); }
.photo-caption { fill: #3b3b36; font-size: 15px; font-weight: 600; }
.art-pill { fill: rgba(13, 13, 13, 0.72); stroke: rgba(162, 197, 35, 0.6); stroke-width: 1; }
.art-pill-text { fill: #fff; font-size: 12.5px; font-weight: 700; }
.art-pin { fill: #e05252; }
.art-bubble { fill: #fff; }
.art-bubble--answer { fill: var(--lime); }
.art-bubble-text { fill: #1a1a1a; font-size: 18px; font-weight: 700; }
.art-avatar { fill: #fff; font-size: 13px; font-weight: 800; }
.art-dot { fill: #9a9a92; }
.art-contours polygon { fill: none; stroke: rgba(72, 107, 0, 0.16); stroke-width: 2; }
/* Hearts float up toward the shared photo and fade; comments pop in and
   out. Each starts part-way through (a negative delay), so they're spread
   out from the first frame. With "reduce motion" on they hold still. */
.art-rise, .art-pop { animation: art-rise 4.2s ease-in-out infinite; animation-delay: calc(var(--d) * -1s); }
.art-pop { transform-origin: 50% 100%; animation-name: art-pop; animation-duration: 4.8s; }
@keyframes art-rise { 0% { translate: 0 calc(16 * 100% / var(--h)); scale: 0.7; opacity: 0; } 20%, 70% { opacity: 1; } 100% { translate: 0 calc(-48 * 100% / var(--h)); scale: 1; opacity: 0; } }
@keyframes art-pop { 0%, 8% { scale: 0.6; opacity: 0; } 18%, 72% { scale: 1; opacity: 1; } 84%, 100% { scale: 0.9; opacity: 0; } }

/* At night the land goes dark under the stars, the birds, photos and
   gadgets dim a little, and screens and bubbles stay bright. */
:root[data-theme="dark"] .band-day { display: none; }
:root[data-theme="dark"] .band-night { display: inline; }
:root[data-theme="dark"] .band-land { filter: brightness(0.5) saturate(0.85); }
:root[data-theme="dark"] .band-dim { filter: brightness(0.82); }
:root[data-theme="dark"] .gear-shadow { fill: rgba(0, 0, 0, 0.35); }
:root[data-theme="dark"] .art-contours polygon { stroke: rgba(162, 197, 35, 0.12); }

/* ---------- Home: birding with care ---------- */

.care { padding: clamp(72px, 12vh, 140px) var(--gutter); }
.care-inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .care-inner { grid-template-columns: 1fr 1fr; gap: 72px; } }
.care-copy h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; }
.care-copy p { color: var(--text-2); font-size: 1.12rem; max-width: 40ch; }
.care-svg { display: block; width: min(500px, 100%); margin: 0 auto; overflow: visible; }
.care-flyer { opacity: 0; }
/* With motion on, the nest starts empty and the bird flies in (motion.js). */
.motion .care .nesting { opacity: 0; }

/* ---------- Home: Denver ---------- */

.denver { position: relative; background: #3f74ad; color: #fff; }
:root[data-theme="dark"] .denver { background: #081329; }
.denver-stage {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: clamp(72px, 12vh, 140px) var(--gutter) 0;
}
/* With motion on, the section is taller than the screen and the stage holds
   still (sticky) for that stretch of scrolling, like the hero. The skyline
   fills the stage below the words; its bottom edge is the ground. */
.motion .denver { height: 180svh; }
.motion .denver-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; min-height: 560px; }
.motion .skyline-wrap { flex: 1 1 0; min-height: 240px; display: flex; flex-direction: column; }
.motion .skyline { flex: 1 1 0; height: auto; }

/* The skyline's layers (index.njk, skyline). Each starts --rise of its box's
   height lower and slides up into place, nearer ones further, so they move
   at different speeds. The mountains come on screen with the section and
   drift up slowly. The city rises the whole time the section scrolls in:
   its towers come up from the bottom of the screen faster than the page,
   and finish just after the stage holds still. Then, as the stage scrolls
   away, each trails the page by --speed, so the sun sinks behind the
   mountains and the ranges sink behind the city. motion.js lights the
   windows just after the city is up, and copies these ranges for browsers
   without scroll-driven animations. */
.sl-sun { --rise: 0.03; --speed: 0.3; }
.sl-far { --rise: 0.05; --speed: 0.45; }
.sl-mid { --rise: 0.08; --speed: 0.55; }
.sl-near { --rise: 0.11; --speed: 0.65; }
.sl-hills { --rise: 0.15; --speed: 0.75; }
.sl-back { --rise: 0.45; --speed: 0.85; }
.sl-towers { --rise: 0.6; --speed: 0.93; }
.sl-front { --rise: 0.75; --speed: 1; }
@keyframes rise { from { transform: translateY(calc(var(--rise) * 100%)); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .motion .denver { view-timeline: --denver block; }
    /* Rising, the land: from when the section is 30% of the way onto the
       screen until 40% of the way through the held stretch. The city: from
       40% of the way on until the same point. Trailing: from when the stage
       starts to scroll away until it has gone. */
    .motion .denver .sl {
      animation: rise linear both, trail linear both;
      animation-timeline: --denver, --denver;
      animation-range: entry 30% contain 40%, exit 0% exit 100%;
    }
    .motion .denver .sl-city { animation-range: entry 40% contain 40%, exit 0% exit 100%; }
  }
}
.denver-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.denver-sky svg, .denver-sky img { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky-mesh--night, .sky-night { display: none; }
:root[data-theme="dark"] .sky-mesh--sunset, :root[data-theme="dark"] .sky-sun { display: none; }
:root[data-theme="dark"] .sky-mesh--night, :root[data-theme="dark"] .sky-night { display: block; }
.moon-glow { fill: rgba(255, 248, 220, 0.1); }
.star { fill: #fdf8e4; }
.star.twinkle { animation: twinkle 3.2s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
/* Wings flap and stars twinkle only while their section is on screen
   (motion.js sets .in-view): the browser redraws them every frame, even off
   screen, and that slowed scrolling everywhere else on the page. */
.motion :is(.hero, .care, .denver, .finale):not(.in-view) :is(.flock-wings, .wing, .twinkle) { animation-play-state: paused; }
.sun-glow { fill: rgba(255, 214, 140, 0.35); }
.denver-inner, .skyline-wrap { position: relative; z-index: 1; }
/* The words stay in front of the peaks that rise beside them. */
.denver-inner { z-index: 2; }
.denver-inner { max-width: var(--max); margin: 0 auto; }
/* A soft shadow keeps the light words readable over the pale sunset sky. */
.denver-copy { max-width: 620px; text-shadow: 0 1px 2px rgba(10, 30, 60, 0.55), 0 2px 16px rgba(10, 30, 60, 0.5); }
.denver-copy h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; color: #fff; }
.denver-copy p { color: rgba(255, 255, 255, 0.9); font-size: 1.12rem; }
.denver-copy .eyebrow { color: #ffe1ad; }
/* The small words need the shadow closer in, so it outlines each letter. */
.denver-copy :is(.eyebrow, p) {
  text-shadow: 0 0 2px rgba(10, 30, 60, 0.6), 0 1px 3px rgba(10, 30, 60, 0.6), 0 2px 14px rgba(10, 30, 60, 0.45);
}
:root[data-theme="dark"] .denver-copy .eyebrow { color: var(--lime); }
.denver-copy .text-link { color: #fff; }
/* The skyline spans the full width, and its box is all the space under the
   words. The land layers fit the mountains (scene.js, `land`) to that box,
   so the highest peak reaches up to just under the words; they always fill
   the width, and when that makes them bigger than the box, the extra ground
   runs below the edge, behind the city. The city layers fit downtown's
   landmarks (scene.js, `city`) into the same box, as tall as it allows,
   standing in front; buildings beyond the landmarks carry on to the sides.
   Both may reach outside their boxes (overflow). Phones, and screens taller
   than they are wide (a tablet held upright), get the tall drawing, which
   packs the towers closer. */
.denver { --skyline-gap: clamp(24px, 5vh, 56px); }
.skyline-wrap { margin: var(--skyline-gap) calc(-1 * var(--gutter)) 0; }
.skyline { position: relative; display: block; width: 100%; height: clamp(320px, 56vh, 640px); }
.skyline .sl { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* Phones: the mountains' box starts most of the way up the gap, so the
   highest peak comes up almost to the words. */
.skyline--tall .sl-land { top: calc(-0.8 * var(--skyline-gap)); height: calc(100% + 0.8 * var(--skyline-gap)); }
/* Wider screens: the mountains are drawn at a scale set by the width
   (--land-k times it, centered), so the words, always 620px wide in the
   middle, cover the low middle of the ridge, and the big peaks at either
   side rise beside them (scene.js, frontRangeLift). The drawing is placed
   so the highest point of that low middle sits 30px under the words
   (--peaks-up: how far the top of the drawing is above the words' bottom;
   --dip comes from scene.js). Between 641 and 1199px the words take up
   most of the width, so the drawing is wider and only the low middle
   shows, with the slopes at the very edges. The ground carries on below
   the stage, or the box stretches (and the drawing scales up) to reach it. */
.skyline--wide { --land-k: 1.8; }
@media (min-width: 1200px) { .skyline--wide { --land-k: 1.3; } }
.skyline--wide .sl-land {
  --peaks-up: calc(var(--land-k) * var(--dip) * 100vw - 30px);
  top: calc(-1 * (var(--skyline-gap) + var(--peaks-up))); bottom: auto;
  left: calc(50% - var(--land-k) * 50%); right: auto;
  width: calc(var(--land-k) * 100%); max-width: none;
  height: auto; min-height: calc(100% + var(--skyline-gap) + var(--peaks-up));
}
.skyline--tall { display: none; }
@media (max-width: 640px), (max-aspect-ratio: 1/1) {
  .skyline--wide { display: none; }
  .skyline--tall { display: block; }
}
.skyline {
  --b-shade: hsl(212 9% 50%); --b-shade-2: hsl(212 9% 46%); --b-lit: hsl(212 12% 70%); --b-lit-2: hsl(212 12% 74%);
  --w-shade: hsl(14 16% 48%); --w-shade-2: hsl(14 16% 44%); --w-lit: hsl(16 22% 66%); --w-lit-2: hsl(16 22% 70%);
  --win: rgba(255, 255, 255, 0.3);
  --dnf-shade: hsl(28 30% 52%); --dnf-lit: hsl(30 38% 68%); --dnf-band: hsl(28 24% 42%);
  --dnf-roof-shade: hsl(165 14% 40%); --dnf-roof-lit: hsl(165 18% 55%); --dnf-clock: #f6f0de;
  --cap-shade: hsl(40 8% 64%); --cap-lit: hsl(40 12% 80%); --cap-col: hsl(40 8% 52%);
  --gold-0: #9c6f1f; --gold-1: #b8862b; --gold-2: #cf9f3a; --gold-3: #e2b84f; --gold-4: #f0cd68; --gold-5: #f8dd86;
  --k-shade: hsl(12 30% 42%); --k-shade-2: hsl(12 30% 38%); --k-lit: hsl(14 36% 56%); --k-lit-2: hsl(14 36% 60%);
  --range-filter: none;
}
/* The back row is a little paler, so the rows read apart. */
.sl-back { --b-shade: hsl(214 10% 58%); --b-shade-2: hsl(214 10% 55%); --b-lit: hsl(214 12% 75%); --b-lit-2: hsl(214 12% 78%); }
.b-shade { fill: var(--b-shade); } .b-shade-2 { fill: var(--b-shade-2); }
.b-lit { fill: var(--b-lit); } .b-lit-2 { fill: var(--b-lit-2); }
.b-wells .b-shade { fill: var(--w-shade); } .b-wells .b-shade-2 { fill: var(--w-shade-2); }
.b-wells .b-lit { fill: var(--w-lit); } .b-wells .b-lit-2 { fill: var(--w-lit-2); }
.b-brick .b-shade { fill: var(--k-shade); } .b-brick .b-shade-2 { fill: var(--k-shade-2); }
.b-brick .b-lit { fill: var(--k-lit); } .b-brick .b-lit-2 { fill: var(--k-lit-2); }
/* With motion on, the windows light up in turn once the city has risen
   (motion.js, .lights-on). */
.win { fill: var(--win); transition: opacity 0.5s ease calc(var(--d) * 1.4s); }
.motion .denver:not(.lights-on) .win { opacity: 0; }
.dnf-shade { fill: var(--dnf-shade); } .dnf-lit { fill: var(--dnf-lit); } .dnf-band { fill: var(--dnf-band); }
.dnf-roof-shade { fill: var(--dnf-roof-shade); } .dnf-roof-lit { fill: var(--dnf-roof-lit); }
.dnf-clock { fill: var(--dnf-clock); }
.dnf-hands { stroke: #2b2b2b; stroke-width: 1.2; stroke-linecap: round; fill: none; }
.cap-shade { fill: var(--cap-shade); } .cap-lit { fill: var(--cap-lit); }
.cap-col { stroke: var(--cap-col); stroke-width: 1.6; }
.dome-0 { fill: var(--gold-0); } .dome-1 { fill: var(--gold-1); } .dome-2 { fill: var(--gold-2); }
.dome-3 { fill: var(--gold-3); } .dome-4 { fill: var(--gold-4); } .dome-5 { fill: var(--gold-5); }
.sky-land, .sl-land:not(.sl-sun, .sl-snowcap) { filter: var(--range-filter); }

/* At night the towers go dark, their windows light up, and the dome and
   the clock face glow. */
:root[data-theme="dark"] .skyline {
  --b-shade: hsl(222 14% 15%); --b-shade-2: hsl(222 14% 13%); --b-lit: hsl(222 12% 22%); --b-lit-2: hsl(222 12% 25%);
  --w-shade: hsl(14 14% 16%); --w-shade-2: hsl(14 14% 14%); --w-lit: hsl(14 14% 24%); --w-lit-2: hsl(14 14% 27%);
  --win: #ffd98a;
  --dnf-shade: hsl(26 18% 22%); --dnf-lit: hsl(28 20% 30%); --dnf-band: hsl(26 16% 18%);
  --dnf-roof-shade: hsl(165 10% 18%); --dnf-roof-lit: hsl(165 12% 26%); --dnf-clock: #ffe9b0;
  --cap-shade: hsl(40 6% 26%); --cap-lit: hsl(40 8% 36%); --cap-col: hsl(40 6% 20%);
  --k-shade: hsl(12 16% 14%); --k-shade-2: hsl(12 16% 12%); --k-lit: hsl(14 16% 21%); --k-lit-2: hsl(14 16% 24%);
  --range-filter: brightness(0.42) saturate(0.85);
}
:root[data-theme="dark"] .sl-back { --b-shade: hsl(222 14% 19%); --b-shade-2: hsl(222 14% 17%); --b-lit: hsl(222 12% 26%); --b-lit-2: hsl(222 12% 29%); }
/* Night windows: only some are lit, and they flicker on in turn. */
:root[data-theme="dark"] .win { fill-opacity: calc(0.35 + var(--d) * 0.65); }

/* ---------- Home: finale ---------- */

/* Light mode: the deep blue of the top of the page, lightening to the
   morning sky behind the mountains. Dark mode: the deep blue sky. */
.finale { position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(180deg, #0a1f3c 0%, #1c5791 38%, #6fa3c7 66%, #b9d5e0 100%); }
:root[data-theme="dark"] .finale { background: var(--sky-deep); }
.finale-stage { position: relative; min-height: 92svh; display: flex; align-items: flex-start; }
.layer-finale { height: 46%; bottom: -1px; }
:root[data-theme="dark"] .layer-finale .rock { filter: brightness(0.55) saturate(0.8); }
:root[data-theme="dark"] .layer-finale .snow, :root[data-theme="dark"] .sky-snow, :root[data-theme="dark"] .sl-snowcap { filter: brightness(0.86); }
.finale-flock { position: absolute; inset: 0; pointer-events: none; }
.finale-flock .flock-bird { fill: #0a1a30; }
.finale-copy { position: relative; z-index: 2; max-width: var(--max); width: 100%; margin: 0 auto; padding: clamp(96px, 16vh, 180px) var(--gutter) 0; text-align: center; }
.finale-copy h2 { font-size: clamp(2.3rem, 6vw, 4.6rem); font-weight: 800; letter-spacing: -0.04em; margin-bottom: 0.5em; }
/* Apple asks for clear space of a quarter of the badge's height around it,
   and at least 40px of height on screen. */
.store-badges { list-style: none; margin: 0 0 2em; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 20px; }
.store-badges img { display: block; height: 54px; width: auto; }
.footer-brand .store-badges { justify-content: flex-start; margin: 18px 0 0; }
.finale-copy p { font-size: 1.15rem; color: #eaf2fa; }
.finale-copy a { color: #fff; font-weight: 700; }
.tester-invite { margin: 36px auto 0; max-width: 460px; padding: 24px; border-radius: var(--radius); background: rgba(13, 13, 13, 0.35); backdrop-filter: blur(8px); }
.tester-invite h3 { font-size: 1.5rem; }
.tester-invite .button { color: var(--night); }

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

.site-footer { background: var(--night); color: #dfe5cf; padding: 48px var(--gutter) 0; }
.footer-inner { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; }
.footer-brand .brand { color: #fff; }
.footer-brand p { margin: 8px 0 0; color: #b9c2a5; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.footer-nav a { color: #fff; font-weight: 600; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 2px; }
/* The legal bar: small, under a hairline. */
.footer-legal {
  max-width: var(--max); margin: 36px auto 0; padding: 16px 0 24px; border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  font-size: 0.78rem; color: #8f9a7a;
}
.footer-legal p { margin: 0; }
.footer-legal ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-legal a { color: #a9b393; text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }

/* ---------- Legal page ---------- */

.legal { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.legal-body { padding-left: 0; padding-right: 0; }
.legal-body h2 { scroll-margin-top: calc(var(--header-h) + 64px); padding-top: 0.6em; border-top: 1px solid var(--line); }
.legal-body h2:first-of-type { border-top: 0; }
.legal-body h3 { scroll-margin-top: calc(var(--header-h) + 64px); }
/* Phones: the section menu is a row of chips that sticks under the header. */
.legal-nav {
  position: sticky; top: var(--header-h); z-index: 5; margin: 0 calc(-1 * var(--gutter));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.legal-nav ul { list-style: none; margin: 0; padding: 10px var(--gutter); display: flex; gap: 8px; width: max-content; }
.legal-nav a { display: block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 0.88rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.legal-nav a:hover { border-color: var(--olive); }
/* Wide screens: a menu down the left side. */
@media (min-width: 1000px) {
  .legal { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 56px; justify-content: center; }
  .legal-nav { margin: 0; padding-top: clamp(40px, 7vh, 72px); background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; overflow: visible; align-self: start; top: calc(var(--header-h) + 8px); }
  .legal-nav ul { flex-direction: column; padding: 0; width: auto; gap: 2px; }
  .legal-nav a { border: 0; background: none; padding: 7px 12px; border-radius: 10px; color: var(--text-2); }
  .legal-nav a:hover { background: var(--surface-2); color: var(--text); }
}
.legal-form { margin: 1.2em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.legal-form > summary { cursor: pointer; padding: 16px 20px; font-weight: 700; list-style: none; }
.legal-form > summary::-webkit-details-marker { display: none; }
.legal-form > summary::after { content: " +"; color: var(--accent-text); }
.legal-form[open] > summary::after { content: " −"; }
.legal-form .web-form { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Content pages ---------- */

/* The mountain band is 1440×200. Its box is never shorter than width ÷ 7.2,
   so the drawing is only ever cropped at the sides, never across the top,
   and the text always sits fully above it. */
.page-hero { --band: max(120px, 13.9vw); position: relative; overflow: hidden; background: var(--page-hero-bg); color: var(--page-hero-text); }
.page-hero-inner { position: relative; z-index: 2; max-width: var(--max); margin: 0 auto; padding: clamp(48px, 9vh, 100px) var(--gutter) calc(var(--band) + 36px); }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; letter-spacing: -0.04em; max-width: 18ch; color: inherit; }
.page-hero p { color: var(--page-hero-text-2); font-size: 1.15rem; max-width: 52ch; margin: 0; }
.page-hero .eyebrow { color: var(--page-hero-eyebrow); }
.page-hero .layer { height: var(--band); }
.page-hero .layer-a .rock { opacity: 0.55; }

.prose { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vh, 72px) var(--gutter) clamp(64px, 10vh, 110px); }
.prose h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-top: 2em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose .updated { color: var(--text-2); font-size: 0.95rem; }
.prose blockquote { margin: 1.5em 0; padding: 14px 18px; border-left: 4px solid var(--lime); background: var(--surface-2); border-radius: 0 14px 14px 0; }
.prose blockquote p:last-child { margin: 0; }
.note-callout { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 1.5em 0; }

/* Testing page: where Perch is, at the top (alpha now, beta sign-ups open,
   then launch), as dots on a line. */
.phase-card { margin: 0 0 2.4em; padding: 22px clamp(18px, 3vw, 28px); border-radius: var(--radius); background: color-mix(in srgb, var(--lime) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--olive) 35%, transparent); }
.phase-card h2 { margin: 0 0 0.35em; font-size: 1.4rem; }
.phase-card p { margin: 0; }
.phase-track { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.phase-track li { position: relative; margin: 0; padding-top: 26px; font-size: 0.85rem; color: var(--text-2); line-height: 1.3; }
.phase-track li::before { content: ""; position: absolute; left: 0; top: 4px; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid color-mix(in srgb, var(--text) 25%, transparent); }
.phase-track li:not(:last-child)::after { content: ""; position: absolute; left: 14px; right: 0; top: 10px; height: 2px; background: color-mix(in srgb, var(--text) 15%, transparent); }
.phase-track b { display: block; color: var(--text); font-size: 1rem; }
.phase-track .is-now::before { background: var(--lime); border-color: var(--olive); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 30%, transparent); }
.phase-track .is-now::after { background: linear-gradient(90deg, var(--olive), color-mix(in srgb, var(--text) 15%, transparent)); }
.phase-track .is-open::before { border-color: var(--olive); }

/* Support page */
.contact-cards { display: grid; gap: 16px; margin: 0 0 2.5em; }
@media (min-width: 640px) { .contact-cards { grid-template-columns: 1fr 1fr; } }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.contact-card h2 { font-size: 1.15rem; margin: 0 0 0.4em; }
.contact-card p { color: var(--text-2); margin-bottom: 0.8em; }
.contact-card a { font-weight: 800; word-break: break-all; }
.help-launch { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; background: var(--surface-2); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 2.5em; }
.help-launch p { margin: 0; flex: 1 1 260px; }
.help-launch button { font: inherit; border: 0; cursor: pointer; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 1.4rem; color: var(--accent-text); transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 16px; color: var(--text-2); }
/* Forms (macros/form.njk, assets/js/forms.js) */
.web-form { display: grid; grid-template-columns: 1fr; gap: 18px 16px; margin: 1.5em 0 2.5em; padding: clamp(18px, 3vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
@media (min-width: 640px) { .web-form { grid-template-columns: 1fr 1fr; } }
.web-form[hidden] { display: none; }
.web-form > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 640px) { .web-form > .is-half { grid-column: span 1; } }
.web-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.web-form fieldset[hidden] { display: none; }
.form-field { display: grid; gap: 6px; align-content: start; }
.dob-parts { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 8px; }
.form-note p { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 0.95rem; line-height: 1.5; }
.form-label, .form-topics legend { font-weight: 700; font-size: 0.95rem; }
.form-label em { font-style: normal; font-weight: 400; color: var(--text-2); }
.form-hint { color: var(--text-2); font-size: 0.85rem; }
.web-form input:not([type=checkbox]):not([type=radio]), .web-form textarea, .web-form select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  padding: 11px 13px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); background: var(--bg);
}
.web-form textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.web-form input:focus-visible, .web-form textarea:focus-visible, .web-form select:focus-visible { outline: 3px solid var(--lime); outline-offset: 1px; border-color: var(--olive); }
.form-topics { display: grid; gap: 10px; }
.form-topics legend { margin-bottom: 10px; padding: 0; }
.form-choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; }
.form-choice:has(input:checked) { border-color: var(--olive); background: color-mix(in srgb, var(--lime) 12%, transparent); }
.form-choice input, .form-check input { width: 20px; height: 20px; flex: none; accent-color: var(--olive); margin: 0; }
.form-check label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 0.95rem; line-height: 1.5; cursor: pointer; }
.form-check input { margin-top: 2px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-actions .button { border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.form-actions .button[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.form-status { margin: 0; flex: 1 1 240px; font-size: 0.95rem; }
.form-status.is-error { color: #c0392b; font-weight: 600; }
:root[data-theme="dark"] .form-status.is-error { color: #ff8a7a; }
.form-done { margin: 1.5em 0 2.5em; padding: 22px 24px; border-radius: var(--radius); background: color-mix(in srgb, var(--lime) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--olive) 40%, transparent); }
.form-done:focus { outline: none; }
.form-done h3 { margin: 0 0 0.3em; font-size: 1.3rem; }
.form-done p { margin: 0; }
.web-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.safety-note { border-left: 4px solid #e05252; padding: 12px 16px; background: var(--surface-2); border-radius: 0 14px 14px 0; margin: 0 0 2em; }

/* Coming Soon and 404 */
.coming-soon { min-height: calc(100svh - var(--header-h)); display: grid; place-items: center; padding: 24px; background: var(--night); color: #f2f3f5; text-align: center; }
.coming-soon-logo { display: block; margin: 0 auto 20px; border-radius: 22.37%; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.coming-soon h1 { font-size: 2.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--lime); margin: 0; }
.coming-soon p { color: #c7cbd1; }
.not-found { min-height: 70vh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 64px var(--gutter); }
.not-found h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; }
.not-found p { color: var(--text-2); }
.not-found-bird { width: 140px; height: auto; margin-bottom: 12px; animation: hop 2.4s ease-in-out infinite; }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0); } 78% { transform: translateY(-10px); } 86% { transform: translateY(0); } }

/* ---------- Help chat ---------- */

.chat { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 70; }
.chat-launcher {
  display: inline-flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--forest); color: #fff; font: inherit; font-weight: 800;
  box-shadow: 0 12px 30px -8px rgba(26, 36, 8, 0.6);
  transition: transform 0.2s var(--ease), background 0.2s;
}
.chat-launcher:hover { transform: translateY(-2px); background: var(--olive); }
.chat.is-open .chat-launcher { display: none; }
.chat-panel {
  position: absolute; right: 0; bottom: 0;
  width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100svh - 32px));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.45);
  transform-origin: bottom right; animation: chat-in 0.28s var(--ease);
}
.chat-panel[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
/* The chat's header uses the same sky as the page headers, light or dark. */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--page-hero-bg); color: var(--page-hero-text); }
.chat-head img { border-radius: 8px; }
.chat-head-text { flex: 1; min-width: 0; }
.chat-head h2 { font-size: 1rem; margin: 0; letter-spacing: -0.01em; }
.chat-head p { margin: 0; font-size: 0.78rem; color: var(--page-hero-text-2); }
.chat-restart, .chat-close { border: 0; background: color-mix(in srgb, currentColor 12%, transparent); color: inherit; font: inherit; font-size: 0.8rem; font-weight: 700; border-radius: 999px; cursor: pointer; }
.chat-restart { padding: 7px 11px; }
.chat-close { width: 34px; height: 34px; display: grid; place-items: center; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-msg { max-width: 86%; margin: 0; padding: 10px 13px; border-radius: 18px; font-size: 0.95rem; line-height: 1.45; animation: msg-in 0.25s var(--ease); }
.chat-msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.chat-msg.me { align-self: flex-end; background: var(--forest); color: #fff; border-bottom-right-radius: 6px; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chat-actions { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; max-height: 62%; overflow-y: auto; }
.chat-option {
  border: 1.5px solid var(--olive); background: transparent; color: var(--accent-text);
  font: inherit; font-size: 0.9rem; font-weight: 700; padding: 8px 13px; border-radius: 999px;
  cursor: pointer; text-decoration: none; text-align: left;
}
.chat-option:hover { background: var(--olive); color: #fff; }
.chat-form { display: grid; gap: 10px; width: 100%; }
.chat-form label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 700; }
.chat-label em { font-style: normal; font-weight: 400; color: var(--text-2); }
body:has(.chat.is-open) .draft-banner { display: none; }
.chat-form input, .chat-form textarea {
  font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.chat-form textarea { resize: vertical; min-height: 72px; }
.chat-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.chat-send { border: 0; background: var(--lime); color: var(--night); font: inherit; font-weight: 800; padding: 12px; border-radius: 999px; cursor: pointer; }
.chat-send[disabled] { opacity: 0.6; cursor: progress; }
@media (max-width: 520px) {
  .chat-panel { position: fixed; inset: auto 0 0 0; width: 100%; height: min(88svh, 640px); border-radius: 24px 24px 0 0; }
  .chat-launcher-label { display: none; }
  .chat-launcher { width: 56px; padding: 0; justify-content: center; }
}

/* ---------- Blog ---------- */

.blog-wrap { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 7vh, 72px) var(--gutter) clamp(64px, 10vh, 110px); }
.blog-subhead { font-size: 1.3rem; margin: 2em 0 0.8em; }
.post-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card-link { color: inherit; text-decoration: none; display: block; }
.post-card-link img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card h2 { font-size: 1.25rem; margin: 18px 20px 0; line-height: 1.25; }
.post-card-link:hover h2 { text-decoration: underline; }
.post-card p { margin: 10px 20px 0; color: var(--text-2); }
.post-card .post-meta { margin: auto 20px 0; padding: 14px 0 18px; font-size: 0.9rem; }
.post-card .post-meta a { color: inherit; }
.blog-post { max-width: 760px; margin: 0 auto; }
.post-hero { margin: 0 0 2em; }
.post-hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.post-hero figcaption { margin-top: 8px; font-size: 0.85rem; color: var(--text-2); }
.post-note { font-size: 0.95rem; color: var(--text-2); font-style: italic; }
.blog-body h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-top: 2em; }
.blog-body h3 { font-size: 1.2rem; margin-top: 1.6em; }
.blog-body ul, .blog-body ol { padding-left: 1.3em; }
.blog-body li { margin: 0.3em 0; }
.blog-body img { max-width: 100%; height: auto; border-radius: 14px; }
.blog-body blockquote { margin: 1.5em 0; padding: 14px 18px; border-left: 4px solid var(--lime); background: var(--surface-2); border-radius: 0 14px 14px 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 2em 0 0; }
.post-tags a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.9rem; text-decoration: none; background: var(--surface-2); }
.post-cta { margin: 2.5em 0; padding: 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.post-cta h2 { margin-top: 0; font-size: 1.4rem; }
.post-cta .store-badges { justify-content: flex-start; margin: 1em 0 0; }
.post-sources { font-size: 0.95rem; }
.post-sources h2 { font-size: 1.2rem; }
.post-sources span { color: var(--text-2); }
.author-box { display: flex; gap: 18px; align-items: flex-start; margin: 2.5em 0 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.author-box img { border-radius: 50%; flex: none; object-fit: cover; }
.author-box h2 { font-size: 1.15rem; margin: 0 0 0.4em; }
.author-box p { margin: 0.4em 0 0; }
.author-credentials { color: var(--text-2); font-size: 0.92rem; }

/* ---------- Reveal on scroll ---------- */

.motion [data-reveal] { opacity: 0; transform: translateY(28px); }
.motion [data-reveal].is-in { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .bird-flying .wing, .flock-wings { animation: none; }
}

/* Home: newsletter box (partials/newsletter.njk). Sits under the finale. */
.newsletter { padding: clamp(40px, 7vw, 72px) 0; background: var(--bg); }
.newsletter-inner { width: min(640px, calc(100% - 32px)); margin: 0 auto; }
.newsletter h2 { margin: 0 0 0.3em; font-size: clamp(1.5rem, 3vw, 2rem); }
.newsletter-inner > p:not(.preview-tag) { margin: 0; color: var(--text-2); }
.newsletter .web-form { margin: 1.25em 0 0; }
