:root {
  /* Color Narrative */
  --color-black: #050505;
  --color-white: #F7F5F0;
  /* Warm Pearl — balanced with a touch more warmth */
  --color-green-accent: #0f4f2c;
  /* Deep sustainable green */
  --color-chartreuse: #d4e022;
  /* Optional highlight / micro-interactions */
  --color-gray-light: #EEECE7;
  /* Structure lines / backgrounds */
  --color-gray-dark: #2a2a2a;
  /* Typography on light background */

  /* Typography */
  --font-primary: 'Inter', sans-serif;

  /* Layout */
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 8rem;

  --container-max-width: 1440px;
  --grid-gap: 2rem;

  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Reset & Baseline */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


html {
  scroll-padding-top: 90px;
  /* Offsets anchor links so sticky header doesn't cover them */
}

html,
body {
  font-family: var(--font-primary);
  background-color: var(--color-black);
  color: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Smooth scrolling disabled for precise canvas sequence control */
}

/* overflow-x ONLY on body, never on html — setting it on html
   disables macOS fast-path compositor scrolling and causes dropped frames */
body {
  overflow-x: clip;
}

/* Page scroll lock during loading */
body.is-loading {
  overflow: hidden;
}

/* ===== Minimal Loading Progress ===== */
/* ===== Minimal Aesthetic Loading Progress ===== */
/* Centered, sleek, glowing progress bar */
.page-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(300px, 60vw);
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  z-index: 100000;
  pointer-events: none;
  transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

.page-loader.loaded {
  opacity: 0;
  transform: translate(-50%, -60%); /* Slight upward drift on finish */
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-green-accent);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5), 0 0 20px rgba(46, 204, 113, 0.3);
  transition: width 0.2s ease-out;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-transform: uppercase;
  /* Corporate, confident, condensed feel */
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
}

h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--spacing-md);
  color: var(--color-gray-dark);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
}

p {
  font-size: 1.125rem;
  color: var(--color-gray-dark);
  max-width: 70ch;
}

