/* ————— CVE Monster ————— */
:root {
  --bg: #080a09;
  --bg-panel: #0e1211;
  --ink: #dfe7e2;
  --ink-dim: #7f8f88;
  --accent: #3ddc84;
  --accent-dim: #1f7a49;
  --line: #1a201d;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -999px;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ————— nav ————— */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.nav-mark {
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-dim);
  transition: color 140ms ease;
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-cta {
  color: var(--accent) !important;
}

/* ————— hero ————— */
.hero {
  max-width: 74rem;
  margin: 0 auto;
  padding: clamp(4rem, 11vh, 8rem) clamp(1.25rem, 4vw, 3rem) clamp(3rem, 7vh, 5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 4rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 20ch;
  text-wrap: balance;
}

.hero h1 .hl {
  color: var(--accent);
}

.hero-sub {
  margin-top: 1.8rem;
  max-width: 60ch;
  font-size: 1.15rem;
  color: color-mix(in srgb, var(--ink) 80%, var(--ink-dim));
}

/* ————— scoreboard ————— */
.scoreboard {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.3rem 0;
}

.scoreboard dt {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.35rem;
}

.scoreboard dd {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

/* ————— sections ————— */
.sec {
  max-width: 74rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 6rem) clamp(1.25rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}

.sec-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.sec-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 26ch;
  text-wrap: balance;
}

.sec-intro {
  margin-top: 1.1rem;
  max-width: 62ch;
  color: color-mix(in srgb, var(--ink) 78%, var(--ink-dim));
}

.sec-intro a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
}
.sec-intro a:hover {
  border-bottom-color: var(--accent);
}

/* ————— stages: the spine ————— */
.stages {
  list-style: none;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  position: relative;
}

.stage {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem 2.5rem;
  padding: 1.7rem 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.stage:last-child {
  border-bottom: 1px solid var(--line);
}

/* the connecting line running down the spine */
.stage::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.stage:first-child::before {
  top: 1.9rem;
}
.stage:last-child::before {
  bottom: calc(100% - 2.5rem);
}

/* the node on the spine */
.stage::after {
  content: "";
  position: absolute;
  left: 0;
  top: 1.75rem;
  width: 0.62rem;
  height: 0.62rem;
  border: 1px solid var(--accent);
  background: var(--bg);
  transform: rotate(45deg);
}

.stage-id {
  padding-left: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stage-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

.stage-verb {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
}

.stage-body h3 {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.stage-body p {
  max-width: 60ch;
  color: color-mix(in srgb, var(--ink) 76%, var(--ink-dim));
}

.stage-body em {
  color: var(--ink);
  font-style: italic;
}

/* ————— ledger table ————— */
.table-scroll {
  margin-top: 2.4rem;
  overflow-x: auto;
  max-width: 42rem;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.ledger th,
.ledger td {
  text-align: right;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ledger th:first-child,
.ledger td:first-child {
  text-align: left;
  font-family: var(--sans);
  width: 60%;
}

.ledger thead th {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 400;
  border-bottom-color: var(--ink-dim);
}

.ledger tbody td:last-child {
  color: var(--accent);
}

.ledger tfoot td {
  border-top: 1px solid var(--ink-dim);
  border-bottom: none;
  padding-top: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.fineprint {
  margin-top: 1.6rem;
  max-width: 58ch;
  font-size: 0.95rem;
  color: var(--ink-dim);
}

/* ————— cta ————— */
.cta-mail {
  display: inline-block;
  margin-top: 1.8rem;
  font-family: var(--mono);
  font-size: clamp(1.15rem, 3.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bg);
  background: var(--accent);
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  transition: background 160ms ease;
}

.cta-mail:hover {
  background: #5ef09b;
}

/* ————— footer ————— */
.footer {
  max-width: 74rem;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
}

.footer a {
  color: var(--ink-dim);
  text-decoration: none;
}
.footer a:hover {
  color: var(--accent);
}

/* ————— responsive ————— */
@media (max-width: 760px) {
  .scoreboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem 1rem;
  }
  .stage {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .stage-body {
    padding-left: 1.6rem;
  }
  .nav-links a:not(.nav-cta) {
    display: none;
  }
}

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