/* ============================================================
   Trail Mix — roguelike auto-chess shooter for the Nintendo DS
   Bright arcade / candy theme. Vanilla CSS, no deps.
   ============================================================ */

:root {
  --bg: #0e1018;
  --bg2: #141728;
  --surface: #191d31;
  --surface-2: #212743;
  --line: #2c3355;
  --line-soft: #232a47;

  --text: #eef1fb;
  --text-dim: #a6acc9;
  --text-faint: #7a80a6;

  /* six factions */
  --red: #ff5566;
  --blue: #4aa8ff;
  --green: #45d67a;
  --yellow: #ffd23f;
  --purple: #b673ff;
  --cyan: #35e0e0;

  --primary: #ffd23f;
  --primary-ink: #241d02;

  --pixel: "Press Start 2P", "Courier New", monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1120px;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  background-image:
    radial-gradient(ellipse 70% 40% at 15% -5%, rgba(255, 85, 102, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 45% at 90% 5%, rgba(53, 224, 224, 0.12), transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 105%, rgba(182, 115, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #0e1018 0%, #0c0e16 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color .18s ease; }
a:hover, a:focus-visible { color: #ffe484; }

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

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

code {
  font-family: var(--pixel);
  font-size: .78em;
  background: rgba(255, 210, 63, 0.1);
  color: #ffe08a;
  padding: .12em .4em;
  border-radius: 5px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: var(--primary-ink);
  padding: .6rem 1rem; z-index: 1000; font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ===================== Top bar ===================== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14, 16, 24, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--pixel); font-size: .72rem;
  letter-spacing: .04em; color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-dots { display: inline-flex; gap: 3px; }
.brand-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.brand-text { transform: translateY(1px); }

.nav {
  margin-left: auto; display: flex; gap: 1.3rem;
  font-size: .82rem; font-weight: 600; letter-spacing: .02em;
}
.nav a { color: var(--text-dim); }
.nav a:hover { color: var(--text); }

.lang { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; }
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: .8rem;
  color: var(--text-faint); padding: .2rem .1rem;
}
.lang-btn.active { color: var(--primary); }
.lang-btn:hover { color: var(--text); }
.lang-div { color: var(--line); }

/* ===================== Hero ===================== */
.hero { position: relative; overflow: hidden; }
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(255,210,63,0.10), transparent) 20% 30% / 40% 50% no-repeat,
    radial-gradient(closest-side, rgba(74,168,255,0.10), transparent) 85% 20% / 45% 55% no-repeat;
}
.hero-inner {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center;
  padding: clamp(2.5rem, 6vw, 5.5rem) 1.25rem clamp(3rem, 7vw, 6rem);
}
.badge {
  display: inline-block; font-family: var(--pixel); font-size: .58rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(53,224,224,.4);
  border-radius: 999px; padding: .5rem .8rem; margin: 0 0 1.4rem;
  background: rgba(53,224,224,.06);
}
.hero-title {
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(2.1rem, 6.5vw, 4.2rem); line-height: 1.08;
  margin: 0 0 1.1rem; letter-spacing: .01em;
  background: linear-gradient(92deg, var(--red) 0%, var(--yellow) 28%, var(--green) 52%, var(--cyan) 72%, var(--purple) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--yellow);
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.35));
}
.hero-sub { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 600; margin: 0 0 1rem; color: var(--text); }
.hero-pitch { font-size: 1.05rem; color: var(--text-dim); margin: 0 0 1.8rem; max-width: 34ch; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-weight: 700; font-size: .95rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 22px rgba(255,210,63,.28); }
.btn-primary:hover { color: var(--primary-ink); transform: translateY(-2px); box-shadow: 0 9px 28px rgba(255,210,63,.4); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.02); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); transform: translateY(-2px); }

.hero-stats { list-style: none; display: flex; gap: 2rem; padding: 0; margin: 0; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--pixel); font-size: 1.35rem; color: var(--text); line-height: 1.2; }
.hero-stats span { font-size: .8rem; color: var(--text-dim); text-transform: lowercase; }

/* DS frame around the hero screenshot */
.hero-art { display: flex; justify-content: center; }
.ds-frame {
  position: relative; padding: 14px; border-radius: 22px;
  background: linear-gradient(160deg, #2a3050, #171b2d);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
  max-width: 300px; rotate: 2deg;
  transition: rotate .3s ease, transform .3s ease;
}
.ds-frame:hover { rotate: 0deg; transform: translateY(-4px); }
.ds-frame img { border-radius: 12px; box-shadow: 0 2px 0 rgba(0,0,0,.4); }

.scroll-hint {
  text-align: center; color: var(--text-faint); font-size: 1.3rem;
  padding-bottom: 1.2rem; animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint { animation: none; } }

/* ===================== Sections ===================== */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem, 5vw, 4.5rem) 1.25rem; }
.divider { display: flex; align-items: center; justify-content: center; margin-bottom: 1.8rem; }
.divider span {
  color: var(--purple); font-size: 1rem;
  padding: 0 1rem; position: relative;
}
.divider::before, .divider::after {
  content: ""; height: 1px; width: min(120px, 20vw);
  background: linear-gradient(90deg, transparent, var(--line));
}
.divider::after { background: linear-gradient(90deg, var(--line), transparent); }

