/* Self-hosted fonts (SIL Open Font License): no request goes to Google.
   EN/IT: Playfair Display (headings) + Source Serif 4 (text). AR: Amiri. */
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/amiri-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Amiri';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/amiri-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/playfair-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/playfair-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-serif-4-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-serif-4-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-serif-4-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/source-serif-4-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Hasan Tayem Portfolio - Modern 2026 Design
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Colours - Light Mode (WCAG AAA 7:1 for normal text) */
  --color-bg: #fafafa;
  --color-bg-alt: #ffffff;
  --color-bg-card: #ffffff;
  --color-text: #1a1a2e;          /* 16.34:1 on bg */
  --color-text-muted: #525275;    /* 7.13:1 on bg (was #64648c, 5.4:1) */
  --color-primary: #0052a3;       /* 7.35:1 on bg (was #0066cc, 5.3:1) */
  --color-primary-hover: #003d7a; /* 10.33:1 on bg */
  --color-accent: #e55a2b;        /* decorative; not used for body text */
  --color-accent-light: #ff6b35;
  --color-required: #952f00;      /* 7.50:1 on bg, 7.82:1 on white form bg */
  --color-border: #e8e8f0;
  --color-border-light: #f0f0f5;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
  
  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Container */
  --container-max: 1200px;
  --container-narrow: 800px;
}

/* Dark Mode */
[data-theme="dark"] {
  /* Dark Mode (WCAG AAA 7:1 for normal text) */
  --color-bg: #0d0d14;
  --color-bg-alt: #151520;
  --color-bg-card: #1a1a28;
  --color-text: #f0f0f5;
  --color-text-muted: #a8a8c8;     /* 8.39:1 on bg, 7.85:1 on bg-alt, 7.45:1 on bg-card */
  --color-primary: #60acff;        /* 8.15:1 on bg, 7.62:1 on bg-alt, 7.23:1 on bg-card (was #4d9fff, failed AAA on bg-alt) */
  --color-primary-hover: #80b8ff;  /* 9.42:1 on bg */
  --color-accent: #ff9d7a;
  --color-accent-light: #ff8c5a;
  --color-required: #ff9d7a;       /* 9.55:1 on bg */
  --color-border: #2a2a3c;
  --color-border-light: #222230;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.2), 0 8px 32px rgba(0,0,0,0.25);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  /* Disable hero motion effects */
  .hero-motion-lines,
  .hero-shapes {
    display: none;
  }
  
  .hero h1,
  .hero-stats {
    opacity: 1;
    transform: none;
    animation: none;
  }
  
  /* Disable fade-in animations */
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Disable mobile menu slide */
  .nav-list {
    transition: none !important;
  }
  
  /* Disable dropdown animations */
  .nav-dropdown {
    transition: none !important;
  }
  
  /* Disable back-to-top animation */
  .back-to-top {
    transition: none !important;
  }
  
  /* Disable hover underline animations */
  .nav-link::after {
    transition: none !important;
  }
  
  /* Disable button hover effects */
  .btn {
    transition: none !important;
  }
  
  /* Disable card hover effects */
  .project-card,
  .focus-card,
  .community-card {
    transition: none !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle film-grain texture — prevents flat "digital" feel */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  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: 256px 256px;
  mix-blend-mode: multiply;
}

[data-theme="dark"] body::after {
  opacity: 0.04;
  mix-blend-mode: soft-light;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

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

a:hover, a:focus { color: var(--color-primary-hover); }

a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Inline links inside body copy need a non-color cue (WCAG 1.4.1).
   Scoped so buttons, cards, nav, and breadcrumbs stay clean. */
.lead a,
.content-section p a,
.content-section li a,
.testimonial-card a,
.card p a,
blockquote a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.lead a:hover,
.content-section p a:hover,
.content-section li a:hover,
.testimonial-card a:hover,
.card p a:hover,
blockquote a:hover,
.lead a:focus,
.content-section p a:focus,
.content-section li a:focus,
.testimonial-card a:focus,
.card p a:focus,
blockquote a:focus {
  text-decoration-thickness: 2px;
}

.lead {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* Inline links inside body copy must be distinguishable without relying on colour alone (WCAG 1.4.1) */
.lead a,
.media-list a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.lead a:hover,
.lead a:focus,
.media-list a:hover,
.media-list a:focus {
  text-decoration-thickness: 2px;
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  font-size: 0.875rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  color: var(--color-text-muted);
  margin-left: var(--space-xs);
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-xs); /* widen hit area without disrupting visual gap */
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-link:hover,
.breadcrumb-link:focus {
  color: var(--color-primary);
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

.speaking-hero-content .breadcrumb-link,
.speaking-hero-content .breadcrumb-link span {
  color: rgba(255, 255, 255, 0.8);
}

.speaking-hero-content .breadcrumb-current {
  color: #fff;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-md);
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  min-height: 48px; /* WCAG 2.5.5 AAA */
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
  color: #fff;
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

[data-theme="dark"] .header {
  background: rgba(13, 13, 20, 0.9);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 48px;
  min-width: 48px; /* WCAG 2.5.5 AAA – preserve hit area when text wraps/collapses */
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}

.logo:hover, .logo:focus { color: var(--color-text); }

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
}

/* Ensure logo SVG adapts to theme */
.logo-icon path,
.logo-icon g {
  fill: var(--color-text);
}

/* Fix logo visibility in dark mode (when loaded as img) */
[data-theme="dark"] .logo-icon {
  filter: brightness(0) invert(1);
}

/* Tablet - slightly smaller logo */
@media (max-width: 992px) {
  .logo-icon {
    width: 44px;
    height: 44px;
  }
  .logo {
    font-size: 1.15rem;
  }
}

/* Mobile - show text and larger icon */
@media (max-width: 576px) {
  .logo {
    gap: var(--space-sm);
  }
  .logo span {
    font-size: 1rem;
  }
  .logo-icon {
    width: 42px;
    height: 42px;
  }
}

/* Navigation */
.nav { display: flex; align-items: center; gap: var(--space-xl); }

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
}

.nav-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
}

/* Underline on hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: var(--space-md);
  right: var(--space-md);
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-text);
  background: var(--color-border-light);
}

.nav-link[aria-current="page"] {
  color: var(--color-primary);
  background: transparent;
}

/* Accessible Dropdown Navigation */
.nav-item-has-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus {
  color: var(--color-text);
  background: var(--color-border-light);
  outline: none;
}

.nav-dropdown-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-dropdown-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.nav-dropdown-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-dropdown-toggle--active {
  color: var(--color-primary);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 200px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 1000;
  list-style: none;
}

.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--color-bg-alt);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
}

