/* ==========================================================================
   MDMN CHESS - PREMIUM 3D & GLASSMORPHISM DESIGN SYSTEM
   Theme: Deep Midnight Navy, Regal Gold, Electric Purple, Cyber Teal
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');


/* --------------------------------------------------------------------------
   1. CSS VARIABLES & THEMES
   -------------------------------------------------------------------------- */
:root {
  /* Dark Mode Default - Deep Midnight Navy & Regal Gold */
  --bg-primary: #070B14;
  --bg-secondary: #0F172A;
  --bg-tertiary: #1E293B;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.75);
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --accent-gold: #F59E0B;
  --accent-gold-bright: #FBBF24;
  --accent-gold-hover: #D97706;
  --accent-gold-light: rgba(245, 158, 11, 0.12);
  --accent-gold-glow: rgba(245, 158, 11, 0.35);
  
  --brand-yellow: #FFD200;
  --brand-yellow-bright: #FFE033;
  --brand-yellow-hover: #E6BD00;
  --brand-yellow-light: rgba(255, 210, 0, 0.15);
  --brand-yellow-glow: rgba(255, 210, 0, 0.35);
  
  --accent-purple: #C9A227;
  --accent-purple-light: rgba(255, 210, 0, 0.14);
  --accent-teal: #14B8A6;
  --accent-teal-light: rgba(20, 184, 166, 0.15);
  --accent-emerald: #10B981;
  --accent-emerald-light: rgba(16, 185, 129, 0.12);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(245, 158, 11, 0.4);
  --border-purple: rgba(139, 92, 246, 0.4);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 32px 80px rgba(0, 0, 0, 0.75);
  --shadow-gold: 0 0 30px rgba(245, 158, 11, 0.25);
  --shadow-purple: 0 0 30px rgba(139, 92, 246, 0.25);
  
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ar-heading: 'Cairo', 'Tajawal', -apple-system, sans-serif;
  --font-ar-body: 'Tajawal', 'Cairo', -apple-system, sans-serif;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --container-width: 1240px;
  --header-height: 80px;
}

/* Light Mode Override */
[data-theme="light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  
  --accent-gold: #D97706;
  --accent-gold-bright: #F59E0B;
  --accent-gold-hover: #B45309;
  --accent-gold-light: rgba(217, 119, 6, 0.12);
  --accent-gold-glow: rgba(217, 119, 6, 0.2);
  
  --brand-yellow: #D9A800;
  --brand-yellow-bright: #F5BE00;
  --brand-yellow-hover: #B88E00;
  --brand-yellow-light: rgba(217, 168, 0, 0.14);
  --brand-yellow-glow: rgba(217, 168, 0, 0.25);
  
  --accent-purple: #B8860B;
  --accent-purple-light: rgba(184, 134, 11, 0.12);
  --accent-teal: #0D9488;
  --accent-teal-light: rgba(13, 148, 136, 0.12);
  --accent-emerald: #059669;
  --accent-emerald-light: rgba(5, 150, 105, 0.12);
  
  --border-color: rgba(15, 23, 42, 0.08);
  --border-highlight: rgba(217, 119, 6, 0.35);
  --border-purple: rgba(124, 58, 237, 0.35);
  
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 32px 80px rgba(15, 23, 42, 0.18);
  --shadow-gold: 0 0 25px rgba(217, 119, 6, 0.15);
  --shadow-purple: 0 0 25px rgba(124, 58, 237, 0.15);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESETS & NOISE OVERLAY FILTER
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Royal Gold Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-yellow), var(--accent-gold));
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--brand-yellow-bright), var(--accent-gold-hover));
}

/* Gold Selection Highlight */
::selection {
  background: var(--accent-gold);
  color: #070B14;
}

/* Accessibility Focus Ring & Skip Link */
:focus-visible {
  outline: 2px solid var(--accent-gold) !important;
  outline-offset: 3px !important;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-gold);
  color: #070B14;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}
[dir="rtl"] .skip-link {
  left: auto;
  right: 1rem;
}

/* 3D Skeuomorphic Icon System (Microsoft Fluent 3D + Icons8 3D Fluency) */
.icon-3d {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

.icon-3d.sm, .icon-sm { width: 20px; height: 20px; }
.icon-3d.md, .icon-md { width: 32px; height: 32px; }
.icon-3d.lg, .icon-lg { width: 48px; height: 48px; }
.icon-3d.xl, .icon-xl { width: 64px; height: 64px; }

.icon-3d:hover {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 6px 16px var(--accent-gold-glow));
}

/* RTL Flip for Directional Icons */
[dir="rtl"] .flip-rtl {
  transform: scaleX(-1);
}
[dir="rtl"] .flip-rtl:hover {
  transform: translateY(-2px) scaleX(-1) scale(1.08);
}

.icon-fallback {
  display: inline-block;
  vertical-align: middle;
}

