:root {
  --paper: #f6f7f0;
  --ink: #173c30;
  --muted: #56695f;
  --line: #d9dfd3;
  --lime: #d6f08a;
  --green: #5a771e;
  --green-dark: #3b5e40;
  --header-bg: #cae4a6;
  --card-line: #c8d5be;
  --resource-trim: 90px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  color: var(--ink);
  font: 16px/1.6 Arial, Helvetica, sans-serif;
  background-color: #ffffff;
  background-image: linear-gradient(180deg, #ffffff 0%, #f4f6f0 100%);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 17px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -1px;
}

h3 {
  margin-bottom: 15px;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 500;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: clamp(14px, 1.2vw + 8px, 24px);
  font-weight: 700;
  letter-spacing: 1.8px;
}

.wrap {
  width: min(89%, 1400px);
  margin-inline: auto;
}

/* Items waiting to be revealed sit ~45px outside their box.
   Clip them so they never create a sideways scrollbar on phones. */
main {
  overflow-x: clip;
}

/* ---------- 3. Page background that shifts while scrolling ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  will-change: opacity;
}

/* Green wash while the service cards are on screen */
body::before {
  z-index: -10;
  background-image: linear-gradient(180deg, #d2f7d5 0%, #e5f3e4 50%, #f0e1a1 100%);
}

/* Soft light wash when the footer is reached */
body::after {
  z-index: -9;
  background-image: linear-gradient(180deg, #e8ebc8 0%, #eff1d4 50%, #79e979 100%);
}

body.cards-visible-bg::before {
  opacity: 1;
}

body.how-visible-bg::before,
body.footer-visible-bg::before {
  opacity: 0;
}

body.footer-visible-bg::after {
  opacity: 1;
}

/* ---------- 4. Header ---------- */
.site-header {
  position: relative;
  background-color: var(--header-bg);
  color: var(--ink);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 90px;
  padding-block: 5px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-logo {
  display: block;
  flex-shrink: 0;
  width: auto;
  height: 76px;
  object-fit: contain;
}

.site-header .brand span {
  color: var(--ink);
  font-weight: 700;
}

.our-services {
  display: inline-block;
  margin-top: 7px;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.site-header .brand .our-services {
  font-weight: 600;
}

nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: transform 0.2s ease;
}

.site-header .nav-link {
  color: var(--ink);
}

.nav-link:hover {
  transform: scale(1.06);
}

.site-header .nav-doc {
  justify-content: center;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #4d6e27;
  color: #ffffff;
  font-weight: 600;
}

/* Leafy vine hanging below the header */
.header-branch-border {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  width: 100%;
  height: 28px;
  margin-top: -1px;
  pointer-events: none;
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: stretch;
  padding-block: 45px 60px;
}

#bg-particles {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  animation: heroFromLeft 0.9s ease-out both;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("resources/images/hero background.png") right bottom / auto 100% no-repeat;
  opacity: 0.3;
  pointer-events: none;
}

.lead {
  max-width: 510px;
  margin: 0 0 30px 15px;
  font-size: clamp(16px, 0.6vw + 12px, 20px);
  line-height: 1.8;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 30px;
  padding: 15px 32px;
  border-radius: 50px;
  box-shadow: 0 6px 16px rgba(90, 119, 30, 0.28);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.lime {
  background: var(--lime);
  color: var(--ink);
}

.button:hover {
  background: #c5e56e;
  box-shadow: 0 10px 22px rgba(90, 119, 30, 0.35);
  transform: translateY(-3px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  margin: 40px 0 0 15px;
  font-size: 10px;
  letter-spacing: 1.4px;
}

.hero-meta span {
  padding-right: 16px;
  border-right: 1px solid var(--line);
  font-size: 13px;
}

.hero-image {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: clamp(340px, 32vw, 460px);
  padding: clamp(22px, 2.8vw, 41px);
  border-radius: 94px 4px 4px 4px;
  background-color: #f2f5f0;
  animation: heroFromRight 0.9s ease-out both;
}

.hero-image::before,
.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-image::before {
  z-index: -2;
  background: url("resources/images/bg2.png") center / cover no-repeat;
  opacity: 0.8;
}

/* Dark gradient so the white text stays readable */
.hero-image::after {
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(10, 30, 23, 0.05) 15%,
    rgba(10, 30, 23, 0.65) 70%,
    rgba(10, 30, 23, 0.95) 100%
  );
}

.hero-image-content {
  width: 100%;
  color: #ffffff;
}

.hero-image-content .eyebrow {
  margin-bottom: 16px;
  color: var(--lime);
}

.hero-image-content h2 {
  margin-bottom: 17px;
  font-size: clamp(26px, 2.8vw, 39px);
}

.hero-image-description {
  max-width: 440px;
  margin: 0;
  color: #e3ece5;
  font-size: 15px;
  line-height: 1.6;
}

@keyframes heroFromLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* ---------- 6. Service cards ---------- */
.catalog {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid #5daa11;
  border-radius: 16px;
  background-color: #d1d1ca;
  background-image:
    linear-gradient(rgba(31, 65, 49, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 65, 49, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 20% 25%, #d8ebd0 0%, transparent 45%),
    radial-gradient(circle at 80% 25%, #cde2c4 0%, transparent 40%),
    radial-gradient(circle at 75% 75%, #e1edd8 0%, transparent 45%),
    radial-gradient(circle at 25% 75%, #d2e6c8 0%, transparent 40%);
  background-size: 48px 48px, 48px 48px, 140% 140%, 140% 140%, 140% 140%, 140% 140%;
  background-position: 0 0, 0 0, center, center, center, center;
  animation: patchPulse 8s ease-in-out infinite alternate;
}

/* Colour patches "breathe" in place */
@keyframes patchPulse {
  0%   { background-size: 48px 48px, 48px 48px, 110% 110%, 160% 160%, 120% 120%, 150% 150%; }
  50%  { background-size: 48px 48px, 48px 48px, 150% 150%, 120% 120%, 160% 160%, 110% 110%; }
  100% { background-size: 48px 48px, 48px 48px, 130% 130%, 140% 140%, 110% 110%, 160% 160%; }
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 32px;
}

.section-heading h2,
.section-heading h3 {
  margin-bottom: 0;
}

.corner-infra-link {
  position: absolute;
  top: 22px;
  right: 28px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1.5px solid #9cb87d;
  border-radius: 24px;
  background-color: #e2edd4;
  box-shadow: 0 3px 10px rgba(23, 60, 48, 0.08);
  color: var(--ink);
  font: 700 14px/1.6 Arial, Helvetica, sans-serif;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease,
    transform 0.25s ease, box-shadow 0.25s ease;
}

.corner-infra-link:hover {
  border-color: var(--green);
  background-color: var(--lime);
  box-shadow: 0 6px 18px rgba(23, 60, 48, 0.18);
  transform: translateY(-2px);
}

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

.card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 27px 28px 0;
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background-size: 200% 100%;
  transition: transform 0.4s var(--ease-out), opacity 0.4s ease,
    box-shadow 0.4s ease, border-color 0.3s ease;
  will-change: transform;
}

.c1 { background-image: linear-gradient(90deg, #d8e8c2 0%, #ffffff 50%, #d8e8c2 100%); }
.c2 { background-image: linear-gradient(90deg, #c3ded3 0%, #ffffff 50%, #c3ded3 100%); }
.c3 { background-image: linear-gradient(90deg, #e3dbc3 0%, #ffffff 50%, #e3dbc3 100%); }

/* Spinning neon ring around each card */
@property --neon-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 2px;
  border-radius: 11px;
  background: conic-gradient(
    from var(--neon-angle),
    transparent 20%,
    #d6f08a 50%,
    #5a771e 70%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spinNeon 4s linear infinite;
  pointer-events: none;
}

@keyframes spinNeon {
  to { --neon-angle: 360deg; }
}

@keyframes moveCardGradient {
  from { background-position: 0% 0%; }
  to   { background-position: 200% 0%; }
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
}

.service-image {
  display: block;
  width: 100%;
  height: 190px;
  margin: 22px 0;
  border-radius: 6px;
  object-fit: cover;
}

.card h3 {
  margin-bottom: 4px;
  font-family: Georgia, serif;
  font-size: clamp(26px, 2.4vw, 31px);
}

/* Subtitle under the card name. Flex items don't collapse margins,
   so the default h4 top margin is removed to keep it close to the title. */
.card h4 {
  margin-top: 0;
}

.card p {
  min-height: 48px; /* 2 lines (15px x 1.6) so all three cards stay aligned */
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 18px 0;
  border-top: 1px solid #bfcbb7;
}

.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}

.explore-link {
  padding: 8px 0;
}

.explore-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.try-link {
  padding: 10px 18px;
  border-radius: 5px;
  background: var(--ink);
  color: #ffffff;
}

.try-link:hover {
  background: #285641;
}

/* Cards stay hidden until they scroll into view (class added by JS).
   Only the entrance animation uses a fill-mode, and only "backwards",
   so it never overrides the opacity/transform used by the hover effects. */
.reveal-enabled .cards .card {
  opacity: 0;
  visibility: hidden;
}

.reveal-enabled .cards .card.is-visible {
  opacity: 1;
  visibility: visible;
  animation: serviceReveal 0.65s ease backwards, moveCardGradient 4s linear infinite;
  animation-delay: var(--reveal-delay, 0ms), 0s;
}

@keyframes serviceReveal {
  from { opacity: 0; translate: 0 35px; }
  to   { opacity: 1; translate: 0 0; }
}

/* Desktop hover: gentle 3D tilt (angles come from JS) and dimmed neighbours */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    z-index: 10;
    border-color: #739450;
    box-shadow: 0 16px 36px rgba(23, 60, 48, 0.16);
    transform: perspective(1000px)
      rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg))
      scale(1.025) translateY(-4px);
  }

  .cards:hover .card:not(:hover) {
    transform: scale(0.98);
  }
}

/* ---------- 7. Peeking mascots (hover on desktop only) ---------- */
.card.bioacoustic-card,
.card.drone-card,
.card.lulc-card {
  overflow: visible;
}

.peeking-bird,
.peeking-drone,
.peeking-satellite {
  position: absolute;
  top: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s var(--ease-spring), opacity 0.35s ease;
  will-change: transform, opacity;
}

.peeking-bird {
  right: 15px;
  width: 80px;
  transform: translateY(20px) scale(0.6) rotate(-10deg);
}

.peeking-drone {
  right: 25px;
  width: 95px;
  transform: translateY(25px) scale(0.6) rotate(8deg);
}

.peeking-satellite {
  right: 25px;
  width: 95px;
  transform: translateY(25px) scale(0.6) rotate(-14deg);
}

.peeking-bird img,
.peeking-drone svg,
.peeking-satellite svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(23, 60, 48, 0.22));
}

.peeking-satellite svg {
  overflow: visible;
}

.bioacoustic-card:hover .peeking-bird {
  opacity: 1;
  transform: translateY(-40px) scale(1) rotate(0deg);
}

.drone-card:hover .peeking-drone {
  opacity: 1;
  transform: translateY(-36px) scale(1) rotate(0deg);
  animation: droneHover 2.2s ease-in-out 0.5s infinite;
}

.lulc-card:hover .peeking-satellite {
  opacity: 1;
  transform: translateY(-36px) scale(1) rotate(-8deg);
  animation: satFloat 3s ease-in-out 0.5s infinite;
}

@keyframes droneHover {
  0%, 100% { transform: translateY(-36px) scale(1) rotate(0deg); }
  50%      { transform: translateY(-43px) scale(1) rotate(-2deg); }
}

@keyframes satFloat {
  0%, 100% { transform: translateY(-36px) scale(1) rotate(-8deg); }
  50%      { transform: translateY(-43px) scale(1) rotate(-3deg); }
}

.peeking-drone .prop {
  transform-box: fill-box;
  transform-origin: center;
  animation: propSpin 0.12s linear infinite;
}

.peeking-drone .prop-b {
  animation-delay: -0.06s;
}

@keyframes propSpin {
  0%, 100% { transform: scaleX(1); }
  50%      { transform: scaleX(0.4); }
}

.peeking-satellite .signal {
  opacity: 0;
  animation: signalPulse 1.4s ease-in-out infinite;
}

.peeking-satellite .s2 {
  animation-delay: 0.35s;
}

@keyframes signalPulse {
  0%, 100% { opacity: 0; }
  40%, 60% { opacity: 1; }
}

/* ---------- 8. "How it works" strip ---------- */
.how {
  padding: clamp(24px, 3vw, 40px) 0;
  background: var(--ink);
  color: #f4f5e8;
}

.how .eyebrow,
.steps article > span {
  color: #c5db9e;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 45px;
  margin-top: 10px;
}

.steps article {
  padding-top: 10px;
  border-top: 1px solid #6d8478;
}

.steps article > span {
  font-size: 12px;
  letter-spacing: 1.4px;
}

.steps h3 {
  margin-top: 22px;
  font-size: 21px;
}

.steps p {
  margin-bottom: 0;
  color: #c8d3cb;
  font-size: 15px;
}

/* ---------- 9. Resources ---------- */
.resources {
  display: grid;
  grid-template-columns: 0.85fr auto 1.2fr;
  gap: 30px;
  align-items: center;
  padding: 20px 0;
}

.resources p {
  max-width: 390px;
  color: var(--muted);
}

.resources .eyebrow {
  color: var(--ink);
}

.resource-center-action {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stacd-standalone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.stacd-standalone-icon img {
  display: block;
  width: 120px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(23, 60, 48, 0.18));
  transition: transform 0.3s var(--ease-out), filter 0.3s ease;
}

.stacd-standalone-icon:hover img {
  transform: scale(1.1) translateY(-3px);
  filter: drop-shadow(0 10px 22px rgba(23, 60, 48, 0.28));
}

/* Link cards: every card starts at the same left edge, marked by an
   always-visible green bar. Hover never shifts the text sideways. */
.resource-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Makes the cards narrower from the right edge */
  padding-right: var(--resource-trim);
}

.resource-links a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  padding: 22px 20px 22px 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  /* Reveal properties follow the stagger delay; hover properties react instantly. */
  transition:
    opacity 0.8s var(--ease-out) var(--reveal-delay, 0s),
    transform 0.8s var(--ease-out) var(--reveal-delay, 0s),
    filter 0.8s var(--ease-out) var(--reveal-delay, 0s),
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

/* The left edge marker */
.resource-links a::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background-color: var(--green);
  transition: width 0.3s var(--ease-out), background-color 0.25s ease;
}

.resource-links a:hover {
  background-color: rgba(230, 240, 220, 0.8);
  box-shadow: 0 8px 20px rgba(23, 60, 48, 0.08);
}

.resource-links a:hover::before {
  width: 8px;
  background-color: var(--green-dark);
}

.resource-links strong {
  color: var(--ink);
  transition: color 0.25s ease;
}

.resource-links a:hover strong {
  color: var(--green-dark);
}

.resource-links small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.arrow-icon {
  display: inline-block;
  flex-shrink: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  transition: transform 0.35s var(--ease-out), color 0.25s ease;
}

.resource-links a:hover .arrow-icon {
  color: var(--green);
  transform: translate(6px, -6px) scale(1.2);
}

/* Scroll reveal: all cards slide in from the same side, so they land on one line */
.reveal-resource {
  opacity: 0;
  filter: blur(4px);
  transform: translateX(-45px);
  will-change: opacity, transform, filter;
}

.reveal-resource.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0);
}

/* "More tools" text slides in from the left */
.animate-text {
  opacity: 0;
  filter: blur(4px);
  transform: translateX(-45px);
  transition: opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out),
    filter 0.85s var(--ease-out);
  will-change: opacity, transform, filter;
}

.animate-text.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateX(0);
}

.animate-delay-1 { transition-delay: 0.15s; }
.animate-delay-2 { transition-delay: 0.3s; }
.animate-delay-3 { transition-delay: 0.45s; }
.animate-delay-4 { transition-delay: 0.6s; }

/* ---------- 10. About us ---------- */
.about-us {
  padding: 35px 0 45px;
  border-top: 1px solid var(--line);
}

.about-us-container {
  max-width: 1050px;
  margin: 0 auto;
}

.about-us .eyebrow {
  margin-bottom: 12px;
  color: var(--green);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.about-us-card {
  position: relative;
  overflow: hidden;
  padding: 28px 32px;
  border: 1px solid #b8cf9f;
  border-radius: 16px;
  background: #e4eed8;
  box-shadow: 0 10px 25px rgba(23, 60, 48, 0.08);
  text-align: center;
  transition: opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out),
    box-shadow 0.4s var(--ease-out),
    border-color 0.4s ease;
}

.about-card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
  pointer-events: none;
}