.nav-item-has-dropdown:hover .nav-dropdown,
.nav-item-has-dropdown:focus-within .nav-dropdown,
.nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* When force-closed via Escape key, prevent hover from reopening */
.nav-item-has-dropdown.dropdown-closed .nav-dropdown {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.nav-dropdown li {
  margin: 0;
}

.nav-dropdown-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus {
  color: var(--color-text);
  background: var(--color-border-light);
  outline: none;
}

.nav-dropdown-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.nav-dropdown-link[aria-current="page"] {
  color: var(--color-primary);
  background: rgba(0, 102, 204, 0.08);
}

[data-theme="dark"] .nav-dropdown-link[aria-current="page"] {
  background: rgba(77, 159, 255, 0.12);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.theme-toggle:hover,
.theme-toggle:focus {
  background: var(--color-border-light);
  border-color: var(--color-border);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--color-text);
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Mobile Menu */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.mobile-toggle:hover {
  background: var(--color-border-light);
}

.mobile-toggle:focus {
  outline: none;
}

.mobile-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  position: relative;
  transition: background 0.2s ease;
}

.mobile-toggle span::before,
.mobile-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-toggle span::before { top: -7px; }
.mobile-toggle span::after { bottom: -7px; }

.mobile-toggle[aria-expanded="true"] span { 
  background: transparent; 
}

.mobile-toggle[aria-expanded="true"] span::before { 
  top: 0;
  transform: rotate(45deg); 
}

.mobile-toggle[aria-expanded="true"] span::after { 
  bottom: 0;
  transform: rotate(-45deg); 
}

@media (max-width: 768px) {
  /* Body scroll lock when menu is open */
  body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }
  
  .mobile-toggle { 
    display: flex; 
    order: -1;
  }
  
  /* Mobile nav container - full screen overlay */
  .nav-list {
    display: flex !important;
    flex-direction: column;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: var(--color-bg-alt) !important;
    padding: var(--space-md) var(--space-lg) var(--space-xl);
    z-index: 9999 !important;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease-out,
                opacity 0.3s ease-out,
                visibility 0.3s ease-out;
    list-style: none;
    margin: 0;
  }
  
  [data-theme="dark"] .nav-list {
    background-color: #0d0d14 !important;
  }
  
  .nav-list.active {
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  /* Mobile menu header with close button */
  .mobile-menu-header {
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: none !important;
    margin-bottom: var(--space-lg);
  }
  
  .mobile-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.2s ease, opacity 0.2s ease;
  }
  
  .mobile-close:hover {
    color: var(--color-text);
  }
  
  .mobile-close:focus {
    outline: none;
  }
  
  .mobile-close:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }
  
  .mobile-close:active {
    opacity: 0.6;
  }
  
  .mobile-close svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
  }
  
  /* Mobile nav items - Apple-style clean look */
  .nav-list > li {
    border-bottom: none;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .nav-list > li:last-child {
    border-bottom: none;
  }
  
  .nav-list .nav-link {
    display: flex;
    align-items: center;
    padding: var(--space-md) 0;
    font-size: 1.4rem;
    font-weight: 600;
    min-height: 52px;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: opacity 0.2s ease;
  }
  
  .nav-list .nav-link::after {
    display: none !important;
  }
  
  /* Clean hover - just opacity change like Apple */
  .nav-list .nav-link:hover {
    opacity: 0.6;
    background: transparent;
  }
  
  .nav-list .nav-link:focus {
    outline: none;
    background: transparent;
  }
  
  .nav-list .nav-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 2px;
  }
  
  .nav-list .nav-link[aria-current="page"] {
    color: var(--color-primary);
  }
  
  /* Mobile dropdown styles */
  .nav-item-has-dropdown {
    position: relative;
  }
  
  .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    padding: var(--space-md) 0;
    font-size: 1.4rem;
    font-weight: 600;
    min-height: 52px;
    color: var(--color-text);
    background: transparent;
    border: none;
    letter-spacing: -0.01em;
    transition: opacity 0.2s ease;
  }
  
  .nav-dropdown-toggle:hover {
    opacity: 0.6;
    background: transparent;
  }
  
  .nav-dropdown-toggle:focus {
    outline: none;
    background: transparent;
  }
  
  .nav-dropdown-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 2px;
  }
  
  .nav-dropdown-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }
  
  .nav-dropdown-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }
  
  .nav-dropdown {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100%;
    min-width: 100%;
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: none;
    padding: 0;
    background: var(--color-bg);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    margin: 0;
  }
  
  .nav-dropdown::before {
    display: none !important;
  }
  
  /* Prevent hover from opening dropdown on mobile */
  .nav-item-has-dropdown:hover .nav-dropdown,
  .nav-item-has-dropdown:focus-within .nav-dropdown {
    max-height: 0;
    padding: 0;
  }
  
  /* Only open when aria-expanded is true */
  .nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown {
    max-height: 500px !important;
    padding: var(--space-sm) 0;
    margin-top: var(--space-xs);
    margin-bottom: var(--space-sm);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-dropdown-link {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    border-left: none;
    margin: 0;
    min-height: 44px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 0;
    transition: opacity 0.2s ease;
    color: var(--color-text-muted);
    text-decoration: none;
  }
  
  .nav-dropdown-link:hover {
    opacity: 0.6;
    background: transparent;
    color: var(--color-text-muted);
  }
  
  .nav-dropdown-link:focus {
    outline: none;
    background: transparent;
  }
  
  .nav-dropdown-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }
  
  .nav-dropdown-link[aria-current="page"] {
    color: var(--color-primary);
  }
}

/* --------------------------------------------------------------------------
   Hero Section - Distinctive Design
   -------------------------------------------------------------------------- */
.hero {
  padding: calc(72px + var(--space-4xl)) 0 var(--space-4xl);
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Animated gradient background */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 102, 204, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(0, 102, 204, 0.06) 0%, transparent 50%);
  pointer-events: none;
  animation: heroGradientShift 8s ease-in-out infinite alternate;
}

