/* ==========================================================================
   Monkey Maya Studios — 16-bit theme
   Deep indigo night sky + gold HUD accents, chunky beveled panels, hard
   shadows, scanlines. Layout/structure is unchanged from the previous theme;
   this is a skin over the same markup.
   ========================================================================== */

:root {
  /* SNES-era menu/HUD palette: deep purple field, gold selection, vivid status */
  --bg: #120a2a;
  --bg-alt: #1b1040;
  --card: #241650;
  --border: #7b5fd3;
  --text: #fdfcff;
  --text-dim: #b8a6ec;
  --accent: #ffd23f;
  --accent-dim: #d4881a;
  --ok: #4fe86b;
  --soon: #ff6fae;

  /* Bevel + drop-shadow tokens that give panels their raised, plastic look */
  --bevel-light: #4a2f9e;
  --bevel-dark: #0a0518;
  --shadow-hard: #07031a;

  /* Square corners everywhere - kept as a token so the SVG diagrams and every
     panel that referenced the old rounded radius flatten out together. */
  --radius: 0;
  --wrap: 1080px;

  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-body: 'Pixelify Sans', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    /* sparse starfield over a night-sky gradient */
    radial-gradient(2px 2px at 12% 8%, rgba(255,255,255,0.55), transparent),
    radial-gradient(2px 2px at 78% 14%, rgba(255,255,255,0.40), transparent),
    radial-gradient(2px 2px at 33% 22%, rgba(255,210,63,0.45), transparent),
    radial-gradient(2px 2px at 62% 5%, rgba(255,255,255,0.35), transparent),
    radial-gradient(2px 2px at 90% 30%, rgba(255,255,255,0.30), transparent),
    radial-gradient(2px 2px at 5% 38%, rgba(184,166,236,0.40), transparent),
    linear-gradient(180deg, #1d1049 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
}

/* CRT scanlines. Fixed and non-interactive, sits above everything including
   the sticky header. Kept subtle so it reads as texture, not noise sitting
   on top of body text. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.045) 0px,
    rgba(0,0,0,0.045) 1px,
    transparent 1px,
    transparent 4px
  );
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.6;
  text-shadow: 3px 3px 0 var(--shadow-hard);
}

/* Sprites and footage stay crunchy when scaled instead of going soft */
img, video { image-rendering: pixelated; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

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

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent-dim);
  text-underline-offset: 4px;
}
.inline-link:hover { text-decoration-color: var(--accent); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-alt);
  border-bottom: 4px solid var(--border);
  box-shadow: 0 4px 0 var(--shadow-hard);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 0.62rem;
  line-height: 1.5;
  text-shadow: 2px 2px 0 var(--shadow-hard);
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 0;
  border: 3px solid var(--bevel-dark);
  background: var(--accent);
  color: var(--bevel-dark);
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0;
  flex-shrink: 0;
  text-shadow: none;
  box-shadow: 3px 3px 0 var(--shadow-hard);
}

.site-nav {
  display: flex;
  align-items: center;
  /* Wraps rather than overflowing the viewport - the display face is wide and
     this nav carries a lot of entries at desktop widths. */
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 22px;
  font-family: var(--font-display);
  font-size: 0.55rem;
}

.site-nav a {
  position: relative;
  color: var(--text-dim);
}
.site-nav a:hover { color: var(--accent); }

/* Classic menu cursor on the hovered entry */
.site-nav a::before {
  content: "\25B6";
  position: absolute;
  left: -13px;
  top: 0;
  color: var(--accent);
  opacity: 0;
}
.site-nav a:hover::before { opacity: 1; }
.nav-cta::before { content: none !important; }

