/* ============================================================================
   UnitSense Marketing — styles.css
   Shared editorial / Riso design system. Tokens ported from the product
   (unitsense/dashboard globals.css, via docs-site/css/docs.css) so the
   marketing site matches the portal + docs. No Tailwind, no build step.
   Components use token vars only — never hardcode hex — so dark mode is free.
   ========================================================================== */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Light Mode (default) — Riso/Editorial ─── */
:root, .light {
  --paper:        #f4f1e8;
  --paper-2:      #ece7d8;
  --ink:          #1a1f36;
  --ink-soft:     #4a4e66;
  --ink-faint:    rgba(26, 31, 54, 0.55);

  --pink:            #e84a9f;
  --pink-deep:       #a83368;
  --chartreuse:      #d4ff00;
  --chartreuse-deep: #6a8000;

  --rule:         rgba(26, 31, 54, 0.12);
  --rule-soft:    rgba(26, 31, 54, 0.06);
  --rule-strong:  var(--ink);

  /* Buttons — mirror product component tokens */
  --btn-primary-bg:       var(--ink);
  --btn-primary-fg:       var(--chartreuse);
  --btn-primary-bg-hover: var(--pink);
  --btn-primary-fg-hover: var(--paper);
  --btn-ghost-fg:         var(--ink);
  --btn-ghost-border:     var(--ink);

  /* Code / ledger surfaces */
  --code-bg:      #14182b;
  --code-fg:      #f4f1e8;
  --code-inline:  rgba(26, 31, 54, 0.06);

  --radius:       2px;

  /* Type roles */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-figures: 'DM Mono', ui-monospace, monospace;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --maxw:         1120px;
}

/* ─── Dark Mode — Riso/Editorial ─── */
.dark {
  --paper:        #14182b;
  --paper-2:      #0c0f1d;
  --ink:          #f4f1e8;
  --ink-soft:     #b3b1a6;
  --ink-faint:    rgba(244, 241, 232, 0.45);

  --pink:            #e84a9f;
  --pink-deep:       #f06bb0;
  --chartreuse:      #d4ff00;
  --chartreuse-deep: #d4ff00;

  --rule:         #2a2f4a;
  --rule-soft:    #1d2237;
  --rule-strong:  var(--ink);

  --btn-primary-bg:       var(--ink);
  --btn-primary-fg:       var(--paper);
  --btn-primary-bg-hover: var(--pink);
  --btn-primary-fg-hover: var(--paper);
  --btn-ghost-fg:         var(--ink);
  --btn-ghost-border:     var(--ink);

  --code-bg:      #0c0f1d;
  --code-fg:      #f4f1e8;
  --code-inline:  rgba(244, 241, 232, 0.07);
}

/* ─── Base ─── */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 200ms ease, color 200ms ease;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

::selection { background: var(--chartreuse); color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: var(--ink-faint) transparent; }

/* ─── Layout primitives ─── */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--rule); }

