/* =========================================================================
   DiligencePilot — Institutional Decision Intelligence
   Production stylesheet
   ========================================================================= */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Surfaces */
  --bg-deep:        #07111F;
  --bg-panel:       #0D1726;
  --bg-panel-2:     #111E33;
  --bg-elevated:    #162640;

  /* Borders & dividers */
  --border:         #1E2A3A;
  --border-soft:    #16202F;
  --border-strong:  #2A3A52;

  /* Text */
  --text-primary:   #E9EEF5;
  --text-secondary: #B7C4D4;
  --text-muted:     #8EA4BA;
  --text-faint:     #5E7184;

  /* Accents */
  --accent:         #35B8C8;          /* intelligence cyan */
  --accent-dim:     #2A93A0;
  --accent-glow:    rgba(53, 184, 200, 0.12);
  --accent-line:    rgba(53, 184, 200, 0.32);
  --gold:           #C9A45C;          /* restrained gold */
  --warn:           #D89464;          /* amber / signal */
  --warn-bg:        rgba(216, 148, 100, 0.08);

  /* Typography */
  --font-display:   'Fraunces', 'Times New Roman', Georgia, serif;
  --font-body:      'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* Scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  /* Layout */
  --content-w:     1240px;
  --content-narrow: 920px;
  --radius:        4px;
  --radius-lg:     8px;

  /* Motion */
  --ease:          cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast:      180ms;
  --dur:           320ms;
  --dur-slow:      640ms;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; padding: 0; }
ul, ol { padding: 0; margin: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-7) 0; }

/* ---------- ATMOSPHERE LAYER ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(53, 184, 200, 0.06), transparent 60%),
    radial-gradient(900px 500px at 5% 110%, rgba(53, 184, 200, 0.04), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(53, 184, 200, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 184, 200, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
main, header, footer { position: relative; z-index: 1; }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  font-variation-settings: 'opsz' 24, 'SOFT' 0;
}
h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-variation-settings: 'opsz' 96, 'SOFT' 0;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  font-variation-settings: 'opsz' 48;
}
h3 {
  font-size: clamp(1.3rem, 2vw, 1.65rem);
  font-variation-settings: 'opsz' 36;
}
h4 {
  font-size: 1.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
p { margin: 0 0 1rem; color: var(--text-secondary); }
p:last-child { margin-bottom: 0; }
strong { color: var(--text-primary); font-weight: 600; }
em { font-family: var(--font-display); font-style: italic; font-weight: 400; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 64ch;
}
.dim { color: var(--text-muted); }
.serif-italic { font-family: var(--font-display); font-style: italic; }

/* ---------- LAYOUT ---------- */
.wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.wrap-narrow {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
section {
  padding: var(--s-9) 0;
}
.section-dark {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.section-tight { padding: var(--s-7) 0; }

.section-head {
  margin-bottom: var(--s-7);
}
.section-head .eyebrow { margin-bottom: var(--s-3); }
.section-head h2 { margin-bottom: var(--s-4); }
.section-head p { max-width: 64ch; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 17, 31, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variation-settings: 'opsz' 36;
}
.brand-mark {
  width: 22px;
  height: 22px;
  display: inline-block;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark + span { line-height: 1; }

nav.primary { display: flex; align-items: center; gap: var(--s-5); }
nav.primary a {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease);
  position: relative;
  padding: 6px 0;
}
nav.primary a:hover, nav.primary a[aria-current="page"] { color: var(--text-primary); }
nav.primary a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-primary) !important;
  transition: all var(--dur-fast) var(--ease);
}
.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  width: 18px;
  height: 1px;
  background: var(--text-primary);
  position: relative;
  display: block;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 1px;
  background: var(--text-primary);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

@media (max-width: 880px) {
  nav.primary {
    position: fixed;
    inset: 68px 0 0 0;
    background: var(--bg-deep);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--s-6) var(--s-5);
    gap: var(--s-4);
    transform: translateX(100%);
    transition: transform var(--dur) var(--ease);
    border-top: 1px solid var(--border-soft);
  }
  nav.primary.open { transform: translateX(0); }
  nav.primary a { font-size: 1rem; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.005em;
  transition: all var(--dur-fast) var(--ease);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-arrow::after {
  content: '→';
  font-family: var(--font-body);
  transition: transform var(--dur-fast) var(--ease);
}
.btn-arrow:hover::after { transform: translateX(3px); }

/* ---------- HERO ---------- */
.hero {
  padding: var(--s-10) 0 var(--s-9);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--s-8);
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-6); }
}
.hero h1 {
  margin-bottom: var(--s-5);
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .serif { font-style: italic; color: var(--text-secondary); font-weight: 400; }

.hero .lead { margin-bottom: var(--s-6); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.hero-meta {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}
.hero-meta div .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
  font-variation-settings: 'opsz' 36;
}
.hero-meta div .lbl {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .hero-meta { grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-4); }
}

