/* ═══════════════════════════════════════════════════════════════════
 * ClinMaker — Data-Viz Enterprise System (v4, 2026-05-18)
 *
 * Typography: Inter Black 900 for display (matches wordmark) + Inter
 * 400/450 for body + JetBrains Mono for data labels and metrics.
 * Layout: Every section anchored by a real platform visualization
 * framed with monospace coordinate labels. Sharp rectangles, no
 * gradients on UI elements, terracotta accent on dark text.
 * ═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Primary — terracotta (Theme E) */
  --primary-50:  #faeee8;
  --primary-100: #f3d5c8;
  --primary-200: #e5b49e;
  --primary-300: #d89578;
  --primary-500: #dc7c5c;
  --primary-600: #d87654;
  --primary-700: #a35037;
  --primary-800: #7d3c28;
  --primary-900: #5c2c1d;

  /* Surface — warm cream */
  --surface-bg:      #faf8f5;
  --surface-card:    #ffffff;
  --surface-hover:   #f5f3ef;
  --surface-input:   #f5f3ef;
  --surface-border:  #ebe7e0;
  --surface-divider: #f0ede7;
  --surface-rule:    #1c1a16;        /* hairlines now use ink for contrast */
  --surface-rule-soft: rgba(28,26,22,0.10);

  /* Text */
  --ink:             #1c1a16;
  --text-primary:    #1c1a16;
  --text-secondary:  #525154;
  --text-muted:      #8a8783;
  --text-tertiary:   #b8b4ad;

  /* Status — CB-safe cool spectrum */
  --status-green:    #059669;
  --status-green-bg: #ecfdf5;
  --status-amber:    #854d0e;
  --status-amber-bg: #fef9c3;
  --status-red:      #6b21a8;
  --status-red-bg:   #f3e8ff;

  /* AI accent — violet (exclusive) */
  --ai-violet:        #7850dc;
  --ai-violet-bg:     #f2eefc;
  --ai-violet-text:   #5a37b4;

  /* Logo wave color */
  --cyan-700: #0e7490;

  /* Fonts */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Display sizes — bold sans, tight tracking */
  --d1: clamp(3.5rem, 7vw, 6.5rem);    /* hero */
  --d2: clamp(2.5rem, 4.5vw, 4rem);    /* section heads */
  --d3: clamp(1.75rem, 2.6vw, 2.5rem); /* sub heads */
  --d4: clamp(1.25rem, 1.8vw, 1.75rem);/* card heads */

  /* Spacing */
  --gutter:       clamp(20px, 3.5vw, 40px);
  --max-content:  1320px;
  --frame-pad:    clamp(24px, 3vw, 36px);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--surface-bg);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss03";
}

a { color: var(--primary-700); text-decoration: none; }
a:hover { color: var(--primary-600); }

::selection { background: var(--primary-200); color: var(--ink); }

/* ────── TYPOGRAPHY ────── */

.display, h1.display, .display-2, .display-3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-feature-settings: "cv11", "ss03", "tnum";
}

/* Wordmark color-shift pattern — used on every display headline */
.shift { color: var(--primary-600); }