/* Mono eyebrow — encodes a section's role, not decoration */
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--pink);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ''; width: 18px; height: 1px; background: var(--pink); display: inline-block;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border: 1px solid transparent; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  letter-spacing: -0.01em; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); color: var(--btn-primary-fg-hover); }
.btn-ghost { background: transparent; color: var(--btn-ghost-fg); border-color: var(--btn-ghost-border); }
.btn-ghost:hover { background: var(--btn-ghost-border); color: var(--paper); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ─── Nav ─── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; gap: 18px;
  height: 62px;
}
.brand { display: flex; align-items: baseline; gap: 9px; flex-shrink: 0; margin-right: 6px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand-sub {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint);
}
.nav-spacer { flex: 1; }
.nav-link {
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  padding: 6px 4px; transition: color .15s;
}
.nav-link:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--rule);
  border-radius: var(--radius); background: transparent; color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.theme-toggle:hover { border-color: var(--rule-strong); background: var(--rule-soft); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.dark .theme-toggle .icon-sun { display: block; }
.dark .theme-toggle .icon-moon { display: none; }

/* ─── Hero ─── */
.hero { padding: 92px 0 84px; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
}
.hero h1 {
  font-weight: 800; font-size: clamp(38px, 6vw, 68px);
  letter-spacing: -0.035em; line-height: 1.02; margin: 20px 0 22px;
}
.hero h1 .mark { color: var(--pink); }
.hero-sub {
  font-size: clamp(17px, 2vw, 20px); line-height: 1.55;
  color: var(--ink-soft); max-width: 36ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-microcopy {
  margin-top: 16px; font-size: 14px; color: var(--ink-faint);
  font-family: var(--font-body);
}
.hero-ladder {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--ink-soft); text-transform: uppercase;
}

/* ─── Signature: the Scorecard / ledger card ─── */
.scorecard {
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper-2); overflow: hidden;
  box-shadow: 6px 6px 0 var(--rule);
}
.scorecard-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--rule);
  background: var(--ink); color: var(--paper);
}
.scorecard-head .sc-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--chartreuse);
}
.scorecard-head .sc-meta {
  font-family: var(--font-mono); font-size: 11px; color: rgba(244,241,232,.6);
}
.scorecard-grade {
  display: flex; align-items: center; gap: 18px; padding: 22px 18px;
  border-bottom: 1px dashed var(--rule);
}
.scorecard-grade .grade {
  font-family: var(--font-display); font-weight: 800; font-size: 64px;
  line-height: 1; letter-spacing: -0.04em; color: var(--ink);
}
.scorecard-grade .grade-by {
  font-family: var(--font-figures); font-size: 13px; color: var(--ink-soft); line-height: 1.5;
}
.scorecard-grade .grade-by b { color: var(--ink); font-weight: 600; }
.sc-rows { padding: 8px 0; }
.sc-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 9px 18px; font-family: var(--font-figures); font-size: 13px;
}
.sc-row .sc-name { color: var(--ink); }
.sc-row .sc-val { color: var(--ink-soft); text-align: right; }
.sc-row .sc-tag {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--radius); border: 1px solid var(--rule);
  color: var(--ink-soft);
}
.sc-row .sc-tag.good { color: var(--chartreuse-deep); border-color: var(--chartreuse-deep); }
.sc-row .sc-tag.dead { color: var(--pink-deep); border-color: var(--pink-deep); }
.scorecard-foot {
  padding: 12px 18px; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
  display: flex; justify-content: space-between;
}

/* ─── Signature: live margin dashboard (homepage hero) ─── */
.marginboard {
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper-2); overflow: hidden;
  box-shadow: 6px 6px 0 var(--rule);
  font-family: var(--font-figures);
}
.mb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--rule);
  background: var(--ink); color: var(--paper);
}
.mb-title {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--chartreuse);
}
.mb-meta { font-family: var(--font-mono); font-size: 11px; color: color-mix(in srgb, var(--paper) 60%, transparent); }
/* dark mode: --ink inverts to cream, so pin the mini-UI headers to a dark surface (chartreuse titles need it) */
.dark .mb-head, .dark .dg-head { background: var(--paper-2); color: var(--ink); }
.dark .mb-meta { color: color-mix(in srgb, var(--ink) 60%, transparent); }
.mb-gm {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 20px 18px 16px; border-bottom: 1px dashed var(--rule);
}
.mb-gm-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}
.mb-gm-val {
  font-family: var(--font-display); font-weight: 800; font-size: 58px;
  line-height: 1; letter-spacing: -0.04em; color: var(--ink); margin-top: 6px;
}
.mb-gm-val i { font-style: normal; font-size: 30px; color: var(--ink-faint); }
.mb-delta {
  display: inline-block; margin-top: 8px; padding: 2px 8px;
  font-size: 11px; font-weight: 700; border-radius: var(--radius);
  font-family: var(--font-figures); letter-spacing: 0;
}
.mb-delta.bad { color: var(--pink-deep); background: color-mix(in srgb, var(--pink) 14%, transparent); }
.mb-spark { flex-shrink: 0; margin-bottom: 6px; }
.mb-kpis { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); }
.mb-kpi { padding: 12px 14px; border-right: 1px solid var(--rule-soft); }
.mb-kpi:last-child { border-right: none; }
.mb-kpi span {
  display: block; font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
}
.mb-kpi b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); margin-top: 4px; }
.mb-cogs { padding: 12px 18px 6px; }
.mb-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; }
.mb-name { width: 108px; flex-shrink: 0; color: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: 12px; }
.mb-track { flex: 1; height: 12px; background: var(--rule-soft); position: relative; overflow: hidden; border-radius: var(--radius); }
.mb-track i { display: block; height: 100%; background: var(--ink); }
.mb-track i.lead { background: var(--pink); }
.mb-amt { width: 52px; text-align: right; color: var(--ink-soft); flex-shrink: 0; }
.mb-lines { border-top: 1px solid var(--rule); padding: 4px 0; }
.mb-line {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 18px; font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--ink);
}
.pill {
  display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700;
  font-family: var(--font-figures); border-radius: var(--radius);
}
/* pill fills intentionally fixed — chartreuse chip needs dark text in both themes */
.pill.ok { background: var(--chartreuse); color: #1a1f36; }
.pill.warn { background: var(--ink); color: var(--chartreuse); }
.dark .pill.warn { background: #f4f1e8; color: #1a1f36; }
.mb-foot {
  padding: 12px 18px; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint);
  display: flex; justify-content: space-between;
}

/* ─── Vision / quote band ─── */
.band { background: var(--ink); color: var(--paper); }
.band .container { padding-top: 84px; padding-bottom: 84px; }
.band .eyebrow { color: var(--chartreuse); }
.band .eyebrow::before { background: var(--chartreuse); }
.band-quote {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(24px, 3.4vw, 38px); line-height: 1.18; letter-spacing: -0.02em;
  margin-top: 22px; max-width: 22ch;
}
.band-quote .hl { color: var(--chartreuse); }
.dark .band { background: var(--paper-2); color: var(--ink); }

/* ─── Section heading block ─── */
.sec-head { max-width: 60ch; margin-bottom: 44px; }
.sec-head h2 { font-weight: 800; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.03em; margin-top: 16px; }
.sec-head p { margin-top: 14px; color: var(--ink-soft); font-size: 18px; line-height: 1.55; }

/* ─── Cards ─── */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper); padding: 26px 24px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--rule-strong); transform: translateY(-3px); box-shadow: 4px 4px 0 var(--rule); }
.card-idx {
  font-family: var(--font-figures); font-size: 12px; color: var(--pink);
  letter-spacing: .1em;
}
.card h3 { font-weight: 700; font-size: 20px; margin: 14px 0 10px; letter-spacing: -0.01em; }
.card p { color: var(--ink-soft); font-size: 15px; line-height: 1.55; }

