/* DownScene — site styles. One quiet page: the logo, one sentence, the launch list. Inter only, one blue, no ornaments.
   No inline styles anywhere (the CSP forbids them): everything visual lives here. */

/* ---------- font (self-hosted, SIL OFL; no third-party requests) ---------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #0e1013;
  --line: #262b33;
  --ink: #c9cfd7;
  --ink-dim: #8a929e;
  --ink-faint: #6c7480;
  --paper: #f3f5f8;
  --accent: #3b7bf0;
  --accent-hover: #4a88f7;
  --accent-bright: #6aa1ff;
  --ok: #3ed598;
  --error: #ff6b78;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.home { grid-template-rows: 1fr auto; }

/* one soft pool of blue light behind the logo, breathing slowly */
body::before {
  content: "";
  position: fixed;
  left: 50%;
  top: 40%;
  z-index: 0;
  width: min(1200px, 170vw);
  aspect-ratio: 16 / 10;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(59, 123, 240, .16), rgba(59, 123, 240, .05) 52%, transparent 74%);
  animation: breathe 11s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .6; transform: translate(-50%, -50%) scale(1.05); } }
/* a whisper of grain, so the dark reads as material rather than a flat screen */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(59, 123, 240, .45); color: var(--paper); }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- the wordmark ---------- */
.wordmark { display: block; height: auto; overflow: visible; color: var(--paper); }
.wordmark .wm-signal { stroke: var(--accent-bright); opacity: 0; }
.wordmark .wm-signal > * { stroke-dasharray: 18 182; stroke-dashoffset: 18; }

/* home: the letters draw themselves once, then the logo keeps beating: every 3.6 s a pulse of light runs through the
   letters (the official hover motion, slowed down) and the mark gives a small heartbeat */
.home .mark { margin: 0 0 clamp(40px, 7vh, 64px); line-height: 0; }
.home .mark .wordmark { width: clamp(250px, 46vw, 600px); transform-origin: 50% 50%; animation: beat 3.6s ease-in-out 2.1s infinite; }
.home .mark .wm-letters > * { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.4s var(--ease) forwards; }
.home .mark .wm-signal { opacity: 1; filter: drop-shadow(0 0 5px rgba(106, 161, 255, .85)); }
.home .mark .wm-signal > * { animation: pulse 3.6s linear infinite; }
.home .mark .wm-letters > :nth-child(1) { animation-delay: .10s; }
.home .mark .wm-letters > :nth-child(2) { animation-delay: .17s; }
.home .mark .wm-letters > :nth-child(3) { animation-delay: .24s; }
.home .mark .wm-letters > :nth-child(4) { animation-delay: .31s; }
.home .mark .wm-letters > :nth-child(5) { animation-delay: .38s; }
.home .mark .wm-letters > :nth-child(6) { animation-delay: .45s; }
.home .mark .wm-letters > :nth-child(7) { animation-delay: .52s; }
.home .mark .wm-letters > :nth-child(8) { animation-delay: .59s; }
.home .mark .wm-letters > :nth-child(9) { animation-delay: .66s; }
.home .mark .wm-signal > :nth-child(1) { animation-delay: 2.10s; }
.home .mark .wm-signal > :nth-child(2) { animation-delay: 2.21s; }
.home .mark .wm-signal > :nth-child(3) { animation-delay: 2.32s; }
.home .mark .wm-signal > :nth-child(4) { animation-delay: 2.43s; }
.home .mark .wm-signal > :nth-child(5) { animation-delay: 2.54s; }
.home .mark .wm-signal > :nth-child(6) { animation-delay: 2.65s; }
.home .mark .wm-signal > :nth-child(7) { animation-delay: 2.76s; }
.home .mark .wm-signal > :nth-child(8) { animation-delay: 2.87s; }
.home .mark .wm-signal > :nth-child(9) { animation-delay: 2.98s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse {
  0% { stroke-dashoffset: 18; }
  30% { stroke-dashoffset: -100; }
  100% { stroke-dashoffset: -100; }
}
@keyframes beat {
  0%, 22%, 100% { transform: scale(1); }
  5% { transform: scale(1.022); }
  10% { transform: scale(.994); }
  15% { transform: scale(1.01); }
}

/* small wordmark on the other pages: the same heartbeat on hover */
.brand { display: inline-block; padding: 6px 0; color: var(--paper); }
.brand .wordmark { width: 132px; }
.brand:hover .wm-signal, .brand:focus-visible .wm-signal { opacity: 1; }
.brand:hover .wm-signal > *, .brand:focus-visible .wm-signal > * { animation: sweep 1.1s linear infinite; }
.brand .wm-signal > :nth-child(2) { animation-delay: .11s; }
.brand .wm-signal > :nth-child(3) { animation-delay: .22s; }
.brand .wm-signal > :nth-child(4) { animation-delay: .33s; }
.brand .wm-signal > :nth-child(5) { animation-delay: .44s; }
.brand .wm-signal > :nth-child(6) { animation-delay: .55s; }
.brand .wm-signal > :nth-child(7) { animation-delay: .66s; }
.brand .wm-signal > :nth-child(8) { animation-delay: .77s; }
.brand .wm-signal > :nth-child(9) { animation-delay: .88s; }
@keyframes sweep { from { stroke-dashoffset: 18; } to { stroke-dashoffset: -100; } }

/* ---------- home ---------- */
.stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: clamp(64px, 12vh, 140px) 24px clamp(40px, 8vh, 80px);
  text-align: center;
}
.headline {
  margin: 0;
  font-size: clamp(27px, 3.5vw, 42px);
  line-height: 1.12;
  letter-spacing: -.024em;
  font-weight: 600;
  color: var(--paper);
  text-wrap: balance;
}
.lead {
  max-width: 31em;
  margin: 16px 0 0;
  font-size: clamp(16px, 1.25vw, 18px);
  color: var(--ink-dim);
  text-wrap: pretty;
}

