/* Custom theme colors - overriding tailwind defaults */
:root {
  --primary-color: #0f172a;
  /* Deep Midnight Blue */
  --primary-dark-color: #1e293b;
  --primary-light-color: #334155;

  --secondary-color: #64748b;
  /* Slate Gray */
  --secondary-light-color: #94a3b8;

  --accent-color: #C2956B;
  /* Warm Terracotta / Sand */
  --accent-dark-color: #A07A52;
  --accent-light-color: #D4AD85;

  --bg-color: #f8fafc;
  /* Soft Off-White */
  --surface-color: #ffffff;
  --text-color: #1e293b;
  --border-color: #e2e8f0;
  /* Gray-200 */

  --gradient-start: #f8fafc;
  /* Slate-50 */
  --gradient-middle: #eff6ff;
  /* Blue-50 */
  --gradient-end: #fffbeb;
  /* Amber-50 */

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* Dark Mode Overrides */
.dark {
  --primary-color: #f8fafc;
  /* Light Text for Dark Mode */
  --primary-dark-color: #e2e8f0;
  --primary-light-color: #cbd5e1;

  --secondary-color: #94a3b8;
  --secondary-light-color: #64748b;

  --bg-color: #020617;
  /* Very Dark Blue Background */
  --surface-color: #0f172a;
  /* Dark Surface */
  --text-color: #f1f5f9;
  --border-color: #1e293b;
  /* Slate-800 */

  --gradient-start: #0f172a;
  /* Slate-900 */
  --gradient-middle: #1e3a8a;
  /* Blue-900 */
  --gradient-end: #451a03;
  /* Amber-950 */

  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Global Styles — placed in @layer base so Tailwind utility classes
   (text-white, text-gray-*, etc.) can override these defaults.
   In Tailwind v4, unlayered CSS beats @layer utilities regardless of
   specificity, which caused hero/nav text to appear black in light mode. */
@layer base {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Offset for sticky header */
    overflow-x: hidden;
    overflow-x: clip;
  }

  body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-x: clip;
    /* Prevent horizontal scroll */
    font-family: 'Source Serif 4', Georgia, serif;
  }

  ::selection {
    background-color: var(--accent-light-color);
    color: white;
  }

  /* Typography Enhancements */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--primary-color);
    line-height: 1.2;
  }

  /* Tighter letter-spacing on large headings for editorial feel */
  h1 {
    letter-spacing: -0.025em;
  }

  h2 {
    letter-spacing: -0.015em;
  }

  /* Sans-serif for UI elements: nav, buttons, labels, badges */
  nav,
  button,
  a[class*="rounded-full"],
  a[class*="rounded-xl"],
  .btn-primary,
  .btn-outline,
  [class*="uppercase"][class*="tracking-"] {
    font-family: 'DM Sans', system-ui, sans-serif;
  }

  /* Ensure body paragraphs use the body serif at regular weight */
  p,
  li,
  blockquote {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
  }
}

/* Consistent tracking for uppercase UI labels */
.stat-label,
[class*="uppercase"] {
  letter-spacing: 0.08em;
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color);
}

.text-secondary {
  color: var(--secondary-color);
}

.text-accent {
  color: var(--accent-color);
}

.bg-primary {
  background-color: var(--primary-color);
  color: white;
}

.bg-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.bg-accent {
  background-color: var(--accent-color);
  color: white;
}

.hover\:text-primary:hover {
  color: var(--primary-color);
}

.hover\:bg-primary:hover {
  background-color: var(--primary-color);
}

.hover\:bg-primary-dark:hover {
  background-color: var(--primary-dark-color);
}

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

.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

.dark .glass-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: var(--accent-light-color);
}

/* Navigation */
.nav-item {
  position: relative;
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: var(--text-color);
  transition: color 0.3s ease;
}

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

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-item:hover::after,
.nav-item.active::after {
  width: 80%;
}

/* Active nav state */
#nav-links a.nav-current,
#mobile-menu a.nav-current {
  color: #0ea5e9 !important;
}

