/* =============================================================================
   Manufacturer Services — page-specific styles
   Scope: anything that belongs only to manufacturer-services.html.
   Foundation classes live in css/style.css — do not duplicate them here.
   ============================================================================= */

/* =============================================================================
   NAV — page-active indicator
   aria-current="page" is valid only on <a>, not <button>. Use a modifier class
   on the mega-menu trigger instead. Mirrors the foundation's
   .site-nav__link[aria-current="page"] color rule.
   ============================================================================= */
.site-nav__link--active { color: var(--c-accent) !important; }

/* =============================================================================
   HERO
   ============================================================================= */

/* Homepage-style hero: full-bleed background photo behind the content, with a
   legibility wash. Mirrors .hero--home in index.css (this page doesn't load it).
   Base .hero (style.css) supplies min-height + flex centering; .hero--dark
   supplies the dark fallback gradient + on-dark colors. */
.mfr-hero { color: var(--c-on-dark); }
.mfr-hero h1 { color: var(--c-on-dark); }
.mfr-hero .hero__eyebrow { color: var(--c-accent); }
.mfr-hero .hero__sub { color: var(--c-on-dark); }

.mfr-hero .hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.mfr-hero .hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mfr-hero .hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(7, 19, 35, 0.78) 0%,
    rgba(7, 19, 35, 0.50) 52%,
    rgba(7, 19, 35, 0.24) 100%);
}
.mfr-hero .hero__inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

/* =============================================================================
   SERVICES — card grid
   Foundation .card-grid + .card handles layout and surface.
   Per-card anchor IDs are in the HTML; no extra CSS needed.
   ============================================================================= */

/* Four service cards in a 2×2 grid (.card-grid--2 in the HTML). Equal row
   heights so all four tiles share the same width AND height. */
#services .card-grid {
  grid-auto-rows: 1fr;
}

/* Ensure card icons are accent-colored (foundation sets .card__icon color) */
.card__icon svg {
  width: 100%;
  height: 100%;
  color: var(--c-accent);
}

/* Even out the four lineup cards regardless of heading/paragraph length.
   Cards are equal-height (2×2 grid with grid-auto-rows:1fr); push the
   "Learn more" links to a shared bottom baseline across every breakpoint. */
#services .card .link-arrow {
  margin-top: auto;
}

/* =============================================================================
   PLAN TO LAUNCH — Gesture-stepped stepper
   One scroll gesture advances exactly one step.
   Engine: js/step-scroller.js · wiring: js/mfr-plan.js.
   Reduced-motion / no-JS fall back to a static stacked list (see bottom of
   this block — REQUIRED).
   ============================================================================= */

/* Section intro header */
.mfr-scrolly {
  padding-bottom: 0; /* stepper runs flush to the section below */
}

.mfr-scrolly__intro {
  padding-bottom: var(--sp-5);
  max-width: 640px;
}
.mfr-scrolly__intro .eyebrow { display: block; margin-bottom: var(--sp-2); }
.mfr-scrolly__intro h2 { margin-bottom: var(--sp-3); color: var(--c-on-dark); }
.mfr-scrolly__intro .lead { color: var(--c-on-dark-2); }

/* --- Stepper scaffold --- */
.mfr-stepper { position: relative; }

.mfr-stepper__stage {
  position: sticky;
  top: var(--nav-h);
  height: calc(100svh - var(--nav-h));
  /* clip (not hidden) keeps inner layers from spilling without making this a
     scroll container, which would break position: sticky */
  overflow: clip;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scroll runway — one block per step.
   Negative margin pulls the runway up over the stage's own flow box (one
   viewport tall) so step 0 begins exactly where the stage pins. Without it
   there is ~1svh of dead scroll before the engine engages. */
.mfr-stepper__track {
  margin-top: calc(-100svh + var(--nav-h));
  pointer-events: none;
}
.mfr-stepper__block { height: 100svh; }

/* Two-column layout inside the stage */
.mfr-stepper__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--sp-6);
  width: 100%;
}

/* --- Schematic visual (left column) ---
   All panels stack in one grid cell; only the active panel is opaque. */
.mfr-stepper__visual {
  display: grid;
  width: 100%;
  max-width: 560px;
}