/* Subtle Legal Footer Attribution */
.footer-attribution {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  opacity: 0.8;
}
.footer-attribution a {
  color: var(--text-secondary);
  text-decoration: underline;
  transition: color var(--transition-fast);
}
.footer-attribution a:hover {
  color: var(--accent-gold);
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-transparency: reduce) {
  .icon-3d {
    filter: none !important;
    transition: none !important;
  }
}

/* Cinematic vignette */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(7, 11, 20, 0.55) 100%);
}

/* Film grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 3;
}

/* Three.js Fixed Background WebGL Canvas */
#three-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

/* Protective Readability Gradient Overlay */
.bg-readability-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(7, 11, 20, 0.45) 0%, rgba(7, 11, 20, 0.75) 65%, rgba(7, 11, 20, 0.92) 100%);
}

[data-theme="light"] .bg-readability-overlay {
  background: radial-gradient(circle at 50% 45%, rgba(248, 250, 252, 0.35) 0%, rgba(248, 250, 252, 0.7) 65%, rgba(248, 250, 252, 0.88) 100%);
}

/* --------------------------------------------------------------------------
   BRAND LOGO & CHIP REUSABLE DESIGN SYSTEM
   -------------------------------------------------------------------------- */
.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E8E8E8;
  border: 1px solid var(--border-highlight);
  border-radius: 12px;
  padding: 4px 10px;
  box-shadow: 0 0 14px var(--brand-yellow-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
  user-select: none;
}

[data-theme="dark"] .logo-chip {
  background: #E8E8E8;
  border-color: var(--border-highlight);
  box-shadow: 0 0 16px var(--brand-yellow-glow);
}

[data-theme="light"] .logo-chip {
  background: #FFFFFF;
  border: 1.5px solid var(--brand-yellow);
  box-shadow: 0 4px 14px rgba(217, 168, 0, 0.2);
}

.logo-chip:hover {
  transform: scale(1.03);
  box-shadow: 0 0 24px var(--brand-yellow);
  border-color: var(--brand-yellow);
}

.logo-chip img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* --------------------------------------------------------------------------
   3. ANIMATED LOADING OVERLAY
   -------------------------------------------------------------------------- */
#loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #070B14;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo-chip {
  width: 200px;
  max-width: 80vw;
  padding: 12px 20px;
  border-radius: 18px;
  background: #E8E8E8;
  border: 2px solid var(--brand-yellow);
  box-shadow: 0 0 35px var(--brand-yellow-glow);
  animation: floatLogo 2.2s ease-in-out infinite;
}

.loader-logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

@keyframes floatLogo {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 25px var(--brand-yellow-glow);
  }
  50% {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 0 45px var(--brand-yellow);
  }
}

.loader-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.loader-title span {
  color: var(--accent-gold);
}

.loader-bar-bg {
  width: 220px;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #B8860B, #FFD200, #B8860B);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   4. PAWN SCROLL PROGRESS BAR
   -------------------------------------------------------------------------- */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 1001;
  background: transparent;
  pointer-events: none;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #B8860B, #FFD200, #B8860B);
  box-shadow: 0 0 12px var(--accent-gold);
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   5. BASE TYPOGRAPHY & LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--text-primary);
  font-weight: 700;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

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

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

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.gradient-text-gold {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-purple {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6.5rem 0;
  position: relative;
  z-index: 2;
}

.section::before {
  content: '';
  display: block;
  width: 200px;
  height: 24px;
  margin: 0 auto 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 24' fill='none'%3E%3Cpath d='M10 12h70M190 12h-70' stroke='%23FFD200' stroke-width='1' opacity='0.7'/%3E%3Cpath d='M100 3 L104 10 L112 12 L104 14 L100 21 L96 14 L88 12 L96 10 Z' fill='%23FFD200'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

@media (max-width: 768px) {
  .section {
    padding: 4.5rem 0;
  }
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 4rem;
}

.section-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-gold);
  background: var(--accent-gold-light);
  padding: 0.35rem 1.1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  border: 1px solid var(--border-highlight);
}

.section-title {
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.section-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   6. BUTTONS & GLASS CARDS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem 1.85rem;
  font-weight: 700;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-hover) 100%);
  color: #070B14;
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.45);
  color: #000000;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-3px);
  color: var(--accent-gold);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: var(--accent-gold-light);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Glassmorphism Card with 3D Tilt Physics */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-fast);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

.glass-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.tilt-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

