/* =========================================================================
   KRYONIS — Civilization Discovery Engine
   Production stylesheet
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@300;400;500&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;1,9..144,400&display=swap');

:root {
  --carbon: #0B0D0C;
  --graphite: #14171A;
  --graphite-2: #1C2024;
  --abyss-green: #102A22;
  --pine: #1A2E25;
  --pine-soft: #243A30;
  --gold: #B8935E;
  --gold-bright: #D4B27A;
  --gold-deep: #8E6C3D;
  --ivory: #E8E3D6;
  --ivory-soft: #D4CFC0;
  --ivory-dim: #8B8676;
  --grey: #5C5F5A;
  --line: rgba(232, 227, 214, 0.12);
  --line-strong: rgba(232, 227, 214, 0.28);
  --line-gold: rgba(184, 147, 94, 0.32);

  --display: 'Fraunces', 'EB Garamond', Georgia, serif;
  --serif: 'EB Garamond', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --max: 1280px;
  --reading: 68ch;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--carbon);
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ========== ATMOSPHERE ========== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(26, 46, 37, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 60% at 90% 80%, rgba(184, 147, 94, 0.06), transparent 70%),
    radial-gradient(ellipse 100% 80% at 50% 110%, rgba(16, 42, 34, 0.4), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 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.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.91 0 0 0 0 0.89 0 0 0 0 0.84 0 0 0 0.035 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
  opacity: 0.5;
}
main, header, footer, nav { position: relative; z-index: 1; }

/* ========== TYPOGRAPHY ========== */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--gold);
  display: inline-block;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--ivory);
  margin: 0;
}
h1 {
  font-size: clamp(2.6rem, 6.8vw, 6.4rem);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-weight: 300;
}
h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-variation-settings: "opsz" 96;
  font-weight: 350;
}
h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-variation-settings: "opsz" 36;
  font-weight: 400;
  line-height: 1.2;
}
h4 {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
p { margin: 0 0 1.1em; }
strong { color: var(--ivory); font-weight: 500; }
em { color: var(--gold-bright); font-style: italic; }

.lede {
  font-family: var(--display);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  line-height: 1.5;
  font-weight: 350;
  color: var(--ivory-soft);
  max-width: var(--reading);
  letter-spacing: -0.005em;
}

.accent {
  font-style: italic;
  color: var(--gold-bright);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-weight: 350;
}

/* ========== LAYOUT ========== */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}
section { padding: clamp(80px, 12vh, 160px) 0; }
.section-head { margin-bottom: clamp(48px, 7vh, 96px); }
.section-head .eyebrow { margin-bottom: 24px; }

/* ========== NAV ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  background: rgba(11, 13, 12, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-mark {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ivory);
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-mark::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--gold);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--ivory-dim);
  transition: color 0.3s ease;
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-bright); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-toggle { display: none; background: none; border: 0; color: var(--ivory); padding: 8px; }

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 120px 0 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  z-index: 0;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 13, 12, 0.4) 0%, rgba(11, 13, 12, 0.85) 100%);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
  width: 100%;
  position: relative;
  z-index: 2;
}
.hero-meta {
  display: flex;
  gap: 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 10px; }
.hero-meta span::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--gold);
  display: inline-block;
}
.hero h1 {
  max-width: 14ch;
  margin-bottom: 36px;
}
.hero-tagline {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1.7vw, 1.5rem);
  line-height: 1.45;
  color: var(--ivory-soft);
  max-width: 56ch;
  font-style: italic;
  font-weight: 350;
  margin-bottom: 56px;
}
.hero-cta {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-horizon {
  position: absolute;
  left: 0; right: 0; bottom: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-gold), transparent);
  z-index: 1;
}
.hero-horizon-label {
  position: absolute;
  bottom: 40px; right: clamp(20px, 4vw, 56px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: right;
  z-index: 2;
}
.hero-horizon-label small {
  display: block;
  color: var(--ivory-dim);
  font-size: 9px;
  margin-top: 4px;
}

/* sub-page hero (smaller) */
.hero-sub {
  min-height: 60vh;
  padding: 140px 0 80px;
}
.hero-sub h1 {
  font-size: clamp(2.2rem, 5.5vw, 5rem);
  max-width: 18ch;
}

