/* Wren's landing page. Text lives on glass, never on bare sky
   (docs/DESIGN-overhaul-2026-10-06.md). tools/check-contrast.mjs reads the
   --tint, --alpha and --ink values below and holds them to Wren's contrast
   rule over every sky the page can show. Change them there and here together. */

:root {
  /* Glass tints and their opacity, per tone and contrast setting. */
  --tint-light: 255 252 246;
  /* Dark glass is night-sky navy, not the app's warm #1C1A17: the web needs
     a denser tint than Liquid Glass, and at this density the warm tint read
     brown over the evening sky. */
  --tint-dark: 18 22 42;
  --alpha-light: 0.7;
  --alpha-dark: 0.8;
  --alpha-light-more: 0.9;
  --alpha-dark-more: 0.92;

  /* GlassInk: two levels, standard and increased contrast. */
  --ink-light: 28 30 27;
  --ink2-light: 65 69 62;
  --ink-light-more: 11 12 11;
  --ink2-light-more: 42 45 40;
  --ink-dark: 246 243 238;
  --ink2-dark: 216 211 202;
  --ink-dark-more: 255 255 255;
  --ink2-dark-more: 234 230 223;

  /* WrenAccentTone: fill and the label on it. */
  --fill-sky: 191 216 238;
  --label-sky: 14 42 69;
  --fill-sand: 232 210 172;
  --label-sand: 51 36 15;

  /* SkySolid: the plain surface without a sky. */
  --solid-light: 243 237 227;
  --solid-dark: 31 28 25;

  /* A morning sky until the script paints the visitor's own. */
  --zenith: 82 145 216;
  --middle: 177 204 236;
  --horizon: 248 218 178;
  --bottom: 230 216 194;
  --band: 255 226 189;
  --band-a: 0.6;
  --band-hot: 255 240 214;
  --band-hot-a: 0.5;
  --hot-x: 40%;
  --sun: 255 230 196;
  --sun-a: 0.55;
  --sun-x: 30%;
  --sun-y: 50%;
  --cloud-light: 233 233 230;
  --cloud-shade: 129 175 227;
  --cloud-a: 0.55;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --glass: var(--tint-light);
  --glass-alpha: var(--alpha-light);
  --ink: var(--ink-light);
  --ink-2: var(--ink2-light);
  --fill: var(--fill-sky);
  --label: var(--label-sky);
  --edge: 255 255 255 / 0.45;
  --solid: var(--solid-light);
  color-scheme: light;
}

[data-tone="dark"] {
  --glass: var(--tint-dark);
  --glass-alpha: var(--alpha-dark);
  --ink: var(--ink-dark);
  --ink-2: var(--ink2-dark);
  --edge: 255 255 255 / 0.1;
  color-scheme: dark;
}
[data-accent="sand"] { --fill: var(--fill-sand); --label: var(--label-sand); }

/* Without the script the page has no sky: the plain surface, as the app
   shows under Reduce Transparency. */
@media (prefers-color-scheme: dark) {
  :root:not([data-tone]) {
    --glass: var(--tint-dark);
    --glass-alpha: var(--alpha-dark);
    --ink: var(--ink-dark);
    --ink-2: var(--ink2-dark);
    --fill: var(--fill-sand);
    --label: var(--label-sand);
    --edge: 255 255 255 / 0.1;
    --solid: var(--solid-dark);
    color-scheme: dark;
  }
}
[data-tone="dark"] { --solid: var(--solid-dark); }

@media (prefers-contrast: more) {
  :root { --glass-alpha: var(--alpha-light-more); --ink: var(--ink-light-more); --ink-2: var(--ink2-light-more); }
  [data-tone="dark"] { --glass-alpha: var(--alpha-dark-more); --ink: var(--ink-dark-more); --ink-2: var(--ink2-dark-more); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-tone]) { --glass-alpha: var(--alpha-dark-more); --ink: var(--ink-dark-more); --ink-2: var(--ink2-dark-more); }
  }
  .glass { border-color: rgb(var(--ink-2) / 0.7); }
}

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