.nav-cta {
  background: var(--accent);
  color: var(--bevel-dark) !important;
  padding: 10px 14px;
  border: 3px solid var(--bevel-dark);
  box-shadow: 3px 3px 0 var(--shadow-hard);
}
.nav-cta:hover { background: #fff06b; }

/* Hero */
.hero {
  padding: 88px 0 72px;
  text-align: center;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.55rem;
  color: var(--accent);
  margin-bottom: 26px;
  text-shadow: 2px 2px 0 var(--shadow-hard);
}

.hero h1 {
  font-size: clamp(0.95rem, 2.4vw, 1.7rem);
  line-height: 1.75;
  margin: 0 0 28px;
  max-width: 860px;
  margin-inline: auto;
}

.highlight { color: var(--accent); }

.hero-sub {
  max-width: 640px;
  margin: 0 auto 38px;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Chunky pressable buttons. steps() timing keeps the motion snappy and
   un-eased, the way a 16-bit UI would respond. */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.6rem;
  line-height: 1.5;
  padding: 15px 22px;
  border: 3px solid var(--bevel-dark);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--shadow-hard);
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2), background 0.06s steps(2);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-hard); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--shadow-hard); }

.btn-primary {
  background: var(--accent);
  color: var(--bevel-dark);
}
.btn-primary:hover { background: #fff06b; }

.btn-ghost {
  background: var(--card);
  color: var(--text);
  box-shadow: inset 2px 2px 0 var(--bevel-light), 4px 4px 0 var(--shadow-hard);
}
.btn-ghost:hover {
  color: var(--accent);
  box-shadow: inset 2px 2px 0 var(--bevel-light), 6px 6px 0 var(--shadow-hard);
}
.btn-ghost:active { box-shadow: inset 2px 2px 0 var(--bevel-light), 0 0 0 var(--shadow-hard); }

/* Sections */
.section { padding: 80px 0; }

.section-title {
  font-size: clamp(0.85rem, 1.8vw, 1.2rem);
  margin: 0 0 44px;
  text-align: center;
  color: var(--accent);
}
/* Solid HUD divider under each section heading */
.section-title::after {
  content: "";
  display: block;
  width: 84px;
  height: 6px;
  margin: 22px auto 0;
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent-dim);
}

/* Learning & Music (subsections) */
.subsection { margin-bottom: 60px; }
.subsection:last-child { margin-bottom: 0; }
.subsection-title {
  font-size: 0.8rem;
  text-align: center;
  margin: 0 0 32px;
}

/* Shared raised-panel treatment: inner bevel + hard drop shadow */
.game-card,
.info-item,
.arch-diagram,
.demo-media,
.doc-card,
.arch-note {
  background: var(--card);
  border: 4px solid var(--border);
  border-radius: 0;
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark),
    6px 6px 0 var(--shadow-hard);
}

/* Games */
.game-card {
  padding: 32px;
  margin-bottom: 32px;
}

/* --- Top-of-page game showcase --- */
.games--top { padding-top: 56px; }

/* Kept in the document for search engines and screen readers - the page leads
   with the game artwork rather than a headline. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-bottom: 44px;
}

/* The card itself is unstyled - the media panel inside carries the bevel, so
   the artwork reads as the object rather than a box around a box. */
.showcase-card { text-align: center; }
.showcase-card .demo-media {
  max-width: none;
  margin: 0 0 20px;
}
.showcase-card h2 {
  font-size: 0.95rem;
  color: var(--accent);
  margin: 14px 0 12px;
}
.showcase-card p {
  color: var(--text-dim);
  margin: 0;
}

.showcase-actions { margin-bottom: 72px; }

/* Per-game deep dive below the showcase */
.game-detail { margin-top: 56px; }
.game-detail .section-title { margin-bottom: 28px; }
.game-detail .game-card { margin-bottom: 0; }

.game-footage { margin-top: 40px; }

.game-status {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bevel-dark);
  background: var(--ok);
  border: 2px solid var(--bevel-dark);
  padding: 6px 10px;
  margin-bottom: 18px;
  box-shadow: 3px 3px 0 var(--shadow-hard);
}
.game-status--soon { background: var(--soon); }

