/* VirtualDream catalog: a dream lab that is also an arcade.
   Night (dark) is the home theme; dawn (light) follows the system or the header's switch. Tokens first, then the parts. */

:root {
  /* night */
  --bg: #0f0b2a;
  --bg-deep: #090620;
  --bg-tint: #15103a;
  --surface: #1c1650;
  --surface-2: #261e66;
  --ink: #f6f3ff;
  --ink-2: #cfc8f2;
  --line: rgba(255, 255, 255, 0.16);
  --edge: #f6f3ff;
  --hard-shadow: #05031a;
  --gold: #f6c453;
  --gold-hi: #ffd97e;
  --gold-ink: #241800;
  --violet: #a99bff;
  --pink: #ff9bd0;
  --mint: #74ecd9;
  --link: #bdb2ff;
  --focus: #9ee7ff;
  --star: rgba(255, 255, 255, 0.9);
  --glow: radial-gradient(60% 55% at 70% 20%, rgba(176, 92, 200, 0.42), transparent 70%),
    radial-gradient(50% 50% at 15% 80%, rgba(72, 96, 230, 0.35), transparent 70%);

  --radius: 20px;
  --radius-s: 12px;
  --gap: clamp(16px, 3vw, 28px);
  --wrap: 1120px;
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* dawn */
:root[data-theme="light"] {
  --bg: #fbf7ff;
  --bg-deep: #f1e8ff;
  --bg-tint: #f3ecff;
  --surface: #ffffff;
  --surface-2: #f6f0ff;
  --ink: #1b1540;
  --ink-2: #4a4372;
  --line: rgba(27, 21, 64, 0.18);
  --edge: #1b1540;
  --hard-shadow: #1b1540;
  --gold: #f6c453;
  --gold-hi: #ffd97e;
  --gold-ink: #241800;
  --violet: #5a3fd6;
  --pink: #b02a78;
  --mint: #0b6f63;
  --link: #4a2fc4;
  --focus: #1f5fd0;
  --star: rgba(90, 63, 214, 0.55);
  --glow: radial-gradient(60% 55% at 70% 20%, rgba(255, 170, 200, 0.55), transparent 70%),
    radial-gradient(50% 50% at 15% 80%, rgba(150, 170, 255, 0.5), transparent 70%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font); min-height: 100vh; overflow-x: hidden; }
img, video, svg { max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 7.2vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.3rem; font-weight: 750; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
main:focus, h1:focus { outline: none; }
address { font-style: normal; }
strong { font-weight: 700; }

.wrap { width: min(var(--wrap), 100% - 2 * clamp(16px, 4vw, 32px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--gold); color: var(--gold-ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }

/* The lab's small print: labels on everything, like a notebook. */
.label { font: 600 0.74rem/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet); margin-bottom: 10px; }
.label-live { color: var(--mint); }
.label-live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 8px; }
.label-xr { color: var(--pink); }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--ink-2); max-width: 46ch; }
.lede.narrow { max-width: 62ch; }
.footnote { color: var(--ink-2); font-size: 0.92rem; margin-top: 18px; }
.tagline { color: var(--ink-2); font-size: 1.1rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1.15rem; margin-right: auto; min-height: 44px; }
.brand b { font-weight: 800; color: var(--gold); }
:root[data-theme="light"] .brand b { color: var(--violet); }
.logo { display: block; flex: none; border-radius: 9px; }
.nav { display: flex; gap: 2px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { background: var(--surface-2); }
.theme { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: transparent; color: var(--ink); font-size: 1.15rem; cursor: pointer; flex: none; }
.theme:hover { background: var(--surface-2); }

/* Arcade parts: thick edge, hard offset shadow, a little lift. */
.card { background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--hard-shadow); }
:root[data-theme="dark"] .card { border-color: color-mix(in srgb, var(--edge) 78%, transparent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 22px; border-radius: 14px; border: 2px solid var(--edge);
  font: 750 1rem/1 var(--font); text-decoration: none; cursor: pointer; color: var(--ink); background: transparent; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.btn-play { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-ink); box-shadow: 4px 4px 0 var(--hard-shadow); }
:root[data-theme="dark"] .btn-play { border-color: #fff3cf; }
.btn-play:hover { background: var(--gold-hi); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--hard-shadow); }
.btn-play:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--hard-shadow); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--edge); }
.btn-ghost[aria-disabled="true"] { color: var(--ink-2); cursor: default; border-style: dashed; }
.btn-big { min-height: 56px; padding-inline: 30px; font-size: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { font: 600 0.74rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 11px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink-2); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.chip-xr { color: var(--pink); border-color: currentColor; }
.chips-plain { margin-top: 20px; }

/* Hero: the night sky. Stars are two tiled gradients; the orb is the lab's moon. */
.hero { position: relative; overflow: hidden; background: var(--glow), linear-gradient(180deg, var(--bg-deep), var(--bg)); border-bottom: 1px solid var(--line); }
.sky { position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(1.6px 1.6px at 20px 30px, var(--star), transparent 60%), radial-gradient(1.2px 1.2px at 90px 120px, var(--star), transparent 60%),
    radial-gradient(1.8px 1.8px at 160px 60px, var(--star), transparent 60%), radial-gradient(1.1px 1.1px at 230px 170px, var(--star), transparent 60%),
    radial-gradient(1.4px 1.4px at 290px 20px, var(--star), transparent 60%);
  background-size: 320px 200px; opacity: 0.8; animation: twinkle 7s ease-in-out infinite alternate; }
.orb { position: absolute; right: max(4vw, calc(50% - 520px)); top: 14%; width: clamp(120px, 22vw, 260px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6d8, var(--gold) 45%, #e08a3c 100%); box-shadow: 0 0 80px 20px rgba(246, 196, 83, 0.35); opacity: 0.92;
  animation: float 9s ease-in-out infinite alternate; }
.hero-inner { position: relative; padding-block: clamp(56px, 11vw, 128px); }
.hero h1 { max-width: 13ch; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--gold), var(--pink) 55%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { margin-top: 18px; }
.hero-chips { margin-top: 26px; }
.boot-note { margin-top: 26px; color: var(--ink-2); font: 600 0.8rem var(--mono); letter-spacing: 0.08em; }
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 0.95; } }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(14px); } }