.display {
  font-size: var(--d1);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.display-2 {
  font-size: var(--d2);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.04em;
}

.display-3 {
  font-size: var(--d3);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.display-4 {
  font-size: var(--d4);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

/* Lede — body with mono lead-in marker */
.lede {
  font-size: clamp(1.0625rem, 1.25vw, 1.1875rem);
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 450;
  max-width: 620px;
  letter-spacing: -0.005em;
}
.lede::before {
  content: '› ';
  color: var(--primary-600);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-right: 4px;
}

/* Body prose */
.prose {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 640px;
  font-weight: 450;
}
.prose p + p { margin-top: 1em; }
.prose strong { color: var(--ink); font-weight: 600; }

/* Eyebrow / section number — monospace */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.eyebrow.brand { color: var(--primary-700); }
.eyebrow .num { color: var(--primary-700); font-weight: 600; }

/* Section number bar — for module sections */
.section-num-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}
.section-num-bar .num {
  color: var(--primary-700);
  font-weight: 600;
}
.section-num-bar .num strong {
  color: var(--ink);
  font-weight: 700;
}
.section-num-bar .rule {
  flex: 1;
  height: 1px;
  background: var(--surface-rule-soft);
}
.section-num-bar .meta { color: var(--text-muted); }

/* ────── LAYOUT PRIMITIVES ────── */
.container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-top: clamp(64px, 8vw, 112px); padding-bottom: clamp(64px, 8vw, 112px); }
.section-tight { padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(40px, 5vw, 64px); }
.section-ink { background: var(--ink); color: rgba(255,255,255,0.78); }
.section-ink .display, .section-ink h1, .section-ink h2 { color: white; }
.section-ink .display .shift { color: var(--primary-400, #de8567); }
.section-ink .lede { color: rgba(255,255,255,0.72); }
.section-ink .eyebrow { color: var(--primary-300); }

/* ────── NAV ────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,248,245,0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--surface-rule-soft);
}
.nav-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}
/* Mark — pulled tight to wordmark; negative margin compensates the SVG's
   internal viewBox whitespace, matching the canonical lockup spacing. */
.logo-mark { width: 32px; height: 32px; flex-shrink: 0; margin-right: -4px; }
/* Wordmark wrapper — keeps "Clin" + "Maker" as a single flush word so no
   flex-gap appears between the two color spans. */
.logo-text { display: inline-flex; }
.logo-text-ink { color: var(--ink); }
.logo-text-brand { color: var(--primary-600); }
.nav-links {
  display: flex;
  gap: clamp(20px, 2.4vw, 36px);
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.003em;
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: white !important;
  padding: 8px 16px;
  font-weight: 600 !important;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--primary-700); color: white !important; }
.nav-cta .arr { color: var(--primary-400, #de8567); }
.nav-cta:hover .arr { color: white; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--ink);
}
.nav-toggle svg { width: 24px; height: 24px; }

/* ────── BUTTONS ────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  border-radius: 0;
}
.btn-primary {
  background: var(--ink);
  color: white;
}
.btn-primary:hover { background: var(--primary-700); color: white; }
.btn-primary .arr { color: var(--primary-400, #de8567); }
.btn-primary:hover .arr { color: white; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--surface-rule);
}
.btn-ghost:hover { background: var(--ink); color: white; }
.btn-ghost .arr { color: var(--primary-600); }
.btn-ghost:hover .arr { color: var(--primary-400, #de8567); }

.btn-white {
  background: white;
  color: var(--ink);
}
.btn-white:hover { background: var(--surface-hover); color: var(--ink); }
.btn-white .arr { color: var(--primary-600); }

.btn-sm { padding: 8px 14px; font-size: 0.8125rem; }

/* ────── HERO ────── */
.hero {
  padding: clamp(56px, 7vw, 96px) var(--gutter) clamp(40px, 5vw, 64px);
  max-width: var(--max-content);
  margin: 0 auto;
}
.hero-statement { max-width: 1180px; }
.hero h1.display {
  margin-top: 24px;
  margin-bottom: clamp(24px, 3vw, 32px);
}
.hero .lede { margin-bottom: clamp(28px, 4vw, 40px); }
.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-buttons .meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  display: flex;
  gap: 12px;
  align-items: center;
}
.hero-buttons .meta .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-green);
  display: inline-block;
}

/* ────── DATA-VIZ FRAME ────── */
.viz-frame {
  background: var(--surface-card);
  border: 1px solid var(--surface-rule);
  position: relative;
  margin-top: clamp(32px, 4vw, 56px);
}
.viz-frame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--surface-rule);
  background: var(--surface-bg);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.viz-frame-head .vh-id { color: var(--primary-700); font-weight: 600; }
.viz-frame-head .vh-meta { display: flex; gap: 18px; align-items: center; }
.viz-frame-head .vh-meta .vh-live::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--status-green);
  margin-right: 6px;
  vertical-align: 1px;
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.viz-frame-body { padding: var(--frame-pad); }

/* Coord labels on corners of viz */
.viz-coord {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding: 4px 6px;
  background: var(--surface-bg);
  pointer-events: none;
  z-index: 2;
}
.viz-coord.tl { top: -7px; left: -7px; }
.viz-coord.tr { top: -7px; right: -7px; }
.viz-coord.bl { bottom: -7px; left: -7px; }
.viz-coord.br { bottom: -7px; right: -7px; }

