/* Anchor offset under fixed nav */
#mps,
#services,
#supplies,
#pourquoi,
#transformation,
#monitoring,
#equipments,
#partenaires,
#secteurs,
#contact,
#hero {
  scroll-margin-top: calc(var(--nav-height, 92px) + var(--logo-clearance, 0px) + 12px);
}

#hero.hero {
  --hero-bg: #f5f7f4;
  --hero-bg-warm: #f8f9f7;
  --hero-text: #17211d;
  --hero-text-soft: #2c3833;
  --hero-muted: #5c665f;
  --hero-faint: #8a938c;
  --hero-line: rgba(23, 33, 29, 0.08);
  --hero-line-strong: rgba(23, 33, 29, 0.14);
  --hero-accent: var(--cyan);
  --hero-accent-deep: var(--cyan-dark);
  --hero-accent-soft: #7dd3f0;
  --hero-accent-dim: rgba(10, 128, 128, 0.14);
  --hero-accent-wash: rgba(10, 128, 128, 0.07);
  --hero-white: #ffffff;
  --hero-graphite: var(--black, #1a1a1a);
  --hero-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hero-rotator-ms: 720ms;
  --hero-nav: var(--nav-height, 92px);
  --hero-logo-clearance: var(--logo-clearance, 0px);

  /* Sticky site-nav is in document flow — hero fills the rest of the viewport */
  position: relative;
  min-height: calc(100vh - var(--hero-nav));
  min-height: calc(100dvh - var(--hero-nav));
  height: auto;
  max-height: none;
  /* Clearance comes from .site-nav + * in base.css — keep box model stable */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
}

/* ---- Background ---- */

#hero .hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: hero3-fadeIn 0.5s ease 0.05s forwards;
}

#hero .hero__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 72% 48%, rgba(255, 255, 255, 0.9) 0%, transparent 62%),
    radial-gradient(ellipse 45% 40% at 18% 85%, var(--hero-accent-wash) 0%, transparent 70%),
    radial-gradient(ellipse 30% 28% at 88% 18%, rgba(236, 0, 140, 0.06) 0%, transparent 70%),
    linear-gradient(165deg, var(--hero-bg-warm) 0%, var(--hero-bg) 48%, #eef1ec 100%);
}

#hero .hero__grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hero-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-line) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 50%, #222525 0%, transparent 75%);
  opacity: 0.55;
}

#hero .hero__arch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hero .hero__glow {
  position: absolute;
  right: 50%;
  top: 46%;
  width: 90vw;
  height: 90vw;
  transform: translate3d(50%, -50%, 0);
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 255, 255, 0.35) 32%,
      rgba(10, 128, 128, 0.1) 52%,
      transparent 70%
    );
  filter: blur(4px);
}

#hero .hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
}

/* ---- Layout ---- */

#hero .hero__shell {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  padding-left: var(--grid-gutter, 2rem);
  padding-right: var(--grid-gutter, 2rem);
}

#hero .hero__layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
}

/* ---- Copy ---- */

#hero .hero__copy {
  position: relative;
  padding-block: 28px 8px;
  align-self: stretch;
  transform: translate3d(0, var(--copy-y, 0px), 0);
  opacity: var(--copy-o, 1);
}

#hero .hero__eyebrow {
  margin-bottom: 18px;
  letter-spacing: 0.12em;
  opacity: 0;
  animation: hero3-rise 0.8s var(--hero-ease) 0.5s forwards;
}

#hero .hero__headline {
  margin-bottom: 16px;
  opacity: 0;
  animation: hero3-rise 0.9s var(--hero-ease) 0.58s forwards;
}

#hero .hero__headline-line {
  display: block;
}

#hero .hero__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.28em 0.38em;
  margin-bottom: 18px;
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--hero-muted);
  line-height: 1.35;
  opacity: 0;
  animation: hero3-rise 0.85s var(--hero-ease) 0.72s forwards;
}

#hero .hero__rotator {
  position: relative;
  display: inline-grid;
  align-items: end;
  min-width: 11.5ch;
  height: 1.35em;
  overflow: hidden;
  vertical-align: baseline;
  color: var(--hero-text);
  font-weight: 700;
  letter-spacing: -0.03em;
}