/* ─── Platform grid, 4-up + scenario mini-strip + coding note ─── */
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .card-grid.cols-4 { grid-template-columns: 1fr; } }
.scn-mini {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 12px;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--font-figures); font-size: 15px;
}
.scn-mini .scn-from { color: var(--ink-soft); }
.scn-mini .scn-arrow { color: var(--ink-faint); }
.scn-mini .scn-to { color: var(--chartreuse-deep); font-weight: 700; font-size: 19px; }
.scn-mini .scn-save { margin-left: auto; font-size: 12px; color: var(--ink-faint); }
.also-note {
  margin-top: 28px; font-size: 14px; color: var(--ink-faint); font-family: var(--font-body);
}
.also-note a { color: var(--ink-soft); font-weight: 700; border-bottom: 1px solid var(--rule); }
.also-note a:hover { color: var(--ink); }

/* ─── Steps (how it works) ─── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper); padding: 24px;
}
.step .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--ink); color: var(--chartreuse);
  font-family: var(--font-figures); font-size: 15px; font-weight: 500;
}
.dark .step .step-num { color: var(--paper); }
.step h3 { font-weight: 700; font-size: 18px; margin: 16px 0 8px; }
.step p { color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.step code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--code-inline); padding: 2px 6px; border-radius: var(--radius); color: var(--ink);
}
.steps-note {
  margin-top: 18px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: .04em; color: var(--ink-faint); text-transform: uppercase;
}

/* ─── "What you see" line items (ledger texture) ─── */
.linelist { border-top: 1px solid var(--rule); margin-top: 8px; }
.lineitem {
  display: flex; align-items: baseline; gap: 16px;
  padding: 18px 4px; border-bottom: 1px solid var(--rule);
}
.lineitem .li-idx { font-family: var(--font-figures); font-size: 13px; color: var(--pink); flex-shrink: 0; width: 32px; }
.lineitem .li-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 2.4vw, 26px); letter-spacing: -0.02em; }

/* ─── Teaser block ─── */
.teaser {
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper-2); padding: 44px;
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
}
.teaser h2 { font-weight: 800; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -0.025em; }
.teaser p { color: var(--ink-soft); font-size: 17px; line-height: 1.5; margin-top: 12px; max-width: 52ch; }

