/* ==========================================================================
   Alliance Test Equipment — Homepage hero
   A 45/55 editorial composition: premium typography against a single
   illuminated instrument grouping. Luxury engineering, not ecommerce.
   ========================================================================== */

.hero {
  position: relative;
  min-height: 760px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #060B14;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
@media (max-width: 1180px) { .hero { min-height: 720px; } }

/* ---------------------------------------------------------- Background ---- */
.hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; will-change: opacity; }

/* Fine engineering grid — sits just above the ground, fades at the edges */
.hero__grid {
  position: absolute;
  inset: -2%;
  translate: var(--px, 0) var(--py, 0);
  background-image:
    linear-gradient(to right, rgba(255,255,255,.038) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.038) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 92% 78% at 62% 48%, #000 12%, transparent 76%);
  mask-image: radial-gradient(ellipse 92% 78% at 62% 48%, #000 12%, transparent 76%);
  opacity: 0;
  animation: heroGridIn 1100ms var(--ease-out) 180ms forwards;
  will-change: transform;
}
@keyframes heroGridIn { to { opacity: 1; } }

.hero__waves,
.hero__rules {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.hero__waves { opacity: 0; animation: heroFade 1400ms var(--ease-out) 320ms forwards; }
.hero__rules {
  opacity: 0;
  animation: heroFade 1400ms var(--ease-out) 480ms forwards;
  translate: var(--px, 0) var(--py, 0);
}
@keyframes heroFade { to { opacity: .55; } }

/* The single soft light source behind the flagship instrument */
.hero__glow {
  position: absolute;
  top: 46%; left: 68%;
  width: 62vw; height: 62vw;
  max-width: 900px; max-height: 900px;
  transform: translate(-50%, -50%) scale(.9);
  background: radial-gradient(circle,
    rgba(24,104,176,.30) 0%,
    rgba(14,64,112,.16) 34%,
    rgba(6,11,20,0) 68%);
  opacity: 0;
  animation: heroGlowIn 1500ms var(--ease-out) 120ms forwards;
}
@keyframes heroGlowIn { to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@media (max-width: 980px) { .hero__glow { top: 62%; left: 50%; } }

/* ---------------------------------------------------- Drifting model IDs --
   Real model numbers from the catalog crossing the background very slowly,
   like a telemetry readout. Atmosphere only — it must never compete with the
   headline, so it is kept faint and masked away from the copy column. */
.hero__drift {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  animation: heroDriftIn 1800ms var(--ease-out) 900ms forwards;
  /* Kept clear of the copy column so it never competes with the headline */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 44%, #000 56%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 44%, #000 56%, #000 90%, transparent 100%);
}
@keyframes heroDriftIn { to { opacity: 1; } }

.hero__drift-row {
  position: absolute;
  left: 0;
  display: flex;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,255,255,.045);
  animation: heroDrift var(--dur, 90s) linear var(--delay, 0s) infinite;
  will-change: transform;
}
.hero__drift-row.is-reverse { animation-name: heroDriftRev; color: rgba(0,150,255,.05); }
.hero__drift-row span { padding-right: 3rem; }

@keyframes heroDrift    { from { transform: translateX(0); }     to { transform: translateX(-50%); } }
@keyframes heroDriftRev { from { transform: translateX(-50%); }  to { transform: translateX(0); } }

@media (max-width: 980px) { .hero__drift { display: none; } }

/* ------------------------------------------------------------- Layout ---- */
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 3vw, 4.5rem);
  padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
}

@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--sp-6); padding-block: var(--sp-7); }
}
@media (max-width: 640px) {
  .hero { min-height: 0; }
  .hero__title { font-size: clamp(1.85rem, 1.1rem + 4.2vw, 2.6rem); }
  .hero__cta { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
  .hero__cta .btn { width: 100%; }
  .hero__link { justify-content: flex-start; margin-top: var(--sp-1); }
  /* The example model numbers scroll rather than forcing the page wide */
  .hero-search__examples {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .hero-search__examples::-webkit-scrollbar { display: none; }
  .hero-search__examples > * { flex: none; }
}

/* --------------------------------------------------------------- Copy ---- */
.hero__copy { max-width: 620px; min-width: 0; }

/* Nothing inside the hero may force the page wider than the viewport.
   `.hero__inner` also carries `.container`, so its max-width is left alone —
   overriding it here would defeat the centred measure. */
.hero, .hero__stage { max-width: 100%; min-width: 0; }
.hero__inner > * { min-width: 0; }

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: .85em;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--steel-400);
  margin-bottom: clamp(1rem, .8rem + .8vw, 1.5rem);
  opacity: 0;
  animation: heroUp 700ms var(--ease-out) 620ms forwards;
}
.hero__eyebrow-sep { width: 26px; height: 1px; background: var(--brand-accent); opacity: .8; }

