:root {
  color-scheme: dark;
  --bg: #070808;
  --bg-elevated: #0d1010;
  --panel: #111515;
  --panel-strong: #161b1a;
  --line: #26322f;
  --line-soft: #1a2321;
  --text: #f3f5f2;
  --muted: #a8b2ab;
  --subtle: #6f7b74;
  --teal: #55d6bd;
  --teal-soft: rgba(85, 214, 189, 0.12);
  --gold: #d4ad59;
  --gold-soft: rgba(212, 173, 89, 0.14);
  --coral: #ef7568;
  --coral-soft: rgba(239, 117, 104, 0.12);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(85, 214, 189, 0.06), transparent 420px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 64px 64px, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::selection {
  background: rgba(85, 214, 189, 0.3);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 10;
  transform: translateY(-160%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 10px 14px;
  color: var(--text);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(85, 214, 189, 0.34);
  border-radius: 7px;
  background: rgba(85, 214, 189, 0.08);
}

.brand-mark span {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--teal);
}

.brand-mark span:nth-child(2) {
  background: var(--gold);
}

.brand-mark span:nth-child(3) {
  background: var(--coral);
}

.brand-mark span:nth-child(4) {
  background: #c9d6d0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(13, 16, 16, 0.72);
  padding: 5px;
}

.nav-links a {
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.nav-links a.active {
  background: var(--teal-soft);
  color: var(--teal);
}

.site-shell {
  width: min(var(--max-width), calc(100% - 40px));
  min-height: calc(100vh - 132px);
  margin: 0 auto;
}

.page {
  display: none;
  padding: 28px 0 80px;
}

.page.active {
  display: block;
  animation: page-in 360ms ease both;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.86fr);
  gap: 56px;
  align-items: center;
  min-height: 68vh;
  padding: 58px 0 36px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.02;
}

h1 {
  max-width: 820px;
  font-size: 4.8rem;
  font-weight: 800;
}

h2 {
  max-width: 820px;
  font-size: 3.5rem;
  font-weight: 800;
}

h3 {
  font-size: 1.22rem;
  font-weight: 750;
}

.lede {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.75;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 7px;
  padding: 0 18px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  border: 1px solid rgba(85, 214, 189, 0.56);
  background: var(--teal);
  color: #06100e;
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.signal {
  position: relative;
  min-height: 510px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(85, 214, 189, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(212, 173, 89, 0.1), transparent 45%),
    #0b0e0e;
}

#knowledgeCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 510px;
}

.signal-overlay {
  position: absolute;
  inset: auto 18px 18px 18px;
  display: grid;
  gap: 8px;
}

.signal-overlay div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(7, 8, 8, 0.72);
  padding: 10px 12px;
  backdrop-filter: blur(12px);
}

.signal-overlay span {
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 600;
}

.signal-overlay strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: right;
}

.thesis-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.thesis-strip p {
  margin: 0;
  background: rgba(17, 21, 21, 0.92);
  padding: 22px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.4;
}

.thesis-strip p:nth-child(1) {
  color: var(--text);
}

.thesis-strip p:nth-child(2) {
  color: var(--teal);
}

.thesis-strip p:nth-child(3) {
  color: var(--gold);
}

.page-heading {
  max-width: 920px;
  padding: 74px 0 34px;
}

.page-heading p:not(.eyebrow) {
  max-width: 770px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.principle,
.stage-card,
.network-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 21, 0.74);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.principle {
  min-height: 250px;
  padding: 22px;
}

.principle span,
.stage-kicker {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

.principle h3 {
  margin-top: 44px;
}

.principle p,
.stage-card p,
.network-panel p,
.network-panel li {
  color: var(--muted);
  line-height: 1.65;
}

.principle p {
  margin: 14px 0 0;
  font-size: 0.95rem;
}

.stage-flow {
  display: grid;
  grid-template-columns: 1.1fr repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin: 18px 0 22px;
}

.stage-flow span {
  display: flex;
  align-items: center;
  min-height: 58px;
  background: rgba(13, 16, 16, 0.92);
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.stage-flow span:nth-child(2),
.stage-flow span:nth-child(4) {
  color: var(--teal);
}

.stage-flow span:nth-child(3) {
  color: var(--gold);
}

.stage-flow span:nth-child(5) {
  color: var(--coral);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stage-card {
  position: relative;
  min-height: 360px;
  padding: 22px;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.stage-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--teal);
}

.stage-card:nth-child(2)::before {
  background: var(--gold);
}

.stage-card:nth-child(3)::before {
  background: #c9d6d0;
}

.stage-card:nth-child(4)::before {
  background: var(--coral);
}

.stage-card:hover {
  transform: translateY(-3px);
  border-color: rgba(85, 214, 189, 0.35);
  background: rgba(22, 27, 26, 0.92);
}

.stage-card h3 {
  margin-top: 64px;
  font-size: 1.75rem;
}

.stage-card p {
  margin: 16px 0 0;
  font-size: 0.95rem;
}

.stage-card .stage-scope {
  color: var(--text);
  font-weight: 650;
}

.network-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 16px;
  align-items: stretch;
}

.network-panel {
  padding: 26px;
}

.network-panel.accent {
  background:
    linear-gradient(135deg, var(--gold-soft), transparent 48%),
    rgba(17, 21, 21, 0.86);
}

.network-panel h3 {
  margin-bottom: 18px;
}

.network-panel ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.network-panel p {
  margin: 0;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--line-soft);
  padding: 28px 0 40px;
  color: var(--subtle);
  font-size: 0.92rem;
}

.footer p {
  margin: 0;
}

.footer p:first-child {
  color: var(--text);
  font-weight: 750;
}

.reveal {
  transform: translateY(16px);
  opacity: 0;
  transition: transform 520ms ease, opacity 520ms ease;
}

.reveal.visible {
  transform: translateY(0);
  opacity: 1;
}

@keyframes page-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1040px) {
  h1 {
    font-size: 3.6rem;
  }

  h2 {
    font-size: 2.8rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    min-height: auto;
    padding-top: 40px;
  }

  .signal {
    min-height: 420px;
  }

  #knowledgeCanvas {
    min-height: 420px;
  }

  .principles-grid,
  .stage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stage-flow {
    grid-template-columns: 1fr;
  }

  .stage-flow span {
    min-height: 46px;
  }
}

@media (max-width: 740px) {
  .topbar {
    width: min(100% - 28px, var(--max-width));
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
  }

  .nav-links a {
    flex: 0 0 auto;
  }

  .site-shell,
  .footer {
    width: min(100% - 28px, var(--max-width));
  }

  .page {
    padding-bottom: 54px;
  }

  h1 {
    font-size: 2.65rem;
    line-height: 1.06;
  }

  h2 {
    font-size: 2.18rem;
    line-height: 1.08;
  }

  .lede,
  .page-heading p:not(.eyebrow) {
    font-size: 1rem;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .signal {
    min-height: 390px;
  }

  #knowledgeCanvas {
    min-height: 390px;
  }

  .signal-overlay div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .signal-overlay strong {
    text-align: left;
  }

  .thesis-strip,
  .principles-grid,
  .stage-grid,
  .network-layout {
    grid-template-columns: 1fr;
  }

  .principle {
    min-height: 210px;
  }

  .stage-card {
    min-height: 300px;
  }

  .footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
