/* Styles for home/slider (app/sections/): the home page's hero.
   Every rule is scoped to .slider-section, so none of it reaches other
   parts of the page.

   The picture fills the screen from the very top (the header floats over
   it). Title, text and buttons sit at the bottom left, on the navy the
   picture fades into; the running order of the slides sits at the bottom
   right. On a phone the running order becomes a row of lines. */

.slider-section {
  --hero-ink: #060c22;
  --hero-navy: #001e53;
  --hero-gold: #f1ae22;
  --hero-gold-hi: #ffc94d;
  --hero-cream: #f3eee2;
  --hero-display: 'Fugaz One', Arial, sans-serif;
  --hero-sans: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --hero-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --hero-edge: clamp(20px, 6vw, 96px);

  position: relative;
  width: 100%;
  height: min(100svh, 920px);
  min-height: 640px;
  background: var(--hero-ink);
  color: var(--hero-cream);
  overflow: hidden;
}

.slider-section *,
.slider-section *::before,
.slider-section *::after {
  box-sizing: border-box;
}

.slider-section ::selection {
  background: var(--hero-gold);
  color: var(--hero-navy);
}

.slider-section .swiper,
.slider-section .swiper-slide {
  width: 100%;
  height: 100%;
}

.slider-section .swiper-slide {
  position: relative;
  overflow: hidden;
}

/* ---------- The picture ---------- */
.slider-section .slide-media {
  position: absolute;
  inset: 0;
}

.slider-section .slide-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.03);
  transition: transform 9s linear;
}

/* A slow push in while the slide is up */
.slider-section .swiper-slide-active .slide-media img {
  transform: scale(1.1);
}

/* Navy rising from the bottom (under the words), a little from the left,
   and a touch at the top so the header reads on a bright picture. */
.slider-section .slide-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(6, 12, 34, 0.96) 0%, rgba(6, 12, 34, 0.78) 24%, rgba(6, 12, 34, 0.28) 52%, rgba(6, 12, 34, 0) 70%),
    linear-gradient(to right, rgba(0, 30, 83, 0.6) 0%, rgba(0, 30, 83, 0) 62%),
    linear-gradient(to bottom, rgba(6, 12, 34, 0.6) 0%, rgba(6, 12, 34, 0) 24%);
}

/* ---------- The words ---------- */
.slider-section .slide-content {
  position: absolute;
  left: var(--hero-edge);
  bottom: clamp(44px, 8vh, 84px);
  z-index: 2;
  width: min(760px, calc(100% - var(--hero-edge) * 2 - 400px));
}

.slider-section .slide-title {
  margin: 0;
  font-family: var(--hero-display);
  font-size: clamp(2.5rem, 5.4vw, 5.25rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: 0;
  color: #fff;
  text-wrap: balance;
}

/* The clip that hides the title until it slides up. The padding (taken
   back by the negative margin) gives Fugaz One's slanted first letter and
   descenders (the g in "Stage") room, so they are not cut off. */
.slider-section .line {
  display: block;
  overflow: hidden;
  padding: 0.08em 0.14em 0.2em;
  margin: -0.08em -0.14em -0.2em;
}

.slider-section .line > span {
  display: block;
}

.slider-section .slide-text {
  max-width: 50ch;
  margin: 20px 0 0;
  font-family: var(--hero-sans);
  font-size: clamp(1rem, 1.25vw, 1.1875rem);
  font-weight: 400;
  line-height: 1.55;
  color: rgba(243, 238, 226, 0.92);
  text-wrap: pretty;
}

.slider-section .slide-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: 32px;
}

/* The one gold button: the website's call to action */
.slider-section .slide-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--hero-gold);
  color: var(--hero-navy);
  font-family: var(--hero-display);
  font-size: 1.0625rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(6, 12, 34, 0.45);
  transition: background-color 0.25s ease, transform 0.35s var(--hero-ease), box-shadow 0.25s ease;
}

.slider-section .slide-btn svg {
  transition: transform 0.35s var(--hero-ease);
}

.slider-section .slide-btn:hover {
  background: var(--hero-gold-hi);
  color: var(--hero-navy);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(6, 12, 34, 0.5);
}

.slider-section .slide-btn:hover svg {
  transform: translateX(4px);
}

.slider-section .slide-btn:active {
  transform: translateY(0);
}

.slider-section .slide-more {
  padding: 6px 0;
  font-family: var(--hero-sans);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--hero-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  transition: color 0.2s ease, text-underline-offset 0.2s ease;
}

.slider-section .slide-more:hover {
  color: var(--hero-gold-hi);
  text-underline-offset: 8px;
}

.slider-section a:focus-visible,
.slider-section button:focus-visible {
  outline: 2px solid var(--hero-gold-hi);
  outline-offset: 4px;
}

/* ---------- A slide coming up: the title rises, the rest follows ----------
   Only once the script is running (.is-ready); without it the first slide
   simply stands there. */
