/* ==========================================================================
   SintraFlow AI — cream paper, teal accent
   ========================================================================== */

:root {
  --bg: #F8F4EC;
  --bg-raised: #F3EEE4;
  --surface-1: #FFFDF8;
  --surface-2: #F6F1E8;
  --surface-3: #EBE4D6;
  --fg: #12100D;
  --fg-muted: #5A544C;
  --fg-subtle: #6B6660;
  --line: rgba(18, 16, 13, 0.10);
  --line-strong: rgba(18, 16, 13, 0.18);
  --brand: #1FC8A9;
  --brand-ink: #0B6B58;
  --brand-hover: #17B399;
  --brand-deep: #B7E8DC;
  --on-brand: #04110E;
  --highlight-from: #0B6B58;
  --highlight-to: #1FC8A9;
  --signal: #C4841A;
  --error: #B3261E;

  /* Legacy aliases used by existing markup */
  --paper: var(--bg);
  --surface: var(--bg-raised);
  --ink: var(--fg);
  --ink-elevated-a: var(--surface-1);
  --ink-elevated-b: var(--surface-2);
  --ink-hairline: var(--line);
  --on-ink: var(--fg);
  --on-ink-muted: var(--fg-muted);
  --accent: var(--brand);
  --accent-ink: var(--brand-ink);
  --accent-soft: var(--brand-deep);
  --muted: var(--fg-muted);
  --structure: var(--fg-subtle);
  --hairline: var(--line);

  --fd: "General Sans", system-ui, sans-serif;
  --fb: "General Sans", system-ui, sans-serif;
  --fmono: "General Sans", system-ui, sans-serif;

  --t-display: clamp(2.75rem, 1.5rem + 5vw, 5.5rem);
  --t-act: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
  --t-lead: 1.0625rem;
  --t-meta: 13px;

  --gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
  --frame: var(--gutter);
  --section-y: clamp(4.5rem, 2.75rem + 5vw, 7.5rem);
  --nav-h: 64px;
  --r1: 10px;
  --r2: 12px;
  --r3: 16px;
  --rp: 999px;
  --shadow-card: none;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --e: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.2s;
  --t-base: 0.55s;
  --t-reveal: 0.6s;
  --stagger-word: 35ms;
  --d-rise: 16px;
}

/* --------------------------------------------------------------- base --- */

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--fb);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand); color: var(--on-brand); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--rp); }
::-webkit-scrollbar-thumb:hover { background: var(--fg-subtle); }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------------------------------------------------------- typography --- */

.f-display {
  font-family: var(--fd);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--fg);
}
.f-body { font-family: var(--fb); }
.f-mono { font-family: var(--fb); }

.t-display { font-size: var(--t-display); line-height: 1.02; letter-spacing: -0.035em; }
.t-act     { font-size: var(--t-act); line-height: 1.08; letter-spacing: -0.025em; }
.t-lead    { font-size: var(--t-lead); line-height: 1.6; color: var(--fg-muted); }

h1, .h1 { font-size: var(--t-display); font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; }
h2, .h2 { font-size: var(--t-act); font-weight: 500; letter-spacing: -0.025em; line-height: 1.08; }
h3, .h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }

.t-meta {
  font-family: var(--fb);
  font-size: var(--t-meta);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow--dot::before,
.t-meta--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.stat-num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--fg);
}

.text-highlight {
  background: linear-gradient(120deg, var(--highlight-from), var(--highlight-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.shell {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.rule { border-top: 1px solid var(--line); }
.section-y { padding-block: var(--section-y); }

/* ------------------------------------------------------------- reveals --- */

.reveal {
  opacity: 0;
  transform: translateY(var(--d-rise));
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--delay, 0s);
  will-change: opacity, transform;
}
.reveal[data-on="true"] { opacity: 1; transform: none; }

.reveal-fade { opacity: 0; transition: opacity 0.7s var(--ease-out); transition-delay: var(--delay, 0s); }
.reveal-fade[data-on="true"] { opacity: 1; }

.reveal-clip {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s var(--ease-out);
  transition-delay: var(--delay, 0s);
}
.reveal-clip[data-on="true"] { clip-path: inset(0 0 0 0); }

.reveal-scale img,
.reveal-scale > .scale-target {
  transform: scale(1.03);
  transition: transform 0.7s var(--ease-out);
}
.reveal-scale[data-on="true"] img,
.reveal-scale[data-on="true"] > .scale-target { transform: scale(1); }

/* --------------------------------------------------------- split text --- */

.split { display: block; }
.split .line { display: block; overflow: hidden; }
.split .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  white-space: pre;
}

.split [data-char],
.split [data-word] {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 600ms var(--ease-out),
    opacity 500ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger-word) + var(--delay, 0s));
  will-change: transform;
}
.split[data-on="true"] [data-char],
.split[data-on="true"] [data-word] { transform: none; opacity: 1; }

