:root {
  --bg: #050a08;
  --bg-2: #08110d;
  --panel: rgba(8, 20, 15, 0.88);
  --panel-2: rgba(10, 27, 20, 0.82);
  --line: rgba(135, 255, 186, 0.18);
  --line-strong: rgba(135, 255, 186, 0.36);
  --text: #d7fbe3;
  --muted: #82ad91;
  --green: #7dffad;
  --green-2: #29d86f;
  --amber: #f2c56b;
  --danger: #ff7e79;
  --max: 1180px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(125,255,173,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,255,173,.035) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(34, 117, 70, 0.12), transparent 32%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto;
  font-family: var(--mono);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; }
button, input { font: inherit; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 999;
  padding: 10px 14px;
  background: var(--green);
  color: #001b0b;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  background: linear-gradient(transparent 50%, rgba(0,0,0,.09) 50%);
  background-size: 100% 4px;
  opacity: .28;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(5, 10, 8, .88);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: .08em;
  font-weight: 800;
}
.brand-mark { color: var(--green); }
.nav {
  display: flex;
  justify-content: center;
  gap: 22px;
}
.nav a, .footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.nav a:hover, .footer a:hover { color: var(--green); }
.toolbar { display: flex; align-items: center; gap: 9px; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: pulse 2s infinite;
}
.status-text { color: var(--muted); font-size: .72rem; }
.lang-switch {
  margin-left: 8px;
  min-width: 46px;
  padding: 7px 10px;
  color: var(--green);
  border: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
}
.lang-switch:hover { background: rgba(125,255,173,.08); }

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 92px 0;
}
.section.compact { padding: 24px 0 68px; }
.hero { padding-top: 118px; }
.hero-grid, .content-grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 50px;
  align-items: center;
}
.eyebrow, .section-index {
  margin: 0 0 18px;
  color: var(--green);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: .85;
  letter-spacing: -.08em;
  font-weight: 900;
}
h1 span { display: block; }
h1 .accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--green);
  text-shadow: 0 0 26px rgba(125,255,173,.17);
}
.lead {
  max-width: 760px;
  margin: 34px 0 0;
  color: #bbdbc6;
  font-size: clamp(1.06rem, 2.2vw, 1.38rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 17px;
  border: 1px solid var(--line-strong);
  color: var(--green);
  text-decoration: none;
  font-size: .78rem;
  letter-spacing: .055em;
  text-transform: uppercase;
  transition: .18s ease;
}
.button:hover { transform: translateY(-2px); background: rgba(125,255,173,.07); }
.button.primary { color: #00190a; background: var(--green); border-color: var(--green); font-weight: 900; }
.button.primary:hover { background: #a0ffc2; }
.button.full { width: 100%; margin-top: 20px; }

.terminal-card, .panel, .archive-card, .metric, .step, .console {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--panel), rgba(4, 13, 9, .94));
  box-shadow: inset 0 0 32px rgba(50, 170, 100, .025), 0 18px 60px rgba(0,0,0,.18);
}
.terminal-card::before, .panel::before, .archive-card::before, .metric::before, .step::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(125,255,173,.055);
  pointer-events: none;
}
.hero-terminal { padding: 0 24px 24px; transform: rotate(.3deg); }
.terminal-title, .code-label {
  display: inline-block;
  margin: 0 0 18px;
  padding: 7px 10px;
  color: var(--green);
  border: 1px solid var(--line-strong);
  border-top: 0;
  font-size: .72rem;
  letter-spacing: .08em;
}
.ascii {
  overflow-x: auto;
  color: #a7eabb;
  font-size: clamp(.68rem, 1.25vw, .88rem);
  line-height: 1.55;
}
.terminal-log { color: var(--muted); font-size: .8rem; }
.terminal-log > span:first-child { color: var(--green); }
.cursor { animation: blink 1s step-end infinite; color: var(--green); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.metric { padding: 22px; }
.metric strong { display: block; color: var(--green); font-size: 1.55rem; line-height: 1.1; }
.metric span { display: block; margin-top: 8px; color: var(--muted); font-size: .76rem; text-transform: uppercase; }
.metric.warning strong { color: var(--amber); font-size: .98rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding-bottom: 24px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}
h2 { margin: 0; font-size: clamp(1.8rem, 5vw, 3.5rem); line-height: 1; letter-spacing: -.055em; }
h3 { margin-top: 0; }
.tag {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  color: var(--green);
  font-size: .68rem;
  white-space: nowrap;
}
.tag.amber { color: var(--amber); border-color: rgba(242,197,107,.35); }
.section-intro { max-width: 850px; color: var(--muted); margin: -12px 0 36px; }
.panel { padding: 34px; }
.prose p { color: #b8d5c0; }
.prose .statement { color: var(--text); font-size: 1.22rem; }
.code-panel pre {
  white-space: pre-wrap;
  color: #a6efbd;
  font-size: .84rem;
  line-height: 1.8;
}
.callout {
  margin-top: 28px;
  padding: 18px;
  border-left: 3px solid var(--amber);
  background: rgba(242,197,107,.045);
  color: #d6c69c;
  font-size: .83rem;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.dimension-card {
  min-height: 240px;
  padding: 25px;
  border: 1px solid var(--line);
  background: rgba(6, 18, 12, .74);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.dimension-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: rgba(10, 31, 20, .82);
}
.dimension-card .number { color: var(--green); font-size: .75rem; letter-spacing: .08em; }
.dimension-card h3 { margin: 26px 0 12px; font-size: 1.04rem; }
.dimension-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.dimension-card.primary { border-color: rgba(125,255,173,.3); }
.dimension-card.final { border-color: rgba(242,197,107,.35); background: rgba(28, 25, 11, .42); }
.dimension-card.final .number, .dimension-card.final h3 { color: var(--amber); }

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.step { padding: 24px 20px; min-height: 260px; }
.step > span { color: var(--green); }
.step h3 { margin: 44px 0 12px; font-size: .95rem; }
.step p { color: var(--muted); font-size: .79rem; }
.protocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  margin-top: 20px;
}
.protocol pre { color: var(--green); font-size: .76rem; overflow-x: auto; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.archive-card { padding: 26px; min-height: 280px; }
.archive-code { color: var(--green); font-size: .7rem; }
.archive-card h3 { margin: 30px 0 12px; font-size: 1rem; }
.archive-card p { color: var(--muted); font-size: .8rem; }
.progress { height: 4px; margin: 28px 0 10px; background: rgba(125,255,173,.08); }
.progress span { display: block; height: 100%; background: var(--green-2); box-shadow: 0 0 10px rgba(41,216,111,.4); }
.archive-card small { color: #607d68; text-transform: uppercase; font-size: .66rem; }

.author-grid { align-items: stretch !important; }
.identity-card { padding: 0 25px 25px; }
.identity-card dl { margin: 12px 0 0; }
.identity-card dl div { padding: 15px 0; border-bottom: 1px dashed var(--line); }
.identity-card dt { color: var(--green); font-size: .68rem; }
.identity-card dd { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }

.warning-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  padding: 30px;
  border: 1px solid rgba(242,197,107,.34);
  background: rgba(35, 28, 9, .36);
}
.warning-box h2 { font-size: 1.4rem; letter-spacing: -.02em; color: var(--amber); }
.warning-box p { color: #cdbf9f; margin-bottom: 0; }
.warning-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 1.4rem;
}

.console { padding: 22px; min-height: 300px; }
.console-output {
  min-height: 210px;
  max-height: 400px;
  overflow-y: auto;
  color: var(--muted);
  font-size: .82rem;
  white-space: pre-wrap;
}
.console-line { margin-bottom: 8px; }
.console-line.command { color: var(--green); }
.console-line.error { color: var(--danger); }
.console-form { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 13px; }
.console-form label { color: var(--green); white-space: nowrap; }
.console-form input { flex: 1; color: var(--text); border: 0; outline: 0; background: transparent; min-width: 0; }
.console-form input::placeholder { color: #496052; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 28px max(28px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #030705;
  font-size: .72rem;
}
.footer strong { display: block; color: var(--green); }
.footer span { display: block; margin-top: 4px; }
.footer-links { display: flex; align-items: center; gap: 20px; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .hero-grid, .content-grid.two { grid-template-columns: 1fr; }
  .hero-terminal { max-width: 680px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dimension-grid, .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .protocol { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .brand span:last-child, .status-text { display: none; }
  .section { width: min(100% - 26px, var(--max)); padding: 70px 0; }
  .hero { padding-top: 86px; }
  h1 { font-size: 4.2rem; }
  .metric-grid, .dimension-grid, .archive-grid, .timeline { grid-template-columns: 1fr; }
  .metric { min-height: 120px; }
  .section-head { align-items: start; flex-direction: column; }
  .tag { white-space: normal; }
  .panel { padding: 24px; }
  .warning-box { grid-template-columns: 1fr; }
  .footer { flex-direction: column; padding: 24px 16px; }
  .footer-links { align-items: flex-start; flex-direction: column; gap: 8px; }
  .console-form label { font-size: .7rem; }
}

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