/* =========================================================
   Vektor AI — ChronoVault marketing site
   main.css
   Design tokens and components from docs/website/02-visual-design-system.md
   ========================================================= */

/* -------- Fonts: self-hosted via Google Fonts link in head -------- */

/* -------- Tokens -------- */
:root {
  /* Colors — primary & neutrals
     Palette: Deep Forest (#0C1511) dark theme with aged-gold chrome
     and sap-green highlights. Variable names retain their historical
     "navy-" / "sage-" / "ink-" labels to avoid touching 900+ downstream
     rules; the *values* have moved. The theme is now dark, so:
       - "ink-" tokens are LIGHT (text-on-dark)
       - "surface-raised" is LIGHTER than "surface-base" (cards lift)
       - "surface-sunken" is DARKER than "surface-base" (wells recede)
       - "navy-800" is the primary ACCENT (aged gold) that drives chrome
       - "sage-600" is the secondary ACCENT (sap green) for links
  */

  /* Dark surface layers — darkest to "lightest" */
  --navy-900: #060C0A;  /* deepest forest — CTA band, dark sections, shadow base */
  --surface-sunken: #080F0D;  /* wells, table headers, code blocks — recede */
  --surface-base:   #0C1511;  /* page background — Deep Forest */
  --surface-raised: #14201B;  /* cards, alt sections, footer — lift */
  --hairline:       #263C32;  /* dividers, card borders (lighter than raised) */
  --overlay:        rgba(6, 12, 10, 0.72);

  /* Ink — LIGHT text on dark background */
  --ink-900: #E8F0E4;  /* primary body + headings — warm near-white */
  --ink-700: #B0C0B2;  /* secondary body, code, captions */
  --ink-500: #7A8A7C;  /* tertiary / meta / muted labels */

  /* Primary accent family — Aged Gold (remapped from "navy") */
  --navy-800: #D4A947;  /* aged gold — primary button fill, h3 accent, focus rings */
  --navy-700: #B88F2A;  /* darker aged gold — button hover, pressed states */

  /* Secondary accent family — Sap Green (remapped from "sage") */
  --sage-700: #8FF2AB;  /* brighter sap — link hover, active text on dim bg */
  --sage-600: #5EE88A;  /* sap green — links, highlights, status, callout borders */
  --sage-100: #0F2A18;  /* dim sap tint — pill bg, badge bg, ::selection */
  --sage-50:  #0A1C11;  /* deeper sap tint — callout bg, summary box bg */

  /* Supporting tones — brightened for dark theme */
  --teal-600: #4AC4D8;  /* bright teal — secondary accent, dataviz */
  --dusk-600: #8395C7;  /* bright dusk blue — chart series */
  --sand-600: #E8A252;  /* warm amber — chart series, badges */
  --clay-600: #E8806A;  /* terracotta — required-field marker, caution border */
  --plum-600: #C084FC;  /* lavender — regulator callout border */

  /* Text on dark sections — same family, explicit alias */
  --paper-on-dark: #E8F0E4;  /* matches --ink-900 — always light */
  --sage-on-dark:  #5EE88A;  /* matches --sage-600 — always sap green */

  /* Typography */
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing — 8px base */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;
  --sp-11: 160px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-full: 9999px;

  /* Shadows — pure black with higher opacity for dark-theme depth */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.65);

  /* Layout */
  --max-content: 1280px;
  --max-prose: 720px;

  /* Transitions */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 240ms;
}

/* -------- Reset & base -------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;     /* Body M 17px */
  line-height: 1.65;
  color: var(--ink-900);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--sage-600);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--sage-700); text-decoration-thickness: 2px; }

a.unstyled, nav a, .btn, .card a.card-link { text-decoration: none; }

::selection { background: var(--sage-100); color: var(--ink-900); }

:focus-visible {
  outline: 3px solid var(--sage-600);
  outline-offset: 2px;
  border-radius: 2px;
}