.game-copy h3,
.game-card h3 { font-size: 0.95rem; margin: 0 0 16px; color: var(--accent); }
.game-tagline { color: var(--text); margin: 0 0 20px; }
.game-desc { color: var(--text-dim); }

.game-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.game-features li {
  padding-left: 26px;
  position: relative;
  color: var(--text-dim);
}
/* Square pixel bullets rather than round dots */
.game-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 0;
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--shadow-hard);
}

/* Demo */
.demo-inner { text-align: center; }
.demo-media {
  position: relative;
  max-width: 820px;
  margin: 0 auto 26px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.demo-media video,
.demo-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.demo-media-fallback {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.demo-media-fallback span {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--shadow-hard);
}
.demo-media-fallback small { color: var(--text-dim); }

.demo-media--empty video,
.demo-media--empty img { display: none; }
.demo-media--empty .demo-media-fallback { display: flex; }

.demo-caption {
  max-width: 660px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.demo-more { margin-top: 64px; }

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  max-width: 820px;
  margin: 0 auto;
}

.demo-grid-item .demo-media { margin-bottom: 18px; }

/* Shared info-grid (Music / Tech) */
.section-intro {
  max-width: 720px;
  margin: 0 auto 44px;
  text-align: center;
  color: var(--text-dim);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.info-item { padding: 26px; }
.info-item h3 { margin: 0 0 14px; font-size: 0.72rem; color: var(--accent); }
.info-item p { color: var(--text-dim); margin: 0; font-size: 0.95rem; }

/* Architecture */
.arch-diagram {
  padding: 26px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.arch-diagram svg { width: 100%; height: auto; display: block; min-width: 560px; }

/* Diagram text uses the body pixel face; the display face is far too wide for
   the fixed coordinates these labels are positioned at. Square off the boxes
   to match the panels around them. */
.arch-diagram svg text { font-family: var(--font-body); }
.arch-diagram svg rect { rx: 0; }

.arch-block { margin-bottom: 52px; }
.arch-block:last-child { margin-bottom: 0; }
.arch-block h3 {
  font-size: 0.78rem;
  margin: 0 0 14px;
  color: var(--accent);
}
.arch-block-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 22px;
  max-width: 740px;
}

.arch-note {
  border-left: 8px solid var(--accent);
  padding: 22px 26px;
  margin-top: 42px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.arch-note strong { color: var(--accent); }

/* Credits */
.credit-group { max-width: 720px; margin: 0 auto 42px; }
.credit-group:last-child { margin-bottom: 0; }
.credit-group h3 {
  font-family: var(--font-display);
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 20px;
}

.credit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.credit-list li {
  color: var(--text-dim);
  font-size: 0.95rem;
  padding: 14px 0;
  border-bottom: 2px solid var(--bevel-light);
}
.credit-list li:last-child { border-bottom: none; padding-bottom: 0; }
.credit-list li:first-child { padding-top: 0; }
.credit-list strong { color: var(--text); }
.credit-list a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Vision */
.vision { text-align: center; }
.vision p {
  max-width: 780px;
  margin: 0 auto;
  color: var(--text-dim);
}

/* History / About */
.about-inner { max-width: 760px; margin: 0 auto; }
.about p { color: var(--text-dim); }

.bio-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

/* Square character portrait, framed like a status-screen bust */
.bio-photo {
  position: relative;
  width: 101px; /* 72px * 1.4 */
  height: 101px;
  border-radius: 0;
  overflow: hidden;
  background: var(--card);
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow-hard);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bio-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bio-photo-fallback {
  display: none;
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--accent);
}
.bio-photo--empty img { display: none; }
.bio-photo--empty .bio-photo-fallback { display: block; }

.bio-text { text-align: left; }
.bio-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--accent);
  text-shadow: 2px 2px 0 var(--shadow-hard);
}
.bio-title { margin: 10px 0 0; color: var(--text-dim); font-size: 0.95rem; }

.timeline {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.timeline li {
  padding-left: 26px;
  position: relative;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 0;
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--shadow-hard);
}
.timeline strong { color: var(--text); }