.about-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 600;
  letter-spacing: -0.5px;
}

.about-subtitle {
  max-width: 850px;
  margin: 0 auto 16px;
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.about-us-lead {
  max-width: 950px;
  margin: 0 auto 24px;
  color: #2c4236;
  font-size: 15px;
  line-height: 1.65;
}

.about-us-lead p {
  margin: 0 0 8px;
}

/* All lead lines share one delay, so they appear together */
.animate-about-text.about-line.is-visible {
  transition-delay: var(--line-delay, 0s);
}


.about-us-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.about-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.about-btn:hover .btn-arrow {
  transform: translate(3px, -3px);
}

.btn-core-stack {
  border: 1px solid #e76f51;
  background-color: #f4a261;
  box-shadow: 0 4px 12px rgba(231, 111, 81, 0.2);
  color: var(--ink);
}

.btn-core-stack:hover {
  background-color: #e76f51;
  box-shadow: 0 6px 18px rgba(231, 111, 81, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-explorer {
  border: 1px solid var(--ink);
  background-color: var(--ink);
  box-shadow: 0 4px 12px rgba(23, 60, 48, 0.2);
  color: #ffffff;
}

.btn-explorer:hover {
  background-color: #285641;
  box-shadow: 0 6px 18px rgba(23, 60, 48, 0.3);
  transform: translateY(-2px);
}

/* Reveal states (toggled by JS). The hover lift is declared after the
   visible state so it still wins. */
.animate-about-card {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  will-change: opacity, transform;
}

.animate-about-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.animate-about-card.is-visible:hover {
  border-color: var(--green);
  box-shadow: 0 18px 35px rgba(23, 60, 48, 0.14);
  transform: translateY(-4px);
}

.animate-about-text {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out),
    filter 0.7s var(--ease-out);
  will-change: opacity, transform, filter;
}

.animate-about-text.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* ---------- 11. Footer ---------- */
.site-footer {
  width: 100%;
  margin: 0;
  padding: 30px 0;
  background-color: var(--ink);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 25px;
  color: #c8d3cb;
  font-size: 13px;
}

.site-footer .brand {
  color: #ffffff;
  font-size: 17px;
}

.site-footer a:not(.brand) {
  color: #c5db9e;
  transition: color 0.2s ease;
}

.site-footer a:not(.brand):hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ---------- 12. Modals (STACD + Infrastructure) ---------- */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 30, 23, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 780px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 44px 40px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 25px 60px rgba(15, 45, 33, 0.3);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s var(--ease-out);
}

.modal-overlay.is-open .modal-container {
  transform: none;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--ink);
  transform: scale(1.1);
}

