/* ============================================================================
 * KQAS V3.0 — BASE STYLESHEET
 * Typography, layout, components. State-reactive via CSS custom properties.
 * Loads after kqas-tokens.css?v=cb5f6399. Tokens are the contract.
 * ============================================================================ */

@import url('/v3/kqas-tokens.css?v=cb5f6399');

/* --- RESET (surgical, not obliterative) --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: var(--body-weight);
  font-size: var(--fs-md);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }

/* --- GRAIN OVERLAY (state-driven) --- */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-overlay);
  opacity: var(--grain-opacity, 0);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  mix-blend-mode: overlay;
  transition: opacity var(--transition);
}

/* --- CRISIS PULSE (State 3 only — 1px red viewport edge) --- */
html.state-crisis body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-overlay);
  border: 1px solid var(--accent);
  animation: crisis-pulse 2s ease-in-out infinite;
  mix-blend-mode: normal;
}
@keyframes crisis-pulse {
  0%, 100% { opacity: 0.14; }
  50%      { opacity: 0.42; }
}

/* --- NARRATIVE GRID (State 5 only — 4% grid lines on surfaces) --- */
html.state-narrative body {
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 96px 96px;
}

/* ============================================================================
 * TYPOGRAPHY
 * ============================================================================ */

.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style, normal);
  line-height: 1.02;
  letter-spacing: var(--tr-tight);
  color: var(--text);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  color: var(--text-muted);
}

.editorial {
  font-family: var(--font-editorial, var(--font-body));
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--text);
  max-width: 58ch;
}

.mono, .data-value {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "ss01" 1;
  letter-spacing: var(--tr-normal);
}

html.state-narrative .data-value { color: var(--text-mono); }
html.state-crisis .data-value { color: var(--text-mono); }

h1, h2, h3, h4, h5, h6 { margin: 0; }

/* ============================================================================
 * LAYOUT PRIMITIVES
 * ============================================================================ */

.container {
  width: 100%;
  max-width: 1440px;
  padding-inline: clamp(24px, 4vw, 72px);
  margin-inline: auto;
}

.container-narrow { max-width: 1100px; }
.container-editorial { max-width: 840px; }

.section {
  padding-block: var(--section-gap);
  position: relative;
}

.section-divider {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 0;
}

.stack > * + * { margin-top: var(--micro-gap); }
.stack-lg > * + * { margin-top: calc(var(--micro-gap) * 2); }
.stack-xl > * + * { margin-top: calc(var(--micro-gap) * 3); }

.cluster { display: flex; flex-wrap: wrap; gap: var(--micro-gap); align-items: baseline; }

/* ============================================================================
 * HEADER — Minimal, state-adaptive
 * ============================================================================ */

.kts-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  padding: clamp(20px, 2vw, 32px) clamp(24px, 4vw, 72px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition), backdrop-filter var(--transition);
}

.kts-header.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

.kts-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-md);
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.kts-wordmark::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-shimmer, var(--accent-muted));
}

.kts-nav {
  display: flex;
  gap: clamp(18px, 2vw, 36px);
  align-items: center;
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.kts-nav a {
  position: relative;
  padding: 6px 0;
  transition: color var(--transition-fast);
}

.kts-nav a:hover { color: var(--text); }

.kts-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}
.kts-nav a:hover::after { transform: scaleX(1); }

/* Language selector — always legible across all states. */
.lang-selector {
  display: inline-flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: var(--tr-wide);
  /* Use --text-muted (not --text-faint) as the base so inactive buttons
     remain readable on every state's background. */
  color: var(--text-muted);
  text-transform: uppercase;
}
.lang-selector button {
  padding: 4px 6px;
  /* Inherit the selector's muted colour — all languages visible by default. */
  color: inherit;
  opacity: 0.75;
  transition: color var(--transition-fast), opacity var(--transition-fast), border-color var(--transition-fast);
  border-bottom: 1px solid transparent;
}
.lang-selector button:hover,
.lang-selector button:focus-visible {
  color: var(--text);
  opacity: 1;
}
.lang-selector button.active {
  color: var(--accent);
  opacity: 1;
  border-bottom-color: var(--accent);
}