/* Editorial headline — line-by-line reveal behind a mask */
.hero__title {
  font-size: clamp(1.95rem, .8rem + 2.85vw, 3.75rem);
  font-weight: 650;
  line-height: 1.0;
  letter-spacing: -.035em;
  margin-bottom: clamp(1.1rem, .9rem + .8vw, 1.6rem);
}
.hero__line { display: block; overflow: hidden; padding-bottom: .04em; }
/* The opening lines sit back tonally so the payoff line lands hardest */
.hero__line:nth-child(1) > span,
.hero__line:nth-child(2) > span { color: rgba(255,255,255,.80); }
.hero__line--em > span { color: #fff; }
.hero__line > span {
  display: block;
  transform: translateY(108%);
  animation: heroLineUp 1000ms var(--ease-out) forwards;
}
.hero__line:nth-child(1) > span { animation-delay: 640ms; }
.hero__line:nth-child(2) > span { animation-delay: 760ms; }
.hero__line:nth-child(3) > span { animation-delay: 880ms; }
@keyframes heroLineUp {
  from { transform: translateY(108%); filter: blur(5px); }
  to   { transform: none; filter: blur(0); }
}

/* The emphasis line carries the accent as a measurement rule */
.hero__line--em > span { position: relative; display: inline-block; padding-bottom: .1em; }
/* The rule reads as a measurement baseline drawn under the claim */
.hero__line--em > span::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-accent) 0%, var(--brand-accent) 62%, rgba(228,120,36,.35) 100%);
  transform: scaleX(0);
  transform-origin: left;
  animation: heroRule 1100ms var(--ease-out) 1450ms forwards;
}
@keyframes heroRule { to { transform: scaleX(1); } }

/* A single slow highlight sweeping the rule — one pass, then still */
.hero__line--em > span::before {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 90px; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  opacity: 0;
  animation: heroSweep 1600ms var(--ease) 2500ms 1 forwards;
}
@keyframes heroSweep {
  0%   { opacity: 0; transform: translateX(0); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(calc(100% + 380px)); }
}

.hero__sub {
  font-size: clamp(1rem, .95rem + .3vw, 1.1rem);
  line-height: 1.62;
  color: var(--steel-300);
  max-width: 500px;
  width: 100%;
  margin-bottom: clamp(1.35rem, 1.1rem + .9vw, 1.9rem);
  opacity: 0;
  animation: heroUp 800ms var(--ease-out) 1180ms forwards;
}

.hero__cta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  opacity: 0;
  animation: heroUp 800ms var(--ease-out) 1320ms forwards;
}
.hero__btn {
  height: 52px;
  padding-inline: 1.9rem;
  border-radius: 3px;
  font-size: .9375rem;
  font-weight: 570;
  letter-spacing: .002em;
}
.hero__link {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-size: var(--fs-sm);
  font-weight: 540;
  color: var(--steel-300);
  position: relative;
  transition: color var(--t) var(--ease);
}
.hero__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t) var(--ease);
}
.hero__link:hover { color: #fff; }
.hero__link:hover::after { transform: scaleX(1); transform-origin: left; }
.hero__link .arrow { transition: transform var(--t) var(--ease); }
.hero__link:hover .arrow { transform: translateX(3px); }

/* ------------------------------------------------------------- Search ---- */
.hero-search {
  margin-top: clamp(1.35rem, 1.1rem + .9vw, 1.9rem);
  max-width: 460px;
  width: 100%;
  opacity: 0;
  animation: heroUp 800ms var(--ease-out) 1460ms forwards;
}
.hero-search__field {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: .82rem 1rem;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 3px;
  color: var(--steel-400);
  text-align: left;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease),
              box-shadow var(--t) var(--ease);
}
.hero-search__field:hover,
.hero-search__field:focus-visible {
  border-color: rgba(228,120,36,.55);
  background: rgba(255,255,255,.055);
  box-shadow: 0 0 0 3px rgba(228,120,36,.10);
  outline: none;
}
.hero-search__field > svg { flex: none; opacity: .65; }
.hero-search__placeholder { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-search__key {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--steel-500);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 2px;
  padding: .18rem .4rem;
}
@media (max-width: 620px) { .hero-search__key { display: none; } }