/* ------------------------------------------------------- rolling links --- */

.roll {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  vertical-align: middle;
  line-height: 1.15;
}
.roll__in { display: block; transition: transform 0.45s var(--ease-out); }
.roll__in span { display: inline-block; }
.roll__out {
  position: absolute;
  inset: 0;
  display: block;
  transform: translateY(100%);
  transition: transform 0.45s var(--ease-out);
  color: var(--fg);
}
.roll:hover .roll__in,
a:hover > .roll .roll__in,
button:hover > .roll .roll__in { transform: translateY(-110%); }
.roll:hover .roll__out,
a:hover > .roll .roll__out,
button:hover > .roll .roll__out { transform: translateY(0); }

/* ------------------------------------------------------------ buttons --- */

.btn {
  --btn-bg: var(--brand);
  --btn-fg: var(--on-brand);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r1);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid transparent;
  font-family: var(--fb);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  overflow: hidden;
  isolation: isolate;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn::before { display: none; }
.btn:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn--ghost,
.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  border-color: var(--line-strong);
}
.btn--ghost:hover,
.btn--secondary:hover {
  background: var(--surface-2);
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn--accent { --btn-bg: var(--brand); --btn-fg: var(--on-brand); }
.btn--accent:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn--paper { --btn-bg: var(--surface-2); --btn-fg: var(--fg); }
.btn--lg { height: 48px; padding: 0 24px; }

.btn .arrow { transition: transform 200ms ease; display: inline-block; }
.btn:hover .arrow { transform: translateX(2px); }

/* --------------------------------------------------------------- link --- */

.ulink {
  position: relative;
  display: inline-block;
  color: inherit;
}
.ulink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.ulink:hover::after { transform: scaleX(1); transform-origin: left; }

a.text-brand, .link-brand { color: var(--brand-ink); }
a.text-brand:hover, .link-brand:hover { color: var(--brand); }

/* ------------------------------------------------------------- marquee --- */

.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: var(--marquee-gap, 3rem);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--marquee-gap, 3rem);
  min-width: 100%;
  animation: marquee var(--marquee-dur, 34s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee--rev .marquee__track { animation-direction: reverse; }
@keyframes marquee { to { transform: translateX(calc(-100% - var(--marquee-gap, 3rem))); } }

/* ------------------------------------------------------ numbered rows --- */

.row-link {
  position: relative;
  display: block;
  border-top: 1px solid var(--line);
  padding-block: clamp(28px, 4vw, 48px);
  transition: background 200ms ease, padding-inline 200ms ease;
}
.row-link:hover { background: var(--surface-2); padding-inline: 18px; }
.row-link__title { transition: transform 0.5s var(--ease-out), color 200ms ease; }
.row-link:hover .row-link__title { color: var(--fg); transform: translateX(6px); }

.row-peek {
  position: fixed;
  top: 0;
  left: 0;
  width: clamp(180px, 20vw, 280px);
  aspect-ratio: 16 / 10;
  border-radius: var(--r2);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  z-index: 60;
  border: 1px solid var(--line);
  transform: translate3d(-50%, -50%, 0) scale(0.96);
  transition: opacity 0.3s var(--ease-out), transform 0.45s var(--ease-out);
}
.row-peek[data-on="true"] { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1); }
.row-peek img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------- cards/grid --- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: 28px;
  transition: background 200ms ease, border-color 200ms ease;
}
.card:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  transform: none;
  box-shadow: none;
}

.media { overflow: hidden; border-radius: var(--r2); }
.media img { transition: transform 700ms var(--ease-out); }
.card:hover .media img,
.group:hover .media img { transform: scale(1.03); }

