/* ================================================================
   EXAR GAMES — dark enterprise-neon theme, tailored for gaming.
   One stylesheet, zero frameworks. Tokens on :root; dark is home,
   light is the away kit. Everything renders client-side.
   ================================================================ */

:root {
  /* accents */
  --pink:   #F0157E;
  --orange: #FF7A3D;
  --violet: #7A5CFF;
  --teal:   #00C4A7;
  --pale:   #EDF0FF;

  /* dark-native surfaces */
  --bg:        #0B0D17;
  --bg-2:      #0E1120;
  --surface:   #141827;
  --surface-2: #1A1F33;
  --edge:      rgba(237, 240, 255, 0.10);
  --edge-hi:   rgba(240, 21, 126, 0.55);
  --fg:        #F2F4FE;
  --fg-dim:    #9AA3C0;
  --pos-bg:    #10142A;      /* poster backdrop */
  --glow:      rgba(240, 21, 126, 0.18);
  --shadow:    rgba(0, 0, 0, 0.45);

  --grad-a: linear-gradient(96deg, var(--pink), var(--orange));
  --grad-b: linear-gradient(96deg, var(--violet), var(--pink));

  --font: "Manrope", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --pixel: "Press Start 2P", "IBM Plex Mono", monospace;

  --gutter: 16px;
  --maxw: 1200px;
  --r: 18px;
}

/* light theme — the away kit (also honours system light unless dark forced) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #FAFBFF;
    --bg-2:      #F1F3FB;
    --surface:   #FFFFFF;
    --surface-2: #EEF1FA;
    --edge:      rgba(11, 13, 23, 0.10);
    --fg:        #10142A;
    --fg-dim:    #5A6280;
    --pos-bg:    #10142A;
    --glow:      rgba(240, 21, 126, 0.12);
    --shadow:    rgba(16, 20, 42, 0.12);
  }
}
:root[data-theme="light"] {
  --bg:        #FAFBFF;
  --bg-2:      #F1F3FB;
  --surface:   #FFFFFF;
  --surface-2: #EEF1FA;
  --edge:      rgba(11, 13, 23, 0.10);
  --fg:        #10142A;
  --fg-dim:    #5A6280;
  --pos-bg:    #10142A;
  --glow:      rgba(240, 21, 126, 0.12);
  --shadow:    rgba(16, 20, 42, 0.12);
}
:root[data-theme="dark"] {
  --bg:        #0B0D17;
  --bg-2:      #0E1120;
  --surface:   #141827;
  --surface-2: #1A1F33;
  --edge:      rgba(237, 240, 255, 0.10);
  --fg:        #F2F4FE;
  --fg-dim:    #9AA3C0;
  --pos-bg:    #10142A;
  --glow:      rgba(240, 21, 126, 0.18);
  --shadow:    rgba(0, 0, 0, 0.45);
}

/* ---------------- base ---------------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--pink); color: #fff; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--pink); color: #fff; padding: 10px 16px; font-weight: 700; border-radius: 8px; }
.skip:focus { left: 8px; }

.eyebrow {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.14em; color: var(--pink); text-transform: uppercase;
  margin-bottom: 14px;
}
.grad-text {
  background: var(--grad-a);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------------- nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-word { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand-word em { font-style: normal; color: var(--fg-dim); font-weight: 500; }

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--fg-dim);
  padding: 8px 14px; border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--fg); background: var(--surface-2); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  background: none; border: 1px solid var(--edge); color: var(--fg);
  cursor: pointer; transition: border-color 0.15s ease, transform 0.2s ease;
}
.theme-btn:hover { border-color: var(--edge-hi); transform: rotate(40deg); }
.tb-dot { transform-origin: center; transition: transform 0.25s ease; }
:root[data-theme="light"] .tb-dot { transform: scale(0.5); }

.burger { display: none; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  padding: 14px 26px; border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-solid {
  color: #fff; background: var(--grad-a);
  box-shadow: 0 8px 26px var(--glow);
}
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 12px 34px var(--glow); }
.btn-ghost { color: var(--fg); border: 1.5px solid var(--edge); background: transparent; }
.btn-ghost:hover { border-color: var(--edge-hi); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.nav-cta { display: inline-flex; }

/* ---------------- hero ---------------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--edge); }
.mesh { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; }
.blob-pink   { width: 46vmax; height: 46vmax; background: #f0157e44; top: -18vmax; right: -12vmax; animation: float-a 16s ease-in-out infinite; }
.blob-violet { width: 38vmax; height: 38vmax; background: #7a5cff3d; bottom: -16vmax; left: -10vmax; animation: float-b 20s ease-in-out infinite; }
.blob-teal   { width: 22vmax; height: 22vmax; background: #00c4a72e; top: 30%; left: 38%; animation: float-a 24s ease-in-out infinite reverse; }
@keyframes float-a { 0%,100% { translate: 0 0; } 50% { translate: -4vmax 3vmax; } }
@keyframes float-b { 0%,100% { translate: 0 0; } 50% { translate: 3vmax -4vmax; } }
.hero-grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--edge) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--edge) 1px, transparent 1px) 0 0 / 64px 64px;
  mask-image: radial-gradient(90% 80% at 50% 10%, #000 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(90% 80% at 50% 10%, #000 30%, transparent 90%);
}

.hero-inner {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px; align-items: center;
  padding: 92px var(--gutter) 66px;
}
.title { font-weight: 800; font-size: clamp(46px, 8vw, 92px); line-height: 1.02; letter-spacing: -0.035em; }
.lede { margin-top: 22px; font-size: clamp(16.5px, 1.7vw, 19px); color: var(--fg-dim); max-width: 540px; }
.cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.trust { margin-top: 22px; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); letter-spacing: 0.04em; }

.hero-stage { position: relative; min-height: 360px; }
.glass {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--edge);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px var(--shadow);
}
.shape { position: absolute; will-change: transform; }
.chip {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--fg-dim);
  padding: 11px 16px; white-space: nowrap;
  animation: chip-bob 5.5s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.chip b { color: var(--fg); font-weight: 600; }
.chip:nth-of-type(1) { top: 4%;  right: 4%; }
.chip:nth-of-type(2) { top: 38%; right: 52%; }
.chip:nth-of-type(3) { bottom: 6%; right: 14%; }
@keyframes chip-bob { 0%,100% { margin-top: 0; } 50% { margin-top: -12px; } }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-teal { background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.dot-pink { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.dot-orange { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.card-float { top: 20%; right: 8%; width: min(300px, 72%); padding: 14px; }

/* ---------------- stat band ---------------- */
.statband {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: var(--maxw); margin: 0 auto;
  border-top: 1px solid var(--edge);
  padding: 26px var(--gutter) 34px;
}
.stat b {
  display: block; font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em;
  background: var(--grad-b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); letter-spacing: 0.06em; }

