/* =========================================================================
   Stalldo landing — token-faithful theme
   Values mirror src/constants/tokens.ts (brand green #2d6a4f), so the marketing
   site and the app read as ONE brand. Do not introduce a new design language.
   ========================================================================= */
:root {
  /* Colors — from tokens.ts Colors (light) */
  --primary: #2d6a4f;
  --primary-light: #e8f5e9;
  --primary-dark: #1b4332;
  --accent: #52b788;            /* DarkColors.primary.main — used as a vivid accent */
  --text: #333333;
  --text-secondary: #6c757d;
  --text-inverted: #ffffff;
  --bg: #f0f2f5;                /* background.main */
  --bg-form: #f8f9fa;
  --surface: #ffffff;
  --border: #dee2e6;
  --border-subtle: #e9ecef;
  --info: #2196f3;
  --warning: #ff9800;
  --success: #4caf50;

  /* Spacing — tokens.ts Spacing */
  --xs: 4px; --sm: 8px; --md: 16px; --lg: 24px; --xl: 32px; --xxl: 40px;
  /* Radius — tokens.ts Radius (extended for marketing) */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

  --shadow-sm: 0 1px 3px rgba(27, 67, 50, .08);
  --shadow-md: 0 8px 24px rgba(27, 67, 50, .10);
  --shadow-lg: 0 24px 60px rgba(27, 67, 50, .16);

  --maxw: 1120px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #52b788; --primary-light: #1b4332; --primary-dark: #081c15;
    --accent: #74c69d;
    --text: #ECEDEE; --text-secondary: #9BA1A6; --text-inverted: #151718;
    --bg: #0f1413; --bg-form: #161b1a; --surface: #1c1e1f;
    --border: #2b3331; --border-subtle: #232826;
    --shadow-md: 0 8px 24px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 16px; line-height: 1.5; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.1; }
img, svg { display: block; }

/* ───── reveal-on-scroll ───── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ───── scroll progress ───── */
.scroll-progress {
  position: fixed; inset: 0 auto auto 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent)); z-index: 100;
}

/* ───── buttons ───── */
.btn {
  --pad: 14px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 16px; padding: var(--pad); border-radius: var(--r-full);
  border: 1px solid transparent; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
  will-change: transform;
}
.btn--sm { --pad: 9px 16px; font-size: 14px; }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-form); }
.btn[disabled] { opacity: .55; pointer-events: none; }

.eyebrow { color: var(--primary); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.lede { color: var(--text-secondary); font-size: 18px; line-height: 1.6; max-width: 56ch; }

/* ───── nav ───── */
.nav {
  position: sticky; top: 0; z-index: 90; display: flex; align-items: center; gap: 20px;
  padding: 14px clamp(16px, 5vw, 48px); max-width: 100%;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border-subtle); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; }
.nav__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow-sm); }
.nav__logo-img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.nav__links { display: flex; gap: 26px; margin-left: 18px; }
.nav__links a { color: var(--text-secondary); font-weight: 500; font-size: 15px; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-toggle { background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--r-full); padding: 6px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.lang-toggle [data-lang].active { color: var(--primary); }
.lang-sep { opacity: .4; margin: 0 2px; }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ───── hero ───── */
.hero { position: relative; padding: clamp(48px, 9vh, 96px) clamp(16px, 5vw, 48px) 72px; overflow: hidden; }
.hero__inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero__title { font-size: clamp(36px, 6vw, 60px); font-weight: 800; margin: 8px 0 18px; }
.hero__sub { font-size: clamp(17px, 2.2vw, 20px); color: var(--text-secondary); max-width: 52ch; line-height: 1.6; }
.hero__capture { display: flex; gap: 10px; margin: 28px 0 10px; max-width: 460px; }
.hero__capture input { flex: 1; padding: 14px 18px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px; }
.hero__capture input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.hero__microcopy { color: var(--text-secondary); font-size: 13px; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; margin-top: 28px; }
.hero__trust li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 900px) { .hero__inner { grid-template-columns: 1fr; } .hero__art { order: -1; } }

/* hero animated background */
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: drift 22s var(--ease) infinite; }
.blob--1 { width: 460px; height: 460px; top: -120px; left: -80px; background: radial-gradient(circle, var(--accent), transparent 70%); }
.blob--2 { width: 520px; height: 520px; top: -60px; right: -120px; background: radial-gradient(circle, var(--primary), transparent 70%); animation-delay: -7s; }
.blob--3 { width: 380px; height: 380px; bottom: -160px; left: 30%; background: radial-gradient(circle, #9be7c4, transparent 70%); animation-delay: -13s; opacity: .35; }
.grid-fade { position: absolute; inset: 0; background-image: linear-gradient(var(--border-subtle) 1px, transparent 1px), linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%); opacity: .5; }
@keyframes drift { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,30px) scale(1.08); } 66% { transform: translate(-30px,20px) scale(.96); } }

