/* Staterica public site. Tokens from the Brand Brain (01-brand-kit.md): ink and sand on ivory.
   Layout: alternating ivory and ink bands; one strong element per view; 4px corners, no shadows. */

@font-face {
  font-family: "Albert Sans";
  src: url("/fonts/AlbertSans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Albert Sans";
  src: url("/fonts/AlbertSans-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #1B2A41;
  --sand: #B08A55;
  --ivory: #F6F3EC;
  --slate: #5B6573;
  --white: #FFFFFF;
  --mist: #8E97A5;               /* slate lifted for use on ink */
  --hair: rgba(91, 101, 115, 0.28);
  --hair-dark: rgba(246, 243, 236, 0.18);
  --status-closing: #B08A55;

  --font: "Albert Sans", Aptos, Calibri, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 4px;
  --gutter: max(24px, env(safe-area-inset-left, 0px));
  --gutter-r: max(24px, env(safe-area-inset-right, 0px));
  --header-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--ivory); padding: 10px 14px; border-radius: var(--radius);
}
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}
.nowrap { white-space: nowrap; }

.band-ink { background: var(--ink); color: var(--ivory); }
.band-ivory { background: var(--ivory); color: var(--ink); }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--slate); margin-bottom: 20px;
}
.band-ink .eyebrow { color: var(--sand); }