/* ---------- the launch-list form ---------- */
.signup {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 460px;
  margin-top: clamp(32px, 5vh, 44px);
}
.field {
  flex: 1 1 220px;
  min-width: 0;
  height: 50px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 10, 13, .55);
  color: var(--paper);
  font: 400 16px/1 var(--font);
  transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: var(--ink-faint); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(59, 123, 240, .2); }
.btn {
  flex: 0 0 auto;
  height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 15px/1 var(--font);
  cursor: pointer;
  box-shadow: 0 10px 26px -12px rgba(59, 123, 240, .9);
  transition: background-color .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; cursor: progress; }
.form-status { flex-basis: 100%; min-height: 1.4em; margin: 2px 0 0; font-size: 14px; color: var(--ink-dim); }
.form-status.is-error { color: var(--error); }
.form-status:empty { display: none; }   /* no empty row under the field until there is something to say */
.signup.is-done .field, .signup.is-done .btn { display: none; }
.signup.is-done .form-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  margin: 0;
  padding: 0 22px;
  border: 1px solid rgba(62, 213, 152, .32);
  border-radius: 999px;
  background: rgba(62, 213, 152, .07);
  color: var(--paper);
  font-size: 15px;
}
.signup.is-done .form-status::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px rgba(62, 213, 152, .9);
}
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin: 16px 0 0; font-size: 14px; color: var(--ink-faint); }

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 22px clamp(20px, 4vw, 40px) calc(22px + env(safe-area-inset-bottom));
  font-size: 13.5px;
  color: var(--ink-faint);
}
.foot nav { display: flex; gap: 22px; }
.foot a { color: var(--ink-dim); }
.foot a:hover { color: var(--paper); }

/* ---------- other pages (privacy, 404) ---------- */
.top { position: relative; z-index: 1; padding: 22px clamp(20px, 4vw, 40px); }
.doc { position: relative; z-index: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(32px, 7vh, 72px) 24px 24px; }
.doc h1 { margin: 0 0 10px; font-size: clamp(36px, 5vw, 56px); line-height: 1.04; letter-spacing: -.034em; font-weight: 640; color: var(--paper); }
.doc .updated { margin: 0; font-size: 14px; color: var(--ink-faint); }
.doc h2 { margin: 48px 0 12px; font-size: 22px; letter-spacing: -.016em; font-weight: 620; color: var(--paper); }
.doc p, .doc li { font-size: 16.5px; line-height: 1.7; color: var(--ink); }
.doc p { margin: 0; text-wrap: pretty; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.doc .summary { margin-top: 32px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 14px; background: rgba(20, 23, 28, .7); }
.doc .summary ul { margin: 0; }
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; }
.doc table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14.5px; }
.doc th, .doc td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid #1d2128; }
.doc tr:last-child td { border-bottom: 0; }
.doc th { font-size: 13px; font-weight: 600; color: var(--ink-dim); background: rgba(20, 23, 28, .9); }
.doc td { color: var(--ink); }

.lost { position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 14px; padding: 40px 24px; text-align: center; }
.lost h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -.026em; font-weight: 600; color: var(--paper); }
.lost p { max-width: 30em; margin: 0; color: var(--ink-dim); }
.lost .btn { display: inline-flex; align-items: center; margin-top: 14px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .home .mark .wm-letters > * { stroke-dashoffset: 0; }
  .home .mark .wm-signal { opacity: 0; }
}

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .signup .field, .signup .btn { flex: 1 1 100%; }
  .foot { justify-content: center; text-align: center; }
}