@keyframes heroGradientShift {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.8; transform: scale(1.05); }
}

[data-theme="dark"] .hero::before {
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(77, 159, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(255, 140, 90, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(77, 159, 255, 0.08) 0%, transparent 50%);
}

/* Motion lines & shapes — hidden (decorative clutter) */
.hero-motion-lines,
.hero-shapes {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  background: var(--color-accent);
  border-radius: 50%;
}

.hero h1 {
  margin-bottom: var(--space-lg);
  animation: heroTitleReveal 1s ease-out forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

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

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

/* Highlight text — no shimmer (static gradient is enough) */

/* Hero stats - quick impact numbers */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border-light);
  animation: fadeInUp 0.8s ease-out forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

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

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 600px) {
  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-lg);
  }
  .hero-stat {
    flex: 1 1 45%;
  }
}

.hero .lead {
  margin-bottom: var(--space-xl);
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  min-height: 48px; /* WCAG 2.5.5 AAA target size */
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--color-border-light);
  color: var(--color-text);
  transform: translateY(-2px);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Cards Grid (Bento Style)
   -------------------------------------------------------------------------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* First card spans two columns for visual hierarchy */
.bento-grid .card:first-child {
  grid-column: span 2;
}

@media (max-width: 992px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-grid .card:first-child { grid-column: span 2; }
}

@media (max-width: 600px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-grid .card:first-child { grid-column: span 1; }
}

.card {
  position: relative;
  min-width: 0;
  overflow-wrap: break-word;
  hyphens: auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  color: #fff;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  min-height: 48px; /* WCAG 2.5.5 AAA */
  font-weight: 600;
  font-size: 0.9rem;
}

.card-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.card:hover .card-link svg {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  color: var(--color-text-muted);
}

/* Intro/Statement Text - Centered for impact */
.intro-text,
.text-center p {
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Centered narrow container */
.container-narrow.text-center {
  text-align: center;
}

.container-narrow.text-center p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   Projects Grid
   -------------------------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

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

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

.project-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--transition-slow);
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-card-content {
  padding: var(--space-lg);
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
}

.project-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Image Gallery
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item { aspect-ratio: 4/3; }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-slow);
}

/* Fix for landscape images that get cut off in square grid */
.gallery-item:nth-child(2) img {
  object-position: center top;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   Picture Elements - Global Constraints
   -------------------------------------------------------------------------- */
picture {
  display: block;
  width: 100%;
  margin: var(--space-lg) 0;
}

picture img {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-lg);
  display: block;
}

/* --------------------------------------------------------------------------
   Video Section
   -------------------------------------------------------------------------- */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Lite YouTube facade */
.lite-youtube {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background-color: #000;
  background-position: center;
  background-size: cover;
  display: block;
  border: none;
  padding: 0;
}

.lite-youtube:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: -3px;
}

.lite-youtube img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lite-youtube-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}

.lite-youtube-play svg {
  width: 100%;
  height: 100%;
}

.lite-youtube:hover .lite-youtube-play svg .yt-play-bg {
  fill: red;
  fill-opacity: 1;
}

/* --------------------------------------------------------------------------
   Quote / Blockquote
   -------------------------------------------------------------------------- */
blockquote {
  position: relative;
  padding: var(--space-xl) var(--space-2xl);
  margin: var(--space-2xl) 0;
  background: linear-gradient(135deg, var(--color-bg-alt), var(--color-bg));
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  font-family: Georgia, serif;
  color: var(--color-primary);
  opacity: 0.3;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Media List
   -------------------------------------------------------------------------- */
.media-list {
  list-style: none;
}

.media-list li {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.media-list li:last-child {
  border-bottom: none;
}

.media-list a {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 500;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.media-list a:hover {
  transform: translateX(4px);
}

.media-list a::before {
  content: '→';
  color: var(--color-primary);
}

/* RTL Support for Arabic */
[dir="rtl"] .media-list a {
  direction: rtl;
}

[dir="rtl"] .media-list a::before {
  content: '←';
}

/* --------------------------------------------------------------------------
   Contact Form
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-2xl);
}

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

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.form-group .required {
  color: var(--color-required);
}

.form-control {
  width: 100%;
  min-height: 48px; /* WCAG 2.5.5 AAA target size */
  padding: var(--space-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: #c00;
  font-weight: 600;
  margin-top: var(--space-sm);
}

.form-group.invalid .form-control {
  border-color: #c00;
}

.form-group.invalid .form-error {
  display: flex;
}

/* Contact form: server-side outcome (?error=) and security-check reminder.
   Body text colour keeps contrast in both themes; the red edge carries the signal. */
.form-alert {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid #c00;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-weight: 600;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Resource Cards
   -------------------------------------------------------------------------- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  list-style: none;
  padding: 0;
  margin: 0;
}

.resource-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.resource-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  color: var(--color-primary);
}

.resource-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
  text-align: center;
}

.footer h2,
.footer h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  list-style: none;
  margin-bottom: var(--space-xl);
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  transition: all var(--transition-base);
}