/* ========== BUTTONS ========== */
/* Doctrine: gold is an accent, never a flooded surface.
   Default state: dark background, subtle ivory border, ivory text.
   Hover: gold border + gold text, with a very faint gold inner glow. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--ivory);
  background: rgba(11, 13, 12, 0.6);
  transition: border-color 0.4s ease, color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  cursor: pointer;
}
.btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(26, 46, 37, 0.5);
  box-shadow: inset 0 0 0 1px rgba(184, 147, 94, 0.12);
}

/* Primary: gold-bordered, gold-typed, deep abyss-green ground.
   Reserved for the principal call to action on a section. */
.btn-primary {
  background: linear-gradient(180deg, rgba(26, 46, 37, 0.7) 0%, rgba(16, 42, 34, 0.85) 100%);
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  box-shadow:
    inset 0 0 0 1px rgba(184, 147, 94, 0.08),
    0 0 0 1px rgba(184, 147, 94, 0.06);
}
.btn-primary:hover {
  color: var(--ivory);
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(36, 58, 48, 0.85) 0%, rgba(26, 46, 37, 0.95) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(212, 178, 122, 0.18),
    0 0 24px rgba(184, 147, 94, 0.12);
}

.btn-arrow::after {
  content: "→";
  font-family: var(--serif);
  font-size: 14px;
  transition: transform 0.3s;
}
.btn-arrow:hover::after { transform: translateX(4px); }

.link-inline {
  color: var(--gold-bright);
  border-bottom: 1px solid var(--line-gold);
  padding-bottom: 1px;
  transition: all 0.3s;
}
.link-inline:hover {
  color: var(--ivory);
  border-bottom-color: var(--ivory);
}

/* ========== DOCTRINE / PROSE ========== */
.doctrine {
  background: linear-gradient(180deg, transparent 0%, rgba(16, 42, 34, 0.25) 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.doctrine-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}
.doctrine-left .sticky {
  position: sticky;
  top: 100px;
}
.doctrine-prose { max-width: var(--reading); }
.doctrine-prose p { margin-bottom: 1.4em; }
.doctrine-prose blockquote {
  margin: 2.5em 0;
  padding-left: 28px;
  border-left: 2px solid var(--gold);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--gold-bright);
  font-weight: 350;
}

@media (max-width: 900px) {
  .doctrine-grid { grid-template-columns: 1fr; }
  .doctrine-left .sticky { position: static; }
}

/* ========== SECTION WITH VISUAL ========== */
.section-visual {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.section-visual-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  z-index: 0;
}
.section-visual-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 13, 12, 0.7) 0%, rgba(11, 13, 12, 0.95) 100%);
}
.section-visual .wrap { position: relative; z-index: 1; }

/* ========== ENGINE CYCLE ========== */
.engine {
  background: var(--graphite);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.engine::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(184, 147, 94, 0.08), transparent 60%);
  pointer-events: none;
}

.cycle {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-top: 64px;
  position: relative;
}
.cycle-node {
  border: 1px solid var(--line);
  border-right: 0;
  padding: 28px 20px;
  position: relative;
  background: rgba(11, 13, 12, 0.5);
  transition: all 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.cycle-node:last-child { border-right: 1px solid var(--line); }
.cycle-node:hover {
  background: rgba(26, 46, 37, 0.5);
  border-color: var(--line-gold);
  transform: translateY(-4px);
}
.cycle-node:hover .cycle-num { color: var(--gold-bright); }
.cycle-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 16px;
  transition: color 0.3s;
}
.cycle-name {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--ivory);
  margin-bottom: 14px;
  font-weight: 400;
}
.cycle-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ivory-dim);
  font-family: var(--serif);
}
.cycle-loop {
  margin-top: 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.cycle-loop::before, .cycle-loop::after {
  content: "↻";
  margin: 0 14px;
  font-size: 16px;
}

@media (max-width: 1100px) {
  .cycle { grid-template-columns: repeat(2, 1fr); }
  .cycle-node {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .cycle-node:nth-child(odd) { border-right: 0; }
  .cycle-node:last-child { border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .cycle { grid-template-columns: 1fr; }
  .cycle-node, .cycle-node:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
}

/* ========== AGENT DETAIL CARDS (engine.html) ========== */
.agent-detail {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.agent-detail:last-child { border-bottom: 0; }
.agent-detail-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
  padding-top: 8px;
}
.agent-detail-label strong {
  display: block;
  color: var(--ivory);
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 12px;
  letter-spacing: -0.01em;
}
.agent-detail-body p {
  color: var(--ivory-soft);
  line-height: 1.6;
}
.agent-detail-body p:last-child { margin-bottom: 0; }
.agent-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
.agent-list li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ivory-dim);
  letter-spacing: 0.04em;
  padding-left: 18px;
  position: relative;
}
.agent-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--gold);
}
@media (max-width: 800px) {
  .agent-detail { grid-template-columns: 1fr; gap: 24px; }
  .agent-list { grid-template-columns: 1fr; }
}