#hero .hero__rotator-item {
  grid-area: 1 / 1;
  display: inline-block;
  white-space: nowrap;
  line-height: 1.3;
  will-change: transform, opacity, filter;
  transition:
    opacity var(--hero-rotator-ms) var(--hero-ease),
    transform var(--hero-rotator-ms) var(--hero-ease),
    filter var(--hero-rotator-ms) var(--hero-ease);
}

#hero .hero__rotator-item::after {
  content: "";
  display: block;
  height: 1.5px;
  margin-top: 1px;
  background: linear-gradient(90deg, var(--hero-accent) 0%, var(--magenta, #ec008c) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform var(--hero-rotator-ms) var(--hero-ease);
}

#hero .hero__rotator-item.is-current {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

#hero .hero__rotator-item.is-current::after {
  transform: scaleX(1);
}

#hero .hero__rotator-item.is-out {
  opacity: 0;
  transform: translateY(-12px);
  filter: blur(5px);
}

#hero .hero__rotator-item.is-out::after {
  transform: scaleX(0);
}

#hero .hero__rotator-item.is-prep {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(5px);
}

#hero .hero__sub {
  margin-bottom: 24px;
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.7;
  color: var(--hero-muted);
  opacity: 0;
  animation: hero3-rise 0.85s var(--hero-ease) 0.82s forwards;
}

#hero .hero__ctas {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 26px;
  opacity: 0;
  animation: hero3-rise 0.8s var(--hero-ease) 0.95s forwards;
}

#hero .hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 22px;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.015em;
  border-radius: 9px;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    transform 0.35s var(--hero-ease),
    background 0.35s var(--hero-ease),
    border-color 0.35s var(--hero-ease),
    box-shadow 0.35s var(--hero-ease),
    color 0.35s var(--hero-ease);
}

#hero .hero-btn:focus-visible {
  outline: 2px solid var(--hero-accent);
  outline-offset: 3px;
}

#hero .hero-btn--primary {
  background: var(--hero-graphite);
  color: var(--hero-white);
  box-shadow: 0 1px 2px rgba(23, 33, 29, 0.06), 0 8px 20px rgba(23, 33, 29, 0.06);
}

#hero .hero-btn--primary:hover {
  background: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10, 128, 128, 0.28);
}

#hero .hero-btn--primary svg {
  width: 15px;
  height: 15px;
  transition: transform 0.35s var(--hero-ease);
}

#hero .hero-btn--primary:hover svg {
  transform: translateX(3px);
}

#hero .hero-btn--ghost {
  background: transparent;
  color: var(--hero-text-soft);
  border-color: var(--hero-line-strong);
}

#hero .hero-btn--ghost:hover {
  border-color: var(--hero-text);
  transform: translateY(-2px);
}

#hero .hero__trust {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hero-faint);
  line-height: 1.7;
  opacity: 0;
  animation: hero3-rise 0.75s var(--hero-ease) 1.08s forwards;
}

/* ---- Stage / machine (desktop illustration; hidden on mobile) ---- */

#hero .hero__stage {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  align-self: stretch;
  order: 2;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: hero3-machineIn 0.95s var(--hero-ease) 0.32s forwards;
}

#hero .hero__stage-shift {
  position: relative;
  width: min(460px, 100%);
  max-width: 460px;
  max-height: none;
  aspect-ratio: 0.95;
  height: auto;
  margin: 0 auto;
  transform: translate3d(var(--stage-x, 0), var(--stage-y, 0), 0) scale(var(--stage-s, 1));
  transform-origin: 50% 60%;
}

#hero .crop {
  display: none;
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0.22;
  pointer-events: none;
  z-index: 6;
}

#hero .crop::before,
#hero .crop::after {
  content: "";
  position: absolute;
  background: var(--hero-text);
}

#hero .crop--tl { top: 6%; left: 8%; }
#hero .crop--tr { top: 6%; right: 6%; }
#hero .crop--bl { bottom: 10%; left: 8%; }
#hero .crop--br { bottom: 10%; right: 6%; }

#hero .crop--tl::before,
#hero .crop--tr::before,
#hero .crop--bl::before,
#hero .crop--br::before {
  width: 14px;
  height: 1px;
}

#hero .crop--tl::after,
#hero .crop--tr::after,
#hero .crop--bl::after,
#hero .crop--br::after {
  width: 1px;
  height: 14px;
}

