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

/* ── Custom properties ─────────────────────────── */
:root {
  --bg:           oklch(13% 0.012 220);
  --bg-raised:    oklch(17% 0.012 220);
  --bg-surface:   oklch(20% 0.012 220);
  --fg:           oklch(91% 0.006 80);
  --fg-muted:     oklch(58% 0.010 200);
  --fg-dim:       oklch(42% 0.010 200);
  --teal:         oklch(68% 0.14 195);
  --teal-subtle:  oklch(20% 0.06 195);
  --teal-border:  oklch(30% 0.08 195);
  --teal-dim:     oklch(42% 0.10 195);
  --amber:        oklch(78% 0.14 75);
  --amber-subtle: oklch(18% 0.06 75);
  --amber-border: oklch(28% 0.08 75);
  --rule:         oklch(26% 0.010 220);
  --rule-soft:    oklch(22% 0.010 220);
  --terminal-bg:  oklch(20% 0.010 220);
  --terminal-bar: oklch(24% 0.010 220);
  --terminal-rule:oklch(30% 0.010 220);
  --terminal-fg:  oklch(88% 0.006 80);
  --terminal-muted: oklch(58% 0.010 200);

  --font-body:    'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-hero:    var(--font-display);
}

/* ── Typography ────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--fg); }

/* ── Layout ─────────────────────────────────────── */
/* Page-level grid bg — very subtle to suggest a spatial canvas */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 80%);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 48px; position: relative; z-index: 1; }
.container--narrow { max-width: 860px; }

/* ── Navigation ─────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.nav-brand-mark {
  width: 28px;
  height: 24px;
  flex-shrink: 0;
}
.nav-brand em { color: var(--teal); font-style: normal; margin-left: -0.4em; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: color 0.14s ease;
}
.nav-link:hover { color: var(--fg); }
.nav-link--cta {
  color: var(--teal);
  border: 1px solid var(--teal-border);
  padding: 7px 14px;
  white-space: nowrap;
}
.nav-link { white-space: nowrap; }
.nav-link--cta:hover { background: var(--teal-subtle); color: var(--teal); }

/* ── Components ─────────────────────────────────── */

/* ── HERO ── */
.hero {
  padding: 140px 0 120px;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--teal);
}
.hero-title {
  font-family: var(--font-hero);
  font-weight: 300;
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 36px;
  max-width: 18ch;
  text-wrap: balance;
}
.hero-title em {
  color: var(--teal);
  font-style: normal;
}
.hero-lede {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 56ch;
  text-wrap: pretty;
  margin-bottom: 56px;
}

.hero-meta {
  display: flex;
  gap: 48px;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
  flex-wrap: wrap;
}
.hero-meta-item {
  flex: 1;
  min-width: 180px;
}
.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.hero-meta-value {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
}
.hero-meta-value em { color: var(--teal); font-style: normal; }

/* ── SECTION SCAFFOLD ── */
section.section {
  padding: 96px 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-eyebrow .counter {
  color: var(--fg-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* ── PILLAR (used 3×) ── */
.pillar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}
.pillar-text { padding-top: 8px; }
.pillar-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--teal-border);
  background: var(--teal-subtle);
  margin-bottom: 24px;
  white-space: nowrap;
}
.pillar-tag .dot {
  width: 6px; height: 6px;
  background: var(--teal);
  display: inline-block;
}
.pillar-name {
  font-family: var(--font-hero);
  font-weight: 300;
  font-size: clamp(40px, 4.8vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.pillar-name .acronym {
  color: var(--teal);
}
.pillar-name .full {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 12px;
  font-weight: 400;
}
.pillar-lede {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.55;
  color: var(--fg);
  margin-bottom: 20px;
  text-wrap: pretty;
}
.pillar-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-muted);
  margin-bottom: 32px;
  max-width: 52ch;
  text-wrap: pretty;
}
.pillar-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--teal-dim);
  transition: gap 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.pillar-link:hover { gap: 18px; border-bottom-color: var(--teal); color: var(--teal); }
.pillar-link::after { content: '→'; }

.pillar-visual {
  position: relative;
}

/* ── FIGURE (SCP component) ── */
.figure {
  border: 1px solid var(--rule);
  background: var(--bg-raised);
  overflow: hidden;
}
.figure-img-wrap {
  aspect-ratio: 4 / 3;
  background: var(--bg-surface);
  overflow: hidden;
  position: relative;
}
.figure-img-wrap img,
.figure-img-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.92) contrast(1.02);
}
.figure-img-wrap--contain img { object-fit: contain; background: oklch(95% 0.005 80); }
.figure-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-surface);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  flex-wrap: wrap;
}
.figure-bar > span { white-space: nowrap; }
.figure-bar-tag { color: var(--teal); letter-spacing: 0.08em; text-transform: none; }
.figure-cap {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.5;
  padding: 0 4px;
}
.figure-cap::before { content: '// '; color: var(--teal); }

