/* ============================================================
   GutRecover — v2 (Vedanta-structured homepage)
   Layered on the shared tokens in styles.css.
   ============================================================ */

:root {
  /* Spore amber — brand kit warm accent */
  --amber: #D89A3C;
  --amber-deep: #B87C24;
}

/* Keep nav items and buttons on one line */
.v2 .main-nav a, .v2 .btn { white-space: nowrap; }
.v2 .main-nav { gap: 0; }
.v2 .main-nav > .nav-item > a { padding: 9px 12px; font-size: 14.5px; }

/* ── Dropdown mega-menus ── */
.nav-item { position: relative; display: flex; align-items: center; pointer-events: auto; align-self: stretch; }
.nav-item > a { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.nav-item > a::after { content: '▾'; font-size: 8px; opacity: 0.5; transition: transform 0.2s ease; line-height: 1; }
.nav-item.is-open > a::after { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  opacity: 0;
  /* Keep panel as a pointer-events area at all times so the mouse
     travelling toward it never triggers pointerleave on .nav-item.
     Inner links are blocked until .is-open via selector below. */
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 300;
  box-shadow: 0 16px 40px -8px rgba(20,32,26,0.16);
  min-width: 180px;
}
/* Block clicks on links while panel is visually closed */
.v2 .main-nav .dropdown a { pointer-events: none; user-select: none; }
.nav-item.is-open .dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* Re-enable link clicks when open */
.v2 .main-nav .nav-item.is-open .dropdown a { pointer-events: auto; user-select: auto; }
/* 10px visual gap handled by top offset; ::before no longer needed */
.dropdown::before { display: none; }
.dropdown-col {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 190px;
}
.dropdown-col + .dropdown-col { border-left: 1px solid var(--line); }
.drop-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.dropdown-col a {
  font-size: 14px;
  font-weight: 450;
  color: var(--ink-soft);
  padding: 5px 0;
  border-radius: 0;
  background: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
}
.dropdown-col a:hover { color: var(--brand-600); padding-left: 5px; background: none; }

/* Light caret on dark hero */
.v2 .site-header:not(.scrolled) .nav-item > a::after { color: rgba(241,243,236,0.55); }

/* Mobile sub-items */
.mobile-sub { padding-left: 24px !important; font-size: 13.5px !important; opacity: 0.8; }
.mobile-sub:before { content: ''; }

/* ---------- Transparent overlay header ---------- */
.v2 .site-header {
  position: fixed;
  left: 0; right: 0;        /* anchor to full viewport width */
  width: 100%;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
}
.v2 .site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
/* Full-bleed header: brand left | nav absolutely centred | cta right */
.v2 .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  max-width: none;
  width: 100%;
  height: 100px;
  padding: 0 clamp(20px, 4vw, 56px);
  gap: 0;
}
/* Nav spans the full bar and centres its items; pointer-events let
   brand + CTA clicks pass through the invisible overlay */