.social-links a:hover,
.social-links a:focus {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.social-links svg {
  width: 20px;
  height: 20px;
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Back to Top
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: calc(var(--space-xl) + 60px);
  right: var(--space-xl);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.back-to-top:hover,
.back-to-top:focus {
  background: var(--color-primary-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
  display: flex;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

/* --------------------------------------------------------------------------
   Page Headers
   -------------------------------------------------------------------------- */
.page-header {
  padding: calc(72px + var(--space-3xl)) 0 var(--space-3xl);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.page-header h1 {
  margin-bottom: var(--space-md);
}

.page-header .lead {
  max-width: 700px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Content Section
   -------------------------------------------------------------------------- */
.content-section {
  padding: var(--space-3xl) 0;
}

.content-section h2 {
  margin-bottom: var(--space-lg);
}

.content-section h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.content-section img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: var(--radius-lg);
  margin: var(--space-lg) 0;
}

.content-section a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Section images - constrained and centered */
.section img,
.section picture img {
  max-height: 500px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-lg);
}

/* Narrow container images */
.container-narrow img,
.container-narrow picture img {
  max-height: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   Scroll Animations
   -------------------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger with non-uniform timing for organic feel */
.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.19s; }
.stagger-3 { transition-delay: 0.33s; }
.stagger-4 { transition-delay: 0.44s; }

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-lg); }
.mb-3 { margin-bottom: var(--space-xl); }
.mb-4 { margin-bottom: var(--space-2xl); }
.mt-2 { margin-top: var(--space-lg); }
.mt-3 { margin-top: var(--space-xl); }
.mt-4 { margin-top: var(--space-2xl); }

/* --------------------------------------------------------------------------
   Thank You / Error Pages
   -------------------------------------------------------------------------- */
.message-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
}

.message-page h1 {
  font-size: 4rem;
  margin-bottom: var(--space-md);
}

.message-page p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

/* ==========================================================================
   ENHANCED 2026 VISUAL POLISH & MICRO-INTERACTIONS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero Background Wash
   -------------------------------------------------------------------------- */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background:
    radial-gradient(ellipse at 40% 30%, rgba(0, 102, 204, 0.07) 0%, transparent 60%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .hero::after {
  background:
    radial-gradient(ellipse at 40% 30%, rgba(77, 159, 255, 0.06) 0%, transparent 60%);
}

/* --------------------------------------------------------------------------
   Button Refinements
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary {
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3);
  transform: translateY(-2px);
}

/* Dark mode: primary buttons need darker bg for white text contrast (WCAG AA) */
[data-theme="dark"] .btn-primary {
  background: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
  background: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  position: relative;
  background: transparent;
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(0, 102, 204, 0.04);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(77, 159, 255, 0.08);
}

/* --------------------------------------------------------------------------
   Project Cards
   -------------------------------------------------------------------------- */
.project-card img {
  transition: transform 0.5s ease;
}

.project-card:hover img {
  transform: scale(1.03);
}

/* --------------------------------------------------------------------------
   Gallery Grid - Staggered Reveal & Hover
   -------------------------------------------------------------------------- */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.gallery-item img {
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Text Reveal Animation
   -------------------------------------------------------------------------- */
.hero h1 {
  overflow: hidden;
}

.hero h1 span,
.hero h1 br + span {
  display: inline-block;
  animation: textReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(100%);
}

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

.hero h1 .highlight {
  animation-delay: 0.2s;
  animation: textReveal 0.8s 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* --------------------------------------------------------------------------
   Scroll Progress Indicator
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  z-index: 10001;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   Focus States
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Cursor glow — disabled (unnecessary decoration) */
.cursor-glow { display: none; }

[data-theme="dark"] .cursor-glow {
  background: radial-gradient(circle, rgba(77, 159, 255, 0.12) 0%, transparent 70%);
}

@media (hover: none) {
  .cursor-glow { display: none; }
}

/* --------------------------------------------------------------------------
   Stat Counter Animation
   -------------------------------------------------------------------------- */
.stat-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* --------------------------------------------------------------------------
   Floating Action Elements
   -------------------------------------------------------------------------- */
.back-to-top {
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-to-top.visible {
  transform: translateY(0);
  opacity: 1;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.25);
}

/* Section dividers — removed (flat alternation is enough) */

/* Social links — simpler timing */
.social-links a {
  transition: all 0.25s ease;
}

.social-links a:hover {
  transform: translateY(-8px) scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 102, 204, 0.3);
}

.social-links li:nth-child(1) a:hover { transition-delay: 0s; }
.social-links li:nth-child(2) a:hover { transition-delay: 0.02s; }
.social-links li:nth-child(3) a:hover { transition-delay: 0.04s; }
.social-links li:nth-child(4) a:hover { transition-delay: 0.06s; }
.social-links li:nth-child(5) a:hover { transition-delay: 0.08s; }
.social-links li:nth-child(6) a:hover { transition-delay: 0.1s; }
.social-links li:nth-child(7) a:hover { transition-delay: 0.12s; }

/* --------------------------------------------------------------------------
   Image Loading Skeleton
   -------------------------------------------------------------------------- */
img[loading="lazy"] {
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-bg-alt) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

img[loading="lazy"].loaded {
  animation: none;
  background: none;
}

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

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

[data-theme="dark"] body::before {
  opacity: 0.03;
}

/* --------------------------------------------------------------------------
   Page Transition Effect
   -------------------------------------------------------------------------- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--color-primary);
  z-index: 99999;
  transform: scaleY(0);
  transform-origin: bottom;
}

.page-transition.active {
  animation: pageWipe 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageWipe {
  0% { transform: scaleY(0); transform-origin: bottom; }
  50% { transform: scaleY(1); transform-origin: bottom; }
  50.1% { transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: top; }
}

/* --------------------------------------------------------------------------
   Section Header Accents
   -------------------------------------------------------------------------- */
.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 32px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 1px;
}

.section-header.text-center h2::after,
.text-center .section-header h2::after {
  left: 50%;
  transform: translateX(-50%);
}

/* --------------------------------------------------------------------------
   Form Input Animations
   -------------------------------------------------------------------------- */
.form-control {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.form-control:focus {
  transform: translateY(-2px);
  box-shadow: 
    0 0 0 4px rgba(0, 102, 204, 0.1),
    0 8px 20px rgba(0, 0, 0, 0.08);
}

.form-group label {
  transition: color 0.3s ease;
}

.form-group:focus-within label {
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Quote Block Enhancement
   -------------------------------------------------------------------------- */
blockquote {
  position: relative;
  padding-left: var(--space-xl);
  border-left: 3px solid var(--color-primary);
}

blockquote::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 5rem;
  font-family: Georgia, serif;
  color: var(--color-primary);
  opacity: 0.15;
  line-height: 1;
}

/* ==========================================================================
   COMPREHENSIVE MOBILE OPTIMIZATIONS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mobile-First Spacing Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --space-lg: 1.25rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 2.5rem;
    --space-4xl: 3rem;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .section {
    padding: var(--space-3xl) 0;
  }
}

@media (max-width: 480px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 1.25rem;
    --space-2xl: 1.5rem;
    --space-3xl: 2rem;
    --space-4xl: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Header
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }
  
  .logo {
    font-size: 1.1rem;
  }

  .logo-icon {
    width: 44px; /* WCAG 2.5.5 AAA minimum */
    height: 44px;
  }
  
  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .nav {
    gap: var(--space-sm);
  }
}

/* --------------------------------------------------------------------------
   Mobile Hero
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero {
    padding: calc(60px + var(--space-2xl)) 0 var(--space-2xl);
    min-height: auto;
  }
  
  .hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    line-height: 1.2;
  }
  
  .hero .lead {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  .hero-badge {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Mobile Cards
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .card {
    padding: var(--space-lg);
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
  }
  
  .card-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .card h3 {
    font-size: 1.1rem;
  }
  
  .card p {
    font-size: 0.9rem;
  }
}

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

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .project-card {
    border-radius: var(--radius-md);
  }
  
  .project-card img {
    height: auto;
    min-height: 160px;
    max-height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  
  .project-card-content {
    padding: var(--space-md);
  }
  
  .project-card-content h3 {
    font-size: 1rem;
  }
  
  .project-card-content p {
    font-size: 0.85rem;
    line-height: 1.6;
  }
}

/* --------------------------------------------------------------------------
   Mobile Gallery
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  
  .gallery-item {
    border-radius: var(--radius-sm);
    aspect-ratio: 4/3;
  }
  
  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* --------------------------------------------------------------------------
   Mobile Section Headers
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .section-header {
    margin-bottom: var(--space-xl);
  }
  
  .section-header h2 {
    font-size: 1.5rem;
  }
  
  .section-header p {
    font-size: 0.9rem;
  }
  
  .page-header {
    padding: calc(60px + var(--space-2xl)) 0 var(--space-xl);
  }
  
  .page-header h1 {
    font-size: 1.75rem;
  }
  
  .page-header .lead {
    font-size: 0.95rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Content Sections
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .content-section {
    padding: var(--space-2xl) 0;
  }
  
  .content-section h2 {
    font-size: 1.35rem;
  }
  
  .content-section h3 {
    font-size: 1.15rem;
    margin-top: var(--space-xl);
  }
  
  .content-section p {
    font-size: 0.95rem;
    line-height: 1.7;
  }
  
  .content-section img {
    margin: var(--space-md) 0;
    border-radius: var(--radius-md);
  }
}

/* --------------------------------------------------------------------------
   Mobile Contact Form
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .contact-grid {
    gap: var(--space-xl);
  }
  
  .form-group {
    margin-bottom: var(--space-md);
  }
  
  .form-control {
    padding: var(--space-sm) var(--space-md);
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  textarea.form-control {
    min-height: 120px;
  }
}

/* --------------------------------------------------------------------------
   Mobile Footer
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .footer {
    padding: var(--space-2xl) 0 var(--space-lg);
  }
  
  .footer h2,
  .footer h3 {
    font-size: 1.1rem;
  }
  
  .social-links {
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .social-links a {
    width: 48px;
    height: 48px;
  }
  
  .social-links svg {
    width: 18px;
    height: 18px;
  }
  
  .footer-copy {
    font-size: 0.8rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Buttons
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.9rem;
  }
  
  .btn svg {
    width: 18px;
    height: 18px;
  }
}

/* --------------------------------------------------------------------------
   Mobile Back to Top
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: var(--space-md);
    right: var(--space-md);
  }
  
  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* --------------------------------------------------------------------------
   Mobile Typography
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); }
  h2 { font-size: clamp(1.35rem, 5vw, 1.75rem); }
  h3 { font-size: clamp(1.1rem, 4vw, 1.35rem); }
  h4 { font-size: 1rem; }
  
  .lead {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  p {
    font-size: 0.95rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Stats Grid
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Resource Cards
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .resource-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .resource-card {
    padding: var(--space-md);
  }
}

/* --------------------------------------------------------------------------
   Mobile Timeline
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
  
  .timeline-item {
    padding-left: 50px;
    margin-bottom: var(--space-lg);
  }
  
  .timeline-dot {
    left: 12px;
    width: 16px;
    height: 16px;
  }
  
  .timeline-content {
    padding: var(--space-md);
  }
  
  .timeline-date {
    font-size: 0.8rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Quote Block
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  blockquote {
    padding-left: var(--space-lg);
    font-size: 1rem;
  }
  
  blockquote::before {
    font-size: 3rem;
    top: -10px;
  }
}

/* --------------------------------------------------------------------------
   Disable Heavy Animations on Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .cursor-glow {
    display: none !important;
  }
  
  .hero::after {
    animation: none;
    opacity: 0.4;
  }
  
  .btn::before {
    display: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .project-card:hover img {
    transform: scale(1.02);
  }
  
  .gallery-item:hover img {
    transform: scale(1.05);
  }
}

/* --------------------------------------------------------------------------
   Touch-Friendly Tap Targets
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  a, button, .btn, .nav-link, .card-link {
    min-height: 48px; /* WCAG 2.5.5 AAA target size */
    display: inline-flex;
    align-items: center;
  }

  /* Links inside sentences are exempt from target size (WCAG 2.5.5/2.5.8) and
     must stay inline, or every line that holds a link grows to 48px. */
  p a:not(.btn):not(.card-link),
  .legal-content li a {
    display: inline;
    min-height: 0;
  }

  .nav-link {
    padding: var(--space-sm) var(--space-md);
  }
}