.section-title {
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(1.15rem, 3vw, 1.8rem); line-height: 1.3;
  text-align: center; margin: 0 0 1rem; color: var(--text);
}
.lede { font-size: 1.1rem; color: var(--text-dim); max-width: 62ch; margin: 0 auto 1rem; text-align: center; }
.lede-dim { color: var(--text-faint); font-size: 1rem; }
.lede code { font-size: .82em; }

/* ===================== Features ===================== */
.features {
  list-style: none; padding: 0; margin: 2.4rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem;
}
.feature {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.4rem 1.3rem;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.feature:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: 0 14px 34px rgba(0,0,0,.32); }
.feature-icon { font-size: 1.7rem; display: block; margin-bottom: .7rem; line-height: 1; }
.feature h3 { font-size: 1.08rem; margin: 0 0 .5rem; color: var(--text); }
.feature p { margin: 0; color: var(--text-dim); font-size: .96rem; line-height: 1.55; }

/* ===================== Colors / companions ===================== */
.colors {
  list-style: none; padding: 0; margin: 2.4rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem;
}
.color-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.3rem 1.3rem 1.3rem;
  transition: transform .16s ease, box-shadow .16s ease;
}
.color-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c);
}
.color-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.32); }
.color-swatch {
  display: inline-block; width: 34px; height: 34px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 18px var(--c); margin-bottom: .8rem;
}
.color-card h3 { margin: 0 0 .4rem; color: var(--c); font-size: 1.15rem; }
.color-card p { margin: 0; color: var(--text-dim); font-size: .95rem; }

/* ===================== Gallery ===================== */
.gallery {
  list-style: none; padding: 0; margin: 2.4rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.4rem;
}
.shot { display: flex; flex-direction: column; gap: .7rem; }
.shot-btn {
  padding: 0; border: 1px solid var(--line-soft); background: var(--bg2);
  border-radius: var(--radius); cursor: pointer; overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  line-height: 0;
}
.shot-btn:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 16px 36px rgba(0,0,0,.4); }
.shot-btn img { width: 100%; height: auto; image-rendering: pixelated; }
.shot-cap { font-size: .88rem; color: var(--text-dim); text-align: center; }

/* ===================== Get it ===================== */
.get-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem;
  margin: 2.4rem 0 2rem;
}
.get-card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.6rem 1.5rem;
  display: flex; flex-direction: column;
}
.get-card h3 { font-size: 1.2rem; margin: 0 0 .6rem; color: var(--text); }
.get-card p { margin: 0 0 1.4rem; color: var(--text-dim); font-size: .98rem; flex: 1; }
.get-card .btn { align-self: flex-start; }

.controls {
  background: var(--bg2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.5rem 1.6rem; margin-top: 1.5rem;
}
.controls-title { font-family: var(--pixel); font-size: .82rem; margin: 0 0 1.1rem; color: var(--cyan); }
.controls-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.controls-list li { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; color: var(--text-dim); font-size: .96rem; }
kbd {
  font-family: var(--pixel); font-size: .62rem;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-bottom-width: 3px;
  border-radius: 6px; padding: .45rem .55rem; white-space: nowrap;
  min-width: 3.4rem; text-align: center;
}

/* ===================== Footer ===================== */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.25rem 4rem; text-align: center;
}
.footer .divider { margin-bottom: 1.6rem; }
.footer-tag { font-size: 1.05rem; color: var(--text); margin: 0 0 1.2rem; }
.footer-links { font-size: .95rem; color: var(--text-faint); margin: 0 0 .8rem; }
.footer-links a { color: var(--text-dim); font-weight: 600; }
.footer-links a:hover { color: var(--primary); }
.madeby { font-size: .9rem; color: var(--text-dim); margin: 0 0 1rem; font-weight: 600; }
.credits { font-size: .8rem; color: var(--text-faint); margin: 0; max-width: 52ch; margin-inline: auto; line-height: 1.6; }

/* ===================== Lightbox ===================== */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(6, 7, 12, 0.94); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: min(92vw, 520px); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.lb-figure img { max-height: 78vh; width: auto; border-radius: 12px; border: 1px solid var(--line); image-rendering: pixelated; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.lb-figure figcaption { color: var(--text-dim); font-size: .95rem; text-align: center; }
.lb-close, .lb-nav {
  position: absolute; background: rgba(25,29,49,.85); color: var(--text);
  border: 1px solid var(--line); border-radius: 50%;
  width: 46px; height: 46px; font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, transform .15s ease;
}
.lb-close:hover, .lb-nav:hover { background: var(--surface-2); transform: scale(1.06); }
.lb-close { top: 1.2rem; right: 1.2rem; }
.lb-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.06); }

/* ===================== Reveal ===================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ===================== Responsive ===================== */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-pitch { max-width: 46ch; }
  .hero-stats { justify-content: center; }
  .hero-art { order: -1; }
  .ds-frame { rotate: 0deg; max-width: 240px; }
}
@media (max-width: 680px) {
  .nav { display: none; }
  .hero-stats { gap: 1.3rem; }
}
