/* South Pixel Studio: shared styles. Dark by default (matches the games), light when the device asks for it. */

@font-face {
  font-family: "Russo One";
  src: url("../fonts/russo-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --bg: #1b2230;
  --panel: #252d3d;
  --panel-2: #2e3749;
  --line: #3a4459;
  --text: #e8ebf1;
  --muted: #a3acbd;
  --accent: #fac775;      /* amber / gold */
  --accent-ink: #1b2230;
  --action: #4ca83c;      /* green buttons */
  --action-ink: #ffffff;
  --info: #5ad1e6;        /* cyan highlights */
  --warn: #e5534b;
  --radius: 10px;
  --wrap: 68rem;
  --display: "Russo One", "Arial Black", Impact, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f1ec;
    --panel: #ffffff;
    --panel-2: #ebe8e1;
    --line: #d6d1c6;
    --text: #1b2230;
    --muted: #535d70;
    --accent: #9a6410;
    --accent-ink: #ffffff;
    --action: #2f7d24;
    --info: #0f7486;
    --warn: #b42318;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a { color: var(--info); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 7vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.9rem); color: var(--accent); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0; }

/* Header / footer */

.site-header {
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.25rem; padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-size: 1.1rem; color: var(--text); text-decoration: none;
}
.brand img { width: auto; height: 32px; }
@media (prefers-color-scheme: light) {
  .brand img { filter: brightness(0.62) saturate(1.5); } /* pale gold is too faint on white */
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.site-footer {
  margin-top: 3rem;
  background: var(--panel);
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem;
  padding-top: 1.25rem; padding-bottom: 1.25rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* Sections */

.section { padding: 2.5rem 0 0; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.eyebrow {
  display: inline-block; font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--info); margin-bottom: 0.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* Home: project cards */

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 0.75rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; color: var(--text); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
a.card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: 0.9rem; }
.card-head img { width: 64px; height: 64px; border-radius: 14px; }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card .more { margin-top: auto; color: var(--accent); font-weight: 700; }
.card.planned { border-style: dashed; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.tag {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--panel-2); color: var(--muted);
}
.tag.live { background: var(--action); color: var(--action-ink); }
.tag.dev { background: var(--accent); color: var(--accent-ink); }

/* Game page */

.hero {
  position: relative; overflow: hidden;
  border-bottom: 2px solid var(--line);
  background: var(--bg);
}
.hero-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.28;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 92%);
}
.hero .wrap { position: relative; z-index: 1; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.hero-main { display: flex; flex-direction: column; gap: 1rem; max-width: 36rem; }
.app-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.35); }
.pitch { font-size: 1.2rem; margin: 0; }
.hero-phone { display: none; }

@media (min-width: 52rem) {
  .hero-art { display: none; }
  .hero::after { display: none; }
  .hero .wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3rem; }
  .hero-phone {
    display: block; width: 260px; aspect-ratio: 9 / 16; object-fit: cover;
    border-radius: 28px; border: 6px solid var(--panel-2); box-shadow: 0 20px 50px rgb(0 0 0 / 0.4);
  }
}

/* Store buttons. An empty href (or an unfilled {{...}} placeholder) shows as "Coming soon". */

.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-width: 11rem; min-height: 3.25rem; padding: 0.45rem 1.1rem;
  border-radius: var(--radius); background: var(--action); color: var(--action-ink);
  text-decoration: none; line-height: 1.2; box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.25);
}
.store:hover { color: var(--action-ink); filter: brightness(1.08); }
.store small { font-size: 0.72rem; opacity: 0.9; }
.store strong { font-size: 1.05rem; }
.store[href=""], .store[href^="{{"], .store:not([href]) {
  background: var(--panel-2); color: var(--muted); pointer-events: none; box-shadow: none;
}
.store[href=""] small, .store[href^="{{"] small, .store:not([href]) small { font-size: 0; }
.store[href=""] small::before, .store[href^="{{"] small::before, .store:not([href]) small::before {
  content: "Coming soon to"; font-size: 0.72rem;
}

.status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; color: var(--accent);
}
.status::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--action); }

/* Screenshots: swipe sideways on phones */

.gallery {
  display: flex; gap: 0.9rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0.25rem 1rem 1rem; margin: 0 -1rem; list-style: none;
  scrollbar-width: thin;
}
.gallery li { flex: 0 0 auto; scroll-snap-align: center; }
.gallery img {
  width: min(62vw, 220px); aspect-ratio: 1080 / 2340; object-fit: cover;
  border-radius: 18px; border: 4px solid var(--panel-2);
}

.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.features h3 { color: var(--info); }
.features p { margin: 0; color: var(--muted); }

.currencies { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.currencies li { font-size: 0.85rem; padding: 0.2rem 0.6rem; border-radius: 6px; background: var(--panel-2); }

.callout {
  border-left: 4px solid var(--accent);
  background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
}
.callout p:last-child { margin: 0; }

/* Long-form docs: privacy, support */

.doc { max-width: 46rem; }
.doc h1 { margin-top: 2rem; }
.doc h2 { margin-top: 2rem; font-size: 1.35rem; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.4rem; }
.doc .meta { color: var(--muted); font-size: 0.95rem; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); }
.doc th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.path { font-weight: 700; color: var(--accent); white-space: nowrap; }

.faq details {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 0.6rem;
}
.faq summary {
  cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-family: var(--display); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 1.1rem 0.9rem; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

.contact-box { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.contact-box p { margin: 0; }
.button {
  display: inline-block; padding: 0.7rem 1.3rem; border-radius: var(--radius);
  background: var(--action); color: var(--action-ink); font-weight: 700; text-decoration: none;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.25);
}
.button:hover { color: var(--action-ink); filter: brightness(1.08); }

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

/* Icon tile for projects without an app icon yet */
.card-icon {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 14px; background: var(--panel-2);
}
.card-icon svg { width: 34px; height: 34px; fill: var(--accent); }
.card-icon .hole { fill: var(--panel-2); }