#hero .crop--tl::before { top: 0; left: 0; }
#hero .crop--tl::after { top: 0; left: 0; }
#hero .crop--tr::before { top: 0; right: 0; }
#hero .crop--tr::after { top: 0; right: 0; }
#hero .crop--bl::before { bottom: 0; left: 0; }
#hero .crop--bl::after { bottom: 0; left: 0; }
#hero .crop--br::before { bottom: 0; right: 0; }
#hero .crop--br::after { bottom: 0; right: 0; }

#hero .machine-float {
  position: absolute;
  inset: 4% 6% 2%;
  animation: hero3-floatY 8.5s ease-in-out 1.2s infinite;
}

#hero .machine-par {
  position: relative;
  width: 100%;
  height: 100%;
  transform: translate3d(var(--mx, 0), var(--my, 0), 0);
}

#hero .machine {
  position: relative;
  width: 100%;
  height: 100%;
}

#hero .machine__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transition: opacity 0.6s var(--hero-ease);
  z-index: 3;
  filter: drop-shadow(0 28px 40px rgba(23, 33, 29, 0.12));
}

#hero .machine__photo.is-loaded {
  opacity: 1;
}

#hero .machine.is-photo .machine__fallback {
  opacity: 0;
  visibility: hidden;
}

#hero .machine__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#hero .mfp {
  position: relative;
  width: min(78%, 240px);
  height: 88%;
  transform: none;
  transform-style: preserve-3d;
}

#hero .mfp__shadow {
  position: absolute;
  left: 50%;
  bottom: -2%;
  width: 86%;
  height: 36px;
  transform: translateX(-54%);
  background: radial-gradient(ellipse, rgba(23, 33, 29, 0.18) 0%, rgba(23, 33, 29, 0.06) 42%, transparent 72%);
  filter: blur(2px);
  z-index: 0;
}

#hero .mfp__side {
  position: absolute;
  left: 2%;
  top: 11%;
  width: 7%;
  height: 80%;
  background: linear-gradient(180deg, #c5c9c3 0%, #aeb3ad 40%, #9aa09a 100%);
  border-radius: 6px 0 0 8px;
  transform: skewY(-8deg);
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.25);
  z-index: 1;
}

#hero .mfp__stack {
  position: absolute;
  left: 8%;
  right: 4%;
  top: 0;
  bottom: 4%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  filter:
    drop-shadow(0 18px 28px rgba(23, 33, 29, 0.1))
    drop-shadow(0 2px 6px rgba(23, 33, 29, 0.06));
}

#hero .mfp__adf {
  height: 15%;
  background: linear-gradient(180deg, #e7eae5 0%, #d5d9d3 55%, #c8ccc6 100%);
  border-radius: 10px 10px 2px 2px;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -1px 0 rgba(23, 33, 29, 0.06);
}

#hero .mfp__adf-lid {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 18%;
  height: 58%;
  background: linear-gradient(180deg, #f4f6f2 0%, #dde1db 100%);
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 29, 0.05);
}

#hero .mfp__adf-lid::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: 3px;
  transform: translate(-50%, -50%);
  background: rgba(23, 33, 29, 0.1);
  border-radius: 2px;
}

#hero .mfp__hinge {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 14%;
  background: linear-gradient(180deg, #bfc4be, #a8aea8);
}

#hero .mfp__body {
  flex: 1;
  position: relative;
  background: linear-gradient(165deg, #fbfcfb 0%, #eef1ec 38%, #e2e6e1 72%, #d5dad4 100%);
  border-radius: 2px 2px 0 0;
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.65),
    inset -1px 0 0 rgba(23, 33, 29, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

#hero .mfp__body::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

#hero .mfp__strip {
  position: absolute;
  left: 0;
  top: 22%;
  width: 3px;
  height: 28%;
  background: linear-gradient(180deg, var(--hero-accent-soft), var(--hero-accent) 60%, transparent);
  opacity: 0.85;
}

