/* ==========================================================================
   ACW ENHANCEMENTS — 50-Phase Visual Upgrade
   New design tokens, animations, and micro-interactions
   Loaded LAST so all overrides win
   ========================================================================== */

/* ============================================
   PHASE 1 — Global Design Tokens
   ============================================ */
:root {
  /* Enhanced color palette */
  --enh-gold: #D4A64A;
  --enh-gold-glow: rgba(212, 166, 74, 0.35);
  --enh-gold-deep: #b88e32;
  --enh-navy-glow: rgba(11, 31, 58, 0.25);
  --enh-blue-accent: #2a6af0;
  --enh-success: #2ecc71;
  --enh-danger: #e74c3c;

  /* Enhanced shadows */
  --enh-shadow-xs: 0 2px 8px rgba(11, 31, 58, 0.04);
  --enh-shadow-sm: 0 8px 24px rgba(11, 31, 58, 0.07);
  --enh-shadow-md: 0 16px 48px rgba(11, 31, 58, 0.10);
  --enh-shadow-lg: 0 24px 64px rgba(11, 31, 58, 0.14);
  --enh-shadow-xl: 0 32px 80px rgba(11, 31, 58, 0.18);
  --enh-shadow-gold: 0 8px 32px rgba(212, 166, 74, 0.22);
  --enh-shadow-glow: 0 0 40px rgba(212, 166, 74, 0.15);

  /* Spacing scale */
  --enh-space-3xs: 4px;
  --enh-space-2xs: 6px;
  --enh-space-xs: 8px;
  --enh-space-sm: 12px;
  --enh-space-md: 16px;
  --enh-space-lg: 24px;
  --enh-space-xl: 32px;
  --enh-space-2xl: 48px;
  --enh-space-3xl: 64px;
  --enh-space-4xl: 96px;

  /* Border radius */
  --enh-radius-sm: 8px;
  --enh-radius-md: 14px;
  --enh-radius-lg: 20px;
  --enh-radius-xl: 28px;
  --enh-radius-2xl: 36px;
  --enh-radius-pill: 999px;

  /* Transitions */
  --enh-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --enh-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --enh-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --enh-duration-fast: 0.15s;
  --enh-duration-normal: 0.25s;
  --enh-duration-slow: 0.4s;
  --enh-duration-slower: 0.6s;

  /* Z-index scale */
  --enh-z-base: 1;
  --enh-z-dropdown: 100;
  --enh-z-sticky: 200;
  --enh-z-overlay: 500;
  --enh-z-modal: 1000;
  --enh-z-toast: 1500;
}

/* ============================================
   PHASE 8 — Button Micro-interactions & Ripple
   ============================================ */
.button, .footer .footer-community__subscribe, .footer .footer-lang__toggle {
  position: relative;
  transition: transform var(--enh-duration-normal) var(--enh-ease-out),
              box-shadow var(--enh-duration-normal) var(--enh-ease-out),
              background-color var(--enh-duration-normal) var(--enh-ease-out),
              border-color var(--enh-duration-normal) var(--enh-ease-out),
              color var(--enh-duration-normal) var(--enh-ease-out);
}

.button::after, .footer .footer-community__subscribe::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255, 255, 255, 0.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
}

.button:active::after, .footer .footer-community__subscribe:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: 0s;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0) scale(0.98);
}

.button.gold {
  box-shadow: var(--enh-shadow-gold);
}

.button.gold:hover {
  box-shadow: 0 12px 36px rgba(212, 166, 74, 0.32);
  transform: translateY(-2px);
}

/* ============================================
   PHASE 11 — Scroll Progress Bar
   ============================================ */
.acw-scroll-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #D4A64A, #b88e32, #D4A64A);
  background-size: 200% 100%;
  animation: scrollProgressShimmer 2s linear infinite;
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

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