/* --------------------------------------------------------------------------
   Safe Area Insets (Notch Support)
   -------------------------------------------------------------------------- */
@supports (padding: max(0px)) {
  .header {
    padding-left: max(var(--space-md), env(safe-area-inset-left));
    padding-right: max(var(--space-md), env(safe-area-inset-right));
  }
  
  .footer {
    padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
  }
  
  .back-to-top {
    bottom: max(var(--space-md), calc(env(safe-area-inset-bottom) + var(--space-md)));
    right: max(var(--space-md), env(safe-area-inset-right));
  }
}

/* --------------------------------------------------------------------------
   Landscape Phone Optimizations
   -------------------------------------------------------------------------- */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(60px + var(--space-lg));
    padding-bottom: var(--space-lg);
  }
  
  .hero h1 {
    font-size: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Small Phone Optimizations (320px - 375px)
   -------------------------------------------------------------------------- */
@media (max-width: 375px) {
  .container {
    padding: 0 var(--space-sm);
  }
  
  .hero h1 {
    font-size: 1.4rem;
  }
  
  .hero .lead {
    font-size: 0.9rem;
  }
  
  .card {
    padding: var(--space-md);
  }
  
  .project-card img {
    min-height: 140px;
    max-height: 180px;
  }
  
  .gallery-grid {
    gap: var(--space-xs);
  }
  
  .gallery-item {
    aspect-ratio: 1;
  }
  
  .social-links a {
    width: 44px; /* WCAG 2.5.5 AAA minimum on smallest viewports (≤375px) */
    height: 44px;
  }
  
  .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   Additional Mobile Image & Theme Fixes
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Proper picture element handling */
  picture {
    display: block;
    width: 100%;
    margin: var(--space-md) 0;
  }
  
  picture img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius-md);
  }
  
  /* Content section images - prevent distortion */
  .content-section picture img,
  .content-section img {
    max-height: 280px;
    object-fit: cover;
    object-position: center top;
  }
  
  /* Speaking page overrides - prevent global constraints from corrupting images */
  .speaking-gallery .gallery-item picture {
    margin: 0;
  }

  .speaking-gallery .gallery-item img,
  .speaking-gallery .gallery-item picture img {
    max-height: none;
    height: auto;
    object-fit: contain;
  }

  .speaking-hero-bg picture {
    margin: 0;
  }

  .speaking-hero-bg img {
    max-height: none;
    border-radius: 0;
  }

  .speaker-bio-photo picture {
    margin: 0;
  }

  /* Hero background adjustments */
  .hero::after {
    width: 100%;
    opacity: 0.3;
  }

  /* Better mobile hero content spacing */
  .hero-content {
    max-width: 100%;
    text-align: center;
  }
  
  /* Prevent text overflow on mobile */
  .hero h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Hero actions full width on mobile */
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* Small phone specific fixes */
  picture img,
  .content-section img {
    max-height: 220px;
    border-radius: var(--radius-sm);
  }
  
  /* Tighter gallery on small screens */
  .gallery-item {
    aspect-ratio: 3/2;
  }

  /* Speaking gallery override - show full images on small screens */
  .speaking-gallery .gallery-item img,
  .speaking-gallery .gallery-item picture img {
    max-height: none;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
  }

  .speaker-bio-photo img {
    max-height: 280px;
    border-radius: var(--radius-md);
  }

  .speaking-hero-bg img {
    max-height: none;
    border-radius: 0;
  }

  /* Page header improvements */
  .page-header {
    padding-top: calc(60px + var(--space-lg));
    padding-bottom: var(--space-md);
  }
  
  .page-header h1 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  
  .page-header .lead {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
  .gallery-item:hover img {
    transform: none;
  }
  
  .gallery-item:hover::after {
    opacity: 0;
  }
  
  .project-card:hover img {
    transform: none;
    filter: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .social-links a:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  /* Reset colours for print */
  :root {
    --color-bg: #fff;
    --color-bg-alt: #fff;
    --color-bg-card: #fff;
    --color-text: #000;
    --color-text-muted: #333;
    --color-primary: #000;
    --color-accent: #333;
    --color-border: #ccc;
  }

  /* Hide non-essential elements */
  .header,
  .footer,
  .back-to-top,
  .skip-link,
  .theme-toggle,
  .mobile-toggle,
  .cursor-glow,
  .scroll-progress,
  .page-transition,
  .floating-shapes,
  .hero-badge-dot,
  .hero-motion-lines,
  .hero-shapes,
  .hero-stats {
    display: none !important;
  }

  /* Reset backgrounds and shadows */
  body,
  .hero,
  .section,
  .section-alt,
  .card,
  .resource-card {
    background: #fff !important;
    box-shadow: none !important;
  }

  /* Ensure text is readable */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }

  h1, h2, h3, h4 {
    color: #000;
    page-break-after: avoid;
  }

  h1 { font-size: 24pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 14pt; }

  /* Remove gradient text effects */
  .hero h1 .highlight,
  .error-code {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
  }

  /* Show URLs for links */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
    word-break: break-all;
  }

  /* Don't show URLs for internal nav */
  .nav-link:after,
  .btn:after,
  .card-link:after,
  .social-links a:after {
    content: none;
  }

  /* Page breaks */
  .section,
  .content-section {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Adjust hero for print */
  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  /* Show breadcrumbs clearly */
  .breadcrumb {
    margin-bottom: 1rem;
  }

  .breadcrumb a {
    color: #000;
  }

  /* Cards in print */
  .card,
  .resource-card {
    border: 1px solid #ccc;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  /* Gallery prints nicely */
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Work With Me Page - Trust Bar
   -------------------------------------------------------------------------- */
.trust-bar {
  text-align: center;
  padding: var(--space-xl) 0;
}

.trust-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.trust-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
}

.trust-item {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

.trust-item:hover {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Work With Me Page - Services Grid
   -------------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.service-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.service-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
}

.service-card p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.service-ideal {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

/* --------------------------------------------------------------------------
   Work With Me Page - Speaking Highlights
   -------------------------------------------------------------------------- */
.highlights-list {
  list-style: none;
  padding: 0;
}

.highlights-list li {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.highlights-list li:last-child {
  border-bottom: none;
}

.highlights-list strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.highlight-topic {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   CTA Note
   -------------------------------------------------------------------------- */
.cta-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Speaking Page - Hero
   -------------------------------------------------------------------------- */
.speaking-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(72px + var(--space-3xl)) 0 var(--space-3xl);
  background-color: #0d0d14;
}

.speaking-hero-bg {
  position: absolute;
  inset: 0;
}

.speaking-hero-bg picture {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.speaking-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  max-height: none;
  border-radius: 0;
  margin: 0;
}

.speaking-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(13, 13, 20, 0.88) 0%,
    rgba(13, 13, 20, 0.72) 50%,
    rgba(13, 13, 20, 0.6) 100%
  );
}

.speaking-hero-content {
  position: relative;
  z-index: 1;
  max-width: 750px;
  color: #f0f0f5;
}

.speaking-hero-content h1 {
  color: #f0f0f5;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

.speaking-hero-content p {
  color: rgba(240, 240, 245, 0.85);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 650px;
}

.speaking-hero-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(240, 240, 245, 0.7);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
}

.speaking-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.speaking-hero-actions .btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0080ff 100%);
}

