/* Lipscomb Games: one stylesheet for every page.
   Colours come from custom properties: the studio's neutral set by default,
   each game's own palette on its pages (written into the page by build.py). */

@font-face {
  font-family: "Reception Slab";
  src: url("assets/fonts/reception-slab.woff") format("woff"),
       url("assets/fonts/reception-slab.ttf") format("truetype");
  font-display: swap;
  /* The font draws capitals, figures, '-' and '.' only; everything else falls back. */
  unicode-range: U+0030-0039, U+0041-005A, U+002D-002E;
}

:root {
  --bg: #111214;
  --panel: #1B1D20;
  --panel-border: #2C2F33;
  --text: #ECEAE6;
  --muted: #A9A6A0;
  --accent: #ECEAE6;
  --accent-text: #111214;
  --focus: #FFD166;
  /* Three voices: the studio mark draws its own letters (an image); game pages set headings in the
     game's display face; everything else, studio headings included, is the body face. */
  --font-display: "Reception Slab", Rockwell, "Roboto Slab", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 80rem;
  --gap: clamp(1rem, 3vw, 2.25rem);
  --header-h: 4.5rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: clamp(100%, 0.3vw + 0.85rem, 137.5%);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img, picture, video { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h2 { font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem); }
/* Studio pages: headings in the body face (the Den's display face belongs to the Den). */
.page-studio h1, .page-studio h2, .page-studio h3 { font-family: var(--font-body); font-weight: 300; letter-spacing: 0.2em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* One container, one left edge, everywhere. */
.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 1.6em; }
.prose > h2:first-child { margin-top: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--accent); color: var(--accent-text);
  padding: 0.6rem 1rem; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.dev-banner { background: #FFD166; color: #111214; text-align: center; font-weight: 600; padding: 0.4rem 1rem; font-size: 0.9rem; margin: 0; }
.todo { display: inline-block; background: #FFD166; color: #111214; font-weight: 600; padding: 0 0.4em; border-radius: 3px; font-size: 0.85em; }

/* ---------------------------------------------------------------- header */

.site-header { border-bottom: 1px solid var(--panel-border); background: var(--bg); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; min-height: var(--header-h); padding-block: 0.6rem;
}
.brand-h1 { margin: 0; font: inherit; text-transform: none; letter-spacing: normal; }
.brand { display: inline-grid; gap: 0.25rem; color: var(--text); text-decoration: none; justify-items: start; }
.brand-lockup { height: 2.6rem; width: auto; }
.brand-tagline { font-family: var(--font-body); font-style: italic; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.02em; line-height: 1.2; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--text); text-decoration: none; padding: 0.3rem 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; color: var(--accent); }

/* ---------------------------------------------------------------- footer */

.site-footer { margin-top: clamp(2.5rem, 6vw, 4.5rem); border-top: 1px solid var(--panel-border); color: var(--muted); font-size: 0.92rem; }
.footer-inner { display: grid; gap: 1.2rem; padding-block: 2rem 2.5rem; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; }
.footer-seal { width: 3rem; height: 3rem; flex: none; }
.footer-brand p { margin: 0; line-height: 1.4; font-style: italic; white-space: nowrap; }
.site-footer nav { display: grid; gap: 0.5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; }
.site-footer a { color: var(--text); }
.site-footer p { margin: 0; }
.colophon { font-size: 0.85rem; }
@media (min-width: 56rem) {
  .footer-inner { grid-template-columns: auto 1fr; column-gap: 3rem; align-items: center; }
  .footer-inner > p { grid-column: 2; }
}

/* ---------------------------------------------------------------- buttons, badges */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.3rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem;
  padding: 0.55rem 1.3rem; border-radius: 3px; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none; border: 2px solid var(--accent); text-align: center;
  background: var(--accent); color: var(--accent-text);
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--accent); }
.btn.is-disabled { background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--muted); border: 2px dashed var(--muted); cursor: not-allowed; filter: none; }