/* ── TERMINAL (SCP component) ── */
.terminal {
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-rule);
  overflow: hidden;
}
.terminal-bar {
  background: var(--terminal-bar);
  border-bottom: 1px solid var(--terminal-rule);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.terminal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terminal-rule); }
.terminal-dot:nth-child(1) { background: oklch(55% 0.04 25); }
.terminal-dot:nth-child(2) { background: oklch(62% 0.04 65); }
.terminal-dot:nth-child(3) { background: oklch(55% 0.04 145); }
.terminal-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--terminal-muted);
  letter-spacing: 0.06em;
  margin-left: 4px;
}
.terminal-body { padding: 22px 24px; }
.terminal-line { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.terminal-line:last-child { margin-bottom: 0; }
.terminal-prompt {
  font-family: var(--font-mono);
  font-size: 13px;
  flex-shrink: 0;
  padding-top: 2px;
}
.terminal-prompt--query    { color: oklch(78% 0.14 75); }
.terminal-prompt--response { color: oklch(68% 0.14 195); }
.terminal-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--terminal-fg);
  overflow-wrap: break-word;
  min-width: 0;
}
.terminal-text em { color: oklch(78% 0.14 75); font-style: normal; }
.terminal-text strong { color: oklch(68% 0.14 195); font-weight: 500; }

/* ── PULL QUOTE for CORD ── */
.pullquote {
  font-family: var(--font-hero);
  font-weight: 300;
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--fg);
  padding: 32px 0;
  border-top: 1px solid var(--teal-dim);
  border-bottom: 1px solid var(--teal-dim);
  text-wrap: pretty;
}
.pullquote::before {
  content: 'KEY INSIGHT';
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--teal);
  margin-bottom: 16px;
  font-weight: 400;
}
.pullquote em { color: var(--teal); font-style: normal; }

/* CORD signal glyphs — 4 facets */
.facets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--rule);
  background: var(--bg-raised);
}
.facet {
  padding: 22px 24px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.facet:nth-child(2n) { border-right: none; }
.facet:nth-last-child(-n+2) { border-bottom: none; }
.facet-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.facet-name {
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: 17px;
  color: var(--fg);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.facet-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ── CLOSING ── */
.closing {
  padding: 120px 0 96px;
  border-top: 1px solid var(--rule);
  text-align: left;
}
.closing-title {
  font-family: var(--font-hero);
  font-weight: 300;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
  max-width: 22ch;
  text-wrap: balance;
}
.closing-title em { color: var(--teal); font-style: normal; }
.closing-body {
  font-size: 17px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 50ch;
  margin-bottom: 40px;
}
.closing-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 1px solid var(--teal-border);
  color: var(--teal);
  background: var(--teal-subtle);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  cursor: pointer;
}
.btn:hover { background: var(--teal); color: var(--bg); border-color: var(--teal); }
.btn--ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--fg-muted);
}
.btn--ghost:hover { color: var(--fg); border-color: var(--fg-muted); background: transparent; }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--rule);
  padding: 40px 0 32px;
  background: var(--bg-raised);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}
.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.footer-brand em { color: var(--teal); font-style: normal; margin-left: -0.4em; }
.footer-brand-mark { width: 28px; height: 24px; flex-shrink: 0; }
.footer-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 12px;
  line-height: 1.6;
  max-width: 32ch;
}
.footer h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  margin-bottom: 16px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer ul a {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg);
}
.footer ul a:hover { color: var(--teal); }
.footer-bottom {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
}

/* ── Utilities ──────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ── Animations ─────────────────────────────────── */
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 720px) {
  .nav-links { display: none; }
}

@media (max-width: 900px) {
  .pillar { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 800px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .container { padding: 0 24px; }
  .nav-inner  { padding: 18px 24px; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ── Viewer ──────────────────────────────────────── */
.figure--viewer .figure-img-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

.figure--viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-loading,
.viewer-hint {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg);
  pointer-events: none;
}

.viewer-hint {
  bottom: 32px;
  transition: opacity 0.6s ease;
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.9),
    0 0 16px rgba(0, 0, 0, 0.8),
    0 1px 3px rgba(0, 0, 0, 1);
}

.viewer-hint--hidden {
  opacity: 0;
}