.v2 .main-nav {
  position: absolute;
  left: 0; right: 0;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.v2 .main-nav a { pointer-events: auto; }
/* Brand and CTA float above the absolute nav layer */
.v2 .header-inner .brand  { position: relative; z-index: 2; }
.v2 .header-inner .header-cta { position: relative; z-index: 2; }
/* GR monogram: always transparent bg; bright chloro+light on dark hero */
.v2 .brand-mark { background: transparent; }
.v2 .site-header:not(.scrolled) .brand-mark .bm-g { color: #6FA64C; }
.v2 .site-header:not(.scrolled) .brand-mark .bm-r { color: #F1F3EC; }
.v2 .site-header:not(.scrolled) .brand-mark .bm-dots i:nth-child(1) { background: #6FA64C; }
.v2 .site-header:not(.scrolled) .brand-mark .bm-dots i:nth-child(2) { background: #2B9C8A; }
.v2 .site-header:not(.scrolled) .brand-mark .bm-dots i:nth-child(3) { background: #D89A3C; }
.v2 .site-header:not(.scrolled) .brand-mark .bm-dots i:nth-child(4) { background: #4A93C4; }
/* Over the photo, nav text is light; once scrolled it returns to ink */
.v2 .site-header:not(.scrolled) .brand-name { color: #FCFBF8; }
.v2 .site-header:not(.scrolled) .brand-name small { color: color-mix(in srgb, #FCFBF8 75%, transparent); }
/* Scope light text to top-level links only — dropdown links keep their own dark-on-white colour */
.v2 .site-header:not(.scrolled) .main-nav > .nav-item > a { color: color-mix(in srgb, #FCFBF8 88%, transparent); }
.v2 .site-header:not(.scrolled) .main-nav > .nav-item > a:hover { color: #FCFBF8; background: color-mix(in srgb, #FCFBF8 14%, transparent); }
.v2 .site-header:not(.scrolled) .menu-toggle { color: #FCFBF8; border-color: color-mix(in srgb, #FCFBF8 40%, transparent); }
.v2 .site-header:not(.scrolled) .header-cta .btn-primary { background: #FCFBF8; color: var(--brand-900); }
.v2 .site-header:not(.scrolled) .header-cta .btn-primary:hover { background: var(--accent-orange); color: #FCFBF8; }

/* ---------- Hero progressive text reveal ----------
   Reusable pattern: add .hero-reveal to a hero copy container; its direct
   children stagger in (eyebrow → headline → paragraph → CTA) once on enter.
   Gated on html.js-anim (set by an inline head script before paint) so that
   with JS disabled the text is simply visible — never stuck hidden. The whole
   block is inside prefers-reduced-motion:no-preference, so reduced-motion
   users get the static, fully-legible end state. */
@media (prefers-reduced-motion: no-preference) {
  html.js-anim .hero-reveal > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
  html.js-anim .hero-reveal > *:nth-child(1) { transition-delay: 0.10s; }
  html.js-anim .hero-reveal > *:nth-child(2) { transition-delay: 0.24s; }
  html.js-anim .hero-reveal > *:nth-child(3) { transition-delay: 0.38s; }
  html.js-anim .hero-reveal > *:nth-child(4) { transition-delay: 0.52s; }
  html.js-anim .hero-reveal.is-revealed > * {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Scroll-linked hero parallax ---------- */
.v2-hero, .page-hero { overflow: hidden; }
[data-parallax] { will-change: transform; backface-visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  [data-parallax] { transform: scale(1.14); }
}

/* ---------- Duotone imagery treatment (Tweaks toggle) ---------- */
html { --duo-dark: #14201A; --duo-light: #2B9C8A; }   /* default: deep ink → lumen teal */
html[data-duo="green"] { --duo-dark: #14201A; --duo-light: #5B8C3E; }
html[data-duo="amber"] { --duo-dark: #1C1A14; --duo-light: #D89A3C; }
.duotone-layer { display: none; position: absolute; inset: 0; pointer-events: none; z-index: 2; }
html[data-duotone="on"] .hero-media image-slot,
html[data-duotone="on"] .hero-media .ph-photo,
html[data-duotone="on"] .page-hero-media image-slot,
html[data-duotone="on"] .page-hero-media .ph-photo,
html[data-duotone="on"] .cl-media image-slot,
html[data-duotone="on"] .cl-media .ph,
html[data-duotone="on"] .inv-deckmedia image-slot {
  filter: grayscale(1) contrast(1.06) brightness(1.02);
}
html[data-duotone="on"] .duotone-layer { display: block; }
html[data-duotone="on"] .duotone-layer.dl-dark { background: var(--duo-dark); mix-blend-mode: multiply; }
html[data-duotone="on"] .duotone-layer.dl-light { background: var(--duo-light); mix-blend-mode: screen; opacity: 0.55; }

/* ---------- Subpage heroes with image slot (same principle as homepage) ---------- */
.page-hero { position: relative; overflow: hidden; isolation: isolate; }
.page-hero .page-hero-media {
  position: absolute; inset: 0; z-index: 0;
}
.page-hero .page-hero-media image-slot,
.page-hero .page-hero-media .ph-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.page-hero .page-hero-media image-slot { z-index: 1; }
.page-hero .page-hero-media .ph-photo {
  z-index: 0;
  background: var(--brand-900);
}
.page-hero .page-hero-scrim {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(
    to right,
    rgba(8,20,18,0.82) 0%,
    rgba(8,20,18,0.62) 50%,
    rgba(8,20,18,0) 80%
  );
}
.page-hero .wrap { position: relative; z-index: 3; }


.v2-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  isolation: isolate;
}
.v2-hero .hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.v2-hero .hero-media image-slot,
.v2-hero .hero-media .ph-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.v2-hero .hero-media .ph-photo { z-index: 0; }
.v2-hero .hero-media image-slot { z-index: 1; color: rgba(252, 251, 248, 0.85); }
.v2-hero .ph-photo {
  background: var(--brand-900);
}
.v2-hero .ph-photo span {
  position: absolute;
  right: 18px;
  bottom: 92px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: color-mix(in srgb, #FCFBF8 80%, transparent);
  background: rgba(0,0,0,0.30);
  padding: 7px 12px;
  border-radius: 9px;
}
/* Left-to-right scrim so overlaid text stays legible */
.v2-hero .hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(8,20,18,0.88) 0%,
    rgba(8,20,18,0.72) 28%,
    rgba(8,20,18,0.28) 52%,
    rgba(8,20,18,0) 70%);
}
.v2-hero .hero-inner { position: relative; z-index: 3; padding-top: 120px; padding-bottom: 160px; width: 100%; }
.v2-hero-copy { max-width: 440px; display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
.v2-hero-copy .eyebrow { color: var(--amber); }
.v2-hero-copy .eyebrow::before { background: var(--amber); }
.v2-hero h1 { color: #FCFBF8; font-size: clamp(42px, 5.6vw, 72px); line-height: 1.04; }
.v2-hero .lede { color: color-mix(in srgb, #FCFBF8 88%, transparent); max-width: 48ch; }
.v2-hero .btn-quiet { color: #FCFBF8; border-color: color-mix(in srgb, #FCFBF8 45%, transparent); }
.v2-hero .btn-quiet:hover { border-color: #FCFBF8; color: #FCFBF8; background: color-mix(in srgb, #FCFBF8 12%, transparent); }
.v2-hero .btn-primary { background: var(--brand-600); color: #FCFBF8; }
.v2-hero .btn-primary:hover { background: #FCFBF8; color: var(--brand-900); }

/* ---------- Orange news ticker pinned to hero base ---------- */
.news-ticker {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  background: var(--accent-orange);
  color: #2A1A06;
}
.news-ticker .ticker-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
}
.news-ticker .ticker-text { font-size: 15.5px; font-weight: 500; }
.news-ticker .ticker-text b { font-weight: 750; }
.news-ticker .btn {
  background: #FCFBF8;
  color: var(--brand-900);
  padding: 11px 26px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}
.news-ticker .btn:hover { background: var(--brand-900); color: #FCFBF8; }

/* ---------- Stats / proof bar ---------- */
.stats-bar {
  background: var(--deep-gut, #0C140F);
  border-top: 1px solid rgba(241,243,236,0.06);
  border-bottom: 1px solid rgba(241,243,236,0.06);
  padding: clamp(40px, 5vw, 64px) clamp(20px, 4vw, 56px);
}
.stats-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 0 clamp(16px, 3vw, 40px);
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 66px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #F1F3EC;
  white-space: nowrap;
}
.stat-num sup {
  font-size: 0.45em;
  vertical-align: super;
  letter-spacing: 0;
  color: var(--chloro, #5B8C3E);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(241,243,236,0.50);
  line-height: 1.65;
  max-width: 18ch;
}
.stat-div {
  width: 1px;
  height: 52px;
  background: rgba(241,243,236,0.12);
  flex-shrink: 0;
}
.stats-note {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(241,243,236,0.22);
  text-align: center;
  margin-top: 28px;
  max-width: none;
}
@media (max-width: 700px) {
  .stats-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px 0;
  }
  .stat-div { display: none; }
  .stat-item { padding: 0 12px; }
}

/* ---------- Commitment (icon cards over soft band) ---------- */
.commit { background: var(--surface); }
.commit-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 60px);
}
.commit-lead .lede { margin-bottom: 4px; }
.icon-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.icon-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 34px 30px;
  border-radius: var(--radius-card);
  background: var(--bg);
  border: 1px solid var(--line);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.icon-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-100);
  box-shadow: 0 20px 44px -24px rgba(20,40,35,0.28);
}
.icon-badge {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--brand-050);
  border: 1px solid var(--brand-100);
  display: grid;
  place-items: center;
  color: var(--brand-600);
}
.icon-badge svg { width: 30px; height: 30px; }
.icon-card h3 { font-size: 21px; line-height: 1.25; }
.icon-card p { font-size: 15px; color: var(--ink-soft); text-wrap: pretty; }
.icon-card .link-more { margin-top: auto; padding-top: 6px; }

/* ---------- Full-bleed pipeline band (microbe texture) ---------- */
.pipeline-band {
  position: relative;
  background: var(--brand-900);
  color: #F4F3EE;
  overflow: hidden;
}
.pipeline-band canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.5;
  z-index: 0;
}
.pipeline-band .wrap { position: relative; z-index: 1; }
.pipeline-band .band-inner {
  padding: var(--section-pad) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 26px;
}
.pipeline-band .eyebrow { color: var(--accent-orange); }
.pipeline-band .eyebrow::before { display: none; }
.pipeline-band h2 { color: #FCFBF8; max-width: 16ch; }
.pipeline-band .btn-primary { background: var(--accent-orange); color: #2A1A06; }
.pipeline-band .btn-primary:hover { background: #FCFBF8; color: var(--brand-900); }

/* Living bacteria photo backdrop (Tweak: data-pipeline-bg="bacteria") */
.pipeline-band .microbe-photo {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; display: none;
}
html[data-pipeline-bg="bacteria"] .pipeline-band .microbe-photo { display: block; }
html[data-pipeline-bg="bacteria"] .pipeline-band #microbe-canvas { display: none; }
.pipeline-band .microbe-photo .mp-img {
  position: absolute; inset: -6%;
  width: 112%; height: 112%;
  object-fit: cover;
  transform: scale(1.04); transform-origin: 62% 42%;
  filter: url(#microbeWobble) saturate(1.06) contrast(1.02);
}
html:not([data-motion="off"]) .pipeline-band .microbe-photo .mp-img {
  animation: microbeDrift 46s ease-in-out infinite alternate;
}
html[data-motion="off"] .pipeline-band .microbe-photo .mp-img {
  filter: saturate(1.05) contrast(1.02); animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .pipeline-band .microbe-photo .mp-img { filter: saturate(1.05) contrast(1.02); animation: none; }
}
@keyframes microbeDrift {
  0%   { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.13) translate(-2.2%, -1.6%); }
}
/* Legibility scrim — a soft centred vignette behind the text only,
   leaving the image edges bright and colourful */
.pipeline-band .microbe-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 58% 82% at 50% 48%,
      color-mix(in srgb, var(--brand-900) 66%, transparent) 0%,
      color-mix(in srgb, var(--brand-900) 46%, transparent) 38%,
      color-mix(in srgb, var(--brand-900) 16%, transparent) 64%,
      transparent 82%);
}
/* Text legibility insurance over the vivid photo (bacteria mode only) */
html[data-pipeline-bg="bacteria"] .pipeline-band .band-inner h2 {
  text-shadow: 0 2px 22px rgba(8, 14, 10, 0.6), 0 1px 3px rgba(8, 14, 10, 0.45);
}
html[data-pipeline-bg="bacteria"] .pipeline-band .band-inner .eyebrow {
  text-shadow: 0 1px 12px rgba(8, 14, 10, 0.7);
}

/* ---------- Split crosslink (Working at / Partner) ---------- */
.crosslink { display: grid; grid-template-columns: 1fr 1fr; min-height: 460px; }
.crosslink .cl-media { position: relative; }
.crosslink .cl-media image-slot, .crosslink .cl-media .ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.crosslink .cl-media image-slot { z-index: 1; }
.crosslink .cl-copy {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(48px, 6vw, 96px) clamp(32px, 5vw, 80px);
}

@media (max-width: 1020px) {
  .commit-lead, .crosslink { grid-template-columns: 1fr; }
  .icon-card-grid { grid-template-columns: 1fr; }
  /* Stack hero as column so ticker sits below copy, not beside it */
  .v2-hero {
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    min-height: 100svh;
  }
  .v2-hero .hero-inner {
    flex: 1;
    display: flex;
    align-items: center;
    padding-top: 100px;
    padding-bottom: 40px;
  }
  .news-ticker { position: static; width: 100%; }
  .crosslink .cl-media { min-height: 280px; }
}

/* ---------- Scroll-reveal photo band (parallax window) ----------
   A full-bleed ribbon whose background photo is pinned and panned by
   scroll, so a different slice of the image shows as you move past it.
   Uses the same parallax engine as the hero (site.js), so it is smooth,
   mobile-safe, and degrades to a static centred image under reduced-motion
   or no-JS. A paper-toned wash keeps text fully legible. */
.reveal-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  clip-path: polygon(0 28px, 100% 0, 100% calc(100% - 28px), 0 100%);
}
.reveal-band .rb-media {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  will-change: transform;
  backface-visibility: hidden;
}
.reveal-band .rb-media image-slot,
.reveal-band .rb-media .ph-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.reveal-band .rb-media image-slot { z-index: 1; color: rgba(252, 251, 248, 0.85); }
.reveal-band .rb-media .ph-photo {
  z-index: 0;
  background:
    repeating-linear-gradient(135deg, var(--brand-050) 0 16px, var(--bg-deep) 16px 32px);
}
/* Paper/mist wash — mutes the photo, warm-toned to match the palette */
.reveal-band .rb-wash {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 86%, transparent) 0%,
      color-mix(in srgb, var(--bg-deep) 80%, transparent) 100%),
    radial-gradient(120% 80% at 50% 50%,
      color-mix(in srgb, var(--surface) 30%, transparent),
      color-mix(in srgb, var(--brand-100) 26%, transparent) 90%);
}
.reveal-band .rb-inner {
  position: relative; z-index: 4;
  padding: clamp(96px, 12vw, 168px) 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 22px;
}
.reveal-band .rb-inner .eyebrow::before { display: none; }
.reveal-band .rb-inner h2 { max-width: 20ch; }
.reveal-band .rb-inner .lede,
.reveal-band .rb-inner p { max-width: 56ch; color: var(--ink-soft); }
.reveal-band .rb-inner .btn { margin-top: 6px; }
@media (max-width: 700px) {
  .reveal-band { clip-path: polygon(0 16px, 100% 0, 100% calc(100% - 16px), 0 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-band .rb-media { will-change: auto; }
}
