:root {
  color-scheme: dark;
  --ink: #07090b;
  --surface: #101418;
  --surface-2: #171d22;
  --line: #2a3239;
  --text: #f3f6f7;
  --muted: #9ba7ae;
  --cyan: #55d5dc;
  --red: #ff645f;
  --lime: #b6df63;
  --amber: #f5be5b;
  --code: #0b0e11;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px;
  background: rgba(7, 9, 11, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.header-inner {
  max-width: var(--max);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 760;
  white-space: nowrap;
}
.brand-mark {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a {
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.runtime-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 700 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .08em;
}
.runtime-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.runtime-pill.is-ready { color: var(--lime); border-color: rgba(182, 223, 99, .45); }
.runtime-pill.is-ready span { background: var(--lime); box-shadow: 0 0 12px rgba(182, 223, 99, .7); }
.runtime-pill.is-unavailable { color: var(--red); border-color: rgba(255, 100, 95, .45); }
.runtime-pill.is-unavailable span { background: var(--red); }
.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}
.menu-button::before { content: "☰"; font-size: 19px; }

.hero {
  min-height: calc(100vh - 64px);
  position: relative;
  display: flex;
  align-items: flex-end;
  background-color: #0a0d10;
  background-image: url("/assets/images/native-typescript-hero.png");
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(5, 7, 9, .56);
}
.hero-inner { width: 100%; max-width: var(--max); margin: 0 auto; padding: 96px 24px 78px; }
.eyebrow {
  margin: 0 0 16px;
  color: var(--cyan);
  font: 700 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
.hero h1 { max-width: 760px; margin-bottom: 24px; font-size: 76px; line-height: .96; letter-spacing: 0; }
.hero-copy { max-width: 640px; margin-bottom: 32px; color: #c6cfd3; font-size: 18px; }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid var(--cyan);
  border-radius: 4px;
  background: var(--cyan);
  color: #071012;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button.secondary { background: rgba(7, 9, 11, .7); color: var(--text); border-color: #58636a; }
.button.danger { background: var(--red); border-color: var(--red); color: #140606; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.icon { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }

.band { border-bottom: 1px solid var(--line); }
.band.alt { background: var(--surface); }
.section { max-width: var(--max); margin: 0 auto; padding: 76px 24px; }
.section.compact { padding-top: 42px; padding-bottom: 42px; }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 480px); gap: 40px; align-items: end; margin-bottom: 38px; }
.section-head h2 { margin-bottom: 0; font-size: 34px; line-height: 1.1; }
.section-head p { margin-bottom: 0; color: var(--muted); }
.page-head { padding-top: 62px; padding-bottom: 42px; }
.page-head h1 { max-width: 840px; margin-bottom: 14px; font-size: 48px; line-height: 1.05; }
.page-head .lede { max-width: 720px; color: var(--muted); font-size: 17px; }
.kicker { color: var(--cyan); font: 700 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.metric { min-height: 128px; padding: 24px; background: var(--surface); border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; margin: 8px 0 2px; font: 750 31px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.metric span { color: var(--muted); font-size: 12px; }
.experience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.experience-card {
  min-height: 220px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  text-decoration: none;
}
.experience-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.experience-card .num { color: var(--cyan); font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.experience-card h3 { margin: auto 0 8px; font-size: 21px; }
.experience-card p { margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.experience-card .open { color: var(--text); font-weight: 700; font-size: 13px; }

.panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; }
.panel-head { min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-title { font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; color: #d8dfe2; }
.panel-body { padding: 18px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); min-height: 560px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.editor-pane, .output-pane { min-width: 0; background: var(--code); }
.editor-pane { border-right: 1px solid var(--line); }
.pane-bar { min-height: 50px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pane-bar .spacer { flex: 1; }
.file-tab { color: var(--cyan); font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
textarea.code-editor {
  width: 100%;
  min-height: 510px;
  resize: vertical;
  padding: 20px;
  border: 0;
  outline: 0;
  background: var(--code);
  color: #d7e0e4;
  font: 14px/1.68 ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
}
.output-body { min-height: 510px; padding: 20px; overflow: auto; }
.output-body pre, .log {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #d7e0e4;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.output-host { min-height: 180px; padding: 18px; border: 1px dashed #3b474e; border-radius: 4px; }
.run-meta { margin-top: 18px; color: var(--muted); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.segmented button { min-height: 32px; padding: 0 11px; border: 0; border-right: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 12px; }
.segmented button:last-child { border-right: 0; }
.segmented button.is-active { background: var(--cyan); color: #071012; font-weight: 750; }

.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.package-card { min-height: 236px; padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.package-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.package-card h3 { margin-bottom: 4px; font: 750 18px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.package-card p { min-height: 44px; color: var(--muted); font-size: 13px; }
.package-result { min-height: 58px; margin: 16px 0; padding: 10px; background: var(--code); color: #cbd5da; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.status-dot { width: 9px; height: 9px; margin-top: 8px; flex: 0 0 auto; border-radius: 50%; background: #566168; }
.status-dot.ok { background: var(--lime); }
.status-dot.error { background: var(--red); }
.small-button { min-height: 34px; padding: 0 12px; border: 1px solid #59656b; border-radius: 4px; background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 700; font-size: 12px; }

.canvas-shell { position: relative; min-height: 610px; background: #050709; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.canvas-shell canvas { width: 100%; height: 610px; }
.canvas-overlay { position: absolute; inset: 24px 24px auto auto; width: min(320px, calc(100% - 48px)); padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: rgba(11, 14, 17, .9); }
.control { margin-top: 16px; }
.control label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #d3dbde; font-size: 12px; }
.control output { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
input[type="range"] { width: 100%; accent-color: var(--cyan); }

.game-layout { display: grid; grid-template-columns: minmax(0, 820px) minmax(260px, 1fr); gap: 18px; align-items: start; }
.game-frame { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #050709; }
.game-frame canvas { width: 100%; aspect-ratio: 16 / 10; touch-action: none; }
.game-hud { min-height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.hud-value { font: 750 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.hud-value span { color: var(--cyan); }
.integrity { width: 120px; height: 7px; background: #31383d; }
.integrity span { display: block; width: 100%; height: 100%; background: var(--lime); transition: width .2s; }
.instruction-list { margin: 0; padding: 0; list-style: none; }
.instruction-list li { padding: 13px 0; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.instruction-list strong { color: var(--text); }

.probe-list { display: grid; gap: 10px; }
.probe-row { min-height: 62px; padding: 12px 14px; display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.probe-row code { color: var(--cyan); font-size: 12px; overflow-wrap: anywhere; }
.probe-detail { color: var(--muted); font-size: 13px; }
.probe-state { color: var(--amber); font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.probe-state.ok { color: var(--lime); }
.probe-state.error { color: var(--red); }

.graph-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.graph-stage { min-height: 540px; position: relative; border: 1px solid var(--line); border-radius: 6px; background-color: #0a0d10; background-image: linear-gradient(#171d22 1px, transparent 1px), linear-gradient(90deg, #171d22 1px, transparent 1px); background-size: 28px 28px; overflow: hidden; }
.graph-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.graph-node { position: absolute; width: 174px; min-height: 72px; padding: 12px; border: 1px solid #425059; border-radius: 5px; background: var(--surface); box-shadow: 0 7px 24px rgba(0,0,0,.28); }
.graph-node.active { border-color: var(--cyan); }
.graph-node strong { display: block; color: #e6edef; font: 700 12px ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.graph-node span { color: var(--muted); font-size: 11px; }
.graph-edge { stroke: #52616a; stroke-width: 1.5; fill: none; }
.graph-side button { width: 100%; margin-bottom: 8px; text-align: left; }
.graph-summary-panel { margin-top: 16px; }
.timeline { margin-top: 34px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.timeline-step { min-height: 124px; padding: 18px; border-right: 1px solid var(--line); background: var(--surface); }
.timeline-step:last-child { border-right: 0; }
.timeline-step b { display: block; color: var(--cyan); font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.timeline-step strong { display: block; margin: 12px 0 5px; }
.timeline-step span { color: var(--muted); font-size: 12px; }

.feature-probe { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.check-list { margin: 0; padding: 0; list-style: none; }
.check-list li { min-height: 54px; padding: 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.check-result { color: var(--amber); font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.check-result.ok { color: var(--lime); }
.mini-canvas { width: 100%; height: 314px; background: #07090b; }
.notice { padding: 14px 16px; border-left: 3px solid var(--amber); background: rgba(245, 190, 91, .08); color: #d7d0bd; font-size: 13px; }
.notice.error { border-color: var(--red); background: rgba(255, 100, 95, .08); color: #e3c0be; }
.notice.ok { border-color: var(--lime); background: rgba(182, 223, 99, .08); color: #d6dfc2; }
.ts-unavailable [data-requires-ts] { opacity: .48; }
.site-footer { padding: 28px 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; }

@media (max-width: 980px) {
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; padding: 12px 24px 20px; flex-direction: column; align-items: stretch; background: var(--ink); border-bottom: 1px solid var(--line); }
  .main-nav.is-open { display: flex; }
  .main-nav a { min-height: 40px; display: flex; align-items: center; }
  .menu-button { display: grid; place-items: center; }
  .header-actions .runtime-pill { display: none; }
  .experience-grid, .package-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace, .feature-probe, .game-layout, .graph-layout { grid-template-columns: 1fr; }
  .editor-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .graph-side { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .graph-side button { margin: 0; }
}

@media (max-width: 680px) {
  .header-inner { padding: 0 16px; }
  .brand { font-size: 14px; }
  .hero { min-height: 740px; background-position: 62% center; }
  .hero::before { background: rgba(5, 7, 9, .68); }
  .hero-inner { padding: 84px 18px 58px; }
  .hero h1 { font-size: 48px; }
  .hero-copy { font-size: 16px; }
  .section { padding: 54px 18px; }
  .section-head { grid-template-columns: 1fr; gap: 14px; }
  .section-head h2 { font-size: 29px; }
  .page-head h1 { font-size: 38px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .experience-grid, .package-grid { grid-template-columns: 1fr; }
  .package-card { min-height: 0; }
  .workspace { min-height: 0; }
  textarea.code-editor, .output-body { min-height: 440px; }
  .segmented { max-width: 100%; overflow-x: auto; }
  .canvas-shell, .canvas-shell canvas { height: 650px; }
  .canvas-overlay { inset: auto 16px 16px; width: calc(100% - 32px); }
  .game-hud { gap: 12px; flex-wrap: wrap; padding: 10px 12px; }
  .probe-row { grid-template-columns: 1fr auto; }
  .probe-detail { grid-column: 1 / -1; }
  .graph-stage { min-height: 620px; }
  .graph-node { width: 148px; }
  .graph-side { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .timeline-step:nth-child(2) { border-right: 0; }
  .timeline-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .footer-inner { flex-direction: column; }
}