/* ========== REGISTRY ========== */
.registry {
  background: linear-gradient(180deg, var(--carbon) 0%, rgba(16, 42, 34, 0.15) 100%);
}
.registry-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding: 6px;
  background: rgba(20, 23, 26, 0.6);
  border: 1px solid var(--line);
  width: fit-content;
}
.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
}
.filter-btn:hover { color: var(--ivory); }
.filter-btn.active {
  background: rgba(16, 42, 34, 0.6);
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(184, 147, 94, 0.08);
}

.ledger { border-top: 1px solid var(--line); }
.hypothesis {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: start;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  transition: all 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  position: relative;
}
.hypothesis::before {
  content: "";
  position: absolute;
  left: -16px; top: 50%;
  width: 6px;
  height: 0;
  background: var(--gold);
  transform: translateY(-50%);
  transition: height 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.hypothesis:hover {
  background: linear-gradient(90deg, rgba(184, 147, 94, 0.04), transparent);
  padding-left: 12px;
}
.hypothesis:hover::before { height: 60%; }
.hypothesis:hover h3 { color: var(--gold-bright); }

.hyp-id {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
  padding-top: 6px;
}
.hyp-body h3 {
  margin-bottom: 14px;
  transition: color 0.3s;
}
.hyp-body p {
  color: var(--ivory-soft);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
  max-width: 60ch;
}
.hyp-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  align-items: flex-end;
}
.status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--line);
  color: var(--ivory-dim);
  white-space: nowrap;
  background: rgba(11, 13, 12, 0.5);
}
.status[data-level="1"] { border-color: rgba(232, 227, 214, 0.2); }
.status[data-level="2"] { border-color: rgba(184, 147, 94, 0.3); color: var(--gold-deep); }
.status[data-level="3"] { border-color: var(--gold-deep); color: var(--gold); }
.status[data-level="4"] { border-color: var(--gold); color: var(--gold-bright); }
.status[data-level="5"] {
  background: rgba(16, 42, 34, 0.85);
  color: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow:
    inset 0 0 0 1px rgba(212, 178, 122, 0.18),
    0 0 12px rgba(184, 147, 94, 0.18);
}
.hyp-track {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ivory-dim);
  letter-spacing: 0.12em;
}

@media (max-width: 800px) {
  .hypothesis { grid-template-columns: 1fr; gap: 16px; }
  .hyp-meta { flex-direction: row; text-align: left; align-items: center; flex-wrap: wrap; }
}

