/* ============================================================
   STIPULA · marketing site
   Dark, matched to the Stipula app (Procurement Intelligence):
   #0F1419 ground, Instrument Sans headings, system-sans body, blue accent,
   the coral brand voice and the red risk flag.
   Two voices: Instrument Sans argues · JetBrains Mono reports.
   ============================================================ */

:root {
  /* ---- Surfaces (matched to the app) ---- */
  --bg:      #0F1419;   /* page ground */
  --panel:   #1A2129;   /* lifted band: nav, footer, alternating sections, terminals */
  --panel2:  #212A34;   /* cards on panels: tickets, form fields, email */
  --border:  #2E3A46;   /* hairlines / card borders */

  /* ---- Text ---- */
  --text:     #E6EDF3;  /* primary */
  --muted:    #8B98A5;  /* metadata, eyebrows' cousins, secondary labels */
  --graphite: #AEB9C2;  /* body prose (a touch softer than --text) */

  /* ---- Interactive (blue, the app's accent) ---- */
  --blue:      #2F81F7; /* primary CTA fill, active, focus */
  --blue-lite: #4DA3FF; /* links, labels, kickers, system accents on dark */

  /* ---- Brand warm (the straw + its flag) ---- */
  --flag:        #D9381E;  /* the risk flag: SVG marks, ticker label */
  --flag-bright: #FF6B54;  /* brand voice: tagline, display emphasis, pullquote */

  /* ---- Severity / status ---- */
  --red:    #F85149;  /* HIGH severity, redline strike, FLAGGED */
  --amber:  #D29922;  /* MEDIUM severity */
  --green:  #3FB950;  /* savings, RECOMMENDED / RECEIVED, checks */

  /* ---- Hairlines ---- */
  --hair:      #2E3A46;
  --hair-soft: rgba(230,237,243,0.07);

  /* ---- Type ---- */
  --display: "Instrument Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* display + headings */
  --serif:   "Instrument Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* editorial italics */
  --sans:    -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* body, like the app */
  --mono:    "JetBrains Mono", "Courier New", ui-monospace, monospace;

  /* ---- Metrics ---- */
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------------- Reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
em { font-style: italic; }
.mono { font-family: var(--mono); }
.ochre { color: var(--flag-bright); }

/* keep interactive content above any decorative layers */
.nav, main, .footer, .skip-link { position: relative; z-index: 1; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--panel); color: var(--text); padding: 10px 16px;
  font-family: var(--mono); font-size: .8rem; border-radius: 2px;
  border: 1px solid var(--border);
  transition: top .2s;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------------- Kickers / eyebrows ---------------- */
.kicker {
  font-family: var(--mono); font-weight: 500; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .22em;
  color: var(--blue-lite); margin: 0 0 1.1rem;
}
.kicker--ochre { color: var(--blue-lite); }

/* ============================================================
   01 · NAV + TICKER
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.nav__bar {
  max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 22px;
  transition: padding .25s var(--ease);
}
.nav.is-shrunk .nav__bar { padding-top: 9px; padding-bottom: 9px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand__seal { display: flex; }
.brand__word { font-family: var(--display); font-weight: 500; font-size: 1.5rem; letter-spacing: .01em; }

.nav__ticket {
  margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-family: var(--mono); font-size: .6875rem; color: var(--muted);
  letter-spacing: .06em; margin-right: auto;
}
.nav__ticket .dot { color: rgba(139,152,165,.5); }
.nav__ticket .online { color: var(--green); display: inline-flex; align-items: center; gap: 6px; }
.nav__ticket .online i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(63,185,80,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(63,185,80,.5)} 70%{box-shadow:0 0 0 6px rgba(63,185,80,0)} 100%{box-shadow:0 0 0 0 rgba(63,185,80,0)} }

.nav__links { display: flex; gap: 20px; }
.nav__links a {
  font-family: var(--mono); font-size: .8125rem; text-decoration: none;
  color: var(--text); letter-spacing: .03em; padding-bottom: 3px;
  background-image: linear-gradient(var(--blue-lite), var(--blue-lite));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1.5px;
  transition: background-size .25s var(--ease);
}
.nav__links a:hover { background-size: 100% 1.5px; }

/* Ticker */
.ticker {
  display: flex; align-items: stretch; background: var(--bg);
  border-top: 1px solid var(--border); overflow: hidden;
}
.ticker__label {
  flex: none; display: flex; align-items: center; padding: 7px 16px;
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .14em;
  color: #fff; background: var(--flag); font-weight: 700;
}
.ticker__mask { overflow: hidden; flex: 1; }
.ticker__track { display: flex; width: max-content; animation: crawl 42s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__group { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.ticker__group li {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 8px 24px; white-space: nowrap;
  font-family: var(--mono); font-size: .8125rem; letter-spacing: .04em;
  color: var(--graphite); border-right: 1px solid var(--border);
}
.ticker__group b { font-style: normal; }
.t-high b { color: var(--red); } .t-med b { color: var(--amber); }
.t-good b { color: var(--green); } .t-good { color: var(--muted); }
.ticker__group li[data-gloss] { cursor: help; }
.ticker__group li[data-gloss]::after {
  content: attr(data-gloss); position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%); width: max-content; max-width: 320px;
  background: var(--panel); color: var(--text); font-family: var(--sans);
  font-size: .8rem; line-height: 1.4; letter-spacing: 0; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 4px; white-space: normal;
  opacity: 0; visibility: hidden; transition: opacity .18s; z-index: 5;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.ticker__group li[data-gloss]:hover::after { opacity: 1; visibility: visible; }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   Shared: stations, terminals, buttons, stamps, seals
   ============================================================ */
.station { display: flex; align-items: baseline; gap: 18px; padding: 6px 0 34px; }
.station::before {
  content: ""; flex: 1; height: 1px; order: 2;
  background: var(--border);
}
.station--ink::before { background: var(--border); }
.station__no {
  order: 1; font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  color: var(--blue-lite); line-height: 1;
}
.station__tag {
  order: 3; font-family: var(--mono); font-size: .6875rem; letter-spacing: .16em;
  color: var(--muted); white-space: nowrap;
}
.station--ink .station__tag { color: var(--muted); }

/* Terminal (readout) panels: cards, like the app */
.terminal {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 26px; position: relative; overflow: hidden;
}
.terminal > * { position: relative; z-index: 1; }
.terminal__meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px; padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px dashed var(--border);
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em; color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--mono); font-size: .8125rem; font-weight: 500; letter-spacing: .04em;
  padding: 13px 22px; border: none; cursor: pointer; border-radius: 8px;
  transition: transform .12s var(--ease), box-shadow .2s, background .2s;
}
.btn--lg { padding: 16px 28px; font-size: .875rem; }
.btn--seal {
  color: #fff; background: var(--blue);
  box-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.btn--seal:hover { background: #4a92ff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(47,129,247,.35); }
.btn--seal:active { transform: translateY(1px); background: #2670e0; box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn--ghost { color: var(--text); background: transparent; border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--blue); }
.btn--ghost-ink { color: var(--text); border-color: var(--border); }
.btn--ghost-ink:hover { border-color: var(--blue-lite); color: #fff; }

/* Stamps: verdicts, off-register, double-ruled */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 7px 14px; border: 2px solid currentColor; border-radius: 3px;
  box-shadow: inset 0 0 0 1px currentColor; opacity: .9;
  transform: rotate(-4deg);
}
.stamp small { font-size: .5rem; letter-spacing: .2em; opacity: .85; }
.stamp--high { color: var(--red); }
.stamp--received { color: var(--green); font-size: 1.1rem; transform: rotate(-7deg); }

/* Brand mark: the broken straw + risk flag */
.footer__mark { display: block; }
.footer__mark svg { display: block; }

/* ============================================================
   02 · HERO
   ============================================================ */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 8vw, 112px); }
.hero__grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero__head {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.75rem, 6vw, 4.75rem); line-height: 1.06; letter-spacing: -0.03em;
  margin: 0 0 1.4rem;
}
.hero__head em { font-style: italic; color: var(--flag-bright); font-weight: 500; }
.hero__sub { font-size: clamp(1.06rem, 1.5vw, 1.2rem); line-height: 1.6; color: var(--graphite); max-width: 60ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 1.9rem 0 1.2rem; }
.disclaimer { font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; color: var(--muted); margin: 0; }
.disclaimer--inline { margin-top: 1rem; }

/* Hero specimen clause */
.hero__spec { align-self: stretch; }
.clause {
  position: relative; padding: 4px 4px 4px 20px; margin-bottom: 6px;
}
.clause__bar {
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--red);
  transform-origin: top; transform: scaleY(1);
}
.clause[data-sev="med"] .clause__bar { background: var(--amber); }
.clause__no { font-family: var(--mono); font-size: .6875rem; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.clause__text { font-family: var(--mono); font-size: .9rem; line-height: 1.7; color: var(--text); margin: 0 0 12px; }
.strike {
  color: #F2B6BA;
  background-image: linear-gradient(var(--red), var(--red));
  background-repeat: no-repeat; background-position: 0 58%; background-size: 100% 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.clause__note { position: relative; padding: 4px 0 4px 22px; margin: 0 0 12px; }
.clause__note .leader { position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--blue); }
.clause__note em { font-family: var(--serif); font-style: italic; font-size: .95rem; color: var(--graphite); }
.lever { font-family: var(--mono); font-size: .8rem; line-height: 1.6; color: var(--graphite); margin: 0; padding: 12px 14px; background: rgba(47,129,247,.1); border-left: 2px solid var(--blue); border-radius: 0 4px 4px 0; }
.lever__tag { color: var(--blue-lite); font-weight: 700; margin-right: 8px; letter-spacing: .12em; }
.hero__spec .stamp { position: absolute; top: 18px; right: 20px; }
.sev { font-family: var(--mono); font-size: .625rem; font-weight: 700; letter-spacing: .1em; padding: 2px 6px; border-radius: 2px; }
.sev--high { color: var(--red); border: 1px solid var(--red); }
.sev--med { color: var(--amber); border: 1px solid var(--amber); }
.sev--blue { color: var(--blue-lite); border: 1px solid var(--blue); }

/* ============================================================
   03 · PROBLEM (ink band) & full-bleed helper
   ============================================================ */
.ink-bleed { background: var(--bg); color: var(--text); position: relative; padding: clamp(56px, 7vw, 96px) 0; }
.ink-bleed > .wrap { position: relative; z-index: 1; }
#problem, #brochure { background: var(--panel); }
.problem__head { margin-bottom: 40px; }
.problem__title { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.1; color: var(--text); }
.risklog { list-style: none; margin: 0; padding: 0; counter-reset: rl; border-top: 1px solid var(--border); }
.risklog__row {
  counter-increment: rl; display: grid;
  grid-template-columns: 26px 22px 250px 1fr; gap: 20px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--border);
}
.risklog__row::before { grid-column: 1; content: counter(rl, decimal-leading-zero); font-family: var(--mono); font-size: .6875rem; color: var(--muted); }
.risklog__glyph { grid-column: 2; font-size: .8rem; }
.risklog__row[data-sev="high"] .risklog__glyph { color: var(--red); }
.risklog__row[data-sev="med"] .risklog__glyph { color: var(--amber); }
.risklog__term { grid-column: 3; font-family: var(--mono); font-size: .875rem; font-weight: 500; letter-spacing: .08em; color: var(--text); }
.risklog__say { grid-column: 4; color: var(--graphite); font-size: 1.02rem; }
.problem__foot { margin-top: 34px; color: var(--muted); font-size: .8rem; letter-spacing: .04em; max-width: 80ch; }

