/* Totem landing page. Tokens mirror the app (flutter_front/lib/config/theme.dart).
   Every scene is authored in its final frame: no JavaScript, reduced motion or a
   failed script load all show the finished picture. */

@font-face {
  font-family: "Inter";
  src: url("/landing-assets/fonts/InterVariable-4.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #E8690B;
  --on-accent: #0F172A;
  --ok: #16A34A;
  --warn: #F59E0B;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --header: 64px;

  --bg: #FFFFFF;
  --bg-alt: #F1F5F9;
  --text: #0F172A;
  --text-2: #334155;
  --muted: #475569;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --accent-ink: #B45309;
  --danger: #B91C1C;
  --field: #FFFFFF;
  --field-line: #64748B; /* form field edges: 3:1 or more against light and dark surfaces */

  --sc-fill: #F1F5F9;
  --sc-stroke: #CBD5E1;
  --sc-edge: #94A3B8;
  --sc-text: #0F172A;
  --sc-muted: #475569;
  --sc-bar: #94A3B8;
  --sc-lane: rgba(232, 105, 11, .10);
  --sc-grid: #CBD5E1;
  color-scheme: light;
}

/* Dark slate: the hero, "how it works" and the footer always; every section in the dark scheme. */
.deep {
  --bg: #0F172A;
  --bg-alt: #0F172A;
  --text: #F1F5F9;
  --text-2: #CBD5E1;
  --muted: #94A3B8;
  --line: #1E293B;
  --line-strong: #334155;
  --accent-ink: #E8690B;
  --danger: #F87171;
  --field: #1E293B;
  --sc-fill: #1E293B;
  --sc-stroke: #334155;
  --sc-edge: #64748B;
  --sc-text: #F1F5F9;
  --sc-muted: #94A3B8;
  --sc-bar: #64748B;
  --sc-lane: rgba(232, 105, 11, .14);
  --sc-grid: #334155;
  background: var(--bg);
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F172A;
    --bg-alt: #0F172A;
    --text: #F1F5F9;
    --text-2: #CBD5E1;
    --muted: #94A3B8;
    --line: #1E293B;
    --line-strong: #334155;
    --accent-ink: #E8690B;
    --danger: #F87171;
    --field: #1E293B;
    --sc-fill: #1E293B;
    --sc-stroke: #334155;
    --sc-edge: #64748B;
    --sc-text: #F1F5F9;
    --sc-muted: #94A3B8;
    --sc-bar: #64748B;
    --sc-lane: rgba(232, 105, 11, .14);
    --sc-grid: #334155;
    color-scheme: dark;
  }
  .deep { --bg: #020617; }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 8px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(4.5rem, 10vw, 8rem); background: var(--bg); }
.section-alt { background: var(--bg-alt); }
.section + .section { border-top: 1px solid var(--line); }

h1 { font-size: clamp(2.25rem, 4.2vw, 3.9rem); line-height: 1.03; letter-spacing: -.035em; font-weight: 680; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 650; max-width: 22ch; text-wrap: balance; }
h3 { font-size: 1.125rem; line-height: 1.35; font-weight: 600; letter-spacing: -.01em; }
p { color: var(--text-2); }
.lead { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--text-2); max-width: 36rem; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: .875rem; }
.note, .fineprint { font-size: .875rem; color: var(--muted); }

.skip { position: absolute; left: 16px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--accent); color: var(--on-accent); font-weight: 600; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.25rem; border: 1px solid transparent; border-radius: 8px;
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: #F27B1F; }
.btn[disabled] { cursor: progress; opacity: .7; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: transparent; border-color: var(--text); }
.btn-sm { min-height: 40px; padding: .5rem .9rem; font-size: .9375rem; }

/* Header */
.topbar { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 32px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.125rem; letter-spacing: -.02em; text-decoration: none; color: var(--text); }
.brand-mark { width: 20px; height: 20px; fill: var(--accent); }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { font-size: .9375rem; color: var(--text-2); text-decoration: none; }
.nav a:hover { color: var(--text); }

/* Hero */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-block: calc(var(--header) + 48px) 64px; }
.hero-in { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.hero-copy h1 { margin-bottom: 1.5rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 2rem 0 1.25rem; }
.scene-hero { max-width: 580px; justify-self: end; width: 100%; }

/* Photographic cutouts beside a section heading: flat, no frame. Width and
   height attributes reserve their box, so nothing shifts when they load. */
.section-head { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: end; }
.art img { display: block; height: auto; }
.art-pair { position: relative; width: 460px; aspect-ratio: 460 / 340; }
.art-notes { position: absolute; top: 0; right: 0; width: 300px; }
.art-papers { position: absolute; left: 0; bottom: 0; width: 320px; }
.art-seedlings img { width: 400px; }
.art-lock img { width: 180px; }
/* Dark cutouts (black lock, dark soil) get a hairline light edge on dark slate. */
@media (prefers-color-scheme: dark) {
  .art-rim { filter: drop-shadow(0 0 1px rgba(203, 213, 225, .55)); }
}

/* Problem */
.pains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 56px; }
.pain { border-top: 1px solid var(--line); padding-top: 28px; }
.pain h3 { margin: 24px 0 8px; }
.scene-sm { max-width: 240px; }