#nav-links a.nav-current::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background-color: #0ea5e9;
  border-radius: 9999px;
}

#nav-links a.bg-brand-primary.nav-current {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
}

/* Mobile Menu */
.mobile-menu {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark-color));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
  transition: all 0.3s ease;
}

.dark .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  /* Blue-500 to Blue-700 */
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.3);
  background: linear-gradient(135deg, var(--primary-dark-color), var(--primary-color));
}

.dark .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.dark .btn-outline {
  color: #f8fafc;
  border-color: #f8fafc;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.dark .btn-outline:hover {
  background: #f8fafc;
  color: #0f172a;
  /* Dark text on white hover */
}

/* Shared spacing for anchored sections */
section {
  scroll-margin-top: 80px;
}

header {
  overflow-x: hidden;
}

/* Sticky navbar – iOS 26 liquid glass style */
#navbar.nav-scrolled {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 0 0 0.5px rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0 0 1.25rem 1.25rem;
}

/* Internal pages start on light backgrounds, so keep nav readable from first paint */
.page-internal #navbar {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.page-internal #navbar #nav-links a:not(.bg-brand-primary):not(.nav-active),
.page-internal #navbar #mobile-menu-btn {
  color: #0F172A !important;
}

.page-internal #navbar #lang-switch-btn,
.page-internal #navbar #theme-toggle-btn {
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.22) !important;
}

.page-internal #navbar #nav-links a[download] {
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.25) !important;
}

.page-internal #navbar #nav-links a[download]:hover {
  background: rgba(15, 23, 42, 0.08) !important;
}

.dark .page-internal #navbar {
  background: rgba(15, 23, 42, 0.72);
  border-bottom: 1px solid rgba(248, 250, 252, 0.08);
}

.dark .page-internal #navbar #nav-links a:not(.bg-brand-primary):not(.nav-active),
.dark .page-internal #navbar #mobile-menu-btn,
.dark .page-internal #navbar #lang-switch-btn,
.dark .page-internal #navbar #theme-toggle-btn,
.dark .page-internal #navbar #nav-links a[download] {
  color: #f8fafc !important;
}

#navbar.nav-scrolled #nav-logo,
#navbar.nav-scrolled #nav-links a:not(.bg-brand-primary):not(.nav-active),
#navbar.nav-scrolled #mobile-menu-btn {
  color: #0F172A !important;
}

#navbar.nav-scrolled #lang-switch-btn,
#navbar.nav-scrolled #theme-toggle-btn {
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.15) !important;
}

/* Download CV button in scrolled navbar */
#navbar.nav-scrolled #nav-links a[download] {
  color: #0F172A !important;
  border-color: rgba(15, 23, 42, 0.25) !important;
}

#navbar.nav-scrolled #nav-links a[download]:hover {
  background: rgba(15, 23, 42, 0.08) !important;
}

.dark #navbar.nav-scrolled {
  background: rgba(15, 23, 42, 0.45);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0 0 1.25rem 1.25rem;
}

.dark #navbar.nav-scrolled #nav-logo,
.dark #navbar.nav-scrolled #nav-links a:not(.bg-brand-primary):not(.nav-active),
.dark #navbar.nav-scrolled #mobile-menu-btn {
  color: #f8fafc !important;
}

.dark #navbar.nav-scrolled #lang-switch-btn,
.dark #navbar.nav-scrolled #theme-toggle-btn {
  color: #f8fafc !important;
  border-color: rgba(248, 250, 252, 0.15) !important;
}

.dark #navbar.nav-scrolled #nav-links a[download] {
  color: #f8fafc !important;
  border-color: rgba(248, 250, 252, 0.2) !important;
}

.dark #navbar.nav-scrolled #nav-links a[download]:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Active nav link for current page */
#nav-links a.nav-active {
  color: #0ea5e9 !important;
  position: relative;
}

#nav-links a.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: #0ea5e9;
  border-radius: 9999px;
}

/* ========================================
   iOS 26 LIQUID GLASS BUTTONS
   ======================================== */

