/* ==========================================================================
   SIGN KERALA - A NEW VISION OF SOCIAL JUSTICE FOR SC/ST
   Million-Dollar Institutional Brand Identity & Design System
   Researched for: Corporate CSR Evaluators, HNW Philanthropists & State Missions
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600;1,700&display=swap');

:root {
  /* Primary Foundation (Authority & Constitutional Governance) */
  --brand-navy-950: #060d1a;
  --brand-navy-900: #0a1628;  /* Dominant Midnight Oxford Navy */
  --brand-navy-800: #112240;  /* Secondary Deep Blue */
  --brand-navy-700: #1b355e;
  
  /* Ecological & Indigenous Heritage (Kasaragod Western Ghats) */
  --brand-pine-950: #041812;
  --brand-pine-900: #072a20;  /* Kasaragod Rainforest Pine */
  --brand-pine-800: #0d4435;
  --brand-pine-700: #13614c;
  --brand-pine-accent: #059669; /* Vitality Green */
  
  /* Sovereign Prestige (Constitutional Justice & Donor Recognition) */
  --brand-gold-600: #b47820;
  --brand-gold-500: #c98a2c;  /* Sovereign Amber Gold */
  --brand-gold-400: #e2a64c;
  --brand-gold-100: #fef7ec;  /* Soft Warm Champagne Tint */
  --brand-gold-border: #fde68a;
  
  /* Digital Mobility & Civic Technology (Literacy & Banking) */
  --brand-cyan-600: #0284c7;  /* Institutional Azure Blue */
  --brand-cyan-500: #0ea5e9;
  --brand-cyan-50:  #f0f9ff;
  
  /* Museum-Grade Canvas (Crisp Architectural Whites) */
  --surface-canvas: #fafbfc;  /* Clean pure porcelain */
  --surface-card:   #ffffff;  /* High contrast pure white */
  --surface-subtle: #f1f4f8;  /* Architectural muted */
  --surface-panel:  #e9eff6;
  
  /* Hairline Precision Borders */
  --border-subtle:  #e2e8f0;
  --border-medium:  #cbd5e1;
  --border-strong:  #94a3b8;
  
  /* High-Contrast Executive Typography */
  --text-headline:  #0a1628;  /* Deepest Ink Navy */
  --text-body:      #2d3748;  /* Slate Charcoal */
  --text-muted:     #5a6a80;  /* Balanced Mid-tone */
  --text-faint:     #8c9bae;  /* Subtle Metadata */

  --nav-glass: rgba(255, 255, 255, 0.94);
  --dock-glass: rgba(255, 255, 255, 0.96);

  /* World-Class Trust & Institutional Typography */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.04), 0 1px 2px rgba(10, 22, 40, 0.02);
  --shadow-md: 0 10px 25px -5px rgba(10, 22, 40, 0.06), 0 8px 10px -6px rgba(10, 22, 40, 0.02);
  --shadow-lg: 0 20px 35px -8px rgba(10, 22, 40, 0.12), 0 10px 14px -5px rgba(10, 22, 40, 0.04);
  --shadow-gold: 0 8px 24px -4px rgba(201, 138, 44, 0.25);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.35s var(--ease-expo);
}

[data-theme="dark"] {
  --brand-navy-950: #02050b;
  --brand-navy-900: #060d1a;
  --brand-navy-800: #0c182c;
  --brand-navy-700: #142848;

  --brand-pine-950: #020b08;
  --brand-pine-900: #051c15;
  --brand-pine-800: #092e23;
  --brand-pine-700: #0d4435;
  --brand-pine-accent: #10b981;

  --brand-gold-600: #d49b38;
  --brand-gold-500: #f59e0b;
  --brand-gold-400: #fbbf24;
  --brand-gold-100: #1e1606;
  --brand-gold-border: #453108;

  --brand-cyan-600: #38bdf8;
  --brand-cyan-500: #60a5fa;

  --surface-canvas: #040810;
  --surface-card:   #08111e;
  --surface-subtle: #0f1c30;
  --surface-panel:  #14243e;

  --border-subtle:  #17263c;
  --border-medium:  #243854;
  --border-strong:  #3b5275;

  --text-headline:  #f8fafc;
  --text-body:      #cbd5e1;
  --text-muted:     #8fa0b8;
  --text-faint:     #5a6e88;

  --nav-glass: rgba(4, 8, 16, 0.92);
  --dock-glass: rgba(8, 17, 30, 0.95);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 35px -8px rgba(0, 0, 0, 0.8);
}

/* Accessibility font scale */
body.font-sm { font-size: 14.5px; }
body.font-md { font-size: 16px; }
body.font-lg { font-size: 18px; }

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100vw;
  overflow-x: clip;
}

