:root {
  color-scheme: dark;
  --ground: #141210;
  --surface: #1e1a16;
  --screen: #10100f;
  --line: #45372b;
  --ink: #f6eee1;
  --muted: #bcafa1;
  --gold: #ffcb59;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--ground); font: 1rem/1.65 var(--body); }
a { color: var(--gold); text-underline-offset: .24em; }
button { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.8vw, 4rem); letter-spacing: -.05em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.5rem); letter-spacing: -.035em; }
h3 { font-size: 1.23rem; }
p { margin: .65rem 0 0; }
.wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; top: .6rem; left: .6rem; transform: translateY(-200%); z-index: 5; background: var(--surface); padding: .5rem 1rem; }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; }
.header-inner { min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 730 1.1rem var(--display); }
.brand img { display: block; border-radius: 6px; }
.main-nav, .footer-inner nav { display: flex; gap: 4px 24px; flex-wrap: wrap; align-items: center; }
.main-nav a, .footer-inner nav a { text-decoration: none; color: var(--muted); padding-block: 8px; }
.main-nav a:hover, .footer-inner nav a:hover { color: var(--gold); }
.hero { padding-top: clamp(30px, 5vw, 64px); padding-bottom: 22px; }
.hero p { max-width: 700px; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.15rem); }
.player { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; overflow: hidden; }
.player-screen { display: grid; position: relative; aspect-ratio: 16 / 9; min-height: 216px; overflow: hidden; background: var(--screen); }
.player-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--screen); }
.player-overlay {
  position: absolute; z-index: 1; inset: 0;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 12px; gap: 12px; text-align: center;
  background: radial-gradient(ellipse at 50% 46%, #39291a 0, #171411 54%, var(--screen) 85%);
}
.player-overlay img { border-radius: 12px; }
.player-overlay .game-preview {
  display: block;
  width: min(100%, 400px);
  height: auto;
  max-height: 48%;
  object-fit: contain;
  border-radius: 6px;
}
.player-overlay:has([data-start][hidden]) .game-preview { display: none; }
.player-overlay p { color: var(--muted); font-size: .9rem; margin: 0; }
.player-overlay p:empty { display: none; }
.player-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 12px 14px; border-top: 1px solid var(--line); }
.player-bar > span { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 12px; font-weight: 680; }
.player-bar small { color: var(--muted); font-weight: 450; }
.player-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 14px; border-radius: 6px; border: 1px solid #6a5743; background: #262018;
  color: var(--ink); text-decoration: none; cursor: pointer; font-size: .92rem; line-height: 1.3;
}
.button:hover { border-color: var(--gold); color: var(--gold); }
.button.primary { background: var(--gold); color: #21190c; border-color: var(--gold); font-weight: 750; padding-inline: 22px; }
.button.primary:hover { background: #ffdc8d; }
.spinner { width: 30px; height: 30px; border: 3px solid #61503b; border-top-color: var(--gold); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player:fullscreen, .player.is-expanded {
  display: grid; grid-template-rows: minmax(0, 1fr) auto; width: 100%; height: 100%; border: 0; border-radius: 0;
}
.player.is-expanded { position: fixed; inset: 0; height: 100dvh; z-index: 4; }
body.player-expanded { overflow: hidden; }
.player:fullscreen .player-screen, .player.is-expanded .player-screen { aspect-ratio: auto; min-height: 0; }
.player[data-kind="game"]:is(:fullscreen, .is-expanded) {
  grid-template-rows: minmax(0, 1fr);
  background: #000;
}
.player[data-kind="game"]:is(:fullscreen, .is-expanded) .player-bar {
  position: absolute;
  inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) auto auto;
  z-index: 2;
  padding: 0;
  border: 0;
}
.player[data-kind="game"]:is(:fullscreen, .is-expanded) .player-bar > span,
.player[data-kind="game"]:is(:fullscreen, .is-expanded) .player-actions > a {
  display: none;
}
.player[data-kind="game"]:is(:fullscreen, .is-expanded) [data-fullscreen] {
  border: 0;
  background: rgb(0 0 0 / 70%);
}
.player-note, .section-intro, .muted { color: var(--muted); }
.player-note { font-size: .9rem; }
.content-section { margin-top: clamp(38px, 6vw, 70px); scroll-margin-top: 20px; }
.section-intro, .reading { max-width: 760px; }
.controls-layout, .route-grid { display: grid; gap: 14px; margin-top: 18px; }
.controls-layout { grid-template-columns: minmax(280px, 1fr) 1.35fr; }
.route-grid { grid-template-columns: repeat(3, 1fr); }
.panel { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.panel h3 { color: var(--gold); }
.key-list { margin: 0; }
.key-list div { display: grid; align-items: center; grid-template-columns: minmax(132px, 1fr) 1fr; gap: 12px; padding-block: 8px; }
.key-list div + div { border-top: 1px solid var(--line); }
.key-list dd { margin: 0; }
.key-list dt span { font-size: .8rem; color: var(--muted); }
kbd { display: inline-block; min-width: 20px; padding: 0 4px; text-align: center; color: var(--gold); background: #15120e; border: 1px solid #6a5743; border-radius: 3px; font: .9em/1.6 "IBM Plex Mono", Consolas, monospace; }
.reading h3 { margin-top: 1.6rem; }
.game-screenshot { max-width: 560px; margin: 14px 0; }
.game-screenshot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 9px; }
.game-screenshot figcaption { margin-top: 6px; color: var(--muted); font-size: .9rem; }
.trailer { max-width: 820px; margin-top: 16px; }
#play .trailer { margin-top: 0; }
details { max-width: 840px; border-bottom: 1px solid var(--line); }
details:first-of-type { margin-top: 14px; border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 13px 4px; font-weight: 650; }
summary::marker { color: var(--gold); }
details p { margin: 0 4px 14px 20px; color: var(--muted); }
.site-footer { margin-top: clamp(36px, 6vw, 66px); padding-block: 28px; background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner p { font-size: .9rem; }
.legal { max-width: 780px; min-height: 52vh; padding-top: 42px; }
.legal h2 { font-size: 1.5rem; margin-top: 27px; }
.legal .button { margin-top: 16px; }
@media (max-width: 680px) {
  .header-inner, .footer-inner { align-items: flex-start; flex-direction: column; }
  .header-inner { padding-block: 10px; gap: 3px; }
  .main-nav, .footer-inner nav { column-gap: 18px; }
  .controls-layout, .route-grid { grid-template-columns: 1fr; }
  .player-overlay { gap: 10px; }
  .trailer .player-overlay img { width: 55px; height: 55px; }
  .player-note { line-height: 1.45; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