.slider-section.is-ready .line > span {
  transform: translateY(112%);
  transition: transform 1s var(--hero-ease);
}

.slider-section.is-ready .slide-text,
.slider-section.is-ready .slide-actions {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.9s var(--hero-ease);
}

.slider-section.is-ready .swiper-slide-active .line > span {
  transform: none;
  transition-delay: 0.25s;
}

.slider-section.is-ready .swiper-slide-active .slide-text {
  opacity: 1;
  transform: none;
  transition-delay: 0.5s;
}

.slider-section.is-ready .swiper-slide-active .slide-actions {
  opacity: 1;
  transform: none;
  transition-delay: 0.65s;
}

/* ---------- The running order ---------- */
.slider-section .slide-bill {
  position: absolute;
  /* clear of the chat button, which floats in the bottom right corner */
  right: calc(var(--hero-edge) + 56px);
  bottom: clamp(44px, 8vh, 84px);
  z-index: 3;
  display: grid;
  gap: 4px;
  width: 280px;
}

.slider-section .slide-cue {
  display: block;
  width: 100%;
  padding: 10px 0 8px;
  border: 0;
  background: none;
  color: rgba(243, 238, 226, 0.72);
  font-family: var(--hero-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: color 0.25s ease;
}

.slider-section .slide-cue:hover {
  color: #fff;
}

.slider-section .slide-cue.is-on {
  color: #fff;
  font-weight: 600;
}

.slider-section .slide-cue-bar {
  display: block;
  height: 2px;
  margin-bottom: 10px;
  background: rgba(243, 238, 226, 0.26);
  overflow: hidden;
}

/* Fills while its slide is on screen. A CSS animation, run by the browser's
   compositor: home-slider.js only starts it (.is-running), pauses it with
   the autoplay (.is-paused on the hero) and marks it full when there is no
   autoplay (.is-full). It used to be redrawn from JavaScript every frame,
   which kept phones busy while the page scrolled past the hero. */
.slider-section .slide-cue-bar > span {
  display: block;
  height: 100%;
  background: var(--hero-gold);
  transform: scaleX(0);
  transform-origin: left;
}

.slider-section .slide-cue.is-running .slide-cue-bar > span {
  animation: slide-cue-fill var(--cue-time, 6000ms) linear forwards;
}

.slider-section.is-paused .slide-cue.is-running .slide-cue-bar > span {
  animation-play-state: paused;
}

.slider-section .slide-cue.is-full .slide-cue-bar > span {
  transform: scaleX(1);
}

@keyframes slide-cue-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.slider-section .slide-cue-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Narrower screens: the running order is a row of lines ---------- */
@media (max-width: 1023px) {
  .slider-section {
    height: min(92svh, 860px);
    min-height: 600px;
  }

  .slider-section .slide-content {
    bottom: 76px;
    width: min(680px, calc(100% - var(--hero-edge) * 2));
  }

  .slider-section .slide-bill {
    left: var(--hero-edge);
    right: var(--hero-edge);
    bottom: 18px;
    width: auto;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 8px;
  }

  /* A taller target than the line itself */
  .slider-section .slide-cue {
    padding: 18px 0;
  }

  .slider-section .slide-cue-bar {
    height: 3px;
    margin: 0;
    border-radius: 2px;
  }

  .slider-section .slide-cue-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (max-width: 600px) {
  .slider-section {
    height: 88svh;
    min-height: 560px;
  }

  .slider-section .slide-title {
    font-size: clamp(2.125rem, 10.5vw, 3rem);
  }

  .slider-section .slide-text {
    margin-top: 14px;
  }

  .slider-section .slide-actions {
    margin-top: 24px;
  }

  .slider-section .slide-btn {
    min-height: 50px;
    padding: 0 24px;
    font-size: 1rem;
  }

  .slider-section .slide-media::after {
    background:
      linear-gradient(to top, rgba(6, 12, 34, 0.97) 0%, rgba(6, 12, 34, 0.85) 34%, rgba(6, 12, 34, 0.3) 62%, rgba(6, 12, 34, 0) 78%),
      linear-gradient(to bottom, rgba(6, 12, 34, 0.6) 0%, rgba(6, 12, 34, 0) 26%);
  }
}

/* A phone on its side: no room for a tall hero */
@media (max-height: 520px) and (orientation: landscape) {
  .slider-section {
    height: 100svh;
    min-height: 360px;
  }

  .slider-section .slide-title {
    font-size: clamp(1.75rem, 6vh, 2.5rem);
  }

  .slider-section .slide-text {
    display: none;
  }

  .slider-section .slide-actions {
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slider-section *,
  .slider-section *::before,
  .slider-section *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .slider-section .slide-media img,
  .slider-section .swiper-slide-active .slide-media img {
    transform: none;
  }
}
