/* Diamond Digger website: dark cave, pixel headings, readable body text. Mobile first. */
@font-face {
  font-family: 'Press Start 2P';
  src: url('fonts/PressStart2P-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #05070d;
  --bg-2: #0b1328;
  --panel: #121c38;
  --panel-2: #18244a;
  --edge: #2b3d6b;
  --text: #e8ecf6;
  --dim: #a3aecb;
  --orange: #ff9a1c;
  --orange-dark: #c25e00;
  --gold: #ffd34a;
  --cyan: #3fd7ff;
  --green: #5cff8a;
  --red: #ff5a4a;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 10px;
  --gutter: 16px;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
.pixel, .pixel img { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--cyan); }
a:hover { color: #9ff0ff; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #1b1206; padding: 8px 12px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.35; letter-spacing: 0.02em; }
h2 { font-size: clamp(18px, 4.2vw, 28px); color: var(--gold); margin: 0 0 16px; text-shadow: 0 3px 0 #000; }
h3 { font-size: 13px; color: var(--text); margin: 0 0 10px; }
.kicker { font-family: var(--pixel); font-size: 11px; color: var(--cyan); letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 12px; }
.lede { font-size: clamp(17px, 2.4vw, 20px); color: var(--text); max-width: 60ch; }
.muted { color: var(--dim); }
.center { text-align: center; }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-intro { color: var(--dim); max-width: 62ch; margin: 0 0 32px; }
.section-alt { background: var(--bg-2); }
.section-tight { padding: 28px 0; }
.narrow { width: min(860px, 100% - 2 * var(--gutter)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center .section-intro { margin-inline: auto; }

/* ---------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 7, 13, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(43, 61, 107, 0.6);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 88px; }
.nav { display: none; gap: 22px; align-items: center; }
.nav a { color: var(--dim); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }
@media (min-width: 860px) { .nav { display: flex; } }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--pixel); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 14px 18px; border-radius: 8px; text-decoration: none; cursor: pointer;
  border: 3px solid var(--orange-dark); background: var(--orange); color: #1b1206;
  box-shadow: 0 4px 0 #000;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { color: #1b1206; transform: translateY(-1px); box-shadow: 0 5px 0 #000; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.btn-small { padding: 10px 12px; font-size: 10px; }
.btn-ghost { background: var(--panel); border-color: var(--edge); color: var(--text); }
.btn-ghost:hover { color: var(--text); }

.stores { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 12px; }
.store-soon {
  display: inline-flex; flex-direction: column; gap: 4px; min-width: 160px;
  padding: 12px 16px; border-radius: 10px; border: 2px solid var(--edge); background: var(--panel);
}
.store-soon b { font-family: var(--pixel); font-size: 10px; color: var(--gold); letter-spacing: 0.06em; }
.store-soon span { font-size: 16px; font-weight: 600; }
.store-badge img { height: 54px; width: auto; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--dim); font-size: 14px; padding: 0; margin: 8px 0 0; list-style: none; }
.trust li::before { content: '\25C6\00A0'; color: var(--cyan); }

/* ---------- hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 7vw, 88px);
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: url('/assets/cave-wide.webp?v=69addb5b') center 30% / cover no-repeat;
  image-rendering: pixelated;
  filter: saturate(1.1);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.55) 0%, rgba(5, 7, 13, 0.82) 55%, var(--bg) 100%);
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; } }
.hero h1 { margin: 0 0 18px; }
.hero h1 img { width: min(440px, 100%); filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.6)); }
.hero .kicker { font-size: 12px; }

/* ---------- phone frames */
.phone {
  position: relative; margin-inline: auto; width: min(300px, 78vw);
  border-radius: 34px; padding: 10px; background: #0d1222;
  border: 3px solid #26355f; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px #000 inset;
}
.phone img { border-radius: 26px; width: 100%; aspect-ratio: 1320 / 2868; object-fit: cover; background: #05070d; }
.phone-land { width: min(560px, 92vw); border-radius: 28px; }
.phone-land img { aspect-ratio: 2868 / 1320; border-radius: 20px; }

/* ---------- Digby running along the dirt */
.runway { position: relative; height: 150px; margin-top: 8px; overflow: hidden; }
.runway::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: url('/assets/sprites/dirt.png?v=f74b726f') 0 0 / 48px 48px repeat-x; image-rendering: pixelated; }
.runway .anim-digby { position: absolute; bottom: 40px; left: -100px; animation: frames var(--t) steps(var(--n)) infinite, cross 10s linear infinite; }
.runway .anim-diamond { --s: 48px; position: absolute; bottom: 48px; }
.runway .gem-1 { left: 22%; }
.runway .gem-2 { left: 55%; animation-delay: -0.3s; }
.runway .gem-3 { left: 83%; animation-delay: -0.6s; }

/* ---------- at a glance */
.glance { background: var(--bg-2); border-block: 1px solid #16213f; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: #16213f; border-radius: var(--radius); overflow: hidden; margin: 0; }
@media (min-width: 980px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts div { background: var(--bg-2); padding: 16px 14px; font-size: 15px; }
@media (min-width: 640px) { .facts div { padding: 18px; font-size: 17px; } }
.facts dt { font-family: var(--pixel); font-size: 10px; color: var(--cyan); margin-bottom: 8px; text-transform: uppercase; }
.facts dd { margin: 0; color: var(--text); }

/* ---------- cards */
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--edge); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.45);
}
.card p { margin: 0; color: var(--dim); font-size: 16px; }
.steps { list-style: none; padding: 0; margin: 0; }
.card .anim, .card .sprite { margin: -8px 0 10px -8px; }
.step-n { font-family: var(--pixel); font-size: 10px; color: var(--orange); display: block; margin-bottom: 10px; }
/* Sprite strips: --n frames side by side, shown --s pixels square, stepped with CSS.
   Creature frames are 48 px and Digby's 64 px, so 96 px keeps whole pixels on 2x and 3x screens. */
.anim {
  --s: 96px; --n: 6; --t: 1s;
  width: var(--s); height: var(--s); flex: none;
  background-repeat: no-repeat; background-size: calc(var(--s) * var(--n)) var(--s);
  image-rendering: pixelated;
  animation: frames var(--t) steps(var(--n)) infinite;
}
.anim-digby { --n: 12; --t: 0.5s; background-image: url('/assets/sprites/digby-run.png?v=eb8b539f'); }
.anim-idle { --n: 6; --t: 0.9s; background-image: url('/assets/sprites/digby-idle.png?v=380c0e02'); }
.anim-diamond { --n: 6; --t: 0.9s; background-image: url('/assets/sprites/diamond.png?v=3b9c6947'); }
.anim-bat { --n: 12; --t: 0.8s; background-image: url('/assets/sprites/bat.png?v=0e745f7e'); }
.anim-firefly { --n: 12; --t: 0.7s; background-image: url('/assets/sprites/firefly.png?v=b64b0a43'); }
.anim-moth { --n: 6; --t: 0.5s; background-image: url('/assets/sprites/moth.png?v=ec5dc437'); }
.anim-keg { --n: 6; --t: 0.4s; background-image: url('/assets/sprites/keg-lit.png?v=e68e4c1f'); }
.sprite { width: 96px; height: 96px; image-rendering: pixelated; flex: none; }

/* ---------- creature list */
.bestiary { display: grid; gap: 14px; }
@media (min-width: 720px) { .bestiary { grid-template-columns: repeat(2, 1fr); } }
.beast { display: flex; gap: 16px; align-items: center; background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius); padding: 14px 18px 14px 10px; }
.beast h3 { margin-bottom: 6px; }
.beast p { margin: 0; color: var(--dim); font-size: 15px; }

/* ---------- deep mine */
.deep { background: radial-gradient(1200px 500px at 50% 0%, #1a1036 0%, var(--bg) 65%); }
.deep-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 980px) { .deep-grid { grid-template-columns: 1fr 1fr; } }
.deep-shots { display: flex; gap: 16px; justify-content: center; }
.deep-shots .phone { width: min(240px, 44vw); }
.bestiary-1 { grid-template-columns: 1fr !important; }
.keys { display: flex; flex: none; }
.keys .sprite { width: 56px; height: 56px; }
.keys .sprite + .sprite { margin-left: -6px; }
.tag { display: inline-block; font-family: var(--pixel); font-size: 9px; padding: 6px 8px; border-radius: 6px; background: #2a1650; color: #e0c8ff; border: 1px solid #5b3aa0; margin-bottom: 12px; }

/* ---------- screenshots */
.gallery { display: flex; align-items: center; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px var(--gutter) 22px; margin-inline: calc(-1 * var(--gutter)); }
.gallery figure { flex: 0 0 auto; scroll-snap-align: center; margin: 0; }
.gallery .phone { width: 240px; }
.gallery .phone-land { width: 520px; }
.gallery figcaption { text-align: center; color: var(--dim); font-size: 14px; margin-top: 12px; }

/* ---------- download */
.download { text-align: center; background: linear-gradient(180deg, var(--bg) 0%, #120c05 100%); }
.download .stores { justify-content: center; }
.download .section-intro { margin-inline: auto; }
.download .anim-idle { --s: 128px; margin: 0 auto 8px; }

/* ---------- faq */
.faq details { background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius); margin-bottom: 12px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--pixel); color: var(--orange); }
.faq details[open] summary::after { content: '\2013'; }
.faq details > div { padding: 0 20px 18px; color: var(--dim); }
.faq details > div p { margin: 0 0 10px; }

/* ---------- legal pages */
.legal { padding: 48px 0 80px; }
.legal .wrap { width: min(820px, 100% - 2 * var(--gutter)); }
.legal h1 { font-size: clamp(20px, 4.5vw, 30px); color: var(--gold); margin: 0 0 12px; }
.legal h2 { font-size: 15px; color: var(--text); margin: 36px 0 12px; text-shadow: none; }
.legal p, .legal li { color: #ccd3e6; }
.legal li { margin-bottom: 6px; }
.legal .summary { background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius); padding: 18px 22px; margin: 24px 0; }
.legal .summary h2 { margin-top: 0; }
.legal nav.toc { background: var(--bg-2); border-radius: var(--radius); padding: 14px 20px; margin: 20px 0; }
.legal nav.toc ol { margin: 0; padding-left: 20px; columns: 2 240px; }
.breadcrumb { font-size: 14px; color: var(--dim); margin-bottom: 18px; }
.breadcrumb a { color: var(--dim); }

/* ---------- footer */
.site-footer { border-top: 1px solid #16213f; padding: 36px 0 44px; background: #04060b; color: var(--dim); font-size: 15px; }
.site-footer .wrap { display: grid; gap: 18px; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: auto 1fr auto; align-items: center; } }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer nav a { color: var(--text); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.whatif { margin: 0; }
.whatif a { color: var(--gold); }
.fineprint { grid-column: 1 / -1; font-size: 13px; margin: 0; color: #6f7a98; }

/* ---------- animation */
@keyframes frames { to { background-position-x: calc(var(--s) * var(--n) * -1); } }
@keyframes cross { from { left: -100px; } to { left: calc(100% + 100px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .runway .anim-digby { left: 40%; }
}

/* ---------- 404 */
.lost h1 { font-size: clamp(22px, 5vw, 34px); color: var(--gold); }
.lost .anim-idle { --s: 128px; margin: 0 auto 12px; }