/* --- Primary CTA Buttons (brand-primary background) --- */
a.bg-brand-primary,
button.bg-brand-primary,
a[class*="bg-brand-primary"],
button[class*="bg-brand-primary"] {
  background: rgba(14, 165, 233, 0.75) !important;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.25),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.15),
    0 4px 16px rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

a.bg-brand-primary:hover,
button.bg-brand-primary:hover,
a[class*="bg-brand-primary"]:hover,
button[class*="bg-brand-primary"]:hover {
  background: rgba(14, 165, 233, 0.9) !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.3),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.2),
    0 8px 32px rgba(14, 165, 233, 0.35);
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.35) !important;
}

/* Dark mode primary buttons — slightly different tint */
.dark a.bg-brand-primary,
.dark button.bg-brand-primary,
.dark a[class*="bg-brand-primary"],
.dark button[class*="bg-brand-primary"] {
  background: rgba(14, 165, 233, 0.65) !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.1),
    0 4px 16px rgba(14, 165, 233, 0.25);
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.dark a.bg-brand-primary:hover,
.dark button.bg-brand-primary:hover,
.dark a[class*="bg-brand-primary"]:hover,
.dark button[class*="bg-brand-primary"]:hover {
  background: rgba(14, 165, 233, 0.85) !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.15),
    0 8px 32px rgba(14, 165, 233, 0.4);
}

/* --- Outline / Ghost Buttons (hero secondary CTA) --- */
a.bg-transparent[class*="border"],
button.bg-transparent[class*="border"] {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

a.bg-transparent[class*="border"]:hover,
button.bg-transparent[class*="border"]:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* --- Dark solid buttons (footer newsletter join) --- */
button.bg-brand-dark,
a.bg-brand-dark,
button[class*="bg-brand-dark"],
a[class*="bg-brand-dark"] {
  background: rgba(15, 23, 42, 0.7) !important;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

button.bg-brand-dark:hover,
a.bg-brand-dark:hover,
button[class*="bg-brand-dark"]:hover,
a[class*="bg-brand-dark"]:hover {
  background: rgba(15, 23, 42, 0.85) !important;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

/* --- Theme & Language Toggle Buttons --- */
#lang-switch-btn,
#theme-toggle-btn {
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#lang-switch-btn:hover,
#theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.15);
  transform: scale(1.05);
}

.dark #lang-switch-btn:hover,
.dark #theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.2);
}

/* --- Footer Social Icon Buttons (glass enhancement) --- */
footer a.rounded-full[class*="border"] {
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

footer a.rounded-full[class*="border"]:hover {
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
    0 0 16px rgba(14, 165, 233, 0.35);
}

/* --- Mobile Nav Menu Glass --- */
#mobile-menu {
  backdrop-filter: blur(14px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%) !important;
  background:
    radial-gradient(circle at 15% 10%, rgba(14, 165, 233, 0.14), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(194, 149, 107, 0.08), transparent 35%),
    rgba(15, 23, 42, 0.975) !important;
  box-shadow:
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.1),
    0 24px 52px rgba(0, 0, 0, 0.45);
}

#mobile-menu .mobile-nav-link {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

#mobile-menu .mobile-nav-link:not(.bg-brand-primary) {
  color: rgba(248, 250, 252, 0.95);
}

#mobile-menu .mobile-nav-link:not(.bg-brand-primary):hover {
  color: #fff;
}

#mobile-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.32));
  z-index: -1;
}

/* --- Contact Form Card Glass --- */
#contact-form {
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dark #contact-form {
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.06);
}

/* Timeline center line used on the experience page */
.timeline-item {
  position: relative;
  z-index: 10;
}

.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background-color: #0ea5e9;
  z-index: 0;
}

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

  .timeline-content {
    padding-left: 3rem;
  }

  .timeline-dot {
    left: 10px;
  }

  [dir="rtl"] .timeline-line {
    right: 20px;
    left: auto;
  }

  [dir="rtl"] .timeline-content {
    padding-left: 0;
    padding-right: 3rem;
  }

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