/* ─── Weekly digest miniature ─── */
.digest-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.digest-wrap h2 { font-weight: 800; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.03em; margin-top: 16px; }
.digest-wrap p { margin-top: 14px; color: var(--ink-soft); font-size: 18px; line-height: 1.55; }
.digest-wrap .micro { font-size: 14px; color: var(--ink-faint); }
@media (max-width: 900px) { .digest-wrap { grid-template-columns: 1fr; gap: 32px; } }
.digest-mini {
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  overflow: hidden; background: var(--paper-2);
  box-shadow: 6px 6px 0 var(--rule); max-width: 460px;
}
.dg-head { background: var(--ink); color: var(--paper); padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.dg-brand { font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: -0.02em; display: block; }
.dg-sub {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--chartreuse);
  display: block; margin-top: 8px;
}
.dg-body { padding: 18px 20px 20px; }
.dg-num {
  font-family: var(--font-display); font-weight: 800; font-size: 52px;
  line-height: 1; letter-spacing: -0.04em; color: var(--ink); margin-top: 8px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.dg-num i { font-style: normal; font-size: 26px; color: var(--ink-faint); }
.dg-bar { position: relative; height: 12px; background: var(--rule-soft); border-radius: var(--radius); margin-top: 16px; overflow: visible; }
.dg-bar i { display: block; height: 100%; background: var(--pink); border-radius: var(--radius); }
.dg-bar em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.dg-scale { font-family: var(--font-figures); font-size: 11px; color: var(--ink-faint); margin-top: 8px; }
.dg-scale b { color: var(--ink); }
.dg-insight {
  margin-top: 16px; padding: 10px 12px; font-size: 13px; line-height: 1.5; color: var(--ink);
  background: color-mix(in srgb, var(--chartreuse) 16%, transparent);
  border-left: 3px solid var(--chartreuse-deep);
}

/* ─── Form ─── */
.form-wrap {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: start;
}
.form {
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper); padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fi { margin-bottom: 14px; }
.fi label {
  display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px;
}
.fi input, .fi select, .fi textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 11px 12px; transition: border-color .15s, box-shadow .15s;
}
.fi textarea { resize: vertical; min-height: 84px; }
.fi input:focus, .fi select:focus, .fi textarea:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 22%, transparent);
}
.fi input::placeholder, .fi textarea::placeholder { color: var(--ink-faint); }
.form-status { margin-top: 12px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); min-height: 18px; }
.form-aside .eyebrow { margin-bottom: 16px; }
.form-aside h2 { font-weight: 800; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; }
.form-aside p { margin-top: 16px; color: var(--ink-soft); font-size: 17px; line-height: 1.55; }
.form-aside .micro { font-size: 15px; color: var(--ink-faint); margin-top: 14px; }

/* ─── Footer ─── */
.footer { border-top: 1px solid var(--rule); padding: 40px 0; color: var(--ink-soft); }
.footer-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer .brand-name { font-size: 16px; }
.footer-links { display: flex; gap: 20px; margin-left: auto; }
.footer-link { font-size: 14px; font-weight: 600; color: var(--ink-soft); transition: color .15s; }
.footer-link:hover { color: var(--ink); }
.footer-copy { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); width: 100%; margin-top: 6px; }

/* ─── Motion: gentle scroll-reveal (respects reduced-motion) ─── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .doc-card { transition: none; }
}

/* ─── Focus visibility (quality floor) ─── */
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-sub { max-width: none; }
  .card-grid, .steps { grid-template-columns: 1fr; }
  .form-wrap { grid-template-columns: 1fr; gap: 32px; }
  .teaser { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .hero { padding: 56px 0; }
  .band .container { padding-top: 56px; padding-bottom: 56px; }
  .nav-link { display: none; }
  .teaser { padding: 28px; }
  .form { padding: 22px; }
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .container { padding: 0 18px; }
  .scorecard-grade .grade { font-size: 52px; }
  .nav .btn { white-space: nowrap; padding: 9px 13px; font-size: 13px; }
  .nav .brand-sub { display: none; }
  .nav-inner { gap: 10px; }
}

