:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #101218;
  --panel-bright: #171a23;
  --line: rgba(255, 255, 255, 0.11);
  --line-bright: rgba(255, 255, 255, 0.2);
  --text: #f4f3ef;
  --muted: #999ca7;
  --quiet: #60646f;
  --cyan: #68e0d1;
  --cyan-bright: #b0fff0;
  --violet: #9b86ff;
  --coral: #ff836d;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100vh;
  height: 100svh;
  max-width: 100vw;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 45%, rgba(74, 62, 137, 0.17), transparent 34%),
    radial-gradient(circle at 12% 15%, rgba(39, 113, 110, 0.11), transparent 26%),
    var(--bg);
}

.app-shell::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 85%);
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
  content: "";
}

.topbar, .footer {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  color: var(--text);
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--cyan);
}

.brand-mark svg { width: 100%; height: 100%; }
.brand-word { font-size: 15px; font-weight: 700; }
.brand-word span { color: var(--quiet); font-weight: 500; }

.nav { display: flex; align-items: center; gap: 6px; }

.nav-button {
  position: relative;
  border: 0;
  padding: 7px 11px;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.nav-button::after {
  position: absolute;
  right: 11px;
  bottom: 0;
  left: 11px;
  height: 1px;
  background: var(--cyan);
  content: "";
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-button:hover, .nav-button.is-active { color: var(--text); }
.nav-button.is-active::after { opacity: 1; transform: scaleX(1); }

.status-pill, .trace-badge {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.status-dot, .trace-badge span, .pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(104, 224, 209, 0.8);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  align-items: center;
  gap: clamp(48px, 8vw, 150px);
  width: min(1440px, calc(100% - 64px));
  min-height: 0;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 66px) 0;
}

.hero { min-width: 0; }
.eyebrow, .stage-kicker, .panel-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.eyebrow-rule { width: 28px; height: 1px; background: var(--cyan); }

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 620px;
  margin-bottom: 26px;
  font-size: clamp(52px, 6.2vw, 94px);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 0.91;
}

h1 span { color: var(--cyan); font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.08em; }

.hero-copy {
  max-width: 470px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 31px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.button:hover { transform: translateY(-2px); }
.button-primary { color: #07100f; background: var(--cyan); }
.button-primary:hover { background: var(--cyan-bright); }
.button-secondary { border-color: var(--line-bright); color: var(--muted); background: transparent; }
.button-secondary:hover { border-color: var(--cyan); color: var(--text); }

.hero-footnote {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--quiet);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footnote-marker { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 10px rgba(255, 131, 109, 0.7); }
.footnote-separator { color: #3d4049; }

.system-stage { min-width: 0; }
.stage-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.stage-kicker { margin-bottom: 6px; color: var(--quiet); font-size: 9px; }
.stage-heading h2 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -0.04em; }
.trace-badge { padding: 6px 9px; color: var(--cyan); font-size: 8px; }

.map-card {
  position: relative;
  min-height: clamp(300px, 40vh, 450px);
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(21, 25, 34, 0.96), rgba(12, 14, 22, 0.96));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26), inset 0 1px rgba(255,255,255,0.05);
}

.map-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px); background-size: 36px 36px; -webkit-mask-image: linear-gradient(135deg, black, transparent 82%); mask-image: linear-gradient(135deg, black, transparent 82%); }
.map-glow { position: absolute; width: 220px; height: 220px; border-radius: 50%; filter: blur(2px); opacity: 0.55; pointer-events: none; }
.map-glow-one { top: -100px; right: -30px; background: radial-gradient(circle, rgba(155,134,255,0.25), transparent 68%); }
.map-glow-two { bottom: -130px; left: 18%; background: radial-gradient(circle, rgba(104,224,209,0.16), transparent 68%); }

.route { position: absolute; height: 1px; transform-origin: left center; }
.route::before { position: absolute; inset: -4px 0; background: inherit; filter: blur(5px); content: ""; opacity: 0.45; }
.route::after { position: absolute; top: -2px; right: -1px; width: 5px; height: 5px; border-radius: 50%; background: inherit; box-shadow: 0 0 12px currentColor; content: ""; }
.route i { position: absolute; top: -2px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; animation: packet 3.5s linear infinite; }
.route-client-kernel { top: 45%; left: 19%; width: 29%; color: var(--cyan); background: linear-gradient(90deg, transparent, var(--cyan)); transform: rotate(-6deg); }
.route-kernel-worker { top: 45%; left: 50%; width: 31%; color: var(--violet); background: linear-gradient(90deg, var(--violet), transparent); transform: rotate(6deg); }
.route-worker-client { top: 68%; left: 18%; width: 65%; color: var(--coral); background: linear-gradient(90deg, transparent, var(--coral), transparent); transform: rotate(-1deg); opacity: 0.55; }
.route-kernel-worker i { animation-delay: -1.7s; }
.route-worker-client i { animation-duration: 4.8s; animation-direction: reverse; animation-delay: -2.5s; }