/* ── RTL support for Homepage Milestones mini-timeline ──── */
.milestone-timeline {
  position: relative;
}

.milestone-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  left: 15px;
}

.milestone-dot {
  position: absolute;
  left: 9px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 10;
}

.milestone-content-left {
  margin-left: 2.5rem;
}

.milestone-content-right {
  margin-left: 2.5rem;
}

@media (min-width: 768px) {
  .milestone-line {
    left: 50%;
  }

  .milestone-dot {
    left: 50%;
    transform: translateX(-50%);
  }

  .milestone-content-left {
    margin-left: 0;
    width: 50%;
    padding-right: 2.5rem;
    text-align: right;
  }

  .milestone-content-right {
    margin-left: auto;
    width: 50%;
    padding-left: 2.5rem;
    text-align: left;
  }
}

/* RTL overrides */
[dir="rtl"] .milestone-line {
  left: auto;
  right: 15px;
}

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

[dir="rtl"] .milestone-content-left,
[dir="rtl"] .milestone-content-right {
  margin-left: 0;
  margin-right: 2.5rem;
}

@media (min-width: 768px) {
  [dir="rtl"] .milestone-line {
    right: 50%;
    left: auto;
  }

  [dir="rtl"] .milestone-dot {
    right: 50%;
    left: auto;
    transform: translateX(50%);
  }

  [dir="rtl"] .milestone-content-left {
    margin-right: 0;
    padding-right: 0;
    padding-left: 2.5rem;
    text-align: left;
  }

  [dir="rtl"] .milestone-content-right {
    margin-left: 0;
    margin-right: auto;
    padding-left: 0;
    padding-right: 2.5rem;
    text-align: right;
  }
}

/* ========================================
   BACKGROUND TEXTURE & DEPTH (Priority 5)
   ======================================== */

/* Subtle noise/grain overlay for dark sections */
.bg-grain::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* Radial glow spots for visual depth behind sections */
.section-glow {
  position: relative;
}

.section-glow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  max-width: 600px;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Sky-blue glow (primary sections) */
.section-glow--primary::after {
  background: radial-gradient(circle, rgba(14,165,233,0.06) 0%, transparent 70%);
}

/* Teal glow (secondary sections) */
.section-glow--secondary::after {
  background: radial-gradient(circle, rgba(13,148,136,0.06) 0%, transparent 70%);
}

/* Warm terracotta glow (accent sections) */
.section-glow--warm::after {
  background: radial-gradient(circle, rgba(194,149,107,0.06) 0%, transparent 70%);
}

/* Dark mode: slightly stronger glow */
.dark .section-glow--primary::after {
  background: radial-gradient(circle, rgba(14,165,233,0.08) 0%, transparent 70%);
}

.dark .section-glow--secondary::after {
  background: radial-gradient(circle, rgba(13,148,136,0.08) 0%, transparent 70%);
}

.dark .section-glow--warm::after {
  background: radial-gradient(circle, rgba(194,149,107,0.08) 0%, transparent 70%);
}

/* Mesh gradient for the hero section */
.hero-mesh {
  position: relative;
}

.hero-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 40% 50% at 15% 80%, rgba(14,165,233,0.08) 0%, transparent 100%),
    radial-gradient(ellipse 35% 40% at 85% 20%, rgba(13,148,136,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 30% 35% at 50% 50%, rgba(194,149,107,0.04) 0%, transparent 100%);
}

/* Warm accent color for the brand */
:root {
  --accent-warm: #C2956B;
  --accent-warm-light: #D4AD85;
  --accent-warm-dark: #A07A52;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Service Cards */
.service-card {
  height: 100%;
  border-radius: 1rem;
  overflow: hidden;
}

/* Aspect Ratio Fixes */
.aspect-w-16 {
  position: relative;
  padding-bottom: 56.25%;
}

.aspect-w-16>* {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.aspect-w-4 {
  position: relative;
  padding-bottom: 75%;
}

.aspect-w-4>* {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Language Switcher */
#lang-switch-btn {
  border: 1px solid var(--secondary-light-color);
  border-radius: 0.375rem;
  overflow: hidden;
  padding: 0.35rem 0.65rem;
  line-height: 1;
  transition: all 0.3s ease;
}

#lang-switch-btn:hover {
  border-color: var(--accent-color);
}

#lang-switch-btn .lang-ar,
#lang-switch-btn .lang-en {
  padding: 0;
}