/* ────── HERO DASHBOARD VIZ ────── */
.dash {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
}
.dash-rail {
  border-right: 1px solid var(--surface-rule-soft);
  padding: 24px 20px;
  background: var(--surface-bg);
}
.dash-rail .rail-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
}
.dash-rail ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.dash-rail li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.dash-rail li.active {
  background: var(--surface-card);
  color: var(--ink);
  border-left-color: var(--primary-600);
  font-weight: 600;
}
.dash-rail li .count {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.dash-rail li.active .count { color: var(--primary-700); }

.dash-main { padding: 28px 32px; min-height: 480px; }

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 28px;
  border-top: 1px solid var(--surface-rule-soft);
  border-bottom: 1px solid var(--surface-rule-soft);
}
.dash-kpi {
  padding: 18px 20px;
  border-right: 1px solid var(--surface-rule-soft);
  position: relative;
}
.dash-kpi:last-child { border-right: 0; }
.dash-kpi .kpi-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.dash-kpi .kpi-label .delta { color: var(--status-green); }
.dash-kpi .kpi-label .delta.neg { color: var(--status-red); }
.dash-kpi .kpi-val {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 2.2vw, 2rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.035em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.dash-kpi .kpi-val .brand { color: var(--primary-600); }
.dash-kpi .kpi-val .small { font-size: 0.6em; font-weight: 700; color: var(--text-muted); margin-left: 4px; }
.dash-kpi .kpi-spark {
  margin-top: 10px;
  height: 24px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
}
.dash-panel {
  border: 1px solid var(--surface-rule-soft);
  background: var(--surface-card);
  padding: 16px 18px;
}
.dash-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--surface-rule-soft);
}
.dash-panel-head .ph-pulse { color: var(--primary-700); }
.dash-row {
  display: grid;
  grid-template-columns: 1.4fr 70px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 0.8125rem;
  border-bottom: 1px dashed var(--surface-rule-soft);
}
.dash-row:last-child { border-bottom: 0; }
.dash-row .r-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink);
  font-weight: 500;
}
.dash-row .r-bar { position: relative; height: 5px; background: var(--surface-hover); }
.dash-row .r-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.dash-row .r-pct {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
}
.dash-row .r-status {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  background: var(--status-green-bg);
  color: var(--status-green);
}
.dash-row .r-status.uat { background: var(--status-amber-bg); color: var(--status-amber); }
.dash-row .r-status.build { background: var(--primary-50); color: var(--primary-700); }

/* Query-trend mini-chart */
.dash-chart { height: 180px; position: relative; }
.dash-chart svg { width: 100%; height: 100%; display: block; }
.dash-chart .gridline { stroke: var(--surface-rule-soft); stroke-width: 0.5; }

/* ────── METRIC STRIP — minimal data row ────── */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--surface-rule);
  border-bottom: 1px solid var(--surface-rule);
  margin-top: clamp(40px, 5vw, 64px);
}
.metric-cell {
  padding: clamp(22px, 2.6vw, 32px) clamp(18px, 2vw, 26px);
  border-right: 1px solid var(--surface-rule-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric-cell:last-child { border-right: 0; }
.metric-cell .m-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.05em;
  line-height: 1;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.metric-cell .m-num .small {
  font-size: 0.5em; font-weight: 700;
  color: var(--text-muted);
  margin-left: 2px;
}
.metric-cell .m-num.brand { color: var(--primary-600); }
.metric-cell .m-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}
.metric-cell .m-tick {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--primary-600);
  letter-spacing: 0.04em;
}

/* ────── MODULE SECTION ────── */
.module {
  padding-top: clamp(72px, 9vw, 128px);
  padding-bottom: clamp(72px, 9vw, 128px);
  border-top: 1px solid var(--surface-rule-soft);
}
.module .module-head {
  display: grid;
  grid-template-columns: minmax(auto, 720px) 1fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 0;
}
.module .module-head .module-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary-700);
  letter-spacing: -0.005em;
  align-self: end;
  justify-self: end;
  padding-bottom: 12px;
}
.module .module-head .module-link:hover { color: var(--primary-600); }
.module .lede { margin-top: 18px; margin-bottom: 0; }