@keyframes packet { from { left: 0; opacity: 0; } 12% { opacity: 1; } 84% { opacity: 1; } to { left: calc(100% - 5px); opacity: 0; } }

.map-node { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translate(-50%, -50%); }
.node-client { top: 39%; left: 16%; }
.node-kernel { top: 39%; left: 50%; }
.node-worker { top: 39%; left: 84%; }
.node-ring { position: absolute; width: 62px; height: 62px; border: 1px solid currentColor; border-radius: 50%; opacity: 0.3; animation: breathe 3.4s ease-in-out infinite; }
.node-kernel .node-ring { width: 82px; height: 82px; animation-delay: -1.2s; }
.node-worker .node-ring { animation-delay: -2.2s; }
.node-core { position: relative; z-index: 1; width: 32px; height: 32px; border: 1px solid currentColor; border-radius: 50%; background: rgba(8, 9, 13, 0.85); box-shadow: 0 0 24px currentColor; }
.node-core::after { position: absolute; inset: 8px; border-radius: 50%; background: currentColor; content: ""; }
.node-client { color: var(--cyan); }
.node-kernel { color: var(--violet); }
.node-worker { color: var(--coral); }
.node-label { margin-top: 8px; color: var(--text); font-size: 10px; font-weight: 800; letter-spacing: 0.18em; }
.map-node small { color: var(--quiet); font-size: 8px; letter-spacing: 0.1em; }

