:root {
  --base: #05070D;
  --surface: #0A121A;
  --line: rgba(234, 242, 245, 0.10);
  --water-glow: #0E5C54;
  --water-glow-edge: #2AA894;
  --water-blue: #123A54;
  --text-high: #EAF2F5;
  /* body reading colour: lifted from #93A7B0 for contrast over the brightened
     flow video — Didone hairlines and long passages were washing out */
  --text-mid: #B4C3CA;
  --text-dim: #7C8D96;
  --cta: #3ECFBA;
  --cta-text: #04141A;
  --serif: "Bodoni Moda", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --pad-x: clamp(24px, 5vw, 48px);
  --section-gap: clamp(96px, 12vw, 140px);
  --measure: 68ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 85% -140px, rgba(18, 58, 84, 0.35), transparent 70%),
    radial-gradient(900px 640px at -180px 38%, rgba(14, 92, 84, 0.22), transparent 70%),
    var(--base);
  color: var(--text-mid);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--text-high);
  text-wrap: balance;
  margin: 0;
}

h1 em, h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--cta);
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--water-glow-edge); }

/* Inline emphasis for a key trust-building line (About): text lifts to
   --text-high and sits on a soft teal wash, not a literal highlighter mark. */
.hl {
  background: none;
  color: var(--text-high);
  font-weight: 600;
  background-image: linear-gradient(rgba(62, 207, 186, 0.16), rgba(62, 207, 186, 0.16));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0.05em 0.15em;
  border-radius: 4px;
}

:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 3px;
  border-radius: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--cta);
  color: var(--cta-text);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(62, 207, 186, 0.25);
  transition: box-shadow 200ms ease-out, transform 200ms ease-out;
}

.button:hover { box-shadow: 0 0 36px rgba(62, 207, 186, 0.4); }
.button:active { transform: scale(0.98); }

.button-nav { min-height: 42px; padding: 9px 20px; font-size: 0.9rem; box-shadow: none; }
.button-nav:hover { box-shadow: 0 0 20px rgba(62, 207, 186, 0.3); }

/* ---------- SpringFlow scroll background ---------- */

/* Fixed layer behind everything. The video is the page's motion engine; the shade
   keeps text readable (readability overrides the animation, per DESIGN.md) and its
   darkness eases per section via body[data-zone]. */
.flow-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: url("assets/flow-poster.jpg") center / cover no-repeat;
}

.flow-video {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 100vh);
  height: max(100vw, 100vh);
  transform: translate(-50%, -50%) scale(1.12);
  object-fit: cover;
  will-change: transform;
  /* The source video is darker than the design needs; brightening here keeps the
     file untouched. The per-zone shade still owns overall darkness. */
  filter: brightness(1.18) saturate(1.06);
}

.flow-shade {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 13, 0.88);
  transition: background-color 700ms ease-out;
}

/* Strongest presence behind How It Works, calmer everywhere else, near-opaque over
   Proof so the numbers stay untouchable. */
body[data-zone="how"] .flow-shade { background: rgba(5, 7, 13, 0.74); }
body[data-zone="hero"] .flow-shade { background: rgba(5, 7, 13, 0.80); }
body[data-zone="proof"] .flow-shade { background: rgba(5, 7, 13, 0.93); }

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 45%, transparent 50%, rgba(5, 7, 13, 0.6) 100%);
}

/* ---------- reveals: emerge from water ---------- */

/* Hidden states only apply once script.js confirms JS + motion are available
   (html.js-reveal), so content is always visible without JS, in headless renderers,
   and under prefers-reduced-motion. */
html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  filter: blur(10px);
}

html.js-reveal .reveal.in-view {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition:
    opacity 900ms cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
    filter 900ms cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s);
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--pad-x);
  background: rgba(10, 18, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo { border-radius: 10px; display: block; }

.nav-word, .footer-word {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-high);
  white-space: nowrap;
}

.button-nav { white-space: nowrap; }

