:root {
  --cocoa: #492c26;
  --tomato: #db4e2f;
  --butter: #f4c453;
  --sage: #b8cdb0;
  --oat: #fff4df;

  --bg: var(--oat);
  --surface: #fffaf0;
  --band: var(--sage);
  --text: var(--cocoa);
  /* WCAG AA (4.5:1+) on oat, surface, butter and sage. */
  --text-soft: #634a42;
  /* Brand tomato is 3.9:1 on light surfaces, so tomato text uses this deeper shade. */
  --accent-ink: #9e351b;
  --line: color-mix(in srgb, var(--cocoa) 22%, transparent);
  --btn-bg: var(--cocoa);
  --btn-text: var(--oat);
  --map-bg: #f9e7c4;
  --grid-dot: color-mix(in srgb, var(--cocoa) 16%, transparent);
  --signup-bg: var(--cocoa);
  --signup-text: var(--oat);
  --signup-soft: #f1dfc6;

  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #3a231e;
    --surface: #593a33;
    --band: #33402f;
    --text: var(--oat);
    --text-soft: #e4d3bd;
    --accent-ink: #ff9a80;
    --line: color-mix(in srgb, var(--oat) 25%, transparent);
    --btn-bg: var(--butter);
    --btn-text: var(--cocoa);
    --map-bg: #4d3029;
    --grid-dot: color-mix(in srgb, var(--oat) 14%, transparent);
    --signup-bg: #593a33;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--btn-bg); color: var(--btn-text); padding: 10px 16px; border-radius: 999px; z-index: 10; }
.skip:focus { top: 12px; }

.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); }
.mono.small { font-size: 11.5px; }

/* Top bar */
.top { display: flex; justify-content: space-between; align-items: center; padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: 8px; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 32px; letter-spacing: -0.02em; text-decoration: none; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tomato); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-text);
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--btn-bg) 55%, #000);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 color-mix(in srgb, var(--btn-bg) 55%, #000); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--btn-bg) 55%, #000); }
.btn[disabled] { opacity: 0.7; cursor: progress; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 72px; }
.hero-copy { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
h1 { font-size: clamp(46px, 7vw, 84px); }
.h1-line { display: block; }
.rotator { display: inline-block; color: var(--accent-ink); }
#verb { display: inline-block; transition: transform 0.35s cubic-bezier(.3,1.6,.5,1), opacity 0.25s ease; }
#verb.out { transform: translateY(0.45em) rotate(-4deg); opacity: 0; }
.lead { font-size: 19px; color: var(--text-soft); max-width: 34ch; }
.lead strong { color: var(--text); }

.scene { margin: 0; position: relative; }
#map { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.12)); }
.map-bg { fill: var(--map-bg); }
.grid-dot { fill: var(--grid-dot); }
.arc { fill: none; stroke: var(--cocoa); stroke-width: 2.2; stroke-dasharray: 5 6; stroke-linecap: round; opacity: 0.75; }
@media (prefers-color-scheme: dark) { .arc { stroke: var(--oat); } }
.plane { fill: var(--tomato); }
.friend { transition: transform 0.9s cubic-bezier(.5,0,.2,1); }
.friend-ring { stroke: var(--surface); stroke-width: 3; }
.friend-init { font-family: var(--font-display); font-weight: 600; font-size: 13px; fill: var(--cocoa); text-anchor: middle; dominant-baseline: central; }
.friend-label { font-family: var(--font-mono); font-size: 10.5px; fill: var(--text); text-anchor: middle; }
.pin { transition: transform 0.9s cubic-bezier(.5,0,.2,1); }
.pin-flower { fill: var(--tomato); transform-origin: 0 0; animation: spin 14s linear infinite; }
.pin-halo { fill: var(--butter); opacity: 0.55; transform-origin: 0 0; animation: pulse 2.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.35); opacity: 0.2; } }

.result {
  position: relative; margin: -44px auto 0;
  width: min(88%, 360px);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px;
  padding: 14px 18px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease;
}
.result.fade { opacity: 0; }
.result-city { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.1; }
.result-why { font-size: 14.5px; color: var(--text-soft); line-height: 1.4; }