#hero .mfp__output {
  position: absolute;
  left: 10%;
  right: 28%;
  top: 14%;
  height: 16%;
  background: linear-gradient(180deg, #1c2420 0%, #0e1411 100%);
  border-radius: 3px;
  box-shadow:
    inset 0 8px 12px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

#hero .mfp__paper {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 62%;
  background: linear-gradient(180deg, #ffffff 0%, #f2f3f0 100%);
  border-radius: 1px 1px 0 0;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(6%);
}

#hero .mfp__paper::after {
  content: "";
  position: absolute;
  right: 10%;
  top: 18%;
  width: 22%;
  height: 2px;
  background: var(--hero-accent);
  opacity: 0.45;
  box-shadow: 0 6px 0 rgba(10, 128, 128, 0.18);
}

#hero .mfp__door {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 38%;
  bottom: 10%;
  background: linear-gradient(180deg, #f7f8f6 0%, #e6e9e4 100%);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 29, 0.06);
}

#hero .mfp__door::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  width: 18%;
  height: 3px;
  transform: translateX(-50%);
  background: rgba(23, 33, 29, 0.12);
  border-radius: 2px;
}

#hero .mfp__door-window {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 28%;
  bottom: 22%;
  background: linear-gradient(180deg, rgba(10, 128, 128, 0.1), rgba(23, 33, 29, 0.04));
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 29, 0.05);
}

#hero .mfp__panel {
  position: absolute;
  top: 12%;
  right: 3%;
  width: 27%;
  height: 26%;
  background: linear-gradient(160deg, #2a312d 0%, #161c19 100%);
  border-radius: 8px;
  z-index: 4;
  box-shadow:
    6px 10px 18px rgba(23, 33, 29, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 7px;
}

#hero .mfp__screen {
  width: 86%;
  height: 58%;
  border-radius: 3px;
  background: linear-gradient(160deg, #0a2a38 0%, #061820 60%, #041018 100%);
  box-shadow:
    inset 0 0 0 1px rgba(10, 128, 128, 0.32),
    0 0 12px rgba(10, 128, 128, 0.1);
  position: relative;
  overflow: hidden;
}

#hero .mfp__screen::before {
  content: "";
  position: absolute;
  left: 14%;
  top: 22%;
  width: 62%;
  height: 2px;
  background: rgba(125, 211, 240, 0.6);
  box-shadow:
    0 5px 0 rgba(125, 211, 240, 0.3),
    0 10px 0 rgba(125, 211, 240, 0.16);
  border-radius: 1px;
}

#hero .mfp__keys {
  display: flex;
  gap: 4px;
}

#hero .mfp__key {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

#hero .mfp__key.is-led {
  background: var(--hero-accent);
  box-shadow: 0 0 6px rgba(10, 128, 128, 0.75);
}

#hero .mfp__drawers {
  height: 17%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px 0 0;
}

#hero .mfp__drawer {
  flex: 1;
  background: linear-gradient(180deg, #e4e7e2 0%, #cfd4ce 100%);
  border-radius: 0 0 3px 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 0 0 1px rgba(23, 33, 29, 0.05);
  position: relative;
}

#hero .mfp__drawer:last-child {
  border-radius: 0 0 8px 8px;
}

#hero .mfp__drawer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16%;
  height: 3px;
  transform: translate(-50%, -50%);
  background: rgba(23, 33, 29, 0.14);
  border-radius: 2px;
}

#hero .mfp__feet {
  position: absolute;
  left: 18%;
  right: 12%;
  bottom: 1%;
  height: 3%;
  display: flex;
  justify-content: space-between;
  z-index: 1;
}

#hero .mfp__feet span {
  width: 10%;
  height: 100%;
  background: #8d928c;
  border-radius: 1px 1px 2px 2px;
}

#hero .machine__lights {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

#hero .machine__light {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.8s var(--hero-ease);
  mix-blend-mode: multiply;
}

#hero .machine__light--equipment {
  top: 4%;
  left: 28%;
  width: 46%;
  height: 22%;
  background: radial-gradient(circle, rgba(10, 128, 128, 0.28), transparent 70%);
}

#hero .machine__light--leasing {
  inset: 18% 16% 20%;
  background: radial-gradient(circle, rgba(10, 128, 128, 0.12), transparent 70%);
}

#hero .machine__light--service {
  top: 38%;
  left: 22%;
  width: 50%;
  height: 28%;
  background: radial-gradient(circle, rgba(236, 0, 140, 0.14), transparent 70%);
}

#hero .machine__light--supply {
  bottom: 8%;
  left: 22%;
  width: 52%;
  height: 22%;
  background: radial-gradient(circle, rgba(255, 242, 0, 0.2), transparent 70%);
}