/* Sections */
.section { padding-block: clamp(48px, 8vw, 88px); }
.section-tint { background: var(--bg-tint); border-block: 1px solid var(--line); }
.section h2 { margin-bottom: 18px; }
.skeleton, .notice { padding: 28px; color: var(--ink-2); }
.notice p + p { margin-top: 14px; }

/* The featured game */
.game-list { display: grid; gap: var(--gap); margin-top: 8px; }
.game-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden; }
.game-card-media { background: #120d33; border-right: 2px solid var(--edge); display: flex; }
.game-card-body { padding: clamp(20px, 3vw, 32px); }
.game-card h3 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); }
.game-card h3 a { color: var(--ink); text-decoration: none; }
.game-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.game-card .tagline { margin: 6px 0 12px; }
.media { position: relative; width: 100%; background: #120d33; overflow: hidden; align-self: center; }
@media (min-width: 821px) { .game-card-media .media { aspect-ratio: auto !important; height: 100%; min-height: 320px; } }
.media-poster, .media-loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* A faint scan line: the arcade cabinet's glass. */
.media-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px); mix-blend-mode: overlay; }
.controls { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.controls summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.controls dl { display: grid; gap: 8px; margin-top: 10px; font-size: 0.95rem; }
.controls dl div { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px; }
dt { font-weight: 700; }
.controls dd, .facts dd { color: var(--ink-2); }

/* Animal Intelligence */
.ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: 28px; }
.ai-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.ai-card .where { margin-top: auto; padding-top: 8px; font: 600 0.74rem var(--mono); letter-spacing: 0.06em; color: var(--ink-2); }
.ai-placeholder { grid-column: span 1; border-style: dashed; box-shadow: none; background: transparent; color: var(--ink-2); justify-content: center; }
.ai-grid .ai-placeholder:nth-last-child(2):nth-child(4) { grid-column: 1 / span 2; }