/* --------------------------------------------------------------------------
   7. NAVIGATION BAR
   -------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
  height: 72px;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
}

.nav-logo-chip {
  height: 46px;
  padding: 4px 12px;
  border-radius: 12px;
}

.nav-logo-chip img {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.brand-text span {
  color: var(--brand-yellow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-gold);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 2px;
  transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border-color: var(--border-highlight);
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--bg-secondary);
    padding: 2.5rem 2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    z-index: 9999;
  }
  
  .nav-menu.open {
    transform: translateX(0);
  }
  
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 1.25rem;
  }
  
  .nav-link {
    font-size: 1.15rem;
    width: 100%;
    padding: 0.75rem 0;
    display: block;
    min-height: 44px;
  }
}

/* --------------------------------------------------------------------------
   8. HERO SECTION & ULTRA-PREMIUM PORTRAIT FRAME
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  padding-top: calc(var(--header-height) + 3.5rem);
  padding-bottom: 5rem;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  background:
    radial-gradient(ellipse at 72% 12%, rgba(255, 210, 0, 0.22) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 30%, rgba(255, 210, 0, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(7, 11, 20, 0.9) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 80%, rgba(7, 11, 20, 0.85) 0%, transparent 50%);
}

/* Subtle ambient chess pattern overlay */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 158, 11, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.25;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
}

@media (max-width: 992px) {
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
  }
  .hero-media {
    order: -1; /* Portrait image ABOVE text on mobile */
    width: 100%;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 1.2rem;
  background: var(--accent-gold-light);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-full);
  color: var(--accent-gold);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-gold);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: clamp(2rem, 1.2rem + 4vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem);
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
}

.hero-intro {
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.125rem);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 630px;
}

@media (max-width: 992px) {
  .hero-intro {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

@media (max-width: 992px) {
  .hero-actions {
    justify-content: center;
  }
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem);
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ULTRA-PREMIUM ANIMATED GRADIENT PORTRAIT FRAME */
.portrait-frame-animated {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border-radius: 28px;
  padding: 6px;
  background: linear-gradient(135deg, #FFD200, #F5C518, #B8860B, #FFD200);
  background-size: 300% 300%;
  animation: gradientShift 10s ease infinite;
  box-shadow: 0 0 60px rgba(255, 210, 0, 0.4), var(--shadow-xl);
  transform-style: preserve-3d;
}

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

.portrait-frame-animated img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 22px;
  display: block;
}

.hero-portrait-brand-sticker {
  position: absolute;
  bottom: -18px;
  right: -18px;
  height: 52px;
  padding: 6px 14px;
  border-radius: 14px;
  background: #E8E8E8;
  border: 2px solid var(--brand-yellow);
  box-shadow: 0 0 25px var(--brand-yellow-glow);
  transform: rotate(-6deg);
  z-index: 10;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hero-portrait-brand-sticker:hover {
  transform: rotate(0deg) scale(1.08);
  box-shadow: 0 0 38px var(--brand-yellow);
  border-color: var(--brand-yellow-bright);
}

.hero-portrait-brand-sticker img {
  height: 38px;
  width: auto;
}

/* --------------------------------------------------------------------------
   9. ABOUT ME SECTION
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3.5rem;
  align-items: center;
}

@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-portrait-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.about-portrait-card img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center 25%;
}

.fide-badge-overlay {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-gold);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.9rem;
}

.about-philosophy-quote {
  background: rgba(7, 11, 20, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 210, 0, 0.15);
  border-left: 4px solid var(--accent-gold);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0 2rem;
  font-size: 1.2rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text-primary);
}

.about-story-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   10. SKILLS SECTION (3D TILT CARDS)
   -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 992px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.category-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.skill-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skill-item-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.925rem;
  font-weight: 600;
}

.skill-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold) 0%, #B8860B 100%);
  border-radius: var(--radius-full);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.skill-tag {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   11. PROJECTS SECTION
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.badge-gold {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border: 1px solid var(--border-highlight);
}

.badge-purple {
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  border: 1px solid var(--border-purple);
}

.badge-teal {
  background: var(--accent-teal-light);
  color: var(--accent-teal);
  border: 1px solid rgba(20, 184, 166, 0.3);
}

.project-title {
  font-size: 1.45rem;
  margin-bottom: 0.85rem;
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.metric-val {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent-gold);
}

.metric-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   12. WRITINGS / BLOG HUB (PREMIUM CARDS WITH SHINE EFFECT)
   -------------------------------------------------------------------------- */
.blog-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-gold);
  color: #070B14;
  border-color: var(--accent-gold);
  font-weight: 700;
}

/* PREMIUM WRITING CARD WITH SHINE SWEEP EFFECT */
.premium-writing-card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.premium-writing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.15), transparent);
  transform: skewX(-25deg);
  transition: left 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-writing-card:hover::before {
  left: 150%;
}

.premium-writing-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.premium-writing-card .article-title {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.flagship-article-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.06) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  align-items: center;
}

@media (max-width: 992px) {
  .flagship-article-card {
    grid-template-columns: 1fr;
    padding: 2rem;
  }
}

