/* ===========================
   PISTO PLAY — BASE.CSS
   Design System Variables & Reset
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── Color Palette ── */
:root {
  /* Primary */
  --purple-900: #1a0533;
  --purple-800: #2d0d5c;
  --purple-700: #4c1d95;
  --purple-600: #6d28d9;
  --purple-500: #7c3aed;
  --purple-400: #a78bfa;
  --purple-300: #c4b5fd;
  --purple-200: #ddd6fe;
  --purple-100: #ede9fe;

  /* Accent */
  --coral-600: #ea580c;
  --coral-500: #f97316;
  --coral-400: #fb923c;
  --coral-300: #fdba74;

  /* Neutral */
  --dark-900: #0f0a1a;
  --dark-800: #1a1228;
  --dark-700: #241a38;
  --dark-600: #2e2248;
  --cream: #fdf8f0;
  --cream-dark: #f5efe0;
  --white: #ffffff;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;

  /* Semantic */
  --bg-primary: var(--dark-900);
  --bg-secondary: var(--dark-800);
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: var(--cream);
  --text-secondary: var(--purple-300);
  --text-muted: var(--gray-400);
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(124, 58, 237, 0.4);

  /* Typography — fluid scale */
  --font: 'Outfit', sans-serif;
  --fs-xs:   clamp(0.6875rem, 1.5vw, 0.75rem);
  --fs-sm:   clamp(0.8rem,    2vw,   0.875rem);
  --fs-base: clamp(0.9rem,    2.5vw, 1rem);
  --fs-lg:   clamp(1rem,      2.5vw, 1.125rem);
  --fs-xl:   clamp(1.1rem,    3vw,   1.25rem);
  --fs-2xl:  clamp(1.25rem,   3.5vw, 1.5rem);
  --fs-3xl:  clamp(1.5rem,    4vw,   1.875rem);
  --fs-4xl:  clamp(1.75rem,   5vw,   2.25rem);
  --fs-5xl:  clamp(2rem,      6vw,   3rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Borders & Shadows */
  --radius-sm:   0.5rem;
  --radius-md:   1rem;
  --radius-lg:   1.5rem;
  --radius-xl:   2rem;
  --radius-full: 9999px;

  --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:        0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg:        0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow:      0 0 30px rgba(124, 58, 237, 0.3);
  --shadow-glow-coral:0 0 30px rgba(249, 115, 22, 0.3);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.4s ease;
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-base:  1;
  --z-card:  10;
  --z-modal: 100;
  --z-toast: 200;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Root overscroll fix — paint behind everything so bounce never shows white ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;

  /* Same dark base as --dark-900 so the "rubber-band" gutter is never white */
  background-color: #0f0a1a;
  /* Tells the browser this is a dark ui — native chrome (status bar, scrollbar) follows */
  color-scheme: dark;

  /* Android: kill the overscroll glow effect at the top */
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Kill white bounce on Android Chrome */
  overscroll-behavior: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, textarea {
  font-family: var(--font);
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ── Background Gradient — fixed layer behind everything ──
   Using a position:fixed pseudo-element anchored to the viewport means
   the gradient ALWAYS covers the screen, even during iOS rubber-band bounce.
   (background-attachment:fixed doesn't work on iOS Safari, this does.) ── */
.bg-gradient::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.12), transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(249, 115, 22, 0.08),  transparent 50%),
    linear-gradient(135deg, #0f0a1a 0%, #1a1228 50%, #0f0a1a 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Keep the body itself solid dark as a fallback */
.bg-gradient {
  background-color: #0f0a1a;
}

@keyframes gradientShift {
  0%   { background-position: 0%   0%; }
  100% { background-position: 100% 100%; }
}

/* ── Noise Texture Overlay ── */
.noise-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Container — fluid, responsive ── */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

@media (min-width: 600px) {
  .container { max-width: 560px; }
}

@media (min-width: 768px) {
  .container { max-width: 720px; }
}

@media (min-width: 1024px) {
  .container {
    max-width: 960px;
    padding: 0 var(--space-8);
  }
}

@media (min-width: 1280px) {
  .container { max-width: 1100px; }
}

/* ── Utility Classes ── */
.text-center  { text-align: center; }

.text-gradient {
  background: linear-gradient(90deg, var(--purple-400), var(--coral-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: var(--dark-800); }
::-webkit-scrollbar-thumb {
  background: var(--purple-600);
  border-radius: var(--radius-full);
}

/* ── Page Transitions ── */
.page-fade-in {
  animation: pageFadeIn 0.4s ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Stars Background ── */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--purple-300);
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.5); }
}