.modal-header {
  padding-right: 40px;
}

.modal-header .eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 12px;
  letter-spacing: 1.8px;
}

.modal-header h2 {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 32px);
}

.modal-subtitle {
  margin: -12px 0 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Only the middle part scrolls; header and buttons stay in view */
.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: #c0d8b2;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.modal-section p {
  margin: 0;
  color: #4a5c52;
  font-size: 15px;
  line-height: 1.6;
}

.modal-list {
  margin: 0;
  padding-left: 20px;
  color: #4a5c52;
}

.modal-list li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.modal-list strong,
.modal-table td strong {
  color: var(--ink);
}

.modal-section code {
  padding: 1px 6px;
  border-radius: 4px;
  background: #eef4e4;
  color: var(--ink);
  font-size: 13px;
}

.modal-diagram-container {
  width: 100%;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(23, 60, 48, 0.08);
}

.modal-diagram-img {
  display: block;
  width: 100%;
  height: auto;
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.modal-table th,
.modal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #4a5c52;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

.modal-table th {
  background: #eef4e4;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.4px;
}

.modal-footer {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.modal-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 22px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.btn-primary { background: var(--ink); }

.btn-primary:hover {
  background: #285641;
  box-shadow: 0 6px 18px rgba(23, 60, 48, 0.2);
  transform: translateY(-2px);
}

.btn-secondary { background: var(--green); }

.btn-secondary:hover {
  background: var(--green-dark);
  box-shadow: 0 6px 18px rgba(90, 119, 30, 0.2);
  transform: translateY(-2px);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Large desktops */
@media (min-width: 1450px) {
  .hero {
    padding-block: 65px 75px;
  }
}

/* Tablet and below: stack the big blocks */
@media (max-width: 1000px) {
  .cards {
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
    gap: 22px;
  }

  .resources {
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
    text-align: center;
  }

  .resources p {
    margin-inline: auto;
  }

  .resource-links {
    width: 100%;
    max-width: 560px;
    padding-right: 0;
    text-align: left;
  }
}

@media (max-width: 900px) {
  .wrap {
    width: calc(100% - 48px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .hero-title {
    font-size: clamp(30px, 5.4vw, 42px);
  }

  .hero-image {
    min-height: 380px;
  }

  nav {
    gap: 18px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Phones */
@media (max-width: 650px) {
  .wrap {
    width: calc(100% - 36px);
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 12px 18px;
    padding-block: 14px;
  }

  .brand {
    font-size: 19px;
  }

  .brand-logo {
    height: 56px;
  }

  nav {
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .nav-link {
    font-size: 15px;
  }

  .site-header .nav-doc {
    min-height: 40px;
    padding: 8px 14px;
  }

  .hero {
    gap: 28px;
    padding-block: 32px 35px;
  }

  .lead,
  .button,
  .hero-meta {
    margin-left: 0;
  }

  .lead {
    margin-bottom: 24px;
  }

  .hero-meta {
    margin-top: 26px;
  }

  .hero-image {
    min-height: 330px;
    border-top-left-radius: 70px;
  }

  .catalog {
    padding: 18px;
  }

  .corner-infra-link {
    position: static;
    margin-bottom: 20px;
    font-size: 13px;
  }

  .section-heading {
    display: block;
    margin-bottom: 24px;
  }

  .card {
    padding: 24px 22px 0;
  }

  .card p {
    min-height: 0;
  }

  .service-image {
    height: 170px;
  }

  .resources {
    padding: 36px 0;
  }

  .resource-links a {
    padding: 18px 16px 18px 24px;
  }

  .about-us-card {
    padding: 24px 20px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  /* Modals become near full-screen sheets */
  .modal-overlay {
    padding: 12px;
  }

  .modal-container {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 28px 20px 20px;
    border-radius: 16px;
  }

  .modal-close-btn {
    top: 10px;
    right: 10px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }

  .modal-btn {
    padding: 13px 18px;
    font-size: 15px;
  }

  .modal-table {
    display: block;
    overflow-x: auto;
  }
}

/* ---------- Touch devices: no hover, so skip hover-only extras ---------- */
@media (hover: none) {
  .peeking-bird,
  .peeking-drone,
  .peeking-satellite {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .animate-text,
  .animate-about-text,
  .animate-about-card,
  .reveal-resource {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .reveal-enabled .cards .card {
    opacity: 1;
    visibility: visible;
  }

  .peeking-satellite .signal {
    opacity: 1;
  }
}

/* ---------- STACD modal: pipeline flow (same look as DIY LULC) ---------- */
.method-flow {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin: 28px 0 14px;
}

.flow-step {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 18px 10px 14px;
  border: 1px solid var(--card-line);
  border-top: 4px solid var(--green);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(23, 60, 48, 0.07);
  text-align: center;
}

.flow-step:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  top: 50%;
  right: -15px;
  z-index: 1;
  color: var(--green);
  font-size: 18px;
  font-weight: 700;
  transform: translateY(-50%);
}

.flow-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -34px auto 10px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 4px 10px rgba(90, 119, 30, 0.3);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.flow-title {
  display: block;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.flow-sub {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.method-note {
  margin: 0 0 20px;
  color: #4a5c52;
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .method-flow {
    flex-direction: column;
    gap: 26px;
  }

  .flow-step:not(:last-child)::after {
    content: "\2193";
    top: auto;
    right: auto;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ---------- STACD modal: video ---------- */
.modal-video {
  width: 100%;
  margin: 0 0 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #000000;
  box-shadow: 0 4px 14px rgba(23, 60, 48, 0.08);
}

.modal-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* ---------- Modals (STACD + Infrastructure): taller dialog ---------- */
/* The dialog was already almost full-screen, so the extra room comes from
   trimming the header / footer so the scrolling content area gets taller. */
.modal-overlay {
  padding: 8px;
}

.modal-overlay .modal-container {
  height: calc(100vh - 16px);
  height: calc(100dvh - 16px);
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  padding: 26px 40px 18px;
}

.modal-overlay .modal-close-btn {
  top: 10px;
}

.modal-overlay .modal-header h2 {
  margin-bottom: 14px;
}

.modal-overlay .modal-subtitle {
  margin: -8px 0 12px;
}

.modal-overlay .modal-footer {
  margin-top: 14px;
}

.modal-overlay .modal-btn {
  padding: 11px 18px;
}

@media (max-width: 650px) {
  .modal-overlay .modal-container {
    padding: 22px 16px 14px;
  }

  .modal-overlay .modal-footer {
    gap: 8px;
  }
}

/* ---------- STACD Walk Through (same look as the Bioacoustic page) ---------- */

/* Button at the end of the scrolling area inside the STACD popup */
.modal-walkthrough {
  display: flex;
  justify-content: center;
  padding: 8px 0 16px;
}

.walkthrough-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font: 600 14px Arial, sans-serif;
  transition: background 0.3s ease, transform 0.3s ease;
}

button.walkthrough-button {
  cursor: pointer;
}

.walkthrough-button span {
  color: var(--lime);
}

.walkthrough-button:hover {
  background: #285641;
  transform: translateY(-2px);
}

/* Popup: the PDF fills the whole popup */
.slides-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-right: 52px; /* keep clear of the close (x) button */
}

.slides-head p {
  margin: 0;
}

.walkthrough-modal .eyebrow {
  display: block;
  margin: 0;
  color: var(--green);
  font-size: 12px;
  letter-spacing: 1.8px;
}

.slides-open {
  flex: none;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
}

.slides-stage {
  display: block;
  flex: 1;
  min-height: 320px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f1f4ec;
  color: var(--muted);
  font-size: 14px;
}

.slides-stage.is-pages {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #e6eadf;
}

.slides-pages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.slides-pages canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.slides-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.slides-loading {
  margin: 0;
  padding: 24px;
  text-align: center;
}

.slides-help {
  margin: 10px 0 0;
  color: #9a3b2a;
  font-size: 14px;
}

@media (max-width: 650px) {
  .slides-head {
    padding-right: 44px;
  }
}