.flagship-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-gold);
  color: #070B14;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.flagship-title {
  font-size: 2.1rem;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 992px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   13. PREMIUM LICHESS CHESSBOARD & STRATEGY DEMO
   -------------------------------------------------------------------------- */
.chess-demo-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.chess-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

@media (max-width: 992px) {
  .chess-demo-grid {
    grid-template-columns: 1fr;
  }
}

/* Lichess Board Wrapper with Coordinates */
#chess-board-container,
.board-container-wrapper {
  position: relative;
  padding: 12px;
  background: #1E293B;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  width: min(90vw, 500px);
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.board-wrapper {
  width: 100%;
}

/* Chessboard.js Custom Overrides for Premium Look */
#tactics-board {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  touch-action: none;
}

/* Custom board colors to match our design */
.white-1e1d7 {
  background-color: #E8D5B5 !important;
}

.black-3c85d {
  background-color: #8B6F47 !important;
}

/* Piece styling */
.piece {
  cursor: pointer;
  transition: transform 0.1s ease;
}

.piece:hover {
  transform: scale(1.05);
}

/* Highlight last move */
.highlight-move {
  background-color: rgba(245, 158, 11, 0.4) !important;
}

/* Highlight selected square */
.highlight-square {
  background-color: rgba(245, 158, 11, 0.3) !important;
}

/* Loading indicator */
.board-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 360px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   14. TIMELINE, SERVICES & CAREER OBJECTIVE
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-gold) 0%, #B8860B 100%);
}

@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
}

.timeline-item {
  position: relative;
  margin-bottom: 3.5rem;
  width: 50%;
  padding-right: 3rem;
}

.timeline-item:nth-child(even) {
  margin-left: 50%;
  padding-right: 0;
  padding-left: 3rem;
}

@media (max-width: 768px) {
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 3.5rem;
    padding-right: 0;
  }
}

.timeline-dot {
  position: absolute;
  top: 0;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 4px solid var(--accent-gold);
  box-shadow: 0 0 15px var(--accent-gold);
  z-index: 2;
}

.timeline-item:nth-child(even) .timeline-dot {
  right: auto;
  left: -12px;
}

@media (max-width: 768px) {
  .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 8px;
    right: auto;
  }
}

/* Highlighted Career Objective Box */
.objective-box {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(245, 158, 11, 0.08) 50%, rgba(139, 92, 246, 0.08) 100%);
  border: 2px solid var(--accent-gold);
  border-radius: 24px;
  padding: 3.5rem 3rem;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   15. CONTACT FORM & SOCIAL CONNECT
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3.5rem;
}

@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.social-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.social-card:hover {
  border-color: var(--accent-gold);
  transform: translateX(6px);
}

.social-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-light);
}

/* Modal Overlay Reader */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(14px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-container:focus-visible,
.sq:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-gold);
  outline-offset: 3px;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: 24px;
  max-width: 840px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 3rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
}

.footer-logo-chip {
  padding: 8px 22px;
  border-radius: 16px;
  background: #E8E8E8;
  border: 1.5px solid var(--border-highlight);
  box-shadow: 0 0 22px var(--brand-yellow-glow);
}

.footer-logo-chip:hover {
  transform: scale(1.05);
  box-shadow: 0 0 32px var(--brand-yellow);
  border-color: var(--brand-yellow);
}

.footer-tagline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-yellow);
  letter-spacing: 0.04em;
  opacity: 0.95;
}

/* --------------------------------------------------------------------------
   16. SCROLL REVEAL ANIMATIONS & STAGGER DELAY UTILITIES
   -------------------------------------------------------------------------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* --------------------------------------------------------------------------
   17. 3D ICON SYSTEM
   -------------------------------------------------------------------------- */
.icon-3d {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.icon-3d:hover {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 4px 8px rgba(245, 158, 11, 0.4));
}

.icon-3d.sm {
  width: 20px;
  height: 20px;
}

.icon-3d.md {
  width: 32px;
  height: 32px;
}

.icon-3d.lg {
  width: 48px;
  height: 48px;
}

.icon-3d.xl {
  width: 64px;
  height: 64px;
}

/* RTL flip for directional icons */
[dir="rtl"] .icon-3d.flip-rtl {
  transform: scaleX(-1);
}

/* Icon fallback for broken images */
.icon-fallback {
  display: none;
}

.icon-3d.error + .icon-fallback {
  display: inline-block;
}

/* Responsive Grid Layout Classes */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.objective-points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-bottom-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  #three-canvas { display: none; }

  .portrait-frame-animated img,
  .about-portrait-card img { height: 360px; }

  .objective-box { padding: 2.25rem 1.35rem; }
  .modal-overlay { padding: 1rem; }
  .modal-container { padding: 2.25rem 1.25rem; max-height: 90vh; }

  .footer-bottom-grid {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 1.25rem;
  }
}