@keyframes breathe { 0%, 100% { opacity: 0.22; transform: scale(0.88); } 50% { opacity: 0.7; transform: scale(1.1); } }
.map-caption { position: absolute; display: inline-flex; align-items: center; gap: 7px; color: var(--quiet); font-size: 8px; letter-spacing: 0.12em; }
.map-caption span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.map-caption-top { top: 15%; left: 9%; color: var(--cyan); }
.map-caption-bottom { right: 9%; bottom: 15%; color: var(--coral); }
.map-coordinates { position: absolute; right: 20px; bottom: 16px; color: #454953; font-size: 8px; letter-spacing: 0.15em; }

.stage-footer { display: flex; align-items: center; gap: 11px; margin-top: 13px; color: var(--quiet); font-size: 8px; letter-spacing: 0.13em; }
.stage-footer span:first-child { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stage-footer-line { width: 34px; height: 1px; background: var(--line-bright); }

.footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 17px 0 20px; border-top: 1px solid var(--line); color: var(--quiet); font-size: 8px; letter-spacing: 0.14em; }
.footer-center { text-align: center; }
.footer span:last-child { text-align: right; }

.panel { position: fixed; inset: 0; z-index: 10; display: grid; pointer-events: none; visibility: hidden; }
.panel.is-open { pointer-events: auto; visibility: visible; }
.panel-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0,0,0,0.6); cursor: default; opacity: 0; transition: opacity 240ms ease; }
.panel-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); padding: clamp(24px, 5vw, 58px); border-left: 1px solid var(--line-bright); background: #0d0f15; box-shadow: -24px 0 80px rgba(0,0,0,0.28); transform: translateX(100%); transition: transform 300ms cubic-bezier(.2,.8,.2,1); }
.panel.is-open .panel-backdrop { opacity: 1; }
.panel.is-open .panel-sheet { transform: translateX(0); }
.panel-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: clamp(60px, 12vh, 130px); }
.panel-index { color: var(--cyan); font-size: 11px; letter-spacing: 0.12em; }
.panel-close { border: 0; padding: 8px 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.panel-close:hover { color: var(--text); }
.panel-kicker { margin-bottom: 18px; color: var(--quiet); }
.panel-view { display: none; max-width: 390px; }
.panel-view.is-active { display: block; animation: panelIn 350ms ease both; }
.panel-view h2 { margin-bottom: 21px; font-size: clamp(40px, 5vw, 62px); font-weight: 500; letter-spacing: -0.07em; line-height: 0.93; }
.panel-view h2 em { color: var(--cyan); font-family: var(--serif); font-weight: 400; }
.panel-view > p:not(.panel-kicker) { margin-bottom: 30px; color: var(--muted); line-height: 1.7; }
.panel-list { display: grid; grid-template-columns: 34px 1fr; gap: 4px 10px; margin-bottom: 21px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.panel-list span { grid-row: span 2; color: var(--cyan); font-size: 10px; }
.panel-list b { font-size: 13px; font-weight: 600; }
.panel-list small { color: var(--quiet); font-size: 11px; }
.protocol-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.protocol-row code { min-width: 58px; color: var(--cyan); font-size: 10px; }
.protocol-row span { font-size: 13px; }
.access-card { display: grid; gap: 8px; margin-bottom: 20px; padding: 18px; border: 1px solid var(--line-bright); background: rgba(104,224,209,0.04); }
.access-card-label { color: var(--cyan); font-size: 9px; letter-spacing: 0.14em; }
.access-card b { font-size: 16px; font-weight: 600; }
.access-card small { color: var(--muted); line-height: 1.5; }
.panel-action { width: 100%; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.noscript-message { position: fixed; inset: auto 16px 16px; z-index: 20; padding: 14px; border: 1px solid var(--coral); background: #171017; color: var(--text); }

@media (max-width: 980px) {
  .topbar, .footer, .main-grid { width: calc(100% - 40px); max-width: 720px; }
  .main-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr); gap: 32px; }
  .status-pill { display: none; }
  h1 { font-size: clamp(50px, 7vw, 76px); }
  .map-card { min-height: 320px; }
  .map-node small { font-size: 7px; }
}

@media (max-width: 760px) {
  .app-shell { min-height: 500px; }
  .topbar, .footer, .main-grid { width: 100%; max-width: 100%; padding-right: 16px; padding-left: 16px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding-top: 17px; }
  .nav { justify-self: end; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-word { font-size: 13px; }
  .nav { gap: 0; }
  .nav-button { padding-inline: 5px; font-size: 8px; letter-spacing: 0.04em; }
  .main-grid { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 20px; padding-top: 20px; padding-bottom: 20px; }
  .hero, .system-stage { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; text-align: center; }
  .eyebrow { justify-content: center; margin-bottom: 12px; }
  h1 { width: 100%; max-width: 100%; margin-bottom: 15px; font-size: clamp(32px, 9vw, 44px); letter-spacing: -0.07em; }
  .hero-copy { width: 100%; max-width: 100%; margin-right: auto; margin-bottom: 19px; margin-left: auto; font-size: 13px; line-height: 1.45; }
  .hero-actions { justify-content: center; margin-bottom: 15px; }
  .button { min-height: 40px; padding-inline: 15px; font-size: 10px; }
  .hero-footnote { justify-content: center; font-size: 8px; }
  .system-stage { margin: 0 auto; }
  .stage-heading { margin-bottom: 8px; }
  .stage-heading h2 { font-size: 15px; }
  .trace-badge { padding: 5px 7px; font-size: 7px; }
  .map-card { min-height: 220px; border-radius: 14px; }
  .node-ring { width: 48px; height: 48px; }
  .node-kernel .node-ring { width: 64px; height: 64px; }
  .node-core { width: 25px; height: 25px; }
  .node-core::after { inset: 6px; }
  .node-label { margin-top: 4px; font-size: 8px; }
  .map-node small, .map-caption, .map-coordinates { font-size: 6px; }
  .stage-footer { margin-top: 7px; font-size: 7px; }
  .footer { padding-bottom: 12px; font-size: 6px; }
  .footer-center { display: none; }
  .footer { grid-template-columns: 1fr 1fr; }
  .footer span:last-child { text-align: right; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .topbar { padding-top: 14px; padding-bottom: 10px; }
  .main-grid { padding-top: 20px; padding-bottom: 20px; }
  h1 { font-size: clamp(46px, 5.4vw, 72px); margin-bottom: 17px; }
  .hero-copy { margin-bottom: 18px; font-size: 13px; }
  .hero-actions { margin-bottom: 18px; }
  .map-card { min-height: 280px; }
  .footer { padding-top: 10px; padding-bottom: 12px; }
}

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