/* State accents — subtle polish only, never hiding the switcher. */
html.state-sovereign .lang-selector { letter-spacing: var(--tr-widest); }
html.state-crisis .lang-selector { /* stays fully visible — removed opacity:0 hide */ }
html.state-narrative .lang-selector { font-family: var(--font-mono); }

/* ============================================================================
 * HERO — Full viewport, atmosphere first
 * ============================================================================ */

.kts-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  /* Vertically center so the headline sits in the upper-middle of the fold,
     rather than being pushed to the very bottom (which previously made the
     page look empty on initial load). */
  align-items: center;
  padding-bottom: clamp(80px, 12vh, 180px);
  padding-top: clamp(120px, 14vh, 180px);
  overflow: hidden;
}

.kts-hero__canvas {
  position: absolute;
  inset: 0;
  z-index: var(--z-canvas);
}

.kts-hero__canvas canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.kts-hero__content {
  position: relative;
  z-index: var(--z-base);
  /* Ensure content is visible by default (fail-safe for when animations don't run). */
  opacity: 1;
  transform: none;
  animation: hero-emerge 900ms 0.1s both cubic-bezier(0.16, 1, 0.3, 1);
}

/* Per-state reveal timing — kept short so users never see a blank hero.
   Previous delays (1.8s–4s) caused the fold to appear empty. */
html.state-events .kts-hero__content,
html.state-crisis .kts-hero__content {
  animation-delay: 0.1s;
}

html.state-narrative .kts-hero__content { animation-delay: 0.2s; }
html.state-branding  .kts-hero__content { animation-delay: 0.2s; }
html.state-sovereign .kts-hero__content { animation-delay: 0.15s; }

@keyframes hero-emerge {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kts-hero__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(20px, 2.4vw, 36px);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.kts-hero__eyebrow::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--accent);
}

.kts-hero__headline {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style, normal);
  font-size: var(--fs-4xl);
  line-height: 1.02;
  letter-spacing: var(--tr-tight);
  max-width: 18ch;
  color: var(--text);
  margin: 0;
}

.kts-hero__sub {
  font-family: var(--font-editorial, var(--font-body));
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 52ch;
  margin-top: clamp(28px, 3vw, 44px);
}

/* ============================================================================
 * AUTHORITY BAR — The numbers speak
 * ============================================================================ */

.authority-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-block: clamp(48px, 5vw, 80px);
  background: var(--surface);
}

.authority-bar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(32px, 4vw, 72px);
  align-items: end;
}

.authority-stat__value {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style, normal);
  font-size: var(--fs-3xl);
  line-height: 0.95;
  letter-spacing: var(--tr-tight);
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

html.state-events .authority-stat__value {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-data);
}

.authority-stat__label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.4;
}

.authority-stat__suffix {
  font-size: 0.5em;
  color: var(--accent);
  font-weight: inherit;
}

/* ============================================================================
 * NARRATIVE ARC — The core proposition
 * ============================================================================ */

.narrative-arc {
  max-width: 960px;
}

.narrative-arc__prop {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style, normal);
  font-size: var(--fs-2xl);
  line-height: 1.18;
  letter-spacing: var(--tr-tight);
  color: var(--text);
}

.narrative-arc__support {
  font-family: var(--font-editorial, var(--font-body));
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 56ch;
  margin-top: clamp(32px, 3.5vw, 52px);
}

/* ============================================================================
 * SERVICES — Portals, not cards
 * ============================================================================ */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.service {
  background: var(--bg);
  padding: clamp(40px, 4vw, 64px) clamp(28px, 3vw, 48px);
  min-height: clamp(280px, 32vw, 420px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  position: relative;
  transition: background var(--transition), color var(--transition);
}

.service:hover { background: var(--surface); }

html.state-events .service { padding-block: clamp(32px, 3vw, 48px); min-height: clamp(240px, 28vw, 360px); }

.service__index {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  letter-spacing: var(--tr-wide);
}

.service__title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style, normal);
  font-size: var(--fs-xl);
  line-height: 1.15;
  letter-spacing: var(--tr-tight);
  color: var(--text);
}