/* Buttery Smooth Inertial Scrolling (Lenis Integration) */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--surface-canvas);
  color: var(--text-body);
  line-height: 1.65;
  transition: background-color 0.35s ease, color 0.35s ease;
  overflow-x: clip;
  position: relative;
}

/* ==========================================================================
   MINIMAL AWWWARDS PRELOADER (Split-Curtain Reveal & Monospace Counter)
   ========================================================================== */
#site-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  user-select: none;
}

/* Split-Curtain Background Panes */
.preloader-curtain {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50.5%;
  background-color: #060d1a;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

.curtain-top {
  top: 0;
  transform-origin: top center;
}

.curtain-bottom {
  bottom: 0;
  transform-origin: bottom center;
}

/* Center Stage Minimal Content */
.preloader-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dismissal Animation States */
#site-preloader.preloader-dismissed .preloader-content {
  opacity: 0;
  transform: translateY(-20px) scale(0.96);
}

#site-preloader.preloader-dismissed .curtain-top {
  transform: translateY(-101%);
}

#site-preloader.preloader-dismissed .curtain-bottom {
  transform: translateY(101%);
}

#site-preloader.preloader-done {
  display: none !important;
}

/* Monospace Decimal Counter */
.preloader-counter {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' on, 'lnum' on;
  letter-spacing: -0.04em;
}

/* Minimalist Glowing Progress Track */
.preloader-track {
  width: 160px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.preloader-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #10b981, #f59e0b);
  border-radius: 9999px;
  transition: width 0.08s ease-out;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

/* Desktop Precision Cursor Follower Removed */

/* Typography Utility */
.font-serif { 
  font-family: var(--font-serif); 
  font-feature-settings: 'kern' 1, 'liga' 1;
}
.font-display { 
  font-family: var(--font-display); 
  font-feature-settings: 'kern' 1, 'liga' 1;
}
.font-sans { 
  font-family: var(--font-sans); 
  font-feature-settings: 'kern' 1, 'liga' 1;
}
.font-mono { 
  font-family: var(--font-mono); 
  font-feature-settings: 'tnum' on, 'lnum' on;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text-headline);
  letter-spacing: -0.02em;
}

/* Institutional Panels */
.glass-nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--nav-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.35s var(--ease-expo), opacity 0.3s ease;
  will-change: transform, opacity;
}
.glass-nav.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.glass-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.interactive-card {
  position: relative;
  transition: transform 0.35s var(--ease-expo), box-shadow 0.35s var(--ease-expo), border-color 0.3s ease;
  overflow: hidden;
}
.interactive-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(10, 22, 40, 0.04), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 2;
}
[data-theme="dark"] .interactive-card::before {
  background: radial-gradient(500px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(56, 189, 248, 0.07), transparent 40%);
}
.interactive-card:hover::before {
  opacity: 1;
}
.interactive-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-navy-700);
}
[data-theme="dark"] .interactive-card:hover {
  border-color: #38bdf8;
}

/* Awwwards Micro-Interactions */
.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulseGreen 2.2s infinite;
}
@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge-shimmer {
  position: relative;
  overflow: hidden;
}
.badge-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  animation: shimmerSweep 4.5s infinite;
}
[data-theme="dark"] .badge-shimmer::after {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.25), transparent);
}
@keyframes shimmerSweep {
  0% { left: -100%; }
  25% { left: 200%; }
  100% { left: 200%; }
}