.hero-search__examples {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--steel-500);
}
.hero-search__examples button {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--steel-400);
  transition: color var(--t-fast) var(--ease);
  position: relative;
}
.hero-search__examples button::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: currentColor; opacity: .3;
  transition: opacity var(--t-fast) var(--ease);
}
.hero-search__examples button:hover { color: #fff; }
.hero-search__examples button:hover::after { opacity: 1; }

/* -------------------------------------------------------------- Stage ---- */
.hero__stage {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 980px) { .hero__stage { min-height: 330px; } }
@media (max-width: 560px) { .hero__stage { min-height: 260px; } }

.hero__stage-inner {
  position: relative;
  will-change: transform;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 4 / 3;
}
@media (max-width: 980px) { .hero__stage-inner { aspect-ratio: 16 / 10; max-width: 560px; } }

/* --------------------------------------------------------- Showcase ---- */
/* One instrument holds the stage at a time and hands over to the next.
   Each is a real listing; the caption links straight through to it. */
.hero__showcase { position: absolute; inset: 0 0 62px; z-index: 2; }
@media (max-width: 560px) { .hero__showcase { inset: 0 0 52px; } }

.hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* `contain` keeps every instrument inside the stage regardless of its own
     aspect ratio, so tall meters and wide mainframes both sit correctly. */
  object-fit: contain;
  object-position: center 44%;
  opacity: 0;
  /* Enters from slightly back and below, leaves forward and up */
  transform: scale(.94) translateY(18px);
  filter: drop-shadow(0 34px 50px rgba(0,0,0,.62)) drop-shadow(0 4px 12px rgba(0,0,0,.45));
  transition: opacity 620ms var(--ease-out), transform 800ms var(--ease-out);
  pointer-events: none;
  will-change: transform, opacity;
}
.hero__slide.is-active {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: heroFloat 11s ease-in-out .8s infinite;
}
.hero__slide.is-leaving {
  opacity: 0;
  transform: scale(1.03) translateY(-16px);
}
/* A very slow drift so the instrument feels alive, never restless */
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1); }
}

/* A soft ground reflection so the instrument sits on a surface, not in a void */
.hero__reflection {
  position: absolute;
  left: 14%; right: 14%;
  bottom: 12%;
  height: 44px;
  background: radial-gradient(ellipse at center, rgba(90,150,210,.22), transparent 72%);
  filter: blur(15px);
  opacity: 0;
  z-index: 1;
  animation: heroFadeIn 1400ms var(--ease-out) 700ms forwards;
}
@keyframes heroFadeIn { to { opacity: 1; } }

/* ---------------------------------------------------------- Caption ---- */
.hero__caption {
  position: absolute;
  left: 0; bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: .85rem 1rem .85rem 1.05rem;
  background: rgba(6,11,20,.66);
  border: 1px solid rgba(255,255,255,.10);
  border-left: 2px solid var(--brand-accent);
  border-radius: 2px;
  backdrop-filter: blur(6px);
  max-width: 78%;
  opacity: 0;
  animation: heroUp 800ms var(--ease-out) 1700ms forwards;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.hero__caption:hover { background: rgba(6,11,20,.8); border-color: rgba(255,255,255,.2); border-left-color: var(--brand-accent); }
.hero__caption-mfr {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--steel-400);
}
.hero__caption-model {
  font-size: 1.05rem;
  font-weight: 620;
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1.2;
}
.hero__caption-tag {
  font-size: var(--fs-xs);
  color: var(--steel-400);
  line-height: 1.4;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero__caption-cta {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin-top: .35rem;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-accent);
}
.hero__caption-cta svg { transition: transform var(--t) var(--ease); }
.hero__caption:hover .hero__caption-cta svg { transform: translateX(3px); }
@media (max-width: 640px) {
  .hero__caption { position: static; max-width: 100%; padding: .7rem .8rem; margin-top: var(--sp-3); }
  .hero__caption-tag { display: none; }
  .hero__showcase { position: relative; inset: auto; height: 240px; }
  .hero__stage-inner { aspect-ratio: auto; }
  .hero__dots { position: static; margin-top: var(--sp-3); justify-content: flex-start; }
  .hero__reflection { bottom: 26%; }
  .hero__tag--spec { top: 0; padding: .45rem .6rem; }
}

/* ------------------------------------------------------------ Dots ---- */
.hero__dots {
  position: absolute;
  right: 0; bottom: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  opacity: 0;
  animation: heroUp 800ms var(--ease-out) 1800ms forwards;
}
.hero__dot {
  position: relative;
  width: 30px; height: 3px;
  background: rgba(255,255,255,.16);
  border-radius: 0;
  overflow: hidden;
  transition: background var(--t) var(--ease);
}
.hero__dot:hover { background: rgba(255,255,255,.3); }
/* The fill doubles as a progress readout for the current slide */
.hero__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand-accent);
  transform: scaleX(0);
  transform-origin: left;
}
.hero__dot.is-active::after { animation: heroDot var(--hero-dwell, 5200ms) linear forwards; }
@keyframes heroDot { to { transform: scaleX(1); } }
@media (max-width: 560px) { .hero__dot { width: 22px; } }