/* ============================================================
   04–06 · CAPABILITIES
   ============================================================ */
.cap { padding: clamp(56px, 8vw, 104px) 0; }
#review, #security { background: var(--panel); }
/* On panel-ground sections, lift the readout cards a step so they float above the surface (like the app). */
#review .terminal, #security .terminal { background: var(--panel2); }
.cap__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
/* Flipped capability: readout-left / prose-right, achieved purely via DOM
   order (terminal comes first in the markup), so no direction hacks needed. */
.cap__prose h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.1; margin-bottom: 1.1rem; }
.cap__prose p { color: var(--graphite); max-width: 62ch; }
.cap__prose em { color: var(--text); font-style: italic; }
.footnotes { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.footnotes li { font-family: var(--mono); font-size: .78rem; line-height: 1.6; color: var(--graphite); padding: 8px 0 8px 0; border-top: 1px dashed var(--border); }
.footnotes span { color: var(--blue-lite); font-weight: 700; margin-right: 8px; letter-spacing: .1em; }

/* Ledger tables */
.ledger { width: 100%; border-collapse: collapse; font-family: var(--mono); }
.ledger th { text-align: left; font-size: .625rem; font-weight: 500; letter-spacing: .12em; color: var(--muted); padding: 0 10px 10px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.ledger th.num, .ledger td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger td { padding: 13px 10px; font-size: .85rem; color: var(--text); border-bottom: 1px solid var(--border); }
.ledger__row td:first-child { color: #fff; }
.ledger--rec { background: rgba(63,185,80,.12); }
.ledger--rec td:first-child { color: var(--green); font-weight: 700; }
.ledger--rec .num b { color: var(--green); }
.tick { color: var(--green); margin-left: 6px; }
.flags { display: flex; flex-wrap: wrap; gap: 5px; }
.flag { font-size: .5625rem; letter-spacing: .06em; padding: 3px 6px; border-radius: 2px; white-space: nowrap; }
.flag--amber { color: var(--amber); border: 1px solid rgba(210,153,34,.5); }
.ledger__balance { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--green); padding: 14px 10px 0; }
.ledger__total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 16px; border: 1px solid var(--green); border-radius: 6px; background: rgba(63,185,80,.08); }
.ledger__total-l { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.ledger__total-v { font-family: var(--mono); font-weight: 700; font-size: 1.5rem; color: var(--green); font-variant-numeric: tabular-nums; }
.ledger__method { margin: 10px 2px 0; font-size: .625rem; color: var(--muted); letter-spacing: .04em; }

/* Contract review specifics */
.review__score { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.score { flex: 1; min-width: 90px; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.score b { display: block; font-family: var(--mono); font-weight: 700; font-size: 1.7rem; color: var(--text); }
.score span { font-family: var(--mono); font-size: .625rem; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.score--high b { color: var(--red); }
.review__doc .clause { padding: 14px 4px 16px 20px; border-bottom: 1px solid var(--border); margin: 0; }
.missing { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--border); }
.missing__head { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: var(--amber); text-transform: uppercase; margin-bottom: 12px; }
.missing ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.missing li { font-family: var(--mono); font-size: .78rem; color: var(--graphite); display: flex; align-items: center; gap: 10px; }
.missing .box { width: 13px; height: 13px; border: 1px solid var(--amber); border-radius: 1px; flex: none; position: relative; }
.missing .box::after { content: "✕"; position: absolute; inset: -3px 0 0; text-align: center; color: var(--amber); font-size: .7rem; }
.btn--email { margin-top: 22px; background: transparent; color: var(--blue-lite); border: 1px solid var(--blue); }
.btn--email:hover { background: rgba(47,129,247,.12); }
.email { margin-top: 16px; padding: 16px; background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; font-family: var(--mono); font-size: .78rem; line-height: 1.65; color: var(--graphite); }
.email p { margin: 0 0 .7rem; }
.email__meta { color: var(--muted); font-size: .625rem; letter-spacing: .06em; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--border); }

/* Spend findings */
.finding { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.finding:last-of-type { border-bottom: 0; }
.finding__head { font-family: var(--display); font-weight: 500; font-size: 1rem; color: #fff; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.finding__rows { font-size: .78rem; color: var(--muted); margin: 0; letter-spacing: .04em; }
.finding__amt { margin-left: auto; font-family: var(--mono); font-weight: 700; color: var(--red); font-size: 1.05rem; }
.finding__act { margin-left: auto; font-size: .7rem; letter-spacing: .12em; color: var(--blue-lite); border: 1px solid var(--blue); padding: 5px 10px; border-radius: 2px; }
.finding--dupe { position: relative; }
.brace { width: 3px; align-self: stretch; background: var(--red); border-radius: 2px; }
.approx { color: var(--blue-lite); padding: 0 4px; }
.finding--merge .finding__rows { border-bottom: 1px dashed var(--blue); padding-bottom: 3px; display: inline-block; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; margin: 0 8px; vertical-align: middle; }
.spark i { width: 4px; background: var(--amber); }
.spark i:nth-child(1){height:5px} .spark i:nth-child(2){height:8px} .spark i:nth-child(3){height:10px} .spark i:nth-child(4){height:14px}
.up { color: var(--amber); }

/* Security / data-flow readout */
.dataflow { list-style: none; margin: 0 0 18px; padding: 0; }
.dataflow li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .82rem; }
.dataflow li:first-child { border-top: 1px solid var(--border); }
.df-node { color: var(--text); }
.df-node::before { content: "\25B8\00a0"; color: var(--blue-lite); }
.df-ok { color: var(--green); font-size: .72rem; letter-spacing: .03em; text-align: right; }
.df-ok::before { content: "\2713\00a0"; }
.df-opt { color: var(--amber); font-size: .72rem; letter-spacing: .03em; text-align: right; }
.df-opt::before { content: "\2192\00a0"; }
.dataflow__tally { display: grid; gap: 8px; }
.dataflow__tally div { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; background: rgba(63,185,80,.07); border-left: 2px solid var(--green); }
.dataflow__tally b { color: var(--green); font-weight: 700; }

/* ============================================================
   07 · USE CASES
   ============================================================ */
.cases { padding: clamp(56px, 8vw, 104px) 0; }
#cases { background: var(--panel); }
.cases__head { margin-bottom: 40px; max-width: 46ch; }
.cases__head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.1; }
/* Filed field tickets: staggered, perforated, corner-stamped; deliberately
   NOT a uniform card matrix. */
.cases__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.ticket { position: relative; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 34px 26px 26px; }
.ticket:nth-child(3n+2) { background: var(--bg); }
.ticket::before { content: ""; position: absolute; top: 10px; left: 18px; right: 18px; border-top: 1px dashed var(--border); }
.ticket__tag { font-family: var(--mono); font-size: .625rem; letter-spacing: .14em; color: var(--muted); margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); max-width: 76%; }
.ticket h3 { font-family: var(--display); font-weight: 500; font-size: 1.4rem; margin-bottom: .6rem; line-height: 1.15; }
.ticket p { color: var(--graphite); font-size: .96rem; margin: 0; }
.ticket em { font-style: italic; color: var(--text); }
.ticket__foot { position: absolute; top: 20px; right: 20px; margin: 0; transform: rotate(-4deg);
  font-family: var(--mono); font-size: .5625rem; letter-spacing: .12em; color: var(--blue-lite);
  border: 1px solid rgba(77,163,255,.5); border-radius: 2px; padding: 3px 7px; }

/* ============================================================
   08 · HOW IT WORKS
   ============================================================ */
.how__head { margin-bottom: 44px; }
.how__head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.9rem, 4vw, 3rem); color: var(--text); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.step { position: relative; padding: 0 28px; border-left: 1px solid var(--border); }
.step:first-child { padding-left: 0; border-left: 0; }
.step__no { font-family: var(--mono); font-size: .8rem; color: var(--blue-lite); letter-spacing: .1em; }
.step h3 { font-family: var(--display); font-weight: 500; font-size: 1.6rem; color: var(--text); margin: 10px 0 12px; }
.step p { color: var(--graphite); font-size: .98rem; }
.step em { color: var(--blue-lite); font-style: italic; }
.how__foot { margin-top: 40px; padding-top: 22px; border-top: 1px dashed var(--border); color: var(--muted); font-size: .78rem; letter-spacing: .03em; max-width: 82ch; }

/* ============================================================
   09 · HERITAGE
   ============================================================ */
.heritage { background: var(--bg); padding: clamp(64px, 9vw, 128px) 0 clamp(72px, 9vw, 120px); position: relative; text-align: center; }
.heritage__deckle { position: absolute; top: -1px; left: 0; right: 0; height: 22px; background: var(--panel);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H120 V10 Q110 22 100 12 T80 12 T60 12 T40 12 T20 12 T0 12 Z' fill='black'/%3E%3C/svg%3E") repeat-x bottom / 120px 22px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H120 V10 Q110 22 100 12 T80 12 T60 12 T40 12 T20 12 T0 12 Z' fill='black'/%3E%3C/svg%3E") repeat-x bottom / 120px 22px; }
.heritage__inner { max-width: 760px; }
.heritage .station { justify-content: center; }
.heritage .station::before { display: none; }
.heritage__mark { margin: 6px auto 0; }
.straw { stroke: var(--muted); stroke-width: 5; stroke-linecap: round; }
.straw-break { fill: var(--flag-bright); }
.heritage__word { font-family: var(--display); font-weight: 500; font-style: italic; font-size: clamp(3.5rem, 10vw, 6.5rem); color: var(--text); line-height: 1; margin: 6px 0 24px; }
.heritage__body { max-width: 58ch; margin: 0 auto; }
.heritage__body p { font-size: 1.14rem; line-height: 1.7; color: var(--graphite); }
.heritage__body strong { color: var(--text); }
.heritage__body .pullquote { font-family: var(--display); font-style: italic; font-weight: 500; font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--flag-bright); margin: 1.6rem 0; line-height: 1.1; }

/* ============================================================
   10 · BROCHURE
   ============================================================ */
.brochure__grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.brochure__lead h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.8rem, 3.4vw, 2.7rem); color: var(--text); line-height: 1.12; margin-bottom: 1rem; }
.brochure__lead p { color: var(--graphite); max-width: 56ch; }
.manifest { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.manifest li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: .82rem; letter-spacing: .04em; color: var(--graphite); }
.manifest b { color: var(--muted); font-weight: 400; }
.manifest__ico { color: var(--blue-lite); }
.brochure__act { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.brochure__act .btn { width: 100%; justify-content: center; }
.brochure__view { font-family: var(--mono); font-size: .72rem; color: var(--blue-lite); text-decoration: none; letter-spacing: .04em; }
.brochure__view:hover { text-decoration: underline; }

/* ============================================================
   11 · CONTACT
   ============================================================ */
.contact { padding: clamp(56px, 8vw, 104px) 0; }
.contact__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact__lead h2 { font-family: var(--display); font-weight: 500; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; margin-bottom: 1.1rem; }
.contact__lead p { color: var(--graphite); max-width: 46ch; }
.contact__lead em { font-style: italic; color: var(--text); }
.contact__aside { font-family: var(--display); font-style: italic; font-size: 1.35rem; color: var(--flag-bright); margin-top: 1.6rem; }
.form { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: clamp(24px, 3vw, 38px); background: var(--panel); }
.form__meta { font-family: var(--mono); font-size: .625rem; letter-spacing: .16em; color: var(--muted); margin: 0 0 22px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-family: var(--mono); font-size: .625rem; letter-spacing: .16em; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: none; border-bottom: 1px solid var(--border);
  background: transparent; font-family: var(--sans); font-size: 1rem; color: var(--text);
  padding: 8px 2px; border-radius: 0; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--blue); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.form__submit { margin-top: 8px; }
.form__submit:disabled { pointer-events: none; }
.form__submit.is-sending { opacity: .85; }
.form__submit.is-sending span { display: none; }
.form__submit.is-sending::after {
  content: ""; width: 13px; height: 13px; flex: none; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: form-spin .7s linear infinite;
}
@keyframes form-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .form__submit.is-sending::after { animation-duration: 2s; }
}
.form__note { min-height: 1.2em; margin: 0 0 12px; font-family: var(--mono); font-size: .78rem; letter-spacing: .03em; }
.form__note.is-err { color: var(--red); }
.form__note.is-ok { color: var(--green); }
.stamp--received { position: absolute; top: 30px; right: 26px; }

