:root {
  --tomato: #A61D1C;
  --tomato-dark: #7E1716;
  --aubergine: #F4EAD7;
  --cream: #F4EAD7;
  --paper: #24211F;
  --sage: #A61D1C;
  --ink-soft: #BDB3A5;
  --line: #514A45;
  --wine: #561111;
  --brown-dark: #321A0F;
  --white: #F4EAD7;
  --canvas: #171615;
  --surface: #24211F;
  --surface-raised: #2E2A27;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--aubergine); background: var(--canvas); font: 16px/1.55 "Nunito", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(233, 75, 53, .35); outline-offset: 2px; }
[hidden] { display: none !important; }

.grain { position: fixed; inset: 0; pointer-events: none; opacity: .28; z-index: -1; background-image: radial-gradient(circle at 72% 18%, rgba(86,17,17,.28), transparent 34%), url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E"); }
.topbar { width: min(1200px, calc(100% - 40px)); height: 88px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: block; width: 120px; height: 62px; overflow: hidden; }
.brand img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.55); filter: brightness(0) saturate(100%) invert(92%) sepia(16%) saturate(453%) hue-rotate(342deg) brightness(104%); }
.text-button { border: 0; background: none; color: var(--aubergine); font-weight: 700; padding: 10px; text-decoration: underline; text-decoration-color: var(--sage); text-decoration-thickness: 3px; text-underline-offset: 5px; }

