/* ============================================================
   BATONOS — landing page
   Themes: light = "belobog", dark = "chernobog"
   Colors, type and spacing extracted from Site.fig
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --primary: #8B6FFF;        /* brand: wordmark, hat, icons, badges, borders (large text / graphics) */
  --primary-hover: #765ED9;
  --btn: #7C63F0;            /* filled-button bg — AA-friendly white text, still on-brand */
  --btn-hover: #6A52D6;

  --maxw: 1060px;
  --pad: 24px;
  --radius-card: 20px;
  --radius-pill: 999px;

  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-hand: "Caveat", cursive;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="light"] {
  --bg: #FFFFFF;
  --text: #1E2433;
  --muted: #5A6172;

  --surface: #FFFFFF;        /* game cards */
  --surface-2: #FAFAFE;      /* feature cards */
  --chip: #F1EFFE;           /* icon chips / badges bg */
  --border: #E8E6F6;
  --border-strong: #E8E6F6;
  --border-outline: #E8E6F6;

  --alt-bg: #F1EFFE;
  --alt-border: #E8E6F6;

  --badge-text: #6A57E8;
  --link-hover: #6E54E0;     /* AA on white for small interactive text */
  --header-bg: rgba(255, 255, 255, .85);

  --shadow-sm: 0 1px 2px rgba(30, 36, 51, .04);
  --shadow-md: 0 10px 30px rgba(30, 36, 51, .07);
  --shadow-lg: 0 24px 60px rgba(124, 99, 240, .16);
  --glow: rgba(134, 116, 244, .14);
}

[data-theme="dark"] {
  --bg: #141226;
  --text: #F2F1FB;
  --muted: #A9A6C6;

  --surface: #1B1832;
  --surface-2: #1B1832;
  --chip: #221F3A;
  --border: #2E2A4D;
  --border-strong: #4D4877;
  --border-outline: #FFFFFF;

  --alt-bg: #2E2A4D;
  --alt-border: #4D4877;

  --badge-text: #6A57E8;
  --link-hover: #B7A6FF;     /* AA on dark bg for small interactive text */
  --header-bg: rgba(20, 18, 38, .85);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);
  --glow: rgba(134, 116, 244, .22);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* overflow-x: clip (not hidden): stops horizontal overflow WITHOUT forcing overflow-y
   to compute to `auto`, which would turn html/body into scroll containers and break
   the page scroll + the sticky header. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }

/* visible keyboard focus for every interactive control */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 8px;
}
/* skip link */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--btn);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: top .2s var(--ease);
}
.skip-link:focus-visible { top: 12px; outline-offset: 2px; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ambient blob in background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 360px at 50% -6%, var(--glow), transparent 70%);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  /* sticky: header stays pinned to the top of the viewport while the page scrolls
     underneath it (it is not carried away with the scroll content). */
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
/* Blur + tint live on a promoted pseudo-element so the backdrop-filter keeps a
   stable compositing layer and doesn't flicker when a theme switch repaints the
   whole document. translateZ(0) is on ::before ONLY — kept off .site-header so the
   mobile position:fixed .nav still resolves against the viewport. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transform: translateZ(0);
  transition: background-color .4s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}
.brand-mark { display: inline-flex; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .5px;
  color: var(--primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
.nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  color: var(--muted);
  transition: color .2s var(--ease);
}
.nav-link:hover { color: var(--link-hover); }
.nav-cta { margin-left: 4px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .2s var(--ease), background-color .2s;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--primary); color: var(--link-hover); }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"]  .icon-moon { display: none; }

/* hamburger (mobile) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}
.menu-toggle span {
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--text);
  margin: 0 auto;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --h: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn-sm { --h: 42px; padding: 0 20px; font-size: 15px; }

.btn-primary {
  background: var(--btn);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 99, 240, .28);
}
.btn-primary:hover { background: var(--btn-hover); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(124, 99, 240, .36); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-outline);
}
.btn-outline:hover { border-color: var(--primary); color: var(--link-hover); transform: translateY(-2px); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 56px 0 96px;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; }

.hero-art {
  position: relative;
  margin-bottom: 8px;
  padding-top: 30px;
}
/* The magician hat (hero centerpiece): it rests calmly, then flies up high when
   you point at it, its shadow deepening as it rises. Transforms don't affect flow,
   so the title below never shifts. Under prefers-reduced-motion the global rule
   drops the transition, so the lifted state just applies instantly (see top). */
.hat {
  transform-origin: 50% 75%;
  filter: drop-shadow(0 16px 26px rgba(124, 99, 240, .22));
  transition: transform .45s var(--ease), filter .45s var(--ease);
}
.hat:hover {
  transform: translateY(-56px) scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 44px 54px rgba(124, 99, 240, .35));
}