/* ============================================
   PHASE 12 — Enhanced Reveal Animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--enh-ease-out), transform 0.65s var(--enh-ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--enh-ease-out), transform 0.5s var(--enh-ease-out);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }

/* Fade variants */
.reveal-fade {
  opacity: 0;
  transition: opacity 0.6s var(--enh-ease-out);
}
.reveal-fade.is-visible { opacity: 1; }

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s var(--enh-ease-out), transform 0.6s var(--enh-ease-out);
}
.reveal-left.is-visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s var(--enh-ease-out), transform 0.6s var(--enh-ease-out);
}
.reveal-right.is-visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s var(--enh-ease-out), transform 0.6s var(--enh-ease-spring);
}
.reveal-scale.is-visible { opacity: 1; transform: scale(1); }

/* ============================================
   PHASE 4 — Enhanced Card Hover (Edge Glow)
   ============================================ */
.home-route-card,
.page-card,
.feature-card,
.module-card,
.home-latest-card {
  transition: transform var(--enh-duration-normal) var(--enh-ease-out),
              box-shadow var(--enh-duration-normal) var(--enh-ease-out),
              border-color var(--enh-duration-normal) var(--enh-ease-out);
}

/* ============================================
   PHASE 15 — Back to Top Button
   ============================================ */