/* -------- Typography -------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4vw + 1rem, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem);
  line-height: 1.2;
}

h3 {
  font-size: 1.5rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

h4 { font-size: 1.25rem; line-height: 1.4; }
h5 { font-size: 1rem; line-height: 1.5; letter-spacing: 0.01em; }

.display {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 5vw + 1rem, 4rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sage-700);
  margin: 0 0 var(--sp-4);
}

.lead {
  font-size: 1.1875rem;
  line-height: 1.65;
  color: var(--ink-700);
  max-width: 40em;
}

p { margin: 0 0 1em; max-width: 40em; }
.prose p { max-width: none; }

small, .caption {
  font-size: 0.8125rem;
  color: var(--ink-700);
}

code, kbd, pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--surface-sunken);
  border-radius: var(--r-sm);
  padding: 0.125em 0.35em;
}
pre { padding: var(--sp-4); overflow-x: auto; border: 1px solid var(--hairline); }

blockquote {
  margin: 0 0 1.5em;
  padding: var(--sp-5) var(--sp-6);
  background: var(--sage-50);
  border-left: 4px solid var(--sage-600);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--ink-900);
}
blockquote p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: 0.35em; }

hr { border: none; border-top: 1px solid var(--hairline); margin: var(--sp-7) 0; }

/* -------- Layout utilities -------- */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding-left: var(--sp-5);
  padding-right: var(--sp-5);
}
@media (min-width: 1024px) {
  .container { padding-left: var(--sp-7); padding-right: var(--sp-7); }
}

.prose { max-width: var(--max-prose); margin: 0 auto; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }

.section { padding: var(--sp-9) 0; }
.section-sm { padding: var(--sp-8) 0; }
.section-lg { padding: var(--sp-10) 0 var(--sp-9); }

.section.alt { background: var(--surface-raised); }
.section.sunken { background: var(--surface-sunken); }
.section.dark {
  background: var(--navy-900);
  color: var(--paper-on-dark);
}
.section.dark h1, .section.dark h2, .section.dark h3, .section.dark h4 { color: var(--paper-on-dark); }
.section.dark .lead { color: rgba(232, 240, 228, 0.85); }
.section.dark a { color: var(--sage-on-dark); }

.grid { display: grid; gap: var(--sp-5); }
.grid.g-2 { grid-template-columns: repeat(2, 1fr); }
.grid.g-3 { grid-template-columns: repeat(3, 1fr); }
.grid.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid.g-3, .grid.g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid.g-2, .grid.g-3, .grid.g-4 { grid-template-columns: 1fr; }
}

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.center { text-align: center; }

/* -------- Header / navigation -------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.site-header.scrolled { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  min-height: 72px;
  padding: 0 var(--sp-5);
  max-width: var(--max-content);
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .nav { padding: 0 var(--sp-7); }
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}
.brand-logo {
  height: 42px;
  width: auto;
  display: block;
}
@media (max-width: 640px) {
  .brand-logo { height: 36px; }
}
/* legacy mark rule kept for back-compat with any remaining inline SVG */
.brand-mark {
  width: 28px; height: 28px;
  flex-shrink: 0;
  display: inline-block;
}

.nav-main {
  display: none;
  gap: var(--sp-5);
  margin-left: var(--sp-5);
  flex-grow: 1;
}
.nav-main a {
  color: var(--ink-900);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  transition: background var(--dur-fast);
}
.nav-main a:hover, .nav-main a.active {
  background: var(--sage-50);
  color: var(--sage-700);
}

.nav-cta { display: none; align-items: center; gap: var(--sp-4); margin-left: auto; }
.nav-cta a.signin { color: var(--ink-700); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.nav-cta a.signin:hover { color: var(--sage-700); }

@media (min-width: 1024px) {
  .nav-main { display: flex; }
  .nav-cta  { display: flex; }
}

/* -------- Desktop dropdown menus -------- */
.nav-dropdown {
  position: relative;
}
.nav-dropdown > .nav-drop-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.nav-drop-trigger .chevron {
  width: 10px; height: 10px;
  transition: transform 0.2s ease;
  opacity: 0.5;
}
.nav-dropdown.open .nav-drop-trigger .chevron {
  transform: rotate(180deg);
}
.nav-drop-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  padding: 12px;
  z-index: 200;
  min-width: 260px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.nav-dropdown.open .nav-drop-panel {
  display: block;
  opacity: 1;
}
.nav-drop-panel.wide {
  min-width: 480px;
  display: none;
}
.nav-dropdown.open .nav-drop-panel.wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  opacity: 1;
}
.nav-drop-header {
  padding: 6px 12px 8px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-500);
  grid-column: 1 / -1;
}
.nav-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--ink-900);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
  line-height: 1.3;
}
.nav-drop-item:hover {
  background: var(--sage-50);
  color: var(--sage-700);
}
.nav-drop-item .drop-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  background: rgba(38,60,50,0.3);
  flex-shrink: 0;
}
.nav-drop-item .drop-label { display: flex; flex-direction: column; }
.nav-drop-item .drop-sub {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--ink-500);
  margin-top: 1px;
}
.nav-drop-divider {
  height: 1px;
  background: var(--hairline);
  margin: 6px 12px;
  grid-column: 1 / -1;
}
.nav-drop-footer {
  padding: 8px 12px;
  grid-column: 1 / -1;
}
.nav-drop-footer a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy-800);
  text-decoration: none;
}
.nav-drop-footer a:hover { color: var(--sage-600); }