/* ============================================================
   12 · FOOTER
   ============================================================ */
.footer { background: var(--panel); color: var(--graphite); padding: clamp(48px, 6vw, 80px) 0 32px; position: relative; border-top: 1px solid var(--border); }
.footer .wrap { position: relative; z-index: 1; }
.footer__grid { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.footer__tag { font-family: var(--display); font-weight: 500; font-size: 1.8rem; color: var(--text); line-height: 1.12; margin: 18px 0 0; }
.footer__nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer__h { font-family: var(--mono); font-size: .625rem; letter-spacing: .16em; color: var(--muted); margin: 0 0 14px; }
.footer__nav a { display: block; font-family: var(--mono); font-size: .8rem; color: var(--graphite); text-decoration: none; padding: 5px 0; letter-spacing: .02em; }
.footer__nav a:hover { color: var(--blue-lite); }
.footer__foot { padding-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; }
.footer__foot p { font-size: .68rem; letter-spacing: .05em; color: var(--muted); margin: 0; }
.footer__foot a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); }
.footer__foot a:hover { color: var(--blue-lite); }
.footer__doc { color: var(--muted); }

/* ============================================================
   REVEAL / MOTION
   ============================================================ */
/* Start-states gated behind `.js` so a no-JS page shows the final state. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* clause-catch reveal: start state (JS only) */
.js .clause--reveal .clause__bar { transform: scaleY(0); transition: transform .3s var(--ease) .05s; }
.js .clause--reveal .strike { background-size: 0% 2px; transition: background-size .3s ease .28s; }
.js .clause--reveal .clause__note { opacity: 0; transform: translateX(-6px); transition: opacity .4s ease .48s, transform .4s var(--ease) .48s; }
.js .clause--reveal .lever { opacity: 0; transform: translateY(4px); transition: opacity .4s ease .62s, transform .4s var(--ease) .62s; }
.js .clause--reveal .stamp { opacity: 0; transform: rotate(-4deg) scale(1.14); transition: opacity .18s ease .8s, transform .28s var(--ease) .8s; }
.clause--reveal.is-caught .clause__bar { transform: scaleY(1); }
.clause--reveal.is-caught .strike { background-size: 100% 2px; }
.clause--reveal.is-caught .clause__note { opacity: 1; transform: none; }
.clause--reveal.is-caught .lever { opacity: 1; transform: none; }
.clause--reveal.is-caught .stamp { opacity: .9; transform: rotate(-4deg) scale(1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker__track { animation: none; }
  .nav__ticket .online i { animation: none; }
  .clause--reveal .clause__bar,
  .clause--reveal .strike,
  .clause--reveal .clause__note,
  .clause--reveal .lever,
  .clause--reveal .stamp { transition: none; }
  .clause--reveal .clause__bar { transform: scaleY(1); }
  .clause--reveal .strike { background-size: 100% 2px; }
  .clause--reveal .clause__note,
  .clause--reveal .lever { opacity: 1; transform: none; }
  .clause--reveal .stamp { opacity: .9; transform: rotate(-4deg) scale(1); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .nav__ticket { display: none; }
  .cases__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  /* Drop nav links before the CTA can collide with them (561–650 band) */
  .nav__links { display: none; }
}
@media (max-width: 900px) {
  .hero__grid,
  .cap__grid,
  .brochure__grid,
  .contact__grid { grid-template-columns: 1fr; }
  .cap--flip .cap__prose { order: 1; }
  .cap--flip .cap__grid > .terminal { order: 2; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .step { padding: 0 0 0 22px; border-left: 1px solid var(--border); }
  .step:first-child { padding-left: 22px; border-left: 1px solid var(--border); }
  .risklog__row { grid-template-columns: 22px 22px 1fr; gap: 8px 14px; }
  .risklog__term { grid-column: 3; }
  .risklog__say { grid-column: 3; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cases__grid { grid-template-columns: 1fr; }
  .missing ul { grid-template-columns: 1fr; }
  .review__score { flex-direction: row; }
  .footer__nav { grid-template-columns: 1fr 1fr; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .station__tag { white-space: normal; text-align: right; }
}

/* Tables never force the page to scroll sideways */
.cap__ledger { overflow-x: auto; }