/* Scrollytelling Reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease-expo), transform 0.75s var(--ease-expo);
  will-change: opacity, transform;
}
.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Awwwards Ambient Mesh Background */
.awwwards-hero-ambient {
  background-image: 
    radial-gradient(at 10% 15%, rgba(10, 22, 40, 0.04) 0px, transparent 50%),
    radial-gradient(at 90% 20%, rgba(7, 42, 32, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 90%, rgba(201, 138, 44, 0.035) 0px, transparent 50%);
}
[data-theme="dark"] .awwwards-hero-ambient {
  background-image: 
    radial-gradient(at 10% 15%, rgba(2, 132, 199, 0.09) 0px, transparent 50%),
    radial-gradient(at 90% 20%, rgba(16, 185, 129, 0.07) 0px, transparent 50%),
    radial-gradient(at 50% 90%, rgba(245, 158, 11, 0.04) 0px, transparent 50%);
}

/* Official Watermark Seal (Static & Dignified) */
.rotating-seal {
  transform-origin: center center;
}

/* Marquee */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  width: 100%;
}
.marquee-track {
  display: inline-flex;
  gap: 2.5rem;
  animation: marqueeScroll 42s linear infinite;
  will-change: transform;
}
.marquee-container:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marqueeScroll {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   AWWWARDS-GRADE INNOVATIVE BUTTON ARCHITECTURE
   ========================================================================== */

/* Universal Button Reset & Base Structure */
.btn-primary,
.btn-secondary,
.btn-emerald {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              color 0.3s ease;
  will-change: transform;
  user-select: none;
}

/* Internal Label & Arrow Animation */
.btn-primary span,
.btn-secondary span,
.btn-emerald span {
  position: relative;
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary svg,
.btn-secondary svg,
.btn-emerald svg {
  position: relative;
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Arrow Slide Interaction */
.btn-primary:hover svg,
.btn-secondary:hover svg,
.btn-emerald:hover svg {
  transform: translateX(3px);
}

/* Dynamic Cursor Spotlight Layer */
.btn-primary::before,
.btn-secondary::before,
.btn-emerald::before {
  content: '';
  position: absolute;
  top: var(--btn-mouse-y, 50%);
  left: var(--btn-mouse-x, 50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 70%);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-emerald:hover::before {
  transform: translate(-50%, -50%) scale(1.6);
  opacity: 1;
}

/* Animated Shimmer Sweep for Buttons */
.btn-primary::after,
.btn-emerald::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -120%;
  width: 70%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  z-index: 1;
  transition: none;
}

.btn-primary:hover::after,
.btn-emerald:hover::after {
  left: 200%;
  transition: left 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active Press Bounce */
.btn-primary:active,
.btn-secondary:active,
.btn-emerald:active {
  transform: scale(0.97) translateY(0) !important;
  transition-duration: 0.1s;
}

/* --- PRIMARY BUTTON (Deep Navy Executive Glow) --- */
.btn-primary {
  background: linear-gradient(135deg, #0a1628 0%, #112240 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.22),
              0 1px 2px rgba(10, 22, 40, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2.5px);
  box-shadow: 0 12px 28px -4px rgba(10, 22, 40, 0.38),
              0 6px 12px -2px rgba(10, 22, 40, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.28),
              0 1px 2px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 12px 30px -4px rgba(2, 132, 199, 0.5),
              0 6px 14px -2px rgba(2, 132, 199, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-color: rgba(125, 211, 252, 0.6);
}

/* --- SECONDARY BUTTON (Frosted Glass / Magnetic Pill) --- */
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-headline);
  border: 1px solid var(--border-medium);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-secondary::before {
  background: radial-gradient(circle, rgba(10, 22, 40, 0.08) 0%, rgba(10, 22, 40, 0) 70%);
}

.btn-secondary:hover {
  transform: translateY(-2.5px);
  background-color: #ffffff;
  color: var(--brand-navy-900);
  border-color: var(--brand-navy-900);
  box-shadow: 0 10px 24px -4px rgba(10, 22, 40, 0.12),
              0 4px 8px -2px rgba(10, 22, 40, 0.06);
}

[data-theme="dark"] .btn-secondary {
  background-color: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .btn-secondary::before {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0) 70%);
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: rgba(30, 41, 59, 0.85);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.4),
              0 0 16px rgba(56, 189, 248, 0.25);
}

/* --- EMERALD BUTTON (Constitutional / Social Impact) --- */
.btn-emerald {
  background: linear-gradient(135deg, #072a20 0%, #0d4a38 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(7, 42, 32, 0.28),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-emerald:hover {
  transform: translateY(-2.5px);
  box-shadow: 0 12px 28px -4px rgba(7, 42, 32, 0.45),
              0 6px 12px -2px rgba(7, 42, 32, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Micro-Interaction Filter Pills */
.filter-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn:hover:not(.active) {
  transform: translateY(-2px);
  border-color: var(--brand-navy-900);
  background-color: var(--surface-subtle);
}

[data-theme="dark"] .filter-btn:hover:not(.active) {
  border-color: #38bdf8;
  color: #38bdf8;
}

.filter-btn.active {
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.2);
}

[data-theme="dark"] .filter-btn.active {
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

/* Floating Bottom Action Dock */
#floating-dock {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--dock-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-medium);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.35s var(--ease-expo), opacity 0.35s;
}
#floating-dock.hidden-dock {
  transform: translateX(-50%) translateY(140%);
  opacity: 0;
  pointer-events: none;
}

/* Innovative Back to Top Button (Laptops / Desktops Only) */
#back-to-top {
  display: none !important; /* Hidden on mobile devices */
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: var(--dock-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-medium);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  align-items: center;
  justify-content: center;
  color: var(--text-headline);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-expo), transform 0.35s var(--ease-expo), background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

/* Reveal on Laptops / Desktops */
@media (min-width: 768px) {
  #back-to-top {
    display: flex !important;
  }
}

/* Strictly enforce hidden on mobile viewports */
@media (max-width: 767px) {
  #back-to-top,
  #back-to-top.visible {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

#back-to-top.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

#back-to-top:hover {
  transform: translateY(-3px) scale(1.05) !important;
  color: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 14px 28px rgba(2, 132, 199, 0.22);
}

[data-theme="dark"] #back-to-top:hover {
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 14px 28px rgba(56, 189, 248, 0.25);
}

#back-to-top:active {
  transform: translateY(0) scale(0.95) !important;
}