/* -------- Mobile drawer accordion -------- */
.drawer-group {}
.drawer-group-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  color: var(--ink-900);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--r-md);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  font-family: var(--font-sans);
  width: 100%;
}
.drawer-group-trigger:hover { background: var(--sage-50); color: var(--sage-700); }
.drawer-group-trigger .chevron {
  width: 12px; height: 12px;
  transition: transform 0.2s ease;
  opacity: 0.5;
}
.drawer-group.open .drawer-group-trigger .chevron {
  transform: rotate(180deg);
}
.drawer-sub {
  display: none;
  padding: 0 0 0 var(--sp-4);
}
.drawer-group.open .drawer-sub { display: block; }
.drawer-sub a {
  display: block;
  padding: 6px var(--sp-4);
  color: var(--ink-700);
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: none;
  border-radius: var(--r-sm);
}
.drawer-sub a:hover { background: var(--sage-50); color: var(--sage-700); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink-900);
}
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.nav-drawer {
  display: none;
  background: var(--surface-raised);
  border-top: 1px solid var(--hairline);
  padding: var(--sp-5);
}
.nav-drawer.open { display: block; }
.nav-drawer ul { list-style: none; margin: 0; padding: 0; }
.nav-drawer li { margin-bottom: var(--sp-3); }
.nav-drawer a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  color: var(--ink-900);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--r-md);
}
.nav-drawer a:hover { background: var(--sage-50); color: var(--sage-700); }
.nav-drawer .drawer-cta { margin-top: var(--sp-4); }

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 14px 24px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--navy-800);      /* aged gold */
  color: var(--surface-base);       /* deep forest text for high contrast on gold */
  border-color: var(--navy-700);
}
.btn-primary:hover {
  background: var(--navy-700);      /* darker gold on hover */
  color: var(--surface-base);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--navy-800);           /* gold text */
  border-color: var(--navy-800);
}
.btn-secondary:hover { background: var(--sage-50); color: var(--navy-800); }

.btn-ghost {
  background: transparent;
  color: var(--sage-700);
  padding: var(--sp-3) var(--sp-4);
}
.btn-ghost:hover { color: var(--sage-600); background: var(--sage-50); }

.btn .arrow { transition: transform var(--dur-fast) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* -------- Hero -------- */
.hero {
  padding: var(--sp-10) 0 var(--sp-9);
  position: relative;
  overflow: hidden;
}
.hero .hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
  align-items: center;
}
@media (min-width: 960px) {
  .hero .hero-grid { grid-template-columns: 1.2fr 1fr; gap: var(--sp-8); }
}

