:root {
  --ink: #0f1530;
  --ink-deep: #090d20;
  --panel: #161f45;
  --line: #2a3566;
  --amber: #ffb547;
  --amber-soft: #ffd592;
  --paper: #f1ebdd;
  --dim: #a3abc9;
  --cyan: #6fe3e1;
  --shop: #221a3d;

  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --term: "VT323", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "opsz" 16;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4vw, 3rem); font-stretch: 85%; letter-spacing: -0.015em; }
h3 { font-size: clamp(1.75rem, 3vw, 2.375rem); font-stretch: 85%; letter-spacing: -0.01em; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--amber); color: var(--ink); padding: 8px 14px; border-radius: 6px; font-weight: 700;
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  max-width: var(--max); margin: 0 auto; padding: 22px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 1.125rem; }
.brand-mark { width: 32px; height: 32px; }
.brand-mark rect { fill: var(--panel); stroke: var(--line); }
.brand-mark path { fill: none; stroke: var(--amber); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.site-header nav { display: flex; gap: 4px 24px; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; color: var(--dim); padding: 4px 0; }
.site-header nav a:hover { color: var(--paper); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-block; text-decoration: none; font-weight: 600;
  padding: 12px 20px; border-radius: 999px;
  background: var(--amber); color: var(--ink); border: 2px solid var(--amber);
  transition: background-color .15s, color .15s;
}
.button:hover { background: var(--amber-soft); border-color: var(--amber-soft); }
.button-quiet { background: transparent; color: var(--paper); border-color: var(--line); }
.button-quiet:hover { background: var(--panel); border-color: var(--dim); color: var(--paper); }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(32px, 7vw, 96px) var(--gutter) clamp(64px, 9vw, 128px);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 88px); align-items: center;
}
.hero h1 {
  font-size: clamp(3rem, 7.2vw, 6rem);
  font-stretch: 78%; font-weight: 800; line-height: .94; letter-spacing: -0.025em;
  font-variation-settings: "opsz" 96;
}
.lede { margin-top: 28px; font-size: 1.1875rem; color: var(--dim); max-width: 34em; }

.crt { margin: 0; }
.crt-screen {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 11;
  padding: clamp(18px, 3.5vw, 36px);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% 45%, #1a2147 0%, var(--ink-deep) 70%);
  border: 14px solid #1b2452;
  box-shadow: inset 0 0 60px rgba(0,0,0,.65), 0 0 0 1px var(--line), 0 30px 80px -30px rgba(255,181,71,.25);
  color: var(--amber);
  font-family: var(--term);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.2;
  display: flex; flex-direction: column; justify-content: center;
  text-shadow: 0 0 8px rgba(255,181,71,.55);
}
.crt-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.term-line { margin: 0; min-height: 1.2em; white-space: pre; }
.wordmark { width: 100%; height: auto; margin: 6% 0 7%; overflow: visible; }
.wordmark-ink {
  fill: none; stroke: var(--amber); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255,181,71,.7));
}
.turtle { fill: var(--cyan); filter: drop-shadow(0 0 5px rgba(111,227,225,.8)); opacity: 0; }
.cursor { display: inline-block; width: .55em; height: 1em; vertical-align: -0.15em; background: var(--amber); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.crt-bezel { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 14px 6px 0; color: var(--dim); font-size: .9375rem; }
.led { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); flex: none; }
.bezel-hint { flex: 1 1 16em; }
.bezel-link { color: var(--paper); text-underline-offset: 4px; }
kbd { font-family: var(--term); font-size: 1.2em; color: var(--amber); }

