/* Gemula Studios — shared styles. Per-game themes override the accent tokens via body class. */
@font-face { font-family: "Silkscreen"; src: url("fonts/silkscreen.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("fonts/silkscreen-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "VT323"; src: url("fonts/vt323.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #0f1412;
  --bg-2: #161d1a;
  --panel: #1b2420;
  --line: #2e3d35;
  --text: #eef0e6;
  --muted: #a9b4a2;
  --accent: #3fd6b4;   /* gem teal */
  --accent-2: #a9b86a; /* leaf */
  --on-accent: #0c1512;
  --nav-h: 64px;
  --pixel: "Silkscreen", "Courier New", monospace;
  --body: "VT323", "Courier New", monospace;
}
body.theme-wildsnap { --accent: #e8b04a; --accent-2: #8fb15a; --on-accent: #1d1508; --bg: #11150f; --bg-2: #181e15; --panel: #1f271b; --line: #34412b; }
body.theme-alchemy { --accent: #c99bff; --accent-2: #f2c46b; --on-accent: #1a0f26; --bg: #120f1a; --bg-2: #1a1524; --panel: #221b2f; --line: #3a2f4f; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 22px;
  line-height: 1.4;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
.pixelated, .pixelated img { image-rendering: pixelated; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--pixel); font-weight: 700; line-height: 1.15; margin: 0 0 16px; }
h2 { font-size: clamp(24px, 4vw, 34px); }
h3 { font-size: 18px; }
p { margin: 0 0 14px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 92%, transparent); box-shadow: 0 2px 0 var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--pixel); font-size: 16px; }
.brand img { width: 40px; height: 40px; image-rendering: pixelated; }
.nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.nav a.link {
  font-family: var(--pixel); font-size: 13px; color: var(--text); text-decoration: none;
  padding: 8px 12px; border: 2px solid transparent; display: block;
}
.nav a.link:hover, .nav a.link.active { border-color: var(--accent); color: var(--accent); }
.burger { display: none; background: none; border: 2px solid var(--text); color: var(--text); font-family: var(--pixel); padding: 6px 10px; cursor: pointer; }
@media (max-width: 820px) {
  .burger { display: block; }
  .nav ul {
    position: absolute; top: var(--nav-h); right: 0; left: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 2px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav.open ul { max-height: 420px; }
  .nav.open { background: var(--bg); }
  .nav a.link { padding: 14px 20px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; place-items: center; text-align: center;
  overflow: hidden; padding: calc(var(--nav-h) + 24px) 16px 64px;
}
.hero-bg {
  position: absolute; inset: -10% 0 0 0; height: 120%;
  background-size: cover; background-position: center; image-rendering: pixelated;
  will-change: transform;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,.15) 40%, var(--bg) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 820px; }
.hero .logo { width: clamp(120px, 22vw, 192px); margin: 0 auto; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4)); animation: float 4s ease-in-out infinite; }
.hero .wordmark { width: clamp(200px, 40vw, 342px); margin: 10px auto 2px; image-rendering: pixelated; }
.hero .kicker { font-family: var(--pixel); letter-spacing: .35em; color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.hero .eyebrow { display: inline-block; background: rgba(0,0,0,.6); padding: 6px 10px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(36px, 8vw, 72px); text-shadow: 4px 4px 0 rgba(0,0,0,.55); margin-bottom: 10px; }
.hero .tagline { font-size: clamp(22px, 3vw, 28px); text-shadow: 2px 2px 0 rgba(0,0,0,.6); max-width: 680px; margin: 0 auto 26px; }
.scroll-hint {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-family: var(--pixel); font-size: 12px; color: var(--muted); text-decoration: none; animation: bob 1.8s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ---------- Buttons ---------- */
.btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-size: 14px; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--on-accent); border: 0; padding: 12px 20px;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 50%, #000), 0 0 0 3px #0008;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 50%, #000), 0 0 0 3px #0008; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 50%, #000), 0 0 0 3px #0008; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 3px var(--text); }
.btn.steam { background: #1b2838; color: #c7d5e0; box-shadow: 0 4px 0 #0b121b, 0 0 0 3px #66c0f4; }
.btn.disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }

/* ---------- Sections ---------- */
section.block { padding: clamp(64px, 10vw, 120px) clamp(16px, 5vw, 48px); }
section.block.alt { background: var(--bg-2); }
.wrap { max-width: 1100px; margin: 0 auto; }
.lead { font-size: clamp(22px, 2.6vw, 26px); color: var(--muted); max-width: 760px; }
.eyebrow { font-family: var(--pixel); font-size: 12px; letter-spacing: .25em; color: var(--accent); margin-bottom: 10px; display: block; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Game cards (home) ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; margin-top: 36px; }
.game-card {
  position: relative; display: block; text-decoration: none; color: var(--text);
  aspect-ratio: 16 / 10; overflow: hidden; border: 3px solid var(--line);
  box-shadow: 8px 8px 0 #0007;
  transition: transform .25s, border-color .25s;
}
.game-card img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform .6s ease; }
.game-card:hover { transform: translateY(-6px); border-color: var(--card-accent, var(--accent)); }
.game-card:hover img { transform: scale(1.06); }
.game-card .info {
  position: absolute; inset: auto 0 0 0; padding: 22px 20px 18px;
  background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,0));
}
.game-card h3 { font-size: 22px; margin-bottom: 6px; color: var(--card-accent, var(--accent)); }
.game-card p { margin: 0; font-size: 20px; }
.badge {
  position: absolute; top: 14px; left: 14px; font-family: var(--pixel); font-size: 11px;
  background: var(--card-accent, var(--accent)); color: #111; padding: 5px 9px;
}