/* Footer */
.site-footer {
  border-top: 4px solid var(--border);
  box-shadow: 0 -4px 0 var(--shadow-hard);
  padding: 48px 0 28px;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 26px;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--accent);
  margin: 0;
  text-shadow: 2px 2px 0 var(--shadow-hard);
}
.footer-tag { color: var(--text-dim); margin: 12px 0 0; font-size: 0.95rem; }
.footer-links a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.footer-copy {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0;
}

/* ==========================================================================
   Design docs
   Two parts: the index cards on the homepage (.doc-grid), and the rendered
   doc pages themselves (.doc-page), generated by tools/build-docs.py.
   ========================================================================== */

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}

/* Whole card is the click target */
.doc-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  color: inherit;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}
.doc-card:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    inset 2px 2px 0 var(--bevel-light),
    inset -2px -2px 0 var(--bevel-dark),
    9px 9px 0 var(--shadow-hard);
}
.doc-card h3 {
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 14px;
}
.doc-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 18px;
}
.doc-card-meta {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 0.5rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* --- Rendered doc page --- */
.doc-page { padding-top: 56px; }

.doc-breadcrumb {
  margin: 0 0 32px;
  font-size: 0.95rem;
}
.doc-breadcrumb a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Long-form reading column - narrower than the site wrap, and left-aligned
   rather than centered like the marketing sections. */
.doc-body {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-dim);
}

.doc-body h1 {
  font-size: clamp(0.85rem, 1.9vw, 1.2rem);
  color: var(--accent);
  margin: 0 0 32px;
  line-height: 1.7;
}
.doc-body h2 {
  font-size: 0.82rem;
  color: var(--accent);
  margin: 56px 0 20px;
  padding-top: 26px;
  border-top: 4px solid var(--border);
}
.doc-body h3 {
  font-size: 0.68rem;
  color: var(--text);
  margin: 38px 0 16px;
}

.doc-body p { margin: 0 0 20px; }
.doc-body strong { color: var(--text); }
.doc-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.doc-body ul,
.doc-body ol { margin: 0 0 22px; padding-left: 26px; }
.doc-body li { margin-bottom: 12px; }

.doc-body code {
  font-family: var(--font-body);
  font-size: 0.95em;
  color: var(--accent);
  background: var(--bg-alt);
  border: 2px solid var(--border);
  padding: 1px 6px;
  white-space: nowrap;
}

.doc-body pre {
  background: var(--bg-alt);
  border: 4px solid var(--border);
  box-shadow:
    inset 2px 2px 0 var(--bevel-dark),
    6px 6px 0 var(--shadow-hard);
  padding: 22px;
  margin: 0 0 26px;
  overflow-x: auto;
}
/* Inside a block, code is plain text again - no chip styling, and it must be
   allowed to wrap-free scroll rather than inherit the inline nowrap. */
.doc-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  white-space: pre;
  font-size: 0.9rem;
  line-height: 1.7;
}

.doc-table-wrap {
  overflow-x: auto;
  margin: 0 0 26px;
}
.doc-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 480px;
}
.doc-body th,
.doc-body td {
  border: 2px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.doc-body th {
  background: var(--bg-alt);
  color: var(--accent);
  font-weight: 400;
}

.doc-body hr {
  border: none;
  border-top: 4px solid var(--border);
  margin: 44px 0;
}

/* Tighten the nav before it gets wide enough to wrap awkwardly */
@media (max-width: 1080px) {
  .site-nav { gap: 12px 15px; font-size: 0.5rem; }
  .site-nav a::before { content: none; }
  .nav-cta { padding: 8px 11px; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .info-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 56px 0; }
  .game-card { padding: 22px; }
  .doc-body pre { padding: 14px; }
  .doc-body code { white-space: normal; }
}

/* Respect reduced-motion: drop the press/hover displacement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover, .btn:active { transform: none; }
}
