/* Tokens from brand/tokens.json */
:root {
  --bg: #FBF6ED;
  --text: #2B1A0E;
  --muted: #74675C;
  --card: #FFFFFF;
  --peach: #FFF3DB;
  --line: #E9DFCF;
  --track: #EDDFC6;
  --accent-text: #B94708;
  --fill: #CC4C08;
  --ember: #E8590C;
  --mango: #FFAF1E;
  --leaf: #7C9A5C;
  --leaf-text: #4C6B33;
  --panel: #2B1A0E;
  --panel-text: #FBF6ED;
  --glow: #FFDEA1;
  --shadow: 0 10px 30px rgba(43, 26, 14, .10);
  --serif: 'Young Serif', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1080px;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 3px; border-radius: 6px; }

html[data-mode="founding"] .only-waitlist,
html[data-mode="waitlist"] .only-founding { display: none !important; }
[hidden], .only-elsewhere, .only-open { display: none !important; }
.elsewhere .only-elsewhere, .full .only-elsewhere, .open-city .only-open { display: inline !important; }
.full .only-founding, .full .only-waitlist,
.elsewhere .only-founding, .elsewhere .only-waitlist,
.open-city .only-founding, .open-city .only-waitlist { display: none !important; }

.skip { position: absolute; left: 16px; top: -60px; background: var(--card); padding: 10px 16px; border-radius: 12px; z-index: 10; }
.skip:focus { top: 16px; }

/* Buttons: white on emberFill */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--fill); color: #fff;
  font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 22px rgba(204, 76, 8, .28);
  transition: transform .15s ease, background-color .15s ease;
  touch-action: manipulation;
}
.btn:hover { background: #B94708; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: var(--fill); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; box-shadow: none; }
.btn-lg { min-height: 56px; padding: 0 34px; font-size: 17px; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 20px var(--gutter);
}
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font: 26px/1 var(--serif); }
.top nav { display: flex; align-items: center; gap: 28px; }
.top nav a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; }
.top nav a:not(.btn):hover { color: var(--accent-text); }
@media (max-width: 640px) {
  .top nav a:not(.btn) { display: none; }
}

/* Hero */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 40px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(32px, 7vw, 88px) var(--gutter) clamp(56px, 9vw, 120px);
}
.hero::before {
  content: ""; position: absolute; inset: -120px calc(50% - 50vw) 0; z-index: -1;
  background: radial-gradient(50% 60% at 70% 30%, var(--glow), transparent 70%);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 999px; padding: 8px 16px;
  font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow);
}
.invited { margin: 22px 0 -10px; font: 19px/1.3 var(--serif); color: var(--accent-text); text-wrap: balance; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--leaf); box-shadow: 0 0 0 0 var(--leaf); }
.hero h1 { font-size: clamp(34px, 10.5vw, 52px); line-height: 1.04; margin: 26px 0 22px; }
.hero h1 span { display: inline-block; }
@media (min-width: 480px) { .hero h1 span { white-space: nowrap; } }
@media (min-width: 821px) { .hero h1 { font-size: clamp(52px, 6vw, 76px); } }
.lede { font-size: clamp(18px, 1.7vw, 20px); color: var(--muted); max-width: 30em; margin-bottom: 34px; text-wrap: pretty; }
.hint { margin-top: 14px; font-size: 15px; color: var(--muted); text-wrap: balance; }