/* --------------------------------------------------------------------------
   Speaking Page - Credential Strip
   -------------------------------------------------------------------------- */
.credential-strip {
  text-align: center;
  padding: var(--space-md) 0;
}

/* --------------------------------------------------------------------------
   Speaking Page - Topics Grid
   -------------------------------------------------------------------------- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

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

.topic-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.topic-number {
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.15;
  margin-bottom: var(--space-md);
}

.topic-card h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
  margin-top: 0;
}

.topic-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.topic-formats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.topic-format-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .topic-format-tag {
  background: var(--color-bg-alt);
}

/* --------------------------------------------------------------------------
   Speaking Page - Speaker Bio
   -------------------------------------------------------------------------- */
.speaker-bio-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

@media (max-width: 768px) {
  .speaker-bio-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

.speaker-bio-text p {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
  line-height: 1.8;
}

.speaker-bio-text blockquote {
  margin-top: var(--space-xl);
}

.speaker-bio-aside {
  position: sticky;
  top: calc(72px + var(--space-xl));
}

@media (max-width: 768px) {
  .speaker-bio-aside {
    position: static;
  }
}

.speaker-bio-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.speaker-bio-photo picture {
  display: block;
  width: 100%;
  margin: 0;
}

.speaker-bio-photo img,
.speaker-bio-photo picture img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius-lg);
  display: block;
  margin: 0;
}