/* ------------------------------------------------------------- pieces --- */

.pieces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.piece {
  aspect-ratio: 1;
  border-radius: var(--r2);
  background: var(--surface-1);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-subtle);
  opacity: 0;
  transform: translate(var(--px, 0), var(--py, 0)) rotate(var(--pr, 0deg)) scale(0.85);
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--e);
  transition-delay: calc(var(--i, 0) * 0.08s);
}
.pieces[data-on="true"] .piece { opacity: 1; transform: none; }
.piece--accent {
  background: color-mix(in srgb, var(--brand-deep) 55%, var(--surface-1));
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--brand);
}

/* ------------------------------------------------------------ chapter --- */

.chapter { position: relative; }
.chapter__stage {
  position: sticky;
  top: var(--nav-h);
  height: calc(100dvh - var(--nav-h));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.layer {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s var(--ease-out), transform 0.65s var(--ease-out);
  pointer-events: none;
  width: 100%;
}
.layer[data-on="true"] { opacity: 1; transform: none; pointer-events: auto; }

.chapter__bar { height: 1px; background: var(--line); position: relative; overflow: hidden; }
.chapter__bar i {
  position: absolute; inset: 0;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

/* ---------------------------------------------------------- accordion --- */

.acc { border-top: 1px solid var(--line); }
.acc__head {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 2vw, 32px);
  padding-block: clamp(20px, 2.4vw, 32px);
  text-align: left;
  transition: color 200ms ease;
}
.acc__head:hover { color: var(--fg); }
.acc__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease-in-out), opacity 0.35s var(--ease-out);
  opacity: 0;
}
.acc[data-open="true"] .acc__body { grid-template-rows: 1fr; opacity: 1; }
.acc__body > div { overflow: hidden; }
.acc__sign { position: relative; width: 14px; height: 14px; flex: none; }
.acc__sign::before,
.acc__sign::after {
  content: "";
  position: absolute;
  background: currentColor;
  inset: 50% 0 auto 0;
  height: 1.5px;
  margin-top: -0.75px;
  transition: transform 0.4s var(--ease-out);
}
.acc__sign::after { transform: rotate(90deg); }
.acc[data-open="true"] .acc__sign::after { transform: rotate(0deg); }

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

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: transform 0.5s var(--ease-out), border-color 200ms ease, background 200ms ease;
}
.nav[data-stuck="true"] { border-bottom-color: var(--line); }
.nav[data-hidden="true"] { transform: translateY(-101%); }

.nav__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  background: var(--brand);
  width: 100%;
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}

.nav__link {
  position: relative;
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 200ms ease;
}
.nav__link:hover { color: var(--fg); }
.nav__link[data-active="true"] { color: var(--brand-ink); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: var(--bg);
  color: var(--fg);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease-in-out);
  overflow-y: auto;
}
.menu[data-open="true"] { clip-path: inset(0 0 0 0); }
.menu a {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
.menu[data-open="true"] a {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.12s + var(--i, 0) * 50ms);
}

/* -------------------------------------------------------------- cursor --- */

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  pointer-events: none;
  z-index: 80;
  transform: translate3d(-50%, -50%, 0);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), background 0.3s var(--ease-out), opacity 0.25s;
  opacity: 0;
}
.cursor[data-on="true"] { opacity: 1; }
.cursor[data-hot="true"] {
  width: 40px; height: 40px;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}
@media (pointer: coarse) { .cursor { display: none; } }

/* -------------------------------------------------------------- loader --- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  pointer-events: none;
  overflow: hidden;
}
.loader__blade {
  background: var(--bg);
  transform: translateY(0);
  will-change: transform;
  transition: transform 0.24s cubic-bezier(0.76, 0, 0.24, 1);
  transition-delay: calc(var(--i, 0) * 24ms);
}
.loader__blade:nth-child(odd)  { --dir: -101%; }
.loader__blade:nth-child(even) { --dir:  101%; }
.loader__blade + .loader__blade { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--brand) 35%, transparent); }
.loader[data-done="true"] .loader__blade { transform: translateY(var(--dir, -101%)); }
.loader__mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fg);
  font-family: var(--fd);
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  transition: opacity 0.14s linear, transform 0.22s var(--ease-out);
}
.loader[data-done="true"] .loader__mark { opacity: 0; transform: translateY(-8px); }

/* ------------------------------------------------------------ parallax --- */

