/* Sparpit web — brand system mirrors sparpit-mobile/src/constants/theme.ts
   (dark-only by brand choice; Space Grotesk display + Outfit body, same as the app).
   The hero is "the pit": the icon's own arena — lattice, glow, orbiting boards. */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  --bg: #0B0D13;
  --surface: #131722;
  --raised: #1B2130;
  --inset: #0F1320;
  --text: #EEF1F8;
  --text-secondary: #8B93A7;
  --text-soft: #C6CDE0;
  --brand-a: #8C6BFF;
  --brand-b: #6A48E8;
  --amber: #FFAE42;   /* deduction */
  --violet: #8C6BFF;  /* lines & grids */
  --red: #E8514E;     /* board classics */
  --cyan: #2FE0C8;    /* quick play */
  --green: #43B892;   /* cards */
  --blue: #5B8DEF;    /* trivia */
  --display: "Space Grotesk", -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Outfit", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--brand-a); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brand-a); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; text-wrap: balance; }

.wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px 96px; }
.wide { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- shared header / footer ---------- */
header.site { display: flex; align-items: center; gap: 12px; }
.wrap > header.site { margin-bottom: 48px; }

.mark {
  width: 40px; height: 40px; border-radius: 11px; flex: none; overflow: hidden;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 22px;
  color: #fff; text-decoration: none;
}
.mark img { width: 100%; height: 100%; display: block; }
.wordmark {
  font-family: var(--display); font-size: 20px; font-weight: 700;
  color: var(--text); text-decoration: none; letter-spacing: 0.2px;
}

footer.site {
  margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--raised);
  color: var(--text-secondary); font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 8px 20px;
}
footer.site a { color: var(--text-secondary); }
footer.site a:hover { color: var(--text-soft); }

/* ---------- legal pages ---------- */
.wrap h1 { font-size: 32px; line-height: 1.2; margin-bottom: 8px; }
.updated { color: var(--text-secondary); font-size: 14px; margin-bottom: 40px; }
section.legal h2 { font-size: 18px; margin: 32px 0 8px; }
section.legal p { color: var(--text-soft); }

.card {
  background: var(--surface); border: 1px solid var(--raised);
  border-radius: 12px; padding: 20px 22px; margin: 20px 0;
}
.card ol { padding-left: 20px; color: var(--text-soft); }
.card li { margin: 6px 0; }

/* ---------- landing ---------- */
.landing header.site {
  max-width: 1040px; margin: 0 auto; padding: 28px 24px;
  justify-content: space-between;
}
.landing header.site .brand { display: flex; align-items: center; gap: 12px; }
.landing nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; }
.landing nav a { color: var(--text-secondary); text-decoration: none; position: relative; }
.landing nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.landing nav a:hover { color: var(--text); }
.landing nav a:hover::after { transform: scaleX(1); }

/* hero — the pit */
.hero {
  position: relative;
  padding: 72px 0 40px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center;
}
.hero::before {
  /* the arena's board lattice, fading out radially like the icon's own */
  content: ""; position: absolute; inset: -28px -60px; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(139, 147, 167, 0.07) 46px 47px),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(139, 147, 167, 0.07) 46px 47px);
  -webkit-mask-image: radial-gradient(70% 85% at 62% 42%, #000 20%, transparent 75%);
  mask-image: radial-gradient(70% 85% at 62% 42%, #000 20%, transparent 75%);
  animation: fadeIn 1.2s ease both;
}
.hero h1 { font-size: clamp(44px, 7vw, 76px); line-height: 1.02; }
.hero h1 .line { display: block; animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero h1 .line:nth-child(2) { animation-delay: 0.12s; }
.hero h1 .grad {
  /* violet player on top, cyan player below — the brand's two colours */
  background: linear-gradient(95deg, var(--violet) 15%, var(--cyan) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tagline {
  color: var(--text-secondary); font-size: 19px; margin-top: 20px; max-width: 44ch;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.24s both;
}
.hero .tagline strong { color: var(--text-soft); font-weight: 500; }
.cta-row {
  margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.36s both;
}
.store-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--raised); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 500; color: var(--text-soft);
}
.store-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; animation: pulse 2.4s ease-in-out infinite; }
.browse-link { font-weight: 600; font-size: 15px; text-decoration: none; }
.browse-link:hover { text-decoration: underline; }

/* the arena: real app icon + orbiting boards */
.arena { position: relative; width: min(440px, 100%); aspect-ratio: 1; margin: 0 auto; }
.arena .glow {
  position: absolute; inset: 10%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(140, 107, 255, 0.28) 0%, rgba(47, 224, 200, 0.07) 45%, transparent 70%);
  animation: fadeIn 1.4s ease 0.2s both, breathe 6s ease-in-out 1.6s infinite;
}
.appicon {
  position: absolute; left: 50%; top: 50%; width: 44%;
  transform: translate(-50%, -50%);
  border-radius: 22.5%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--raised);
  animation: iconIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both, float 7s ease-in-out 1.4s infinite;
}
.tile {
  position: absolute; width: 21%; aspect-ratio: 1; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--raised);
  display: flex; align-items: center; justify-content: center;
  animation: pop 0.55s cubic-bezier(0.3, 1.4, 0.4, 1) both, float 6s ease-in-out infinite;
  transition: border-color 0.25s ease;
}
.tile:hover { border-color: var(--text-secondary); }
.tile svg { width: 62%; height: 62%; }
.tile.t1 { left: 2%;  top: 6%;   rotate: -6deg; animation-delay: 0.55s, 1.8s; }
.tile.t2 { right: 4%; top: 0;    rotate: 5deg;  animation-delay: 0.65s, 2.6s; --float-y: -10px; }
.tile.t3 { left: -4%; top: 44%;  rotate: 4deg;  animation-delay: 0.75s, 2.2s; }
.tile.t4 { right: -3%; top: 40%; rotate: -5deg; animation-delay: 0.85s, 3.1s; --float-y: -7px; }
.tile.t5 { left: 12%; bottom: 2%; rotate: 6deg; animation-delay: 0.95s, 2.9s; }
.tile.t6 { right: 12%; bottom: -2%; rotate: -4deg; animation-delay: 1.05s, 3.5s; --float-y: -9px; }