html { background: rgb(var(--solid)); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 1.0625rem/1.6 var(--sans);
  color: rgb(var(--ink));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The sky. CSS layers draw it still; with WebGL, the canvas on top draws it
   moving (sky-gl.js) and the layers stay underneath as the fallback. */
.sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(to bottom,
    rgb(var(--zenith)) 0%, rgb(var(--middle)) 50%, rgb(var(--horizon)) 80%, rgb(var(--bottom)) 100%);
}
:root:not([data-tone]) .sky { display: none; }
.sky > div { position: absolute; inset: 0; }
.sky-clouds {
  opacity: var(--cloud-a);
  background:
    radial-gradient(ellipse 34% 9% at 27.6% 33%, rgb(var(--cloud-light)) 0%, rgb(var(--cloud-light) / 0.45) 50%, rgb(var(--cloud-light) / 0) 100%),
    radial-gradient(ellipse 44% 15% at 27% 39%, rgb(var(--cloud-shade)) 0%, rgb(var(--cloud-shade) / 0.4) 50%, rgb(var(--cloud-shade) / 0) 100%),
    radial-gradient(ellipse 28% 7% at 78.4% 20%, rgb(var(--cloud-light) / 0.6) 0%, rgb(var(--cloud-light) / 0.25) 50%, rgb(var(--cloud-light) / 0) 100%),
    radial-gradient(ellipse 36% 12% at 78% 25%, rgb(var(--cloud-shade) / 0.6) 0%, rgb(var(--cloud-shade) / 0.22) 50%, rgb(var(--cloud-shade) / 0) 100%);
}
.sky-band {
  background:
    radial-gradient(ellipse 52% 6% at var(--hot-x) 80%, rgb(var(--band-hot) / var(--band-hot-a)) 0%, rgb(var(--band-hot) / 0) 100%),
    radial-gradient(ellipse 100% 22% at 50% 80%, rgb(var(--band) / var(--band-a)) 0%, rgb(var(--band) / calc(var(--band-a) * 0.45)) 45%, rgb(var(--band) / 0) 100%);
}
.sky-sun {
  mix-blend-mode: screen;
  background: radial-gradient(circle max(62vw, 62lvh) at var(--sun-x) var(--sun-y),
    rgb(var(--sun) / var(--sun-a)) 0%, rgb(var(--sun) / calc(var(--sun-a) * 0.35)) 50%, rgb(var(--sun) / 0) 100%);
}
/* Faint fixed grain so dark gradients do not band. */
.sky-grain { background: url("grain.svg"); mix-blend-mode: overlay; }
.sky-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.sky-live .sky-gl { opacity: 1; }

@media (prefers-reduced-transparency: reduce) {
  .sky { display: none; }
  :root { --glass-alpha: 1; }
}

/* Glass. The tint alone carries the contrast; the blur is only looks. As the
   light passes dusk while scrolling, glass and ink change together. */
.glass {
  background: rgb(var(--glass) / var(--glass-alpha));
  border: 1px solid rgb(var(--edge));
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, 0 18px 48px -18px rgb(10 13 30 / 0.3);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  backdrop-filter: blur(28px) saturate(140%);
  transition: background-color 0.7s ease, border-color 0.7s ease, color 0.7s ease;
}
@media (prefers-reduced-transparency: reduce) {
  .glass { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
}
body, .chip, .button, .pill, .msg { transition: background-color 0.7s ease, color 0.7s ease; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) { .wrap { padding: 0 32px; } }

h1, h2, h3, p { margin: 0; }

/* Header: the mark and wordmark, and a way back to the form. */
.top {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
@media (min-width: 640px) { .top { top: 20px; left: 24px; right: 24px; } }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 4px 8px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font: 600 1.375rem/1 var(--serif);
  letter-spacing: -0.01em;
}
.brand img { width: 40px; height: 40px; display: block; }
.top-links { display: flex; gap: 8px; }
/* Phones keep one button; the form's fine print links to the requirements. */
@media (max-width: 479px) { .top-req { display: none; } }
.top-join, .top-req {
  padding: 10px 18px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

/* The clock: shown while the day plays, it counts the hours as you scroll. */
.clock {
  position: fixed;
  z-index: 10;
  bottom: 20px;
  left: 50%;
  translate: -50% 12px;
  padding: 8px 18px;
  border-radius: 999px;
  font: 500 1.25rem/1.2 var(--serif);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, translate 0.5s ease, background-color 0.7s ease, color 0.7s ease;
}
.clock.on { opacity: 1; translate: -50% 0; }

/* Hero: one glass card on a full screen of sky, and the bird beside it. */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding-top: 96px;
  padding-bottom: 88px;
}
.hero-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  border-radius: 32px;
  padding: 30px 22px 28px;
  text-align: center;
}
@media (min-width: 640px) { .hero-card { padding: 56px 56px 48px; } }
.eyebrow {
  margin-bottom: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(var(--ink-2));
}
h1 {
  font: 500 clamp(2.4rem, 1.3rem + 4.2vw, 4.25rem)/1.04 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1 > span { display: block; }
.nowrap { white-space: nowrap; }
.lead {
  margin: 20px auto 0;
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  line-height: 1.5;
  color: rgb(var(--ink-2));
  max-width: 32em;
  text-wrap: pretty;
}

/* The bird perches on the card on desktop. A CSS
   background, so phones never download it. */
.hero-bird { display: none; }
@media (min-width: 980px) {
  .hero-bird {
    display: block;
    position: absolute;
    z-index: 2;
    width: 230px;
    aspect-ratio: 1041 / 1049;
    /* Perched on the card's bottom edge, near the right: the body (70 %
       down the art, 46 % across) rests on the edge, the tail hangs below. */
    bottom: -66px;
    right: -56px;
    pointer-events: none;
  }
  .hero-bird > div {
    width: 100%;
    height: 100%;
    background: url("bird.webp") center / contain no-repeat;
    filter: drop-shadow(0 18px 24px rgb(20 16 40 / 0.25));
  }
}

.cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  padding: 9px 18px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}

