/* =================== CSS Variables =================== */
:root {
  --bg: #0b0b0f;
  --panel: #151620;
  --ink: #ffffff;
  --muted: #cfd3da;
  --primary: #FF008C;
  --citrus: #FFD166;
  --acid: #00D1B2;
  --alert: #F24E1E;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --maxw: 1200px;
}

/* =================== Reset & Base Styles =================== */
*,
*:before,
*:after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(255, 0, 140, .16), transparent), var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: Montserrat, Inter, system-ui, sans-serif;
  line-height: 1.15;
  margin: 0 0 .5rem;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: .2px;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration: none;
}

/* =================== Layout =================== */
.container {
  width: min(100%, var(--maxw));
  margin-inline: auto;
  padding: 24px;
}

/* =================== Header & Navigation =================== */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 11, 15, .45);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.logo-img {
  height: 34px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}

/* =================== Buttons =================== */
.btn {
  --bg: var(--primary);
  --fg: #fff;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.1rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 8px 26px rgba(255, 0, 140, .3);
  font-weight: 600;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(255, 0, 140, .38);
}

.btn.ghost {
  --bg: transparent;
  --fg: var(--ink);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: none;
}

.btn.alt {
  --bg: var(--acid);
  box-shadow: 0 8px 26px rgba(0, 209, 178, .28);
}

.btn .flag {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset;
}

.btn .flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.btn .label {
  line-height: 1;
}

/* =================== Hero Section =================== */
.hero {
  position: relative;
  isolation: isolate;
}

.hero-grid {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  align-items: center;
  min-height: 70vh;
}

.kicker {
  color: var(--citrus);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: .9rem;
}

.lead {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* =================== Game Canvas =================== */
.playcard {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 420px;
}

canvas#arena {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
}

.badge {
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .12);
  padding: .4rem .7rem;
  border-radius: 999px;
  font-weight: 600;
}

.hud .right {
  display: flex;
  gap: 8px;
}

.restart {
  pointer-events: auto;
}

/* =================== Panels =================== */
.panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

/* =================== Showcase & Gallery =================== */
.showcase {
  margin-top: 48px;
  background: linear-gradient(135deg, rgba(255, 209, 102, .06), transparent 30%), radial-gradient(900px 400px at 10% -10%, rgba(0, 209, 178, .12), transparent 60%), var(--bg);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.tile {
  grid-column: span 6;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  min-height: 200px;
  padding: 16px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.tile.large {
  grid-column: span 12;
  min-height: 280px;
}

/* =================== Document Tiles =================== */
.tile.doc {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}

.tile.doc::before {
  content: 'PDF';
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: .75rem;
  letter-spacing: .6px;
  font-weight: 800;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 60%, white 0%);
}

.tile.doc::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: conic-gradient(from var(--sh, 0deg), var(--accent), transparent 40%);
  opacity: .28;
  filter: blur(24px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  transform: scale(1.04);
}

.tile.doc:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55);
  border-color: color-mix(in srgb, var(--accent) 40%, white 0%);
}

.tile.doc:hover::after {
  opacity: .55;
  --sh: 260deg;
}

.tile.doc:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.doc-es {
  --accent: #FF008C;
}

.doc-en {
  --accent: #00D1B2;
}

/* =================== Footer =================== */
footer {
  padding: 40px 0 64px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
}

/* =================== Accessibility =================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* =================== Benefits Sheet =================== */
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  background: linear-gradient(180deg, #0f0f14 0%, #0b0b0f 100%);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -10px 50px rgba(0, 0, 0, .5);
  transform: translateY(105%);
  transition: transform .35s ease;
  z-index: 60;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.sheet[aria-hidden="false"] {
  transform: translateY(0);
}

.sheet__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: -1;
}

.sheet[aria-hidden="false"] .sheet__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sheet__content {
  padding: 18px 24px 28px;
}

.sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.benefits {
  display: grid;
  gap: .8rem;
  margin: 0;
  padding-left: 1.1rem;
}

.benefits li {
  color: var(--muted);
  list-style: none;
  position: relative;
  padding-left: 1.6rem;
}

.benefits li:before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--acid);
  font-weight: 800;
}

.sheet__close {
  --bg: transparent;
  border-color: rgba(255, 255, 255, .18);
}

body.no-scroll {
  overflow: hidden;
}

/* =================== Sticky CTA =================== */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  display: none;
  z-index: 50;
}

.sticky-cta .wrap {
  margin: auto;
  max-width: var(--maxw);
  padding: 0 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.sticky-cta .btn {
  padding: .9rem 1.2rem;
}

/* =================== Animations =================== */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* =================== Toast Notification =================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #16171f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  padding: .6rem .9rem;
  border-radius: 999px;
  z-index: 1000;
  box-shadow: var(--shadow);
  font-weight: 600;
  opacity: 0;
  transition: .25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* =================== Responsive Design =================== */
@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .panels {
    grid-template-columns: 1fr;
  }

  .tile {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  .sticky-cta {
    display: block;
  }
}
