/* Zibble teaser. Built on Prateek's design system:
   Apple-style restraint and negative space; the name shown once per screen;
   golden-ratio spacing (8 13 21 34 55 89) and type (16 26 42 68; the wordmark is a logo, sized on the same ratio);
   concentric radii (inner = outer minus padding, border counted, floor half the outer);
   solid surfaces under text, a soft floor shadow, three elevations;
   graphite dark mode from tokens that follow the device; AA contrast in both modes;
   motion with springs, rubber-banding, staged focus and a pulse to confirm, all off under reduced motion.
   Art direction: one ink, one paper, one orange dot. The name is a toy you can push around.
   System fonts, no third-party anything, no inline styles (the CSP in _headers forbids them). Mobile first. */
:root {
  --s1: 8px; --s2: 13px; --s3: 21px; --s4: 34px; --s5: 55px; --s6: 89px;
  --t1: 16px; --t2: 26px; --t3: 42px; --t4: 68px; --t-small: 13px;
  --r-pill: 34px; --r-pill-in: 28px; /* 34 minus 5 padding minus 1 border */
  --r-md: 21px; --r-box: 6px;

  --paper: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #55565c;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.24);
  --dot: #ff8a00;
  --dot-shade: #e06a00;
  --on-ink: #f5f5f7;
  --warn: #b3261e;
  --rim: rgba(255, 255, 255, 0.95);
  --floor: rgba(0, 0, 0, 0.16);
  --ring: rgba(29, 29, 31, 0.22);
  --e1: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.05);
  --e2: 0 2px 5px rgba(0, 0, 0, 0.04), 0 8px 21px rgba(0, 0, 0, 0.07);
  --e3: 0 5px 13px rgba(0, 0, 0, 0.05), 0 21px 55px rgba(0, 0, 0, 0.1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter Display", Inter, "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1d21; --surface: #26272c; --ink: #ececf0; --ink-soft: #a6a8b0;
    --line: rgba(255, 255, 255, 0.1); --line-strong: rgba(255, 255, 255, 0.28);
    --dot: #ff9a1f; --dot-shade: #e67a00; --on-ink: #1c1d21; --warn: #ff9b91;
    --rim: rgba(255, 255, 255, 0.07); --floor: rgba(0, 0, 0, 0.5); --ring: rgba(236, 236, 240, 0.28);
    --e1: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
    --e2: 0 2px 5px rgba(0, 0, 0, 0.25), 0 8px 21px rgba(0, 0, 0, 0.3);
    --e3: 0 5px 13px rgba(0, 0, 0, 0.3), 0 21px 55px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1c1d21; --surface: #26272c; --ink: #ececf0; --ink-soft: #a6a8b0;
  --line: rgba(255, 255, 255, 0.1); --line-strong: rgba(255, 255, 255, 0.28);
  --dot: #ff9a1f; --dot-shade: #e67a00; --on-ink: #1c1d21; --warn: #ff9b91;
  --rim: rgba(255, 255, 255, 0.07); --floor: rgba(0, 0, 0, 0.5); --ring: rgba(236, 236, 240, 0.28);
  --e1: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
  --e2: 0 2px 5px rgba(0, 0, 0, 0.25), 0 8px 21px rgba(0, 0, 0, 0.3);
  --e3: 0 5px 13px rgba(0, 0, 0, 0.3), 0 21px 55px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
a { color: var(--ink); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Film grain over flat paper: texture you feel more than see. */
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: url("noise.png") repeat; background-size: 160px 160px;
  opacity: 0.05; mix-blend-mode: overlay;
}

/* ---------- The teaser ---------- */
.teaser { display: grid; grid-template-rows: 1fr auto; min-height: 100vh; min-height: 100svh; overflow-x: hidden; }
.stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: var(--s5) var(--s3) var(--s4);
  padding-left: max(var(--s3), env(safe-area-inset-left));
  padding-right: max(var(--s3), env(safe-area-inset-right));
}