section {
  padding: 6rem 0;
  position: relative;
  contain: layout style;
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

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

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

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

.bg-gray {
  background-color: var(--color-gray-light);
  color: var(--color-gray-dark);
}

/* Typography Watermark System (Editorial Overlap) */
/* Typography Watermark System (Home Page Overlaps) */
h2.has-watermark {
  position: relative;
  z-index: 1;
}

h2.has-watermark::before {
  content: attr(data-watermark);
  position: absolute;
  top: clamp(2.75rem, 5.5vw, 4.4rem);
  margin-top: -0.98em;
  left: -0.05em;
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 900;
  line-height: 0.8;
  color: rgba(0, 0, 0, 0.04);
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: -0.03em;
  z-index: -1;
  pointer-events: none;
  user-select: none;
}

h2.has-watermark.has-watermark-center::before {
  left: 50%;
  transform: translateX(-50%);
}

/* Force explicit syllable spans to maintain identical line-box bounds as raw text for watermark anchoring */
h2.has-watermark span {
  display: inline-block;
  vertical-align: bottom;
}

.bg-black h2.has-watermark::before {
  color: rgba(255, 255, 255, 0.04);
}

/* About Page Watermark System (Strict Standardization) */
.watermark-group {
  position: relative;
  display: inline-block;
  margin-bottom: 0.25rem;
  /* "reduce it to very less just slight more than touching" */
}

.watermark-group.center {
  display: block;
  text-align: center;
  width: 100%;
}

.about-bg-watermark {
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 900;
  color: rgba(0, 0, 0, 0.04);
  text-transform: uppercase;
  line-height: 0.8;
  letter-spacing: -0.03em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.centered-label {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  margin: 0;
  z-index: 10;
  white-space: nowrap;
}

.watermark-group.center .centered-label {
  left: 50%;
  transform: translate(-50%, -50%);
}

.tech-watermark-group .centered-label {
  /* Center horizontally correctly */
  left: 0;
  top: 50%;
}

.bg-black .about-bg-watermark {
  color: rgba(255, 255, 255, 0.04);
}

/* Dual-tone boundary watermark using difference blend mode blending through DOM stacking */
.tech-watermark-group {
  position: relative;
  /* Negative margin pulls the watermark up OUT of the dark section, bleeding into the section above it. 
     This allows normal document flow for the title gap beneath it. */
  margin-top: calc(-0.3333 * clamp(4rem, 10vw, 9rem));
  z-index: 20;
  width: 100%;
  margin-bottom: 0.25rem;
}

.tech-boundary-watermark {
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  line-height: 0.8;
  margin: 0;
  /* Absolute precise dual-tone clip matching the 0.3333em negative pull exactly */
  /* Top 41.66% (0.3333em / 0.8em line-height) is over the light background */
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.08) 0%,
      rgba(0, 0, 0, 0.08) 41.66%,
      rgba(255, 255, 255, 0.1) 41.66%,
      rgba(255, 255, 255, 0.1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Horizontal Dual-tone boundary watermark for Geographic map split grid */
.geo-boundary-watermark {
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  line-height: 0.8;
  margin: 0;
  /* Left side over light background, Right side over black box. 
     Account for the 4rem grid gap (50% + 2rem offset) */
  background: linear-gradient(to right,
      rgba(0, 0, 0, 0.08) 0%,
      rgba(0, 0, 0, 0.08) calc(50% + 2rem),
      rgba(255, 255, 255, 0.22) calc(50% + 2rem),
      rgba(255, 255, 255, 0.22) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--color-green-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: #0b3d22;
}

.btn-outline {
  background-color: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background-color: var(--color-white);
  color: var(--color-black);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--spacing-md) 0;
  z-index: 100;
  transition: background-color 0.8s ease, box-shadow 0.8s ease, padding 0.5s ease, border-color 0.8s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.navbar.scrolled {
  background-color: rgba(5, 5, 5, 0.92);
  box-shadow: inset 0 40px 60px -10px rgba(5, 5, 5, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--spacing-sm) 0;
}

.navbar.scrolled-light {
  background-color: rgba(247, 245, 240, 0.95);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar.scrolled-light .nav-item {
  color: var(--color-black);
}

.navbar.scrolled-light .nav-item:hover {
  color: var(--color-green-accent);
}

.navbar.scrolled-light .btn-outline {
  border-color: rgba(0, 0, 0, 0.3);
  color: var(--color-black);
}

.navbar.scrolled-light .btn-outline:hover {
  background-color: var(--color-black);
  color: var(--color-white);
}

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

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 64px;
  width: auto;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.logo-img:hover {
  opacity: 0.8;
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.nav-links .nav-item {
  text-decoration: none;
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.nav-links .nav-item:hover {
  opacity: 1;
}

.nav-actions {
  display: flex;
  gap: 1rem;
}

/* --- Dropdown Navigation --- */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown > .nav-item {
  cursor: pointer;
}

.nav-dropdown > .nav-item::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.5;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover > .nav-item::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: rgba(5, 5, 5, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 0;
  margin-top: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 200;
  list-style: none;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Invisible bridge between nav item and dropdown to prevent hover gap */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.06);
}

/* Light navbar dropdown override */
.navbar.scrolled-light .dropdown-menu {
  background: rgba(247, 245, 240, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.navbar.scrolled-light .dropdown-menu a {
  color: var(--color-gray-dark);
}

.navbar.scrolled-light .dropdown-menu a:hover {
  color: var(--color-green-accent);
  background: rgba(15, 79, 44, 0.04);
}

/* Hero Phase Container */
#hero {
  position: relative;
  height: 500vh;
  background-color: var(--color-black);
  contain: layout style;
}

.video-container {
  position: sticky;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Center handles variable screen heights perfectly */
}

/* Vignette effect to seamlessly blend the animation grain into the solid black */
.video-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Combine circular vignette, bottom fade, and a balanced bottom-right slant */
  background:
    radial-gradient(circle at center, transparent 25%, rgba(0, 0, 0, 0.7) 40%, rgba(0, 0, 0, 0.95) 50%, var(--color-black) 60%, var(--color-black) 100%),
    linear-gradient(345deg, var(--color-black) 0%, var(--color-black) 22%, rgba(0, 0, 0, 0.95) 38%, transparent 60%),
    linear-gradient(to top, var(--color-black) 0%, var(--color-black) 10%, rgba(0, 0, 0, 0.95) 25%, transparent 45%);
  z-index: 5;
}

#hero-canvas {
  /* scaleFactor = 0.47 for desktop */
  width: 47vw;
  /* cropRatio forced via aspect-ratio: (1280 / 720*0.92) = 1.932 */
  aspect-ratio: 1280 / 662.4;
  /* Cover forces the 16:9 video to fill the 1.932 box by cropping top/bottom */
  object-fit: cover;
  /* Aligning top pushes all the cropping to the bottom 8% */
  object-position: top center;
  opacity: 0.8;

  /* Vertical positioning: drawY = (canvasH - drawH) * 0.35 */
  /* This means it sits slightly above center.
     Since flex handles dead-center, we just nudge it up */
  margin-top: -10vh;

  /* Promote canvas to its own GPU layer — prevents full-page repaint on each frame draw */
  will-change: contents;
}

/* Hero Text Overlays tied to scroll */
.hero-text-overlay {
  position: absolute;
  top: 62.5%;
  left: 50%;
  transform: translate(-50%, 40px);
  /* Come from lower side */
  width: 100%;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.hero-text-overlay.active {
  opacity: 0.35;
  /* Highly transparent (watermark-like) so the text does not distract from the animation */
  transform: translate(-50%, 0);
  /* Settle at final spot */
}

.hero-text-overlay.past {
  opacity: 0;
  transform: translate(-50%, -40px);
  /* Slider upward on exit */
}

.hero-text-overlay h1 {
  color: var(--color-white);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin-top: 0.5rem;
}

.hero-text-overlay .support-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  margin: 0.5rem auto 0 auto;
  text-align: center;
  /* Ensure exact centering with the major term */
}

.data-points {
  position: absolute;
  top: 91%;
  /* Move further down to prevent overlapping the text above */
  left: 50%;
  transform: translate(-50%, calc(-50% + 40px));
  /* Come from lower side */
  display: flex;
  width: 95%;
  /* Spread across almost full width */
  justify-content: space-between;
  align-items: flex-start;
  /* Ensure the tops of all items align perfectly horizontally */
  gap: var(--spacing-md);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 10;
  backface-visibility: hidden;
}

.data-points.active {
  opacity: 1;
  transform: translate(-50%, -50%);
  /* Settle */
}

.data-item {
  text-align: center;
  flex: 1;
  /* Give each item equal width so long text doesn't overlap */
  padding: 0 1rem;
}

.data-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-green-accent);
  margin-bottom: 1rem;
  /* Spacing between number and text */
  display: inline-block;
  /* Keep numbers and symbols on the exact same line */
}

.data-label {
  display: block;
  /* Force the text to drop below the numbers */
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.5;
  /* Better readability for multi-line text */
  color: var(--color-white);
  opacity: 0.8;
}

/* Post Hero Transition */
.transition-section {
  height: 50vh;
  background: linear-gradient(to bottom, var(--color-black) 0%, var(--color-white) 100%);
}

/* Standard Sections Layout */
section:not(#hero) {
  padding: var(--spacing-xl) 0;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-light);
}


/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}

/* 3D Flip Card System — Compliance Section */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}

