/* ============================================================
   GTA VI LAUNCH THEME — original sunset/neon homage.
   Everything is scoped to html[data-theme="vice"] (set by the
   inline head script in index.html), so the normal site is
   untouched outside the 16 Nov – 3 Dec window.
============================================================ */

/* Theme-only elements stay hidden unless their class is active */
.vice-intro-screen,
.vice-countdown,
.vice-toggle { display: none; }

/* ─── TOKENS ─────────────────────────────────── */
html[data-theme="vice"] {
  --vice-pink:     oklch(0.72 0.23 355);
  --vice-orange:   oklch(0.80 0.16 60);
  --vice-teal:     oklch(0.82 0.12 195);
  --vice-purple:   oklch(0.20 0.08 305);

  --bg:            oklch(0.12 0.03 305);
  --bg-1:          oklch(0.15 0.04 305);
  --bg-2:          oklch(0.17 0.045 305);
  --bg-3:          oklch(0.21 0.055 305);
  --border:        oklch(0.72 0.23 355 / 0.14);
  --border-hover:  oklch(0.72 0.23 355 / 0.40);
  --border-accent: oklch(0.72 0.23 355 / 0.45);
  --text:          oklch(0.96 0.01 340);
  --text-muted:    oklch(0.74 0.035 320);
  --text-dim:      oklch(0.56 0.04 315);
  --accent:        var(--vice-pink);
  --accent-dim:    oklch(0.72 0.23 355 / 0.12);
  --accent-glow:   oklch(0.72 0.23 355 / 0.30);

  --vice-sunset:   linear-gradient(180deg, var(--vice-orange) 0%, var(--vice-pink) 70%);
}