/* ---------------- sections ---------------- */
.section { padding: 96px var(--gutter); max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; }
.alt { position: relative; }
.alt::before {
  content: ""; position: absolute; inset: 0 calc(50% - 50vw);
  background: var(--bg-2); z-index: -1;
  border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge);
}
.sec-head { max-width: 720px; margin-bottom: 52px; }
.sec-head h2 { font-weight: 800; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -0.03em; }
.sec-sub { margin-top: 14px; color: var(--fg-dim); }

/* ---------------- games ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.card {
  background: var(--surface);
  border: 1px solid var(--edge); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  transform-style: preserve-3d;
}
.card:hover { transform: translateY(-4px); border-color: var(--edge-hi); box-shadow: 0 22px 60px var(--shadow), 0 0 0 4px var(--glow); }
.card-wide { grid-column: 1 / -1; }
.poster { aspect-ratio: 4 / 3; border-bottom: 1px solid var(--edge); }
.card-wide .poster { aspect-ratio: 8 / 3; }
.poster svg { width: 100%; height: 100%; }
.card-body { padding: 22px 24px 26px; }
.card-body h3 { font-weight: 800; font-size: 22px; letter-spacing: -0.01em; margin-bottom: 8px; }
.card-body p { color: var(--fg-dim); font-size: 15px; }
.wip {
  display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  color: #fff; background: var(--grad-b); border-radius: 999px; padding: 4px 12px; margin-bottom: 10px;
}
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips li {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em; color: var(--fg-dim);
  border: 1px solid var(--edge); border-radius: 999px; padding: 4px 12px;
}

/* ---------------- pillars ---------------- */
.pillar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.pillar {
  background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r);
  padding: 26px 24px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.pillar:hover { transform: translateY(-4px); border-color: var(--edge-hi); }
.pillar-ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 18px;
}
.pillar-ic svg { width: 24px; height: 24px; }
.ic-pink   { color: var(--pink);   background: color-mix(in srgb, var(--pink) 14%, transparent); }
.ic-violet { color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }
.ic-teal   { color: var(--teal);   background: color-mix(in srgb, var(--teal) 14%, transparent); }
.ic-orange { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.pillar h3 { font-weight: 800; font-size: 17.5px; margin-bottom: 8px; }
.pillar p { color: var(--fg-dim); font-size: 14.5px; }

/* ---------------- pipeline ---------------- */
.pipe { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.pipe li {
  background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r);
  padding: 20px 22px; display: grid; gap: 4px; position: relative; overflow: hidden;
}
.pipe li::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-b); opacity: 0; transition: opacity 0.2s ease;
}
.pipe li:hover::after { opacity: 1; }
.pipe b { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; color: var(--fg); }
.pipe span { color: var(--fg-dim); font-size: 14px; }

