/* ================================================================
   ANIVYX — DESIGN SYSTEM v2
   Glass · Gloss · Motion · Depth
   ================================================================ */

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

/* ===== DESIGN TOKENS ===== */
:root {
  /* Backgrounds */
  --bg-primary:      #080810;
  --bg-surface:      #0f0f18;
  --bg-card:         #13131e;
  --bg-elevated:     #1a1a28;

  /* Accent — Anivyx Crimson */
  --accent:          #c0292a;
  --accent-hover:    #e0312f;
  --accent-dim:      rgba(192, 41, 42, 0.14);
  --accent-glow:     rgba(192, 41, 42, 0.5);
  --accent-glow-soft:rgba(192, 41, 42, 0.2);

  /* Text */
  --text-primary:    #ffffff;
  --text-secondary:  rgba(255,255,255,0.87);
  --text-muted:      rgba(255,255,255,0.52);
  --text-subtle:     rgba(255,255,255,0.28);

  /* Borders */
  --border:          rgba(255,255,255,0.07);
  --border-hover:    rgba(255,255,255,0.15);
  --border-glass:    rgba(255,255,255,0.10);

  /* Glass system */
  --glass-bg:        rgba(255,255,255,0.035);
  --glass-bg-mid:    rgba(255,255,255,0.055);
  --glass-bg-hover:  rgba(255,255,255,0.07);
  --glass-border:    rgba(255,255,255,0.09);
  --glass-blur:      blur(24px);
  --glass-blur-heavy:blur(48px);

  /* Gloss */
  --gloss-line:      rgba(255,255,255,0.10);
  --gloss-sweep:     linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.07) 50%, transparent 70%);

  /* Overlays */
  --overlay-dark:    rgba(8,8,16,0.88);
  --overlay-hero:    linear-gradient(to top, #080810 0%, rgba(8,8,16,0.55) 55%, rgba(8,8,16,0.05) 100%);

  /* Font */
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radius — soft Apple-grade curves */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* Motion tokens */
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.6, 1);
  --ease-bounce:  cubic-bezier(0.68, -0.55, 0.265, 1.55);

  --transition-fast: 160ms var(--ease-out);
  --transition-base: 280ms var(--ease-smooth);
  --transition-slow: 480ms var(--ease-smooth);
  --transition-spring: 380ms var(--ease-spring);
  --transition-page: 420ms var(--ease-out);

  /* Soft depth shadows — no harsh black */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-md:   0 4px 18px rgba(0,0,0,0.30), 0 2px 6px rgba(0,0,0,0.18);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.40), 0 4px 14px rgba(0,0,0,0.20);
  --shadow-card: 0 24px 64px rgba(0,0,0,0.52), 0 8px 24px rgba(0,0,0,0.28);
  --shadow-glow: 0 0 28px var(--accent-glow), 0 0 56px var(--accent-glow-soft);
  --shadow-glass:0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.20), inset 0 1px 0 var(--gloss-line);

  --navbar-h: 68px;
  --page-px:  clamp(1.25rem, 4.5vw, 5rem);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg-primary:      #f4f5f7;
  --bg-surface:      #ffffff;
  --bg-card:         #ffffff;
  --bg-elevated:     #ffffff;

  --accent:          #e11d48;
  --accent-hover:    #be123c;
  --accent-dim:      rgba(225, 29, 72, 0.1);
  --accent-glow:     rgba(225, 29, 72, 0.2);
  --accent-glow-soft:rgba(225, 29, 72, 0.1);

  --text-primary:    #111827;
  --text-secondary:  #374151;
  --text-muted:      #6b7280;
  --text-subtle:     #9ca3af;

  --border:          rgba(0,0,0,0.08);
  --border-hover:    rgba(0,0,0,0.15);
  --border-glass:    rgba(0,0,0,0.1);

  --glass-bg:        rgba(255,255,255,0.7);
  --glass-bg-mid:    rgba(255,255,255,0.85);
  --glass-bg-hover:  rgba(255,255,255,0.95);
  --glass-border:    rgba(0,0,0,0.06);

  --gloss-line:      rgba(0,0,0,0.05);
  --gloss-sweep:     linear-gradient(135deg, transparent 30%, rgba(0,0,0,0.03) 50%, transparent 70%);

  --overlay-dark:    rgba(255,255,255,0.9);
  --overlay-hero:    linear-gradient(to top, #f4f5f7 0%, rgba(244,245,247,0.7) 55%, rgba(244,245,247,0) 100%);

  --shadow-sm:       0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:       0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:       0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-card:     0 4px 15px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  --shadow-glass:    0 8px 32px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ===== BASE ===== */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise texture overlay for depth */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(2rem,5vw,3.5rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.25rem,3vw,1.75rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
p  { font-size: 0.9375rem; line-height: 1.7; color: var(--text-secondary); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem; font-weight: 700;
  transition: all var(--transition-base);
  white-space: nowrap; user-select: none;
  position: relative; overflow: hidden;
  cursor: pointer; border: none;
}
/* Gloss layer on all buttons */
.btn::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.10), transparent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  pointer-events: none;
}
.btn:active { transform: scale(0.97) !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9a1f1f);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow-soft);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.btn-ghost:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-icon {
  width: 44px; height: 44px; padding: 0;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
}
.btn-lg { padding: 0.875rem 2.25rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8125rem; }

/* ===== BADGES / TAGS ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.65rem; border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #9a1f1f);
  color: #fff;
}
.tag {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.85rem; border-radius: var(--radius-full);
  font-size: 0.8125rem; font-weight: 500;
  background: var(--glass-bg); color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: all var(--transition-fast);
}
.tag:hover { background: var(--glass-bg-hover); border-color: var(--border-hover); }

/* ===== RATING ===== */
.rating {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.875rem; font-weight: 700; color: #fbbf24;
}
.rating svg { width: 14px; height: 14px; stroke: #fbbf24; fill: none; }

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Glass utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

/* ===== KEYFRAMES ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes pageReveal {
  from { opacity: 0; transform: translateY(14px) scale(0.99); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    filter: blur(0px); }
}

@keyframes blurIn {
  from { opacity: 0; filter: blur(10px); transform: scale(0.98); }
  to   { opacity: 1; filter: blur(0px);  transform: scale(1); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  from { background-position: -700px 0; }
  to   { background-position:  700px 0; }
}

@keyframes shimmerSweep {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

@keyframes heroZoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1.0); }
}

@keyframes heroFade {
  0%   { opacity: 0; transform: scale(1.06); }
  10%  { opacity: 1; transform: scale(1); }
  90%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.97); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 16px var(--accent-glow-soft); }
  50%       { box-shadow: var(--shadow-glow); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.45; } }

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

@keyframes borderGlow {
  0%, 100% { border-color: rgba(192,41,42,0.3); }
  50%       { border-color: rgba(192,41,42,0.7); }
}

/* ===== PAGE TRANSITION ===== */
.page-enter { animation: pageReveal var(--transition-page) var(--ease-out) both; }

/* ===== STAGGER HELPERS ===== */
.stagger-1 { animation-delay: 60ms; }
.stagger-2 { animation-delay: 120ms; }
.stagger-3 { animation-delay: 180ms; }
.stagger-4 { animation-delay: 240ms; }
.stagger-5 { animation-delay: 300ms; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