#lang-switch-btn .hidden {
  display: none;
}

[data-translate="stat_countries_list"] {
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 340px);
  white-space: normal;
  text-align: center;
}

/* Keep nav layout stable while enlarging only the logo visually */
.nav-logo-wrap {
  width: 270px;
  display: flex;
  align-items: center;
  overflow: visible;
}

.nav-logo-img {
  transform: scale(1.7);
  transform-origin: left center;
}

[dir='rtl'] .nav-logo-img {
  transform-origin: right center;
}

@media (max-width: 1023px) {
  .nav-logo-wrap {
    width: 190px;
  }

  .nav-logo-img {
    transform: scale(1.28);
  }
}

@media (max-width: 640px) {
  main,
  section,
  header {
    max-width: 100%;
    overflow-x: clip;
  }

  #navbar {
    overflow: visible !important;
  }

  #navbar > div {
    overflow: visible !important;
  }

  #mobile-menu {
    position: fixed !important;
    inset: 0 !important;
    height: 100dvh;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  [data-translate="stat_countries_list"] {
    display: none;
  }

  .nav-logo-wrap {
    width: 170px;
  }

  .nav-logo-img {
    transform: scale(1.18);
  }
}

/* ── Hero Copy Readability Panel (Priority 9) ─────────────── */
.hero-copy-panel {
  position: relative;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 12% 14%, rgba(56, 189, 248, 0.16), transparent 38%),
    linear-gradient(140deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.4));
  border: none;
  box-shadow:
    0 24px 55px -28px rgba(2, 6, 23, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.hero-copy-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 35%);
  opacity: 0.5;
}

@media (min-width: 1024px) {
  .hero-copy-panel {
    padding: 1.75rem 2rem;
  }
}

@media (max-width: 640px) {
  .hero-copy-panel {
    padding: 1.1rem;
    border-radius: 1.2rem;
  }

  .hero-mobile-carousel {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(2, 6, 23, 0.55);
    box-shadow: 0 18px 35px -18px rgba(2, 6, 23, 0.9);
  }

  .hero-mobile-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    gap: 0.6rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.55rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .hero-mobile-track::-webkit-scrollbar {
    display: none;
  }

  .hero-mobile-card {
    position: relative;
    scroll-snap-align: center;
    border-radius: 0.8rem;
    overflow: hidden;
    min-height: 210px;
  }

  .hero-mobile-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.05), rgba(2, 6, 23, 0.28));
    pointer-events: none;
  }

  .hero-mobile-image {
    width: 100%;
    height: 100%;
    min-height: 210px;
    object-fit: cover;
    object-position: center top;
  }

  .hero-mobile-badge {
    position: absolute;
    left: 0.95rem;
    bottom: 0.95rem;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.66);
    border: 1px solid rgba(248, 250, 252, 0.2);
    border-radius: 999px;
    padding: 0.36rem 0.65rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  [dir='rtl'] .hero-mobile-badge {
    left: auto;
    right: 0.95rem;
  }

  .hero-mobile-hint {
    margin-top: 0.45rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(224, 231, 255, 0.74);
  }

  .hero-mobile-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
  }

  .hero-mobile-dots span {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
  }

  .hero-mobile-dots span:first-child {
    width: 1.2rem;
    background: rgba(14, 165, 233, 0.88);
  }

  .hero-cta-group {
    flex-direction: column;
  }

  .hero-cta-group > a {
    width: 100%;
    justify-content: center;
  }

  a[data-translate^="cta_"],
  button[data-translate^="cta_"] {
    width: 100%;
    justify-content: center;
  }

  .project-compact .project-title,
  .project-compact .project-desc {
    overflow-wrap: anywhere;
  }
}