@media (max-width: 560px) {
  .nav { padding: 10px 16px; gap: 10px; }
  .nav-logo { width: 30px; height: 30px; }
  .nav-word { font-size: 0.88rem; }
  .button-nav { min-height: 44px; padding: 7px 12px; font-size: 0.78rem; }
}

.nav-ai { color: var(--cta); }

.nav-links { display: none; gap: 28px; }

.nav-links a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 160ms ease-out;
}

.nav-links a:hover { color: var(--text-high); }

@media (min-width: 820px) {
  .nav-links { display: flex; }
}

/* ---------- hero ---------- */

.hero {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 110px) var(--pad-x) var(--section-gap);
  text-align: center;
}

/* Entrance veil: a solid layer the logo surfaces on, then the whole thing lifts to
   reveal the already-rendered page. Never overlaps content visually, and the page
   stays interactive underneath (pointer-events: none). ~2.3s total, once per
   session (html.skip-intro, set in <head>). */
.veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--base);
  pointer-events: none;
  will-change: opacity;
  animation: veil-lift 700ms ease-out 2200ms forwards;
}

.veil img {
  width: min(48vw, 300px);
  height: auto;
  /* screen-blend erases the PNG's dark baked background against the solid veil;
     the circular mask feathers the square edge. */
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  opacity: 0;
  /* will-change gives the logo its own compositor layer so the animated blur is
     rasterised there, not against the whole page — that was the entrance lag. */
  will-change: transform, opacity, filter;
  animation:
    logo-emerge 800ms cubic-bezier(0.22, 1, 0.36, 1) 150ms forwards,
    logo-dissolve 550ms ease-in 1850ms forwards;
}

@keyframes veil-lift {
  to { opacity: 0; visibility: hidden; }
}

@keyframes logo-emerge {
  from { opacity: 0; transform: translateY(46px) scale(0.92); filter: blur(8px); }
  to { opacity: 0.95; transform: none; filter: blur(0); }
}

@keyframes logo-dissolve {
  to { opacity: 0; transform: translateY(-26px) scale(1.05); filter: blur(8px); }
}

/* Repeat visit in the same session: no veil, hero reveals fire near-instantly. */
html.skip-intro .veil { display: none; }
html.skip-intro .hero .reveal.in-view { transition-delay: 60ms; }

.hero h1 {
  font-size: clamp(2.2rem, 7.5vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.slogan {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--cta);
  margin-top: 18px;
}

.hero-sub {
  max-width: 56ch;
  margin: 22px auto 0;
}

.hero-support {
  margin: 14px auto 0;
  color: var(--text-high);
  font-weight: 500;
}

.hero-copy .button { margin-top: 30px; }

.droplet-video {
  display: block;
  width: min(62vw, 340px);
  height: auto;
  margin: 0 auto 30px;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 72%);
  mask-image: radial-gradient(circle, #000 55%, transparent 72%);
}

/* Small screens: drop the background video entirely (load speed beats effect on a
   phone between jobs); the dimmed poster keeps the texture. The droplet stays: it is
   1.1MB, loops quietly, and carries the leak metaphor at the decision point. */
@media (max-width: 768px) {
  .flow-video { display: none; }
}

/* Reduced motion: no background video, no veil, no reveals (script.js never adds
   .js-reveal and pauses every video). The droplets keep their poster frames, so
   they read as still images. */
@media (prefers-reduced-motion: reduce) {
  .flow-video { display: none; }
  .veil { display: none; }
}

/* ---------- sections ---------- */

section { scroll-margin-top: 88px; }

.how, .proof, .about, .band {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--pad-x) var(--section-gap);
}

.how h2, .proof h2 {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.15;
  max-width: 24ch;
  margin-bottom: clamp(36px, 5vw, 56px);
}

/* ---------- stat journey deck (closing band) ---------- */

/* Default (no JS, reduced motion): a plain readable column of glass cards.
   script.js adds .deck-scroll for the sticky 3D stack, so nothing below ever
   depends on the animation. */