.display {
  font-size: clamp(38px, 5.1vw, 70px);
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.statement {
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
.body { font-size: 18px; line-height: 1.65; max-width: 58ch; }
.band-ink .body { color: rgba(246, 243, 236, 0.82); }

/* ---------- Header: always visible, login top right ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--ink);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.solid { background: var(--ivory); border-bottom-color: var(--hair); }
.site-header.on-dark { color: var(--ivory); }
.site-header.on-dark.solid { background: var(--ink); border-bottom-color: var(--hair-dark); }
.header-row { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-mark .mk-grid rect { fill: none; stroke: currentColor; stroke-opacity: 0.45; stroke-width: 1.2; }
.brand-mark .mk-now { fill: currentColor; }
.brand-mark .mk-goal { fill: none; stroke: var(--sand); stroke-width: 2.6; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.wordmark { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.tagline { font-size: 12px; opacity: 0.72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-login {
  flex: none;
  display: inline-flex; align-items: center; height: 40px; padding: 0 20px;
  border-radius: var(--radius); font-size: 15px; font-weight: 600; text-decoration: none;
  background: var(--ink); color: var(--ivory); border: 1px solid var(--ink);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn-login:hover { background: transparent; color: var(--ink); }
.on-dark .btn-login { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.on-dark .btn-login:hover { background: transparent; color: var(--ivory); }

/* ---------- Nine-box figures ---------- */
.ninebox { overflow: visible; }
.nb-lines path { fill: none; stroke: currentColor; stroke-opacity: 0.32; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.nb-goal, .st-goal { fill: none; stroke: var(--sand); stroke-width: 4; }
.nb-now { fill: currentColor; }

/* ---------- 1 · Hero ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 940px);
  display: flex; align-items: center;
  padding-block: calc(var(--header-h) + 64px) 120px;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.hero-copy { min-width: 0; }
.hero .display .line, .hero .display .line > span { display: inline; }
.lede { margin-top: 32px; font-size: clamp(18px, 1.6vw, 21px); max-width: 44ch; color: rgba(246, 243, 236, 0.82); }
.hero-figure { color: var(--ivory); width: 100%; max-width: 420px; justify-self: end; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(246, 243, 236, 0.6);
}
.scroll-cue span { width: 1px; height: 36px; background: rgba(246, 243, 236, 0.4); transform-origin: top; }

/* ---------- 2 · Problem ---------- */
.problem { padding-block: clamp(96px, 14vw, 180px) clamp(64px, 8vw, 110px); }
.ledger { margin-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--ink); }
.ledger-head, .ledger dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.ledger-head { padding: 14px 0; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); border-bottom: 1px solid var(--hair); }
.ledger dl { margin: 0; }
.ledger dl > div { padding: 22px 0; border-bottom: 1px solid var(--hair); }
.ledger dt { font-size: 20px; font-weight: 600; line-height: 1.35; }
.ledger dd { margin: 0; font-size: 18px; color: var(--slate); line-height: 1.45; }

/* ---------- 3 · Method ---------- */
.method { padding-block: clamp(64px, 8vw, 110px) clamp(96px, 12vw, 160px); }
.method-title { max-width: none; font-size: clamp(40px, 7vw, 96px); line-height: 1.02; letter-spacing: -0.03em; }
.method-title span { display: block; }
.method-title span:nth-child(2) { padding-left: clamp(24px, 8vw, 140px); }
.method-title span:nth-child(3) { padding-left: clamp(48px, 16vw, 280px); }
.disciplines { margin-top: clamp(56px, 7vw, 96px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }
.discipline { border-top: 1px solid var(--ink); padding-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.discipline h3 { font-size: 24px; letter-spacing: -0.01em; }
.discipline p { font-size: 17px; }
.replaces { color: var(--slate); font-size: 15px !important; margin-top: auto; padding-top: 8px; }
.replaces span { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 2px; }

/* ---------- 4 · Story (pinned stage) ---------- */
.story { padding-block: clamp(96px, 12vw, 160px) 0; }
.story-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); margin-top: 24px; }
.steps { list-style: none; margin: 0; padding: 0 0 30vh; }
.step {
  min-height: 72vh; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  opacity: 0.32; transition: opacity 0.5s var(--ease);
}
.step.active { opacity: 1; }
.step-n { font-size: 14px; font-weight: 600; color: var(--sand); font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }
.step h3 { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.02em; }
.step p { font-size: 18px; max-width: 40ch; color: rgba(246, 243, 236, 0.82); }

.story-stage { position: relative; }
.stage-inner {
  position: sticky; top: calc(var(--header-h) + (100vh - var(--header-h)) / 2 - 260px);
  height: 520px; color: var(--ivory);
  display: grid; place-items: center;
}
.ninebox-story { width: 100%; max-width: 460px; transition: transform 0.9s var(--ease); }
.stage-inner:is([data-stage="4"], [data-stage="5"]) .ninebox-story { transform: translateX(-16%) scale(0.84); }
.axis text { fill: rgba(246, 243, 236, 0.6); font-family: var(--font); font-size: 13px; }
.axis .axis-title { fill: var(--ivory); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; }
.dots circle { fill: var(--ivory); opacity: 0; transition: opacity 0.6s var(--ease), fill 0.6s var(--ease), stroke 0.6s var(--ease); stroke-width: 2; }
.st-goal, .st-now, .st-path, .mini-page { opacity: 0; transition: opacity 0.6s var(--ease), transform 0.9s var(--ease); }
.st-now { fill: var(--ivory); }
.st-path { fill: none; stroke: var(--ivory); stroke-width: 2; stroke-dasharray: 6 8; stroke-opacity: 0.7; }
.stage-caption {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center;
  font-size: 14px; letter-spacing: 0.06em; color: rgba(246, 243, 236, 0.72);
}

.stage-inner[data-stage] .dots circle { opacity: 0.9; }
.stage-inner[data-stage="1"] .dots .s2,
.stage-inner[data-stage="1"] .dots .s3 { fill: transparent; stroke: var(--ivory); }
.stage-inner[data-stage="1"] .dots .s3 { stroke: var(--mist); stroke-dasharray: 3 3; }
.stage-inner[data-stage="2"] .dots circle,
.stage-inner[data-stage="3"] .dots circle,
.stage-inner[data-stage="4"] .dots circle,
.stage-inner[data-stage="5"] .dots circle { opacity: 0.14; }
.stage-inner:is([data-stage="2"], [data-stage="3"], [data-stage="4"], [data-stage="5"]) :is(.st-goal, .st-now) { opacity: 1; }
.stage-inner:is([data-stage="3"], [data-stage="4"], [data-stage="5"]) .st-path { opacity: 1; }
.stage-inner[data-stage="5"] .st-now { transform: translateX(100px); }
.stage-inner[data-stage="5"] .st-path { stroke-opacity: 0.35; }

.mini-page {
  position: absolute; right: 0; top: 50%; margin-top: -90px;
  width: 150px; padding: 14px; border-radius: var(--radius);
  background: var(--ivory); color: var(--ink);
  display: flex; flex-direction: column; gap: 7px;
  transform: translateY(24px);
}
.stage-inner:is([data-stage="4"], [data-stage="5"]) .mini-page { opacity: 1; transform: none; }
.mp-label { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate); }
.mp-bar { height: 6px; background: rgba(27, 42, 65, 0.16); border-radius: 1px; }
.w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.mp-bar.w60 { background: var(--ink); height: 8px; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 66px; margin: 4px 0; }
.mp-grid i { aspect-ratio: 1; border: 1px solid rgba(27, 42, 65, 0.3); }
.mp-grid i.n { background: var(--ink); border-color: var(--ink); }
.mp-grid i.g { border: 2px solid var(--sand); }