@media (hover: none) {
  .logo-chip:hover,
  .btn-primary:hover,
  .glass-card:hover,
  .social-card:hover,
  .premium-writing-card:hover {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  #three-canvas { display: none; }
  .animate-on-scroll { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   CONTACT FORM FORMSPREE AJAX FEEDBACK STYLES
   -------------------------------------------------------------------------- */
.form-status {
  display: none;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 600;
  transition: all var(--transition-normal);
  animation: fadeInStatus 0.4s ease-out forwards;
}

@keyframes fadeInStatus {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.form-status.success {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid var(--brand-yellow);
  color: var(--text-primary);
  box-shadow: 0 0 20px var(--brand-yellow-glow);
}

.form-status.error {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid #EF4444;
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.form-status-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.spinner-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(7, 11, 20, 0.3);
  border-top-color: #070B14;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.35rem;
}

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

/* --------------------------------------------------------------------------
   PRIVACY POLICY PAGE STYLES & TRUST SIGNALS
   -------------------------------------------------------------------------- */
.privacy-hero-card {
  text-align: center;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.privacy-shield-container {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent-gold-light);
  border: 2px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 25px var(--accent-gold-glow);
}

.privacy-hero-title {
  font-size: clamp(1.8rem, 1.3rem + 2vw, 3rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.privacy-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-gold);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
}

.privacy-content-card {
  padding: 3rem 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .privacy-hero-card { padding: 2rem 1.25rem; }
  .privacy-content-card { padding: 2rem 1.25rem; }
}

.privacy-section-tag {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.privacy-block {
  margin-bottom: 2.5rem;
}

.privacy-block:last-child {
  margin-bottom: 0;
}

.privacy-block h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.65rem);
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.privacy-block p {
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.privacy-quote {
  background: var(--accent-gold-light);
  border-left: 4px solid var(--accent-gold);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-weight: 600;
  font-style: italic;
  color: var(--text-primary);
  margin: 1.25rem 0;
  font-size: 1rem;
}

.privacy-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.privacy-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: clamp(0.925rem, 0.9rem + 0.2vw, 1rem);
  line-height: 1.7;
}

[lang="ar"] .privacy-list li {
  padding-left: 0;
  padding-right: 1.5rem;
}

.privacy-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-gold);
  font-weight: 800;
}

[lang="ar"] .privacy-list li::before {
  left: auto;
  right: 0;
}

.privacy-highlight-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 1.25rem 0;
}

.lang-divider {
  text-align: center;
  position: relative;
  margin: 3.5rem 0;
}

.lang-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.lang-divider span {
  position: relative;
  background: var(--bg-primary);
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-highlight);
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.privacy-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: var(--accent-gold-light);
  border: 1px solid var(--border-highlight);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
}

.form-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.form-privacy-note a {
  color: var(--accent-gold);
  font-weight: 600;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   FOUNDER DEFINITION CARD (AI MODEL QUOTABLE BLOCK)
   -------------------------------------------------------------------------- */
.founder-definition-card {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-top: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.founder-def-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.founder-def-en {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.75;
  margin-bottom: 0.85rem;
}

.founder-def-ar {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   ROYAL FAQ ACCORDION SECTION
   -------------------------------------------------------------------------- */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-group-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-gold);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-highlight);
  margin-bottom: 0.5rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-highlight);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

[lang="ar"] .faq-question {
  text-align: right;
}

.faq-question:hover,
.faq-question.active {
  color: var(--accent-gold);
}

.faq-icon {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent-gold);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-question.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
  padding: 0 1.5rem;
  background: rgba(7, 11, 20, 0.4);
}

[data-theme="light"] .faq-answer {
  background: rgba(241, 245, 249, 0.6);
}

.faq-answer.open {
  max-height: 400px;
  padding: 1rem 1.5rem 1.5rem;
}

.faq-answer p {
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   RTL & ARABIC TYPOGRAPHY SYSTEM
   -------------------------------------------------------------------------- */
html[dir="rtl"], [dir="rtl"] {
  direction: rtl;
  text-align: right;
  font-family: var(--font-ar-body);
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: var(--font-ar-heading);
}

html[dir="rtl"] .stat-item {
  border-left: none;
  border-right: 2px solid var(--border-color);
  padding-left: 0;
  padding-right: 1.5rem;
}

html[dir="rtl"] .timeline-item {
  padding-left: 0;
  padding-right: 2.5rem;
}

html[dir="rtl"] .timeline-dot {
  left: auto;
  right: -9px;
}

html[dir="rtl"] .timeline::before {
  left: auto;
  right: 0;
}

/* Language Switcher Badge Button */
.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-full);
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.lang-switcher-btn:hover {
  background: var(--accent-gold);
  color: #070B14;
  box-shadow: 0 0 15px var(--accent-gold-glow);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   ARTICLES HUB & CARD GRID SYSTEM
   -------------------------------------------------------------------------- */
.articles-hub-hero {
  padding-top: calc(var(--header-height) + 3rem);
  padding-bottom: 3rem;
  text-align: center;
}

.articles-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
}