.acw-back-to-top {
  position: fixed;
  bottom: 32px;
  inset-inline-end: 32px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(11, 31, 58, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--enh-shadow-sm);
  color: var(--shell-primary, #0B1F3A);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--enh-duration-normal) var(--enh-ease-out),
              visibility var(--enh-duration-normal),
              transform var(--enh-duration-normal) var(--enh-ease-out),
              box-shadow var(--enh-duration-normal) var(--enh-ease-out);
  z-index: var(--enh-z-sticky);
}

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

.acw-back-to-top:hover {
  box-shadow: var(--enh-shadow-md);
  transform: translateY(-3px);
  border-color: var(--enh-gold-glow);
}

.acw-back-to-top svg {
  width: 20px;
  height: 20px;
  transition: transform var(--enh-duration-fast) var(--enh-ease-out);
}

html[dir='rtl'] .acw-back-to-top svg {
  transform: scaleX(-1);
}

.acw-back-to-top:hover svg {
  transform: translateY(-2px);
}

/* ============================================
   PHASE 14 — Enhanced Form Inputs
   ============================================ */
.field input,
.field textarea,
.field select {
  border: 1.5px solid var(--enh-line, rgba(11, 31, 58, 0.12));
  border-radius: var(--enh-radius-md);
  background: rgba(255, 255, 255, 0.96);
  transition: border-color var(--enh-duration-normal) var(--enh-ease-out),
              box-shadow var(--enh-duration-normal) var(--enh-ease-out),
              background-color var(--enh-duration-normal) var(--enh-ease-out);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #D4A64A;
  box-shadow: 0 0 0 3px rgba(212, 166, 74, 0.15);
  background: #fff;
  outline: none;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: rgba(11, 31, 58, 0.2);
}

/* ============================================
   PHASE 32 — Vertical Rhythm Enhancement
   Keep typography shared, but let every page own its section spacing. Most
   public pages already define `.section` margins, so adding another margin
   plus 24px padding on both sides created 70px+ empty bands between cards.
   ============================================ */
body {
  line-height: 1.75;
}

/* ============================================
   PHASE 28 — Footer Layout Enhancement
   ============================================ */
.footer-card {
  transition: transform var(--enh-duration-normal) var(--enh-ease-out);
}

.footer-card:hover {
  transform: translateY(-2px);
}

.footer-links a {
  position: relative;
  transition: color var(--enh-duration-fast) var(--enh-ease-out),
              padding-inline-start var(--enh-duration-normal) var(--enh-ease-out);
}

.footer-links a::before {
  content: '';
  position: absolute;
  bottom: -2px;
  inset-inline-start: 0;
  width: 0;
  height: 1.5px;
  background: var(--shell-gold, #D4A64A);
  transition: width var(--enh-duration-normal) var(--enh-ease-out);
}

.footer-links a:hover::before {
  width: 100%;
}

/* ============================================
   PHASE 34 — Navigation Active Indicator
   ============================================ */
.nav-links a {
  position: relative;
  transition: color var(--enh-duration-fast) var(--enh-ease-out);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  inset-inline-start: 50%;
  width: 0;
  height: 2px;
  background: #D4A64A;
  border-radius: 1px;
  transition: width var(--enh-duration-normal) var(--enh-ease-out),
              inset-inline-start var(--enh-duration-normal) var(--enh-ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
  inset-inline-start: 0;
}

/* ============================================
   PHASE 23 — Animated Number Counters
   ============================================ */
[data-counter] {
  font-variant-numeric: tabular-nums;
  transition: color var(--enh-duration-fast) var(--enh-ease-out);
}

/* ============================================
   PHASE 35 — Card Spotlight Hover Effect
   ============================================ */
.page-card, .feature-card, .module-card {
  --spotlight-x: 50%;
  --spotlight-y: 50%;
}

.page-card:hover, .feature-card:hover, .module-card:hover {
  background-image: radial-gradient(
    400px circle at var(--spotlight-x) var(--spotlight-y),
    rgba(212, 166, 74, 0.06),
    transparent 60%
  );
}

/* ============================================
   PHASE 13 — Skeleton Loading
   ============================================ */
.skeleton {
  background: linear-gradient(90deg,
    rgba(11, 31, 58, 0.06) 25%,
    rgba(11, 31, 58, 0.10) 50%,
    rgba(11, 31, 58, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--enh-radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-title {
  height: 22px;
  width: 75%;
  margin-bottom: 12px;
  border-radius: 6px;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--enh-radius-md);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

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

/* ============================================
   PHASE 42 — Enhanced Chips/Badges
   ============================================ */
.chips span {
  position: relative;
  overflow: hidden;
  transition: background-color var(--enh-duration-fast) var(--enh-ease-out),
              transform var(--enh-duration-fast) var(--enh-ease-out);
}

.chips span:hover {
  transform: translateY(-1px);
}

/* ============================================
   PHASE 18 — Enhanced Mobile Navigation
   ============================================ */
@media (max-width: 1080px) {
  .site-nav {
    transform: translateX(100%);
    transition: transform 0.35s var(--enh-ease-out);
  }

  html[dir='rtl'] .site-nav {
    transform: translateX(-100%);
  }

  .site-header.open .site-nav,
  .site-header.menu-open .site-nav {
    transform: translateX(0);
  }
}

/* ============================================
   PHASE 22 — CTA Section Enhancement
   ============================================ */
.home-action-band {
  position: relative;
  overflow: hidden;
}

.home-action-band::before {
  content: '';
  position: absolute;
  top: -50%;
  inset-inline-end: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 173, 62, 0.12), transparent 70%);
  pointer-events: none;
  animation: ctaPulse 4s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ============================================
   PHASE 30 — Animated Border Gradient on Cards
   ============================================ */
.acw-glow-card {
  position: relative;
  border: 1px solid transparent !important;
  background-clip: padding-box;
}

.acw-glow-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    var(--glow-angle, 0deg),
    rgba(212, 166, 74, 0.3),
    transparent 40%,
    transparent 60%,
    rgba(212, 166, 74, 0.3)
  );
  z-index: -1;
  opacity: 0;
  transition: opacity var(--enh-duration-normal) var(--enh-ease-out);
}

.acw-glow-card:hover::before {
  opacity: 1;
}

@keyframes borderRotate {
  0% { --glow-angle: 0deg; }
  100% { --glow-angle: 360deg; }
}

@property --glow-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ============================================
   PHASE 36 — Hero Stats Counter Enhancement
   ============================================ */
.home-signal strong {
  position: relative;
}

.home-signal strong::after {
  content: '';
  position: absolute;
  bottom: -2px;
  inset-inline-start: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--home-gold-soft), transparent);
  opacity: 0;
  transition: opacity var(--enh-duration-normal) var(--enh-ease-out);
}

.home-signal:hover strong::after {
  opacity: 1;
}

/* ============================================
   PHASE 38 — SVG Wave Section Dividers
   ============================================ */
.enh-wave-divider {
  width: 100%;
  height: 60px;
  display: block;
  margin: -1px 0;
}

.enh-wave-divider path {
  fill: var(--bg, #F5F1E8);
}

/* ============================================
   PHASE 39 — Text Gradient Animation
   ============================================ */
.enh-gradient-text {
  background: linear-gradient(135deg, #D4A64A, #b88e32, #D4A64A);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textGradientShift 3s ease infinite;
}

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

/* ============================================
   PHASE 24 — Latest Report Glass Enhancement
   ============================================ */
.home-latest-card {
  backdrop-filter: blur(2px);
}

.home-latest-card:hover {
  box-shadow: 0 20px 48px rgba(8, 27, 52, 0.2);
}

/* ============================================
   PHASE 26 — Enhanced Search
   ============================================ */
.search-wrap {
  position: relative;
}

.search-wrap input:focus {
  border-color: #D4A64A;
  box-shadow: 0 0 0 3px rgba(212, 166, 74, 0.12);
}

.search-feedback {
  font-size: 10px;
  padding: 4px 0;
  min-height: 18px;
}

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

  .cursor-dot,
  .cursor-ring,
  .hero-particles,
  .hero-particle {
    display: none !important;
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .button {
    border: 2px solid ButtonText;
  }

  .nav-links a::after {
    background: Highlight;
  }

  .acw-scroll-progress {
    background: Highlight;
  }
}

/* Focus visible enhancements for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #D4A64A;
  outline-offset: 3px;
}

/* ============================================
   PHASE 48 — Print Styles
   ============================================ */
@media print {
  .acw-scroll-progress,
  .acw-back-to-top,
  .site-header,
  .footer,
  .nav-toggle,
  .search-wrap,
  .lang-switch,
  .button,
  .reveal {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #555;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
  }

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

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

/* ============================================
   PHASE 2 — Enhanced Header Transitions
   ============================================ */
body > .site-header {
  transition: padding 0.3s var(--enh-ease-out),
              background-color 0.3s var(--enh-ease-out),
              border-color 0.3s var(--enh-ease-out),
              box-shadow 0.3s var(--enh-ease-out),
              backdrop-filter 0.3s var(--enh-ease-out) !important;
}

body > .site-header .header-main {
  transition: min-height 0.3s var(--enh-ease-out),
              max-height 0.3s var(--enh-ease-out),
              padding 0.3s var(--enh-ease-out),
              opacity 0.25s var(--enh-ease-out),
              transform 0.3s var(--enh-ease-out),
              border-color 0.25s var(--enh-ease-out),
              box-shadow 0.25s var(--enh-ease-out) !important;
}

body > .site-header .brand img {
  transition: width 0.3s var(--enh-ease-out),
              height 0.3s var(--enh-ease-out),
              filter 0.3s var(--enh-ease-out) !important;
}

body > .site-header.acw-header-condensed .brand img {
  width: 42px !important;
  height: 42px !important;
}

body > .site-header .brand-copy h1,
body > .site-header .brand-copy strong {
  transition: font-size 0.3s var(--enh-ease-out),
              opacity 0.25s var(--enh-ease-out),
              transform 0.25s var(--enh-ease-out) !important;
}

body > .site-header.acw-header-condensed .brand-copy h1,
body > .site-header.acw-header-condensed .brand-copy strong {
  font-size: 20px !important;
}

body > .site-header .nav-links a {
  transition: color 0.2s var(--enh-ease-out),
              background-color 0.2s var(--enh-ease-out) !important;
}

body > .site-header .nav-links a:hover {
  color: var(--acw-header-gold) !important;
}

/* ============================================
   PHASE 3 — Hero Floating Particles
   ============================================ */
.home-hero {
  position: relative;
}

.home-hero .hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(216, 173, 62, 0.4);
  animation: particleFloat 8s ease-in-out infinite;
}

.hero-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 7s; }
.hero-particle:nth-child(2) { left: 25%; top: 60%; animation-delay: 1.5s; animation-duration: 9s; }
.hero-particle:nth-child(3) { left: 50%; top: 30%; animation-delay: 3s; animation-duration: 6s; width: 3px; height: 3px; }
.hero-particle:nth-child(4) { left: 70%; top: 70%; animation-delay: 0.8s; animation-duration: 10s; }
.hero-particle:nth-child(5) { left: 85%; top: 40%; animation-delay: 2.2s; animation-duration: 8s; width: 5px; height: 5px; }
.hero-particle:nth-child(6) { left: 40%; top: 80%; animation-delay: 4s; animation-duration: 7.5s; }
.hero-particle:nth-child(7) { left: 60%; top: 15%; animation-delay: 1s; animation-duration: 11s; width: 3px; height: 3px; }
.hero-particle:nth-child(8) { left: 90%; top: 55%; animation-delay: 2.8s; animation-duration: 6.5s; }

@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-20px) translateX(10px) scale(1.2);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-10px) translateX(-8px) scale(0.8);
    opacity: 0.4;
  }
  75% {
    transform: translateY(-25px) translateX(5px) scale(1.1);
    opacity: 0.5;
  }
}