.hero h1 { margin-bottom: var(--sp-5); }
.hero .lead { margin-bottom: var(--sp-6); }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.hero-visual {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4);
  position: relative;
  overflow: hidden;
  max-height: 420px;
  cursor: pointer;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s ease;
}
.hero-visual::after {
  content: 'Click to expand';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: linear-gradient(to top, var(--surface-raised) 20%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--navy-800);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.hero-visual:hover { box-shadow: var(--shadow-xl, 0 20px 40px rgba(0,0,0,0.5)); }
.hero-visual.expanded {
  max-height: 2000px;
  cursor: default;
}
.hero-visual.expanded::after {
  opacity: 0;
  pointer-events: none;
}

/* Fake product screenshot stylized as SVG-ish blocks */
.hero-visual .screen {
  background: var(--surface-base);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  height: 100%;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.hero-visual .screen-bar {
  display: flex; gap: var(--sp-2); align-items: center;
  padding-bottom: var(--sp-3); border-bottom: 1px solid var(--hairline);
}
.hero-visual .screen-bar .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--hairline); }
.hero-visual .screen-bar .label {
  margin-left: var(--sp-3); font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-700);
}
.hero-visual .screen-row {
  display: flex; gap: var(--sp-3); align-items: center;
  padding: var(--sp-2) 0; border-bottom: 1px dashed var(--hairline); font-size: 0.8125rem;
}
.hero-visual .screen-row:last-child { border-bottom: 0; }
.hero-visual .pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em;
}
.pill.sage  { background: var(--sage-100); color: var(--sage-700); }
.pill.sand  { background: #2E1F08; color: #E8A252; }
.pill.clay  { background: #2E1A12; color: #E8806A; }
.pill.teal  { background: #0E2429; color: #4AC4D8; }
.pill.dusk  { background: #1A1F33; color: #8395C7; }
.pill.plum  { background: #25152A; color: #C084FC; }

/* -------- Cards -------- */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
  color: var(--ink-900);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3, .card h4 { margin: 0; }

.card .icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--sage-100);
  color: var(--sage-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card .learn-more {
  margin-top: auto;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--sage-700);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card .learn-more:hover { color: var(--sage-600); }
.card .learn-more .arrow { transition: transform var(--dur-fast) var(--ease); }
.card:hover .learn-more .arrow { transform: translateX(4px); }

.card.card-link { text-decoration: none; }
.card.card-link:hover { color: var(--ink-900); }

.card.quote {
  background: var(--surface-sunken);
  border-left: 4px solid var(--sage-600);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.55;
}
.card.quote .attribution {
  margin-top: var(--sp-4);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink-700);
}

/* -------- Chips / pills (navigation-level) -------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  background: var(--surface-base);
  color: var(--ink-700);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}
.chip:hover, .chip.active {
  background: var(--sage-50);
  border-color: var(--sage-600);
  color: var(--sage-700);
}

/* -------- Callouts -------- */
.callout {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  margin: var(--sp-5) 0;
  border-left: 4px solid;
}
.callout.note     { background: var(--sage-50); border-color: var(--sage-600); }
.callout.caution  { background: #241806; border-color: var(--clay-600); color: var(--ink-900); }
.callout.regulator { background: #1F0F24; border-color: var(--plum-600); color: var(--ink-900); }
.callout strong { display: block; margin-bottom: var(--sp-2); color: var(--ink-900); }

/* -------- Trust / logo strip -------- */
.trust-strip {
  padding: var(--sp-7) 0;
  background: var(--surface-raised);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
}
.trust-strip .label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-700);
  margin-bottom: var(--sp-5);
}
.framework-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-5) var(--sp-6);
  align-items: center;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink-700);
}
.framework-row span { opacity: 0.85; }

/* -------- Capability grid card-ish -------- */
.capability-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 960px) { .capability-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .capability-grid { grid-template-columns: 1fr; } }

/* -------- Feature row (alternating image + text) -------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
  align-items: center;
  padding: var(--sp-7) 0;
}
@media (min-width: 960px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .feature-row.reverse > *:first-child { order: 2; }
}
.feature-row h2 { margin-bottom: var(--sp-4); }
.feature-row .lead { margin-bottom: var(--sp-4); }

.feature-visual {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  min-height: 260px;
  box-shadow: var(--shadow-sm);
}

/* -------- Breadcrumbs -------- */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--ink-700);
  padding: var(--sp-5) 0 0;
}
.breadcrumb a { color: var(--ink-700); text-decoration: none; }
.breadcrumb a:hover { color: var(--sage-700); }
.breadcrumb .sep { color: var(--sage-600); margin: 0 var(--sp-2); }
.breadcrumb .current { color: var(--ink-900); font-weight: 500; }

/* -------- Article page -------- */
.article-header {
  padding: var(--sp-8) 0 var(--sp-5);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--hairline);
}
.article-meta {
  font-size: 0.8125rem;
  color: var(--ink-700);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
.article-meta .dot-sep::before { content: "·"; margin-right: var(--sp-3); color: var(--ink-500); }
.article-body { padding: var(--sp-8) 0 var(--sp-9); }
.article-body .prose p { font-size: 1.0625rem; line-height: 1.75; }
.article-body .prose h2 { margin-top: 2em; padding-top: 0; }
.article-body .prose h3 { color: var(--navy-800); }
.article-body .prose ul, .article-body .prose ol { max-width: 40em; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  background: var(--sage-100);
  color: var(--sage-700);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* -------- Tables -------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-5) 0;
  font-size: 0.9375rem;
}
th, td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
th {
  background: var(--surface-sunken);
  font-weight: 600;
  color: var(--ink-900);
  font-size: 0.875rem;
}
tbody tr:hover { background: var(--surface-raised); }