/* ========== HYPOTHESIS DETAIL (registry.html) ========== */
.hyp-detail {
  border: 1px solid var(--line);
  background: rgba(20, 23, 26, 0.4);
  padding: 48px;
  margin-bottom: 32px;
  transition: all 0.4s;
}
.hyp-detail:hover {
  border-color: var(--line-gold);
  background: rgba(26, 46, 37, 0.3);
}
.hyp-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.hyp-detail-head h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  max-width: 32ch;
}
.hyp-detail-id {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.hyp-detail-rows {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.hyp-detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.hyp-detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hyp-detail-row-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 4px;
}
.hyp-detail-row p {
  color: var(--ivory-soft);
  margin: 0;
  line-height: 1.6;
}
@media (max-width: 700px) {
  .hyp-detail { padding: 32px 24px; }
  .hyp-detail-head { flex-direction: column; gap: 12px; }
  .hyp-detail-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ========== ECOSYSTEM ========== */
.ecosystem {
  background: var(--graphite);
  border-top: 1px solid var(--line);
}
.eco-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: 64px;
}
.eco-node {
  background: var(--graphite);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: background 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  position: relative;
  min-height: 320px;
}
.eco-node:hover { background: var(--graphite-2); }
.eco-node.primary {
  background: linear-gradient(135deg, var(--abyss-green) 0%, var(--pine) 100%);
}
.eco-node.primary:hover { background: linear-gradient(135deg, var(--pine) 0%, var(--pine-soft) 100%); }
.eco-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.eco-domain {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.1;
  color: var(--ivory);
}
.eco-role {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ivory-soft);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.eco-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ivory-dim);
  flex-grow: 1;
}
.eco-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: gap 0.3s;
  margin-top: 8px;
}
.eco-link::after { content: "↗"; transition: transform 0.3s; }
.eco-link:hover { gap: 14px; color: var(--gold-bright); }
@media (max-width: 800px) { .eco-grid { grid-template-columns: 1fr; } }

/* ========== ECOSYSTEM DETAIL PAGE ========== */
.eco-detail {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 80px);
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.eco-detail:last-child { border-bottom: 0; }
.eco-detail-left .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 16px;
}
.eco-detail-left .domain {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--ivory);
}
.eco-detail-left .role {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-bright);
  font-size: 1.1rem;
  margin-bottom: 20px;
}
.eco-detail-right p { color: var(--ivory-soft); line-height: 1.65; }
.eco-detail-right .eco-link { margin-top: 16px; }
@media (max-width: 800px) {
  .eco-detail { grid-template-columns: 1fr; gap: 20px; padding: 48px 0; }
}

/* ========== HORIZON / 2129 ========== */
.horizon {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(26, 46, 37, 0.5), transparent 60%),
    var(--carbon);
  position: relative;
  overflow: hidden;
}
.horizon-inner {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}
.horizon-years {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 9rem);
  font-weight: 300;
  line-height: 1;
  color: var(--ivory);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  letter-spacing: -0.03em;
  margin: 32px 0;
}
.horizon-years .sep {
  color: var(--gold);
  font-style: italic;
  margin: 0 0.1em;
}
.horizon-meta {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 64px;
  flex-wrap: wrap;
}
.horizon-meta div { text-align: center; }
.horizon-meta strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--gold-bright);
  font-style: italic;
}
.horizon-meta small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin-top: 8px;
  display: block;
}

/* ========== METHODOLOGY ========== */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: 64px;
}
.method-cell {
  background: var(--carbon);
  padding: 36px 32px;
  border-top: 2px solid transparent;
  transition: border-color 0.5s;
}
.method-cell:hover { border-top-color: var(--gold); }
.method-cell .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 20px;
}
.method-cell h4 {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 14px;
}
.method-cell p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ivory-dim);
  margin: 0;
}
@media (max-width: 900px) { .method-grid { grid-template-columns: 1fr; } }

/* ========== CORRESPONDENCE ========== */
.corr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 8vw, 96px);
  align-items: start;
}
.corr-form {
  background: rgba(20, 23, 26, 0.4);
  border: 1px solid var(--line);
  padding: 48px;
}
.corr-form h3 { margin-bottom: 24px; }
.corr-form p { color: var(--ivory-soft); margin-bottom: 32px; }
.corr-form label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.corr-form input, .corr-form textarea {
  width: 100%;
  background: rgba(11, 13, 12, 0.7);
  border: 1px solid var(--line);
  color: var(--ivory);
  padding: 12px 16px;
  font-family: var(--serif);
  font-size: 1rem;
  margin-bottom: 24px;
  transition: border-color 0.3s;
}
.corr-form input:focus, .corr-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.corr-form textarea { resize: vertical; min-height: 140px; }
.corr-info dl { margin: 0; }
.corr-info dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 24px;
  margin-bottom: 6px;
}
.corr-info dt:first-child { margin-top: 0; }
.corr-info dd {
  margin: 0 0 8px;
  color: var(--ivory-soft);
  font-family: var(--serif);
  font-size: 1rem;
}
@media (max-width: 900px) {
  .corr-grid { grid-template-columns: 1fr; }
  .corr-form { padding: 32px 24px; }
}