@media (max-width: 768px) {
  .hero-particles,
  .hero-particle {
    display: none !important;
  }
}

/* ============================================
   PHASE 5 — Process Line Animation
   ============================================ */
.home-process-grid::before {
  animation: processLineGlow 3s ease-in-out infinite;
}

@keyframes processLineGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.home-process-card {
  transition: background-color 0.3s var(--enh-ease-out);
}

.home-process-card:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.home-process-index {
  transition: transform 0.3s var(--enh-ease-spring),
              border-color 0.3s var(--enh-ease-out),
              box-shadow 0.3s var(--enh-ease-out);
}

.home-process-card:hover .home-process-index {
  transform: scale(1.08);
  border-color: rgba(216, 173, 62, 0.8);
  box-shadow: 0 0 20px rgba(216, 173, 62, 0.3);
}

/* ============================================
   PHASE 6 — Footer Ambient Glow
   ============================================ */
.footer .footer-community {
  position: relative;
  overflow: hidden;
}

.footer .footer-community::after {
  content: '';
  position: absolute;
  bottom: -40%;
  inset-inline-end: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 166, 74, 0.08), transparent 70%);
  pointer-events: none;
  animation: footerGlow 6s ease-in-out infinite;
}

@keyframes footerGlow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.footer .footer-main {
  position: relative;
}