.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 3px;
  background: var(--accent); color: var(--accent-text); line-height: 1.5;
}
.badge-in-development { background: transparent; color: var(--text); border: 1px solid currentColor; }
.tag {
  display: inline-block; vertical-align: middle; font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 0.1rem 0.5rem; border: 1px solid var(--muted);
  color: var(--muted); border-radius: 3px; margin-left: 0.4rem; position: relative; top: -0.15em;
}

/* ---------------------------------------------------------------- hero (home feature and game page) */

.feature, .game-hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--bg); color: var(--text);
  display: flex; align-items: flex-end;
  min-height: min(48vw, calc(100svh - var(--header-h)));
}
.game-hero { min-height: min(44vw, calc(100svh - var(--header-h))); }
.feature-media { position: absolute; inset: 0; z-index: -2; }
.feature-media picture, .feature-media img { width: 100%; height: 100%; }
.feature-media img { object-fit: cover; object-position: var(--hero-pos, center); max-width: none; }
.feature::after, .game-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--bg) 93%, transparent) 0%, color-mix(in srgb, var(--bg) 90%, transparent) 4%, transparent 10%),
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 22%, transparent 50%),
    linear-gradient(to right, color-mix(in srgb, var(--bg) 75%, transparent) 0%, transparent 45%);
}
.feature-inner { padding-block: clamp(2rem, 5vw, 4rem); }
.feature-logo, .game-logo { width: min(25rem, 72vw); margin: 0 0 1rem; }
.feature-logo img, .game-logo img { width: 100%; }
.hook {
  max-width: 32rem; font-size: clamp(1.08rem, 0.95rem + 0.45vw, 1.4rem); line-height: 1.45; text-wrap: balance;
  text-shadow: 0 1px 12px color-mix(in srgb, var(--bg) 80%, transparent);
}
.release { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 0; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; align-items: center; }

@media (max-width: 40rem) {
  .feature, .game-hero { display: block; min-height: 0; }
  .feature-media { position: relative; inset: auto; aspect-ratio: 4 / 3; }
  .feature-media img { object-position: var(--hero-pos-mobile, var(--hero-pos, center)); }
  .feature-media::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, var(--bg) 0%, transparent 45%);
  }
  .feature::after, .game-hero::after { content: none; }
  .feature-inner { margin-top: -4.5rem; position: relative; padding-top: 0; }
  .feature-logo, .game-logo { width: min(19rem, 78vw); }
}

/* ---------------------------------------------------------------- home */

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-games { padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.section-about { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.studio-statement { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.statement-mark { width: clamp(7.5rem, 12vw, 10rem); height: auto; }
.studio-statement .prose p:last-child { margin-bottom: 0; }
.section h2 { margin-bottom: 1.2rem; }

.games-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.card {
  position: relative; background: var(--card-panel, var(--panel)); color: var(--card-text, var(--text));
  border: 1px solid var(--card-panel-border, var(--panel-border)); border-radius: 4px; overflow: hidden;
  display: flex; flex-direction: column;
}
.card-art { position: relative; }
.card-art > picture img { width: 100%; aspect-ratio: 920 / 430; object-fit: cover; }
.card-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 0.55), transparent 55%); pointer-events: none; }
.card-logo { position: absolute; left: 1rem; bottom: 0.9rem; width: min(52%, 15rem); z-index: 1; }
.card-logo img { width: 100%; height: auto; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: 0.5rem; justify-items: start; }
.card h3 { margin: 0; font-size: 1.2rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.card:hover { border-color: var(--card-accent, var(--accent)); }
.card .badge { background: var(--card-accent, var(--accent)); color: var(--card-accent-text, var(--accent-text)); }
.card .badge-in-development { background: transparent; color: var(--card-text, var(--text)); }
.card-meta { margin: 0; color: var(--card-muted, var(--muted)); font-size: 0.95rem; }

/* ---------------------------------------------------------------- game page */

.game-layout { display: grid; gap: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2rem, 5vw, 3.5rem); }
.game-main { display: grid; gap: clamp(2.5rem, 6vw, 4rem); min-width: 0; }
.game-main > * { min-width: 0; }
@media (min-width: 72rem) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; column-gap: 3.5rem; }
  .game-aside { position: sticky; top: 1.5rem; }
}
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 4px; padding: clamp(1.1rem, 3vw, 1.8rem); }

