/* Google Fonts are now loaded via <link> tags in each HTML <head> for non-blocking loading */

:root {
  /* Brand Colors - Premium Palette */
  --primary: #1E4D3A; 
  --primary-dark: #123326;
  --secondary: #D4AF37; 
  --secondary-light: #E2C35C;
  --accent: #6B8E6B; 
  
  /* Neutrals */
  --bg-color: #F8F5F0; 
  --surface: #FFFFFF;
  --text-dark: #2C2C2C; 
  --text-muted: #5A5A5A;
  --light-sage: #E8EDE6;
  
  /* Glassmorphism & Effects */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-lg: 0 20px 40px -5px rgba(30, 77, 58, 0.08);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
  
  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  
  /* Layout */
  --section-padding: clamp(5rem, 10vw, 8rem) 0;
  --container-width: 1400px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Animation */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s var(--ease-smooth);
  --transition-normal: 0.4s var(--ease-smooth);
}

/* Dark Theme Variables - Ultra-Premium Midnight Forest */
[data-theme="dark"] {
  /* Brand Colors - Optimized for AA Accessible Contrast */
  --primary: #8EB89B; /* Accessible soft mint/sage green for text & headings */
  --primary-dark: #123326; /* Kept deep for select container overrides */
  --secondary: #E2C35C; /* Shimmering gold, lightened for accessibility contrast */
  --secondary-light: #F0D782;
  --accent: #A3C1AD; /* Muted sage */
  
  /* Neutrals */
  --bg-color: #121815; /* Deep luxury charcoal-sage canvas */
  --surface: #1B2420; /* Deep muted dark-sage panels */
  --text-dark: #F3F4F6; /* Soft off-white for crisp readability */
  --text-muted: #9CA3AF; /* Accessible gray */
  --light-sage: #1E2823; /* Darker sage for inset cards */
  
  /* Glassmorphism & Effects */
  --glass-bg: rgba(27, 36, 32, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(226, 195, 92, 0.35);
}

/* Base Reset & Smooth Scrolling (respect reduced-motion preference) */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--bg-color);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* ── Skip to Content Link (Accessibility) ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--primary);
  color: var(--surface);
  padding: 0.8rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 var(--radius-md) 0;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}

/* Fluid Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary);
  letter-spacing: 0;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--text-dark);
}

h1 { font-size: clamp(3rem, 6vw, 5.5rem); }
h2 { font-size: clamp(2.5rem, 4vw, 4rem); }
h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }

p {
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 5%;
}

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

.mt-4 {
  margin-top: 2rem;
}

.section-header {
  max-width: 760px;
  margin-bottom: 1rem;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 2.5rem;
  border-radius: 50px; /* Pill shape feels more premium here */
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: 0.6s;
  z-index: -1;
}

.btn:hover::after {
  transform: translateX(100%);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--surface);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 15px 25px rgba(30, 77, 58, 0.2);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background-color: var(--secondary-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

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

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--surface);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn:focus-visible,
.nav-links a:focus-visible,
.project-card:focus-visible,
.filter-btn:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 4px;
}