#hero .machine__light--monitoring {
  top: 16%;
  right: 8%;
  width: 28%;
  height: 22%;
  background: radial-gradient(circle, rgba(10, 128, 128, 0.32), transparent 68%);
}

#hero[data-topic="equipment"] .machine__light--equipment,
#hero[data-topic="leasing"] .machine__light--leasing,
#hero[data-topic="service"] .machine__light--service,
#hero[data-topic="supply"] .machine__light--supply,
#hero[data-topic="monitoring"] .machine__light--monitoring {
  opacity: 1;
}

/* ---- Markers ---- */

#hero .marker {
  display: none;
  position: absolute;
  z-index: 8;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px 12px 12px;
  border: 1px solid rgba(23, 33, 29, 0.1);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  border-radius: 14px;
  opacity: 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
  max-width: 220px;
  min-width: 172px;
  font: inherit;
  box-shadow:
    0 1px 2px rgba(23, 33, 29, 0.04),
    0 12px 30px rgba(23, 33, 29, 0.12);
  transition:
    opacity 0.6s var(--hero-ease),
    transform 0.35s var(--hero-ease),
    border-color 0.35s var(--hero-ease),
    box-shadow 0.35s var(--hero-ease),
    background 0.35s var(--hero-ease);
  transform: translate3d(var(--kx, 0), var(--ky, 0), 0);
}

#hero .marker:nth-child(1) { animation: hero3-markerIn 0.7s var(--hero-ease) 1.05s forwards; }
#hero .marker:nth-child(2) { animation: hero3-markerIn 0.7s var(--hero-ease) 1.18s forwards; }
#hero .marker:nth-child(3) { animation: hero3-markerIn 0.7s var(--hero-ease) 1.31s forwards; }
#hero .marker:nth-child(4) { animation: hero3-markerIn 0.7s var(--hero-ease) 1.44s forwards; }
#hero .marker:nth-child(5) { animation: hero3-markerIn 0.7s var(--hero-ease) 1.57s forwards; }

#hero .marker--1 { top: 4%; left: -2%; }
#hero .marker--2 { top: 12%; right: -4%; }
#hero .marker--3 { top: 52%; right: -6%; }
#hero .marker--4 { bottom: 8%; left: 2%; }
#hero .marker--5 { top: 38%; left: -6%; }

#hero .marker__dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.22);
  flex-shrink: 0;
  transition:
    background 0.6s var(--hero-ease),
    box-shadow 0.6s var(--hero-ease),
    transform 0.6s var(--hero-ease);
}

#hero .marker__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#hero .marker__num {
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  color: #64748b;
  transition: color 0.6s var(--hero-ease);
}

#hero .marker__title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
  line-height: 1.2;
  transition: color 0.6s var(--hero-ease);
}

#hero .marker__desc {
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #475569;
  line-height: 1.35;
  transition: color 0.6s var(--hero-ease);
}

#hero .marker__line {
  position: absolute;
  height: 2px;
  top: 50%;
  opacity: 0.4;
  background: linear-gradient(90deg, rgba(10, 128, 128, 0.5), transparent);
  transition: opacity 0.6s var(--hero-ease), background 0.6s var(--hero-ease);
  pointer-events: none;
}

#hero .marker--1 .marker__line { left: 100%; width: 44px; margin-left: 4px; }
#hero .marker--2 .marker__line {
  right: 100%;
  width: 40px;
  margin-right: 4px;
  background: linear-gradient(90deg, transparent, rgba(10, 128, 128, 0.5));
}
#hero .marker--3 .marker__line {
  right: 100%;
  width: 48px;
  margin-right: 4px;
  background: linear-gradient(90deg, transparent, rgba(10, 128, 128, 0.5));
}
#hero .marker--4 .marker__line { left: 100%; width: 48px; margin-left: 4px; }
#hero .marker--5 .marker__line { left: 100%; width: 52px; margin-left: 4px; }

#hero .marker.is-active {
  opacity: 1 !important;
  z-index: 9;
  border-color: rgba(10, 128, 128, 0.5);
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(10, 128, 128, 0.14),
    0 16px 38px rgba(0, 119, 179, 0.2);
  transform: translate3d(var(--kx, 0), var(--ky, 0), 0) scale(1.05);
}