.footer .footer-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 166, 74, 0.3), transparent);
}

/* ============================================
   PHASE 7 — Typography Enhancement
   ============================================ */
h1, h2, h3, h4 {
  text-wrap: balance;
  hanging-punctuation: first last;
}

.section-head h2 {
  letter-spacing: -0.02em;
}

html[dir='rtl'] .section-head h2 {
  letter-spacing: 0;
}

/* ============================================
   PHASE 9 — Enhanced Tablet Breakpoints
   ============================================ */
@media (min-width: 768px) and (max-width: 1080px) {
  .home-route-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }

  .home-route-card--lead {
    grid-column: 1 / -1 !important;
  }

  .home-process-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
  }

  .home-watch-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .home-action-band {
    grid-template-columns: 1fr !important;
  }

  .home-action-links {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ============================================
   PHASE 10 — Enhanced Dark Mode
   ============================================ */
html[data-theme='dark'] body:not([data-page='news']):not(.managed-page) {
  --site-body-bg:
    radial-gradient(circle at top left, rgba(212, 166, 74, 0.10), transparent 24%),
    radial-gradient(circle at bottom right, rgba(216, 173, 62, 0.06), transparent 26%),
    linear-gradient(180deg, rgba(13,26,44,.55), rgba(11,22,38,0) 28%),
    #0b1626 !important;
}

/* Header dark mode handled by acw-public-header.css — do not duplicate */

html[data-theme='dark'] .home-route-card:not(.home-route-card--lead) {
  background: rgba(18, 26, 39, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme='dark'] .home-feature-card {
  background: rgba(18, 26, 39, 0.95) !important;
}

html[data-theme='dark'] .acw-back-to-top {
  background: rgba(18, 26, 39, 0.92);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Form dark mode handled by site-dark.css — do not duplicate */

/* ============================================
   PHASE 16 — Image Lazy Loading + Blur-up
   ============================================ */
img[loading='lazy'] {
  transition: filter 0.5s var(--enh-ease-out);
  filter: blur(4px);
}

img[loading='lazy'].loaded {
  filter: blur(0);
}

/* ============================================
   PHASE 17 — Page Transition
   ============================================ */
.acw-page-enter {
  animation: pageEnter 0.4s var(--enh-ease-out);
}

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

/* ============================================
   PHASE 19 — Micro Tooltips
   ============================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(11, 31, 58, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s var(--enh-ease-out),
              transform 0.2s var(--enh-ease-out),
              visibility 0.2s;
  z-index: var(--enh-z-toast);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   PHASE 20 — 3D Tilt on Cards
   ============================================ */
.tilt-card {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.tilt-card-inner {
  transition: transform 0.3s var(--enh-ease-out);
  transform-style: preserve-3d;
}

/* ============================================
   PHASE 25 — Parallax Hero
   ============================================ */
.home-hero {
  will-change: transform;
}

/* ============================================
   PHASE 27 — Loading Screen
   ============================================ */
.acw-loading-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg, #F5F1E8);
  z-index: 99999;
  transition: opacity 0.4s var(--enh-ease-out), visibility 0.4s;
}

.acw-loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.acw-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(11, 31, 58, 0.1);
  border-top-color: #D4A64A;
  border-radius: 50%;
  animation: loadingSpin 0.8s linear infinite;
}

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

/* ============================================
   PHASE 29 — Color Scheme Toggle
   ============================================ */
.acw-theme-toggle {
  position: fixed;
  bottom: 32px;
  inset-inline-start: 32px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(11, 31, 58, 0.18);
  border-radius: 50%;
  background: rgba(245, 241, 232, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(11, 31, 58, 0.14);
  color: #081b34;
  cursor: pointer;
  z-index: var(--enh-z-sticky);
  transition: transform 0.3s var(--enh-ease-spring),
              box-shadow 0.3s var(--enh-ease-out),
              background 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease;
  font-size: 20px;
  line-height: 1;
}

html[data-theme='dark'] .acw-theme-toggle,
html:not([data-theme='light']):not([data-theme]) .acw-theme-toggle {
  background: rgba(20, 45, 76, 0.92);
  border-color: rgba(212, 166, 74, 0.3);
  color: #d4a64a;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}

html[data-theme='light'] .acw-theme-toggle {
  background: rgba(245, 241, 232, 0.96);
  border-color: rgba(11, 31, 58, 0.18);
  color: #081b34;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .acw-theme-toggle {
    background: rgba(20, 45, 76, 0.92);
    border-color: rgba(212, 166, 74, 0.3);
    color: #d4a64a;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
  }
}

.acw-theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(11, 31, 58, 0.22);
}

html[data-theme='dark'] .acw-theme-toggle:hover,
html:not([data-theme='light']):not([data-theme]) .acw-theme-toggle:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .acw-theme-toggle:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
}

.acw-theme-toggle:focus-visible {
  outline: 2px solid var(--enh-gold);
  outline-offset: 3px;
}

/* ============================================
   PHASE 31 — Ambient Background Animation
   ============================================ */
.ambient-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
  animation: ambientMove 20s ease-in-out infinite;
}

