:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #181b20;
  --panel-2: #21262d;
  --ink: #f4f2ed;
  --muted: #b9b4aa;
  --line: #333841;
  --accent: #e2bd63;
  --accent-2: #8cc7bd;
  --danger: #e67878;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

img,
video,
iframe,
canvas {
  display: block;
  max-width: 100%;
}

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

button,
input {
  font: inherit;
}

.site-header {
  align-items: center;
  background: rgba(16, 17, 19, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
}

.brand-mark {
  align-items: center;
  background: var(--accent);
  color: #171411;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--muted);
  padding: 8px 10px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

.hero {
  min-height: min(760px, calc(84svh - 64px));
  overflow: hidden;
  padding: clamp(96px, 15vw, 168px) clamp(18px, 6vw, 76px) 96px;
  position: relative;
}

.hero::after {
  background: linear-gradient(90deg, rgba(16, 17, 19, 0.96) 0%, rgba(16, 17, 19, 0.78) 42%, rgba(16, 17, 19, 0.26) 100%);
  content: "";
  inset: 0;
  position: absolute;
}

.hero-media {
  inset: 0;
  position: absolute;
}

.hero-media img {
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.hero-content {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 6.8rem;
  letter-spacing: 0;
  line-height: 0.9;
  margin-bottom: 22px;
}

h2 {
  font-size: 3.2rem;
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 16px;
}

h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.hero-copy {
  color: var(--muted);
  font-size: 1.25rem;
  max-width: 620px;
}

.hero-actions,
.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

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

.button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--ink);
}

.section {
  padding: clamp(64px, 10vw, 112px) clamp(18px, 6vw, 76px);
}

.section-heading {
  max-width: 860px;
}

.section-heading p:not(.eyebrow),
.control-note,
.frame-note,
figcaption {
  color: var(--muted);
}

.section-heading.compact {
  margin-bottom: 28px;
}

.intro-section {
  background: #14171b;
}

.stat-strip {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 36px;
}

.stat-strip div {
  background: var(--panel);
  min-height: 116px;
  padding: 24px;
}

.stat-strip strong {
  color: var(--accent-2);
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 10px;
}

.stat-strip span {
  color: var(--muted);
}

.split-section,
.media-section,
.run-section {
  background: var(--bg);
}

.mockup-layout,
.video-grid,
.command-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
}

.media-frame,
.play-frame,
.command-grid > div {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 0;
  overflow: hidden;
}

.media-frame img,
.media-frame video {
  aspect-ratio: 16 / 10;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.sketch-frame {
  background: #eeeae1;
}

.sketch-frame img {
  aspect-ratio: auto;
  background: #f7f3ea;
  height: auto;
  max-height: 680px;
  object-fit: contain;
  object-position: center;
  padding: 18px;
}

.media-frame figcaption,
.frame-note {
  margin: 0;
  padding: 12px 14px;
}

.play-frame iframe {
  background: #101113;
  border: 0;
  height: min(680px, 74vw);
  width: 100%;
}

.game-section {
  background: #17191d;
}

.game-shell {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 360px);
}

.canvas-wrap {
  background:
    linear-gradient(135deg, rgba(226, 189, 99, 0.08), transparent 36%),
    #090a0c;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: auto;
  padding: clamp(10px, 2vw, 18px);
}

#realGame {
  background: #090a0c;
  height: auto;
  image-rendering: pixelated;
  margin: 0 auto;
  outline: 0;
  outline-offset: 4px;
  width: min(100%, 608px);
}

#realGame:focus-visible {
  box-shadow: 0 0 0 3px var(--accent);
}

.game-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 18px;
  position: sticky;
  top: 88px;
}

.score-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.score-grid div {
  background: var(--panel-2);
  min-height: 82px;
  padding: 12px;
}

.score-grid span,
.mode-group span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.score-grid strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
  margin-top: 8px;
}

.mode-group {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 16px 0;
}

.mode-group label {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
}

.mobile-pad {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 42px);
  justify-content: start;
  margin-bottom: 16px;
}

.mobile-pad button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.mobile-pad button[data-hold="up"] {
  grid-column: 2;
  grid-row: 1;
}

.mobile-pad button[data-hold="left"] {
  grid-column: 1;
  grid-row: 2;
}

.mobile-pad button[data-hold="down"] {
  grid-column: 2;
  grid-row: 3;
}

.mobile-pad button[data-hold="right"] {
  grid-column: 3;
  grid-row: 2;
}

.work-section {
  background: #131519;
}

.work-tabs,
.architecture {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.work-tabs button,
.architecture button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 8px 12px;
}

.work-tabs button.active,
.architecture button.active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #08110f;
}

.work-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  margin-top: 14px;
  min-height: 180px;
  padding: 22px;
}

.work-detail ul {
  color: var(--muted);
  columns: 2;
  gap: 32px;
  margin: 0;
  padding-left: 18px;
}

.work-detail li {
  break-inside: avoid;
  margin-bottom: 8px;
}

.architecture-text {
  background: var(--panel);
  border-left: 4px solid var(--accent);
  color: var(--muted);
  margin: 14px 0 0;
  max-width: 900px;
  padding: 18px;
}

.command-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.command-grid > div {
  padding: 18px;
}

pre {
  background: #08090b;
  border: 1px solid var(--line);
  color: var(--accent-2);
  margin: 0;
  overflow-x: auto;
  padding: 14px;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 24px clamp(18px, 6vw, 76px);
}

@media (max-width: 980px) {
  h1 {
    font-size: 4.8rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .stat-strip,
  .mockup-layout,
  .video-grid,
  .command-grid,
  .game-shell {
    grid-template-columns: 1fr;
  }

  .game-panel {
    position: static;
  }

  .work-detail ul {
    columns: 1;
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 3.4rem;
  }

  h2 {
    font-size: 2rem;
  }

  .hero-copy {
    font-size: 1.08rem;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    padding-bottom: 56px;
    padding-top: 64px;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(16, 17, 19, 0.9) 0%, rgba(16, 17, 19, 0.96) 100%);
  }

  .stat-strip {
    grid-template-columns: 1fr 1fr;
  }

  .play-frame iframe {
    height: 560px;
  }
}