/* ---------------- contact ---------------- */
.contact { padding-bottom: 120px; }
.contact-card {
  position: relative;
  display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 36px; align-items: center;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, var(--pink), var(--violet), var(--teal)) border-box;
  border: 1.6px solid transparent; border-radius: 24px;
  padding: 48px;
  box-shadow: 0 30px 80px var(--shadow);
}
.contact-card h2 { font-weight: 800; font-size: clamp(26px, 3.6vw, 42px); letter-spacing: -0.02em; }
.cta-col { display: grid; gap: 12px; }

/* ---------------- footer ---------------- */
.footer {
  border-top: 1px solid var(--edge);
  padding: 40px var(--gutter) 56px; text-align: center;
  background: var(--bg-2);
}
.footer p { font-size: 14px; color: var(--fg-dim); }
.footer b { color: var(--fg); }
.foot-fine { margin-top: 8px; font-family: var(--mono); font-size: 12px; }

/* ---------------- reveal on scroll ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 0.06s; }
.reveal:nth-child(3) { transition-delay: 0.12s; }
.reveal:nth-child(4) { transition-delay: 0.18s; }

/* party mode (↑↑↓↓ — you found it) */
.party .blob { animation-duration: 3s !important; opacity: 0.8; }
.party .chip { animation-duration: 1.2s; }
.party .brand-word em { animation: party-hue 0.8s linear infinite; }
@keyframes party-hue { 0% { color: var(--pink); } 33% { color: var(--teal); } 66% { color: var(--orange); } 100% { color: var(--pink); } }

/* ---------------- responsive ---------------- */
@media (max-width: 1020px) {
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; padding-top: 72px; }
  .hero-stage { min-height: 250px; }
  .card-float { right: 2%; }
}
@media (max-width: 880px) {
  .card-grid { grid-template-columns: 1fr; }
  .pipe { grid-template-columns: 1fr 1fr; }
  .contact-card { grid-template-columns: 1fr; padding: 32px; }
  .statband { grid-template-columns: repeat(2, 1fr); row-gap: 22px; }
}
@media (max-width: 760px) {
  .nav-cta { display: none; }
  .nav-links {
    position: fixed; inset: 63px 0 auto 0; z-index: 49;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--edge);
    max-height: 0; overflow: hidden; transition: max-height 0.28s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 16px var(--gutter); border-radius: 0; border-top: 1px solid var(--edge); }

  .burger {
    display: grid; gap: 4.5px; place-content: center;
    width: 38px; height: 38px; border-radius: 999px;
    background: none; border: 1px solid var(--edge); cursor: pointer;
  }
  .burger span { width: 16px; height: 2px; background: var(--fg); transition: transform 0.2s ease, opacity 0.2s ease; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  .section { padding: 64px var(--gutter); }
  .pipe { grid-template-columns: 1fr; }
  .cta-row { flex-direction: column; }
  .btn { width: 100%; }
  .hero-stage { display: none; }
  .trust { font-size: 11px; }
}

/* ---------------- gamer pass ---------------- */
.pixel { font-family: var(--pixel) !important; letter-spacing: 0.04em; }
.eyebrow.pixel { font-size: 11px; line-height: 1.8; }
.stat b.pixel { font-size: clamp(18px, 3vw, 30px); line-height: 1.6; }
.foot-fine.pixel { font-size: 10px; line-height: 2; }

/* XP bar = scroll progress, pinned above the nav */
.xpbar {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.xpbar span {
  display: block; height: 100%; width: 0;
  background: var(--grad-a);
  box-shadow: 0 0 12px var(--pink);
}

.press-start {
  margin-top: 26px; font-family: var(--pixel); font-size: 12px; color: var(--fg);
  animation: blink 1.15s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }

.ach { font-size: 15px; line-height: 1; filter: saturate(1.2); }

/* player screenshots drop straight over the SVG posters: put assets/<slug>.png in place */
.poster { position: relative; }
.poster .shot {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 2;
}

/* boot-screen sweep on card hover */
.poster::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.14) 46%, transparent 60%),
              repeating-linear-gradient(0deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 3px);
  background-size: 300% 100%, auto;
  background-position: 120% 0, 0 0;
}
.card:hover .poster::after { animation: bootsweep 0.9s ease; }
@keyframes bootsweep { from { background-position: 120% 0, 0 0; } to { background-position: -60% 0, 0 0; } }

/* hero CRT vignette — barely-there, pure flavour */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 40%, transparent 62%, rgba(0,0,0,0.28) 100%);
}
:root[data-theme="light"] .hero::after { display: none; }

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .chip, .press-start { animation: none !important; }
  .card:hover .poster::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn, .pillar, .theme-btn { transition: none; }
}