.ambient-blob--1 {
  width: 500px;
  height: 500px;
  background: #D4A64A;
  top: 10%;
  inset-inline-start: -10%;
  animation-delay: 0s;
}

.ambient-blob--2 {
  width: 400px;
  height: 400px;
  background: #0B1F3A;
  bottom: 20%;
  inset-inline-end: -8%;
  animation-delay: 5s;
}

@keyframes ambientMove {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(30px, -20px); }
  50% { transform: translate(-20px, 30px); }
  75% { transform: translate(15px, 15px); }
}

/* ============================================
   PHASE 33 — Cursor Trail (desktop only)
   ============================================ */
@media (pointer: fine) and (hover: hover) and (min-width: 1024px) {
  .cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4A64A;
    pointer-events: none;
    z-index: 99999;
    transition: transform 0.15s var(--enh-ease-out),
                opacity 0.3s;
    mix-blend-mode: difference;
    opacity: 0;
  }

  .cursor-dot.active {
    opacity: 1;
  }

  .cursor-ring {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(212, 166, 74, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transition: transform 0.2s var(--enh-ease-out),
                width 0.3s var(--enh-ease-out),
                height 0.3s var(--enh-ease-out),
                border-color 0.3s,
                opacity 0.2s;
    transform: translate(-50%, -50%);
    opacity: 0;
  }

  .cursor-ring.active {
    opacity: 1;
  }

  .cursor-ring.hovering {
    width: 52px;
    height: 52px;
    border-color: rgba(212, 166, 74, 0.8);
  }

  a, button, .page-card, .feature-card, .module-card {
    cursor: pointer;
  }
}