/* The wordmark: heavy, tight, physical. Each letter is its own body you can push. */
.mark {
  position: relative; z-index: 1; display: flex; margin: 0;
  font-family: var(--f-display);
  font-size: clamp(89px, min(27vw, 33vh), 288px);
  font-weight: 800; letter-spacing: -0.055em; line-height: 0.9;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.ch { position: relative; display: inline-block; transform-origin: 50% 100%; touch-action: none; }
.js .ch { cursor: grab; }
.js .ch:active { cursor: grabbing; }

/* The dot on the i is the idea: a real orange ball. */
.ch-i { padding: 0 0.01em; margin-left: 0.02em; }
.probe { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.ball {
  position: absolute; left: 50%; top: 0.04em; /* refined by placeDot() in app.js */
  width: 0.205em; height: 0.205em; margin-left: -0.1025em;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: inset 0 -0.012em 0 rgba(0, 0, 0, 0.08);
  transform-origin: 50% 100%; touch-action: none;
}
.js .ball { cursor: grab; }
.js .ball:active { cursor: grabbing; }

/* Soft floor shadow the name stands on. */
.floor {
  width: min(78vw, 820px); height: 21px; margin-top: -8px;
  background: radial-gradient(closest-side, var(--floor), transparent);
  opacity: 0.4;
}
.nudge { margin: var(--s1) 0 0; font-size: var(--t-small); color: var(--ink-soft); }
.nudge[hidden] { display: none; }

.line {
  margin: var(--s4) 0 0;
  font-size: var(--t2); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25;
}
.w { display: inline-block; }
.when {
  margin: var(--s2) 0 0;
  font-size: var(--t-small); font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* The one action. It starts as a single quiet button and opens into the email field. */
.join-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 440px; margin-top: var(--s5); }
.ask {
  height: 55px; padding: 0 var(--s4);
  border: 0; border-radius: var(--r-pill);
  background: var(--ink); color: var(--on-ink);
  font: inherit; font-size: var(--t1); font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: var(--e2);
  transition: transform 0.35s var(--spring);
}
.ask:hover { transform: scale(1.04); }
.ask:active { transform: scale(0.95); }
.ask[hidden] { display: none; }
.join { position: relative; width: 100%; }
.join[hidden] { display: none; }
.pill {
  display: flex; align-items: center; gap: var(--s1);
  padding: 5px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--rim), var(--e3);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.pill:focus-within { border-color: var(--line-strong); box-shadow: inset 0 1px 0 var(--rim), 0 0 0 4px var(--ring), var(--e3); }
.pill input {
  flex: 1; min-width: 0; height: 55px; padding: 0 var(--s2) 0 var(--s3);
  border: 0; border-radius: var(--r-pill-in); background: transparent;
  color: var(--ink); font: inherit; font-size: var(--t1);
}
.pill input::placeholder { color: var(--ink-soft); opacity: 1; }
.pill input:focus { outline: none; }
.go {
  flex: none; height: 55px; padding: 0 var(--s4);
  border: 0; border-radius: var(--r-pill-in);
  background: var(--ink); color: var(--on-ink);
  font: inherit; font-size: var(--t1); font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.35s var(--spring), opacity 0.2s var(--ease);
}
.go:hover { transform: scale(1.04); }
.go:active { transform: scale(0.95); }
.go[disabled] { cursor: progress; opacity: 0.7; transform: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent {
  position: relative; display: flex; align-items: center; justify-content: center; gap: var(--s1);
  min-height: 44px; margin-top: var(--s2); padding: 0 var(--s1);
  font-size: var(--t-small); line-height: 1.45; color: var(--ink-soft); text-align: left; cursor: pointer;
}
.consent input { position: absolute; opacity: 0; width: 21px; height: 21px; margin: 0; left: var(--s1); cursor: pointer; }
.consent .box {
  flex: none; position: relative; width: 21px; height: 21px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-box); background: var(--surface);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.35s var(--spring);
}
.consent .box::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid var(--on-ink); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 0.3s var(--spring);
}
.consent input:checked + .box { background: var(--ink); border-color: var(--ink); transform: scale(1.06); }
.consent input:checked + .box::after { transform: rotate(45deg) scale(1); }
.consent input:focus-visible + .box { outline: 3px solid var(--ring); outline-offset: 2px; }
.consent a { color: var(--ink-soft); font-weight: 600; }

.msg { margin: var(--s1) 0 0; font-size: var(--t-small); color: var(--warn); }
.msg[hidden] { display: none; }

/* After joining, the same space turns into the confirmation. */
.done { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s1) 0; outline: none; }
.done[hidden] { display: none; }
.done-title { margin: 0; font-size: var(--t2); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.done-sub { margin: 0; color: var(--ink-soft); }

.foot {
  display: flex; justify-content: center; gap: var(--s3);
  padding: var(--s3) var(--s3) max(var(--s3), env(safe-area-inset-bottom));
  font-size: var(--t-small); color: var(--ink-soft);
}
.foot a { display: inline-flex; align-items: center; min-height: 44px; margin: -13px 0; color: var(--ink-soft); }

@media (min-width: 768px) {
  .line { font-size: var(--t3); }
  .stage { padding-top: var(--s6); }
}
@media (max-height: 620px) and (orientation: landscape) {
  .mark { font-size: clamp(68px, 22vh, 160px); }
  .line { margin-top: var(--s3); }
  .join-wrap { margin-top: var(--s4); }
}

/* Opening sequence: hidden only while the animation script is running it (see boot.js). */
.motion .mark .ch, .motion .ball, .motion .line .w, .motion .when, .motion .join-wrap, .motion .foot, .motion .floor { opacity: 0; }

/* ---------- Plain pages: privacy, thanks, not found ---------- */
.page { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100svh; }
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  max-width: 720px; width: 100%; margin: 0 auto; padding: var(--s2) var(--s3);
}
.bar .name {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--f-display); font-size: var(--t2); font-weight: 800; letter-spacing: -0.05em;
  color: var(--ink); text-decoration: none;
}
.bar .cta { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.sheet { max-width: 720px; width: 100%; margin: 0 auto; padding: var(--s4) var(--s3) var(--s5); }
.paper {
  padding: var(--s4) var(--s3);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); box-shadow: inset 0 1px 0 var(--rim), var(--e2);
}
.sheet h1 { margin: 0 0 var(--s2); font-size: var(--t2); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.sheet h2 { margin: var(--s4) 0 var(--s1); font-size: var(--t1); font-weight: 700; letter-spacing: -0.005em; }
.sheet ul { padding-left: var(--s3); }
.sheet li + li { margin-top: var(--s1); }
.muted { color: var(--ink-soft); font-size: var(--t-small); }
.center { text-align: center; }
.dot-solo {
  display: block; width: 34px; height: 34px; margin: 0 auto var(--s3); border-radius: 50%;
  background: var(--dot);
}
.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: var(--s3); font-weight: 600; }
@media (min-width: 768px) {
  .sheet h1 { font-size: var(--t3); }
  .paper { padding: var(--s5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