/* sections */
.section { padding: 88px 0 0; }
.section h2 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 8px; }
.section .lede { color: var(--text-secondary); font-size: 17px; max-width: 60ch; margin-bottom: 36px; }

/* category cards — the game shelves */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cat {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 22px;
  background: var(--surface);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 58%);
  border: 1px solid var(--raised);
  border-top: 3px solid var(--accent, var(--raised));
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.cat:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--raised));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cat-ico {
  width: 46px; height: 46px; flex: none; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--inset));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--raised));
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform 0.25s ease;
}
.cat:hover .cat-ico { transform: rotate(-6deg) scale(1.06); }
.cat-ico svg { width: 24px; height: 24px; }
.cat-head .meta { min-width: 0; }
.cat .tag { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }
.cat h3 { font-size: 19px; line-height: 1.25; }
.count {
  margin-left: auto; flex: none; align-self: flex-start;
  font-family: var(--display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--inset));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--raised));
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.cat p { color: var(--text-secondary); font-size: 15px; margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 500; color: var(--text-soft);
  background: var(--inset); border: 1px solid var(--raised);
  border-radius: 999px; padding: 5px 12px 5px 10px; white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--accent, var(--text-secondary)); opacity: 0.85;
}
.chip:hover {
  border-color: var(--accent, var(--text-secondary)); color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, var(--inset));
  transform: translateY(-1px);
}

/* feature cards */
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.feat {
  background: var(--surface); border: 1px solid var(--raised); border-radius: 16px; padding: 22px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.feat:hover { transform: translateY(-3px); border-color: #262d40; }
.feat .ico {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--fc, var(--brand-a)) 13%, var(--inset));
  border: 1px solid color-mix(in srgb, var(--fc, var(--brand-a)) 32%, var(--raised));
  box-shadow: 0 0 16px color-mix(in srgb, var(--fc, var(--brand-a)) 18%, transparent);
}
.feat .ico svg { width: 20px; height: 20px; }
.feat h3 { font-size: 17px; margin-bottom: 6px; }
.feat p { color: var(--text-secondary); font-size: 15px; }

/* fair play strip */
.fair {
  margin-top: 72px; border-radius: 20px; padding: 36px;
  background: linear-gradient(135deg, rgba(140, 107, 255, 0.14), rgba(47, 224, 200, 0.05));
  border: 1px solid rgba(140, 107, 255, 0.25);
}
.fair h2 { font-size: 24px; margin-bottom: 10px; }
.fair p { color: var(--text-soft); max-width: 68ch; }

.landing footer.site { max-width: 1040px; margin: 96px auto 0; padding: 24px; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes iconIn { from { opacity: 0; transform: translate(-50%, -38%) scale(0.85); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes pop { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 var(--float-y, -8px); }
}
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* the icon floats around its centered position */
.appicon { --float-y: -9px; }
@keyframes floatIcon {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% + var(--float-y))); }
}
.appicon { animation: iconIn 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both, floatIcon 7s ease-in-out 1.4s infinite; }

/* scroll reveals (JS adds .js to <html>, .in on intersect) */
html.js .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .stagger.in > * { opacity: 1; transform: none; }
.stagger.in > :nth-child(2) { transition-delay: 0.07s; }
.stagger.in > :nth-child(3) { transition-delay: 0.14s; }
.stagger.in > :nth-child(4) { transition-delay: 0.21s; }
.stagger.in > :nth-child(5) { transition-delay: 0.28s; }
.stagger.in > :nth-child(6) { transition-delay: 0.35s; }
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .stagger > *, html.js .reveal { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 56px; }
  .arena { width: min(360px, 92%); }
  .landing nav { gap: 18px; }
}
