:root {
  --bg: #10141c;
  --bg-grid: #161d29;
  --panel: #1d2634;
  --panel-top: #283347;
  --border-dark: #0a0d13;
  --border-mid: #324058;
  --text: #edf2f7;
  --muted: #b8c2d1;
  --accent: #6ea8fe;
  --accent-strong: #8fd3ff;
  --accent-soft: #223146;
  --good: #72c9a1;
  --shadow: #0d121a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 20px 20px;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

iframe {
  border: 0;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.panel {
  background: var(--panel);
  border: 2px solid var(--border-dark);
  box-shadow:
    inset 0 0 0 2px var(--border-mid),
    6px 6px 0 0 var(--shadow);
}

.site-header,
.hero-copy,
.info-card,
.site-footer,
.pixel-window {
  padding: 20px;
}

.site-header {
  margin-bottom: 20px;
}

.brand-mark,
.section-label,
.window-bar p,
.demo-launch-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.brand-name,
.hero-copy h2,
.info-card h3,
.feature-item h4 {
  margin: 0;
  line-height: 1.15;
}

.brand-name {
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: 0.02em;
}

.hero-copy {
  margin-bottom: 24px;
}

.hero-copy h2 {
  margin-top: 10px;
  font-size: clamp(1.6rem, 4vw, 2.7rem);
  max-width: 16ch;
}

.hero-text,
.window-hint,
.feature-item p,
.store-copy,
.highlight-list,
.site-footer,
.demo-launch-meta {
  color: var(--muted);
  line-height: 1.6;
}

.hero-text {
  margin: 14px 0 0;
  max-width: 70ch;
}

.demo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.pixel-window {
  width: min(860px, 100%);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin: -20px -20px 0;
  border-bottom: 2px solid var(--border-dark);
  background: var(--panel-top);
  box-shadow: inset 0 -2px 0 0 var(--border-mid);
}

.window-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.window-dots {
  display: inline-flex;
  gap: 6px;
}

.window-dots span {
  width: 12px;
  height: 12px;
  display: inline-block;
  background: var(--accent-soft);
  border: 2px solid var(--border-dark);
  box-shadow: inset 0 0 0 2px var(--border-mid);
}

.window-body {
  padding-top: 16px;
}

.window-hint {
  margin: 0 0 14px;
}

.demo-launch {
  width: 100%;
  min-height: clamp(240px, 48vw, 420px);
  padding: 24px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  background:
    linear-gradient(#111a25 1px, transparent 1px),
    linear-gradient(90deg, #111a25 1px, transparent 1px),
    #0d1118;
  background-size: 20px 20px;
  border: 2px solid var(--border-dark);
  box-shadow: inset 0 0 0 2px var(--border-mid);
}

.demo-launch:hover,
.demo-launch:focus-visible {
  outline: none;
  transform: translate(1px, 1px);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.demo-launch-label {
  display: block;
}

.demo-launch-meta {
  display: block;
  max-width: 38ch;
  font-size: clamp(1rem, 2.3vw, 1.2rem);
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.9fr);
  gap: 20px;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.feature-item {
  padding: 14px;
  background: #17202c;
  border: 2px solid var(--border-dark);
  box-shadow: inset 0 0 0 2px #2a364b;
}

.feature-item h4 {
  font-size: 1rem;
}

.feature-item p {
  margin: 8px 0 0;
}

.install-card {
  display: flex;
  flex-direction: column;
}

.store-copy {
  margin: 12px 0 16px;
}

.button-stack {
  display: grid;
  gap: 12px;
}

.pixel-button,
.close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  border: 2px solid var(--border-dark);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.06),
    4px 4px 0 0 var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.pixel-button:hover,
.close-button:hover,
.close-button:focus-visible {
  transform: translate(1px, 1px);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.06),
    3px 3px 0 0 var(--shadow);
}

.pixel-button.primary {
  background: var(--accent);
  color: #08111d;
}

.pixel-button.secondary {
  background: var(--good);
  color: #0c1812;
}

.close-button {
  background: #d4dde9;
  color: #0b121a;
  cursor: pointer;
}

.highlight-list {
  margin: 18px 0 0;
  padding-left: 18px;
}

.highlight-list li + li {
  margin-top: 8px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  font-size: 0.95rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(8, 12, 18, 0.82);
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-shell {
  width: 960px;
  height: 648px;           /* 600 content + 48 title bar */
  padding: 0;
  overflow: hidden;
  display: block;
}

.modal-bar {
  margin: 0 !important;
  width: 960px;
  height: 48px;
}

.modal-body {
  width: 960px;
  height: 600px;
  padding: 0;
  overflow: hidden;
}

.wasm-frame {
  display: block;
  width: 960px;
  height: 600px;
  border: 0;
}

@media (max-width: 860px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 12px;
    padding-bottom: 24px;
  }

  .site-header,
  .hero-copy,
  .info-card,
  .site-footer,
  .pixel-window {
    padding: 16px;
  }

  .window-bar {
    margin: -16px -16px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-name {
    font-size: clamp(1.7rem, 10vw, 2.6rem);
  }

  .modal-shell {
    width: 100%;
    height: min(90vh, 880px);
  }

  .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    padding: 0;
  }
}