/* ---------- Studio / values ---------- */
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.framed { border: 3px solid var(--line); box-shadow: 8px 8px 0 #0007; image-rendering: pixelated; }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 40px; }
.value { background: var(--panel); border: 2px solid var(--line); padding: 22px; }
.value .ico { font-family: var(--pixel); color: var(--accent); font-size: 26px; margin-bottom: 8px; }

/* ---------- Team roles ---------- */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin-top: 36px; }
.role {
  background: var(--panel); border: 2px solid var(--line); padding: 24px 22px;
  position: relative; transition: transform .25s, border-color .25s;
}
.role:hover { transform: translateY(-4px); border-color: var(--accent); }
.role .avatar {
  width: 72px; height: 72px; margin-bottom: 14px; background: var(--bg-2); border: 2px solid var(--line);
  display: grid; place-items: center; image-rendering: pixelated; overflow: hidden;
}
.role .avatar img { width: 100%; height: 100%; object-fit: contain; }
.role .title { font-family: var(--pixel); font-size: 12px; color: var(--accent); letter-spacing: .12em; }
.role h3 { margin: 6px 0 10px; }
.role p { font-size: 20px; color: var(--muted); margin: 0; }

/* ---------- Game page: features ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 36px; }
.feature { background: var(--panel); border-left: 4px solid var(--accent); padding: 20px 22px; }
.feature h3 { color: var(--accent); }
.feature p { margin: 0; font-size: 20px; }

/* ---------- Trailer (two-click) ---------- */
.video {
  position: relative; aspect-ratio: 16 / 9; background: #000 center / cover; border: 3px solid var(--line);
  box-shadow: 8px 8px 0 #0007; margin-top: 30px; overflow: hidden; image-rendering: pixelated;
}
.video::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; background: #000; }
.video.has-file::before { display: none; }
.video .consent { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 20px; }
.video .play {
  width: 84px; height: 84px; background: var(--accent); border: 0; cursor: pointer;
  clip-path: polygon(0 0, 100% 50%, 0 100%); transition: transform .2s;
}
.video .play:hover { transform: scale(1.1); }
.video small { font-size: 18px; color: var(--muted); max-width: 520px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 30px; }
.gallery button { padding: 0; border: 3px solid var(--line); background: none; cursor: zoom-in; aspect-ratio: 16 / 9; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform .4s; }
.gallery button:hover img { transform: scale(1.05); }
.gallery button:hover { border-color: var(--accent); }
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: none;
  place-items: center; padding: 16px; cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-height: 90vh; width: auto; image-rendering: pixelated; border: 3px solid var(--line); }

/* ---------- Steam ---------- */
.steam-box {
  margin-top: 30px; background: #1b2838; border: 3px solid #2a475e; padding: 26px;
  display: grid; gap: 18px; grid-template-columns: 1fr auto; align-items: center; color: #c7d5e0;
}
.steam-box h3 { color: #fff; margin-bottom: 6px; }
.steam-box p { margin: 0; font-size: 20px; }
.steam-widget { grid-column: 1 / -1; }
.steam-widget iframe { width: 100%; height: 190px; border: 0; }
@media (max-width: 640px) { .steam-box { grid-template-columns: 1fr; } }

/* ---------- Status bar ---------- */
.facts { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }
.fact { font-family: var(--pixel); font-size: 11px; background: rgba(0,0,0,.55); border: 2px solid var(--accent); padding: 7px 11px; }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; }
.contact .lead { margin: 0 auto 26px; }
footer {
  background: #080a09; border-top: 2px solid var(--line); padding: 34px 16px; text-align: center;
  font-size: 18px; color: var(--muted);
}
footer nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; font-family: var(--pixel); font-size: 12px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ---------- Legal page ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: calc(var(--nav-h) + 48px) 16px 80px; }
.legal h1 { color: var(--accent); font-size: 30px; }
.legal h2 { font-size: 16px; margin-top: 32px; color: var(--accent-2); }
.legal p { font-size: 21px; }

/* back to top */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 46px; height: 46px;
  background: var(--accent); color: var(--on-accent); border: 0; font-family: var(--pixel); font-size: 18px; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .3s; box-shadow: 0 4px 0 #0008;
}
.to-top.show { opacity: 1; pointer-events: auto; }