/* ---------- 5 · One page per stakeholder ---------- */
.review { padding-block: clamp(110px, 14vw, 190px) clamp(64px, 8vw, 110px); }
.review-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.review-copy { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.a3 {
  margin: 0; background: var(--white); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 36px); display: flex; flex-direction: column; gap: 22px; min-width: 0;
}
.a3-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.a3-brand { font-weight: 700; font-size: 16px; }
.a3-tag { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.a3-title { display: flex; flex-direction: column; gap: 2px; padding-bottom: 18px; border-bottom: 1px solid var(--hair); }
.a3-title strong { font-size: 22px; letter-spacing: -0.01em; }
.a3-title span { font-size: 14px; color: var(--slate); }
.a3-body { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 28px; align-items: start; }
.a3-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.a3-grid i { aspect-ratio: 1; border: 1px solid var(--hair); }
.a3-grid i.now { background: var(--ink); border-color: var(--ink); }
.a3-grid i.goal { border: 3px solid var(--sand); }
.a3-facts { margin: 0; display: flex; flex-direction: column; }
.a3-facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 15px; }
.a3-facts dt { color: var(--slate); }
.a3-facts dd { margin: 0; font-weight: 600; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.status.closing { background: rgba(176, 138, 85, 0.16); color: #7A5B30; }
.a3-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.a3-foot span { font-size: 13px; color: var(--slate); border-top: 2px solid var(--ink); padding-top: 8px; }

/* ---------- 6 · Roles ---------- */
.roles { padding-block: clamp(64px, 8vw, 110px) clamp(110px, 14vw, 180px); }
.role-table { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.role { border-top: 1px solid var(--ink); padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.role h3 { font-size: 19px; line-height: 1.25; }
.role p { font-size: 16px; color: var(--slate); }

/* ---------- 7 · Data ---------- */
.data { padding-block: clamp(110px, 14vw, 180px); }
.data-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 96px); align-items: end; }

/* ---------- 8 · Close ---------- */
.close { padding-block: clamp(110px, 14vw, 190px); }
.close-inner { display: flex; flex-direction: column; gap: 28px; }
.ninebox-close { width: 96px; color: var(--ink); margin-bottom: 4px; }
.lockup { display: flex; flex-direction: column; gap: 10px; }
.lockup-name { font-size: clamp(48px, 8vw, 112px); line-height: 1; letter-spacing: -0.03em; }
.lockup-tag { font-size: clamp(18px, 2vw, 24px); font-weight: 400; color: var(--slate); letter-spacing: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(246, 243, 236, 0.75); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); font-size: 15px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--ivory); font-weight: 700; font-size: 18px; }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ivory); text-decoration: underline; }
.footer-meta { margin-left: auto; }