/* How it works: stacked by default, a pinned stage in full motion mode */
.how { padding-block: clamp(4.5rem, 10vw, 8rem); }
.steps { display: grid; gap: 80px; margin-top: 56px; }
.step { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; }
.step-no { display: block; font-size: .8125rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; margin-bottom: 10px; }
.step h3 { font-size: 1.5rem; margin-bottom: 10px; }
.step .scene { max-width: 520px; width: 100%; justify-self: end; }
.how.is-stage { min-height: 100vh; display: flex; align-items: center; padding-block: calc(var(--header) + 24px) 32px; }
.how.is-stage .wrap { width: 100%; }
/* The step paragraphs share one reserved area under the titles and cross-fade,
   so switching steps never moves anything (no layout shift while pinned). */
.how.is-stage .steps { position: relative; grid-template-columns: 5fr 7fr; grid-template-rows: repeat(4, auto); column-gap: 64px; row-gap: 4px; margin-top: 40px; padding-bottom: 9.5em; }
.how.is-stage .step { display: contents; }
.how.is-stage .step-text { grid-column: 1; padding: 12px 0 12px 20px; border-left: 2px solid var(--line-strong); transition: border-color .4s var(--ease); }
.how.is-stage .step-text h3 { font-size: 1.25rem; margin-bottom: 4px; color: var(--muted); transition: color .4s var(--ease); }
.how.is-stage .step-text p {
  position: absolute; left: 0; bottom: 0; width: calc((100% - 64px) * 5 / 12); height: 8.5em;
  padding-left: 22px; font-size: .975rem; color: var(--text-2); opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s;
}
.how.is-stage .step-text .step-no { margin-bottom: 4px; }
.how.is-stage .step-text.is-active { border-color: var(--accent); }
.how.is-stage .step-text.is-active h3 { color: var(--text); }
.how.is-stage .step-text.is-active p { opacity: 1; visibility: visible; }
.how.is-stage .step:nth-child(1) .step-text { grid-row: 1; }
.how.is-stage .step:nth-child(2) .step-text { grid-row: 2; }
.how.is-stage .step:nth-child(3) .step-text { grid-row: 3; }
.how.is-stage .step:nth-child(4) .step-text { grid-row: 4; }
.how.is-stage .step .scene { grid-column: 2; grid-row: 1 / span 4; align-self: center; }

/* Sectors */
.tabs { display: flex; gap: 4px; margin-top: 40px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  flex: none; padding: 12px 16px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none;
  font: inherit; font-size: .9375rem; font-weight: 500; color: var(--muted); cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.panel { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; padding-top: 48px; }
.panel[hidden] { display: none; }
.panel > p { font-size: 1.25rem; line-height: 1.55; }
.scene-md { max-width: 480px; width: 100%; justify-self: end; }

/* Trust */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; margin-top: 56px; }
.trust .icon { width: 44px; height: 44px; margin-bottom: 20px; }
.trust h3 { margin-bottom: 8px; }
.trust p { font-size: .975rem; }

/* What changes */
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin: 56px 0 32px; }
.figures li { border-top: 1px solid var(--line); padding-top: 24px; }
.figure { color: var(--text); font-size: clamp(3.5rem, 7vw, 5.5rem); font-weight: 650; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.figure .unit { font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; color: var(--text-2); }

/* Data */
.data { display: grid; grid-template-columns: 7fr 5fr; gap: 56px; align-items: end; }
.data .lead { margin-top: 20px; }
.checks li { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); color: var(--text); font-weight: 500; }
.checks svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Demo */
.demo-in { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
.demo-copy .lead { margin-top: 20px; }
#demo-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field { display: grid; gap: 6px; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: .875rem; font-weight: 500; color: var(--text); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: .65rem .8rem; border: 1px solid var(--field-line); border-radius: 8px;
  background: var(--field); color: var(--text); font: inherit; font-size: 1rem;
  transition: border-color .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: .8125rem; color: var(--danger); }