/* Audit-trail timeline viz */
.viz-timeline {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  position: relative;
  min-height: 360px;
}
.viz-timeline .lane-labels {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--surface-rule-soft);
}
.viz-timeline .lane-label {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 14px 16px 14px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--surface-rule-soft);
  justify-content: flex-end;
  gap: 8px;
}
.viz-timeline .lane-label:last-child { border-bottom: 0; }
.viz-timeline .lane-label .lane-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.viz-timeline .lane-label.ai .lane-dot { background: var(--ai-violet); }
.viz-timeline .lane-label.human .lane-dot { background: var(--ink); }
.viz-timeline .lane-label.system .lane-dot { background: var(--primary-600); }

.viz-timeline .lanes {
  position: relative;
  display: flex;
  flex-direction: column;
}
.viz-timeline .lanes::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--surface-rule-soft) 1px, transparent 1px);
  background-size: 12.5% 100%;
  background-position: 0 0;
  pointer-events: none;
  opacity: 0.6;
}
.viz-timeline .lane {
  flex: 1;
  position: relative;
  border-bottom: 1px dashed var(--surface-rule-soft);
}
.viz-timeline .lane:last-child { border-bottom: 0; }
.viz-timeline .event {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 0;
  background: var(--surface-card);
  border: 1px solid var(--surface-rule-soft);
  border-left: 3px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1;
  transition: all 0.15s;
}
.viz-timeline .event:hover { z-index: 3; background: var(--primary-50); }
.viz-timeline .event .ev-tag {
  background: var(--ink); color: white;
  padding: 2px 7px;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.viz-timeline .event .ev-text { color: var(--text-secondary); }
.viz-timeline .event.ev-ai { border-left-color: var(--ai-violet); }
.viz-timeline .event.ev-ai .ev-tag { background: var(--ai-violet); }
.viz-timeline .event.ev-brand { border-left-color: var(--primary-600); }
.viz-timeline .event.ev-brand .ev-tag { background: var(--primary-600); }

.viz-time-axis {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  padding-top: 14px;
  border-top: 1px solid var(--surface-rule-soft);
  margin-top: 16px;
}
.viz-time-axis .axis-empty {}
.viz-time-axis .axis-ticks {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.viz-time-axis .axis-ticks span {
  text-align: left;
  padding-left: 2px;
}

/* ────── COLOPHON ────── */
.colophon {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 48px) var(--gutter);
  border-top: 1px solid var(--surface-rule);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}
.colophon .col-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: -0.035em;
}
.colophon .col-brand .shift { color: var(--primary-600); }
.colophon a { color: var(--text-secondary); }
.colophon a:hover { color: var(--ink); }
.colophon .col-divider { color: var(--text-tertiary); margin: 0 4px; }
.colophon .col-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

/* ────── DEMO MODAL ────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,26,22,0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface-card);
  width: 100%; max-width: 520px;
  padding: clamp(28px, 4vw, 44px);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--surface-rule);
  animation: modalIn 0.25s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
}
.modal-close:hover { color: var(--ink); }
.modal-close svg { width: 22px; height: 22px; }
.modal h3.display-3 { margin-bottom: 8px; }
.modal .lede { font-size: 1rem; margin-bottom: 24px; max-width: none; }

/* ────── FORMS ────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--surface-rule-soft);
  background: var(--surface-card);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 450;
  color: var(--ink);
  transition: border-color 0.15s;
  border-radius: 0;
}
.form-control:focus {
  outline: none;
  border-color: var(--ink);
}
.form-control::placeholder { color: var(--text-tertiary); }
textarea.form-control { resize: vertical; min-height: 84px; }
select.form-control {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1l4 4 4-4' stroke='%23a35037' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--ink);
  color: white;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-top: 12px;
  transition: background 0.15s;
}
.form-submit:hover { background: var(--primary-700); }
.form-submit .arr { color: var(--primary-400, #de8567); }
.form-success { padding: 32px 0; }
.form-success .display-3 { margin-bottom: 10px; color: var(--ink); }
.form-success p { color: var(--text-secondary); }

/* ────── WIZARD (pricing page) ─────────────────────────────────── */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(36px, 5vw, 56px);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.wizard-progress .step-dot {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface-rule-soft);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-card);
  transition: all 0.2s;
  flex-shrink: 0;
}
.wizard-progress .step-dot.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.wizard-progress .step-dot.done {
  border-color: var(--primary-600);
  background: var(--primary-50);
  color: var(--primary-700);
}
.wizard-progress .step-rule {
  flex: 1;
  height: 1px;
  background: var(--surface-rule-soft);
}
.wizard-progress .step-rule.done { background: var(--primary-600); }

