:root {
  --bg: #050a18;
  --bg-2: #081123;
  --txt: #d7e3fb;
  --dim: #748ab5;
  --line: rgba(126, 158, 208, .18);
  --line-strong: rgba(126, 158, 208, .34);
  --acc: #8cff4d;
  --acc-line: rgba(140, 255, 77, .42);
  --acc-dim: rgba(140, 255, 77, .10);
  --glow: rgba(140, 255, 77, .28);
  --sans: "Inter", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --edge: clamp(20px, 5vw, 60px);
  --w: 1140px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .004em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%;
  opacity: .22;
}

body::after {
  content: "";
  position: fixed;
  inset: 10px;
  z-index: 3;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.glow {
  position: fixed;
  top: -34vh;
  left: 50%;
  width: 110vw;
  height: 92vh;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, var(--glow) 0%, rgba(140, 255, 77, .05) 42%, transparent 72%);
  opacity: .34;
  filter: blur(18px);
}

header, main, footer { position: relative; z-index: 1; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  max-width: var(--w);
  margin: 0 auto;
  padding: 22px var(--edge);
  background: rgba(5, 10, 24, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: .16em;
  text-decoration: none;
}

.brand-a { color: var(--acc); }
.brand-b { color: var(--txt); }

.nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 38px);
}

.nav a {
  position: relative;
  color: var(--dim);
  font-size: .92rem;
  text-decoration: none;
  padding-bottom: 4px;
  transition: color .22s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--acc);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}

.nav a:hover { color: var(--txt); }
.nav a.active { color: var(--acc); }
.nav a.active::after { transform: scaleX(1); }

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .1em;
  color: var(--dim);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 14px var(--acc-line);
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--w);
  margin: 0 auto;
  padding: clamp(88px, 15vh, 168px) var(--edge) clamp(64px, 10vh, 120px);
}

.eyebrow {
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--acc);
}

.slash { color: var(--line-strong); }

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8.2vw, 7.2rem);
  font-weight: 700;
  line-height: .99;
  letter-spacing: -.035em;
}

h1 em {
  font-style: normal;
  color: var(--acc);
  text-shadow: 0 0 60px rgba(140, 255, 77, .22);
}

.lede {
  max-width: 46rem;
  margin: 30px 0 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--dim);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 42px;
}

.btn {
  display: inline-block;
  padding: .92em 1.7em;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--txt);
  font-size: .93rem;
  text-decoration: none;
  transition: border-color .22s ease, color .22s ease, background-color .22s ease, box-shadow .28s ease;
}

.btn:hover {
  border-color: var(--acc-line);
  color: var(--acc);
  box-shadow: 0 18px 46px -26px var(--glow);
}

.btn-primary {
  border-color: var(--acc-line);
  color: var(--acc);
  background: var(--acc-dim);
  box-shadow: 0 18px 46px -26px var(--glow);
}

.btn-primary:hover { background: rgba(140, 255, 77, .16); }

a:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- sections ---------- */

.section {
  max-width: var(--w);
  margin: 0 auto;
  padding: clamp(56px, 9vh, 104px) var(--edge);
  border-top: 1px solid var(--line);
}

.section-head { margin-bottom: 44px; }

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--dim);
}

.bar { width: 40px; height: 1px; background: var(--acc-line); }

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3.3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.02em;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -.005em;
}

/* metrics */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 30px 28px 32px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .016);
  transition: border-color .24s ease, box-shadow .3s ease, background-color .24s ease;
}

.card:hover {
  border-color: var(--acc-line);
  background: rgba(255, 255, 255, .03);
  box-shadow: 0 26px 64px -40px var(--glow);
}

.metric {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--acc);
}

.card p:last-child { margin: 0; color: var(--dim); font-size: .94rem; }

/* module rows */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  align-items: start;
  gap: 20px;
  padding: 26px 12px;
  border-bottom: 1px solid var(--line);
  transition: background-color .24s ease;
}

.row:hover { background: rgba(140, 255, 77, .028); }

.idx {
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .1em;
  color: var(--line-strong);
  transition: color .24s ease;
}

.row:hover .idx { color: var(--acc); }

.row p { margin: 0; color: var(--dim); font-size: .95rem; }

.tag {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--dim);
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .35em .7em;
}

/* structure panel */

.panel {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-2);
  box-shadow: 0 34px 90px -60px var(--glow);
}

.tree {
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 2;
  color: var(--txt);
}

.tree code { font: inherit; color: inherit; }

.note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: .9rem;
}

.note code, .rules code {
  font-family: var(--mono);
  font-size: .84em;
  color: var(--acc);
}

/* rules list */

.rules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.rules li {
  display: flex;
  gap: 16px;
  padding: 26px 28px;
  background: var(--bg);
}

.rules li:hover { background: var(--bg-2); }

.rules p { margin: 0; color: var(--dim); font-size: .93rem; }

.swatch {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.swatch-bg { background: var(--bg-2); }
.swatch-acc { background: var(--acc); box-shadow: 0 0 16px var(--acc-line); }
.swatch-line { border-color: var(--acc-line); }
.swatch-txt { background: var(--txt); }

/* footer */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: var(--w);
  margin: 0 auto;
  padding: 40px var(--edge) 52px;
  border-top: 1px solid var(--line);
}

.footer-left p {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: .86rem;
}

.to-top {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .14em;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .22s ease, border-color .22s ease;
}

.to-top:hover { color: var(--acc); border-color: var(--acc-line); }

/* reveal */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .3, 1);
}

html.js [data-reveal].in { opacity: 1; transform: none; }

/* responsive */

@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 168px; }
  .topbar { grid-template-columns: auto auto; row-gap: 14px; }
  .nav { grid-column: 1 / -1; justify-content: flex-start; order: 3; }
  .status { margin-left: auto; }
  .row { grid-template-columns: 3.2rem 1fr; }
  .tag { grid-column: 2; justify-self: start; }
  body::after { inset: 6px; }
  body::before { background-size: 50% 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .glow { filter: none; }
}