/* ========== CTA STRIP ========== */
.cta-strip {
  background: var(--abyss-green);
  border-top: 1px solid var(--line-gold);
  border-bottom: 1px solid var(--line-gold);
}
.cta-strip .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.cta-strip h2 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  max-width: 24ch;
  margin: 0;
}
/* Inside CTA strip the surrounding ground is already abyss-green,
   so the primary button needs a more graphite-leaning ground for contrast. */
.cta-strip .btn-primary {
  background: linear-gradient(180deg, rgba(20, 23, 26, 0.85) 0%, rgba(11, 13, 12, 0.95) 100%);
}
.cta-strip .btn-primary:hover {
  background: linear-gradient(180deg, rgba(28, 32, 36, 0.95) 0%, rgba(20, 23, 26, 1) 100%);
}
@media (max-width: 800px) { .cta-strip .wrap { grid-template-columns: 1fr; } }

/* ========== FOOTER ========== */
.foot {
  background: var(--carbon);
  border-top: 1px solid var(--line);
  padding: 80px 0 40px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.foot h5 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 20px;
  font-weight: 400;
}
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 12px; }
.foot a {
  color: var(--ivory-soft);
  font-size: 0.95rem;
  transition: color 0.3s;
}
.foot a:hover { color: var(--gold-bright); }
.foot-mark {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--ivory);
  margin-bottom: 16px;
}
.foot-desc {
  color: var(--ivory-dim);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 42ch;
}
.foot-bottom {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .foot-grid { grid-template-columns: 1fr; } }

/* ========== TICKER ========== */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 12, 0.5);
  padding: 18px 0;
  overflow: hidden;
}
.ticker-track {
  display: flex;
  gap: 64px;
  animation: scroll 60s linear infinite;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  white-space: nowrap;
}
.ticker-track span { display: inline-flex; align-items: center; gap: 12px; }
.ticker-track span::before {
  content: "";
  width: 4px; height: 4px;
  background: var(--gold);
}
@keyframes scroll { to { transform: translateX(-50%); } }

/* ========== 404 ========== */
.notfound {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}
.notfound h1 { font-size: clamp(4rem, 12vw, 9rem); margin-bottom: 16px; }
.notfound p { color: var(--ivory-soft); margin-bottom: 40px; }

/* ========== REVEAL ========== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.25, 0.1, 0.25, 1), transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

.hero .reveal { animation: heroIn 1.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; opacity: 0; }
.hero .reveal:nth-child(1) { animation-delay: 0.1s; }
.hero .reveal:nth-child(2) { animation-delay: 0.3s; }
.hero .reveal:nth-child(3) { animation-delay: 0.5s; }
.hero .reveal:nth-child(4) { animation-delay: 0.7s; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== UTIL ========== */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-gold), transparent);
  margin: 80px 0;
}

/* ========== HERO MOBILE ========== */
@media (max-width: 800px) {
  .hero { min-height: auto; padding: 100px 0 60px; }
  .hero-horizon, .hero-horizon-label { display: none; }
  .hero-cta {
    gap: 14px;
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-cta .btn {
    width: auto;
    min-width: 220px;
    justify-content: center;
    padding: 14px 22px;
    font-size: 11px;
  }
}

/* ========== NAV MOBILE ========== */
@media (max-width: 800px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - 64px);
    width: 100vw;
    background: #0B0D0C;
    background-image:
      radial-gradient(ellipse 80% 50% at 20% 10%, rgba(26, 46, 37, 0.5), transparent 60%),
      radial-gradient(ellipse 60% 60% at 90% 80%, rgba(184, 147, 94, 0.08), transparent 70%);
    flex-direction: column;
    align-items: flex-start;
    padding: 48px 32px;
    gap: 28px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 100;
    overflow-y: auto;
  }
  .nav-links a { font-size: 14px; padding: 8px 0; }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: block; z-index: 101; position: relative; }
  .nav-toggle svg { width: 24px; height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