.speaker-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.speaker-stat {
  text-align: center;
  padding: var(--space-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
}

.speaker-stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.speaker-stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Speaking Page - Gallery
   -------------------------------------------------------------------------- */
.speaking-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

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

@media (max-width: 480px) {
  .speaking-gallery {
    grid-template-columns: 1fr;
  }
}

.speaking-gallery .gallery-item {
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: auto;
}

.speaking-gallery .gallery-item picture {
  display: block;
  width: 100%;
  margin: 0;
}

.speaking-gallery .gallery-item img,
.speaking-gallery .gallery-item picture img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
  margin: 0;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Speaking Page - Formats Grid
   -------------------------------------------------------------------------- */
.formats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

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

.format-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.format-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.format-card h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
  margin-top: 0;
}

.format-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Speaking Page - Testimonials
   -------------------------------------------------------------------------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

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

.testimonial-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin: 0;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--color-text-muted);
  position: relative;
}

.testimonial-card p {
  margin-bottom: var(--space-lg);
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: var(--space-md);
  left: var(--space-lg);
  font-size: 4rem;
  font-family: Georgia, serif;
  color: var(--color-primary);
  opacity: 0.15;
  line-height: 1;
}

.testimonial-attribution {
  font-style: normal;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.testimonial-attribution cite {
  font-style: normal;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Speaking Page - Booking CTA
   -------------------------------------------------------------------------- */
.booking-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
  margin: var(--space-xl) 0 var(--space-lg);
}

.booking-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: var(--space-md);
}

/* --------------------------------------------------------------------------
   Speaking Page - Mobile Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .speaking-hero {
    min-height: auto;
    padding: calc(60px + var(--space-2xl)) 0 var(--space-2xl);
  }

  .speaking-hero-overlay {
    background: linear-gradient(
      180deg,
      rgba(13, 13, 20, 0.92) 0%,
      rgba(13, 13, 20, 0.88) 60%,
      rgba(13, 13, 20, 0.8) 100%
    );
  }

  .speaking-hero-content h1 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .speaking-hero-content p {
    font-size: 0.95rem;
  }

  .speaking-hero-label {
    font-size: 0.75rem;
  }

  .speaking-hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .speaking-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .topic-card {
    padding: var(--space-xl);
  }

  .topic-number {
    font-size: 2.25rem;
  }

  .topic-card h3 {
    font-size: 1.1rem;
  }

  .speaker-bio-photo img {
    max-height: 350px;
    object-fit: cover;
    object-position: center top;
  }

  .speaking-gallery .gallery-item img,
  .speaking-gallery .gallery-item picture img {
    max-height: none;
    height: auto;
    object-fit: contain;
  }

  .speaker-stats-grid {
    gap: var(--space-sm);
  }

  .speaker-stat {
    padding: var(--space-md);
  }

  .speaker-stat-value {
    font-size: 1.5rem;
  }

  .speaker-stat-label {
    font-size: 0.75rem;
  }

  .format-card {
    padding: var(--space-xl);
  }

  .testimonial-card {
    padding: var(--space-xl);
    font-size: 0.95rem;
  }

  .testimonial-card::before {
    font-size: 3rem;
  }

  .booking-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .booking-buttons .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Biography Page - Sticky Section Nav
   -------------------------------------------------------------------------- */
.bio-nav {
  position: sticky;
  top: 80px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-2xl);
  z-index: 100;
}

.bio-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
  justify-content: center;
}

.bio-nav-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.bio-nav-link:hover,
.bio-nav-link:focus {
  background: var(--color-bg);
  color: var(--color-primary);
}

.bio-nav-link.active {
  background: var(--color-primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.mt-3 {
  margin-top: var(--space-2xl);
}

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

/* --------------------------------------------------------------------------
   Stagger Animation Classes
   -------------------------------------------------------------------------- */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* --------------------------------------------------------------------------
   Mobile Responsive - New Components
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .bio-nav {
    top: 68px;
    padding: var(--space-sm);
  }
  
  .bio-nav-list {
    gap: var(--space-xs);
  }
  
  .bio-nav-link {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .service-card {
    padding: var(--space-xl);
  }
  
  .trust-logos {
    gap: var(--space-lg);
  }
  
  .trust-item {
    font-size: 0.95rem;
  }
}

/* Hide mobile-only elements on desktop */
@media (min-width: 769px) {
  .mobile-menu-header {
    display: none;
  }
}

/* --- FIX: Mobile Stats Spacing --- */
@media (max-width: 768px) {
  
  /* --- FIX: Reorder Contact Page on Mobile --- */
  .contact-grid {
    display: flex;
    flex-direction: column-reverse; /* Puts the buttons on top, form on bottom */
    gap: var(--space-xl);
  }

  /* Shrink the red shape so it doesn't hit the text */
  .hero-shapes .shape-1 {
    width: 250px;
    height: 250px;
    right: -120px;
    opacity: 0.05; /* Make it more subtle */
  }
  
  /* Give the stats more breathing room */
  .hero-stats {
    gap: var(--space-md);
    padding-top: var(--space-lg);
  }
}
/* ==========================================================================
   Featured Publication (Biography → Research)
   ========================================================================== */
.publication {
  position: relative;
  margin: var(--space-xl) 0 var(--space-lg);
  border-radius: var(--radius-lg);
}

/* Animated gradient glow behind the card */
.publication-glow {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent), var(--color-primary));
  background-size: 300% 300%;
  opacity: 0.3;
  filter: blur(16px);
  z-index: 0;
  transition: opacity var(--transition-base);
  animation: pubGlow 9s ease infinite;
}
@keyframes pubGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.publication:hover .publication-glow { opacity: 0.55; }