.hub-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-gold);
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.25);
}

.hub-card-cover {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #070b14 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.hub-card-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 158, 11, 0.15) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.4;
}

.hub-card-icon {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 12px var(--brand-yellow-glow));
  transition: transform var(--transition-normal);
}

.hub-card:hover .hub-card-icon {
  transform: scale(1.1) rotate(4deg);
}

.hub-card-badge-lang {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border: 1px solid var(--border-highlight);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

html[dir="rtl"] .hub-card-badge-lang {
  right: auto;
  left: 1rem;
}

.hub-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hub-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hub-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.hub-card:hover .hub-card-title {
  color: var(--accent-gold);
}

.hub-card-excerpt {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.hub-card-read-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   ARTICLE READING PAGE TYPOGRAPHY & LAYOUT
   -------------------------------------------------------------------------- */
.article-reading-page {
  padding-top: calc(var(--header-height) + 2.5rem);
  padding-bottom: 5rem;
}

.static-chess-pattern-bg {
  background-image: radial-gradient(rgba(245, 158, 11, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
}

.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.article-breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.article-breadcrumb a:hover {
  color: var(--accent-gold);
}

.article-header {
  margin-bottom: 2.5rem;
  text-align: left;
}

html[dir="rtl"] .article-header {
  text-align: right;
}

.article-title-main {
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.article-author-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.article-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.article-author-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.75rem;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 1.65rem;
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
  color: var(--accent-gold);
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.article-body ul, .article-body ol {
  margin-bottom: 1.75rem;
  padding-left: 1.75rem;
}

html[dir="rtl"] .article-body ul,
html[dir="rtl"] .article-body ol {
  padding-left: 0;
  padding-right: 1.75rem;
}

.article-body li {
  margin-bottom: 0.6rem;
}

.article-body blockquote {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-gold);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-primary);
}

html[dir="rtl"] .article-body blockquote {
  border-left: none;
  border-right: 4px solid var(--accent-gold);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.article-cta-card {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  margin-top: 3.5rem;
  box-shadow: var(--shadow-md);
}

.article-cta-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.article-cta-text {
  font-size: 0.975rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

/* ========================================
   EDITORIAL HERO TYPOGRAPHY
   ======================================== */

.hero-title-editorial {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.85;
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.03em;
  position: relative;
}

[dir="rtl"] .hero-title-editorial {
  align-items: flex-end;
  line-height: 1.2;
}

.hero-word-massive {
  font-family: 'Fraunces', 'Amiri', serif;
  font-weight: 900;
  font-size: clamp(4rem, 14vw, 11rem);
  color: #FFFFFF;
  text-shadow: 0 4px 40px rgba(255, 210, 0, 0.15);
  display: block;
  white-space: nowrap;
}

[dir="rtl"] .hero-word-massive {
  font-family: 'Amiri', 'Fraunces', serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-word-italic {
  font-family: 'Fraunces', 'Amiri', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 9rem);
  background: linear-gradient(135deg, #FFD200 0%, #F5C518 50%, #B8860B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: -0.15em;
  display: block;
  white-space: nowrap;
}

[dir="rtl"] .hero-word-italic {
  font-family: 'Amiri', 'Fraunces', serif;
  font-weight: 700;
  margin-top: 0;
}

.hero-founder {
  font-family: 'Fraunces', 'Amiri', serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-style: italic;
  color: rgba(255, 210, 0, 0.9);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 1.5rem 0 1rem 0;
  font-weight: 500;
}

[dir="rtl"] .hero-founder {
  font-family: 'Amiri', 'Fraunces', serif;
  text-transform: none;
}

.hero-quote {
  font-family: 'Fraunces', 'Amiri', serif;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-style: italic;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(7, 11, 20, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 210, 0, 0.15);
  border-left: 2px solid rgba(255, 210, 0, 0.4);
  padding: 1rem 1.15rem;
  max-width: 500px;
  margin: 1.5rem 0;
  border-radius: 0 12px 12px 0;
}

[dir="rtl"] .hero-quote {
  font-family: 'Amiri', 'Fraunces', serif;
  border-left: none;
  border-right: 2px solid rgba(255, 210, 0, 0.4);
  padding-left: 0;
  padding-right: 1rem;
}

/* Light theme override */
[data-theme="light"] .hero-word-massive {
  color: #070B14;
  text-shadow: 0 4px 40px rgba(184, 134, 11, 0.1);
}

[data-theme="light"] .hero-founder {
  color: rgba(184, 134, 11, 0.9);
}

[data-theme="light"] .hero-quote {
  color: rgba(7, 11, 20, 0.6);
}

/* Mobile refinement */
@media (max-width: 768px) {
  .hero-title-editorial {
    line-height: 0.9;
  }

  .hero-word-massive {
    font-size: clamp(3rem, 18vw, 5rem);
  }

  .hero-word-italic {
    font-size: clamp(2.5rem, 15vw, 4rem);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-title-editorial * {
    transition: none !important;
  }
}

/* ========================================
   ROYAL ARTIFACTS, LIFE TREE, EDITORIAL ARTICLES, CHESS UX
   ======================================== */

.hero-content {
  position: relative;
}

.hero-artifact-crown {
  position: absolute;
  right: -5%;
  top: 18%;
  width: clamp(72px, 12vw, 140px);
  height: auto;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(255, 210, 0, 0.65));
  animation: royalCrownSpin 6s linear infinite;
}

[dir="rtl"] .hero-artifact-crown {
  right: auto;
  left: -5%;
}

@keyframes royalCrownSpin {
  from { transform: rotate(-8deg); }
  to { transform: rotate(8deg); }
}

.section-artifact {
  position: absolute;
  top: 1.5rem;
  right: 4%;
  width: 72px;
  height: 72px;
  object-fit: contain;
  opacity: 0.6;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 8px 16px rgba(255, 210, 0, 0.35));
  animation: artifactFloat 7s ease-in-out infinite;
}

[dir="rtl"] .section-artifact {
  right: auto;
  left: 4%;
}

.section-artifact.artifact-book {
  animation: artifactFlutter 5s ease-in-out infinite;
}

.section-artifact.artifact-light {
  animation: artifactPulse 3.5s ease-in-out infinite;
}

.section-artifact.artifact-mail {
  animation: artifactFloat 6s ease-in-out infinite;
}

@keyframes artifactFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes artifactFlutter {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-8px); }
}

@keyframes artifactPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.06); }
}