/* ============================================
   PHASE 37 — Magnetic Button Effect
   ============================================ */
.magnetic-btn {
  transition: transform 0.3s var(--enh-ease-out);
}

/* ============================================
   PHASE 40 — Masonry-like Grid
   ============================================ */
.masonry-grid {
  columns: 3;
  column-gap: 16px;
}

.masonry-grid > * {
  break-inside: avoid;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .masonry-grid {
    columns: 2;
  }
}

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

/* ============================================
   PHASE 41 — Scroll Snap
   ============================================ */
.scroll-snap-x {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.scroll-snap-x > * {
  scroll-snap-align: start;
}

/* ============================================
   PHASE 43 — Scroll Progress Indicators
   ============================================ */
.section-progress {
  position: relative;
}

.section-progress::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #D4A64A, #b88e32);
  border-radius: 1px;
  transition: width 0.4s var(--enh-ease-out);
}

.section-progress.in-view::after {
  width: 100%;
}

/* ============================================
   PHASE 44 — Drop Caps & Pull Quotes
   ============================================ */
article > p:first-of-type::first-letter {
  float: inset-inline-start;
  font-size: 3.2em;
  line-height: 0.85;
  padding-inline-end: 8px;
  padding-block-start: 4px;
  color: #D4A64A;
  font-weight: 700;
}

.pull-quote {
  position: relative;
  margin: 24px 0;
  padding: 20px 24px;
  border-inline-start: 3px solid #D4A64A;
  background: rgba(212, 166, 74, 0.06);
  border-radius: 0 var(--enh-radius-md) var(--enh-radius-md) 0;
  font-size: 1.1em;
  font-style: italic;
  color: var(--home-ink, #10213A);
}

html[dir='rtl'] .pull-quote {
  border-radius: var(--enh-radius-md) 0 0 var(--enh-radius-md);
}

/* ============================================
   PHASE 45 — Frosted Glass Nav Overlay
   ============================================ */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--enh-z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--enh-ease-out), visibility 0.3s;
}

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

/* ============================================
   PHASE 46 — Image Hover Zoom
   ============================================ */
.img-zoom {
  overflow: hidden;
  border-radius: var(--enh-radius-md);
}

.img-zoom img {
  transition: transform 0.5s var(--enh-ease-out);
}

.img-zoom:hover img {
  transform: scale(1.06);
}

/* ============================================
   PHASE 47 — Animated SVG Icons
   ============================================ */
.svg-icon {
  transition: transform 0.3s var(--enh-ease-spring),
              color 0.2s;
}

.svg-icon:hover {
  transform: scale(1.15) rotate(-3deg);
}

.svg-icon--bounce:hover {
  animation: iconBounce 0.5s var(--enh-ease-spring);
}

@keyframes iconBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1.1); }
}

/* ============================================
   PHASE 50 — Final Polish
   ============================================ */
/* Smooth image rendering */
img {
  image-rendering: -webkit-optimize-contrast;
}

