/**
 * SigmaChess - Ultra Premium Design System v2.0
 * Handcrafted Dark Luxury Theme
 * Deep Navy + Black + Gold + Glassmorphism
 */

:root {
  /* ===== Gold Palette - Refined Luxury ===== */
  --gold: #D4A853;
  --gold-light: #F0D48A;
  --gold-dark: #A07D2E;
  --gold-deep: #7A5C1A;
  --gold-muted: rgba(212, 168, 83, 0.6);
  --gold-gradient: linear-gradient(135deg, #D4A853 0%, #F0D48A 40%, #D4A853 70%, #A07D2E 100%);
  --gold-gradient-subtle: linear-gradient(135deg, rgba(212, 168, 83, 0.15) 0%, rgba(240, 212, 138, 0.08) 100%);
  --gold-shimmer: linear-gradient(90deg, transparent 0%, rgba(212, 168, 83, 0.5) 50%, transparent 100%);
  --gold-text-gradient: linear-gradient(135deg, #F0D48A 0%, #D4A853 50%, #A07D2E 100%);
  
  /* ===== Dark Palette - True Depth ===== */
  --dark-void: #020205;
  --dark-abyss: #050508;
  --dark-primary: #08080E;
  --dark-secondary: #0C0C14;
  --dark-tertiary: #10101C;
  --dark-elevated: #161625;
  --dark-surface: #1C1C2E;
  --dark-hover: #222238;
  --dark-navy: #0A0A1A;
  --dark-navy-deep: #060612;
  
  /* ===== Background System ===== */
  --bg-body: #050508;
  --bg-section-1: #08080E;
  --bg-section-2: #0C0C14;
  --bg-section-3: #10101C;
  --bg-card: rgba(22, 22, 37, 0.6);
  --bg-card-hover: rgba(28, 28, 46, 0.8);
  --bg-glass: rgba(8, 8, 14, 0.75);
  --bg-glass-light: rgba(255, 255, 255, 0.02);
  --bg-glass-gold: rgba(212, 168, 83, 0.03);
  --bg-input: rgba(16, 16, 28, 0.8);
  
  /* ===== Text Colors ===== */
  --text-primary: #FFFFFF;
  --text-secondary: #E8E4DC;
  --text-tertiary: #B8B4AC;
  --text-muted: #7A7888;
  --text-dim: #5A586A;
  --text-gold: #D4A853;
  --text-gold-light: #F0D48A;
  
  /* ===== Typography ===== */
  --font-primary: 'Tajawal', sans-serif;
  --font-display: 'Tajawal', sans-serif;
  
  /* ===== Font Scale - Modular ===== */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.15rem;
  --fs-4xl: 2.65rem;
  --fs-5xl: 3.15rem;
  --fs-6xl: 3.8rem;
  --fs-7xl: 4.6rem;
  --fs-8xl: 5.4rem;
  --fs-hero: clamp(2.8rem, 5.2vw, 5.6rem);
  
  /* ===== Spacing Scale ===== */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-14: 3.5rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;
  --sp-40: 10rem;
  --sp-48: 12rem;
  --sp-section: clamp(4rem, 7vw, 6.5rem);
  
  /* ===== Border Radius ===== */
  --radius-xs: 0.25rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-4xl: 2.5rem;
  --radius-full: 9999px;
  
  /* ===== Shadows - Layered Depth ===== */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 4px 24px rgba(212, 168, 83, 0.2);
  --shadow-gold-lg: 0 8px 40px rgba(212, 168, 83, 0.3);
  --shadow-gold-glow: 0 0 40px rgba(212, 168, 83, 0.15), 0 0 80px rgba(212, 168, 83, 0.08);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(212, 168, 83, 0.05);
  --shadow-card-hover: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 168, 83, 0.15);
  
  /* ===== Glass Effects ===== */
  --glass-border: rgba(212, 168, 83, 0.08);
  --glass-border-hover: rgba(212, 168, 83, 0.2);
  --glass-blur: blur(20px);
  --glass-blur-heavy: blur(40px);
  --glass-blur-ultra: blur(60px);
  
  /* ===== Transitions ===== */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 600ms;
  --duration-slower: 800ms;
  --transition-fast: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 400ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-elegant: 800ms cubic-bezier(0.19, 1, 0.22, 1);
  
  /* ===== Z-Index Scale ===== */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-header: 500;
  --z-overlay: 800;
  --z-modal: 900;
  --z-loader: 9999;
  
  /* ===== Layout ===== */
  --container-max: 1240px;
  --container-narrow: 900px;
  --container-padding: 1.5rem;
  --header-height: 78px;
  --header-height-scrolled: 68px;
  
  /* ===== Noise Texture ===== */
  --noise-opacity: 0.03;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis handles smooth scroll */
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text-secondary);
  background-color: var(--bg-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  direction: rtl;
  text-align: right;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-normal);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 800;
  color: var(--text-primary);
}

/* ===== Utility Classes ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ===== Premium Section Title System ===== */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5);
  background: rgba(212, 168, 83, 0.06);
  border: 1px solid rgba(212, 168, 83, 0.15);
  border-radius: var(--radius-full);
  color: var(--gold);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--sp-6);
  letter-spacing: 0.5px;
}

.section-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(212, 168, 83, 0.6);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.section-title .gold {
  background: var(--gold-text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-description {
  font-size: var(--fs-md);
  color: var(--text-muted);
  line-height: 1.9;
  max-width: 600px;
}

.section-header {
  margin-bottom: var(--sp-16);
}

.section-header.center {
  text-align: center;
}

.section-header.center .section-description {
  margin: 0 auto;
}

/* ===== Premium Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-8);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--fs-base);
  transition: var(--transition-normal);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: var(--gold-shimmer);
  transition: var(--transition-slow);
}

.btn:hover::before {
  right: 100%;
}

.btn-gold {
  background: var(--gold-gradient);
  color: var(--dark-primary);
  box-shadow: var(--shadow-gold);
  border: none;
}

.btn-gold:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-gold-lg);
}

.btn-gold:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid rgba(212, 168, 83, 0.3);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(212, 168, 83, 0.08);
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
  color: var(--gold);
}

.btn-glass {
  background: rgba(212, 168, 83, 0.06);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 83, 0.15);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(212, 168, 83, 0.12);
  border-color: rgba(212, 168, 83, 0.4);
  transform: translateY(-2px);
}

.btn-sm {
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--fs-sm);
}

.btn-lg {
  padding: var(--sp-5) var(--sp-10);
  font-size: var(--fs-md);
}

/* ===== View All Link ===== */
.view-all {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--gold);
  font-weight: 600;
  font-size: var(--fs-base);
  transition: var(--transition-normal);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
}

.view-all:hover {
  gap: var(--sp-4);
  background: rgba(212, 168, 83, 0.06);
}

.view-all svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transform: rotate(180deg);
  transition: var(--transition-normal);
}

.view-all:hover svg {
  transform: rotate(180deg) translateX(4px);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root {
    --container-padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 1rem;
  }
}

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

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ===== Selection ===== */
::selection {
  background: rgba(212, 168, 83, 0.3);
  color: var(--text-primary);
}