.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; justify-self: center; }
.big-mango { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 30px 40px rgba(204, 76, 8, .22)); }
.big-mango .leaf { transform-box: fill-box; }
.prompt {
  position: absolute; width: min(250px, 62%);
  background: var(--card); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow);
}
.prompt .q { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prompt .a { font: 17px/1.35 var(--serif); margin-top: 6px; }
.p1 { right: -12%; bottom: -2%; rotate: 4deg; }
.p2 { left: -12%; top: 36%; rotate: -5deg; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-art { max-width: 300px; margin-top: 8px; }
  .prompt { text-align: left; }
  .prompt { width: 210px; padding: 13px 15px; }
  .prompt .a { font-size: 15px; }
  .p1 { display: none; }
  .p2 { left: -8%; top: auto; bottom: 2%; }
}

/* Sections */
section:not(.hero) { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(44px, 6vw, 80px) var(--gutter); }
h2 { font-size: clamp(34px, 4.6vw, 52px); }
.sub { color: var(--muted); font-size: 18px; margin-top: 14px; max-width: 34em; }

.intent ul { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px; }
.intent li { border-top: 3px solid var(--mango); padding-top: 20px; }
.intent li:nth-child(2) { border-color: var(--ember); }
.intent li:nth-child(3) { border-color: var(--leaf); }
.intent li:nth-child(4) { border-color: var(--text); }
.intent h3 { font-size: 23px; margin-bottom: 10px; }
.intent p { color: var(--muted); }
@media (max-width: 900px) { .intent ul { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .intent ul { grid-template-columns: 1fr; gap: 28px; } }

/* Founding perks, just above the sign-up box */
.perks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 56px; }
.perks-h { grid-column: 1 / -1; font: 600 15px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.perk { background: var(--peach); border: 2px solid var(--ember); border-radius: 24px; padding: 28px; }
.perk h4 { font: clamp(24px, 2.6vw, 30px)/1.15 var(--serif); margin: 0 0 10px; }
.perk p { color: var(--muted); font-size: 17px; }
@media (max-width: 640px) { .perks { grid-template-columns: 1fr; } }

/* City board */
.board { list-style: none; padding: 0; margin: 44px 0 0; border-top: 1px solid var(--line); }
.board li { border-bottom: 1px solid var(--line); }
.board button {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 7.5em; align-items: center; gap: 24px;
  padding: 18px 12px; border-radius: 14px;
  transition: background-color .2s ease;
}
.board button:hover { background: var(--peach); }
.board button:focus-visible { outline: 3px solid var(--mango); outline-offset: -3px; }
.board button[aria-pressed="true"] { background: var(--peach); box-shadow: inset 0 0 0 2px var(--ember); }
.board .name { font: clamp(22px, 2.6vw, 30px)/1.15 var(--serif); }
.meter { display: block; height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
/* Bars ripen with the stage: green when planted, mango when growing, ember when almost ripe */
.meter i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--leaf), var(--mango)); }
.board button:has(.planted) .meter i { background: var(--leaf); }
.board button:has(.soon) .meter i, .board button:has(.open) .meter i { background: linear-gradient(90deg, var(--mango), var(--ember)); }
.stage { font-size: 15px; font-weight: 600; color: var(--muted); text-align: right; }
.stage.soon { color: var(--accent-text); }
.stage.open { color: var(--leaf-text); }
@media (max-width: 640px) {
  .board button { grid-template-columns: 1fr auto; gap: 10px 16px; padding: 16px 8px; }
  .board .meter { grid-column: 1 / -1; grid-row: 2; }
  .board .name { font-size: 22px; }
}