.flip-card {
  perspective: 1000px;
  cursor: pointer;
  height: 280px;
  contain: layout style paint;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  border: 1px solid var(--color-gray-light);
  border-top: 3px solid var(--color-green-accent);
  background: var(--color-white);
  text-align: center;
}

.flip-card-front h3 {
  font-size: 1.15rem;
  color: var(--color-black);
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}

.flip-card-back {
  transform: rotateY(180deg);
  background: var(--color-black);
  color: var(--color-white);
  border-color: var(--color-green-accent);
}

.flip-card-back h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--color-white);
}

.flip-card-back p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

.flip-body-name {
  font-size: 0.8rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-green-accent) !important;
  margin-bottom: 0.75rem;
}

.flip-logo {
  max-height: 130px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.flip-logo-pair {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  align-items: center;
}

.flip-logo-pair .flip-logo {
  max-height: 70px;
}

.flip-card:hover .flip-logo {
  transform: scale(1.05);
}

.flip-hint {
  font-size: 0.75rem;
  color: var(--color-gray-dark);
  opacity: 0.6;
  margin-top: auto;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Services / Core Strengths Cards */
.card {
  padding: var(--spacing-md);
  border: 1px solid var(--color-gray-light);
  border-left: 2px solid var(--color-green-accent);
  background-color: var(--color-white);
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: var(--color-green-accent);
  box-shadow: 0 10px 30px rgba(15, 79, 44, 0.05);
  /* Subtle green glow */
}

.card h3 {
  color: var(--color-black);
  margin-bottom: 1rem;
}

.card p {
  font-size: 1rem;
}

/* Process Timeline */
section#process {
  padding: 0;
  /* Override global section padding since this uses a 100vh sticky container */
}

.timeline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  margin-top: var(--spacing-lg);
}