#back-to-top svg {
  transition: transform 0.25s var(--ease-expo);
}

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

/* Timeline Scrubber Pills */
.timeline-pill {
  transition: var(--transition-smooth);
}
.timeline-pill.active {
  background-color: var(--brand-navy-900);
  color: #ffffff !important;
  border-color: var(--brand-navy-900);
  box-shadow: 0 4px 14px rgba(10, 22, 40, 0.25);
}
[data-theme="dark"] .timeline-pill.active {
  background-color: #0284c7;
  border-color: #38bdf8;
}

/* Modals */
.modal-overlay {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-expo), visibility 0.3s;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-container {
  transform: scale(0.94) translateY(20px);
  transition: transform 0.35s var(--ease-expo);
}
.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  transform: translateY(140%);
  transition: transform 0.35s var(--ease-expo), opacity 0.35s ease;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Filter Tab Pills */
.filter-btn {
  transition: var(--transition-smooth);
}
.filter-btn.active {
  background-color: var(--brand-navy-900);
  color: #ffffff;
  border-color: var(--brand-navy-900);
  box-shadow: 0 4px 12px rgba(10, 22, 40, 0.25);
}
[data-theme="dark"] .filter-btn.active {
  background-color: #0284c7;
  border-color: #38bdf8;
}

/* Multi-Page Navigation Styling (Professional Institutional Grade) */
.nav-link {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.25rem;
  transition: color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text-headline);
}
[data-theme="dark"] .nav-link:hover {
  color: #ffffff;
}
.nav-link-active {
  color: var(--text-headline) !important;
  font-weight: 600;
}
[data-theme="dark"] .nav-link-active {
  color: #ffffff !important;
}
.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--brand-navy-900);
  border-radius: 9999px;
}
[data-theme="dark"] .nav-link-active::after {
  background-color: #38bdf8;
}

/* Mobile Navigation Drawer (Full Height Scrollable) */
#mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 88vw;
  background: var(--surface-card);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-expo);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#mobile-menu.menu-open {
  transform: translateX(0%);
}
#mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 13, 26, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#mobile-menu-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Page Hero Headers */
.page-header-ambient {
  background: radial-gradient(circle at 50% 0%, rgba(10, 22, 40, 0.05), transparent 70%),
              radial-gradient(circle at 90% 20%, rgba(7, 42, 32, 0.04), transparent 50%);
}
[data-theme="dark"] .page-header-ambient {
  background: radial-gradient(circle at 50% 0%, rgba(2, 132, 199, 0.12), transparent 70%),
              radial-gradient(circle at 90% 20%, rgba(5, 150, 105, 0.08), transparent 50%);
}

/* ==========================================================================
   MOBILE & TOUCH SCREEN SYSTEM OPTIMIZATIONS
   ========================================================================== */

/* 1. Prevent iOS Auto-Zoom on Input Focus */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* 2. Mobile Floating Action Dock Scaling & Clean Fit */
@media (max-width: 640px) {
  #floating-dock {
    bottom: 0.85rem !important;
    padding: 0.35rem 0.55rem !important;
    gap: 0.25rem !important;
    max-width: calc(100vw - 1.25rem) !important;
  }
  .dock-hide-mobile {
    display: none !important;
  }
  #floating-dock a, 
  #floating-dock button {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.55rem !important;
  }
}

/* 3. Small Mobile Preloader Sizing */
@media (max-width: 480px) {
  .preloader-track {
    width: 130px !important;
  }
  #preloader-percent {
    font-size: 3rem !important;
  }
}

/* 4. Responsive Modal Padding & Mobile Scrolling */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.5rem !important;
  }
  .modal-container {
    max-height: 92vh !important;
    border-radius: 1.25rem !important;
  }
}

/* 5. Touch Screen Hover Safety (Eliminates Sticky Hover States) */
@media (hover: none) and (pointer: coarse) {
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-emerald:hover,
  .interactive-card:hover {
    transform: none !important;
  }
  .interactive-card:active,
  .btn-primary:active,
  .btn-secondary:active {
    transform: scale(0.98) !important;
  }
}

/* 6. Typography Word-Wrap & Hyphenation Guard for Narrow Displays (<= 375px) */
@media (max-width: 400px) {
  h1, h2, h3 {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .hero-pillar-tab {
    font-size: 0.72rem !important;
    padding: 0.35rem 0.4rem !important;
  }
}

/* Print Rules */
@media print {
  #back-to-top, #floating-dock, #toast, header, aside, footer, .no-print {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  img.dark\:hidden {
    display: block !important;
  }
  img.hidden.dark\:block {
    display: none !important;
  }
}

