/* ============================================================
   Spark Plug Games — site styles
   One file, no framework. Tokens first; components below.
   ============================================================ */

:root {
  --red: #9e1b20;
  --red-bright: #c0262c;
  --red-dark: #7a1418;
  --gold: #d9a62a;
  --ink: #1d1f24;
  --ink-soft: #3b3f47;
  --muted: #5b616b;
  --line: #e3e0da;
  --bg: #ffffff;
  --bg-alt: #f6f4f0;
  --dark: #15171b;
  --on-dark: #f3f1ec;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: 2px; }
a:hover { color: var(--red-bright); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }
.section { padding-top: 56px; padding-bottom: 56px; }
.band { background: var(--bg-alt); }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; font-weight: 700; color: var(--red); margin-bottom: .6em; }
.eyebrow a { text-decoration: none; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46em; }
.note { color: var(--muted); font-style: italic; }
.more { font-weight: 600; text-decoration: none; }
.more::after { content: " \2192"; }
.back { margin-top: 2em; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand img { width: 190px; }
.nav-toggle { display: none; }
#site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
#site-nav a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
#site-nav a:hover { background: var(--bg-alt); color: var(--red); }
#site-nav a[aria-current="page"] { color: var(--red); box-shadow: inset 0 -3px 0 var(--gold); border-radius: 0; }

@media (max-width: 900px) {
  .brand img { width: 150px; }
  .js .nav-toggle {
    display: block; font: inherit; font-weight: 600; background: none; border: 1px solid var(--line);
    border-radius: 6px; padding: 6px 14px; color: var(--ink); cursor: pointer;
  }
  .js #site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .js #site-nav.open { display: block; }
  #site-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .header-row { flex-wrap: wrap; }
  html:not(.js) #site-nav ul { flex-direction: row; flex-wrap: wrap; padding: 0 0 8px; }
}

/* ---------- buttons ---------- */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5em 0; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 8px; font-weight: 700; text-decoration: none;
  border: 2px solid var(--red); color: var(--red); background: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--red); color: #fff; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / .7); }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--dark); color: var(--on-dark); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(21 23 27 / .92) 0%, rgb(21 23 27 / .55) 60%, rgb(21 23 27 / .2) 100%); }