/* ── Social Icon Brand Colors (Default + Hover) ───────────── */
.social-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.25s, color 0.25s, border-color 0.25s,
    box-shadow 0.25s, transform 0.2s;
  transform: scale(1);
}

.social-icon:hover {
  transform: scale(1.1);
}

.social-icon--linkedin {
  background-color: rgba(10, 102, 194, 0.2);
  color: #0A66C2;
  border-color: rgba(10, 102, 194, 0.45);
}

.social-icon--linkedin:hover {
  background-color: rgba(10, 102, 194, 0.34);
  box-shadow: 0 0 12px rgba(10, 102, 194, 0.4);
}

.social-icon--x {
  background-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.35);
}

.social-icon--x:hover {
  background-color: rgba(248, 250, 252, 0.2);
  box-shadow: 0 0 12px rgba(248, 250, 252, 0.25);
}

.social-icon--instagram {
  background: linear-gradient(135deg, rgba(245, 96, 64, 0.24), rgba(193, 53, 132, 0.24), rgba(131, 58, 180, 0.24));
  color: #fca5d6;
  border-color: rgba(225, 48, 108, 0.4);
}

.social-icon--instagram:hover {
  background: linear-gradient(135deg, rgba(245, 96, 64, 0.36), rgba(193, 53, 132, 0.36), rgba(131, 58, 180, 0.36));
  box-shadow: 0 0 12px rgba(225, 48, 108, 0.4);
}

.social-icon--facebook {
  background-color: rgba(24, 119, 242, 0.2);
  color: #60a5fa;
  border-color: rgba(24, 119, 242, 0.45);
}

.social-icon--facebook:hover {
  background-color: rgba(24, 119, 242, 0.34);
  box-shadow: 0 0 12px rgba(24, 119, 242, 0.4);
}

.social-icon--github {
  background-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.45);
}

.social-icon--github:hover {
  background-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.35);
}

/* ── Accordion Project Cards ─────────────────────────────── */
.project-accordion .accordion-header:hover .accordion-chevron svg {
  filter: drop-shadow(0 0 4px currentColor);
}