main { width: min(1200px, calc(100% - 40px)); margin: 0 auto 60px; }
.welcome { min-height: calc(100vh - 148px); display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 8vw; }
.eyebrow { margin: 0 0 14px; color: var(--cream); opacity: .72; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { font-family: "Anton", sans-serif; font-weight: 400; letter-spacing: -.025em; line-height: .95; text-transform: uppercase; }
h1 { max-width: 700px; margin: 0; font-size: clamp(54px, 7vw, 96px); }
h1 em { color: var(--tomato); font-weight: inherit; }
.lead { max-width: 640px; margin: 28px 0; color: var(--ink-soft); font-size: clamp(17px, 2vw, 20px); }
.welcome-meta { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 32px; font-size: 14px; font-weight: 600; }
.primary, .secondary { min-height: 52px; border-radius: 99px; padding: 0 24px; font-weight: 700; border: 1px solid transparent; transition: transform .2s, background .2s; }
.primary { color: var(--white); background: var(--tomato); box-shadow: 0 10px 30px rgba(166, 29, 28, .34); }
.primary:hover { background: var(--tomato-dark); transform: translateY(-2px); }
.primary span { margin-left: 14px; }
.secondary { color: var(--cream); border-color: var(--line); background: transparent; }
.secondary:hover { border-color: var(--cream); background: var(--surface-raised); }
.mascot-card { aspect-ratio: .88; position: relative; overflow: hidden; border: 8px solid #2B2825; border-radius: 44% 44% 28px 28px; color: var(--cream); background: var(--wine); box-shadow: var(--shadow); transform: rotate(2deg); }
.mascot-card::before { content: ""; position: absolute; inset: 14px; z-index: 2; border: 1px solid rgba(244,234,215,.45); border-radius: 43% 43% 20px 20px; pointer-events: none; }
.mascot-card img { width: 100%; height: 82%; display: block; object-fit: cover; object-position: center 62%; mix-blend-mode: screen; }
.mascot-card p { position: absolute; right: 34px; bottom: 24px; z-index: 3; margin: 0; text-align: right; font-weight: 800; line-height: 1.15; }
.stamp { position: absolute; top: 38px; left: 34px; z-index: 3; width: 100px; height: 100px; display: grid; place-items: center; border: 2px solid var(--cream); border-radius: 50%; text-align: center; font: 400 16px/1.05 "Anton", sans-serif; letter-spacing: .06em; transform: rotate(-12deg); }

.form-shell { min-height: calc(100vh - 120px); display: grid; grid-template-columns: 270px minmax(0, 760px); gap: clamp(36px, 7vw, 100px); align-items: start; padding: 44px 0; }
.journey { position: sticky; top: 24px; }
.journey-heading { margin-bottom: 24px; font-size: 13px; font-weight: 700; }
.progress { height: 6px; margin-top: 9px; overflow: hidden; border-radius: 6px; background: var(--surface-raised); }
.progress i { display: block; width: 0; height: 100%; background: var(--tomato); transition: width .35s ease; }
#stepNav { display: grid; gap: 2px; }
.nav-step { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border: 0; border-radius: 10px; color: var(--ink-soft); background: none; text-align: left; font-size: 13px; }
.nav-step i { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-style: normal; font-size: 10px; }
.nav-step.active { color: var(--cream); background: var(--surface-raised); font-weight: 700; }
.nav-step.active i { color: white; border-color: var(--tomato); background: var(--tomato); }
.nav-step.done i { color: white; border-color: var(--sage); background: var(--sage); }
.privacy-note { margin-top: 24px; color: var(--ink-soft); font-size: 12px; }
#onboardingForm { padding: clamp(26px, 5vw, 54px); border: 1px solid var(--line); border-radius: 28px; background: rgba(36, 33, 31, .94); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.step-head { margin-bottom: 36px; }
.step-head h2 { margin: 0 0 14px; font-size: clamp(38px, 5vw, 60px); }
.step-head > p:last-child { max-width: 600px; margin: 0; color: var(--ink-soft); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label, .field legend { font-weight: 700; font-size: 14px; }
.field label span { color: var(--tomato); }
.hint { margin: -3px 0 0; color: var(--ink-soft); font-size: 12px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; color: var(--cream); background: var(--surface-raised); padding: 13px 14px; caret-color: var(--cream); transition: border .2s, box-shadow .2s; }
.field input::placeholder, .field textarea::placeholder { color: #887F76; }
.field input, .field select { min-height: 50px; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--tomato); box-shadow: 0 0 0 3px rgba(233,75,53,.1); outline: none; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--tomato); }
.choice-list { display: flex; flex-wrap: wrap; gap: 9px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-raised); font-size: 13px; cursor: pointer; }
.choice input:checked + span { color: var(--white); border-color: var(--tomato); background: var(--tomato); }
.secure-callout { grid-column: 1 / -1; padding: 16px 18px; border-left: 4px solid var(--tomato); border-radius: 8px; color: var(--cream); background: var(--wine); font-size: 13px; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--line); }
.success { max-width: 700px; min-height: calc(100vh - 120px); margin: auto; display: grid; place-content: center; text-align: center; }
.success-mark { width: 72px; height: 72px; margin: 0 auto 24px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--sage); font-size: 36px; }
.success h2 { margin: 0 0 20px; font-size: clamp(42px, 6vw, 72px); }
.success > p:last-child { color: var(--ink-soft); font-size: 18px; }
.toast { position: fixed; right: 22px; bottom: 22px; opacity: 0; transform: translateY(15px); z-index: 5; padding: 13px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--cream); background: var(--surface-raised); box-shadow: var(--shadow); transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (max-width: 850px) {
  .welcome { grid-template-columns: 1fr; padding: 50px 0 80px; }
  .mascot-card { width: min(420px, 90%); margin: 20px auto 0; }
  .form-shell { grid-template-columns: 1fr; padding-top: 14px; }
  .journey { position: static; }
  #stepNav { display: none; }
  .privacy-note { display: none; }
}
@media (max-width: 560px) {
  main, .topbar { width: min(100% - 24px, 1200px); }
  .topbar { height: 72px; }
  .topbar .text-button { font-size: 12px; }
  .welcome { min-height: auto; }
  .mascot-card { display: none; }
  .fields { grid-template-columns: 1fr; }
  .field { grid-column: 1 !important; }
  #onboardingForm { padding: 24px 18px; border-radius: 20px; }
  .form-actions { position: sticky; bottom: 0; margin-inline: -18px; padding: 16px 18px; background: var(--surface); }
  .form-actions button { padding-inline: 16px; }
}