/* --------------------------------------------------- Technical labels ---- */
.hero__tag {
  position: absolute;
  z-index: 4;
  translate: var(--px, 0) var(--py, 0);
  transition: translate 240ms var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: .6rem .85rem;
  background: rgba(6,11,20,.62);
  border: 1px solid rgba(255,255,255,.10);
  border-left: 2px solid var(--brand-accent);
  border-radius: 2px;
  backdrop-filter: blur(4px);
  opacity: 0;
  animation: heroUp 800ms var(--ease-out) 1620ms forwards;
  white-space: nowrap;
}
.hero__tag--spec { left: 0; top: 6%; }
.hero__tag--years { right: 2%; bottom: 12%; animation-delay: 1740ms; }
@media (max-width: 560px) {
  .hero__tag--spec { top: 0; padding: .45rem .6rem; }
  .hero__tag--years { display: none; }
}
.hero__tag-k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
}
.hero__tag-v {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--steel-500);
}
.hero__tag-n {
  font-size: 1.35rem;
  font-weight: 660;
  letter-spacing: -.03em;
  line-height: 1;
  color: #fff;
}
.hero__tag-n sup { color: var(--brand-accent); font-size: .55em; top: -.5em; }

/* ------------------------------------------------------- Bottom strip ---- */
.hero-strip {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255,255,255,.09);
  opacity: 0;
  animation: heroUp 800ms var(--ease-out) 1560ms forwards;
}
.hero-strip__inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 860px) { .hero-strip__inner { grid-template-columns: repeat(2, 1fr); } }

.hero-strip__item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1.35rem 1.5rem 1.35rem 0;
  border-right: 1px solid rgba(255,255,255,.09);
  transition: background var(--t) var(--ease);
  position: relative;
}
@media (min-width: 861px) {
  .hero-strip__item + .hero-strip__item { padding-left: 1.5rem; }
  .hero-strip__item:last-child { border-right: 0; }
}
@media (max-width: 860px) {
  .hero-strip__item { padding: 1.1rem 1rem 1.1rem 0; border-bottom: 1px solid rgba(255,255,255,.09); }
  .hero-strip__item:nth-child(2n) { border-right: 0; padding-left: 1rem; }
  .hero-strip__item:nth-last-child(-n+2) { border-bottom: 0; }
}
.hero-strip__item::before {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 0; height: 1px;
  background: var(--brand-accent);
  transition: width var(--t-slow) var(--ease-out);
}
.hero-strip__item:hover::before { width: 100%; }

.hero-strip__n {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--steel-500);
  transition: color var(--t) var(--ease), transform var(--t) var(--ease);
  flex: none;
}
.hero-strip__item:hover .hero-strip__n { color: var(--brand-accent); transform: translateY(-1px); }
.hero-strip__label {
  font-size: var(--fs-sm);
  font-weight: 540;
  color: var(--steel-300);
  transition: color var(--t) var(--ease);
  flex: 1;
  min-width: 0;
}
.hero-strip__item:hover .hero-strip__label { color: #fff; }
.hero-strip__item svg {
  flex: none;
  color: var(--steel-500);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), color var(--t) var(--ease);
}
.hero-strip__item:hover svg { opacity: 1; transform: none; color: var(--brand-accent); }
.hero-strip__item--cta .hero-strip__label { color: #fff; font-weight: 570; }

/* ------------------------------------------------------ Shared keyframe -- */
@keyframes heroUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .hero__grid, .hero__waves, .hero__rules, .hero__glow, .hero__reflection,
  .hero__eyebrow, .hero__sub, .hero__cta, .hero-search, .hero-strip, .hero__tag {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero__waves, .hero__rules { opacity: .55 !important; }
  .hero__line > span { animation: none !important; transform: none !important; filter: none !important; }
  .hero__line--em > span::after { animation: none !important; transform: scaleX(1) !important; }
  .hero__line--em > span::before { animation: none !important; opacity: 0 !important; }
  .hero__drift { display: none !important; }
  .hero__slide { animation: none !important; }
  .hero__slide.is-active { transform: none !important; }
  .hero__caption, .hero__dots { animation: none !important; opacity: 1 !important; }
  .hero__dot.is-active::after { animation: none !important; transform: scaleX(1) !important; }
}