.mfr-stepper__panel {
  grid-area: 1 / 1;
  align-self: center;
  /* Outgoing: snap to hidden so there's no bleed-through */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0ms, transform 0ms;
  pointer-events: none;
}

.mfr-stepper__panel.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  /* Incoming: time-based fade-in — always fully composed regardless of speed */
  transition:
    opacity   0.5s var(--ease-out),
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mfr-stepper__panel.is-passed {
  opacity: 0;
  transform: translateY(-12px);
}

/* Plan-to-Launch step graphics — Claude Design handover (static inline SVG).
   Self-contained: all colors live in the SVG attributes. We only supply the
   float drop-shadow and map the SVG's .mono/.sans font classes to our tokens
   (Space Grotesk + JetBrains Mono are already loaded in the page head). */
.mfr-step-graphic {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter:
    drop-shadow(0 22px 38px rgba(74, 155, 209, 0.18))
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}
.mfr-step-graphic .mono { font-family: var(--f-mono); }
.mfr-step-graphic .sans { font-family: var(--f-display); }

/* --- Step cards (right column) ---
   All cards share one grid cell so they stack; the column sizes to the
   tallest. Only the active card is opaque. */
.mfr-stepper__cards { display: grid; }

.mfr-stepper__card {
  grid-area: 1 / 1;
  align-self: center;
  max-width: 460px;
  padding: var(--sp-4) var(--sp-5);
  background: rgba(46, 163, 242, 0.06);
  border: 1px solid var(--c-line-dark);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-lg);
  display: grid;
  gap: var(--sp-2);
  /* Incoming frame: offset below, transparent */
  opacity: 0;
  transform: translateY(44px) scale(0.97);
  transition:
    opacity   0.5s ease,
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  pointer-events: none;
}

.mfr-stepper__card.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mfr-stepper__card.is-passed {
  opacity: 0;
  transform: translateY(-44px) scale(0.97);
}

.mfr-stepper__card h3 {
  color: var(--c-on-dark);
  font-size: var(--t-h3);
}

.mfr-stepper__card p {
  color: var(--c-on-dark-2);
}

/* Step number eyebrow */
.mfr-step-num {
  display: block;
  margin-bottom: var(--sp-1);
  color: var(--c-accent);
}

/* --- Static fallback: reduced motion AND no-JS ---
   step-scroller.js is inert under prefers-reduced-motion, so the CSS must
   stand in: unpin the stage, drop the runway, and unstack all content so
   every step is visible and legible. REQUIRED. */
@media (prefers-reduced-motion: reduce) {
  .mfr-stepper__stage {
    position: static;
    height: auto;
    overflow: visible;
  }
  .mfr-stepper__track { display: none; }
  .mfr-stepper__layout { align-items: start; }
  .mfr-stepper__visual { gap: var(--sp-3); }
  .mfr-stepper__panel,
  .mfr-stepper__panel.is-passed {
    grid-area: auto;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
  }
  .mfr-stepper__cards { gap: var(--sp-3); }
  .mfr-stepper__card,
  .mfr-stepper__card.is-passed {
    grid-area: auto;
    opacity: 1 !important;
    transform: none !important;
    max-width: 100%;
    pointer-events: auto;
  }
}

.no-js .mfr-stepper__stage {
  position: static;
  height: auto;
  overflow: visible;
}
.no-js .mfr-stepper__track { display: none; }
.no-js .mfr-stepper__layout { align-items: start; }
.no-js .mfr-stepper__visual { gap: var(--sp-3); }
.no-js .mfr-stepper__panel {
  grid-area: auto;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.no-js .mfr-stepper__cards { gap: var(--sp-3); }
.no-js .mfr-stepper__card {
  grid-area: auto;
  opacity: 1;
  transform: none;
  max-width: 100%;
  pointer-events: auto;
}

/* =============================================================================
   CROSS-LINK CARDS
   Foundation .cross-link and .cross-link__cards handle the grid.
   Add surface, radius, hover, and internal layout here.
   ============================================================================= */

.cross-link__head {
  margin-bottom: var(--sp-5);
}
.cross-link__head .eyebrow {
  display: block;
  margin-bottom: var(--sp-2);
}
.cross-link__head .cross-link__title {
  font-size: var(--t-h2);
}

.cross-link__card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--c-bg-alt);
  border-radius: var(--r-xl);
  text-decoration: none;
  color: var(--c-ink);
  transition:
    background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.cross-link__card:hover {
  background: #eef1f6;
  transform: translateY(-2px);
}
.cross-link__card:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