html[data-theme="vice"] body::before {
  background:
    radial-gradient(ellipse 70% 50% at 10% -5%, oklch(0.72 0.23 355 / 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 90% 105%, oklch(0.80 0.16 60 / 0.07) 0%, transparent 60%);
}

/* ─── HERO ───────────────────────────────────── */
html[data-theme="vice"] .hero {
  background-image:
    linear-gradient(
      to bottom,
      oklch(0.55 0.22 355 / 0.30) 0%,
      oklch(0.25 0.10 305 / 0.50) 35%,
      oklch(0.12 0.03 305 / 0.85) 65%,
      oklch(0.12 0.03 305 / 1) 100%
    ),
    url('/assets/img/hero-bg-2400.jpg');
  background-blend-mode: normal, luminosity;
}

html[data-theme="vice"] .display-hero {
  text-shadow: 0 0 40px oklch(0.72 0.23 355 / 0.35);
}
html[data-theme="vice"] .hero-accent {
  background: var(--vice-sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 24px oklch(0.72 0.23 355 / 0.45));
}

/* Countdown (in hero meta, above stats) */
html[data-theme="vice"] .vice-countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}
.vice-countdown-label {
  font-family: var(--font-body);
  font-variation-settings: 'wght' 620, 'wdth' 86;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vice-teal);
}
.vice-countdown-time {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--vice-sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ─── TELEMETRY BENTO → HUD ──────────────────── */
html[data-theme="vice"] .bento-card {
  border-radius: 2px;
  background: linear-gradient(160deg, var(--bg-2) 0%, oklch(0.14 0.04 305) 100%);
}
/* Corner brackets */
html[data-theme="vice"] .bento-card::after {
  content: '';
  position: absolute;
  inset: 8px;
  pointer-events: none;
  --c: oklch(0.82 0.12 195 / 0.55);
  background:
    linear-gradient(var(--c), var(--c)) top left    / 14px 1px,
    linear-gradient(var(--c), var(--c)) top left    / 1px 14px,
    linear-gradient(var(--c), var(--c)) top right   / 14px 1px,
    linear-gradient(var(--c), var(--c)) top right   / 1px 14px,
    linear-gradient(var(--c), var(--c)) bottom left / 14px 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 14px,
    linear-gradient(var(--c), var(--c)) bottom right/ 14px 1px,
    linear-gradient(var(--c), var(--c)) bottom right/ 1px 14px;
  background-repeat: no-repeat;
}
html[data-theme="vice"] .bento-card::before {
  background: linear-gradient(90deg, transparent, var(--vice-pink), var(--vice-orange), transparent);
}
html[data-theme="vice"] .bento-card:hover {
  box-shadow: 0 12px 34px -12px oklch(0.72 0.23 355 / 0.35);
}
/* Stats read like a cash counter */
html[data-theme="vice"] .bento-stat-num,
html[data-theme="vice"] .bento-mini-stat-num {
  color: oklch(0.86 0.17 145);
  text-shadow: 0 0 14px oklch(0.86 0.17 145 / 0.35);
}
html[data-theme="vice"] .bento-stat-label,
html[data-theme="vice"] .bento-mini-stat-lbl,
html[data-theme="vice"] .bento-label {
  color: var(--vice-teal);
}

/* ─── INTRO (loading screen) ─────────────────── */
html.vice-intro { overflow: hidden; }
html.vice-intro .vice-intro-screen {
  display: flex;
  /* Safety net: if vice.js never runs, the screen hides itself */
  animation: vice-intro-failsafe 0.01s 8s forwards;
}
@keyframes vice-intro-failsafe { to { visibility: hidden; opacity: 0; pointer-events: none; } }

.vice-intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 1rem 5rem;
  background: radial-gradient(ellipse 90% 60% at 50% 110%, oklch(0.30 0.14 340 / 0.55), transparent 70%), #07040b;
  color: var(--text, #fff);
  text-align: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.vice-intro-screen.is-leaving { display: flex; opacity: 0; visibility: hidden; }

.vice-intro-sun {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: min(60vw, 420px);
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: linear-gradient(180deg, oklch(0.85 0.15 75), oklch(0.68 0.24 355) 75%);
  /* Retro horizontal stripes cut through the lower half */
  -webkit-mask: linear-gradient(180deg, #000 50%, transparent 50% 54%, #000 54% 62%, transparent 62% 67%, #000 67% 75%, transparent 75% 81%, #000 81% 89%, transparent 89%);
  mask: linear-gradient(180deg, #000 50%, transparent 50% 54%, #000 54% 62%, transparent 62% 67%, #000 67% 75%, transparent 75% 81%, #000 81% 89%, transparent 89%);
  opacity: 0.35;
  filter: blur(0.5px);
}

.vice-intro-mark {
  position: relative;
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: clamp(4.5rem, 18vw, 11rem);
  line-height: 0.85;
  text-transform: uppercase;
  background: linear-gradient(180deg, oklch(0.88 0.13 80) 0%, oklch(0.72 0.23 355) 60%, oklch(0.55 0.20 310) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 30px oklch(0.72 0.23 355 / 0.5));
  animation: vice-mark-in 1.1s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes vice-mark-in { from { opacity: 0; transform: scale(1.08); letter-spacing: 0.08em; } }

.vice-intro-line {
  position: relative;
  min-height: 1.4em;
  font-family: var(--font-body, system-ui);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.82 0.12 195);
}

.vice-intro-skip {
  position: absolute;
  bottom: 2.25rem;
  right: 1rem;
  min-height: 44px;
  padding: 0 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.80 0.03 320);
  animation: vice-blink 1.6s ease-in-out infinite;
}
.vice-intro-skip:focus-visible { outline: 2px solid oklch(0.82 0.12 195); outline-offset: 2px; }
@keyframes vice-blink { 50% { opacity: 0.45; } }

.vice-intro-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: oklch(1 0 0 / 0.06);
}
.vice-intro-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, oklch(0.82 0.12 195), oklch(0.72 0.23 355), oklch(0.80 0.16 60));
  box-shadow: 0 0 12px oklch(0.72 0.23 355 / 0.7);
}

/* ─── TOGGLE ─────────────────────────────────── */
html.vice-window .vice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 900;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-hover);
  background: oklch(0.12 0.02 300 / 0.75);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 0.66rem;
  font-variation-settings: 'wght' 620, 'wdth' 86;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}
.vice-toggle::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.vice-toggle[aria-pressed="true"] { color: var(--text); }
.vice-toggle[aria-pressed="true"]::before {
  background: var(--vice-pink);
  box-shadow: 0 0 10px var(--vice-pink);
}
.vice-toggle:hover { color: var(--text); border-color: var(--border-accent); }
.vice-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── MOBILE ─────────────────────────────────── */
@media (max-width: 768px) {
  html[data-theme="vice"] .vice-countdown { align-items: flex-start; }
}

/* ─── REDUCED MOTION ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vice-intro-mark,
  .vice-intro-skip { animation: none; }
}
