@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ink: #f4f2eb;
  --ink-2: #ebe8df;
  --panel: #ffffff;
  --paper: #ffffff;
  --paper-2: #e7e2d6;
  --text: #13161a;
  --muted: #5f6670;
  --faint: #858b94;
  --line: rgba(19,22,26,.13);
  --line-strong: rgba(19,22,26,.24);
  --indigo: #4c55cc;
  --indigo-soft: #353eaf;
  --signal: #a8e43d;
  --signal-ink: #182304;
  --warn: #ffb45a;
  --red: #ff756d;
  --max: 1240px;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.shell { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.mono { font-family: var(--mono); }

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244,242,235,.88);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--indigo-soft);
  position: relative;
  display: grid;
  place-items: center;
  transform: rotate(45deg);
}
.brand-mark::after { content: ""; width: 10px; height: 10px; background: var(--signal); }
.brand-text { display: flex; align-items: baseline; gap: 9px; }
.brand-text b { font-size: 18px; letter-spacing: -.02em; }
.brand-text span { color: var(--faint); font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.nav-links { display: flex; align-items: center; gap: 3px; }
.nav-links a { color: var(--muted); font-size: 14px; padding: 9px 11px; border-radius: 4px; }
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-tools { display: flex; align-items: center; gap: 9px; }
.language { font: 11px var(--mono); color: var(--faint); padding: 8px; }
.language:hover { color: var(--text); }
.menu-button { display: none; color: var(--text); background: none; border: 1px solid var(--line); padding: 9px 12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-2px); border-color: var(--indigo-soft); }
.button.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.button.primary:hover { background: #c9ff67; border-color: #c9ff67; }
.button.small { min-height: 38px; padding: 0 14px; font-size: 13px; }
.arrow { font-family: var(--mono); }

.hero {
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(19,22,26,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19,22,26,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 70% 50%, black, transparent 70%);
}
.hero-layout {
  position: relative;
  width: min(1920px, calc(100% - 32px));
  padding: 64px 0 58px;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 2.5vw, 48px);
  align-items: stretch;
  min-height: clamp(650px, 72vh, 800px);
}
.hero-grid > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--indigo-soft);
  font: 11px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 32px; height: 1px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(54px, 6.6vw, 92px);
  line-height: .94;
  letter-spacing: -.065em;
  max-width: 10ch;
  margin: 30px 0;
}
h1 em { color: var(--signal); font-style: normal; }
.hero-lead { color: var(--muted); font-size: clamp(18px, 1.7vw, 22px); max-width: 650px; line-height: 1.55; }
.hero-lead strong { color: var(--text); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-game {
  scroll-margin-top: 74px;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 46px minmax(0, 1fr) auto;
  border: 1px solid #263148;
  border-radius: 16px;
  background: #0b1220;
  box-shadow: 0 18px 42px rgba(19,22,26,.16);
}
.hero-game-bar {
  height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #d8deea;
  background: #f3f2ee;
  border-bottom: 1px solid #cfd1d2;
  font-size: 13px;
}
.hero-game-bar > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #353a42;
  font-weight: 600;
}
.hero-game-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(168,228,61,.18);
}
.hero-game-bar a { color: #353a42; font-size: 12px; }
.hero-game-bar a:hover { color: var(--indigo-soft); }
.hero-game-bar b { font-family: var(--mono); }
.hero-game iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #0b1220;
}
.hero-game-note {
  min-height: 58px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  color: #aeb7c8;
  border-top: 1px solid #263148;
  font-size: 12px;
}
.hero-game-note p { margin: 0; }
.hero-game-note strong { color: #f3f5f8; font-weight: 600; }
.hero-game-note nav { display: flex; gap: 15px; flex: 0 0 auto; }
.hero-game-note a { color: #c8f770; white-space: nowrap; }
.hero-game-note a:hover { color: white; }

.routes a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  padding: 22px 24px;
  background: var(--panel);
}
.routes a:hover { background: white; }
.routes span {
  grid-column: 1 / -1;
  color: var(--faint);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: .09em;
}
.routes b { font-size: 15px; }
.routes i { color: var(--signal); font-style: normal; }

.section { padding: 120px 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 190px 1fr; gap: 50px; margin-bottom: 64px; }
.section-index { color: var(--faint); font: 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
h2 { font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.055em; max-width: 13ch; margin-bottom: 22px; }
.section-intro { color: var(--muted); font-size: 19px; max-width: 700px; }
.downloads-home { padding-block: 88px; scroll-margin-top: 74px; }
.downloads-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 34px;
}
.downloads-head h2 { margin: 12px 0 9px; }
.downloads-head p { max-width: 680px; margin: 0; color: var(--muted); font-size: 16px; }
.downloads-head .button { flex: 0 0 auto; }
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.download-card {
  min-height: 250px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}
.download-card--cli { grid-column: 1 / -1; min-height: 270px; background: #f8f7f2; }
.download-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.download-meta span { color: var(--indigo-soft); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .09em; }
.download-meta b { color: var(--faint); font: 10px var(--mono); font-weight: 500; }
.download-card h3 { max-width: 18ch; margin: 42px 0 9px; font-size: 22px; letter-spacing: -.03em; line-height: 1.12; }
.download-card p { max-width: 520px; margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.download-card--cli h3 { margin-top: 30px; font-size: 28px; }
.download-card--cli > .button { align-self: flex-start; margin-top: auto; }
.download-options { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 18px; }
.download-options a { color: var(--muted); font: 11px var(--mono); border-bottom: 1px solid var(--line-strong); }
.download-options a:hover { color: var(--indigo-soft); border-color: var(--indigo-soft); }
.download-link { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.download-link i { color: var(--signal); font: normal 16px var(--mono); }
.download-link:hover { color: var(--indigo-soft); }
.routes { padding: 0 0 96px; }
.routes .shell {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.question {
  background: var(--paper);
  color: var(--text);
  padding: clamp(36px, 7vw, 86px);
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 60px;
  align-items: end;
}
.question blockquote { margin: 0; font-size: clamp(36px, 5vw, 68px); line-height: 1.07; letter-spacing: -.05em; font-weight: 600; max-width: 17ch; }
.question p { margin: 0; color: var(--muted); font-size: 14px; }

.mechanism { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.mechanism-card { min-height: 300px; padding: 30px; border-right: 1px solid var(--line); position: relative; }
.mechanism-card:last-child { border-right: 0; }
.mechanism-card .num { color: var(--indigo-soft); font: 11px var(--mono); }
.mechanism-card h3 { margin: 80px 0 13px; font-size: 23px; letter-spacing: -.03em; }
.mechanism-card p { color: var(--muted); font-size: 14px; }
.mechanism-card::after { content: "→"; position: absolute; right: -13px; top: 28px; width: 25px; height: 25px; background: var(--ink); color: var(--indigo-soft); text-align: center; z-index: 2; font-family: var(--mono); }
.mechanism-card:last-child::after { display: none; }

.mesh-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 70px; align-items: center; }
.mesh-copy h2 { max-width: 9ch; }
.mesh-copy p { color: var(--muted); font-size: 17px; }
.mesh-points { list-style: none; padding: 0; margin: 28px 0 0; }
.mesh-points li { padding: 13px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.mesh-points b { color: var(--text); }
.mesh-map {
  min-height: 560px;
  position: relative;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at center, rgba(105,115,255,.2), transparent 45%),
    linear-gradient(rgba(19,22,26,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19,22,26,.045) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}
.mesh-line { position: absolute; left: 50%; top: 50%; height: 1px; background: rgba(174,180,255,.45); transform-origin: 0 0; }
.line-a { width: 37%; transform: rotate(-140deg); }
.line-b { width: 36%; transform: rotate(-37deg); }
.line-c { width: 32%; transform: rotate(44deg); }
.line-d { width: 36%; transform: rotate(145deg); }
.node {
  position: absolute;
  width: 116px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font: 10px var(--mono);
}
.node b { display: block; color: var(--text); font-size: 11px; margin-bottom: 4px; }
.node span { color: var(--faint); }
.node.origin { left: calc(50% - 58px); top: calc(50% - 43px); border-color: var(--indigo); }
.node.origin::before { content: "ISSUER"; color: var(--indigo-soft); display: block; margin-bottom: 7px; }
.node.a { left: 8%; top: 12%; }
.node.b { right: 7%; top: 14%; }
.node.c { right: 9%; bottom: 12%; }
.node.d { left: 7%; bottom: 13%; }
.mesh-result {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: var(--signal);
  color: var(--signal-ink);
  font: 10px var(--mono);
  white-space: nowrap;
}

.families { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.family { background: var(--ink); padding: 38px; min-height: 300px; display: flex; flex-direction: column; }
.family-code { color: var(--indigo-soft); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.family h3 { font-size: 27px; margin: 38px 0 12px; letter-spacing: -.035em; }
.family p { color: var(--muted); max-width: 47ch; }
.case-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: auto; padding-top: 28px; }
.case-links a, .case-links span { font: 11px var(--mono); color: var(--signal); }
.case-links a:hover { text-decoration: underline; }

.tool-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.tool {
  border: 1px solid var(--line);
  padding: 30px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  transition: background .2s, border-color .2s, transform .2s;
}
.tool:hover { background: var(--panel); border-color: var(--indigo); transform: translateY(-4px); }
.tool-tag { color: var(--indigo-soft); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.tool h3 { font-size: 24px; margin: 50px 0 12px; }
.tool p { color: var(--muted); font-size: 14px; }
.tool-link { margin-top: auto; color: var(--signal); font: 11px var(--mono); }

.boundary { background: var(--paper); color: var(--text); }
.boundary .section-index { color: #6d7074; }
.boundary h2 { color: var(--text); max-width: 12ch; }
.boundary .section-intro { color: #555b61; }
.boundary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #cfc9bb; border: 1px solid #cfc9bb; }
.boundary-col { background: var(--paper); padding: 38px; }
.boundary-col h3 { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 24px; }
.boundary-col ul { list-style: none; padding: 0; margin: 0; }
.boundary-col li { border-top: 1px solid #d4cec0; padding: 16px 0; font-size: 15px; }
.boundary-col.yes h3 { color: #3c6911; }
.boundary-col.no h3 { color: #a23e36; }

.standard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 70px; }
.standard-copy p { color: var(--muted); font-size: 18px; max-width: 650px; }
.artifact-list { border-top: 1px solid var(--line); }
.artifact {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.artifact span { color: var(--faint); font: 10px var(--mono); text-transform: uppercase; }
.artifact b { font-size: 14px; }
.artifact i { color: var(--signal); font-style: normal; }

.final-cta { padding: 110px 0; }
.final-box {
  background: var(--indigo);
  color: white;
  padding: clamp(40px, 7vw, 88px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  align-items: end;
}
.final-box h2 { max-width: 12ch; margin-bottom: 0; }
.final-box .section-index { color: #d8dbff; }
.final-box .button.primary { background: var(--signal); color: var(--signal-ink); }

.footer { border-top: 1px solid var(--line); padding: 60px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3,1fr); gap: 40px; }
.footer-brand p { color: var(--faint); max-width: 340px; font-size: 13px; margin-top: 18px; }
.footer-col h4 { color: var(--faint); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 15px; }
.footer-col a, .footer-col span { display: block; color: var(--muted); font-size: 13px; padding: 5px 0; }
.footer-col a:hover { color: var(--signal); }
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; margin-top: 54px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font: 10px var(--mono); }

[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].visible { opacity: 1; transform: none; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-grid > div { max-width: 820px; }
  .hero-game { width: min(100%, 900px); height: auto; }
  .hero-game iframe { height: 680px; }
}

@media (max-width: 1000px) {
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 72px; padding: 14px 24px 22px; background: var(--ink); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; }
  .site-head.open .nav-links { display: flex; }
  .menu-button { display: block; }
  .nav-tools .button { display: none; }
  .mechanism { grid-template-columns: 1fr 1fr; }
  .mechanism-card:nth-child(2) { border-right: 0; }
  .mechanism-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .mechanism-card:nth-child(2)::after { display: none; }
  .mesh-grid, .standard-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 30px, var(--max)); }
  .brand-text span { display: none; }
  .hero-layout { padding: 60px 0 54px; }
  h1 { font-size: clamp(48px, 15vw, 76px); }
  .hero-game { border-radius: 10px; }
  .hero-game-note { align-items: flex-start; flex-direction: column; gap: 8px; }
  .downloads-head { align-items: flex-start; flex-direction: column; }
  .download-grid, .routes .shell { grid-template-columns: 1fr; }
  .download-card--cli { grid-column: auto; }
  .section { padding: 84px 0; }
  .section-head { grid-template-columns: 1fr; gap: 18px; margin-bottom: 42px; }
  .question { grid-template-columns: 1fr; gap: 30px; }
  .mechanism, .families, .tool-grid, .boundary-grid { grid-template-columns: 1fr; }
  .mechanism-card { border-right: 0; border-bottom: 1px solid var(--line); min-height: 240px; }
  .mechanism-card::after { display: none; }
  .family { min-height: 280px; padding: 28px; }
  .mesh-map { min-height: 500px; }
  .node { width: 100px; }
  .final-box { grid-template-columns: 1fr; }
  .artifact { grid-template-columns: 78px 1fr; }
  .artifact i { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