.service__desc {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 42ch;
}

.service__cta {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: gap var(--transition-fast);
}
.service__cta::after { content: '→'; transition: transform var(--transition-fast); }
.service:hover .service__cta { gap: 16px; }
.service:hover .service__cta::after { transform: translateX(4px); }

/* ============================================================================
 * PROOF FIELD — Scale as content
 * ============================================================================ */

.proof-field {
  background: var(--surface);
  padding-block: var(--section-gap);
  position: relative;
}

.proof-list {
  display: grid;
  gap: 1px;
  background: var(--border);
}

.proof-item {
  background: var(--bg);
  padding: clamp(28px, 2.8vw, 44px) clamp(24px, 3vw, 48px);
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: clamp(20px, 3vw, 48px);
  align-items: baseline;
  transition: background var(--transition-fast);
}
.proof-item:hover { background: var(--surface); }

.proof-item__num {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  color: var(--text-faint);
  letter-spacing: var(--tr-wide);
}

.proof-item__title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style, normal);
  font-size: var(--fs-lg);
  line-height: 1.25;
  color: var(--text);
}

.proof-item__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  letter-spacing: var(--tr-wide);
  text-align: end;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .proof-item { grid-template-columns: 40px 1fr; }
  .proof-item__meta { grid-column: 1 / -1; text-align: start; }
}

/* ============================================================================
 * AEGIS V29 INTELLIGENCE PANEL (State 5)
 * ============================================================================ */

.aegis-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(32px, 3vw, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background-color: var(--border);
  position: relative;
}

.aegis-panel::before {
  content: 'AEGIS V29 — INTELLIGENCE LAYER';
  position: absolute;
  top: -10px; left: 24px;
  padding: 0 12px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: var(--tr-widest);
  color: var(--accent);
}

.aegis-metric {
  background: var(--surface);
  padding: clamp(20px, 2vw, 32px);
}

.aegis-metric__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: var(--tr-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.aegis-metric__value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  color: var(--text-mono);
  margin-top: 10px;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.aegis-metric__delta {
  font-size: var(--fs-xs);
  color: #4FC8A0;
  font-weight: 500;
}

.aegis-metric__status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-wider);
  color: var(--text-faint);
  margin-top: 8px;
}

.aegis-metric__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.aegis-metric__live::before {
  content: '';
  width: 6px; height: 6px;
  background: #4FC8A0;
  border-radius: 50%;
  box-shadow: 0 0 8px #4FC8A0;
  animation: pulse-live 1.6s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ============================================================================
 * EVIDENCE LOCKER — SHA-256 visible claim blocks (State 3, State 5)
 * ============================================================================ */

.evidence-claim {
  border-inline-start: 2px solid var(--accent);
  padding: clamp(18px, 1.8vw, 28px) clamp(22px, 2vw, 36px);
  background: var(--surface);
  margin-block: var(--micro-gap);
}

.evidence-claim__text {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
  max-width: 62ch;
}

.evidence-claim__hash {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  color: var(--text-faint);
  letter-spacing: var(--tr-wide);
  margin-top: 14px;
  word-break: break-all;
}
.evidence-claim__hash::before {
  content: 'SHA-256 · ';
  color: var(--accent);
}

/* ============================================================================
 * INQUIRY — The commitment statement
 * ============================================================================ */

.inquiry {
  padding-block: var(--section-gap);
  border-top: 1px solid var(--border);
}

.inquiry__headline {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style, normal);
  font-size: var(--fs-2xl);
  line-height: 1.15;
  letter-spacing: var(--tr-tight);
  color: var(--text);
  max-width: 20ch;
}