/* How it works */
.band { background: var(--band); padding: 96px 0 88px; margin-top: 24px; border-radius: 40px 40px 0 0; }
.band h2, .modes-sec h2 { font-size: clamp(32px, 4.4vw, 50px); margin-top: 10px; max-width: 18ch; }
.band .mono { color: var(--text); }
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--surface); border-radius: var(--radius); padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.steps h3 { font-size: 24px; }
.steps p { color: var(--text-soft); }
.num { width: 40px; height: 40px; border-radius: 50%; background: var(--butter); color: var(--cocoa); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 20px; }

/* Modes */
.modes-sec { padding-top: 88px; padding-bottom: 88px; }
.modes { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: minmax(150px, auto); gap: 16px; }
.mode { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: transform 0.2s ease; }
.mode:hover { transform: rotate(-1.2deg) translateY(-3px); }
.mode h3 { font-size: 30px; letter-spacing: 0.01em; }
.mode p { color: var(--text-soft); font-size: 15.5px; }
.mode-go { grid-row: span 2; background: var(--butter); border-color: transparent; color: var(--cocoa); justify-content: flex-end; position: relative; overflow: hidden; }
.mode-go h3 { font-size: clamp(64px, 9vw, 112px); line-height: 0.9; }
.mode-go p { color: var(--cocoa); font-size: 18px; max-width: 30ch; }
.mode-go::before { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: color-mix(in srgb, var(--tomato) 30%, transparent); }
.tag { align-self: flex-start; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: var(--cocoa); color: var(--oat); position: relative; }
.tag.soft { background: transparent; color: var(--text-soft); border: 1.5px solid var(--line); }

/* Signup */
#waitlist { scroll-margin-top: 24px; padding-bottom: 72px; }
.signup { background: var(--signup-bg); color: var(--signup-text); border-radius: 36px; padding: 64px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; position: relative; overflow: hidden; }
.signup h2 { font-size: clamp(34px, 5vw, 56px); }
.signup > p { color: var(--signup-soft); max-width: 46ch; }
.signup-flower { position: absolute; width: 180px; height: 180px; left: -50px; bottom: -60px; fill: var(--butter); opacity: 0.9; animation: spin 30s linear infinite; }
#form { width: 100%; max-width: 520px; margin-top: 12px; position: relative; }
.field { display: flex; gap: 10px; background: var(--oat); border-radius: 999px; padding: 6px; }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 18px; font: inherit; font-size: 17px; color: var(--cocoa); }
.field input::placeholder { color: #7a625a; }
.field input:focus { outline: none; }
.field:focus-within { outline: 3px solid var(--butter); outline-offset: 3px; }
.signup .btn { --btn-bg: var(--tomato); color: #fff; background: #b8401f; box-shadow: none; min-height: 48px; }
.signup .btn:hover, .signup .btn:active { box-shadow: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.msg { min-height: 1.5em; margin-top: 14px; color: var(--signup-text); font-weight: 500; }
.msg.err { color: #ffc9b8; }

/* Footer */
.foot { display: flex; align-items: center; gap: 10px; padding-bottom: calc(36px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--text-soft); flex-wrap: wrap; }
.foot-flower { fill: var(--tomato); }
.foot-dim { margin-left: auto; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 28px; padding-bottom: 80px; }
  .steps { grid-template-columns: 1fr; }
  .modes { grid-template-columns: 1fr 1fr; }
  .mode-go { grid-column: span 2; grid-row: auto; min-height: 260px; }
}
@media (max-width: 520px) {
  .wordmark { font-size: 28px; }
  .band { padding: 72px 0 64px; border-radius: 28px 28px 0 0; }
  .signup { padding: 48px 20px 56px; border-radius: 28px; }
  .field { flex-direction: column; background: transparent; padding: 0; gap: 12px; }
  .field input { background: var(--oat); border-radius: 999px; min-height: 52px; }
  .field:focus-within { outline: none; }
  .field input:focus-visible { outline: 3px solid var(--butter); outline-offset: 3px; }
  .signup .btn { width: 100%; min-height: 52px; }
  .foot-dim { margin-left: 0; width: 100%; }
}

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