.cta-card { display: grid; gap: 0.9rem; }
.cta-card .cta-logo { margin: 0; width: min(16rem, 70%); }
.cta-card .cta-title { font-size: 1.15rem; margin: 0; }
@media (min-width: 72rem) { .cta-card .cta-logo { display: none; } }
@media (max-width: 71.99rem) { .cta-card .cta-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.cta-card .actions { margin-top: 0.2rem; flex-direction: column; align-items: stretch; }
.cta-card .cta-press { margin: 0; font-size: 0.95rem; }
dl.facts-dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.facts-dl dt { color: var(--muted); }
dl.facts-dl dd { margin: 0; }
@media (max-width: 71.99rem) {
  .cta-card { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); align-items: center; column-gap: 2rem; }
  .cta-card .actions { flex-direction: row; }
}

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.features li { border-left: 3px solid var(--accent); padding: 0.1rem 0 0.1rem 1rem; }
.features strong { color: var(--accent); display: block; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; font-size: 1rem; margin-bottom: 0.15rem; }
.plain-features li { margin-bottom: 0.5rem; }

blockquote.quote {
  margin: 0; max-width: 46rem; font-family: var(--font-body); font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); border-left: 3px solid var(--accent); padding-left: 1.2rem;
}
blockquote.quote p { margin-bottom: 0.3em; }
blockquote.quote footer { font-family: var(--font-body); font-style: normal; font-size: 0.95rem; color: var(--muted); }

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.gallery a { display: block; border: 1px solid var(--panel-border); border-radius: 3px; overflow: hidden; }
.gallery a:hover { border-color: var(--accent); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.more { margin: 0.9rem 0 0; font-size: 0.95rem; }
@media (max-width: 40rem) {
  .gallery {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 85%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.6rem; overscroll-behavior-x: contain;
  }
  .gallery li { scroll-snap-align: start; }
}

.mood { margin: 0; }
.mood img { width: 100%; border: 1px solid var(--panel-border); border-radius: 3px; }

.trailer video { width: 100%; border: 1px solid var(--panel-border); }

.world-note .lead { font-style: italic; font-size: 1.15rem; }
.world-note p:last-child { margin-bottom: 0; }

.ea h2 { margin-bottom: 1rem; }

table.reqs { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-bottom: 0.8rem; }
table.reqs th, table.reqs td { text-align: left; vertical-align: top; padding: 0.55rem 0.8rem 0.55rem 0; border-bottom: 1px solid var(--panel-border); }
table.reqs thead th { color: var(--accent); font-weight: 600; }
table.reqs tbody th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.langs { max-width: 32rem; margin-bottom: 1.2rem; }
.note { color: var(--muted); font-size: 0.9rem; }
.note-after { margin-top: 1.2rem; color: var(--muted); }
@media (max-width: 40rem) {
  table.reqs:not(.langs), table.reqs:not(.langs) tbody, table.reqs:not(.langs) tr, table.reqs:not(.langs) th, table.reqs:not(.langs) td { display: block; }
  table.reqs:not(.langs) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.reqs:not(.langs) tr { padding-block: 0.6rem; border-bottom: 1px solid var(--panel-border); }
  table.reqs:not(.langs) th, table.reqs:not(.langs) td { border: 0; padding: 0.15rem 0; white-space: normal; }
  table.reqs:not(.langs) td::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; }
  table.reqs:not(.langs) td:empty { display: none; }
  table.langs tbody th { white-space: normal; }
}

/* ---------------------------------------------------------------- press, about, 404 */

dl.factsheet { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: 0.55rem 1.5rem; margin: 0; }
dl.factsheet dt { color: var(--muted); font-weight: 600; }
dl.factsheet dd { margin: 0; }
@media (max-width: 34rem) { dl.factsheet { grid-template-columns: 1fr; gap: 0.1rem; } dl.factsheet dd { margin-bottom: 0.7rem; } }

