/* Cinnabar Games — site styles */
@font-face { font-family: "Pixelify Sans"; src: url("fonts/pixelify-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --sky: #bce9fe;        /* sampled from the Tiny Space Program launch pad */
  --sky-deep: #8fd3f2;
  --ink: #15233f;        /* text on sky and paper */
  --space: #10173a;      /* deep space section */
  --space-raised: #1a2452;
  --starlight: #e8f1ff;  /* text on space */
  --muted-dark: #a9b6d6;
  --cinnabar: #c8102e;   /* the red of the CG mark */
  --cyan: #3fd6e8;       /* in-game UI frame colour */
  --paper: #f5fbff;
  --muted: #4b5a78;
  --pixel: "Pixelify Sans", "Courier New", monospace;
  --text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 68rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--text); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cinnabar); outline-offset: 3px; }
.on-space :focus-visible { outline-color: var(--cyan); }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.375rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* Header */
.site-head { background: var(--sky); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--pixel); font-weight: 600; font-size: 1.25rem; }
.brand img { width: 30px; height: auto; image-rendering: pixelated; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 700; padding: .25rem 0; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--cinnabar); }

/* Home hero: the launch pad */
.hero { background: var(--sky); position: relative; overflow: hidden; }
.hero-text { padding-top: clamp(2rem, 7vw, 5rem); position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.75rem, 10vw, 6.5rem); line-height: .95; margin-bottom: .3em; max-width: 9ch; }
.hero p { font-size: clamp(1.125rem, 2.2vw, 1.375rem); max-width: 30rem; }
.hero-art { margin-top: clamp(-9rem, -14vw, -2rem); }
.hero-art img { width: 100%; min-width: 720px; margin-left: auto; image-rendering: pixelated; }
@media (max-width: 720px) { .hero-art { margin-top: 1rem; } .hero-art img { margin-left: calc(50% - 360px); } }

/* Space section (sky fades into space under the launch pad) */
.on-space { background: var(--space); color: var(--starlight); }
.horizon { height: 5rem; background: linear-gradient(#3a6f2e, var(--space)); }
.section { padding: clamp(3rem, 8vw, 6rem) 0; }
.lede { color: var(--muted-dark); max-width: 36rem; font-size: 1.125rem; }

/* Game rows */
.games { display: grid; gap: clamp(2.5rem, 6vw, 4rem); margin-top: 2.5rem; }
.game { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.5rem 2rem; align-items: start; }
.game-icon { width: 7.5rem; height: 7.5rem; border-radius: 1.6rem; image-rendering: pixelated; }
.game-icon.placeholder { display: grid; place-items: center; background: var(--space-raised); border: 3px solid var(--cyan); font-family: var(--pixel); font-size: 2.25rem; color: var(--cyan); }
.game h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .25em; }
.game h3 a { text-decoration: none; }
.game h3 a:hover { text-decoration: underline; }
.game .tag { color: var(--cyan); font-weight: 700; margin-bottom: .6em; }
.game p { max-width: 38rem; }
.game-shots { grid-column: 1 / -1; display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.game-shots img { width: min(26rem, 80vw); flex: none; border-radius: .5rem; scroll-snap-align: start; }
@media (max-width: 560px) { .game { grid-template-columns: 1fr; } .game-icon { width: 5.5rem; height: 5.5rem; border-radius: 1.2rem; } }

/* Store buttons */
.stores { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.store { display: inline-flex; flex-direction: column; line-height: 1.15; text-decoration: none; padding: .6rem 1.1rem; border-radius: .6rem; background: var(--starlight); color: var(--space); border: 2px solid var(--starlight); font-weight: 700; }
.store small { font-weight: 400; font-size: .75rem; }
.store:hover { background: var(--cyan); border-color: var(--cyan); }
.on-paper .store { background: var(--ink); color: #fff; border-color: var(--ink); }
.on-paper .store:hover { background: var(--cinnabar); border-color: var(--cinnabar); }
.more { display: inline-block; margin-top: 1rem; font-weight: 700; }

/* Studio */
.studio { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: start; }
.studio img { width: 5rem; image-rendering: pixelated; }
.studio p { max-width: 38rem; }
@media (max-width: 560px) { .studio { grid-template-columns: 1fr; } }

/* Inner pages */
.page-head { background: var(--sky); padding: clamp(2rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem); }
.page-head h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
.page-head p { max-width: 36rem; font-size: 1.125rem; }
.prose { max-width: 42rem; }
.prose h2 { font-size: 1.625rem; margin-top: 2.25rem; }
.prose h3 { font-size: 1.25rem; margin-top: 1.75rem; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.25em; font-size: .975rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .55rem .6rem; border-bottom: 1px solid #cfdbe8; }
.prose th { font-weight: 700; }
.table-scroll { overflow-x: auto; }
.updated { color: var(--muted); }

/* Game detail page */
.game-hero { background: var(--space); color: var(--starlight); }
.game-hero-art img { width: 100%; max-height: 26rem; object-fit: cover; object-position: center 70%; image-rendering: pixelated; }
.game-hero .wrap { display: grid; grid-template-columns: 8rem 1fr; gap: 1.5rem 2rem; align-items: center; padding-top: 2rem; padding-bottom: 2.5rem; }
.game-hero .game-icon { width: 8rem; height: 8rem; }
.game-hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: .2em; }
.game-hero .tag { color: var(--cyan); font-weight: 700; font-size: 1.125rem; margin: 0; }
.game-hero .stores { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 560px) { .game-hero .wrap { grid-template-columns: 1fr; } .game-hero .game-icon { width: 6rem; height: 6rem; } }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); gap: 3rem; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; gap: 1.5rem; } }
.facts { margin: 0; padding: 1.25rem 1.5rem; background: #fff; border: 2px solid #d5e4f0; border-radius: .75rem; align-self: start; }
.facts dt { font-weight: 700; margin-top: .75rem; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0; color: var(--muted); }
.gallery { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gutter) 1rem; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; }
.gallery img { width: min(36rem, 85vw); flex: none; border-radius: .6rem; scroll-snap-align: center; }

/* Footer */
.site-foot { background: var(--space); color: var(--muted-dark); padding: 2.5rem 0; font-size: .95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { color: var(--starlight); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.wrap.prose { max-width: var(--wrap); }
.wrap.prose > * { max-width: 42rem; }