/* Modern Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  background: rgba(18, 51, 38, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 0.5rem 0;
  box-shadow: 0 16px 30px rgba(9, 26, 20, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar.scrolled .logo img {
  height: 75px;
  width: auto;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 105px;
  width: auto;
  transition: height var(--transition-normal), filter var(--transition-normal);
}

.logo {
  --logo-x: 0px;
  --logo-y: 0px;
  display: inline-flex;
  align-items: center;
  transform: translate3d(var(--logo-x), var(--logo-y), 0) scale(1);
  transform-origin: center;
  transition: transform 0.65s var(--ease-spring), filter var(--transition-normal);
  will-change: transform;
}

.logo.logo-magnetic {
  transform: translate3d(var(--logo-x), var(--logo-y), 0) scale(1.06);
}

.logo:hover img,
.logo:focus-visible img {
  filter: drop-shadow(0 10px 18px rgba(30, 77, 58, 0.28));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.45rem 1.8rem;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.nav-links li {
  display: flex;
  align-items: center;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  left: -0.75rem;
  right: -0.75rem;
  top: 100%;
  height: 0.9rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--primary);
  position: relative;
  padding: 0;
  white-space: nowrap;
}

.nav-links .btn {
  min-height: 40px;
  padding: 0.55rem 1.15rem !important;
  margin-left: 0.35rem !important;
  font-size: 0.76rem !important;
  line-height: 1;
  white-space: nowrap;
}

.nav-links .btn::after {
  display: none;
}

.nav-links .btn-primary:hover {
  box-shadow: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--secondary);
  transition: all var(--transition-fast);
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 170px;
  padding: 0.65rem;
  list-style: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-normal), transform var(--transition-normal), visibility var(--transition-normal);
  z-index: 10;
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-submenu li {
  width: 100%;
}

.nav-submenu a {
  width: 100%;
  justify-content: flex-start;
  min-height: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  border-radius: 12px;
}

.nav-submenu a::after {
  display: none;
}

.nav-submenu a:hover {
  background: rgba(30, 77, 58, 0.08);
}

/* Hero Section with Micro-interactions */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 5rem;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  z-index: -2;
  transform: none;
  animation: none;
}

.hero-collage-bg {
  background: #07120e;
  transform: none;
  animation: none;
  overflow: hidden;
}

.hero-collage-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: heroCollageScroll 168s linear infinite;
  will-change: transform;
}

.hero-collage-track img {
  width: auto;
  height: 100%;
  max-width: none;
  flex: 0 0 auto;
  object-fit: cover;
}

@keyframes heroCollageScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-collage-track {
    animation: none;
  }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg, 
    rgba(30, 77, 58, 0.95) 0%, 
    rgba(30, 77, 58, 0.6) 50%,
    rgba(44, 44, 44, 0.4) 100%
  );
  z-index: -1;
}

.hero-content {
  max-width: 900px;
  color: var(--surface);
}

.hero-content h1 {
  color: var(--surface);
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.3rem;
  font-weight: 300;
  margin-bottom: 3rem;
  max-width: 650px;
}

/* Hero Trust Badges (COR + Efficiency Manitoba) */
.hero {
  position: relative;
}

.hero-trust-badges {
  position: absolute;
  right: calc(clamp(2rem, 5vw, 4.5rem) + 1.2rem);
  bottom: clamp(2rem, 4vh, 3.5rem);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeUpIn 1s ease 0.3s backwards;
}

.hero-badge-cor {
  height: clamp(50px, 5.2vw, 68px);
  width: auto;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.7));
  transition: transform var(--transition-fast), filter var(--transition-fast);
  display: block;
}

.hero-badge-em {
  height: clamp(28px, 3vw, 38px);
  width: auto;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.7));
  transition: transform var(--transition-fast), filter var(--transition-fast);
  display: block;
}

.hero-badge-cor:hover,
.hero-badge-em:hover {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.85));
}

@media (max-width: 991px) {
  .hero-trust-badges {
    position: static;
    margin-top: 2.2rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
  }
  .hero-badge-cor {
    height: 48px;
  }
  .hero-badge-em {
    height: 28px;
  }
}

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

/* Section Styling */
.section {
  padding: var(--section-padding);
  position: relative;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.section-tag::before {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background-color: var(--secondary);
}

/* Services Grid - Elevated */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

.service-card {
  background: var(--surface);
  padding: 3.5rem 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.03);
  z-index: 1;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: var(--primary);
  transition: all 0.5s var(--ease-spring);
  z-index: -1;
}

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

.service-card:hover::before {
  height: 100%;
}

.service-icon {
  width: 70px;
  height: 70px;
  background: var(--light-sage);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  transition: all var(--transition-normal);
}

.service-card:hover .service-icon {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1) rotate(5deg);
}

.service-card h3 {
  transition: color var(--transition-normal);
}

.service-card:hover h3,
.service-card:hover p {
  color: var(--surface);
}

/* Projects Masonry - Premium Interactions */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.project-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30, 77, 58, 0.95) 0%, rgba(30, 77, 58, 0.4) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  opacity: 0;
  transition: all 0.5s ease;
}

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