.deck { margin-bottom: clamp(56px, 8vw, 96px); }

.deck-title {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

.deck-sub {
  max-width: 52ch;
  margin: 0 auto;
  font-size: 0.98rem;
}

.deck-stack {
  display: grid;
  gap: 16px;
  max-width: 560px;
  margin: 30px auto 0;
}

.deck-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  /* glass: the fixed flow layer shows through the blur; opaque enough that the
     card behind never ghosts through the front card's text */
  background: rgba(10, 18, 26, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(234, 242, 245, 0.07);
  padding: clamp(20px, 3.4vw, 30px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.deck-card h3 {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  line-height: 1.3;
  max-width: 34ch;
}

.deck-card p { margin: 0; font-size: 0.92rem; line-height: 1.55; max-width: 46ch; }

.deck-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--water-glow-edge);
}

.deck-num {
  font-family: var(--serif);
  font-size: clamp(4.2rem, 10.5vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--text-high);
  text-shadow: 0 2px 24px rgba(62, 207, 186, 0.22);
}

/* Longer number strings ("35 to 50%", "47% to 68%") get a smaller cap than the
   short ones ("77%", "80 hrs") so every card can run its number as large as
   possible without wrapping to a second line inside the fixed-height stack. */
.deck-num-wide { font-size: clamp(2.6rem, 6.6vw, 3.9rem); }

.deck-src { font-size: 0.72rem; color: var(--text-dim); padding-top: 6px; }

.deck-cta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--cta);
}

.deck-count { display: none; font-size: 0.8rem; color: var(--text-dim); margin-top: 18px; }
.deck-count span { color: var(--text-high); }

/* Scroll-stack mode: the section becomes a tall runway; the sticky viewport pins
   while scroll progress deals each card up and away (transforms set per frame by
   script.js — no transitions, scroll IS the animation). */
.deck.deck-scroll { height: 460vh; }

.deck.deck-scroll .deck-sticky {
  position: sticky;
  top: 76px;
  height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

.deck.deck-scroll .deck-stack {
  position: relative;
  width: min(92vw, 640px);
  height: min(60vh, 505px);
  /* flex-shrink: 0 — the sticky flex column must never squeeze the stack, or
     card text clips; short viewports shed header space instead (rules below). */
  flex-shrink: 0;
  margin-top: 20px;
  transform-style: preserve-3d;
}

.deck.deck-scroll .deck-sub { margin-top: 4px; }

.deck.deck-scroll .deck-card {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  transition: none;
}

/* Cards waiting in the stack keep their chrome but hide their text (script.js
   drives --content-o), so the next card's copy never interferes with reading
   the front one; it fades in as the card reaches the front. */
.deck.deck-scroll .deck-card > * { opacity: var(--content-o, 1); }

.deck.deck-scroll .deck-count { display: block; }

/* Phones: layered backdrop blur is heavy, so swap glass for near-solid; and the
   cards need a taller box with tighter type so no stat ever clips. */
@media (max-width: 768px) {
  .deck-card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(10, 18, 26, 0.92);
    padding: 20px 18px;
    gap: 8px;
  }
  .deck-card p { font-size: 0.85rem; }
  .deck-card h3 { font-size: 1.02rem; }
  .deck-num { font-size: clamp(3.2rem, 13vw, 3.9rem); }
  .deck-num-wide { font-size: clamp(2.1rem, 8.5vw, 2.5rem); }
  .deck-sub { font-size: 0.88rem; max-width: 40ch; }
  .deck.deck-scroll .deck-title { font-size: 1.5rem; margin-bottom: 6px; }
  /* flex-shrink: 0 — otherwise the sticky flex column squeezes the stack and
     clips card text; the box must stay tall enough for the longest card. */
  .deck.deck-scroll .deck-stack { height: min(60vh, 500px); min-height: 466px; flex-shrink: 0; margin-top: 12px; }
  .deck.deck-scroll .deck-count { margin-top: 12px; }
}