#hero .marker:not(.is-active) {
  filter: none;
}

#hero .marker.is-active .marker__dot {
  background: var(--hero-accent);
  box-shadow:
    0 0 0 5px var(--hero-accent-dim),
    0 0 14px rgba(10, 128, 128, 0.55);
  transform: scale(1.15);
}

#hero .marker.is-active .marker__num {
  color: var(--hero-accent-deep);
}

#hero .marker.is-active .marker__title {
  color: #0f172a;
}

#hero .marker.is-active .marker__desc {
  color: #334155;
}

#hero .marker.is-active .marker__line {
  opacity: 1;
  background: linear-gradient(90deg, var(--hero-accent), transparent);
}

#hero .marker--2.is-active .marker__line,
#hero .marker--3.is-active .marker__line {
  background: linear-gradient(90deg, transparent, var(--hero-accent));
}

#hero .marker:hover {
  border-color: rgba(10, 128, 128, 0.4);
  box-shadow:
    0 1px 2px rgba(23, 33, 29, 0.04),
    0 18px 36px rgba(0, 119, 179, 0.18);
  transform: translate3d(var(--kx, 0), calc(var(--ky, 0px) - 3px), 0);
}

#hero .marker:hover .marker__title {
  color: var(--hero-accent-deep);
}

#hero .marker:focus-visible {
  outline: 2px solid var(--hero-accent);
  outline-offset: 3px;
}

#hero.is-ready .marker:not(.is-active) {
  opacity: 0.92;
}

#hero.is-ready .marker.is-active {
  opacity: 1;
}

/* ---- Mobile topic bubbles (grid; desktop uses .marker on stage) ---- */

#hero .topic-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 16px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

#hero .topic-bar a {
  min-width: 0;
  padding: 12px 12px 13px;
  border: 1px solid rgba(23, 33, 29, 0.1);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  color: #475569;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  text-align: left;
  box-shadow: 0 8px 20px rgba(23, 33, 29, 0.06);
  transition:
    background 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s var(--hero-ease);
}

#hero .topic-bar a:last-child {
  grid-column: 1 / -1;
}

#hero .topic-bar a[aria-pressed="true"] {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(10, 128, 128, 0.28);
  box-shadow:
    0 0 0 2px rgba(10, 128, 128, 0.16),
    0 8px 20px rgba(10, 128, 128, 0.12);
}

#hero .topic-bar .t-num {
  flex: none;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--hero-accent-deep);
  line-height: 1.2;
}

#hero .topic-bar .t-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#hero .topic-bar .t-name {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--hero-text);
  line-height: 1.25;
  white-space: normal;
}

#hero .topic-bar .t-name-short {
  display: none;
}

#hero .topic-bar .t-desc {
  font-size: var(--text-2xs);
  font-weight: 400;
  color: var(--hero-muted);
  line-height: 1.35;
}

#hero .topic-bar a:focus-visible {
  outline: 2px solid var(--hero-accent);
  outline-offset: 2px;
}

/* ---- Scroll cue ---- */

#hero .hero__scroll {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0 16px;
  text-decoration: none;
  opacity: 0;
  animation: hero3-fadeIn 0.8s ease 1.4s forwards;
}

#hero .hero__scroll span {
  font-size: var(--text-3xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hero-faint);
}

#hero .hero__scroll-line {
  width: 1px;
  height: 36px;
  background: var(--hero-line-strong);
  position: relative;
  overflow: hidden;
}

#hero .hero__scroll-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 100%;
  height: 40%;
  background: var(--hero-accent);
  animation: hero3-scrollDrop 2.2s var(--hero-ease) 1.6s infinite;
}

/* ---- Motion ---- */

@keyframes hero3-fadeIn {
  to { opacity: 1; }
}

@keyframes hero3-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero3-machineIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero3-markerIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero3-floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes hero3-scrollDrop {
  0% { top: -40%; }
  100% { top: 110%; }
}

@media (prefers-reduced-motion: reduce) {
  #hero .hero__bg,
  #hero .hero__eyebrow,
  #hero .hero__headline,
  #hero .hero__kicker,
  #hero .hero__sub,
  #hero .hero__ctas,
  #hero .hero__trust,
  #hero .hero__stage,
  #hero .hero__scroll,
  #hero .marker {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }

  #hero .hero__rotator-item,
  #hero .hero__rotator-item.is-out,
  #hero .hero__rotator-item.is-prep,
  #hero .hero__rotator-item.is-current {
    filter: none !important;
    transform: none !important;
  }

  #hero .machine-float {
    animation: none !important;
  }
}