.hero-text { position: relative; z-index: 1; padding-top: 56px; padding-bottom: 56px; }
@media (min-width: 700px) { .hero-text { padding-top: 96px; padding-bottom: 96px; } }
.hero h1 { color: #fff; max-width: 14em; }
.hero .lede { color: #dcd8d0; }
.hero .eyebrow { color: var(--gold); }

/* ---------- feature (image + text) ---------- */
.feature { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .feature { grid-template-columns: 1.2fr 1fr; } }
.feature-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.feature h2 a { color: inherit; text-decoration: none; }
.feature h2 a:hover { color: var(--red); }

/* ---------- capability list ---------- */
.capabilities { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.capabilities li { background: #fff; border-radius: var(--radius); padding: 22px; border-top: 4px solid var(--red); box-shadow: var(--shadow); }
.capabilities p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

.clients { list-style: none; padding: 0; margin: 16px 0 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.clients li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 600; color: var(--ink-soft); background: #fff; }

/* ---------- cards ---------- */
.cards { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.card a { display: flex; flex-direction: column; height: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.card a:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(0 0 0 / .08), 0 10px 28px rgb(0 0 0 / .12); }
.card img, .card-placeholder { aspect-ratio: 7 / 4; width: 100%; object-fit: cover; background: var(--dark); }
.card-placeholder { display: grid; place-items: center; color: var(--gold); font-weight: 800; font-size: 2rem; letter-spacing: .1em; background: linear-gradient(135deg, var(--dark), var(--red-dark)); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 18px; }
.card-title { font-weight: 700; color: var(--ink); line-height: 1.3; }
.card a:hover .card-title { color: var(--red); }
.card-meta { font-size: .85rem; color: var(--muted); }
.card-text { font-size: .95rem; color: var(--ink-soft); }

/* ---------- article / case study / game ---------- */
.prose { max-width: 46em; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose figure, .case figure { margin: 2em 0; }
figcaption { font-size: .9rem; color: var(--muted); margin-top: .5em; }
.post { padding-top: 48px; padding-bottom: 64px; }
.byline { color: var(--muted); }
.post-hero { border-radius: var(--radius); margin: 1.5em 0 2em; width: 100%; }

.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 24px 0 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.facts div { background: #fff; padding: 14px 18px; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 600; }

.gallery { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: var(--bg-alt); }
.gallery-portrait { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-width: 900px; }
.gallery-portrait img { aspect-ratio: 1 / 2; object-fit: contain; background: #000; }
.shot { display: block; border-radius: 8px; }
.shot:hover img { opacity: .9; }

.video { position: relative; aspect-ratio: 16 / 9; margin: 32px 0; max-width: 46em; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }

.cta { background: var(--dark); color: var(--on-dark); border-radius: var(--radius); padding: 32px; margin-top: 48px; border-left: 6px solid var(--gold); }
.cta h2 { color: #fff; margin-top: 0; }
.cta p { color: #d6d2ca; }

.earlier { margin-top: 40px; }
.earlier h3 { font-size: 1.3rem; }
.earlier > p { max-width: 46em; color: var(--ink-soft); }

/* ---------- lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.lightbox::backdrop { background: rgb(10 10 12 / .88); }
.lightbox img { max-width: 92vw; max-height: 84vh; width: auto; border-radius: 6px; margin: 0 auto; }
.lightbox p { color: #e9e6df; text-align: center; margin: 10px auto 0; max-width: 60em; font-size: .95rem; }
.lightbox button { position: fixed; background: rgb(0 0 0 / .55); color: #fff; border: 1px solid rgb(255 255 255 / .3); border-radius: 999px; width: 44px; height: 44px; font-size: 22px; cursor: pointer; }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 12px; top: 50%; }
.lightbox .lb-next { right: 12px; top: 50%; }

/* ---------- contact ---------- */
.contact { display: grid; gap: 40px; }
@media (min-width: 860px) { .contact { grid-template-columns: 1fr 1.2fr; } }
.contact-form label { display: block; font-weight: 700; margin-bottom: 4px; }
.contact-form input, .contact-form textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #c9c5bd; border-radius: 8px; background: #fff; color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--red); outline: 3px solid rgb(217 166 42 / .45); outline-offset: 0; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: 8px 0 16px; min-height: 65px; }
.form-status { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.form-status.ok { background: #e9f5ec; color: #1d5b2e; border: 1px solid #b7dcc1; }
.form-status.err { background: #fbeaea; color: var(--red-dark); border: 1px solid #efc1c1; }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: #c9c5bd; margin-top: 0; }
.footer-row { display: grid; gap: 8px 40px; padding-top: 40px; padding-bottom: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); font-size: .95rem; }
.site-footer strong { color: #fff; }
.site-footer a { color: #f0d48a; }
.copyright { grid-column: 1 / -1; border-top: 1px solid #2c2f36; padding-top: 16px; margin: 8px 0 0; font-size: .85rem; color: #8f8b84; }

/* ---------- 404 runner ---------- */
.game404 { text-align: center; padding-top: 40px; padding-bottom: 56px; }
.game404 h1 { margin-bottom: .2em; }
.game404 .lede { margin: 0 auto 24px; }
.runner { position: relative; max-width: 760px; margin: 0 auto 16px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--dark); }
.runner canvas { display: block; width: 100%; height: auto; aspect-ratio: 760 / 260; cursor: pointer; touch-action: manipulation; }
.runner-help { color: var(--muted); font-size: .92rem; }
.game404 nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 24px 0 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