.publication-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: var(--space-xl);
  padding: var(--space-xl);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: inherit;
}

/* Book-cover mockup */
.publication-cover {
  position: relative;
  align-self: start;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--color-primary), #073b73 55%, var(--color-accent));
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-md);
  overflow: hidden;
  color: #fff;
}
.publication-cover::before { /* spine */
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 8px;
  background: rgba(255, 255, 255, 0.18);
}
.publication-cover::after { /* shine sweep */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.28) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.9s ease;
}
.publication:hover .publication-cover::after { transform: translateX(100%); }
.publication-cover-tag {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.publication-cover svg { width: 38px; height: 38px; opacity: 0.95; }
.publication-cover-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 600;
}

.publication-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.publication-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.publication-badge--new {
  color: var(--color-required);
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
}
.publication-badge--new .publication-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse 2s infinite;
}
.publication-badge--oa {
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.publication-body h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  margin-bottom: var(--space-xs);
}
.publication-subtitle {
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-md);
}
.publication-desc { margin-bottom: var(--space-md); }
.publication-authors {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}
.publication-authors strong { color: var(--color-text); }

.publication-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}
.publication-meta dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.publication-meta dd {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.publication-actions .btn { font-size: 0.9rem; }

@media (max-width: 640px) {
  .publication-inner { grid-template-columns: 1fr; }
  .publication-cover { width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  .publication-glow { animation: none; }
  .publication-cover::after { display: none; }
}

/* --------------------------------------------------------------------------
   Cookie Banner (inserted by app.js; first in the DOM, fixed at the bottom)
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  padding: var(--space-lg) 0;
  background: var(--color-bg-card);
  border-top: 3px solid var(--color-primary);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  min-height: 0;
}

/* On short screens only the text scrolls; the buttons always stay in view. */
.cookie-banner-body {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
}

.cookie-banner-body {
  max-width: 760px;
}

.cookie-banner-title {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
}

.cookie-banner p {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.cookie-banner p:last-child {
  margin-bottom: 0;
}

.cookie-banner .cookie-banner-status {
  font-weight: 600;
}

.cookie-banner a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner .cookie-banner-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-primary);
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  flex-shrink: 0;
}

/* Keep focused elements and the end of the page clear of the fixed banner
   (WCAG 2.4.11 Focus Not Obscured). --cookie-banner-h is set by app.js. */
html.has-cookie-banner {
  scroll-padding-bottom: calc(var(--cookie-banner-h, 0px) + 16px);
}

.has-cookie-banner body {
  padding-bottom: var(--cookie-banner-h, 0px);
}

.has-cookie-banner .back-to-top {
  bottom: calc(var(--cookie-banner-h, 0px) + var(--space-md));
}

@media (max-width: 768px) {
  .cookie-banner {
    padding: var(--space-sm) 0 var(--space-md);
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .cookie-banner-body {
    flex: 1 1 auto;
  }

  .cookie-banner-title {
    font-size: 1.05rem;
    margin-bottom: var(--space-xs);
  }

  .cookie-banner p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.375rem;
  }

  .cookie-banner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .cookie-banner-actions .btn {
    width: 100%;
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    line-height: 1.3;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cookie-banner {
    animation: cookieBannerIn 0.35s ease-out;
  }

  @keyframes cookieBannerIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

/* --------------------------------------------------------------------------
   Footer Legal Links
   -------------------------------------------------------------------------- */
.footer-legal ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs) var(--space-lg);
  list-style: none;
  margin-bottom: var(--space-md);
}

.footer-legal a,
.footer-legal-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-xs) 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}

.footer-legal a:hover,
.footer-legal a:focus,
.footer-legal-btn:hover,
.footer-legal-btn:focus {
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Legal Pages (Privacy Policy, Terms of Use)
   -------------------------------------------------------------------------- */
.legal-content {
  max-width: 780px;
  margin: 0 auto;
}

.legal-updated {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-xl);
}

.legal-summary {
  margin-bottom: var(--space-2xl);
  padding: var(--space-lg);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
}

.legal-summary h2 {
  margin-top: 0;
}

.legal-toc {
  margin-bottom: var(--space-2xl);
  padding: var(--space-lg);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.legal-toc h2 {
  font-size: 1.1rem;
  margin: 0 0 var(--space-sm);
}

.legal-toc ol {
  padding-inline-start: 1.5rem;
  margin: 0;
}

.legal-toc li {
  margin-bottom: var(--space-xs);
}

.legal-content h2 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  margin: var(--space-2xl) 0 var(--space-md);
  scroll-margin-top: 96px;
}

.legal-content h3 {
  font-size: 1.15rem;
  margin: var(--space-xl) 0 var(--space-sm);
}

.legal-content p,
.legal-content li {
  margin-bottom: var(--space-md);
}

.legal-content ul {
  padding-inline-start: 1.5rem;
  margin-bottom: var(--space-md);
}

.legal-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.legal-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.legal-table caption {
  padding: var(--space-sm) var(--space-md);
  text-align: start;
  font-weight: 600;
}

.legal-table th,
.legal-table td {
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--color-border);
  text-align: start;
  vertical-align: top;
}

.legal-table th {
  background: var(--color-bg-alt);
  font-family: var(--font-display);
  font-weight: 600;
}

.legal-table code {
  font-size: 0.88em;
  word-break: break-all;
}

.legal-cookie-settings {
  margin: var(--space-lg) 0;
}

/* --------------------------------------------------------------------------
   Arabic typography (Amiri): Naskh needs a slightly larger size and more
   line height than Latin text, or its dots and marks collide.
   -------------------------------------------------------------------------- */
html[lang="ar"] {
  font-size: 106.25%;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4 {
  line-height: 1.5;
  letter-spacing: 0;
}

html[lang="ar"] body {
  line-height: 1.9;
}