/* hero visual area */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 580px;
  margin-left: auto;
}
.hero-visual svg { width: 100%; height: 100%; }

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  position: relative;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.card:hover { border-color: var(--border-strong); }
.card-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: block;
  margin-bottom: var(--s-3);
  text-transform: uppercase;
}
.card h4 { margin-bottom: var(--s-2); }
.card p { font-size: 0.94rem; color: var(--text-secondary); margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-3); }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s-3); }

@media (max-width: 980px) {
  .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
}

/* ---------- PROBLEM / PRINCIPLE BLOCKS ---------- */
.problem {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--warn);
  border-radius: var(--radius);
  padding: var(--s-5);
}
.problem .eyebrow { color: var(--warn); }
.problem .eyebrow::before { background: var(--warn); }
.problem h4 { margin: var(--s-3) 0 var(--s-2); }
.problem p { font-size: 0.94rem; }

.principle {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-5);
  position: relative;
}
.principle .num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: var(--s-3);
  font-variation-settings: 'opsz' 96;
}
.principle h4 { margin-bottom: var(--s-2); }

/* ---------- KEY MESSAGE BANDS ---------- */
.key-band {
  border-left: 2px solid var(--accent);
  padding: var(--s-5) var(--s-6);
  margin: var(--s-7) 0;
  background: linear-gradient(90deg, var(--accent-glow), transparent 70%);
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.3;
  font-variation-settings: 'opsz' 36;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.key-band .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: var(--s-2);
}
.key-band em { color: var(--text-secondary); font-weight: 400; }

/* ---------- WORKFLOW CARDS ---------- */
.workflow-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  position: relative;
  transition: all var(--dur-fast) var(--ease);
}
.workflow-card:hover {
  border-color: var(--accent);
  background: var(--bg-panel-2);
}
.workflow-card .wf-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--s-2);
}
.workflow-card h4 {
  font-size: 0.98rem;
  margin-bottom: var(--s-2);
}
.workflow-card .wf-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Workflow 0 highlighted */
.workflow-0 {
  background: var(--bg-elevated);
  border-color: var(--accent);
  grid-column: 1 / -1;
}

/* ---------- CONTEXT / PROFILE PILLS ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pill-accent { color: var(--accent); border-color: var(--accent-line); }

/* ---------- TABLES ---------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-panel);
  margin: var(--s-5) 0;
}
table.weights {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.weights th, table.weights td {
  padding: 10px 14px;
  text-align: center;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
table.weights th:last-child, table.weights td:last-child { border-right: none; }
table.weights tr:last-child td { border-bottom: none; }
table.weights th {
  background: var(--bg-panel-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
table.weights td.row-label {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  background: var(--bg-panel-2);
}
table.weights tr.total td {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-top: 1px solid var(--accent-line);
}
table.weights td.heat-high { color: var(--accent); font-weight: 600; }
table.weights td.heat-low  { color: var(--text-faint); }

/* ---------- STAT BLOCKS ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin: var(--s-6) 0;
}
.stat {
  border-left: 1px solid var(--border);
  padding-left: var(--s-4);
}
.stat .n {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  display: block;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--s-2);
  font-variation-settings: 'opsz' 72;
}
.stat .lbl {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.stat .desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-display);
}
@media (max-width: 720px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-4); }
}

/* ---------- SVG DIAGRAM CONTAINERS ---------- */
.diagram {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  margin: var(--s-5) 0;
  overflow: hidden;
  position: relative;
}
.diagram-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border-soft);
}
.diagram-caption span { color: var(--accent); margin-right: var(--s-2); }

/* ---------- BREADCRUMB ---------- */
.crumb {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--s-5) 0 0;
}
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--accent); }
.crumb span { color: var(--text-faint); margin: 0 8px; }

/* ---------- PAGE HEADER ---------- */
.page-head {
  padding: var(--s-7) 0 var(--s-7);
  border-bottom: 1px solid var(--border-soft);
}
.page-head .eyebrow { margin-bottom: var(--s-4); }
.page-head h1 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  margin-bottom: var(--s-4);
  max-width: 18ch;
}
.page-head .lead { margin: 0; }

/* ---------- LIST WITH MARKERS ---------- */
.markered {
  list-style: none;
  padding: 0;
}
.markered li {
  position: relative;
  padding-left: 28px;
  margin-bottom: var(--s-3);
  color: var(--text-secondary);
}
.markered li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 14px;
  height: 1px;
  background: var(--accent);
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding: var(--s-8) 0 var(--s-5);
  margin-top: var(--s-9);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--s-6);
  margin-bottom: var(--s-7);
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-grid h5 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
  font-weight: 500;
}
.footer-grid ul li { margin-bottom: var(--s-2); }
.footer-grid a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease);
}
.footer-grid a:hover { color: var(--accent); }
.footer-grid .brand { margin-bottom: var(--s-3); }
.footer-grid p { font-size: 0.86rem; color: var(--text-muted); max-width: 36ch; }