/* -------- Forms -------- */
.form-field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
label { font-size: 0.875rem; font-weight: 600; color: var(--ink-900); }
label .req { color: var(--clay-600); margin-left: 4px; }
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 12px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  color: var(--ink-900);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--sage-600);
  outline-offset: 2px;
  border-color: var(--navy-800);
}
textarea { min-height: 120px; resize: vertical; }
.helper { font-size: 0.8125rem; color: var(--ink-700); }

/* -------- Footer -------- */
.site-footer {
  background: var(--surface-raised);
  border-top: 1px solid var(--hairline);
  padding: var(--sp-9) 0 var(--sp-6);
  margin-top: var(--sp-9);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-7);
}
@media (max-width: 960px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-col h5 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-700);
  margin-bottom: var(--sp-4);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: var(--sp-3); }
.footer-col a {
  color: var(--ink-900);
  text-decoration: none;
  font-size: 0.9375rem;
}
.footer-col a:hover { color: var(--sage-700); }

.footer-bottom {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--ink-700);
}
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--sage-600);
  border-radius: 50%;
  margin-right: var(--sp-2);
  vertical-align: middle;
  box-shadow: 0 0 0 3px var(--sage-50);
}

/* -------- CTA band -------- */
.cta-band {
  background: var(--navy-900);
  color: var(--paper-on-dark);
  padding: var(--sp-9) 0;
  text-align: center;
}
.cta-band h2 {
  color: var(--paper-on-dark);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3vw + 1rem, 2.75rem);
  margin-bottom: var(--sp-4);
}
.cta-band p {
  color: rgba(232, 240, 228, 0.8);
  margin: 0 auto var(--sp-5);
  max-width: 40em;
  font-size: 1.0625rem;
}
.cta-band .btn-primary {
  background: var(--navy-800);       /* aged gold — consistent with in-section primary */
  border-color: var(--navy-700);
  color: var(--surface-base);
}
.cta-band .btn-primary:hover {
  background: var(--navy-700);
  color: var(--surface-base);
}

/* -------- Small layout helpers -------- */
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.text-center { text-align: center; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge.supported { background: var(--sage-100); color: var(--sage-700); }
.badge.coming    { background: var(--surface-sunken); color: var(--ink-700); border: 1px solid var(--hairline); }
.badge.region    { background: #1A1F33; color: #8395C7; }

/* Index cards with pillar styling */
.pillar-card {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  text-decoration: none;
  color: var(--ink-900);
  display: block;
  transition: all var(--dur-fast) var(--ease);
}
.pillar-card:hover {
  transform: translateY(-2px);
  border-color: var(--sage-600);
  box-shadow: var(--shadow-md);
  color: var(--ink-900);
}
.pillar-card .number {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--sage-600);
  display: block;
  margin-bottom: var(--sp-2);
}
.pillar-card h3 { margin-bottom: var(--sp-2); }

/* Diagram helper */
.diagram {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin: var(--sp-6) 0;
}
.flow {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  align-items: stretch;
}
.flow .step {
  flex: 1 1 160px;
  background: var(--surface-base);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-size: 0.875rem;
  position: relative;
}
.flow .step strong { display: block; font-family: var(--font-serif); margin-bottom: var(--sp-1); color: var(--navy-800); }
.flow .step + .step::before {
  content: "→";
  position: absolute;
  left: -18px; top: 50%; transform: translateY(-50%);
  color: var(--sage-600);
  font-weight: bold;
}
@media (max-width: 720px) {
  .flow .step + .step::before { content: none; }
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
}
.skip-link:focus {
  left: 12px; top: 12px;
  background: var(--navy-800);
  color: var(--surface-base);       /* dark forest text on gold for AA contrast */
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  z-index: 200;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------- KB article cards in grid -------- */
.article-card {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-decoration: none;
  color: var(--ink-900);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--dur-fast) var(--ease);
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--sage-600);
  box-shadow: var(--shadow-md);
  color: var(--ink-900);
}
.article-card .tag { align-self: flex-start; }
.article-card h3 { font-size: 1.125rem; }
.article-card .excerpt { color: var(--ink-700); font-size: 0.9375rem; flex-grow: 1; }
.article-card .meta {
  font-size: 0.75rem;
  color: var(--ink-500);
  display: flex;
  gap: var(--sp-3);
}