.field-error:empty { display: none; }
.consent { grid-template-columns: auto 1fr; align-items: start; gap: 12px; }
.consent input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--accent); }
.consent label { font-weight: 400; color: var(--text-2); font-size: .9375rem; }
.consent .field-error { grid-column: 2; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-fallback { font-size: 1.125rem; color: var(--text); }
.form-fallback a { font-weight: 600; text-underline-offset: 3px; }
.form-status { margin-top: 18px; font-size: .9375rem; color: var(--text-2); }
.form-status.is-error { color: var(--danger); }
.form-status.is-error a { color: var(--text); font-weight: 600; }
.form-status.is-success { margin-top: 0; padding: 24px 0; border-top: 2px solid var(--ok); font-size: 1.25rem; color: var(--text); }

/* Footer */
.footer { padding-block: 56px; border-top: 1px solid var(--line); }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; align-items: start; }
.footer p { color: var(--muted); }
.footer .brand { margin-bottom: 8px; color: var(--text); }
.footer-tag { font-size: .9375rem; }
.footer-links { display: grid; gap: 8px; font-size: .9375rem; color: var(--text-2); }
.footer a { color: var(--text-2); text-underline-offset: 3px; }
.footer a:hover { color: var(--text); }
.langs { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9375rem; color: var(--muted); }
.langs span { width: 100%; }
.langs a { text-decoration: none; }
.langs a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Scenes: SVG vocabulary */
.scene svg { width: 100%; height: auto; overflow: visible; }
.s-frame, .s-rule { fill: none; stroke: var(--sc-stroke); }
.s-box { fill: var(--sc-fill); stroke: var(--sc-stroke); }
.s-key { stroke: var(--accent); }
.s-edge, .s-line { fill: none; stroke: var(--sc-edge); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.s-dash { stroke-dasharray: 4 4; }
.s-drop { fill: none; stroke: var(--sc-stroke); stroke-dasharray: 2 3; }
.s-dot { fill: var(--sc-edge); }
.s-lane { fill: var(--sc-lane); }
.s-track { fill: var(--sc-fill); }
.s-bar { fill: var(--sc-bar); }
.s-acc { fill: var(--accent); }
.s-okbg { fill: var(--ok); }
.s-warn, .s-warnbg { fill: var(--warn); }
.s-warn-stroke { fill: none; stroke: var(--warn); stroke-width: 2; stroke-linecap: round; }
.s-stamp { fill: none; stroke: var(--accent); stroke-width: 2; }
.s-grid { fill: var(--sc-grid); }
.s-icon { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.s-tick, .s-tick-ink, .s-tick-w { fill: none; stroke: var(--on-accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.s-tick-w { stroke: #FFFFFF; }
.s-text { fill: var(--sc-text); font-size: 13px; }
.s-muted { fill: var(--sc-muted); font-size: 13px; }
.s-ink { fill: var(--on-accent); font-size: 13px; }
.s-sm { font-size: 11px; }
.s-xs { font-size: 10px; }
.s-strong { font-weight: 600; }
.s-figure { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.s-num, .s-figure, .count { font-variant-numeric: tabular-nums; }
.t-bg { fill: #1E293B; stroke: #475569; }
.t-head { fill: var(--ok); opacity: .75; }
.t-grid { fill: none; stroke: #334155; }

/* Final frame. Motion code animates towards exactly these values. */
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.tile { opacity: 0; }

/* Scripts are on their way: hide the hero scene so its first frame is not the last one.
   If motion never starts, the fallback animation reveals the final frame anyway. */
.motion-pending .scene-hero { visibility: hidden; animation: reveal-fallback 0s 2.5s forwards; }
@keyframes reveal-fallback { to { visibility: visible; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* No fallback animation runs here, so never keep the hero hidden. */
  .motion-pending .scene-hero { visibility: visible; }
}

/* Narrow screens */
@media (max-width: 959px) {
  .nav { display: none; }
  .topbar-in { justify-content: space-between; }
  .trust { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .wrap { padding-inline: 16px; }
  .section-head { grid-template-columns: 1fr; gap: 24px; }
  .art-pair { width: 100%; max-width: 460px; }
  .art-notes { width: 58%; }
  .art-papers { width: 62%; }
  .art-seedlings img { width: min(80vw, 400px); }
  .art-lock img { width: 36vw; max-width: 180px; }
  .hero { min-height: 0; padding-block: calc(var(--header) + 40px) 56px; }
  .hero-in, .step, .panel, .data, .demo-in, .footer-in { grid-template-columns: 1fr; gap: 32px; }
  .scene-hero, .step .scene, .scene-md { justify-self: start; }
  .pains, .figures { grid-template-columns: 1fr; gap: 40px; }
  .steps { gap: 56px; }
  #demo-form { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .btn-sm { width: auto; }
}
@media (max-width: 559px) {
  .trust { grid-template-columns: 1fr; }
}