/* hero art — phone + floating cards */
.hero__art { position: relative; display: grid; place-items: center; min-height: 420px; }
.phone { width: 264px; height: 540px; border-radius: 38px; background: linear-gradient(160deg, #20302b, #0d1614); padding: 12px; box-shadow: var(--shadow-lg); transition: transform .2s var(--ease); }
.phone__notch { width: 110px; height: 22px; background: #0d1614; border-radius: 0 0 14px 14px; margin: 0 auto 8px; }
.phone__screen { position: relative; height: calc(100% - 30px); border-radius: 28px; background: linear-gradient(180deg, var(--primary-light), var(--bg)); overflow: hidden; padding: 16px; }
.ui-card { position: absolute; left: 16px; right: 16px; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-sm); }
.ui-card__row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ui-card__meta { color: var(--text-secondary); font-size: 12px; margin-top: 6px; }
.ui-card__bar { height: 6px; border-radius: 4px; background: var(--border-subtle); margin-top: 8px; overflow: hidden; }
.ui-card__bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.ui-pill { width: 10px; height: 10px; border-radius: 50%; }
.ui-pill--ok { background: var(--success); } .ui-pill--info { background: var(--info); } .ui-pill--warn { background: var(--warning); }
.ui-card--health { top: 26px; } .ui-card--feed { top: 132px; } .ui-card--money { top: 250px; }
.float-a { animation: floaty 6s var(--ease) infinite; } .float-b { animation: floaty 6s var(--ease) -2s infinite; } .float-c { animation: floaty 6s var(--ease) -4s infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.orbit { position: absolute; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-md); font-size: 24px; animation: orbit 14s linear infinite; }
.orbit--vet { top: 8%; right: 6%; } .orbit--farrier { bottom: 14%; left: 2%; animation-delay: -4s; } .orbit--hoof { bottom: 4%; right: 12%; animation-delay: -9s; }
@keyframes orbit { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(6deg); } }

.scroll-cue { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; width: 24px; height: 38px; border: 2px solid var(--border); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; translate: -50% 0; width: 4px; height: 8px; border-radius: 2px; background: var(--primary); animation: cue 1.6s infinite; }
@keyframes cue { 0% { opacity: 0; top: 8px; } 40% { opacity: 1; } 80% { opacity: 0; top: 20px; } }

/* ───── proof strip ───── */
.proof { border-block: 1px solid var(--border-subtle); background: var(--surface); }
.proof__inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; padding: 30px clamp(16px,5vw,48px); }
.stat { text-align: center; } .stat b { display: block; font-size: 30px; font-weight: 800; color: var(--primary); }
.stat span { font-size: 13px; color: var(--text-secondary); }
@media (max-width: 640px) { .proof__inner { grid-template-columns: repeat(2,1fr); } }

/* ───── generic section ───── */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(56px, 10vh, 104px) clamp(16px,5vw,48px); }
.section--alt { max-width: 100%; background: var(--surface); border-block: 1px solid var(--border-subtle); }
.section--alt > * { max-width: var(--maxw); margin-inline: auto; }
.section__head { max-width: 60ch; margin-bottom: 44px; }
.section__head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin: 4px 0 14px; }

/* ───── split (problem/solution) ───── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.split__col { background: var(--bg-form); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 28px; }
.split__label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; }
.split__label--pain { color: var(--warning); } .split__label--gain { color: var(--primary); }
.painlist, .gainlist { list-style: none; display: grid; gap: 14px; }
.painlist li, .gainlist li { padding-left: 30px; position: relative; color: var(--text); }
.painlist li::before { content: "—"; position: absolute; left: 0; color: var(--text-secondary); }
.gainlist li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 800; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* ───── steps ───── */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.section--alt .step { background: var(--bg-form); }
.step__num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-light); color: var(--primary); font-weight: 800; font-size: 20px; margin-bottom: 16px; }
.step h3 { font-size: 20px; margin-bottom: 8px; } .step p { color: var(--text-secondary); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ───── roles ───── */
.rolegrid, .featuregrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.rolecard { text-align: left; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 26px; cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; box-shadow: var(--shadow-sm); }
.rolecard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.rolecard__icon, .feature__ic { font-size: 32px; display: block; margin-bottom: 14px; }
.rolecard h3 { font-size: 19px; margin-bottom: 6px; } .rolecard p { color: var(--text-secondary); font-size: 15px; }
.feature { background: var(--bg-form); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); padding: 26px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; } .feature p { color: var(--text-secondary); font-size: 15px; }
@media (max-width: 860px) { .rolegrid, .featuregrid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .rolegrid, .featuregrid { grid-template-columns: 1fr; } }