[data-parallax] { will-change: transform; }

/* ---------------------------------------------------------------- form --- */

input.field,
select.field,
textarea.field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  height: 44px;
  padding: 0 14px;
  font-family: var(--fb);
  font-size: 15px;
  color: var(--fg);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
textarea.field { height: auto; padding: 12px 14px; resize: vertical; min-height: 120px; }
.field::placeholder { color: var(--fg-subtle); }
input.field:focus,
select.field:focus,
textarea.field:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent);
}
select.field { appearance: none; }

/* --------------------------------------------------------------- prose --- */

.prose-editorial { font-size: 1.0625rem; line-height: 1.7; color: var(--fg-muted); }
.prose-editorial > * + * { margin-top: 1.35em; }
.prose-editorial h2 {
  font-family: var(--fd);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--fg);
  margin-top: 2.2em;
}
.prose-editorial h3 {
  font-family: var(--fd);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin-top: 1.8em;
}
.prose-editorial p { color: var(--fg-muted); }
.prose-editorial a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose-editorial a:hover { color: var(--brand); }
.prose-editorial ul, .prose-editorial ol { padding-left: 1.2em; color: var(--fg-muted); }
.prose-editorial li + li { margin-top: 0.5em; }
.prose-editorial ul { list-style: disc; }
.prose-editorial ol { list-style: decimal; }
.prose-editorial blockquote {
  border-left: 2px solid var(--brand);
  padding-left: 1.2em;
  font-family: var(--fd);
  font-size: 1.25em;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.prose-editorial img { border-radius: var(--r2); }
.prose-editorial code {
  font-family: var(--fb);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--fg);
}
.prose-editorial pre {
  background: var(--surface-1);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 1.2em;
  border-radius: var(--r2);
  overflow-x: auto;
}
.prose-editorial pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose-editorial hr { border: 0; border-top: 1px solid var(--line); }
.prose-editorial table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.5;
}
.prose-editorial th, .prose-editorial td {
  padding: 0.7em 0.9em;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  color: var(--fg-muted);
}
.prose-editorial th {
  color: var(--fg);
  font-weight: 500;
  border-bottom-color: var(--line-strong);
  white-space: nowrap;
}
.prose-editorial td:first-child { color: var(--fg); min-width: 9em; }

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

.hero {
  position: relative;
  text-align: center;
  padding-top: clamp(3rem, 2rem + 4vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 2rem + 5vw, 6rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10%;
  width: min(720px, 90vw);
  height: min(420px, 55vw);
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--rp);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}
.hero-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: clamp(3rem, 2rem + 4vw, 5rem);
}
.status-strip__cell {
  padding: 1.25rem 1rem;
  text-align: left;
}
.status-strip__cell + .status-strip__cell {
  border-left: 1px solid var(--line);
}
.status-strip__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-subtle);
  margin-bottom: 0.4rem;
}
.status-strip__value {
  font-size: 15px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.4;
}
@media (max-width: 767px) {
  .status-strip { grid-template-columns: 1fr 1fr; }
  .status-strip__cell:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .status-strip__cell:nth-child(4) { border-top: 1px solid var(--line); }
}

/* ------------------------------------------------------ pipeline card --- */

.pipeline {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: 28px 24px;
  text-align: left;
}
.pipeline__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-subtle);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pipeline__title i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
}
.pipeline__flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pipeline__node {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pipeline__node--active {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
  color: var(--fg);
  background: color-mix(in srgb, var(--brand-deep) 40%, var(--surface-2));
}
.pipeline__node i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-subtle);
}
.pipeline__node--active i { background: var(--brand); }
.pipeline__edge {
  width: 18px;
  height: 1px;
  background: var(--line-strong);
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .pipeline__edge { display: none; }
  .pipeline__flow { gap: 10px; }
}

