/* GemRogue website. Palette follows ART_DIRECTION.md: violet-black stone,
   warm gold for frames and primary actions, indigo-violet for secondary,
   pale ivory / lavender text, and the five element colors. */
:root {
  --stone: #120b1c;
  --stone-2: #1c1329;
  --panel: rgba(24, 16, 36, 0.88);
  --gold: #e8b04a;
  --gold-hi: #ffd98a;
  --gold-lo: #9a6a22;
  --violet: #5b4a9a;
  --violet-hi: #8a78d0;
  --ivory: #f3ead8;
  --lavender: #c9bfe6;
  --muted: #9a90b4;
  --fire: #e2504a;
  --water: #3f8ef0;
  --earth: #3fae6a;
  --light: #f0b43a;
  --dark: #9a5be0;
  --radius: 4px;
  --max: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--stone);
  color: var(--ivory);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The painted cave from the title screen, held behind everything. A fixed
   pseudo-element instead of background-attachment: fixed, which iOS ignores. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(18, 11, 28, 0.35) 0%, rgba(18, 11, 28, 0.82) 55%, rgba(18, 11, 28, 0.94) 100%),
    url("/img/cave.webp") center top / cover no-repeat;
}

img { max-width: 100%; height: auto; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

a { color: var(--gold-hi); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--gold); color: #1a1008; padding: 8px 14px; z-index: 10;
}
.skip:focus { left: 8px; }

.wrap { width: min(var(--max), 100% - 40px); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(14, 9, 22, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(232, 176, 74, 0.35);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; }
.brand .brand-icon { width: 32px; height: 32px; border-radius: 7px; }
.brand .brand-word { width: 153px; height: 26px; }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  color: var(--lavender); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 4px 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold-hi); }
@media (max-width: 560px) {
  .brand .brand-word { display: none; }
  .site-nav { gap: 4px 14px; flex-wrap: nowrap; }
  .site-nav a { font-size: 14px; }
}
@media (max-width: 380px) {
  .site-nav a[href$="#play"] { display: none; }
}

/* Hero */
.hero { text-align: center; padding: 72px 0 48px; }
.hero-logo { width: min(612px, 88vw); height: auto; display: block; margin: 0 auto 22px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35)); }
.tagline { font-size: clamp(20px, 3.2vw, 26px); color: var(--ivory); margin: 0 0 6px; font-weight: 600; }
.subtag { color: var(--lavender); margin: 0 auto 30px; max-width: 34em; }
.gem-row { display: flex; justify-content: center; gap: clamp(10px, 3vw, 26px); margin: 0 0 34px; }
.gem-row img { width: clamp(36px, 7vw, 56px); height: auto; animation: bob 3.2s ease-in-out infinite; }
.gem-row img:nth-child(2) { animation-delay: -0.6s; }
.gem-row img:nth-child(3) { animation-delay: -1.2s; }
.gem-row img:nth-child(4) { animation-delay: -1.8s; }
.gem-row img:nth-child(5) { animation-delay: -2.4s; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* Store buttons */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 220px; padding: 10px 20px;
  background: #0b0710; color: #fff; text-decoration: none; text-align: left;
  border: 2px solid rgba(255, 255, 255, 0.75); border-radius: 10px;
  line-height: 1.2;
}
.store:hover { border-color: var(--gold-hi); color: #fff; }
.store svg { width: 28px; height: 28px; flex: none; fill: currentColor; }
.store small { display: block; font-size: 12px; color: #d8d2e6; }
.store strong { display: block; font-size: 19px; }
.store[aria-disabled="true"] { opacity: 0.7; cursor: default; border-style: dashed; }
.store[aria-disabled="true"]:hover { border-color: rgba(255, 255, 255, 0.75); }
.stores-note { color: var(--muted); font-size: 15px; margin: 14px 0 0; }

/* Sections and panels */
section { padding: 56px 0; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 14px; }
h2 {
  font-size: clamp(26px, 4vw, 34px); color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.06em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
}
.section-lead { color: var(--lavender); max-width: 40em; margin: 0 0 28px; }
.center { text-align: center; }
.center .section-lead { margin-inline: auto; }

/* A dark stone panel with a gold rim, like the game's plaques. */
.panel {
  background: var(--panel);
  padding: 22px;
  border: 2px solid rgba(232, 176, 74, 0.6);
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 217, 138, 0.12), 0 10px 24px rgba(0, 0, 0, 0.35);
}

/* Features */
.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature img { width: 48px; height: 48px; flex: none; margin-top: 2px; }
.feature h3 { font-size: 19px; color: var(--ivory); margin-bottom: 6px; }
.feature p { margin: 0; color: var(--lavender); font-size: 16px; }

/* Elements */
.elements { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 18px; }
.element { text-align: center; padding: 18px 14px; }
.element img { width: 56px; height: 56px; }
.element h3 { font-size: 18px; margin: 8px 0 4px; }
.element p { margin: 0; font-size: 15px; color: var(--lavender); }
.element.fire h3 { color: var(--fire); }
.element.water h3 { color: var(--water); }
.element.earth h3 { color: var(--earth); }
.element.light h3 { color: var(--light); }
.element.dark h3 { color: var(--dark); }

/* Screenshot gallery: a scroll-snapped row of phone frames. */
.gallery {
  display: flex; gap: 18px; overflow-x: auto; padding: 6px 4px 18px;
  scroll-snap-type: x mandatory; scrollbar-color: var(--gold-lo) transparent;
}
.gallery figure { margin: 0; flex: 0 0 auto; scroll-snap-align: center; text-align: center; }
.gallery img {
  display: block; width: 200px; height: 375px; object-fit: cover;
  border-radius: 18px; border: 3px solid #2a1f3c;
  box-shadow: 0 0 0 2px rgba(232, 176, 74, 0.45), 0 14px 30px rgba(0, 0, 0, 0.5);
}
.gallery figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }
/* Centered when everything fits, still scrollable from the first shot when not. */
.gallery figure:first-child { margin-left: auto; }
.gallery figure:last-child { margin-right: auto; }