.timeline::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-gray-light);
  z-index: 1;
}

.timeline-item {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
  opacity: 0.2;
  transform: translateX(50px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backface-visibility: hidden;
  will-change: transform, opacity;
  contain: layout style;
}

.timeline-item.active {
  opacity: 1;
  transform: translateX(0) scale(1.03);
}

.timeline-item.past {
  opacity: 0.35;
  transform: translateX(0) translateY(-20px);
}

.timeline-dot {
  width: 50px;
  height: 50px;
  background-color: var(--color-white);
  border: 2px solid var(--color-green-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  font-weight: 700;
  color: var(--color-green-accent);
  transition: background-color 0.6s ease, color 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s ease;
}

.timeline-item.active .timeline-dot {
  background-color: var(--color-green-accent);
  color: var(--color-white);
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(15, 79, 44, 0.1);
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .data-points {
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
  }

  html {
    scroll-padding-top: 140px;
    /* Taller on mobile because nav links stack under the logo */
  }

  /* Layout collapses */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .flip-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .flip-card {
    height: 240px;
  }

  /* Make Navbar links accessible via horizontal scrolling */
  .navbar .container {
    flex-wrap: wrap;
  }

  .nav-links {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding: 1rem 0 0.5rem 0;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for a clean UI */
  }

  .nav-links .nav-item {
    white-space: nowrap;
  }

  /* Mobile dropdowns — click-toggleable */
  .nav-dropdown > .nav-item::after {
    border-top-width: 3px;
    border-left-width: 3px;
    border-right-width: 3px;
  }

  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: none;
    min-width: 200px;
    margin-top: 0.5rem;
  }

  .nav-dropdown:hover .dropdown-menu {
    transform: none;
  }

  .dropdown-menu::before {
    height: 8px;
    top: -8px;
  }

  .nav-actions {
    display: none;
    /* Hide buttons to prioritize the scrollable menu on small screens */
  }

  .logo-img {
    height: 48px;
    /* Slightly larger logo for mobile */
  }

  /* Fix Animation Scale for Mobile */
  #hero-canvas {
    /* Scale factor 0.61 on mobile */
    width: 61vw;
    margin-top: -15vh;
    /* Keeps it nudged upward out of the text's way */
  }

  /* Make sure vignette slant looks good on narrow mobile screens */
  .video-container::after {
    background:
      radial-gradient(ellipse at center, transparent 15%, rgba(0, 0, 0, 0.6) 35%, rgba(0, 0, 0, 0.95) 55%, var(--color-black) 70%, var(--color-black) 100%),
      linear-gradient(350deg, var(--color-black) 0%, var(--color-black) 25%, rgba(0, 0, 0, 0.95) 45%, transparent 65%),
      linear-gradient(to top, var(--color-black) 0%, var(--color-black) 10%, rgba(0, 0, 0, 0.95) 25%, transparent 45%);
  }

  /* Fix Hero Section numbers overlapping */
  /* Remove absolute bottom anchoring and let them stack naturally via relative flex */
  .hero-text-overlay {
    top: 50%;
  }

  .data-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    top: 85%;
    bottom: auto;
    transform: translate(-50%, -50%);
  }

  .data-item {
    padding: 0;
    flex: unset;
  }

  .data-value {
    font-size: 2rem;
    /* Scale down thick numbers on mobile */
  }

  /* Condense Process Architecture to fit 100vh on phone screens instead of breaking sticky */
  #process .container>p {
    margin-bottom: 1.5rem !important;
    /* Override the inline 4rem margin */
  }

  #process h2 {
    margin-bottom: 0.5rem;
    font-size: 2rem;
  }

  .timeline {
    margin-top: 1rem;
    flex-direction: column;
  }

  .timeline::before {
    width: 2px;
    height: 100%;
    left: 24px;
    top: 0;
  }

  .timeline-item {
    display: grid;
    grid-template-columns: 50px 1fr;
    /* Dot is 50px */
    column-gap: 1.5rem;
    text-align: left;
    margin-bottom: var(--spacing-md);
    transform: translateY(30px);
  }

  .timeline-dot {
    grid-row: 1 / span 4;
    /* Span all text elements vertically */
    margin: 0;
  }

  .timeline-item.active {
    transform: translateY(0) scale(1.03);
  }

  .timeline-item.past {
    transform: translateY(-20px);
  }
}