.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay {
  opacity: 1;
}

.project-category {
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.4s ease 0.1s;
}

.project-title {
  color: var(--surface);
  font-size: 1.8rem;
  margin-bottom: 0;
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.4s ease 0.2s;
}

.project-album-count {
  color: var(--secondary) !important;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.4px;
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.4s ease 0.28s;
}

.project-album-count svg,
.project-album-count i {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.2;
  vertical-align: middle;
  flex-shrink: 0;
}

.project-card:hover .project-category,
.project-card:hover .project-title,
.project-card:hover .project-album-count,
.project-card:focus-visible .project-category,
.project-card:focus-visible .project-title,
.project-card:focus-visible .project-album-count {
  transform: translateY(0);
  opacity: 1;
}

.project-card:hover .project-album-count {
  color: var(--secondary-light) !important;
}

/* Before & After Slider */
.before-after-section {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-color) 100%);
}

.before-after-slider {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  border-radius: var(--radius-sm);
  background: var(--primary-dark);
  box-shadow: var(--shadow-lg);
  cursor: ew-resize;
  isolation: isolate;
  touch-action: none;
}

.before-after-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.before-after-image-after {
  position: absolute;
  inset: 0;
}

.before-after-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--before-after-position, 50%)) 0 0);
  z-index: 1;
}

.before-after-before .before-after-image {
  width: 100%;
}

.before-after-label {
  position: absolute;
  top: 1rem;
  z-index: 3;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(18, 51, 38, 0.88);
  color: var(--surface);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
}

.before-after-label-before {
  left: 1rem;
}

.before-after-label-after {
  right: 1rem;
  background: rgba(212, 175, 55, 0.95);
  color: var(--primary-dark);
}

.before-after-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--before-after-position, 50%);
  z-index: 4;
  width: 3px;
  background: var(--surface);
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(18, 51, 38, 0.2);
  pointer-events: none;
}

.before-after-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130px;
  height: 218px;
  border-radius: 999px;
  background: transparent;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
}

.before-after-handle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 12px 18px rgba(18, 51, 38, 0.55));
}

/* Dragging state - glow on img so overflow:hidden can't clip it */
[data-before-after].dragging .before-after-handle img {
  animation: handle-pulse 0.65s ease-in-out infinite alternate;
}

[data-before-after].dragging .before-after-divider {
  box-shadow: 0 0 0 2px #7DBA58, 0 0 12px 4px rgba(95, 157, 72, 0.45);
}

@keyframes handle-pulse {
  from { filter: drop-shadow(0 0 4px #5F9D48) drop-shadow(0 0 10px rgba(95, 157, 72, 0.55)); }
  to   { filter: drop-shadow(0 0 8px #7DBA58)  drop-shadow(0 0 18px rgba(144, 186, 101, 0.75)); }
}

/* Particles */
.ba-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #d4ff90, #7DBA58);
  pointer-events: none;
  z-index: 10;
  animation: ba-particle-burst 0.7s ease-out forwards;
}

@keyframes ba-particle-burst {
  0%   { opacity: 1; transform: translate(0, 0) scale(1.2); }
  100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0); }
}

.before-after-range {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.before-after-slider:focus-within .before-after-divider {
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.45);
}

@media (hover: none) {
  .project-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(30, 77, 58, 0.92) 0%, rgba(30, 77, 58, 0.25) 65%, transparent 100%);
  }

  .project-category,
  .project-title,
  .project-album-count {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Tablet Optimization (769px – 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --section-padding: 5rem 0;
  }

  /* Navbar */
  .navbar {
    padding: 0.9rem 0;
  }

  .navbar.scrolled {
    padding: 0.7rem 0;
  }

  .logo img {
    height: 60px;
  }

  .navbar.scrolled .logo img {
    height: 45px;
  }

  /* Hero typography */
  h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
  h2 { font-size: clamp(2rem, 4vw, 3rem); }

  .hero {
    padding-top: 5rem;
  }

  .hero-content p {
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
  }

  /* Content grids — 2 columns at tablet */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .logo img {
    height: 52px;
  }

  .navbar.scrolled .logo img {
    height: 44px;
  }

  body.mobile-menu-open .navbar .logo img {
    height: 52px;
  }

  .before-after-slider {
    min-height: 240px;
    aspect-ratio: 4 / 3;
  }

  .before-after-label {
    top: 0.75rem;
    font-size: 0.68rem;
  }

  .before-after-handle {
    width: 100px;
    height: 168px;
  }

  h1 { font-size: clamp(2.4rem, 12vw, 3.4rem); }
  h2 { font-size: clamp(2rem, 9vw, 2.8rem); }

  .hero {
    min-height: 86vh;
    padding-top: 6rem;
  }

  .hero-collage-track {
    animation-duration: 272s;
  }

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

  .hero-btns {
    display: grid;
    gap: 1rem;
  }

  .btn {
    width: 100%;
    padding: 1rem 1.35rem;
    font-size: 0.78rem;
  }

  .services-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-overlay {
    padding: 1.5rem;
  }

  .project-title {
    font-size: 1.35rem;
  }
}