/* Summary box inside articles */
.summary-box {
  background: var(--sage-50);
  border: 1px solid var(--sage-100);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-7) 0;
}
.summary-box h4 {
  font-family: var(--font-serif);
  margin-top: 0;
  color: var(--sage-700);
}
.summary-box ul { margin-bottom: 0; }

/* Two-column content layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}
@media (min-width: 960px) {
  .two-col { grid-template-columns: 2fr 1fr; }
}

/* Sidebar inside articles */
.aside {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.aside h5 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-700);
  margin-top: 0;
  margin-bottom: var(--sp-3);
}
.aside ul { list-style: none; padding: 0; margin: 0; }
.aside li { margin-bottom: var(--sp-3); }
.aside a { font-size: 0.9375rem; }

/* ====== VISUAL: Enhanced mapping studio (homepage hero) ====== */
.studio-screen {
  background: var(--navy-900);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.875rem;
}
.studio-bar {
  background: var(--surface-raised);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.studio-bar .dots { display: flex; gap: 6px; }
.studio-bar .dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--hairline); }
.studio-bar .title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-500); margin-left: 8px; }
.studio-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--hairline);
}
.studio-tab {
  padding: 10px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-500);
  border-bottom: 2px solid transparent;
}
.studio-tab.active {
  color: var(--navy-800);
  border-bottom-color: var(--navy-800);
  background: rgba(212,169,71,0.05);
}
.studio-content {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0;
}
@media (max-width: 640px) {
  .studio-content { grid-template-columns: 1fr; }
  .studio-sidebar { border-left: none !important; border-top: 1px solid var(--hairline); }
}
.studio-main { padding: 12px; }
.studio-sidebar {
  border-left: 1px solid var(--hairline);
  padding: 12px;
  background: rgba(6,12,10,0.4);
}
.studio-sidebar-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-500);
  margin: 0 0 10px;
}
.studio-row {
  display: grid;
  grid-template-columns: 84px 64px 1fr 72px;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(38,60,50,0.4);
  font-size: 0.8125rem;
}
.studio-row:last-child { border-bottom: none; }
.studio-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
}
.studio-pill.pass { background: var(--sage-100); color: var(--sage-600); }
.studio-pill.risk { background: #2E1F08; color: var(--sand-600); }
.studio-pill.review { background: #0E2429; color: var(--teal-600); }
.studio-pill.ai { background: #1A1F33; color: var(--dusk-600); }
.studio-pill.fail { background: #2E1A12; color: var(--clay-600); }
.studio-ref { color: var(--ink-700); font-family: var(--font-mono); font-size: 0.6875rem; }
.studio-desc { color: var(--ink-900); font-size: 0.75rem; }
.studio-age { color: var(--ink-500); font-size: 0.625rem; text-align: right; }
.studio-meta {
  display: flex;
  gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.studio-stat { font-size: 0.6875rem; color: var(--ink-500); }
.studio-stat strong { color: var(--navy-800); font-weight: 700; }
.studio-graph-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.studio-graph-bar .seg { height: 100%; border-radius: 3px; }
.bar-legend {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.bar-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.5625rem;
  color: var(--ink-500);
}
.bar-legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.fw-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(38,60,50,0.3);
  border: 1px solid var(--hairline);
  margin-bottom: 5px;
  width: 100%;
}
.fw-badge-name { font-size: 0.625rem; font-weight: 600; color: var(--ink-900); }
.fw-badge-pct { font-size: 0.625rem; font-weight: 700; margin-left: auto; }
.fw-badge-bar {
  width: 100%;
  height: 3px;
  background: var(--hairline);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}
.fw-badge-fill { height: 100%; border-radius: 2px; }
.sparkline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(38,60,50,0.4);
}
.sparkline-label { font-size: 0.5625rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; white-space: nowrap; }

/* ====== VISUAL: Capability page inline visuals ====== */
.visual-section {
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin: var(--sp-6) 0;
  overflow-x: auto;
}

/* -- Risk heatmap -- */
.risk-panel {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 720px) { .risk-panel { grid-template-columns: 1fr; } }
.risk-matrix-wrap { position: relative; }
.risk-axis-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-500);
}
.risk-axis-y {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left center;
  white-space: nowrap;
}
.risk-grid {
  display: grid;
  grid-template-columns: 72px repeat(5, 1fr);
  gap: 3px;
  margin-left: 20px;
}
.risk-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  position: relative;
  transition: transform 0.15s ease;
}
.risk-cell:hover { transform: scale(1.06); z-index: 2; }
.risk-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 0.6875rem;
  color: var(--ink-500);
  text-align: right;
  line-height: 1.2;
}
.risk-top-label {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--ink-500);
  padding-bottom: 4px;
  line-height: 1.2;
}
.risk-marker {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(232,240,228,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--surface-base);
}
.risk-marker::after {
  content: attr(data-label);
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--ink-700);
  white-space: nowrap;
}
.risk-zone-label {
  position: absolute;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.35;
  pointer-events: none;
}
.risk-register {
  background: var(--navy-900);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 14px;
}
.risk-register h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-800);
  margin: 0 0 10px;
}
.rr-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(38,60,50,0.4);
}
.rr-item:last-child { border-bottom: none; }
.rr-id {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--surface-base);
  flex-shrink: 0;
}
.rr-details { flex: 1; min-width: 0; }
.rr-name { font-size: 0.75rem; font-weight: 600; color: var(--ink-900); line-height: 1.3; }
.rr-meta { font-size: 0.625rem; color: var(--ink-500); margin-top: 2px; }
.rr-meta .severity {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 3px;
}
.rr-summary {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
}
.rr-stat-val { font-size: 1rem; font-weight: 700; display: block; }
.rr-stat-label { font-size: 0.5rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.06em; }