/* ===== Unified Footer (Imported from About Page) ===== */
.about-footer {
  padding: var(--spacing-lg) 0 var(--spacing-md) 0;
  border-bottom: none !important;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--color-white);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ===== Responsive Unified Footer ===== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ===== Modern Integrated Left-Image Faded Sections ===== */
.section-integrated {
  position: relative;
  padding: 8rem 0;
  overflow: hidden;
  /* Increased vertical padding for more section space */
}

.section-integrated {
  min-height: 1050px;
  /* Safety rail to ensure larger images push section height and don't overflow */
}

.section-integrated .container {
  position: relative;
  z-index: 2;
}

.section-integrated-bg {
  position: absolute;
  top: 30rem;
  left: 0;
  width: 495px;
  max-width: 49.5%;
  z-index: 0;
  pointer-events: none;
  border-radius: 16px;
  overflow: hidden;
}

#challenges .section-integrated-bg {
  top: 22rem; /* Adjusted upward specifically for the first section */
}



.section-integrated-bg img {
  width: 100%;
  height: auto;
  display: block;
  /* Visual fallback */
  border-radius: 16px;

  /* Stacked Masks: 
     1. Black rounded rectangle that enforces the 16px border-radius crop
     2. Linear gradient that creates the bokeh fade on the right edge
     'composite: source-in' means ONLY show where BOTH masks overlap */
  -webkit-mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 1) 85%, rgba(0, 0, 0, 0) 100%),
    url('data:image/svg+xml;utf8,<svg viewBox="0 0 1 1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" rx="0.03" ry="0.02" fill="black"/></svg>');
  -webkit-mask-composite: source-in;

  mask-image:
    linear-gradient(to right, rgba(0, 0, 0, 1) 85%, rgba(0, 0, 0, 0) 100%),
    url('data:image/svg+xml;utf8,<svg viewBox="0 0 1 1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" rx="0.03" ry="0.02" fill="black"/></svg>');
  mask-composite: intersect;

  opacity: 1;
}

/* Ensure the header text sits on top */
.section-integrated h2.has-watermark {
  position: relative;
  z-index: 2;
}

.section-integrated-content {
  margin-left: 545px;
  /* Safely clears the 495px image width + a nice 50px gap */
  position: relative;
  z-index: 3;
}

/* --- ALTERNATING LAYOUT: IMAGE ON RIGHT --- */
.section-integrated.image-right .section-integrated-bg {
  left: auto;
  right: 0;
}