.wizard-step { display: none; }
.wizard-step.active {
  display: block;
  animation: fadeIn 0.35s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-step .q-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-700);
  margin-bottom: 14px;
}
.wizard-step .q-text {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 32px;
}

.wizard-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}
.wizard-opt {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--surface-rule-soft);
  background: var(--surface-card);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  width: 100%;
  border-radius: 0;
}
.wizard-opt:hover {
  border-color: var(--ink);
  background: var(--primary-50);
}
.wizard-opt.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.wizard-opt.selected .opt-mark {
  background: white;
  color: var(--ink);
  border-color: white;
}
.wizard-opt.selected .opt-note { color: rgba(255,255,255,0.65); }
.wizard-opt .opt-mark {
  width: 26px; height: 26px;
  border: 1px solid var(--surface-rule-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-bg);
  color: var(--text-muted);
  flex-shrink: 0;
  text-transform: uppercase;
}
.wizard-opt .opt-text {
  flex: 1;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.4;
}
.wizard-opt .opt-note {
  display: block;
  font-size: 0.8125rem;
  font-weight: 450;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--surface-rule-soft);
}
.wizard-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 0;
}
.wizard-back:hover { color: var(--ink); }
.wizard-back:disabled { opacity: 0; pointer-events: none; }

/* Wizard result */
.wizard-result { display: none; }
.wizard-result.active {
  display: block;
  animation: fadeIn 0.45s ease-out;
}
.wizard-result .res-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-700);
  margin-bottom: 14px;
}
.wizard-result .res-fit {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin-bottom: 28px;
}
.wizard-result .res-fit .fit-name { color: var(--primary-600); }
.wizard-result .res-detail {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 28px;
}
.wizard-result .res-summary {
  margin-bottom: 32px;
  padding: 20px 24px;
  border-left: 3px solid var(--primary-600);
  background: var(--surface-card);
  border-top: 1px solid var(--surface-rule-soft);
  border-right: 1px solid var(--surface-rule-soft);
  border-bottom: 1px solid var(--surface-rule-soft);
}
.wizard-result .res-summary-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 8px 0;
  font-size: 0.9375rem;
}
.wizard-result .res-summary-row + .res-summary-row { border-top: 1px dashed var(--surface-rule-soft); }
.wizard-result .res-summary-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 4px;
}
.wizard-result .res-summary-val { color: var(--ink); font-weight: 500; }
.wizard-result .res-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ────── RESPONSIVE ────── */
@media (max-width: 1024px) {
  .dash { grid-template-columns: 1fr; }
  .dash-rail { border-right: 0; border-bottom: 1px solid var(--surface-rule-soft); }
  .dash-rail ul { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .dash-rail li { padding: 6px 10px; border-left: 0; border-bottom: 2px solid transparent; }
  .dash-rail li.active { border-bottom-color: var(--primary-600); border-left-color: transparent; }
  .dash-grid { grid-template-columns: 1fr; }
  .module .module-head { grid-template-columns: 1fr; gap: 16px; }
  .module .module-head .module-link { justify-self: start; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-cell:nth-child(odd) { border-right: 1px solid var(--surface-rule-soft); }
  .metric-cell:nth-child(even) { border-right: 0; }
  .metric-cell:nth-child(-n+4) { border-bottom: 1px solid var(--surface-rule-soft); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--surface-bg);
    padding: 20px var(--gutter);
    gap: 16px;
    border-bottom: 1px solid var(--surface-rule-soft);
  }
  .nav-toggle { display: block; }
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-kpi:nth-child(odd) { border-right: 1px solid var(--surface-rule-soft); }
  .dash-kpi:nth-child(even) { border-right: 0; }
  .dash-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--surface-rule-soft); }
  .form-row { grid-template-columns: 1fr; }
  .colophon { flex-direction: column; align-items: flex-start; gap: 12px; }
  .viz-timeline { grid-template-columns: 110px 1fr; }
  .viz-time-axis { grid-template-columns: 110px 1fr; }
}