/* The waitlist form. */
.join { margin: 32px auto 0; max-width: 520px; text-align: left; }
.join label { display: block; font-size: 0.9375rem; font-weight: 600; margin-bottom: 8px; }
.join-row { display: flex; flex-wrap: wrap; gap: 10px; }
.join input[type="email"] {
  flex: 1 1 15rem;
  min-width: 0;
  height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgb(var(--ink-2) / 0.55);
  background: rgb(var(--glass) / 0.85);
  color: rgb(var(--ink));
  font: inherit;
}
.button {
  flex: 0 0 auto;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  border: 0;
  background: rgb(var(--fill));
  color: rgb(var(--label));
  font: 600 1rem/50px var(--sans);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.button:hover { box-shadow: 0 0 0 4px rgb(var(--fill) / 0.45); }
.button[disabled] { cursor: progress; }
@media (max-width: 459px) { .join-row .button { flex: 1 1 100%; } }
.fine { margin-top: 12px; font-size: 0.9375rem; color: rgb(var(--ink-2)); }
.status:empty { display: none; }
.status { margin-top: 14px; font-weight: 600; }
.status.ok { font-size: 1.125rem; }

/* Honeypot: off screen for people, present for form-filling bots. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* A day with Wren: each moment holds the screen while the sky moves to its
   hour. Copy and window alternate sides on wide screens. */
.day { padding-bottom: 8vh; }
.moment {
  min-height: 92vh;
  min-height: 92svh;
  display: grid;
  gap: 18px;
  align-content: center;
  padding: 6vh 0;
}
@media (min-width: 880px) {
  .moment {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    gap: 48px;
    align-items: center;
  }
  .moment:nth-child(even of .moment) { grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); }
  .moment:nth-child(even of .moment) .moment-copy { order: 2; }
}
.moment-copy { border-radius: 24px; padding: 26px 22px 28px; }
@media (min-width: 640px) { .moment-copy { padding: 34px 34px 36px; } }
.when {
  font: 500 clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem)/1 var(--serif);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
}
.chip {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgb(var(--fill) / 0.75);
  color: rgb(var(--ink));
  font-size: 0.875rem;
  font-weight: 600;
}
[data-tone="dark"] .chip { background: rgb(var(--fill) / 0.1); }
.moment h3 { font: 600 clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem)/1.2 var(--serif); letter-spacing: -0.015em; }
.moment-copy > p:last-child { margin-top: 10px; color: rgb(var(--ink-2)); max-width: 30em; }

/* A Wren window, as the app draws a conversation. */
.window {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.5s cubic-bezier(.2, .7, .2, 1), background-color 0.7s ease, border-color 0.7s ease;
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--ink-2));
  border-bottom: 1px solid rgb(var(--ink-2) / 0.16);
}
.dots { display: inline-flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: rgb(var(--ink-2) / 0.28); }
.thread { display: grid; gap: 10px; padding: 18px 16px 20px; }
@media (min-width: 640px) { .thread { gap: 12px; padding: 28px 28px 32px; font-size: 1.125rem; } }
.msg {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.45;
}
.msg.wren {
  justify-self: start;
  background: rgb(var(--glass) / 0.75);
  border: 1px solid rgb(var(--edge));
  border-bottom-left-radius: 6px;
}
.msg.me {
  justify-self: end;
  background: rgb(var(--fill));
  color: rgb(var(--label));
  border-bottom-right-radius: 6px;
}
.msg.actions { padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgb(var(--fill));
  color: rgb(var(--label));
  font-weight: 600;
  font-size: 0.9375rem;
}
.pill.quiet { background: rgb(var(--glass) / 0.75); color: rgb(var(--ink)); border: 1px solid rgb(var(--ink-2) / 0.3); }
.msg.meta {
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--ink-2));
}
.meta-icon { width: 14px; height: 14px; flex: none; }