.section-integrated.image-right .section-integrated-bg img {
  /* Quick left edge merge, combined with the SVG rounded crop */
  -webkit-mask-image:
    linear-gradient(to left, rgba(0, 0, 0, 1) 85%, rgba(0, 0, 0, 0) 100%),
    url('data:image/svg+xml;utf8,<svg viewBox="0 0 1 1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" rx="0.03" ry="0.02" fill="black"/></svg>');
  -webkit-mask-composite: source-in;

  mask-image:
    linear-gradient(to left, rgba(0, 0, 0, 1) 85%, rgba(0, 0, 0, 0) 100%),
    url('data:image/svg+xml;utf8,<svg viewBox="0 0 1 1" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" rx="0.03" ry="0.02" fill="black"/></svg>');
  mask-composite: intersect;
}

.section-integrated.image-right .section-integrated-content {
  margin-left: 0;
  margin-right: 545px;
  /* Text on left, clearing the right image */
}

/* --- CENTERING & COLOR BLENDING FOR HEADERS --- */
/* Ensure the wrapper respects boundaries */
.section-integrated .container {
  position: relative;
  z-index: 2;
}

/* --- OVERLAY CLIP-PATH LOGIC --- */
/* This cleanly wraps the base text (rendered flawlessly like Process Architecture) 
   and crops an inverted version exactly over the image area. */
.header-overlay-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 4rem;
  /* Generous gap between the title block and the content/image below */
}

.header-overlay-wrapper h2.overlap-invert {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 5;
  color: transparent !important;
}


.header-overlay-wrapper h2.overlap-invert.overlay-clip-left::before {
  /* Smooth gradient transition from bright white (over image) to transparent (over background) */
  color: transparent !important;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.7) calc(min(495px, 49.5%) - 40px), transparent calc(min(495px, 49.5%) + 40px), transparent 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.header-overlay-wrapper h2.overlap-invert.overlay-clip-right::before {
  /* Enforces a completely uniform color (#e0e0e0) across the entire right-aligned watermark (e.g., "FRAMEWORK") as specifically requested by the user. */
  color: #e0e0e0 !important;
  background-image: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
}

/* Clip left header to the exact left image edge (min(495px, 49.5%)) */
.overlay-clip-left {
  clip-path: polygon(0 -1000%, min(495px, 49.5%) -1000%, min(495px, 49.5%) 1000%, 0 1000%);
}

/* Clip right header to the exact right image edge (max(100% - 495px, 50.5%)) */
.overlay-clip-right {
  clip-path: polygon(max(100% - 495px, 50.5%) -1000%, 100% -1000%, 100% 1000%, max(100% - 495px, 50.5%) 1000%);
}

/* Responsive Stacking for Mobile */
@media (max-width: 1024px) {

  .overlay-clip-left,
  .overlay-clip-right {
    display: none;
  }

  .section-integrated-bg,
  .section-integrated.image-right .section-integrated-bg {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 500px;
    margin-bottom: 2rem;
  }

  .section-integrated-bg img,
  .section-integrated.image-right .section-integrated-bg img {
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0) 100%);
  }

  .section-integrated-content,
  .section-integrated.image-right .section-integrated-content {
    margin-left: 0;
    margin-right: 0;
  }
}

/* ===== Homepage Section Animations ===== */

/* --- Scroll-triggered Card Entrance --- */
.section-integrated .card {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.section-integrated.in-view .card {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for the 4-card grid */
.section-integrated.in-view .grid-2 .card:nth-child(1) { transition-delay: 0s; }
.section-integrated.in-view .grid-2 .card:nth-child(2) { transition-delay: 0.15s; }
.section-integrated.in-view .grid-2 .card:nth-child(3) { transition-delay: 0.3s; }
.section-integrated.in-view .grid-2 .card:nth-child(4) { transition-delay: 0.45s; }
.section-integrated.in-view .grid-2 .card:nth-child(5) { transition-delay: 0.6s; }
.section-integrated.in-view .grid-2 .card:nth-child(6) { transition-delay: 0.75s; }

/* --- Subtle Ken Burns (slow zoom) on Section Images --- */
.section-integrated img[loading="lazy"] {
  transition: transform 10s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1);
  will-change: transform;
}

.section-integrated.in-view img[loading="lazy"] {
  transform: scale(1.10);
}

/* --- Card Hover Lift --- */
.section-integrated .card {
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.3s ease;
}

.section-integrated .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* --- Metrics Counter Section Entrance --- */
#metrics .grid-4 > div {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#metrics.in-view .grid-4 > div {
  opacity: 1;
  transform: translateY(0);
}