/* ───── join / questionnaire ───── */
.join__panel { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 64px); align-items: start;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border-radius: var(--r-xl); padding: clamp(28px, 5vw, 56px); box-shadow: var(--shadow-lg); }
.join__intro .eyebrow { color: #bfe9d2; } .join__intro h2 { color: #fff; font-size: clamp(26px,4vw,40px); }
.join__intro .lede { color: rgba(255,255,255,.85); }
.join__perks { list-style: none; margin-top: 22px; display: grid; gap: 10px; }
.join__perks li { padding-left: 26px; position: relative; color: rgba(255,255,255,.92); }
.join__perks li::before { content: "★"; position: absolute; left: 0; color: #ffd479; }
.quiz { background: var(--surface); color: var(--text); border-radius: var(--r-lg); padding: clamp(20px,3vw,32px); position: relative; min-height: 360px; }
.quiz__progress { height: 6px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; margin-bottom: 24px; }
.quiz__progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--primary),var(--accent)); transition: width .4s var(--ease); }
.quiz__step { display: none; border: 0; animation: stepIn .45s var(--ease); }
.quiz__step.is-active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.quiz legend { font-size: 19px; font-weight: 700; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { padding: 10px 16px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--bg-form); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--primary); }
.chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }
.q-field { display: block; margin-top: 18px; }
.q-field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.q-field input[type=text], .q-field input[type=email], .q-field textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-form); color: var(--text); font: inherit; }
.q-field input:focus, .q-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.q-field--inline { display: flex; align-items: flex-start; gap: 10px; }
.q-field--inline span { margin: 0; font-weight: 400; font-size: 14px; color: var(--text-secondary); }
.cf-turnstile { margin-top: 18px; }
.quiz__nav { display: flex; gap: 12px; margin-top: 26px; }
.quiz__nav .btn { flex: 1; }
.quiz__nav--hidden { display: none; }
.quiz__error { color: var(--warning); font-size: 14px; margin-top: 14px; }
.quiz__done { position: absolute; inset: 0; display: none; place-content: center; text-align: center; gap: 12px; background: var(--surface); border-radius: var(--r-lg); padding: 32px; animation: stepIn .5s var(--ease); }
.quiz__done--visible { display: grid; }
.quiz__check { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-size: 32px; font-weight: 800; animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 820px) { .join__panel { grid-template-columns: 1fr; } }

/* ───── footer ───── */
.footer { background: var(--surface); border-top: 1px solid var(--border-subtle); padding: 48px clamp(16px,5vw,48px) 28px; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer__brand { display: grid; gap: 8px; font-weight: 800; }
.footer__brand > span:first-of-type { } .footer__tag { font-weight: 400; color: var(--text-secondary); max-width: 36ch; }
.footer__links { display: flex; gap: 22px; } .footer__links a { color: var(--text-secondary); font-size: 15px; }
.footer__links a:hover { color: var(--text); }
.footer__copy { max-width: var(--maxw); margin: 28px auto 0; color: var(--text-secondary); font-size: 13px; }

/* ───── exit-intent overlay ───── */
.exit-overlay { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.exit-overlay--visible { display: grid; animation: fadeIn .3s var(--ease); }
.exit-overlay__panel { background: var(--surface); border-radius: var(--r-xl); padding: 40px 36px 32px; max-width: 400px; width: 90%; text-align: center; box-shadow: var(--shadow-lg); position: relative; }
.exit-overlay__close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 28px; color: var(--text-secondary); cursor: pointer; }
.exit-overlay h3 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.exit-overlay p { color: var(--text-secondary); margin-bottom: 20px; }
.exit-overlay__form { display: flex; gap: 8px; }
.exit-overlay__form input { flex: 1; padding: 12px 16px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--bg-form); color: var(--text); font-size: 15px; }
.exit-overlay__form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.exit-overlay__form .btn { flex-shrink: 0; }
.exit-overlay__skip { background: none; border: none; color: var(--text-secondary); font-size: 13px; margin-top: 14px; cursor: pointer; }
.exit-overlay__skip:hover { color: var(--text); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ───── share actions (post-submission) ───── */
.share-actions { display: flex; gap: 10px; margin-top: 18px; }
.share-actions .btn { flex: 1; }
.share-skip { color: var(--text-secondary) !important; border-color: var(--border) !important; }
.share-priority { margin-top: 16px; font-size: 15px; color: var(--primary); font-weight: 700; }
.share-copied { margin-top: 10px; font-size: 14px; color: var(--success); }

/* ───── follow-up WTP field ───── */
.q-field--wtp-followup { margin-top: 10px; }

/* ───── reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