/* Live Logo terminal */
.crt-screen.is-live { display: block; padding: 0; background: var(--screen-bg, radial-gradient(120% 90% at 50% 45%, #1a2147 0%, var(--ink-deep) 70%)); cursor: text; }
.crt-screen.is-live:focus-within { box-shadow: inset 0 0 60px rgba(0,0,0,.65), 0 0 0 1px var(--line), 0 0 0 4px rgba(111,227,225,.35), 0 30px 80px -30px rgba(255,181,71,.25); }
.logo-stage { position: absolute; inset: 0; }
.logo-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.logo-text {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 0 clamp(14px, 3vw, 28px) clamp(10px, 2vw, 18px);
}
.logo-output { max-height: calc(1.2em * 4); overflow: hidden; }
.logo-line { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.logo-line.is-echo { color: var(--amber-soft); }
.logo-line.is-error { color: #ff9f8a; text-shadow: 0 0 8px rgba(255,120,100,.5); }
.logo-input { display: flex; align-items: baseline; gap: .6ch; }
.logo-prompt { flex: none; }
.logo-input input {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--amber); text-shadow: inherit; caret-color: var(--amber);
}

.logo-page .crt-screen.is-live { aspect-ratio: auto; height: min(78vh, 760px); min-height: 460px; display: flex; flex-direction: column; }
.logo-page .logo-stage { position: relative; inset: auto; flex: 1; min-height: 0; }
.logo-page .logo-text { position: relative; padding-top: 12px; border-top: 1px dashed rgba(255,181,71,.25); }
.logo-page .logo-output { max-height: calc(1.2em * 6); min-height: calc(1.2em * 3); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* Logo page */
.logo-intro { max-width: var(--max); margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--gutter) 32px; }
.logo-intro h1 { font-size: clamp(3rem, 7vw, 5.5rem); font-stretch: 78%; font-weight: 800; line-height: .94; letter-spacing: -0.025em; font-variation-settings: "opsz" 96; }
.logo-intro .lede { max-width: 40em; }
.logo-workspace { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.control {
  font: inherit; font-size: .9375rem; color: var(--paper); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; cursor: pointer;
}
.control:hover { border-color: var(--dim); }
.speed { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.speed input { accent-color: var(--amber); width: 130px; }
.speed-note { font-size: .875rem; }

.example-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 40px 32px; }
.example-list li { display: flex; flex-direction: column; }
.example-list h3 { font-size: 1.5rem; }
.example-list p { color: var(--dim); margin: 8px 0 14px; }
.example-list pre {
  margin: 0 0 16px; padding: 14px 16px; flex: 1;
  background: var(--ink-deep); border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--term); font-size: 1.1875rem; line-height: 1.15; color: var(--amber);
  overflow-x: auto; white-space: pre;
}
.example-list .button { align-self: flex-start; }

.reference { border-top: 1px solid var(--line); }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 48px 40px; }
.reference-grid h3 { font-size: 1.5rem; margin-bottom: 12px; }
.reference-grid dl { margin: 0; border-top: 1px solid var(--line); }
.reference-grid dl div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.reference-grid dt { font-family: var(--term); font-size: 1.3rem; line-height: 1.1; color: var(--amber); }
.reference-grid dt span { color: var(--dim); }
.reference-grid dd { margin: 2px 0 0; color: var(--dim); font-size: .96875rem; }
.palette-title { font-size: 1.5rem; margin: 56px 0 16px; }
.palette { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.palette li { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: .9375rem; }
.palette li::before { content: ""; width: 22px; height: 22px; border-radius: 6px; background: var(--c); border: 1px solid var(--line); flex: none; }
.palette span { font-family: var(--term); font-size: 1.25rem; color: var(--paper); min-width: 1.4em; }

.logo-story { border-top: 1px solid var(--line); }
.logo-story p { max-width: 36em; color: var(--dim); font-size: 1.1875rem; margin-top: 20px; }
.logo-story a:not(.button) { color: var(--paper); text-underline-offset: 4px; }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gutter); }
.section-head { max-width: 40em; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head p { color: var(--dim); margin-top: 16px; font-size: 1.1875rem; }

/* Games */
.games { border-top: 1px solid var(--line); }
.game {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 64px); align-items: start;
}
.game + .game { margin-top: clamp(80px, 11vw, 144px); }
.game-fi .game-media { order: 2; }
.game-fi .game-text { order: 1; }
.game-key { width: 100%; border-radius: 14px; }
.game-key-wrap { position: relative; }
.game-key-wrap::after {
  content: ""; position: absolute; inset: 0; border-radius: 14px;
  background: linear-gradient(to top, rgba(4,6,16,.75), transparent 45%);
}
.fi-wordmark { position: absolute; left: 5%; bottom: 7%; width: 48%; z-index: 1; }
.shots { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shots img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.tagline { font-size: 1.25rem; color: var(--amber); margin: 12px 0 20px; font-weight: 500; }
.game-fi .tagline { color: var(--cyan); }
.game-text > p:not(.tagline) { color: var(--dim); }
.specs { margin: 28px 0 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 7.5em 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--dim); font-size: .9375rem; }
.specs dd { margin: 0; }

/* Shop */
.shop {
  max-width: none; margin: 0;
  background: var(--shop);
  padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  padding-right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.shop-intro { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: center; max-width: 900px; }
.shop-intro p { color: #cfc6e4; max-width: 38em; margin-top: 16px; }
.cat-tv { width: 100%; filter: drop-shadow(0 20px 30px rgba(0,0,0,.35)); }
.status { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--paper) !important; background: rgba(255,255,255,.06); padding: 6px 14px; border-radius: 999px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff9fc0; box-shadow: 0 0 8px #ff9fc0; }
.products { list-style: none; padding: 0; margin: clamp(48px, 6vw, 72px) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.products img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; margin-bottom: 18px; }
.products h3 { font-size: 1.3125rem; font-stretch: 90%; }
.products p { color: #cfc6e4; font-size: .96875rem; margin-top: 8px; }
.fineprint { margin: 40px 0 0; font-size: .875rem; color: #a99fc4; max-width: 60em; }

/* Studio */
.studio { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.studio-text p { color: var(--dim); font-size: 1.1875rem; margin-top: 20px; max-width: 34em; }
.contact { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: clamp(24px, 4vw, 40px); scroll-margin-top: 24px; }
.contact h2 { font-size: 2rem; }
.contact p { color: var(--dim); margin-top: 12px; }

.contact-form { margin-top: 24px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9375rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--paper);
  background: var(--ink-deep); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
}
.field textarea { resize: vertical; min-height: 7.5em; line-height: 1.5; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 1px; border-color: transparent; }
.field [aria-invalid="true"] { border-color: #ff9f8a; }
.contact .field-error { margin: 0; color: #ffb3a3; font-size: .9375rem; }
.field-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .button { justify-self: start; cursor: pointer; font: inherit; font-weight: 600; }
.contact-form .button:disabled { opacity: .7; cursor: progress; }
.form-status { margin: 0; min-height: 1.6em; }
.form-status.is-sent { color: var(--cyan); }
.form-status.is-error { color: #ffb3a3; }

/* Footer */
.site-footer {
  max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 32px; color: var(--dim); font-size: .9375rem;
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--paper); }

/* 404 */
.lost { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 12vw, 160px) var(--gutter); }
.lost .crt-screen { max-width: 640px; aspect-ratio: auto; min-height: 240px; }

@media (max-width: 960px) {
  .hero, .game, .studio { grid-template-columns: 1fr; }
  .crt { max-width: 640px; }
  .game-fi .game-media, .game-fi .game-text { order: 0; }
  .products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .site-header nav { gap: 4px 16px; }
  .hero .crt-screen { font-size: 1.125rem; }
  .hero .logo-output { max-height: calc(1.2em * 3); }
  .shop-intro { grid-template-columns: 1fr; }
  .cat-tv { width: 180px; }
  .products { grid-template-columns: 1fr; }
  .shots { gap: 8px; }
  .specs div { grid-template-columns: 6.5em 1fr; }
  .crt-screen { border-width: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}