#metrics.in-view .grid-4 > div:nth-child(1) { transition-delay: 0s; }
#metrics.in-view .grid-4 > div:nth-child(2) { transition-delay: 0.2s; }
#metrics.in-view .grid-4 > div:nth-child(3) { transition-delay: 0.4s; }
#metrics.in-view .grid-4 > div:nth-child(4) { transition-delay: 0.6s; }

/* --- Facility Dual Image Entrance --- */
#infrastructure .grid-2 > div {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#infrastructure.in-view .grid-2 > div {
  opacity: 1;
  transform: translateY(0);
}

#infrastructure.in-view .grid-2 > div:nth-child(1) { transition-delay: 0.1s; }
#infrastructure.in-view .grid-2 > div:nth-child(2) { transition-delay: 0.3s; }

/* --- Compliance Flip Cards Entrance --- */
#compliance .flip-card {
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#compliance.in-view .flip-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#compliance.in-view .flip-card:nth-child(1) { transition-delay: 0s; }
#compliance.in-view .flip-card:nth-child(2) { transition-delay: 0.12s; }
#compliance.in-view .flip-card:nth-child(3) { transition-delay: 0.24s; }
#compliance.in-view .flip-card:nth-child(4) { transition-delay: 0.36s; }

/* --- Engagement Framework Cards --- */
#cases .card {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#cases.in-view .card {
  opacity: 1;
  transform: translateX(0);
}

#cases.in-view .card:nth-child(1) { transition-delay: 0.05s; }
#cases.in-view .card:nth-child(2) { transition-delay: 0.15s; }
#cases.in-view .card:nth-child(3) { transition-delay: 0.25s; }
#cases.in-view .card:nth-child(4) { transition-delay: 0.35s; }

/* --- Contact Section Entrance --- */
#contact .grid-2 > div {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#contact.in-view .grid-2 > div {
  opacity: 1;
  transform: translateY(0);
}

#contact.in-view .grid-2 > div:nth-child(1) { transition-delay: 0s; }
#contact.in-view .grid-2 > div:nth-child(2) { transition-delay: 0.2s; }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .section-integrated .card,
  #metrics .grid-4 > div,
  #infrastructure .grid-2 > div,
  #compliance .flip-card,
  #cases .card,
  #contact .grid-2 > div {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .section-integrated img[loading="lazy"] {
    transform: none;
    transition: none;
  }
}
/* ===== MOBILE FIXES ===== */
@media (max-width: 1024px) {
  /* 1. Center the expanding images on mobile */
  .section-integrated-bg,
  .section-integrated.image-right .section-integrated-bg {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
  }
  
  .section-integrated img[loading="lazy"] {
    transform-origin: center center;
  }

  /* 2. Prevent Shadow Titles from cropping weirdly or causing overflow */
  h2.has-watermark::before {
    font-size: 11vw !important; /* Smaller than 15vw to fit on mobile */
    white-space: nowrap;
    left: 50% !important;
    transform: translate(-50%, -10%) !important;
    text-align: center;
    width: 100%;
  }

  .watermark-group .watermark,
  .tech-boundary-watermark,
  .geo-boundary-watermark {
    font-size: 11vw !important;
  }
  
  body {
    overflow-x: hidden;
  }

  /* 3. Fix Dropdown clipping in scrollable nav */
  .dropdown-menu {
    position: fixed !important;
    top: var(--header-height, 80px) !important;
    left: 10% !important;
    width: 80% !important;
    margin-left: 0 !important;
    transform: translateY(10px) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  }
  
  .nav-dropdown:hover .dropdown-menu {
    transform: translateY(0) !important;
  }
}