/* ─── Integration rows (collateral pages: /margin, /governance) ─── */
.intg { border-top: 1px solid var(--rule); margin-top: 8px; }
.intg-row {
  display: grid; grid-template-columns: 200px 1fr; gap: 16px;
  padding: 15px 4px; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.intg-layer {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
}
.intg-names {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(16px, 2vw, 21px); letter-spacing: -0.015em;
  min-width: 0; /* let the grid track shrink below the row's min-content width */
}
.intg-names .sep { color: var(--ink-faint); font-weight: 400; padding: 0 6px; }
/* Vendor names have no spaces between them (seps are padded spans), so give each
   separator a zero-width-space break opportunity — otherwise a row is one
   unbreakable string and blows the page width out on narrow viewports. */
.intg-names .sep::after { content: "\200B"; }
.intg-mech {
  margin-top: 20px; font-family: var(--font-figures); font-size: 13px;
  line-height: 1.7; color: var(--ink-soft);
}
.intg-mech b { color: var(--ink); font-weight: 600; }
.intg-rest { margin-top: 14px; font-size: 15px; color: var(--ink-soft); font-style: italic; }
@media (max-width: 640px) { .intg-row { grid-template-columns: 1fr; gap: 4px; } }

/* ─── Print — collateral pages double as their own PDF (Brand & Assets spec) ─── */
.print-only {
  display: none; font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-soft); margin-top: 14px;
}
@media print {
  @page { margin: 11mm 13mm; }
  /* Force light-on-white regardless of the visitor's theme */
  :root, .light, .dark {
    --paper: #ffffff; --paper-2: #f6f4ec; --ink: #1a1f36; --ink-soft: #4a4e66;
    --ink-faint: rgba(26, 31, 54, 0.55); --rule: rgba(26, 31, 54, 0.18);
    --rule-soft: rgba(26, 31, 54, 0.08); --rule-strong: #1a1f36;
    --code-bg: #f6f4ec; --code-fg: #1a1f36; --code-inline: rgba(26, 31, 54, 0.06);
    --chartreuse-deep: #6a8000; --pink-deep: #a83368;
  }
  .nav, .footer, .theme-toggle, .hero-cta, .hero-microcopy, .btn { display: none !important; }
  /* Scroll-reveal starts at opacity 0 — without this, printed sections are blank */
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  body { font-size: 12.5px; }
  .section { padding: 26px 0; }
  .hero { padding: 16px 0 22px; }
  .hero h1 { font-size: 34px; }
  .hero-grid { gap: 28px; }
  /* Ink-friendly band: border instead of solid dark fill */
  .band { background: transparent; color: var(--ink); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
  .band .container { padding-top: 28px; padding-bottom: 28px; }
  .band .eyebrow { color: var(--pink); }
  .band .eyebrow::before { background: var(--pink); }
  .band-quote .hl { color: var(--pink-deep); }
  .sec-head { margin-bottom: 16px; }
  .sec-head h2 { font-size: 24px; }
  .sec-head p { font-size: 14px; margin-top: 8px; }
  .band-quote { font-size: 20px; margin-top: 12px; }
  .card, .step, .lineitem, .intg-row, .marginboard, .teaser, .scorecard, .band { break-inside: avoid; }
  .card-grid { gap: 10px; }
  .card { padding: 14px 16px; }
  .card h3 { font-size: 15px; margin: 8px 0 5px; }
  .card p { font-size: 12.5px; }
  .teaser { padding: 20px; gap: 14px; }
  .teaser p { font-size: 13.5px; margin-top: 8px; }
  .lineitem { padding: 10px 4px; }
  .lineitem .li-name { font-size: 16px; }
  .intg-row { padding: 8px 4px; }
  .intg-names { font-size: 15px; }
  .intg-mech { margin-top: 12px; font-size: 12px; }
  .intg-rest { margin-top: 8px; font-size: 12.5px; }
  .mb-gm-val { font-size: 40px; }
  .mb-head, .mb-foot { padding: 9px 14px; }
  .mb-gm { padding: 12px 14px 10px; }
  .mb-kpi { padding: 8px 10px; }
  .mb-kpi b { font-size: 14px; }
  .mb-cogs { padding: 8px 14px 4px; }
  .mb-row { margin-bottom: 6px; }
  .mb-line { padding: 6px 14px; font-size: 12px; }
  .hero-sub { font-size: 14px; }
  .hero-ladder { margin-top: 12px; padding-top: 10px; }
  .print-only { display: block !important; }
  /* Dark-theme visitors: higher-specificity dark overrides must not survive into print */
  .dark .mb-head, .dark .dg-head { background: var(--ink); color: var(--paper); }
  .dark .mb-meta { color: color-mix(in srgb, var(--paper) 60%, transparent); }
  .dark .band { background: transparent; }
  /* Hero boards depend on their fills — keep backgrounds even if "Background graphics" is off */
  .marginboard, .marginboard * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ─── Door cards (homepage router: /margin vs /governance) ─── */
.doors { display: flex; flex-direction: column; gap: 18px; }
.door {
  display: block; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper-2); overflow: hidden;
  box-shadow: 6px 6px 0 var(--rule);
  transition: transform .15s, box-shadow .15s;
}
.door:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--rule); }
.door-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: var(--ink); border-bottom: 1px solid var(--rule);
}
.door-head .dh-title {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--chartreuse);
}
.door-head .dh-meta { font-family: var(--font-mono); font-size: 10px; color: rgba(244,241,232,.55); }
.dark .door-head { background: var(--paper-2); }
.dark .door-head .dh-meta { color: var(--ink-faint); }
.door-tag {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  letter-spacing: -0.02em; color: var(--ink); padding: 16px 18px 6px;
}
.door-body { padding: 0 18px 14px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.door-link {
  display: block; padding: 12px 18px; border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--pink);
  transition: color .15s;
}
.door:hover .door-link { color: var(--ink); }
