/* SnapBattler site — shared styles. Palette mirrors the app (theme/tokens.ts). */
:root {
  --ink: #3E4763;
  --ink-2: #5A6378;
  --muted: #6C7590;
  --amber: #F5A83B;
  --amber-deep: #DB8B14;
  --violet: #8E7CF3;
  --violet-ink: #6A56D6;
  --teal: #2FB8A6;
  --danger: #F26D7E;
  --bg-top: #F3ECF8;
  --bg-bot: #E2ECFA;
  --card: #FFFFFF;
  --border: #E6E4F2;

  /* class colours (theme/classes.ts) */
  --tank: #F5A83B;
  --assassin: #F0596E;
  --healer: #4CBB78;
  --mage: #8E7CF3;
  --sniper: #E8823C;

  /* element colours (theme/elements.ts) */
  --fire: #FF7A48;
  --nature: #63BE58;
  --earth: #B08D57;
  --electric: #F5B923;
  --water: #4FA8EF;

  color-scheme: light;
}

* { box-sizing: border-box; }

/* Images carry width/height attributes (to reserve layout space and avoid CLS).
   Without this, a CSS width alone would leave the attribute height in force and
   squash the image. Anything that needs a fixed box overrides this explicitly. */
img { max-width: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  line-height: 1.65;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bot)) fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

h1, h2, h3 { letter-spacing: -0.02em; }

/* ── header ── */
header.site {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(12px);
  background: rgba(243, 238, 250, 0.72);
  border-bottom: 1px solid rgba(230,228,242,.7);
}
header.site .inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand img { width: 38px; height: 38px; border-radius: 11px; }
.brand strong { font-size: 1.08rem; }
nav { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .93rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--violet-ink); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 999px; padding: 14px 28px; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: 2px solid transparent;
  transition: transform .14s ease, box-shadow .14s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--amber); color: #fff; box-shadow: 0 10px 24px rgba(245,168,59,.36); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(245,168,59,.44); }
.btn-ghost { background: #fff; color: var(--violet-ink); border-color: var(--border); }
.badge-soon {
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(142,124,243,.14); color: var(--violet-ink);
  padding: 6px 12px; border-radius: 999px;
}

/* ── hero ── */
.hero { position: relative; text-align: center; padding: 74px 0 30px; }
.hero .kicker {
  display: inline-block; font-weight: 800; font-size: .74rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--violet-ink);
  background: rgba(142,124,243,.13); padding: 7px 15px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.2rem); line-height: 1.05; margin: 0 0 16px; }
.hero h1 .accent {
  background: linear-gradient(96deg, var(--amber-deep), var(--danger), var(--violet));
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sweep 7s ease-in-out infinite;
}
@keyframes sweep { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.hero p.lead { font-size: clamp(1.05rem, 2.3vw, 1.28rem); color: var(--ink-2); max-width: 620px; margin: 0 auto 30px; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; }

/* floating blobs behind the hero */
.blob { position: absolute; border-radius: 50%; filter: blur(70px); z-index: -1; pointer-events: none; }
.blob.a { width: 420px; height: 420px; background: rgba(245,168,59,.28); top: -120px; right: -60px; animation: drift 18s ease-in-out infinite; }
.blob.b { width: 380px; height: 380px; background: rgba(142,124,243,.26); top: 120px; left: -110px; animation: drift 22s ease-in-out infinite reverse; }
@keyframes drift { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(28px,-26px) scale(1.09); } }