/* Heroes */
.heroes { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.hero-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 16px 20px; }
.hero-card img { width: 160px; height: 240px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55)); }
.hero-card h3 { font-size: 19px; color: var(--gold-hi); margin: 10px 0 6px; }
.hero-card p { margin: 0; font-size: 15px; color: var(--lavender); }

/* Community */
.links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; font-weight: 700; font-size: 17px; text-decoration: none;
  border-radius: var(--radius);
  color: #1a1008;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, #c98a2a);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 3px 0 #5a3c12;
}
.btn:hover { color: #1a1008; filter: brightness(1.08); }
.btn svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.btn.secondary {
  color: var(--ivory);
  background: linear-gradient(180deg, var(--violet-hi), var(--violet) 55%, #3d2f6e);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 3px 0 #221a40;
}
.btn.secondary:hover { color: #fff; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: default; filter: none; }

/* Document pages (privacy, terms, support) */
.doc { padding: 48px 0 64px; }
.doc .panel { padding: clamp(22px, 4vw, 40px); }
.doc h1 { font-size: clamp(28px, 5vw, 38px); color: var(--gold); }
.doc h2 { font-size: 22px; text-transform: none; letter-spacing: 0; margin-top: 28px; }
.doc p, .doc li { color: var(--lavender); }
.doc .updated { color: var(--muted); font-size: 15px; }
.notice {
  border-left: 4px solid var(--gold); background: rgba(232, 176, 74, 0.08);
  padding: 14px 18px; color: var(--ivory); margin: 18px 0;
}
/* Policy text (built from Termly's export by tools/build_policies.py). */
.policy { color: var(--lavender); font-size: 16px; overflow-wrap: anywhere; }
.policy h2 { font-size: 20px; color: var(--gold); margin: 36px 0 12px; text-transform: none; letter-spacing: 0; scroll-margin-top: 80px; }
.policy h3 { font-size: 17px; color: var(--ivory); margin: 22px 0 8px; }
.policy p, .policy li { margin: 0 0 12px; }
.policy ul { padding-left: 22px; margin: 0 0 14px; }
.policy strong { color: var(--ivory); }
.policy table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 15px; }
.policy th, .policy td { border: 1px solid rgba(201, 191, 230, 0.25); padding: 8px 10px; text-align: left; vertical-align: top; }
.policy th { color: var(--ivory); background: rgba(255, 255, 255, 0.04); }
.policy [id] { scroll-margin-top: 80px; }
.policy-credit { margin-top: 32px; font-size: 14px; color: var(--muted); }

details { border-bottom: 1px solid rgba(201, 191, 230, 0.18); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--ivory); }
details p { margin: 10px 0 0; }

/* Footer */
.site-footer {
  border-top: 2px solid rgba(232, 176, 74, 0.3);
  background: rgba(10, 6, 16, 0.9);
  padding: 30px 0 40px; margin-top: 24px; font-size: 15px; color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 30px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--lavender); text-decoration: none; }
.site-footer a:hover { color: var(--gold-hi); }
.site-footer p { margin: 0; }