/* -- Timeline -- */
.tl-container { position: relative; padding: 12px 0 0; }
.tl-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.tl-title-block h3 { font-size: 0.875rem; font-weight: 700; color: var(--navy-800); margin: 0; }
.tl-title-block .sub { font-size: 0.6875rem; color: var(--ink-500); margin-top: 2px; }
.tl-legend { display: flex; gap: 14px; align-items: center; }
.tl-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.5625rem;
  color: var(--ink-500);
}
.tl-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.tl-track {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--hairline);
  margin-left: 14px;
}
.tl-node {
  position: relative;
  margin-bottom: 24px;
  padding-left: 20px;
}
.tl-node:last-child { margin-bottom: 0; }
.tl-node::before {
  content: '';
  position: absolute;
  left: -35px;
  top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface-base);
  border: 2px solid var(--navy-800);
}
.tl-node.current::before {
  background: var(--navy-800);
  box-shadow: 0 0 12px rgba(212, 169, 71, 0.5);
  width: 16px; height: 16px;
  left: -36px; top: 5px;
}
.tl-node.branch::before {
  border-color: var(--teal-600);
  border-style: dashed;
}
.tl-node-date {
  font-size: 0.6875rem;
  color: var(--ink-500);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.tl-node-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.3;
}
.tl-node-desc {
  font-size: 0.8125rem;
  color: var(--ink-700);
  margin-top: 3px;
  line-height: 1.45;
}
.tl-node-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.tl-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-tag.add { background: var(--sage-100); color: var(--sage-600); }
.tl-tag.change { background: #2E1F08; color: var(--sand-600); }
.tl-tag.delete { background: #2E1A12; color: var(--clay-600); }
.tl-tag.auto { background: #1A1F33; color: var(--dusk-600); }
.tl-branch-box {
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px dashed rgba(74,196,216,0.3);
  border-radius: 6px;
  background: rgba(14,36,41,0.3);
}
.tl-branch-label {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-600);
  margin-bottom: 4px;
}
.tl-branch-desc {
  font-size: 0.75rem;
  color: var(--ink-700);
  line-height: 1.4;
}
.tl-diff-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.tl-diff { font-size: 0.6875rem; font-weight: 600; }
.tl-node-hash {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--ink-500);
  background: rgba(38,60,50,0.4);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
}

/* -- AI pipeline -- */
.ai-pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.ai-pipeline-header h3 { font-size: 0.875rem; font-weight: 700; color: var(--navy-800); margin: 0; }
.ai-pipeline-stats { display: flex; gap: 16px; }
.ai-pstat { text-align: center; }
.ai-pstat-val { font-size: 1.25rem; font-weight: 700; display: block; }
.ai-pstat-label { font-size: 0.5rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.06em; }
.ai-stages-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  margin-bottom: 24px;
}
@media (max-width: 640px) {
  .ai-stages-row { grid-template-columns: 1fr; gap: 8px; }
  .ai-arrow-col { transform: rotate(90deg); padding: 4px 0; }
}
.ai-stage-card {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.ai-stage-card.propose { background: rgba(26,31,51,0.4); border-color: rgba(131,149,199,0.3); }
.ai-stage-card.queue { background: rgba(212,169,71,0.06); border-color: rgba(212,169,71,0.4); }
.ai-stage-card.approve { background: rgba(94,232,138,0.04); border-color: rgba(94,232,138,0.3); }
.ai-stage-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem;
  margin: 0 auto 8px;
}
.ai-stage-card.propose .ai-stage-icon { background: rgba(131,149,199,0.15); }
.ai-stage-card.queue .ai-stage-icon { background: rgba(212,169,71,0.15); }
.ai-stage-card.approve .ai-stage-icon { background: rgba(94,232,138,0.12); }
.ai-stage-name { font-size: 0.75rem; font-weight: 700; margin-bottom: 2px; }
.ai-stage-sub { font-size: 0.625rem; color: var(--ink-500); }
.ai-stage-count { font-size: 1.375rem; font-weight: 700; margin-top: 8px; }
.ai-arrow-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: var(--navy-800);
  font-size: 1.5rem;
  opacity: 0.5;
}
.ai-queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.ai-queue-table thead th {
  text-align: left;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  padding: 8px 8px;
  border-bottom: 1px solid var(--hairline);
}
.ai-queue-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(38,60,50,0.3);
  vertical-align: top;
}
.ai-queue-table tbody tr:last-child td { border-bottom: none; }
.ai-conf-bar { display: inline-flex; align-items: center; gap: 4px; }
.ai-conf-track {
  width: 40px; height: 4px;
  background: var(--hairline);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
}
.ai-conf-fill { height: 100%; border-radius: 3px; }
.ai-conf-pct { font-size: 0.625rem; font-weight: 600; }
.ai-type-badge, .ai-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-type-badge.map { background: #1A1F33; color: var(--dusk-600); }
.ai-type-badge.gap { background: #2E1A12; color: var(--clay-600); }
.ai-type-badge.evidence { background: var(--sage-100); color: var(--sage-600); }
.ai-type-badge.draft { background: #2E1F08; color: var(--sand-600); }
.ai-status-badge.pending { background: #2E1F08; color: var(--navy-800); }
.ai-status-badge.approved { background: var(--sage-100); color: var(--sage-600); }
.ai-status-badge.rejected { background: #2E1A12; color: var(--clay-600); }
.ai-audit-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ai-audit-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: rgba(212,169,71,0.1);
  border: 1px solid rgba(212,169,71,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.ai-audit-text h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--navy-800);
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ai-audit-text p {
  font-size: 0.75rem;
  color: var(--ink-700);
  margin: 0;
  line-height: 1.45;
}

/* -- Posture radar + table -- */
.posture-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 720px) { .posture-layout { grid-template-columns: 1fr; } }
.posture-overall {
  text-align: center;
  padding: 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--navy-900);
  margin-bottom: 14px;
}
.posture-score { font-size: 2.25rem; font-weight: 700; color: var(--sage-600); line-height: 1; }
.posture-score-label { font-size: 0.5625rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-top: 2px; }
.posture-score-sub { font-size: 0.6875rem; color: var(--ink-700); margin-top: 4px; }
.posture-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.posture-table thead th {
  text-align: left;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
  padding: 8px 8px;
  border-bottom: 1px solid var(--hairline);
}
.posture-table tbody td {
  padding: 8px;
  border-bottom: 1px solid rgba(38,60,50,0.3);
}
.posture-table tbody tr:last-child td { border-bottom: none; }
.posture-dim-name { font-weight: 600; color: var(--ink-900); }
.posture-bar-cell { display: flex; align-items: center; gap: 6px; }
.posture-bar-track {
  flex: 1;
  height: 5px;
  background: var(--hairline);
  border-radius: 3px;
  overflow: hidden;
}
.posture-bar-fill { height: 100%; border-radius: 3px; }
.posture-bar-pct { font-size: 0.6875rem; font-weight: 700; min-width: 32px; text-align: right; }
.posture-trend { font-size: 0.6875rem; font-weight: 600; }
.posture-trend.up { color: var(--sage-600); }
.posture-trend.down { color: var(--clay-600); }
.posture-trend.flat { color: var(--ink-500); }
.posture-gap { font-size: 0.625rem; color: var(--ink-500); }
.radar-container { display: flex; justify-content: center; }

