:root {
  color-scheme: dark;
  --ink: #f1eee6;
  --muted: #999d9c;
  --panel: rgba(17, 20, 25, 0.9);
  --panel-2: rgba(27, 31, 38, 0.88);
  --line: rgba(255, 255, 255, 0.11);
  --green: #8ad656;
  --green-deep: #20391f;
  --amber: #efb457;
  --red: #e85d52;
  --cyan: #82d6dc;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #05070a; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(91, 134, 106, 0.19), transparent 33rem),
    radial-gradient(circle at 90% 5%, rgba(83, 70, 118, 0.2), transparent 35rem),
    linear-gradient(160deg, #090c11 0%, #050609 65%, #080a0d 100%);
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.65) 0 1px, transparent 1.3px),
    radial-gradient(circle, rgba(138,214,86,.55) 0 1px, transparent 1.2px);
  background-position: 0 0, 37px 23px;
  background-size: 71px 71px, 113px 113px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

button, a { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 28px; position: relative; }
.masthead { border-bottom: 1px solid var(--line); padding-bottom: 27px; }
.eyebrow, .kicker { color: var(--green); text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 750; }
.title-row { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-top: 8px; }
h1 { margin: 0; font-size: clamp(4.4rem, 11vw, 8.3rem); font-weight: 900; letter-spacing: -.095em; line-height: .82; }
.subtitle { margin: 16px 0 0; color: var(--muted); font-size: 1.05rem; }
.status-cluster { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); font-size: .78rem; white-space: nowrap; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.status-good { color: var(--green); }
.status-warn { color: var(--amber); }

.tabs { display: flex; gap: 5px; margin: 22px 0; overflow-x: auto; padding: 3px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.22); }
.tab { flex: 1 0 max-content; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 11px 16px; cursor: pointer; }
.tab:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.tab.is-active { color: #0b0e0d; background: var(--green); font-weight: 750; }
kbd { font: inherit; opacity: .6; margin-right: 4px; }

.panel { min-height: 580px; }
.panel[hidden] { display: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, .8fr); gap: 18px; }
.viewer-card, .launch-card, .note, .metric, .wasm-card { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.viewer-card { border-radius: 18px; overflow: hidden; }
.canvas-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
#scenario-canvas { display: block; width: 100%; height: 100%; }
.canvas-badge { position: absolute; top: 14px; left: 14px; padding: 7px 9px; border-radius: 7px; background: rgba(0,0,0,.72); color: #d4ddd2; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(9px); }
.viewer-controls { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 12px; color: var(--muted); font-size: .82rem; }
.icon-button, .secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.045); border-radius: 8px; cursor: pointer; }
.icon-button { width: 34px; height: 34px; }
.secondary-button { padding: 8px 12px; }
.icon-button:hover, .secondary-button:hover { background: rgba(255,255,255,.1); }
.push-right { margin-left: auto; }

