/* ==========================================================================
   TRIONEX — hero-slider.css
   Full-screen WebGL slider (same layout as the Flux build): image fills the
   section, counter top-left, title + buttons bottom-left over a scrim,
   slide nav bottom-right, scroll cue centre.
   The rest of the site is light; only the hero keeps white-on-image text.
   Desktop banners are 1916×821, mobile banners are square (1254×1254) —
   js/hero-slider.js swaps between them at 768px.
   Requires: base.css, js/hero-slider.js (GSAP + Three.js)
   ========================================================================== */

.hero-slider {
  --hero-ink: #ffffff;
  --hero-ink-muted: rgba(255, 255, 255, 0.86);
  --hero-ink-light: rgba(255, 255, 255, 0.62);
  --hero-line: rgba(255, 255, 255, 0.32);

  position: relative;
  width: 100%;
  /* the header is fixed and solid, so the hero fills what's left of the screen */
  height: calc(100svh - var(--header-h) - var(--announce-h));
  min-height: 520px;
  max-height: 1000px;
  overflow: hidden;
  background: var(--color-brand-deep);
  color: var(--hero-ink);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.hero-slider.loaded { opacity: 1; }

.webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Non-WebGL crossfade layers (see initFallback in js/hero-slider.js) */
.hero-fallback {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-fallback__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: opacity, transform;
}

/* Readability scrim over the image — navy-tinted to match the brand. */
.hero-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 19, 49, 0.45) 0%, rgba(0, 19, 49, 0.12) 14%, rgba(0, 19, 49, 0) 26%),
    linear-gradient(to top, rgba(0, 19, 49, 0.92) 0%, rgba(0, 19, 49, 0.7) 22%, rgba(0, 19, 49, 0.3) 44%, rgba(0, 19, 49, 0) 66%),
    linear-gradient(to right, rgba(0, 19, 49, 0.45) 0%, rgba(0, 19, 49, 0) 55%);
}

/* --------------------------------------------------------------------------
   Counter
   -------------------------------------------------------------------------- */
.slide-number,
.slide-total {
  position: absolute;
  z-index: 3;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
  top: clamp(1.25rem, 4vh, 2.5rem);
}
.slide-number {
  left: var(--gutter);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  color: var(--hero-ink);
}
.slide-number::after {
  content: "";
  position: absolute;
  left: calc(100% + 0.55rem);
  top: 50%;
  width: clamp(18px, 2vw, 30px);
  height: 2px;
  background: var(--color-accent-light);
}
.slide-total {
  left: calc(var(--gutter) + clamp(18px, 2vw, 30px) + 3.4rem);
  font-size: 0.8125rem;
  color: var(--hero-ink-light);
  padding-top: 0.35em;
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.slide-content {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  bottom: clamp(3rem, 10vh, 6rem);
  max-width: min(680px, 56vw);
}
.slide-title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-4xl);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--hero-ink);
  text-shadow: 0 2px 24px rgba(0, 19, 49, 0.35);
  perspective: 800px;
  transform-style: preserve-3d;
}
.slide-title span { will-change: transform, opacity, filter; }

.slide-description {
  max-width: 48ch;
  font-size: var(--text-lg);
  color: var(--hero-ink-muted);
}

.slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
/* outline button reads white on the image */
.hero-slider .btn:not(.btn--primary) {
  --btn-fg: #ffffff;
  --btn-border: rgba(255, 255, 255, 0.55);
  --btn-bg: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-slider .btn:not(.btn--primary):hover { --btn-border: #ffffff; --btn-bg: rgba(255, 255, 255, 0.14); }

/* --------------------------------------------------------------------------
   Slide navigation
   -------------------------------------------------------------------------- */
.slides-navigation {
  position: absolute;
  z-index: 4;
  right: var(--gutter);
  bottom: clamp(3rem, 10vh, 6rem);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  width: clamp(160px, 16vw, 225px);
}
.slide-nav-item {
  text-align: left;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--dur-mid) var(--ease-out);
}
.slide-nav-item:hover { opacity: 0.85; }
.slide-nav-item.active { opacity: 1; }

.slide-progress-line {
  position: relative;
  width: 100%;
  height: 2px;
  background: var(--hero-line);
  overflow: hidden;
}
.slide-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--color-accent-light);
  opacity: 0;
  transition: width 0.1s linear, opacity var(--dur-mid) ease;
}
.slide-nav-title {
  margin-top: 0.55rem;
  font-family: var(--font-head);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--hero-ink-light);
  transition: color var(--dur-mid) var(--ease-out);
}
.slide-nav-item.active .slide-nav-title { color: var(--hero-ink); }

/* --------------------------------------------------------------------------
   Scroll cue
   -------------------------------------------------------------------------- */
.scroll-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  translate: -50% 0;
  bottom: var(--space-5);
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  font-family: var(--font-head);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--hero-ink-light);
}
.scroll-cue__rail {
  width: 1px;
  height: 42px;
  background: var(--hero-line);
  overflow: hidden;
}
.scroll-cue__rail::after {
  content: "";
  display: block;
  width: 100%;
  height: 40%;
  background: var(--color-accent-light);
  animation: scroll-cue 2.2s var(--ease-in-out) infinite;
}
@keyframes scroll-cue {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(250%); }
  100% { transform: translateY(250%); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .slide-content {
    right: var(--gutter);
    max-width: none;
    bottom: clamp(5rem, 12vh, 7rem);
  }
  .slides-navigation {
    left: var(--gutter);
    right: var(--gutter);
    bottom: clamp(1.75rem, 5vh, 2.5rem);
    width: auto;
    flex-direction: row;
    gap: var(--space-2);
  }
  .slide-nav-item { flex: 1; }
  .slide-nav-title { display: none; }
  .scroll-cue { display: none; }
}

@media (max-width: 768px) {
  /* square mobile banners; tall enough for the photo plus the copy */
  .hero-slider { height: auto; aspect-ratio: 4 / 5; min-height: 0; max-height: 86svh; }
  .slide-title { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .slide-description { font-size: var(--text-base); }
  .slide-content { bottom: clamp(3.75rem, 9vh, 4.5rem); }
  .slide-description { font-size: 0.875rem; line-height: 1.5; }
  .slide-actions { margin-top: var(--space-4); gap: var(--space-2); }
  .slide-actions .btn { flex: 1; padding: 0.8em 1em; font-size: 0.8125rem; }
  .slide-number, .slide-total { display: none; }
}