.hero-caption {
  position: absolute;
  top: 170px;
  left: 62%;
  transform: translateX(152px);
  line-height: 0;
  z-index: 3;
  cursor: pointer;
  user-select: none;
  background: none;
  border: 0;
  padding: 0;
  transition: transform .25s var(--ease);
}
.hero-caption:hover { transform: translateX(152px) scale(1.06); }

/* two baked-in SVG labels; the rotation is part of the artwork (don't add rotate() here) */
.lights-label { display: block; height: 96px; width: auto; }
[data-theme="dark"]  #lights_out_label { display: none; }
[data-theme="light"] #lights_on_label  { display: none; }

.sparkles .spark { transform-origin: center; animation: twinkle 2.6s ease-in-out infinite; }
.sparkles .s2 { animation-delay: .6s; }
.sparkles .s3 { animation-delay: 1.2s; }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 96px);
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--primary);
  margin-top: 8px;
}
.hero-subtitle {
  max-width: 560px;
  margin: 18px auto 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}
.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  padding: 96px 0;
}
.section-alt {
  background: var(--alt-bg);
  border-top: 1px solid var(--alt-border);
  border-bottom: 1px solid var(--alt-border);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}

.section-head { text-align: center; margin-bottom: 52px; }
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.15;
  color: var(--text);
}
.section-subtitle {
  margin-top: 10px;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- What we do: feature cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 54px; height: 54px;
  border-radius: 16px;
  background: var(--chip);
  color: var(--primary);
  margin-bottom: 18px;
}
.feature-icon svg { width: 26px; height: 26px; }
.feature-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--text);
  margin-bottom: 8px;
}
.feature-text { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- Games ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .3s var(--ease);
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.game-art { aspect-ratio: 1 / 1; overflow: hidden; }
.game-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.game-card:hover .game-art img { transform: scale(1.04); }
.game-body { padding: 24px; }
.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.game-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  color: var(--text);
}
.badge {
  margin-left: auto;
  flex: none;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--badge-text);
  font-size: 12px;
  font-weight: 600;
}
.game-text { font-size: 15px; line-height: 1.6; color: var(--muted); margin-bottom: 20px; }
.store-links { display: flex; gap: 10px; flex-wrap: wrap; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color .2s var(--ease), transform .2s var(--ease), background-color .2s;
}
.store-btn:hover { border-color: var(--primary); color: var(--link-hover); transform: translateY(-2px); }
.store-btn svg { flex: none; }
.store-btn img { flex: none; width: 16px; height: 16px; }

/* "Coming soon" — a locked store button: de-emphasised, not clickable.
   It carries the .store-btn class too, so the rules below come AFTER the active
   ones to win on equal specificity and neutralise the hover lift. */
.store-btn--soon {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface-2);
}
.store-btn--soon:hover { transform: none; border-color: var(--border); color: var(--muted); }
.store-btn--soon svg { opacity: .5; }
.store-soon {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--chip);
  color: var(--badge-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* ---------- About ---------- */
.about-inner { text-align: center; }
.about-text {
  max-width: 760px;
  margin: 22px auto 0;
  font-size: 17px;
  line-height: 1.62;
  color: var(--muted);
}
.about-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}
.tag {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ---------- Contacts ---------- */
.contacts-inner { text-align: center; }
.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}
.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px 14px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: left;
  transition: transform .22s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.contact-icon {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--primary);
  flex: none;
}
.contact-meta { display: flex; flex-direction: column; line-height: 1.3; }
.contact-name { font-weight: 600; font-size: 15px; color: var(--text); }
.contact-sub { font-size: 12px; color: var(--muted); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg);
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-links { display: flex; gap: 28px; }
.footer-link { font-size: 13.5px; color: var(--muted); transition: color .2s var(--ease); }
.footer-link:hover { color: var(--link-hover); }
.footer-copy { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

@media (max-width: 760px) {
  .section { padding: 72px 0; }
  .hero { padding: 40px 0 72px; }

  .menu-toggle { display: flex; }
  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform .3s var(--ease), opacity .3s var(--ease), visibility .3s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav-link { padding: 14px 8px; font-size: 16px; border-bottom: 1px solid var(--border); }
  .nav-cta { margin: 14px 0 0; align-self: flex-start; }

  .games-grid { grid-template-columns: 1fr; max-width: 440px; }
  /* hat fills the width on phones — no room to the side, so keep the caption above it */
  .hero-caption { top: -6px; transform: translateX(8px); }
  .hero-caption:hover { transform: translateX(8px) scale(1.06); }
  .lights-label { height: 44px; }
}

@media (max-width: 420px) {
  :root { --pad: 18px; }
  .store-links { flex-direction: column; }
  .store-btn { width: 100%; justify-content: center; }
  .contact-card { width: 100%; }
}