/* =============================================
   Night Mode Overrides
   ============================================= */

/* Nav links — dark glass container and high-visibility white text with light outline */
[data-theme="dark"] .nav-links {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}
[data-theme="dark"] .nav-links a:not(.btn) {
  color: #ffffff;
  /* Same weight as day mode so links keep identical widths when toggling themes */
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.55), 0 0 3px rgba(255, 255, 255, 0.28);
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}
[data-theme="dark"] .nav-links a:hover {
  color: var(--secondary);
  text-shadow: 0 0 1px rgba(226, 195, 92, 0.8), 0 0 3px rgba(226, 195, 92, 0.4);
}
[data-theme="dark"] .nav-links a.btn {
  /* --primary flips to light sage in night mode, so the pill CTA needs dark
     text; !important beats the inline color:#fff on the Build With Us link */
  color: #123326 !important;
  text-shadow: none;
}

/* Submenus — dark background instead of white panel in night mode */
[data-theme="dark"] .nav-submenu {
  background: #1a2a20;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .nav-submenu a {
  color: var(--text-dark);
}
[data-theme="dark"] .nav-submenu a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--secondary);
}

/* Hero & page-header titles — force white in night mode; --surface flips dark
   and .hero-inner / .article-hero rules use !important in light mode */
[data-theme="dark"] .hero-content h1,
[data-theme="dark"] .hero-content h2,
[data-theme="dark"] .hero-content h3,
[data-theme="dark"] .hero-inner .hero-content h1,
[data-theme="dark"] .hero-inner .hero-content h2,
[data-theme="dark"] .hero-inner .hero-content h3,
[data-theme="dark"] .blog-hero h1,
[data-theme="dark"] .article-hero h1,
[data-theme="dark"] .projects-hero h1,
[data-theme="dark"] .video-page-hero h1,
[data-theme="dark"] .effect-page-hero h1 {
  color: #ffffff !important;
}

/* Blog post dark mode — invisible borders fix + text */
[data-theme="dark"] .article-body,
[data-theme="dark"] .article-sidebar,
[data-theme="dark"] .timeline-panel,
[data-theme="dark"] .cta-panel {
  border-color: rgba(255, 255, 255, 0.07);
}
[data-theme="dark"] .article-section {
  border-top-color: rgba(255, 255, 255, 0.07);
}
[data-theme="dark"] .timeline-list li {
  border-top-color: rgba(255, 255, 255, 0.07);
}
[data-theme="dark"] .article-body p,
[data-theme="dark"] .timeline-panel p {
  color: var(--text-muted);
}
[data-theme="dark"] .cta-panel p {
  color: rgba(255, 255, 255, 0.9) !important;
}
[data-theme="dark"] .article-lede {
  color: var(--text-dark) !important;
}
[data-theme="dark"] .timeline-list time {
  color: var(--secondary);
}
[data-theme="dark"] .timeline-list span {
  color: var(--text-dark);
}

