html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body { overscroll-behavior-y: none; overflow-x: hidden; }
section[id] { scroll-margin-top: 5rem; }
@media (min-width: 768px) { section[id] { scroll-margin-top: 6rem; } }

/* Scroll reveal (only hides content when JS is running) */
.js .reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
}
.js .reveal-on-scroll.is-revealed { opacity: 1; transform: none; }

/* Marquee: two identical copies, shift exactly one copy width */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeWave 34s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: 1.5rem; padding-right: 1.5rem; flex-shrink: 0; }
@keyframes marqueeWave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Tech cards */
.tech-card {
  transition: transform .28s cubic-bezier(.16,1,.3,1), background-color .28s, color .28s, border-color .28s, box-shadow .28s;
}
.tech-card:hover {
  transform: translateY(-4px);
  background-color: #3A4724 !important;
  color: #FBFBE7 !important;
  border-color: #3A4724 !important;
  box-shadow: 0 12px 28px -6px rgba(58, 71, 36,.3);
}
.tech-card:hover svg, .tech-card:hover .tech-title { color: #FBFBE7 !important; }
.tech-card:hover .tech-subtext { color: #D3D8C0 !important; }

/* FAQ accordion */
.faq-trigger { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.faq-content-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .35s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.faq-item.active .faq-content-wrapper { grid-template-rows: 1fr; opacity: 1; }
.faq-icon { transition: transform .3s cubic-bezier(.16,1,.3,1); }
.faq-item.active .faq-icon { transform: rotate(45deg); }

/* Mobile menu */
#mobile-menu { transition: max-height .3s cubic-bezier(.16,1,.3,1), opacity .25s ease, padding .3s; }
#mobile-menu.hidden-menu { max-height: 0; opacity: 0; pointer-events: none; padding-top: 0; padding-bottom: 0; visibility: hidden; }
#mobile-menu.open-menu { max-height: 480px; opacity: 1; pointer-events: auto; visibility: visible; }

/* Globe */
@keyframes globeRotate { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes globeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.globe-stage {
  animation: globeFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 0 25px rgba(80, 99, 47,.4)) drop-shadow(0 0 60px rgba(58, 71, 36,.25));
}
.globe-sphere {
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 35% 30%, #50632F 0%, #3A4724 25%, #1E2513 70%, #1A2111 100%);
  transform: rotate(15deg) translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari overflow+radius fix */
  isolation: isolate;
}
.globe-map-track { display: flex; width: 200%; height: 100%; animation: globeRotate 38s linear infinite; will-change: transform; }
.globe-map-panel { width: 50%; height: 100%; flex-shrink: 0; }
.globe-atmosphere {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 28% 25%, rgba(251,251,231,.35) 0%, rgba(155,166,133,.2) 30%, rgba(30, 37, 19,.55) 75%, rgba(26,33,17,.88) 100%);
  mix-blend-mode: hard-light;
}
.globe-inner-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: rgba(251,251,231,.45) 24px 14px 35px inset, rgba(26,33,17,.88) -28px -24px 50px inset, rgba(155,166,133,.6) 0 0 20px inset;
}
.globe-grid-lines { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; border: 1px solid rgba(211, 216, 192,.25); }

/* Nav active state */
.nav-link.is-active { color: #3A4724; }
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: #3A4724; transform: scaleX(0); transition: transform .2s ease;
}

/* Form */
.field {
  width: 100%;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(155,166,133,.6);
  border-radius: 0;
  padding: .8rem 1rem;
  font-size: 1rem; /* 16px avoids iOS zoom on focus */
  color: #1E2513;
  transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: rgba(58, 71, 36,.5); }
.field:focus { outline: none; border-color: #3A4724; box-shadow: 0 0 0 3px rgba(80, 99, 47,.25); }
.service-chip[aria-pressed="true"] { background: #3A4724; color: #FBFBE7; border-color: #3A4724; }

:focus-visible { outline: 2px solid #50632F; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track, .globe-map-track, .globe-stage { animation: none; }
  .js .reveal-on-scroll { opacity: 1; transform: none; transition: none; }
}

/* LightRays (React Bits) */
.light-rays { position: relative; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.light-rays__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* Glass top bar: 25% cream (75% transparent) + frosted blur */
.glass-header {
  background: rgba(243, 242, 230, 0.25);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
          backdrop-filter: blur(16px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 24px -12px rgba(58, 71, 36, 0.18);
}

/* GradientASCII (React Bits) */
.gradient-ascii-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.gradient-ascii-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* Hero background stack + fade */
.hero-bg .hero-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg {
  /* fades out toward the bottom and the sides so it melts into the page */
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, rgba(0,0,0,.6) 60%, transparent 92%);
          mask-image: radial-gradient(120% 100% at 50% 0%, #000 35%, rgba(0,0,0,.6) 60%, transparent 92%);
  animation: heroBgIn 2.2s cubic-bezier(.16,1,.3,1) both;
}
@keyframes heroBgIn {
  from { opacity: 0; transform: translateY(-24px) scale(1.04); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) { .hero-bg { animation: none; } }