.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.downloads li { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.downloads .thumb {
  aspect-ratio: 16 / 9; padding: 0.8rem; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: repeating-conic-gradient(#2a2d31 0% 25%, #202226 0% 50%) 50% / 20px 20px;
}
.downloads .thumb picture { width: 100%; height: 100%; }
.downloads .thumb img { width: 100%; height: 100%; object-fit: contain; }
.downloads .thumb.on-light { background: repeating-conic-gradient(#e9e6df 0% 25%, #d5d1c8 0% 50%) 50% / 20px 20px; }
.downloads .thumb.photo { padding: 0; background: #000; }
.downloads .thumb.photo img { object-fit: cover; }
.downloads .thumb.capsule-thumb { aspect-ratio: 920 / 430; }
.downloads p { margin: 0; padding: 0.7rem 0.9rem 0.9rem; font-size: 0.92rem; }
.downloads .meta { color: var(--muted); display: block; font-size: 0.85rem; }

.page-head { padding-block: clamp(2rem, 6vw, 4rem) 0; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { font-size: clamp(1.8rem, 1rem + 3vw, 3rem); }
.page-head .lead { color: var(--muted); max-width: 46rem; font-size: 1.08rem; margin-bottom: 0; }
.page-head .actions { margin-top: 1.5rem; }
.crumbs { color: var(--muted); margin-bottom: 0.6rem; }
.stack > * + * { margin-top: clamp(2rem, 5vw, 3rem); }
.kicker { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; margin-bottom: 0.4rem; }
.not-found { padding-block: clamp(4rem, 14vw, 9rem) clamp(2rem, 6vw, 4rem); }
.not-found h1 { font-size: clamp(2rem, 1rem + 4vw, 3.6rem); }

/* ---------------------------------------------------------------- lightbox (gallery.js) */

dialog.lightbox { width: min(96vw, 110rem); max-height: 96vh; padding: 0; border: 1px solid var(--panel-border); background: #000; color: #f2f2f2; }
dialog.lightbox::backdrop { background: rgb(0 0 0 / 0.85); }
dialog.lightbox figure { margin: 0; }
dialog.lightbox img { width: 100%; max-height: calc(96vh - 4.5rem); object-fit: contain; }
dialog.lightbox figcaption { padding: 0.6rem 12rem 0.8rem 1rem; font-size: 0.95rem; min-height: 3rem; }
dialog.lightbox .lb-bar { position: absolute; right: 0.5rem; bottom: 0.5rem; display: flex; gap: 0.4rem; align-items: center; }
dialog.lightbox button { font: inherit; font-size: 1.1rem; min-width: 2.75rem; min-height: 2.75rem; border-radius: 3px; background: #1d1f22; color: #f2f2f2; border: 1px solid #555; cursor: pointer; }
dialog.lightbox button:hover { background: #2b2e32; }
dialog.lightbox .lb-count { font-size: 0.85rem; color: #c9c9c9; margin: 0 0.4rem; }
@media (max-width: 40rem) { dialog.lightbox figcaption { padding-right: 1rem; padding-bottom: 3.6rem; } }

@media (prefers-reduced-motion: no-preference) {
  .btn, .card, .gallery a { transition: border-color 0.15s ease, filter 0.15s ease; }
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) { .btn, .badge { border: 1px solid ButtonText; } }

.store-desc-label { color: var(--muted); font-size: 0.9rem; margin: 1.5rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.08em; }
.store-desc { margin: 0; border-left: 3px solid var(--accent); padding-left: 1rem; font-style: italic; }
.store-desc p { margin: 0; }

/* On wide layouts the facts card beside the page carries price and platform, so the hero's
   facts row keeps to the badge and the date and stays clear of the fighters. */
@media (min-width: 72rem) { .game-hero .facts li:nth-child(n+3) { display: none; } }

/* Home: the studio section runs straight into the footer. */
.page-home .section-about { padding-bottom: 0; }
.page-home .site-footer { margin-top: clamp(1.75rem, 4vw, 2.75rem); }

/* Phones: the tagline lives in the footer; the header keeps the lockup only. */
@media (max-width: 40rem) { .brand-tagline { display: none; } }

/* Below 1400 px the hero box is short and wide: keep the hook clear of the fighter's shoulder. */
@media (max-width: 1399px) { .hook { max-width: 31rem; } }