/* -------------------------------------------------- reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .reveal, .reveal-fade, .split [data-char], .split [data-word], .piece, .layer {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .loader { display: none; }
}

@media (max-width: 900px) {
  .chapter { height: auto !important; }
  .chapter__stage {
    position: static;
    height: auto;
    display: block;
    padding-block: clamp(48px, 10vw, 90px);
  }
  .layer {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    margin-bottom: clamp(40px, 9vw, 72px);
  }
  .layer:last-of-type { margin-bottom: 0; }
  .chapter .grid > .layer { grid-area: auto; }
}

/* ============================================================== MILO ===== */
/* Restyled as a dark chat panel. Behaviour (dock/centre/aside/bubble) kept. */

.milo {
  position: fixed;
  inset: 0;
  z-index: 58;
  pointer-events: none;
  contain: layout style;
}

.milo__stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  transform:
    translate(calc(-50% + var(--mx, 0px)), calc(-50% + var(--my, 0px)))
    scale(var(--ms, 1));
  transition: transform 0.85s var(--e);
  will-change: transform;
}

.milo[data-state="dock"] .milo__stage {
  --mx: calc(50vw - 56px);
  --my: calc(50vh - 56px);
  --ms: 1;
}
.milo[data-state="centre"] .milo__stage {
  --mx: 0px;
  --my: 20px;
  --ms: 1;
}
.milo[data-state="aside"] .milo__stage {
  --mx: calc(-50vw + 72px);
  --my: calc(50vh - 80px);
  --ms: 1;
}

.milo__stage { opacity: 0; }
.milo[data-on="true"] .milo__stage {
  opacity: 1;
  transition: transform 0.85s var(--e), opacity 0.5s var(--ease-out);
}

.milo__char {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
  color: var(--brand);
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.milo__char:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.milo__char:active { transform: scale(0.96); }
.milo__char-icon {
  width: 22px;
  height: 22px;
}
.milo__svg { display: none; }

.milo__head, .milo__antenna, .milo__pupils, .milo__body-g { transform: none !important; }

.milo__card {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 260px;
  background: var(--surface-1);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: 85% 100%;
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--e);
  pointer-events: none;
}
.milo[data-hover="true"][data-state="dock"] .milo__card { opacity: 1; transform: none; }
.milo__card p { font-size: 13.5px; line-height: 1.5; color: var(--fg-muted); }
.milo__card strong {
  display: block;
  font-family: var(--fd);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 3px;
}

.milo__bubble {
  pointer-events: auto;
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: min(330px, calc(100vw - var(--frame) * 2));
  background: var(--surface-1);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: 16px 18px 14px;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: 85% 100%;
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--e);
}
.milo[data-bubble="true"] .milo__bubble { opacity: 1; transform: none; }
.milo[data-hover="true"][data-state="dock"] .milo__bubble { opacity: 0; pointer-events: none; }

.milo[data-state="centre"] .milo__bubble {
  bottom: auto;
  top: calc(100% + 10px);
  right: 50%;
  transform-origin: 50% 0;
  transform: translate(50%, 12px) scale(0.96);
  width: min(420px, calc(100vw - var(--frame) * 2));
  text-align: center;
}
.milo[data-state="centre"][data-bubble="true"] .milo__bubble { transform: translate(50%, 0) scale(1); }
.milo[data-state="centre"] .milo__bubble::after { left: 50%; right: auto; margin-left: -6px; top: -6px; bottom: auto; }

.milo[data-state="aside"] .milo__bubble {
  bottom: auto;
  top: 50%;
  right: auto;
  left: calc(100% + 14px);
  width: min(380px, calc(100vw - 140px));
  transform: translateY(-50%) translateX(12px) scale(0.97);
  transform-origin: 0 50%;
  text-align: left;
}
.milo[data-state="aside"][data-bubble="true"] .milo__bubble { transform: translateY(-50%) scale(1); }
.milo[data-state="aside"] .milo__bubble::after { left: -6px; right: auto; top: 50%; bottom: auto; margin-top: -6px; }

.milo__bubble::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--surface-1);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
  border-radius: 2px;
}

.milo__eyebrow {
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 16px;
  margin-bottom: 10px;
}
.milo[data-state="centre"] .milo__eyebrow { justify-content: center; }
.milo__eyebrow i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  animation: guidePulse 2.4s var(--ease-in-out) infinite;
}
@keyframes guidePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.milo__text { font-size: 14px; line-height: 1.5; min-height: 2.9em; color: var(--fg-muted); }
.milo[data-state="aside"] .milo__text { min-height: 0; }
.milo__caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: var(--brand);
  vertical-align: text-bottom;
  animation: caretBlink 1s step-end infinite;
}
.milo[data-typing="false"] .milo__caret { display: none; }
@keyframes caretBlink { 50% { opacity: 0; } }