.inquiry__commitment {
  border-inline-start: 1px solid var(--accent);
  padding: clamp(20px, 2vw, 36px) clamp(24px, 2.4vw, 40px);
  font-family: var(--font-editorial, var(--font-body));
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 56ch;
  background: var(--surface);
}

.inquiry__commitment em {
  font-style: normal;
  color: var(--text);
}

.inquiry__cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: var(--tr-widest);
  text-transform: uppercase;
  transition: all var(--transition-fast);
  background: transparent;
}

.inquiry__cta:hover {
  background: var(--accent);
  color: var(--bg);
}

.inquiry__cta::after {
  content: '→';
  transition: transform var(--transition-fast);
}
.inquiry__cta:hover::after { transform: translateX(4px); }

/* ============================================================================
 * FOOTER
 * ============================================================================ */

.kts-footer {
  border-top: 1px solid var(--border);
  padding: clamp(40px, 4vw, 72px) clamp(24px, 4vw, 72px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: var(--tr-wide);
  color: var(--text-faint);
}

.kts-footer__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.kts-footer__status::before {
  content: '';
  width: 6px; height: 6px;
  background: #4FC8A0;
  border-radius: 50%;
  box-shadow: 0 0 6px #4FC8A0;
}

/* ============================================================================
 * STATE SWITCHER (development/override — hidden UI, accessible via ?state=)
 * Tiny corner indicator showing active state. NOT a visible switcher in prod.
 * ============================================================================ */

.kqas-state-ind {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: var(--z-header);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tr-wider);
  color: var(--text-faint);
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

body:hover .kqas-state-ind { opacity: 0.6; }

/* ============================================================================
 * RESPONSIVE
 * ============================================================================ */

@media (max-width: 768px) {
  .kts-nav { display: none; }
  .services { grid-template-columns: 1fr; }
  .authority-bar__grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

@media (max-width: 480px) {
  .kts-hero { padding-top: 120px; padding-bottom: 60px; }
  .authority-bar__grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================================
 * RTL — ARABIC
 * ============================================================================ */

html[dir="rtl"] {
  font-size: 110%;
}

html[dir="rtl"] body {
  line-height: 1.8;
}

html[dir="rtl"] .kts-hero__eyebrow::before {
  /* Line is still on leading edge — margin logical property covers it */
}

html[dir="rtl"] .service__cta::after { content: '←'; }
html[dir="rtl"] .inquiry__cta::after { content: '←'; }
html[dir="rtl"] .kts-hero__headline,
html[dir="rtl"] .narrative-arc__prop,
html[dir="rtl"] .service__title,
html[dir="rtl"] .inquiry__headline {
  font-family: 'Scheherazade New', 'Noto Naskh Arabic', var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
}

html[dir="rtl"] .kts-hero__sub,
html[dir="rtl"] .narrative-arc__support,
html[dir="rtl"] .editorial {
  font-family: 'Noto Naskh Arabic', 'Scheherazade New', var(--font-body);
  line-height: 1.85;
}

/* ============================================================================
 * MOTION — REDUCED
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .kts-hero__content { opacity: 1; transform: none; }
  html.state-crisis body::after { animation: none; opacity: 0.2; }
  .aegis-metric__live::before { animation: none; }
}

/* ============================================================================
 * STATE-DIFFERENTIATED VISUAL LAYER — V3.1
 * Each of the 5 states now projects a visibly distinct atmosphere via a
 * fixed-position tint, state-aware body class, decorative marks, and a
 * smooth colour transition when the class flips.
 * ============================================================================ */

/* Animate token flips so ?state= transitions are felt, not just seen */
html { transition: background-color 600ms cubic-bezier(0.16,1,0.3,1); }
body {
  position: relative;
  transition: background-color 600ms cubic-bezier(0.16,1,0.3,1),
              color 600ms cubic-bezier(0.16,1,0.3,1);
}

/* State tint layer — distinct coloured halo per state */
body::before {
  /* already used for grain — extend with the state-tint via background-image layering */
  background-image:
    var(--bg-tint, none),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  background-repeat: no-repeat, repeat;
  background-size: cover, 200px 200px;
}

/* ---------- STATE 1 · SOVEREIGN — gold-leaf top rail ---------- */
html.state-sovereign body::after {
  content: '';
  position: fixed; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
  opacity: 0.55;
  pointer-events: none;
  z-index: var(--z-overlay);
}
html.state-sovereign .kts-hero__eyebrow { color: var(--accent); letter-spacing: 0.36em; }
html.state-sovereign .service__cta,
html.state-sovereign .inquiry__cta { color: var(--accent); }

/* ---------- STATE 2 · EVENTS — orange accent bar + tight rhythm ---------- */
html.state-events body::after {
  content: '';
  position: fixed; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 38%, transparent 38%, transparent 62%, var(--accent) 62%, var(--accent) 100%);
  opacity: 0.85;
  pointer-events: none;
  z-index: var(--z-overlay);
  box-shadow: 0 0 24px rgba(255,77,28,0.28);
}
html.state-events .kts-hero__headline { letter-spacing: -0.03em; }
html.state-events .service { border-color: rgba(255,77,28,0.18); }
html.state-events .service__index { color: var(--accent); }
html.state-events .inquiry__cta { background: var(--accent); color: #0a0a0a; padding: 14px 28px; }

/* ---------- STATE 3 · CRISIS — red viewport pulse + timestamp markers ---------- */
/* (existing crisis-pulse preserved) */
html.state-crisis .kts-hero__eyebrow::before {
  content: '● LIVE · ';
  color: var(--accent);
  animation: crisis-pulse 1.6s ease-in-out infinite;
  margin-right: 4px;
}
html.state-crisis .service__cta { color: var(--accent); font-weight: 600; }
html.state-crisis .inquiry__cta { border: 1px solid var(--accent); color: var(--accent); padding: 14px 28px; }

/* ---------- STATE 4 · BRANDING — bronze italic tagline + corner embellishment ---------- */
html.state-branding .kts-hero__headline { font-style: italic; font-weight: 500; }
html.state-branding .kts-hero__eyebrow { color: var(--accent-2, var(--accent)); }
html.state-branding body::after {
  content: '';
  position: fixed; top: 20px; right: 20px; width: 60px; height: 60px;
  background: radial-gradient(circle at center, var(--accent-shimmer), transparent 70%);
  pointer-events: none;
  z-index: var(--z-overlay);
  opacity: 0.6;
}
html.state-branding .service__title { font-family: var(--font-display); font-style: italic; }
html.state-branding .inquiry__cta { color: var(--accent-2, var(--accent)); }

/* ---------- STATE 5 · NARRATIVE — teal grid (existing) + live-data monospace signature ---------- */
html.state-narrative .authority-stat__value,
html.state-narrative .data-value { color: var(--accent); font-family: var(--font-mono); }
html.state-narrative .kts-hero__eyebrow::after {
  content: ' · v3.0 · aegis v29';
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.82em;
  letter-spacing: 0.12em;
}
html.state-narrative .service__index { font-family: var(--font-mono); color: var(--accent); }
html.state-narrative .inquiry__cta {
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 24px;
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: var(--fs-xs);
}

/* ---------- CAPABILITY PAGES — inherit the state cast ---------- */
/* The cap-* tokens override base colours; rebind them to state accent so
 * a ?state= arriving capability page visibly matches. */
html.state-sovereign  body { --cap-accent: var(--accent); --cap-bg: var(--bg); }
html.state-events     body { --cap-accent: var(--accent); --cap-bg: var(--bg); }
html.state-crisis     body { --cap-accent: var(--accent); --cap-bg: var(--bg); }
html.state-branding   body { --cap-accent: var(--accent-2, var(--accent)); --cap-bg: var(--bg); }
html.state-narrative  body { --cap-accent: var(--accent); --cap-bg: var(--bg); }