.launch-card { border-radius: 18px; padding: 30px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; position: relative; }
.launch-mark { position: absolute; right: -22px; top: -62px; font-size: 14rem; line-height: 1; color: rgba(138,214,86,.07); font-family: Georgia, serif; }
h2 { margin: 6px 0 12px; font-size: clamp(1.7rem, 3vw, 2.45rem); line-height: 1.02; letter-spacing: -.045em; }
h3 { margin: 5px 0 9px; font-size: 1.08rem; }
.launch-card > p:not(.kicker), .note p, .wasm-card p, .section-heading > p, .plain-note { color: var(--muted); line-height: 1.55; }
.primary-button { border: 0; border-radius: 9px; background: var(--green); color: #0b1009; padding: 13px 16px; font-weight: 800; cursor: pointer; }
.primary-button:disabled { cursor: not-allowed; background: #31353a; color: #93989b; }
.primary-button.compact { padding: 10px 14px; }
.microcopy { font-size: .75rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.metric { border-radius: 13px; padding: 19px; box-shadow: none; }
.metric strong { display: block; font-size: 1.65rem; color: var(--green); }
.metric span { color: var(--muted); font-size: .78rem; }
.note-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.note { border-radius: 13px; padding: 20px; box-shadow: none; }
.note p:last-child { margin-bottom: 0; }
.warning-note { border-color: rgba(239,180,87,.28); background: linear-gradient(135deg, rgba(239,180,87,.08), var(--panel)); }
.warning-note .kicker { color: var(--amber); }
.start-note { grid-column: 1 / -1; }
.start-note ol { margin: 12px 0 0; padding-left: 1.25rem; color: var(--muted); line-height: 1.6; }
.start-note li + li { margin-top: 4px; }

.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin: 12px 0 22px; }
.section-heading > p { max-width: 460px; margin: 0; }
.level-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.level-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.level-number { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--green); font-weight: 800; }
.level-name { min-width: 0; font-weight: 700; }
.level-meta { margin-top: 4px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.coop { color: var(--green); font-size: .68rem; border: 1px solid rgba(138,214,86,.32); padding: 4px 6px; border-radius: 5px; }

.check-result { padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.24); color: var(--muted); margin-bottom: 12px; font-size: .82rem; }
.check-result.is-running { color: var(--amber); }
.check-result.is-good { color: var(--green); }
.check-result.is-bad { color: var(--red); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 780px; background: var(--panel); }
th, td { text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: .78rem; }
th { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; }
td code { color: var(--cyan); }
tr:last-child td { border-bottom: 0; }
.legal-warning { margin: 14px 0; padding: 15px; border-left: 3px solid var(--amber); background: rgba(239,180,87,.08); color: #c8c3b7; line-height: 1.5; font-size: .84rem; }
.legal-warning strong { color: var(--amber); }
.text-link { color: var(--green); text-decoration: none; }
.manifest-note { color: var(--muted); font-size: .73rem; }

.engine-state { color: var(--red); border: 1px solid rgba(232,93,82,.35); background: rgba(232,93,82,.08); padding: 8px 11px; border-radius: 8px; font-size: .75rem; }
.wasm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wasm-card { box-shadow: none; padding: 20px; border-radius: 12px; border-top-width: 3px; }
.wasm-card.passed { border-top-color: var(--green); }
.wasm-card.failed { border-top-color: var(--red); }
.wasm-card.pending { border-top-color: var(--amber); }
.step { color: var(--muted); text-transform: uppercase; letter-spacing: .11em; font-size: .64rem; }
.architecture { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.25); }
.architecture > div { min-height: 105px; display: flex; flex-direction: column; justify-content: center; padding: 15px; border-radius: 9px; background: var(--green-deep); }
.architecture > div.blocked { background: rgba(232,93,82,.11); }
.architecture span { color: var(--green); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; }
.architecture .blocked span { color: var(--red); }
.architecture strong { margin: 5px 0; }
.architecture small { color: var(--muted); line-height: 1.4; }
.architecture b { color: var(--muted); }
code { color: var(--cyan); }

footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 36px; padding-top: 17px; border-top: 1px solid var(--line); color: #6f7477; font-size: .7rem; }

@media (max-width: 800px) {
  .shell { width: min(100% - 22px, 680px); padding-top: 30px; }
  .title-row, .section-heading { align-items: flex-start; flex-direction: column; }
  .status-cluster { justify-content: flex-start; }
  .hero-grid, .note-grid, .wasm-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .level-grid { grid-template-columns: 1fr; }
  .architecture { grid-template-columns: 1fr; }
  .architecture b { transform: rotate(90deg); justify-self: center; }
  .panel { min-height: 0; }
}

@media (max-width: 480px) {
  h1 { font-size: 4.5rem; }
  .status-cluster { display: grid; width: 100%; }
  .status { justify-content: center; }
  .launch-card { padding: 23px; }
  .metric { padding: 15px; }
  .level-card { grid-template-columns: 43px minmax(0, 1fr); }
  .coop { grid-column: 2; justify-self: start; }
  footer { flex-direction: column; }
}