.footer-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- FORM (INSTITUTIONAL INTAKE) ---------- */
.intake-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-7);
  margin: var(--s-6) 0;
}
.intake-card .placeholder-frame {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: var(--s-7);
  text-align: center;
  background: var(--bg-deep);
}
.intake-card .placeholder-frame .lbl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: var(--s-3);
}
.intake-card .placeholder-frame h3 { margin-bottom: var(--s-3); }
.intake-card .placeholder-frame p { color: var(--text-muted); max-width: 50ch; margin: 0 auto; }

/* ---------- COOKIE BANNER ---------- */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  z-index: 200;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-line);
  display: none;
}
.cookie-banner.show { display: block; }
.cookie-banner h4 { margin-bottom: var(--s-2); font-size: 1rem; }
.cookie-banner p { font-size: 0.86rem; margin-bottom: var(--s-4); color: var(--text-muted); }
.cookie-banner .actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.cookie-banner .btn {
  padding: 9px 16px;
  font-size: 0.82rem;
}

/* ---------- DECISION LABEL FAMILIES ---------- */
.label-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  border-top: 2px solid var(--text-muted);
}
.label-card.pos-strong { border-top-color: var(--accent); }
.label-card.pos-cond   { border-top-color: var(--accent-dim); }
.label-card.info       { border-top-color: var(--gold); }
.label-card.neg        { border-top-color: var(--warn); }
.label-card .tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--s-3);
  display: block;
}
.label-card.pos-strong .tag { color: var(--accent); }
.label-card.pos-cond   .tag { color: var(--accent-dim); }
.label-card.info       .tag { color: var(--gold); }
.label-card.neg        .tag { color: var(--warn); }

/* ---------- DISCLAIMER BLOCK ---------- */
.scope-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--s-5) var(--s-6);
  margin: var(--s-6) 0;
}
.scope-block .label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: var(--s-3);
}
.scope-block ul { list-style: none; padding: 0; column-count: 2; column-gap: var(--s-6); }
@media (max-width: 720px) { .scope-block ul { column-count: 1; } }
.scope-block li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: var(--s-2);
  padding-left: 18px;
  position: relative;
  break-inside: avoid;
}
.scope-block li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.7rem;
  top: 4px;
}
.scope-block em {
  display: block;
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- FIVE-PHASE FLOW ---------- */
.flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: var(--s-5) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-panel);
}
.flow .step {
  padding: var(--s-5) var(--s-4);
  border-right: 1px solid var(--border-soft);
  position: relative;
}
.flow .step:last-child { border-right: none; }
.flow .step .n {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent);
  display: block;
  margin-bottom: var(--s-2);
  font-variation-settings: 'opsz' 36;
}
.flow .step h4 { font-size: 0.95rem; margin-bottom: 6px; }
.flow .step p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
@media (max-width: 880px) {
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow .step { border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
}
@media (max-width: 480px) {
  .flow { grid-template-columns: 1fr; }
  .flow .step { border-right: none; }
}

/* ---------- LEGAL CONTENT PAGES ---------- */
.legal-content {
  font-size: 0.96rem;
  line-height: 1.7;
}
.legal-content h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: var(--s-7) 0 var(--s-3);
  font-variation-settings: 'opsz' 36;
}
.legal-content h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  margin: var(--s-5) 0 var(--s-2);
  color: var(--text-primary);
}
.legal-content p, .legal-content li { color: var(--text-secondary); }
.legal-content ul { padding-left: 0; list-style: none; margin: var(--s-3) 0; }
.legal-content ul li {
  padding-left: 22px;
  position: relative;
  margin-bottom: var(--s-2);
}
.legal-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 10px;
  height: 1px;
  background: var(--accent);
}
.legal-content .verify-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 2px 7px;
  border-radius: 3px;
  margin-left: 6px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- ANIMATIONS ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* SVG diagram animations */
@keyframes pulse-node {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes draw-line {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

.diagram .node-pulse { animation: pulse-node 3s ease-in-out infinite; }

/* Hero engine animations */
.hero-orbit {
  transform-origin: center;
  animation: spin-slow 60s linear infinite;
}
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-orbit { animation: none; }
}

/* ---------- FOCUS STATES (WCAG 2.2 AA) ---------- */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg-deep);
  padding: 10px 18px;
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- 404 ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: var(--s-9) 0;
}
.error-page .code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--warn);
  text-transform: uppercase;
  margin-bottom: var(--s-3);
}
.error-page h1 { max-width: 16ch; }

/* ---------- UTILITY ---------- */
.mt-7 { margin-top: var(--s-7); }
.mt-5 { margin-top: var(--s-5); }
.mb-5 { margin-bottom: var(--s-5); }
.text-center { text-align: center; }
.hidden { display: none; }
@media (max-width: 640px) { .hide-sm { display: none; } }


/* Tally institutional intake embed */
.tally-embed-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(126, 247, 255, 0.18);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 20% 0%, rgba(126, 247, 255, 0.08), transparent 34%),
    rgba(8, 18, 31, 0.72);
  box-shadow: var(--shadow-soft);
}
.tally-embed-frame iframe {
  display: block;
  width: 100%;
  min-height: 860px;
  border: 0;
  background: transparent;
}
@media (max-width: 720px) {
  .tally-embed-frame iframe {
    min-height: 1040px;
  }
}