/* More coming */
.coming { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.coming-card { padding: 22px; border-style: dashed; box-shadow: none; background: transparent; }
.coming-card p:last-child { color: var(--ink-2); margin-top: 8px; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: center; }
.about p + p { margin-top: 14px; }
.promises { padding: 24px; display: grid; gap: 14px; }
.promises li { padding-left: 30px; position: relative; color: var(--ink-2); }
.promises li strong { color: var(--ink); }
.promises li::before { content: "★"; position: absolute; left: 0; color: var(--gold); }
:root[data-theme="light"] .promises li::before { color: #b9790a; }

/* A game's page */
.game { padding-block: clamp(24px, 5vw, 48px) clamp(48px, 8vw, 88px); display: grid; gap: clamp(32px, 5vw, 56px); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.crumbs { margin-bottom: -24px; }
.game-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--gap); align-items: center; }
.game-head-media { overflow: hidden; display: flex; }
.game-head .tagline { margin-top: 10px; font-size: 1.25rem; }
.game-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.game h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 14px; }
.game p + p { margin-top: 12px; }
.facts { padding: 22px; }
.facts dl { display: grid; gap: 10px; }
.facts dl div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.facts dl div:last-child { border: 0; padding: 0; }
.facts dd { text-align: right; }
.control-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.control-grid .card { padding: 18px; box-shadow: 4px 4px 0 var(--hard-shadow); }
.control-grid dt { font: 600 0.74rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet); margin-bottom: 8px; }
.xr { padding: clamp(20px, 3vw, 32px); background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 16%, var(--surface)), var(--surface) 60%); }
.xr .safety { margin-top: 14px; }
.xr ol { list-style: decimal; padding-left: 1.3em; margin-top: 14px; display: grid; gap: 6px; }
.shots { display: grid; grid-template-columns: 1fr 1fr 0.5fr; gap: 16px; align-items: start; }
.shots li { overflow: hidden; box-shadow: 4px 4px 0 var(--hard-shadow); }
.shots img { display: block; width: 100%; }

/* Text pages */
.page { max-width: 760px; }
.prose h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); margin-bottom: 14px; }
.prose h2 { font-size: 1.35rem; margin: 34px 0 10px; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 12px; }
.prose ul { list-style: disc; padding-left: 1.3em; display: grid; gap: 8px; }
.contact-card { padding: 24px; margin-top: 26px; }
.contact-card dl { display: grid; gap: 16px; }
.contact-card dl div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; }
.contact-card a { word-break: break-word; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-deep); padding-block: 28px; font-size: 0.95rem; }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; margin-right: auto; }
.foot-brand .logo { width: 24px; height: 24px; }
.foot-links { display: flex; gap: 4px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; }
.legal { flex-basis: 100%; color: var(--ink-2); font-size: 0.88rem; }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; z-index: 30; padding: 14px 20px; background: #fff1b8; color: #241800; border-top: 2px solid #241800; }
#blazor-error-ui a { color: #241800; font-weight: 700; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* Phone */
@media (max-width: 820px) {
  .game-card, .game-head, .game-cols, .about { grid-template-columns: minmax(0, 1fr); }
  .game-card-media { border-right: 0; border-bottom: 2px solid var(--edge); }
  .game-head-media { order: -1; }
  .ai-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-grid .ai-placeholder:nth-last-child(2):nth-child(4) { grid-column: auto; }
  .shots { grid-template-columns: 1fr 1fr; }
  .shots .shot-tall { grid-column: 1 / -1; max-width: 220px; }
  .controls dl div { grid-template-columns: 1fr; gap: 2px; }
  .card { box-shadow: 4px 4px 0 var(--hard-shadow); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  /* Two rows: the name and the theme switch, then the sections. */
  .bar { flex-wrap: wrap; gap: 0 8px; padding-top: 6px; }
  .bar nav { order: 3; flex-basis: 100%; margin-inline: -10px; }
  .nav a { padding: 0 10px; font-size: 0.92rem; }
  html { scroll-padding-top: 120px; }
  .orb { opacity: 0.5; top: 6%; right: -30px; }
  .actions .btn { flex: 1 1 auto; }
  .contact-card dl div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky, .orb { animation: none; }
  .btn { transition: none; }
  .btn-play:hover, .btn-play:active { transform: none; }
}
@media (forced-colors: active) {
  .card, .btn, .chip { border-color: CanvasText; box-shadow: none; }
  .hero h1 em { color: CanvasText; background: none; }
}