/* Sign-up */
.join {
  margin-top: 40px; background: var(--panel); color: var(--panel-text);
  border-radius: 28px; padding: clamp(22px, 3.4vw, 36px);
  view-transition-name: join;
}
.join .badge { margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; align-items: end; }
.fields label { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.fields input, .fields select {
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: 14px;
  border: 1.5px solid rgba(251, 246, 237, .28); background: rgba(251, 246, 237, .08);
  color: var(--panel-text); font: 500 16px var(--sans);
}
.fields select { appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23FBF6ED' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; }
.fields select option { color: #2B1A0E; background: #FBF6ED; }
.fields input::placeholder { color: rgba(251, 246, 237, .6); }
.fields input:focus-visible, .fields select:focus-visible { outline: 3px solid var(--mango); outline-offset: 1px; border-color: transparent; }
.error { color: #FFC9A8; font-weight: 600; margin-top: 12px; }
.error:empty { display: none; }
.joined { display: none; outline: none; }
.joined h3 { font-size: clamp(28px, 3.4vw, 36px); }
.joined-line, .joined .ask { margin-top: 8px; color: rgba(251, 246, 237, .8); max-width: 36em; }
.joined .ask { margin-top: 24px; }
.join fieldset { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
.join legend { font-size: 14px; font-weight: 600; margin-bottom: 10px; padding: 0; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.submit-row .btn { min-height: 52px; }
.spots { font-weight: 600; color: var(--mango); }
.spots:empty { display: none; }
.turnstile:not(:empty) { margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(251, 246, 237, .28); font-weight: 600; font-size: 15px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chips span:hover { border-color: rgba(251, 246, 237, .6); }
.chips input:checked + span { background: var(--mango); border-color: var(--mango); color: #2B1A0E; }
.chips input:focus-visible + span { outline: 3px solid var(--mango); outline-offset: 2px; }
.joined .actions { display: flex; align-items: center; gap: 20px; margin-top: 24px; }
.skip { all: unset; padding: 6px 0; cursor: pointer; font-weight: 600; color: rgba(251, 246, 237, .8); text-decoration: underline; text-underline-offset: 3px; }
.skip:hover { color: var(--panel-text); }
.skip:focus-visible { outline: 3px solid var(--mango); outline-offset: 3px; border-radius: 6px; }
.join.done form { display: none; }
.join.done .joined { display: block; }
.fields:has(.suggest:not([hidden])) { grid-template-columns: 1.3fr 1fr 1fr; }
@media (max-width: 760px) { .fields, .fields:has(.suggest:not([hidden])) { grid-template-columns: 1fr; } }

.badge {
  display: inline-block; background: var(--mango); color: #2B1A0E;
  border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 700;
}
.badge.plain { background: var(--line); color: var(--text); }

/* Pricing */
/* One per row on phones and tablets; side by side, as many as are shown, on wider screens. */
.plans { display: grid; gap: 20px; margin-top: 44px; }
@media (min-width: 1040px) { .plans { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } .plans .price { font-size: 44px; } }
.plan { background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.plan.founding { background: var(--peach); border-color: var(--ember); }
.price { font: clamp(40px, 5vw, 52px)/1 var(--serif); margin: 22px 0 6px; font-variant-numeric: lining-nums tabular-nums; }
.price small { font: 500 18px var(--sans); color: var(--muted); margin-left: 2px; }
.alt { color: var(--muted); font-weight: 500; margin-bottom: 16px; }
.price + p:not(.alt) { margin-top: 16px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); max-width: 760px; }
.faq details:first-of-type { margin-top: 36px; border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; font-size: 19px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; translate: 0 -50%; font: 28px/1 var(--serif); color: var(--accent-text); transition: rotate .2s ease; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 36em; }

/* Footer */
footer { background: #2B1A0E; color: #FBF6ED; padding: 48px var(--gutter); text-align: center; display: grid; gap: 10px; justify-items: center; }
footer .logo { color: #FBF6ED; font-size: 22px; }
footer .small { font-size: 14px; color: #ABA69E; }
footer .small a { color: inherit; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  /* One load sequence: headline, copy, mango, then the prompts */
  .hero-copy > :not(h1), .hero h1 span, .big-mango, .prompt { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero h1 span:nth-child(2) { animation-delay: .12s; }
  .lede { animation-delay: .24s; }
  .hero-copy .btn, .hint { animation-delay: .34s; }
  .big-mango { animation: grow 1.1s cubic-bezier(.2, .8, .2, 1.15) .15s both, sway 7s ease-in-out 1.3s infinite; transform-origin: 60% 15%; }
  .big-mango .leaf { animation: flutter 3.5s ease-in-out 1.3s infinite; transform-origin: 0% 100%; }
  .p1 { animation: rise .9s cubic-bezier(.2, .7, .2, 1) .55s both, bob 6s ease-in-out 1.5s infinite; }
  .p2 { animation: rise .9s cubic-bezier(.2, .7, .2, 1) .7s both, bob 6s ease-in-out 3s infinite; }
  .dot { animation: ping 2.4s ease-out 1.2s infinite; }

  @keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
  @keyframes grow { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
  @keyframes sway { 50% { transform: rotate(3deg); } }
  @keyframes flutter { 50% { transform: rotate(-9deg); } }
  @keyframes bob { 50% { translate: 0 -8px; } }
  @keyframes ping { 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

  /* Meters ripen as they scroll into view */
  @supports (animation-timeline: view()) {
    .meter i { animation: ripen linear both; animation-timeline: view(); animation-range: entry 10% cover 40%; }
    @keyframes ripen { from { width: 4%; } }
  }

  ::view-transition-old(join), ::view-transition-new(join) { animation-duration: .35s; }
}

/* Confirmation page (/confirm) */
.confirm { max-width: 620px; margin: 0 auto; padding: clamp(32px, 8vw, 96px) var(--gutter) 96px; text-align: center; }
.confirm-mango { width: 96px; height: 96px; margin-bottom: 28px; filter: drop-shadow(0 14px 20px rgba(204, 76, 8, .2)); }
.confirm h1 { font-size: clamp(34px, 5vw, 48px); }
.confirm p { color: var(--muted); font-size: 18px; margin: 18px auto 32px; max-width: 30em; text-wrap: pretty; }
@media (prefers-reduced-motion: no-preference) {
  .confirm > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .confirm h1 { animation-delay: .1s; }
  .confirm p { animation-delay: .2s; }
  .confirm .btn { animation-delay: .3s; }
}