[data-theme="light"] .section-artifact,
[data-theme="light"] .hero-artifact-crown {
  filter: drop-shadow(0 8px 14px rgba(7, 11, 20, 0.28));
}

[data-theme="dark"] .icon-3d {
  filter: drop-shadow(0 2px 8px rgba(255, 210, 0, 0.28));
}

.icon-3d:active {
  animation: iconPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.social-icon-box {
  position: relative;
  overflow: visible;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.social-icon-box:hover {
  transform: translateY(-8px) rotate(8deg);
}

.social-icon-box::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 0, 0.45) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.social-icon-box:hover::after {
  opacity: 1;
  animation: sparkBurst 0.6s ease-out;
}

@keyframes sparkBurst {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

.mobile-dust-canvas {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  .mobile-dust-canvas.is-active {
    display: block;
    background: radial-gradient(ellipse at 70% 0%, rgba(255, 210, 0, 0.18), transparent 45%),
                radial-gradient(ellipse at center, #0b1220 0%, #070B14 70%);
  }

  .hero-artifact-crown,
  .section-artifact {
    width: 48px;
    height: 48px;
    opacity: 0.45;
  }
}

/* Life Tree */
.life-tree-section {
  overflow: hidden;
}

.section-title-editorial {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 3.5rem;
  line-height: 0.95;
}

.section-title-editorial .title-massive {
  font-family: 'Fraunces', 'Amiri', serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  color: var(--text-primary);
}

.section-title-editorial .title-italic {
  font-family: 'Fraunces', 'Amiri', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  background: linear-gradient(135deg, #FFD200, #B8860B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[dir="rtl"] .section-title-editorial .title-massive,
[dir="rtl"] .section-title-editorial .title-italic {
  font-family: 'Amiri', 'Fraunces', serif;
  font-weight: 700;
}

.life-tree-wrap {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.tree-trunk {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(255, 210, 0, 0.15), #FFD200, rgba(255, 210, 0, 0.2));
  border-radius: 99px;
  box-shadow: 0 0 18px rgba(255, 210, 0, 0.35);
}

.tree-stage {
  position: relative;
  width: 50%;
  padding: 0 3rem 3rem 0;
  margin-bottom: 0.5rem;
}

.tree-stage:nth-child(even) {
  margin-left: 50%;
  padding: 0 0 3rem 3rem;
}

.tree-node {
  position: absolute;
  top: 1.4rem;
  right: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFD200;
  box-shadow: 0 0 0 6px rgba(255, 210, 0, 0.18), 0 0 22px rgba(255, 210, 0, 0.7);
  z-index: 2;
}

.tree-stage:nth-child(even) .tree-node {
  right: auto;
  left: -10px;
}

.tree-node-final {
  animation: finalNodePulse 2.4s ease-in-out infinite;
}

@keyframes finalNodePulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(255, 210, 0, 0.18), 0 0 22px rgba(255, 210, 0, 0.7); }
  50% { box-shadow: 0 0 0 12px rgba(255, 210, 0, 0.12), 0 0 36px rgba(255, 210, 0, 1); }
}

.tree-card {
  background: rgba(7, 11, 20, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 210, 0, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .tree-card,
[data-theme="light"] .about-philosophy-quote,
[data-theme="light"] .hero-quote {
  background: rgba(255, 255, 255, 0.72);
}

.tree-image-placeholder {
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  border: 1px solid rgba(255, 210, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin-bottom: 1rem;
  background: rgba(255, 210, 0, 0.06);
  object-fit: cover;
  overflow: hidden;
}

.tree-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.tree-year {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

[dir="rtl"] .tree-year {
  letter-spacing: 0.08em;
  text-transform: none;
}

.tree-story {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

[dir="rtl"] .tree-trunk {
  left: 50%;
}

[dir="rtl"] .tree-stage {
  padding: 0 0 3rem 3rem;
}

[dir="rtl"] .tree-stage:nth-child(even) {
  margin-left: 0;
  margin-right: 50%;
  padding: 0 3rem 3rem 0;
}

[dir="rtl"] .tree-node {
  right: auto;
  left: -10px;
}

[dir="rtl"] .tree-stage:nth-child(even) .tree-node {
  left: auto;
  right: -10px;
}

@media (max-width: 768px) {
  .tree-trunk {
    left: 18px;
    transform: none;
  }

  .tree-stage,
  .tree-stage:nth-child(even),
  [dir="rtl"] .tree-stage,
  [dir="rtl"] .tree-stage:nth-child(even) {
    width: 100%;
    margin: 0;
    padding: 0 0 2rem 2.6rem;
  }

  .tree-node,
  .tree-stage:nth-child(even) .tree-node,
  [dir="rtl"] .tree-node,
  [dir="rtl"] .tree-stage:nth-child(even) .tree-node {
    left: 9px;
    right: auto;
  }
}

/* Article editorial */
.article-body {
  font-variant-numeric: oldstyle-nums;
}

.article-body > p.article-kicker + p::first-letter {
  font-family: 'Fraunces', 'Amiri', serif;
  float: left;
  font-size: 4.5em;
  line-height: 0.75;
  padding: 0.08em 0.12em 0 0;
  font-weight: 700;
  background: linear-gradient(135deg, #FFD200, #B8860B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[dir="rtl"] .article-body > p.article-kicker + p::first-letter {
  float: right;
  padding: 0.08em 0 0 0.12em;
  font-family: 'Amiri', 'Fraunces', serif;
}

.article-kicker {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

[dir="rtl"] .article-kicker,
[dir="rtl"] .section-title,
[dir="rtl"] .article-body h2 {
  font-family: 'Amiri', 'Cairo', serif;
  font-weight: 700;
}

.article-body blockquote,
.pull-quote {
  font-family: 'Fraunces', 'Amiri', serif;
  font-style: italic;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  line-height: 1.45;
  max-width: 70%;
  float: right;
  margin: 0.5rem 0 1.5rem 1.5rem;
  padding: 1.25rem 1.4rem;
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 210, 0, 0.15);
  border-left: 4px solid #FFD200;
  color: var(--text-primary);
}

[dir="rtl"] .article-body blockquote,
[dir="rtl"] .pull-quote {
  font-family: 'Amiri', 'Fraunces', serif;
  float: left;
  margin: 0.5rem 1.5rem 1.5rem 0;
  border-left: none;
  border-right: 4px solid #FFD200;
}

.article-editorial-end {
  clear: both;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 3rem 0 1rem;
  color: #FFD200;
}

.article-editorial-end::before,
.article-editorial-end::after {
  content: '';
  height: 1px;
  width: 90px;
  background: linear-gradient(90deg, transparent, #FFD200, transparent);
}

/* Chessboard polish */
#tactics-board .square-55d63 {
  min-width: 44px;
  min-height: 44px;
}

#tactics-board img {
  transition: transform 0.18s ease, filter 0.18s ease;
}

#tactics-board img:hover {
  transform: translateY(-8px) scale(1.06);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
}

#tactics-board .highlight-gold {
  box-shadow: inset 0 0 0 4px rgba(255, 210, 0, 0.85);
  background: radial-gradient(circle, rgba(255, 210, 0, 0.45), transparent 70%) !important;
}

.chess-reset-btn,
#reset-puzzle,
button[onclick*="resetTacticsDemo"] {
  border: 1px solid rgba(255, 210, 0, 0.35);
  background: linear-gradient(135deg, #FFD200, #B8860B);
  color: #070B14;
  font-weight: 700;
  border-radius: 999px;
  min-height: 44px;
  padding: 0.55rem 1.2rem;
}

@media (prefers-reduced-motion: reduce) {
  .hero-artifact-crown,
  .section-artifact,
  .tree-node-final,
  .social-icon-box::after,
  .icon-3d {
    animation: none !important;
  }

  .tree-stage,
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