/* ==========================================================================
   Scroll Reveal Animations (Fluid Bezier & Accessible Contrast)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.17, 0.67, 0.3, 1.01), transform 1s cubic-bezier(0.17, 0.67, 0.3, 1.01);
  will-change: opacity, transform;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 1s cubic-bezier(0.17, 0.67, 0.3, 1.01), transform 1s cubic-bezier(0.17, 0.67, 0.3, 1.01);
  will-change: opacity, transform;
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 1s cubic-bezier(0.17, 0.67, 0.3, 1.01), transform 1s cubic-bezier(0.17, 0.67, 0.3, 1.01);
  will-change: opacity, transform;
}

.reveal-zoom {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 1s cubic-bezier(0.17, 0.67, 0.3, 1.01), transform 1s cubic-bezier(0.17, 0.67, 0.3, 1.01);
  will-change: opacity, transform;
}

.reveal.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-zoom.visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Staggered Delay Helpers */
.reveal-delay-1 { transition-delay: 150ms; }
.reveal-delay-2 { transition-delay: 300ms; }
.reveal-delay-3 { transition-delay: 450ms; }
.reveal-delay-4 { transition-delay: 600ms; }
.reveal-delay-5 { transition-delay: 750ms; }
.reveal-delay-6 { transition-delay: 900ms; }

/* Safe bypass for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-zoom {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Centered Inner Page Hero Section Styles */
.hero-inner {
  min-height: 65vh !important;
  min-height: 65svh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  position: relative !important;
  padding-top: calc(135px + 3rem) !important;
  padding-bottom: 3rem !important;
}
.hero-inner .hero-content {
  margin: 0 auto !important;
  text-align: center !important;
  max-width: 900px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}
.hero-inner .hero-content h1 {
  text-align: center !important;
  color: var(--surface) !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
}
.hero-inner .hero-content p {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
  max-width: 680px !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* ==========================================================================
   Print Stylesheet — ensures clean, readable printed pages
   ========================================================================== */
@media print {
  :root,
  [data-theme="dark"] {
    --primary: #1E4D3A;
    --primary-dark: #123326;
    --secondary: #D4AF37;
    --bg-color: #FFFFFF;
    --surface: #FFFFFF;
    --text-dark: #2C2C2C;
    --text-muted: #5A5A5A;
    --light-sage: #E8EDE6;
  }

  body {
    background: #FFFFFF !important;
    color: #2C2C2C !important;
  }

  /* Hide non-essential interactive/decorative UI */
  .preloader,
  .navbar,
  .mobile-nav,
  .mobile-controls,
  .theme-toggle-btn,
  .filter-bar,
  .hero-bg,
  .hero-overlay,
  .modal-backdrop,
  .preloader-bar,
  gkb-footer,
  .gkb-footer {
    display: none !important;
  }

  /* Make hero text readable on white */
  .hero,
  .hero-inner {
    min-height: auto !important;
    padding: 2rem 0 !important;
  }
  .hero-content h1,
  .hero-inner .hero-content h1 {
    color: #1E4D3A !important;
  }
  .hero-content p,
  .hero-inner .hero-content p {
    color: #2C2C2C !important;
  }

  /* Reveal all hidden content immediately */
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-zoom {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Make CTA sections readable */
  .cta-section {
    background: #FFFFFF !important;
    color: #1E4D3A !important;
    border: 2px solid #1E4D3A;
  }
  .cta-content h2 { color: #1E4D3A !important; }
  .cta-content p { color: #2C2C2C !important; }
  .cta-section::before { display: none !important; }

  /* Show links and their URLs */
  a { color: #1E4D3A !important; text-decoration: underline; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #5A5A5A;
  }

  /* Avoid breaking inside sections */
  section,
  .project-card,
  .testimonial-card,
  .why-card { page-break-inside: avoid; }

  /* Force colors to print accurately */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
/* Accessibility: NoScript Fallbacks */
noscript .reveal {
  opacity: 1 !important;
  transform: none !important;
}
noscript #preloader {
  display: none !important;
}

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