/* ---- Breakpoints (mobile-first) ---- */

@media (min-width: 481px) {
  #hero .hero__copy {
    padding-block: 36px 8px;
  }

  #hero .hero__eyebrow {
    margin-bottom: 28px;
    letter-spacing: var(--tracking-wide);
  }

  #hero .hero__headline {
    margin-bottom: 22px;
  }

  #hero .hero__kicker {
    margin-bottom: 26px;
  }

  #hero .hero__rotator {
    min-width: 13.5ch;
  }

  #hero .hero__sub {
    margin-bottom: 34px;
  }

  #hero .hero__ctas {
    margin-bottom: 36px;
  }

  #hero .hero__scroll {
    padding-bottom: 14px;
  }
}

@media (min-width: 769px) {
  #hero .hero__ctas {
    flex-direction: row;
    align-items: center;
  }

  #hero .hero-btn {
    width: auto;
  }

  #hero .hero__trust {
    letter-spacing: 0.11em;
    line-height: 1.6;
  }

  /* Tablet: keep illustration + compact horizontal topic bar */
  #hero .hero__stage {
    display: flex;
    min-height: min(360px, 48vh);
  }

  #hero .machine-float {
    inset: 8% 10% 6%;
  }

  #hero .mfp {
    width: min(70%, 280px);
  }

  #hero .topic-bar {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    margin: 8px 0 12px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(23, 33, 29, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(23, 33, 29, 0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #hero .topic-bar a {
    flex: 1 1 0;
    min-width: 84px;
    padding: 10px 10px 11px;
    border: 0;
    background: transparent;
    border-radius: 10px;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    box-shadow: none;
  }

  #hero .topic-bar a:last-child {
    grid-column: auto;
  }

  #hero .topic-bar a[aria-pressed="true"] {
    background: #ffffff;
    border-color: transparent;
    box-shadow:
      0 0 0 2px rgba(10, 128, 128, 0.2),
      0 4px 12px rgba(0, 119, 179, 0.12);
  }

  #hero .topic-bar .t-num {
    font-size: var(--text-3xs);
  }

  #hero .topic-bar .t-name {
    font-size: var(--text-2xs);
    white-space: nowrap;
  }

  #hero .topic-bar .t-name-full {
    display: none;
  }

  #hero .topic-bar .t-name-short {
    display: inline;
  }

  #hero .topic-bar .t-desc {
    display: none;
  }
}

@media (min-width: 993px) {
  /* Wide enough for illustration — stack until height also allows schema */
  #hero .hero__layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #hero .hero__copy {
    padding: 12px 0 0;
    align-self: stretch;
  }

  #hero .hero__stage {
    display: flex;
    min-height: min(360px, 42vh);
    max-height: none;
    align-self: stretch;
    order: 2;
    width: 100%;
  }

  #hero .hero__stage-shift {
    width: min(560px, 100%, 52vh);
    max-width: 560px;
    max-height: none;
    aspect-ratio: 0.92;
    margin: 0 auto;
  }

  #hero .hero__glow {
    right: 4%;
    width: min(720px, 58vw);
    height: min(720px, 58vw);
    transform: translate3d(var(--bg-x, 0), calc(-50% + var(--bg-y, 0px)), 0);
  }

  #hero .mfp {
    width: min(78%, 340px);
    transform: perspective(1400px) rotateY(-6deg);
  }

  #hero .machine-float {
    inset: 4% 8% 2%;
  }
}

/* Schema markers around MFP — need vertical room, not just width */
@media (min-width: 993px) and (min-height: 720px) {
  #hero .hero__stage {
    min-height: 420px;
  }

  #hero .hero__stage-shift {
    width: min(560px, 100%);
  }

  #hero .marker {
    display: flex;
  }

  #hero .crop {
    display: block;
  }

  #hero .topic-bar {
    display: none;
  }
}