/* Better selection color */
::selection {
  background: rgba(212, 166, 74, 0.3);
  color: #0B1F3A;
}

::-moz-selection {
  background: rgba(212, 166, 74, 0.3);
  color: #0B1F3A;
}

html[data-theme='dark'] ::selection,
html[data-theme='dark'] ::-moz-selection {
  background: rgba(212, 166, 74, 0.4);
  color: #e8eef6;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) ::selection,
  html:not([data-theme='light']) ::-moz-selection {
    background: rgba(212, 166, 74, 0.4);
    color: #e8eef6;
  }
}

/* Smooth scrollbar (webkit) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(11, 31, 58, 0.04);
}

::-webkit-scrollbar-thumb {
  background: rgba(11, 31, 58, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(11, 31, 58, 0.25);
}

html[data-theme='dark'] ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme='dark'] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
  }
  html:not([data-theme='light']) ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
  }
  html:not([data-theme='light']) ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
  }
}

/* Prevent layout shifts */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Performance: contain paint */
.feature-card, .page-card, .module-card, .home-latest-card {
  contain: paint style;
}

/* ============================================
   PUBLIC SURFACE UNIFICATION — 2026-08-21
   Shared rhythm for the high-traffic public families. Page-specific layouts
   remain intact; these rules standardize their visual contract.
   ============================================ */
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='newsStory'],body[data-page='newsLive'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']){
  --public-surface-radius:22px;
  --public-control-radius:14px;
  --public-section-gap:clamp(28px,4vw,48px);
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='newsStory'],body[data-page='newsLive'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main .section{
  margin-top:var(--public-section-gap);
  scroll-margin-top:150px;
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main .section-head{
  gap:18px;
  margin-bottom:20px;
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main .section-head h2{
  line-height:1.25;
  text-wrap:balance;
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main :where(.card,.panel,.info-card,.donation-card){
  border-radius:var(--public-surface-radius);
}
:where(body[data-page='prayer'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main :where(input,textarea,select){
  min-height:46px;
  border-radius:var(--public-control-radius) !important;
  font:inherit;
}
:where(body[data-page='prayer'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main textarea{
  line-height:1.8;
  resize:vertical;
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) .button{
  min-height:44px;
  font-weight:750;
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) .button:hover{
  transform:none;
}
body[data-page='prayer'] main .hero{
  min-height:clamp(520px,calc(100vh - 180px),720px) !important;
}
body[data-page='prayer'] main .hero-layout{
  align-items:end;
}
body[data-page='prayer'] main :where(.live-grid,.map-grid){
  align-items:stretch;
}
body[data-page='prayer'] main .card{
  overflow-wrap:anywhere;
}
:where(body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main form{
  align-content:start;
}
:where(body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main label{
  line-height:1.55;
}
:where(body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main :where(input[type='email'],input[type='tel'],input[type='password']){
  direction:ltr;
  text-align:start;
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='newsStory'],body[data-page='newsLive'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) > :where(.footer,.site-footer){
  margin-top:clamp(38px,6vw,72px);
  border-top:1px solid rgba(212,166,74,.18);
}
:where(body[data-page='prayer'],body[data-page='news'],body[data-page='newsStory'],body[data-page='newsLive'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) > :where(.footer,.site-footer) :where(.footer-card,.footer-panel){
  border-radius:20px;
}
@media(max-width:900px){
  :where(body[data-page='prayer'],body[data-page='news'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main .section-head{
    align-items:start;
    flex-direction:column;
  }
  body[data-page='prayer'] main :where(.live-grid,.map-grid){
    grid-template-columns:1fr !important;
  }
}
@media(max-width:640px){
  :where(body[data-page='prayer'],body[data-page='news'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']){
    --public-surface-radius:18px;
    --public-section-gap:28px;
  }
  body[data-page='prayer'] main .hero{min-height:auto !important}
  body[data-page='prayer'] main .hero-layout{padding:24px 18px}
  :where(body[data-page='prayer'],body[data-page='support'],body[data-page='donate'],body[data-page='reportSubmit']) main :where(.button,button[type='submit']){width:100%}
}