.milo__dots { display: none; gap: 5px; padding: 4px 0 6px; }
.milo[data-thinking="true"] .milo__dots { display: flex; }
.milo[data-state="centre"] .milo__dots { justify-content: center; }
.milo[data-thinking="true"] .milo__text { display: none; }
.milo__dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-subtle);
  animation: guideDots 1.1s var(--ease-in-out) infinite;
}
.milo__dots i:nth-child(2) { animation-delay: 0.15s; }
.milo__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes guideDots {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  40%      { transform: translateY(-4px); opacity: 1; }
}

.milo__ask {
  pointer-events: auto;
  position: relative;
  display: none;
  margin-top: 12px;
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  color: var(--brand);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}
.milo__ask[data-show="true"] { display: inline-block; }
.milo__ask::before { content: ""; position: absolute; inset: -14px -8px -12px; }
.milo__ask:hover { color: var(--brand-hover); border-color: var(--brand-hover); }

.milo__close {
  pointer-events: auto;
  position: absolute;
  top: 0; right: 0;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r1);
  font-family: var(--fb);
  font-size: 18px;
  line-height: 1;
  color: var(--fg-subtle);
  transition: color 200ms ease;
}
.milo__close:hover { color: var(--brand); }

.milo__recall {
  pointer-events: auto;
  position: absolute;
  right: var(--frame);
  bottom: var(--frame);
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--surface-1);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  transition: transform 0.4s var(--e), background 200ms ease, border-color 200ms ease;
}
.milo[data-min="true"] .milo__recall { display: flex; }
.milo[data-min="true"] .milo__stage { opacity: 0; pointer-events: none; }
.milo__recall:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.milo__recall i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
}

@media (max-width: 767px) {
  .milo[data-state] .milo__stage {
    width: 56px;
    --mx: calc(50vw - 28px - var(--frame));
    --my: calc(50vh - 28px - var(--frame));
    --ms: 1;
  }
  .milo .milo__bubble,
  .milo[data-state="centre"] .milo__bubble,
  .milo[data-state="aside"] .milo__bubble {
    bottom: calc(100% + 10px);
    top: auto;
    left: auto;
    right: 0;
    width: min(248px, calc(100vw - var(--frame) * 2));
    padding: 12px 14px;
    text-align: left;
    transform: translateY(10px) scale(0.96);
    transform-origin: 90% 100%;
  }
  .milo[data-bubble="true"] .milo__bubble,
  .milo[data-state="centre"][data-bubble="true"] .milo__bubble,
  .milo[data-state="aside"][data-bubble="true"] .milo__bubble { transform: none; }
  .milo .milo__bubble::after,
  .milo[data-state="centre"] .milo__bubble::after,
  .milo[data-state="aside"] .milo__bubble::after {
    left: auto; right: 22px; bottom: -6px; top: auto; margin: 0;
  }
  .milo[data-state] .milo__eyebrow { justify-content: flex-start; margin-bottom: 10px; min-height: 20px; }
  .milo__text,
  .milo[data-state] .milo__text { font-size: 13px; line-height: 1.45; min-height: 0; }
  .milo__ask { margin-top: 8px; }
  .milo__card { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .milo__char { animation: none; }
  .milo__stage { transition: none; }
  .milo__caret, .milo__eyebrow i, .milo__dots i { animation: none; }
}

/* ------------------------------------------------------- tap targets --- */

@media (max-width: 767px) {
  .tap-y { padding-block: 11px; }
  .tap-y.ulink::after { bottom: 9px; }
}
.tap-min { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }

.sr-only-f {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.hit { position: relative; }
.hit::before { content: ""; position: absolute; inset: -14px -6px; }

/* Footer */
.site-footer {
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  color: var(--fg);
}
.site-footer a { color: var(--fg-muted); font-size: 14px; transition: color 200ms ease; }
.site-footer a:hover { color: var(--fg); }

/* Blog thumb */
.thumb-frame {
  aspect-ratio: 16 / 10;
  border-radius: var(--r2);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-1);
}
.thumb-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