.cross-link__card-media {
  border-radius: var(--r-lg);
  overflow: hidden;
  /* Explicit dimensions reserved — zero CLS on asset swap */
  aspect-ratio: 3 / 2;
  width: 100%;
}
.cross-link__card-media .placeholder {
  /* placeholder already has aspect-ratio: 16/9 from inline style;
     override to match the card media slot */
  aspect-ratio: 3 / 2;
  border-radius: 0; /* parent clips */
}
.cross-link__card-media picture {
  display: block;
  width: 100%;
  height: 100%;
}
.cross-link__card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cross-link__card-body {
  display: grid;
  gap: var(--sp-2);
  padding-inline: var(--sp-1);
}
.cross-link__card-body .eyebrow {
  display: block;
}
.cross-link__card-body h3 {
  font-size: var(--t-h3);
  color: var(--c-ink);
}
.cross-link__card-body p {
  color: var(--c-ink-2);
  font-size: 1rem;
}
.cross-link__card-body .link-arrow {
  margin-top: var(--sp-1);
  justify-self: start;
}

/* =============================================================================
   CTA BAND — "Get in Touch"
   Light-gray (.section--alt) contact band hosting the same Talk-to-an-Engineer
   form as the home page. Foundation .cta-band + .cta-band__inner handle
   centering; the .cta-form rules below mirror the home page (defined in
   index.css) so the form is styled without loading index.css here.
   ============================================================================= */
#contact .eyebrow { display: block; margin-bottom: var(--sp-2); }

/* Light band: dark body text (overrides the dark .cta-band default) */
.cta-band.section--alt p { color: var(--c-ink-2); }

/* Contact form — custom-styled, submits to the HubSpot Forms API (js/forms.js). */
.cta-form {
  margin: var(--sp-5) auto 0;
  max-width: 540px;
  text-align: left;
}
.cta-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.cta-form__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cta-form__label {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-ink-2);
}
.cta-form input:not([type="checkbox"]) {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--c-ink);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  -webkit-appearance: none;
  appearance: none;
}
.cta-form input::placeholder { color: var(--c-ink-3); }
.cta-form input:not([type="checkbox"]):focus {
  outline: none;
  border-color: var(--c-accent-ink);
  box-shadow: 0 0 0 3px rgba(27, 118, 181, 0.16);
}
.cta-form__submit { width: 100%; }

/* "I am a…" business-type checkbox group */
.cta-form__group {
  border: 0;
  margin: 0 0 var(--sp-3);
  padding: 0;
}
.cta-form__group legend {
  margin-bottom: 9px;
  padding: 0;
}
.cta-form__check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--c-ink);
  cursor: pointer;
}
.cta-form__check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--c-accent-ink);
  cursor: pointer;
}
.cta-form__status {
  margin: var(--sp-3) 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}
.cta-form__status--ok { color: #1a7f37; font-weight: 600; }
.cta-form__status--error { color: #b42318; }
.cta-form__status a { color: inherit; }

@media (max-width: 560px) {
  .cta-form__row { grid-template-columns: 1fr; }
}

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

/* 1024px — tablet landscape: single column, hide schematic, keep cards */
@media (max-width: 1024px) {
  .mfr-stepper__layout {
    gap: var(--sp-4);
  }
}

/* 768px — mobile: single column, hide decorative diagram, full-width cards */
@media (max-width: 768px) {
  .mfr-stepper__layout {
    grid-template-columns: 1fr;
  }
  .mfr-stepper__visual {
    display: none; /* decorative — aria-hidden; drop at mobile */
  }
  .mfr-stepper__card {
    max-width: 100%;
    padding: var(--sp-4);
  }
  .cross-link__card {
    padding: var(--sp-2);
  }
}

/* 480px — small mobile */
@media (max-width: 480px) {
  .mfr-scrolly__intro h2 {
    font-size: var(--t-h2);
  }
  .cross-link__card-body h3 {
    font-size: var(--t-h3);
  }
}