.accordion-read-hint {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.accordion-header:hover .accordion-read-hint {
  opacity: 1;
}

/* Pulse ring on chevron to invite click */
@keyframes hint-pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }

  70% {
    box-shadow: 0 0 0 6px transparent;
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.accordion-chevron-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chevron-ring {
  border-radius: 9999px;
  padding: 6px;
  border: 1.5px solid currentColor;
  opacity: 0.65;
  transition: opacity 0.2s, transform 0.3s;
  animation: hint-pulse 2.5s ease-in-out infinite;
}

.accordion-header:hover .chevron-ring,
.accordion-header[aria-expanded="true"] .chevron-ring {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   Priority 7 — Varied Card Designs Per Content Type
   ══════════════════════════════════════════════════════════════ */

/* ── 1. Competency Cards (about.html) — Icon-forward with gradient badge ── */
.competency-card {
  position: relative;
  background: white;
  border-radius: 1.25rem;
  padding: 2rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .competency-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.competency-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 1.25rem 1.25rem 0 0;
  transition: height 0.35s ease;
}

.competency-card:hover::before {
  height: 6px;
}

.competency-card--primary::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.competency-card--secondary::before { background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.competency-card--accent::before { background: linear-gradient(90deg, #C2956B, #D4AD85); }
.competency-card--indigo::before { background: linear-gradient(90deg, #6366f1, #818cf8); }

.competency-card .card-icon-badge {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.competency-card:hover .card-icon-badge {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 8px 25px -5px currentColor;
}

.competency-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

.dark .competency-card:hover {
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

/* Skill pills within competency cards */
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.skill-pill:hover {
  transform: translateY(-1px);
}

/* ── 2. Methodology Timeline Steps — Connected dots + animated line ── */
.methodology-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .methodology-timeline {
    flex-direction: row;
    gap: 0;
    justify-content: space-between;
  }
}

/* Connecting line (desktop) */
.methodology-timeline::before {
  display: none;
}

.methodology-progress-line {
  display: none;
}

@media (min-width: 768px) {
  .methodology-timeline::before {
    content: '';
    display: block;
    position: absolute;
    top: 2.5rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, #0F172A 0%, #0ea5e9 33%, #0d9488 66%, #C2956B 100%);
    z-index: 0;
    opacity: 0.2;
  }

  .dark .methodology-timeline::before {
    opacity: 0.15;
  }

  .methodology-progress-line {
    display: block;
    position: absolute;
    top: 2.5rem;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, #0F172A 0%, #0ea5e9 33%, #0d9488 66%, #C2956B 100%);
    z-index: 1;
    opacity: 0.75;
    pointer-events: none;
  }

  .dark .methodology-progress-line {
    opacity: 0.6;
  }
}

.methodology-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
}

/* Step number badge */
.step-badge {
  width: 5rem;
  height: 5rem;
  border-radius: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 1.25rem;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.step-badge {
  color: white;
}

.step-badge::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 1.5rem;
  border: 2px dashed var(--step-accent, currentColor);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Step accent colors for dashed hover border */
.step-badge.bg-brand-dark { --step-accent: #334155; }
.step-badge.bg-brand-primary { --step-accent: #0ea5e9; }
.step-badge.bg-brand-secondary { --step-accent: #0d9488; }
.step-badge.bg-brand-accent { --step-accent: #C2956B; }

/* Make dark badge visible on dark backgrounds */
.dark .step-badge.bg-brand-dark {
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.methodology-step:hover .step-badge {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2);
}

.methodology-step:hover .step-badge::after {
  opacity: 0.3;
}

.step-badge .step-number {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

/* Connector dots between steps (desktop) */
.step-connector {
  display: none;
}

@media (min-width: 768px) {
  .step-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 2.15rem;
    right: -0.5rem;
    z-index: 2;
    width: 0.75rem;
    height: 0.75rem;
  }

  [dir='rtl'] .step-connector {
    right: auto;
    left: -0.5rem;
  }

  .step-connector::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #0ea5e9;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
    animation: dot-pulse 2s ease-in-out infinite;
  }
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
}

#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #0d9488, #C2956B);
  z-index: 80;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  box-shadow: 0 1px 10px rgba(14, 165, 233, 0.35);
}

/* Step description text */
.step-desc {
  font-size: 0.8rem;
  color: #9ca3af;
  max-width: 160px;
  line-height: 1.5;
}

/* ── 3. Project Compact Cards (Homepage) — Horizontal with color stripe ── */
.project-compact {
  display: flex;
  flex-direction: row;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.dark .project-compact {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.project-compact:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.1);
}

.dark .project-compact:hover {
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.4);
}

.project-compact .project-stripe {
  width: 5px;
  flex-shrink: 0;
  transition: width 0.3s ease;
}

.project-compact:hover .project-stripe {
  width: 8px;
}

.project-compact .project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.project-compact .project-thumb-wrap {
  width: 132px;
  min-width: 132px;
  background: #0f172a;
  overflow: hidden;
}

.project-compact .project-thumb {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-compact:hover .project-thumb {
  transform: scale(1.06);
}

.project-compact .project-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.dark .project-compact .project-title {
  color: white;
}

.project-compact .project-meta {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.project-compact .project-desc {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.6;
  flex: 1;
}

.dark .project-compact .project-desc {
  color: #9ca3af;
}

.project-compact .project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 1rem;
  transition: gap 0.2s ease;
}

.project-compact:hover .project-link {
  gap: 0.625rem;
}

@media (max-width: 640px) {
  .project-compact .project-thumb-wrap {
    width: 108px;
    min-width: 108px;
  }
}

/* ── 4. Testimonial Cards — keep current carousel but polish ── */
.testimonial-card {
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4rem;
  font-family: 'Newsreader', Georgia, serif;
  color: #0ea5e9;
  opacity: 0.15;
  line-height: 1;
  pointer-events: none;
}
