/* Spirit Runner site: system fonts only, no cookies, no third-party requests. */

:root {
  color-scheme: light dark;
  --paper: #fbf1e1;
  --card: #fffaf2;
  --ink: #2b1a10;
  --ink-soft: #64493a;
  --line: #ead6b6;
  --accent: #b8461a;
  --tint: #fbe2bd;
  --dusk: #2a1638;
  --dusk-ink: #fbeedd;
  --shadow: 0 10px 28px rgba(70, 35, 10, 0.12);
  --radius: 18px;
  --head: Rockwell, "Rockwell Nova", "Roboto Slab", "Noto Serif", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1020;
    --card: #24172d;
    --ink: #f7ead8;
    --ink-soft: #cdb59d;
    --line: #3e2b49;
    --accent: #f39255;
    --tint: #3a2135;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--body);
}

a { color: var(--accent); text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--head); line-height: 1.2; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { left: 8px; }

/* Top bar */

.topbar { background: var(--dusk); color: var(--dusk-ink); }
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 20px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.15rem;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar nav a {
  color: #f4d3a8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.topbar nav a:hover,
.topbar nav a[aria-current="page"] {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* Hero: the canyon scrolls by like in the game while the horse gallops. */

.hero {
  position: relative;
  overflow: hidden;
  background: #331956;
  color: #fff6e8;
  text-align: center;
  min-height: 600px;
}
.scene {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 600px;
  background: url("img/hero.webp") 0 100% / auto 600px repeat-x;
  animation: pan 40s linear infinite;
}
@keyframes pan { to { background-position-x: -1200px; } }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(36, 17, 50, 0.82) 0%, rgba(36, 17, 50, 0.45) 50%, rgba(36, 17, 50, 0) 78%);
}
.horse {
  position: absolute;
  z-index: 2;
  bottom: 34px;
  left: calc(50% - 58px);
  width: 116px;
  height: 105px;
  background: url("img/horse-run.webp") 0 0 / 800% 100% no-repeat;
  animation: gallop 0.6s steps(8) infinite;
}
@keyframes gallop { to { background-position-x: 114.2857%; } }
.hero-inner { position: relative; z-index: 3; padding: 44px 16px 170px; }
.hero-icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.hero h1 {
  font-size: clamp(2.4rem, 8vw, 4rem);
  margin: 18px 0 8px;
  letter-spacing: 0.5px;
  text-shadow: 0 3px 0 #7a2d10, 0 8px 24px rgba(0, 0, 0, 0.5);
}
.tagline {
  font-size: clamp(1.05rem, 2.8vw, 1.3rem);
  max-width: 32em;
  margin: 0 auto 26px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #120a14;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 9px 20px 9px 16px;
  text-align: left;
  line-height: 1.25;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.badge svg { width: 26px; height: 26px; flex: none; }
.badge small {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.badge strong { font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  .scene, .horse { animation: none; }
}

/* Sections */

.section { padding: 64px 0; }
.section + .section { padding-top: 8px; }
.section h2 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin: 0 0 6px; }
.lead { color: var(--ink-soft); margin: 0 0 28px; font-size: 1.05rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.card p { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.97rem; }
.card .body { padding: 14px 18px 20px; }
.stage img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.howto .card { padding: 18px 20px 22px; }
.howto .num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--head);
  font-weight: 800;
  margin-bottom: 8px;
}

/* FAQ */

.faq details, .contact { max-width: 780px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 18px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  list-style: none;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details p { margin: 12px 0 16px; color: var(--ink-soft); }

.contact {
  margin-top: 28px;
  background: var(--tint);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.contact h3 { margin: 0 0 6px; }
.contact p { margin: 0; }
.mail { display: inline-block; font-weight: 700; overflow-wrap: anywhere; }

/* Documents (privacy, terms) */

.doc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 48px);
  margin: 36px auto 56px;
}
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); margin: 0 0 4px; }
.doc h2 { font-size: 1.35rem; margin: 34px 0 8px; padding-top: 6px; }
.doc h3 { font-size: 1.08rem; margin: 20px 0 4px; }
.doc .meta { color: var(--ink-soft); margin: 0 0 22px; }
.doc ul { padding-left: 1.3em; }
.doc li { margin: 4px 0; }
.summary {
  background: var(--tint);
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 24px;
}
.summary ul { margin: 6px 0 0; }
.toc { columns: 2 220px; margin: 0; padding-left: 1.3em; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { font-family: var(--head); }

/* 404 */

.lost { text-align: center; padding: 72px 16px 96px; }
.lost img { width: 160px; height: auto; }
.lost h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 12px 0 6px; }

/* Footer */

footer {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 26px 0 34px;
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: inherit; }

code { font-size: 0.9em; overflow-wrap: anywhere; }