/* ── the game card (HTML rendition of the in-app card) ── */
.gamecard {
  position: relative; width: 220px; border-radius: 20px; padding: 8px;
  background: linear-gradient(135deg, #fff, #EEF0F7);
  box-shadow: 0 18px 42px rgba(70,80,120,.24);
  overflow: hidden;
}
.gamecard .face { background: #fff; border-radius: 13px; border: 1px solid var(--border); overflow: hidden; }
.gamecard .top { display: flex; align-items: center; gap: 6px; padding: 8px 9px 6px; }
.gamecard .pill {
  font-size: .56rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.gamecard .cname { flex: 1; font-weight: 800; font-size: .78rem; line-height: 1.15; text-align: left; }
.gamecard .hp { font-weight: 900; font-size: .95rem; }
.gamecard .hp span { font-size: .55rem; color: var(--muted); margin-right: 2px; }
.gamecard .art { position: relative; margin: 0 8px; border-radius: 10px; overflow: hidden; aspect-ratio: 1/1; }
.gamecard .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gamecard .band {
  position: absolute; left: 5px; right: 5px; bottom: 5px; border-radius: 6px;
  background: rgba(58,64,86,.52); color: #fff; font-size: .48rem; letter-spacing: .03em;
  padding: 3px 7px; display: flex; justify-content: space-between; font-weight: 600;
}
.gamecard .body { padding: 9px 11px 12px; text-align: left; }
.gamecard .ability { font-weight: 800; font-size: .72rem; }
.gamecard .adesc { font-size: .6rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.gamecard .flavor { font-size: .56rem; color: #A6ADBE; font-style: italic; margin-top: 8px; line-height: 1.35; }

/* holographic shine sweep */
.gamecard .holo {
  position: absolute; inset: 0; pointer-events: none; border-radius: 20px; mix-blend-mode: screen;
  background: linear-gradient(105deg,
    transparent 32%, rgba(255,255,255,.55) 45%,
    rgba(142,124,243,.42) 52%, rgba(79,168,239,.38) 58%,
    rgba(255,255,255,.5) 65%, transparent 78%);
  background-size: 260% 100%; background-position: 180% 0;
  transition: background-position 1.1s ease;
}
.gamecard:hover .holo, .gamecard.shine .holo { background-position: -60% 0; }

/* floating hero cards */
.herocards { display: flex; justify-content: center; gap: 18px; margin-top: 56px; flex-wrap: wrap; perspective: 1400px; }
.herocards .gamecard { animation: bob 6s ease-in-out infinite; }
.herocards .gamecard:nth-child(2) { animation-delay: -1.6s; }
.herocards .gamecard:nth-child(3) { animation-delay: -3.2s; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1deg); } }

/* ── sections ── */
section { padding: 78px 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin: 0 0 12px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.step { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 26px; position: relative; }
.step .num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: .85rem; color: #fff; background: var(--violet); margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 1.12rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* class showcase */
.classes { display: flex; gap: 20px; overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory; }
.classcard { flex: 0 0 auto; scroll-snap-align: center; text-align: center; }
.classcard .label { margin-top: 14px; font-weight: 800; font-size: .95rem; }
.classcard .role { color: var(--muted); font-size: .84rem; }

/* element ring */
.ring-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.ring-wrap ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.ring-wrap li { margin: 10px 0; }
.ring svg { width: 100%; max-width: 420px; display: block; margin: 0 auto; }
.ring .spin { transform-origin: 210px 210px; animation: spin 34s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring .dash { stroke-dasharray: 7 9; animation: march 1.6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -32; } }

/* screenshot showcase */
.shots { display: flex; gap: 20px; overflow-x: auto; padding: 8px 4px 14px; scroll-snap-type: x mandatory; }
.shots figure { margin: 0; flex: 0 0 auto; scroll-snap-align: center; width: 230px; }
.shots img {
  width: 100%; height: auto;   /* the width/height attrs reserve space; CSS must scale it */
  border-radius: 22px; display: block; border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 18px 40px rgba(70,80,120,.22);
}
.shots figcaption { margin-top: 12px; font-size: .88rem; color: var(--muted); text-align: center; font-weight: 600; }

/* split feature */
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 48px; align-items: center; }
.split img.phone { width: 100%; height: auto; max-width: 300px; border-radius: 26px; box-shadow: 0 22px 50px rgba(70,80,120,.26); display: block; margin: 0 auto; }
.split h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin: 0 0 14px; }
.split p { color: var(--ink-2); }
.bullets { list-style: none; padding: 0; margin: 22px 0 0; }
.bullets li { display: flex; gap: 11px; margin: 13px 0; color: var(--ink-2); }
.bullets .tick {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: rgba(47,184,166,.16);
  color: var(--teal); display: grid; place-items: center; font-size: .74rem; font-weight: 900; margin-top: 2px;
}

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 24px; text-align: center; }
.stat b { display: block; font-size: 2.1rem; line-height: 1.1; color: var(--violet-ink); }
.stat span { color: var(--muted); font-size: .9rem; }

/* fairness / final cta */
.finale {
  background: var(--card); border: 1px solid var(--border); border-radius: 28px;
  padding: 54px 32px; text-align: center; margin-bottom: 30px;
}
.finale h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: 0 0 12px; }
.finale p { color: var(--muted); max-width: 520px; margin: 0 auto 26px; }

/* ── generic content pages ── */
main.doc { background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 40px; margin: 24px 0 56px; }
main.doc h1 { margin-top: 0; font-size: 2.1rem; }
main.doc h2 { margin-top: 34px; font-size: 1.25rem; }
main.doc .updated { color: var(--muted); font-size: .9rem; margin-top: -8px; }
main.doc li { margin: 7px 0; }
main.doc a { color: var(--violet-ink); }
.callout { background: #F6F5FB; border: 1px solid var(--border); border-radius: 16px; padding: 18px 22px; margin: 24px 0; }

/* ── footer ── */
footer { border-top: 1px solid var(--border); padding: 30px 0 46px; color: var(--muted); font-size: .9rem; }
footer .links { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
footer a { color: var(--violet-ink); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

/* ── scroll reveal ──
   Only hide content when JS is running (html.js). Without JS the page stays fully
   readable, and a safety-net timer reveals anything the observer misses. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .split, .ring-wrap { grid-template-columns: 1fr; gap: 30px; }
  section { padding: 58px 0; }
}
@media (max-width: 620px) {
  main.doc { padding: 26px 20px; border-radius: 18px; }
  .shots figure { width: 200px; }
  .finale { padding: 38px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