/* Short viewports at any width (laptops included): drop the intro line so the
   pinned stack keeps room for full card text. */
@media (max-height: 900px) {
  .deck.deck-scroll .deck-sub { display: none; }
  .deck.deck-scroll .deck-title { margin-bottom: 4px; }
}

/* Short screens (landscape phones, small laptops): shrink the header and card
   chrome further so nothing ever clips. */
@media (max-height: 740px) and (max-width: 768px) {
  .deck.deck-scroll .deck-sub { display: none; }
  .deck.deck-scroll .deck-title { font-size: 1.35rem; margin-bottom: 0; }
  .deck.deck-scroll .deck-card { padding: 16px 14px; gap: 6px; }
  .deck.deck-scroll .deck-card p { font-size: 0.8rem; }
  .deck.deck-scroll .deck-count { margin-top: 10px; }
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.step {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 26, 0.6);
  padding: 28px;
  transition: border-color 200ms ease-out;
}

.step:hover { border-color: rgba(42, 168, 148, 0.45); }

.step-num {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
}

.step h3 {
  font-size: 1.45rem;
  margin: 10px 0 10px;
}

.step p:last-child { font-size: 0.98rem; }

/* ---------- proof ---------- */

.proof-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* single case card now: centre it as a deliberate feature, not a stretched box */
  max-width: 680px;
  margin: 0 auto;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 18, 26, 0.6);
  padding: clamp(24px, 4vw, 36px);
}

.card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--water-glow-edge);
  margin-bottom: 18px;
}

.case-card h3 { font-size: 1.5rem; }

.case-kind { font-size: 0.9rem; margin: 4px 0 16px; }

.quote { margin: 26px 0 0; border-top: 1px solid var(--line); padding-top: 22px; }

.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  line-height: 1.35;
  color: var(--text-high);
}

.quote figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 0.9rem;
}

.quote strong { color: var(--text-high); font-weight: 600; }

.quote-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--water-glow);
  color: var(--text-high);
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.stats { margin: 0; }

.stat { padding: 20px 0; }

.stat + .stat { border-top: 1px solid var(--line); }

.stat dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--water-glow-edge);
}

.stat-num {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  color: var(--text-high);
  margin: 6px 0 6px;
}

.stat dd { margin: 0; font-size: 0.95rem; }

.proof-close {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-high);
  margin-top: clamp(36px, 5vw, 56px);
}

/* ---------- about ---------- */

.about {
  display: grid;
  gap: 40px;
  align-items: start;
}

.about h2 {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 28px;
}

.about-body p { max-width: var(--measure); }

.about-body p + p { margin-top: 1.2em; }

.who-card ul {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.who-card li {
  padding: 10px 0 10px 22px;
  position: relative;
  font-size: 0.98rem;
}

.who-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--water-glow-edge);
}

.who-card .button { width: 100%; }

.who-note {
  text-align: center;
  font-size: 0.88rem;
  margin-top: 12px;
}

@media (min-width: 900px) {
  .about { grid-template-columns: 1.6fr 1fr; gap: 56px; }
  .who-card { position: sticky; top: 96px; }
}

/* ---------- closing band ---------- */

.band {
  text-align: center;
  padding-top: clamp(48px, 7vw, 80px);
}

.band h2 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.12;
}

.band p { max-width: 52ch; margin: 18px auto 30px; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--pad-x) 32px;
}

.footer-row {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand { display: flex; align-items: center; gap: 12px; }

.footer-brand img { border-radius: 9px; }

.footer-word { font-size: 1rem; }

.footer-slogan {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-mid);
}

.footer-place { font-size: 0.92rem; }

.footer-links { display: flex; gap: 24px; }

.footer-links a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 160ms ease-out;
}

.footer-links a:hover { color: var(--text-high); }

.footer-legal {
  max-width: 1140px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--text-dim);
}