/* Wide + short: keep wide gutters, stay stacked, topic-bar (no crushed markers) */
@media (min-width: 1200px) and (max-height: 779px) {
  #hero.hero {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  #hero .hero__shell {
    padding-left: 112px;
    padding-right: 112px;
  }

  #hero .hero__layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #hero .hero__copy {
    padding: 8px 0 0;
    align-self: stretch;
  }

  /* Schema below → center intro (beats base .col-intro @ ≥1200 left) */
  #hero .hero__copy.col-intro {
    text-align: center !important;
    align-items: center !important;
  }

  #hero .hero__copy.col-intro .eyebrow:not(.eyebrow--center) {
    justify-content: center !important;
  }

  #hero .hero__copy.col-intro .hero__kicker,
  #hero .hero__copy.col-intro .hero__ctas {
    justify-content: center !important;
    align-items: center !important;
  }

  #hero .hero__stage {
    min-height: 0;
    max-height: min(340px, 46vh);
    order: 2;
  }

  #hero .hero__stage-shift {
    width: min(420px, 100%, 44vh);
    max-width: 420px;
    max-height: min(340px, 46vh);
    margin: 0 auto;
  }

  #hero .marker,
  #hero .crop {
    display: none;
  }

  #hero .topic-bar {
    display: flex;
  }

  #hero .machine-float {
    inset: 6% 10% 4%;
  }
}

/* Wide + tall enough: side-by-side schema */
@media (min-width: 1200px) and (min-height: 780px) {
  #hero.hero {
    height: calc(100vh - var(--hero-nav));
    height: calc(100dvh - var(--hero-nav));
    max-height: calc(100vh - var(--hero-nav));
    max-height: calc(100dvh - var(--hero-nav));
  }

  #hero .hero__shell {
    padding-left: 112px;
    padding-right: 112px;
  }

  #hero .hero__layout {
    grid-template-columns: minmax(280px, 0.84fr) minmax(320px, 1.16fr);
    gap: 16px 32px;
  }

  #hero .hero__copy {
    padding: 0;
    align-self: center;
  }

  /* Side-by-side → left intro */
  #hero .hero__copy.col-intro {
    text-align: left !important;
    align-items: flex-start !important;
  }

  #hero .hero__copy.col-intro .eyebrow:not(.eyebrow--center) {
    justify-content: flex-start !important;
  }

  #hero .hero__copy.col-intro .hero__kicker,
  #hero .hero__copy.col-intro .hero__ctas {
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }

  #hero .hero__stage {
    min-height: 0;
    max-height: calc(100dvh - var(--hero-nav) - 64px);
    align-self: center;
    order: 0;
  }

  #hero .hero__stage-shift {
    width: min(640px, 100%, calc((100dvh - var(--hero-nav) - 64px) * 0.92));
    max-width: 100%;
    max-height: calc(100dvh - var(--hero-nav) - 64px);
    margin: 0;
  }

  #hero .marker {
    display: flex;
  }

  #hero .crop {
    display: block;
  }

  #hero .topic-bar {
    display: none;
  }

  #hero .machine-float {
    inset: 4% 6% 2%;
  }
}

@media (min-width: 1440px) and (min-height: 780px) {
  #hero .hero__stage-shift {
    width: min(700px, 100%, calc((100dvh - var(--hero-nav) - 64px) * 0.92));
    max-width: 700px;
  }

  #hero .machine-float {
    inset: 4% 4% 2% 8%;
  }
}

/* Very short viewports (any width): never force full-bleed hero height */
@media (max-height: 640px) {
  #hero.hero {
    min-height: 0;
    height: auto;
    max-height: none;
  }

  #hero .hero__stage {
    min-height: 0;
    max-height: min(280px, 50vh);
  }

  #hero .hero__stage-shift {
    width: min(360px, 85%, 48vh);
    max-width: 360px;
    max-height: min(280px, 50vh);
  }

  #hero .marker,
  #hero .crop {
    display: none;
  }

  #hero .topic-bar {
    display: flex;
  }

  #hero .hero__scroll {
    display: none;
  }

  #hero .hero__copy.col-intro {
    text-align: center !important;
    align-items: center !important;
  }

  #hero .hero__copy.col-intro .eyebrow:not(.eyebrow--center) {
    justify-content: center !important;
  }

  #hero .hero__copy.col-intro .hero__kicker,
  #hero .hero__copy.col-intro .hero__ctas {
    justify-content: center !important;
    align-items: center !important;
  }
}