/* System requirements. */
.reqs { padding: 8vh 0 2vh; display: grid; justify-items: center; scroll-margin-top: 72px; }
.reqs-card {
  width: 100%;
  max-width: 760px;
  border-radius: 28px;
  padding: 30px 22px 28px;
}
@media (min-width: 640px) { .reqs-card { padding: 44px 48px 40px; } }
.reqs h2 { font: 500 clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem)/1.15 var(--serif); letter-spacing: -0.02em; }
.reqs-lead { margin-top: 10px; color: rgb(var(--ink-2)); max-width: 34em; }
.reqs-table { width: 100%; margin-top: 24px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.reqs-table th, .reqs-table td { padding: 12px 10px 12px 0; text-align: left; vertical-align: top; }
.reqs-table thead th { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(var(--ink-2)); }
.reqs-table tbody th { font-weight: 600; width: 26%; }
.reqs-table tbody tr { border-top: 1px solid rgb(var(--ink-2) / 0.22); }
/* The recommended column stands out. */
.reqs-table td:nth-child(3), .reqs-table thead th:nth-child(3) { font-weight: 700; color: rgb(var(--ink)); }
.reqs .fine { margin-top: 18px; }
.fine a { color: inherit; }

/* Closing line and footer. */
.closing {
  min-height: 70vh;
  display: grid;
  place-items: center;
}
.closing-card {
  width: 100%;
  max-width: 640px;
  border-radius: 28px;
  padding: 36px 24px;
  text-align: center;
}
@media (min-width: 640px) { .closing-card { padding: 48px 48px 44px; } }
.closing h2 { font: 500 clamp(2rem, 1.5rem + 2vw, 3rem)/1.1 var(--serif); letter-spacing: -0.02em; }
.closing p { margin: 12px 0 24px; color: rgb(var(--ink-2)); }

footer { padding: 8px 0 32px; text-align: center; }
.foot {
  display: inline-block;
  border-radius: 16px;
  padding: 10px 16px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgb(var(--ink-2));
}

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

/* Focus: an ink ring with a soft accent halo, readable on any glass. */
:focus-visible {
  outline: 2px solid rgb(var(--ink));
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgb(var(--fill) / 0.6);
}
input:focus-visible { outline-offset: 1px; }
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

/* Motion, only when the visitor has not asked for less. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .rise { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) both; }
  .cue.rise { animation-delay: 0.5s; }
  @keyframes rise { from { opacity: 0; translate: 0 18px; } }
  .cue.rise { animation-name: rise-cue; }
  @keyframes rise-cue { from { opacity: 0; translate: -50% 18px; } }

  /* The bird flies in and lands; perched, it keeps still. */
  .hero-bird { animation: arrive 1.8s cubic-bezier(.2, .7, .2, 1) 0.2s both; }
  @keyframes arrive { from { opacity: 0; translate: 120px -40px; rotate: 6deg; } }

  /* Conversations play in order once a moment scrolls into view. */
  .motion .moment-copy, .motion .window { opacity: 0; translate: 0 28px; transition: opacity 0.9s ease, translate 0.9s cubic-bezier(.2, .7, .2, 1), transform 0.5s cubic-bezier(.2, .7, .2, 1), background-color 0.7s ease; }
  .motion .window { transition-delay: 0.12s; }
  .motion .play .moment-copy, .motion .play .window { opacity: 1; translate: 0 0; }
  .motion .thread > * { opacity: 0; translate: 0 10px; transition: opacity 0.5s ease, translate 0.5s ease, background-color 0.7s ease, color 0.7s ease; }
  .motion .play .thread > * { opacity: 1; translate: 0 0; }
  .motion .play .thread > :nth-child(1) { transition-delay: 0.6s; }
  .motion .play .thread > :nth-child(2) { transition-delay: 1.5s; }
  .motion .play .thread > :nth-child(3) { transition-delay: 2.5s; }
}

@media (forced-colors: active) {
  .glass, .chip, .button, .pill, .msg, .join input[type="email"] { border: 1px solid CanvasText; }
  .sky { display: none; }
}