/* ---------- Motion (only when JS runs and motion is allowed) ---------- */
@keyframes step-move {
  0%, 12% { transform: translate(0, 0); }
  13%, 25% { transform: translate(100px, 0); }
  26%, 38% { transform: translate(100px, -100px); }
  39%, 51% { transform: translate(200px, -100px); }
  52%, 88% { transform: translate(212px, -188px) scale(0.76); }
  89%, 100% { transform: translate(0, 0); }
}
@keyframes draw { from { stroke-dashoffset: 1800; } to { stroke-dashoffset: 0; } }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.motion .nb-now { animation: step-move 9s steps(1, end) infinite; transform-box: fill-box; transform-origin: 0 0; }
.motion .hero .nb-lines path,
.motion .close .nb-lines path { stroke-dasharray: 1800; animation: draw 2.4s var(--ease) both; }
.motion .hero .display { animation: fade-up 1.2s 0.1s var(--ease) both; }
.motion .lede { animation: fade-up 1s 0.5s var(--ease) both; }
.motion .scroll-cue span { animation: cue 2.4s var(--ease) infinite; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.motion .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); }
.motion .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .role-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid, .data-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-figure { max-width: 220px; justify-self: start; order: -1; }
  .hero { min-height: auto; padding-block: calc(var(--header-h) + 48px) 110px; }
  .disciplines { grid-template-columns: minmax(0, 1fr); }
  .ledger-head { display: none; }
  .ledger dl > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }

  /* Story: stage pinned at the top, steps scroll underneath */
  .story-grid { grid-template-columns: minmax(0, 1fr); }
  .story-stage { order: -1; position: sticky; top: var(--header-h); z-index: 2; background: var(--ink); padding-bottom: 8px; }
  .stage-inner { position: relative; top: 0; height: 330px; }
  .ninebox-story { max-width: 300px; }
  .mini-page { width: 104px; padding: 10px; right: 4px; margin-top: -70px; }
  .step { min-height: 60vh; justify-content: flex-start; padding-top: 24px; }
}
@media (max-width: 560px) {
  .tagline { display: none; }
  .role-table { grid-template-columns: minmax(0, 1fr); }
  .a3-body { grid-template-columns: minmax(0, 1fr); }
  .a3-grid { width: 120px; }
  .a3-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .footer-meta { margin-left: 0; }
}

/* ---------- Privacy policy and other legal pages ---------- */
.legal { padding-block: calc(var(--header-h) + 64px) clamp(80px, 10vw, 140px); }
.legal-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.legal-side { position: sticky; top: calc(var(--header-h) + 40px); display: flex; flex-direction: column; gap: 8px; }
.legal-side .eyebrow { margin-bottom: 0; }
.legal-date { font-size: 14px; color: var(--slate); margin-bottom: 16px; }
.toc { display: flex; flex-direction: column; border-left: 1px solid var(--hair); }
.toc a { font-size: 14px; color: var(--slate); text-decoration: none; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--ink); }
.legal-body { max-width: 70ch; min-width: 0; }
.legal-body .statement { margin-bottom: 20px; }
.legal-intro { font-size: 20px; line-height: 1.55; color: var(--ink); }
.legal-body section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--hair); scroll-margin-top: calc(var(--header-h) + 24px); }
.legal-body h2 { font-size: 24px; letter-spacing: -0.01em; margin-bottom: 14px; }
.legal-body h3 { font-size: 17px; margin: 24px 0 8px; }
.legal-body p + p { margin-top: 14px; }
.legal-body ul { margin: 12px 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.legal-body li::marker { color: var(--sand); }
.legal-table { overflow-x: auto; margin-top: 16px; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--white); }
.legal-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; }
.legal-table th, .legal-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.legal-table th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.legal-table tr:last-child td { border-bottom: 0; }
@media (max-width: 820px) {
  .legal-grid { grid-template-columns: minmax(0, 1fr); }
  .legal-side { position: static; }
  .toc { display: none; }
}
