html,
body {
  background: var(--bg-primary);
}
.hero {
  position: relative;
  z-index: 10;
}
.hero,
.glass-section {
  font-family: "Satoshi", sans-serif;
}

.creative-svg {
  width: 100%;
  height: 100vh;
  display: block;
}

/* Section wrapper */
.glass-section {
  position: relative;
  /* ✨ Add this */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vw;
}

.glass-panel {
  position: relative;
  /* Already present — good */
}

.parallax-heading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  font-size: clamp(2rem, 6vw, 7rem);
  color: whitesmoke;
  pointer-events: none;
  mix-blend-mode: lighten;
  will-change: transform;
}

/* ===========================
   REMOVE GLASS FROM CREATIVE SVG
   =========================== */
.glass-panel:has(.creative-svg) {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

/* Text rendering */
text {
  letter-spacing: -0.02em;
  dominant-baseline: middle;
}

.glass-bg {
  position: relative;
  border-radius: 20px;

  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.04));

  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);

  border: 1px solid rgba(255, 255, 255, 0.18);

  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);

  overflow: hidden;

  /* 🔑 REQUIRED for blend modes */
  isolation: isolate;
}

.glass-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.12) 35%,
      rgba(255, 255, 255, 0.04) 60%,
      rgba(0, 0, 0, 0.18) 100%);

  opacity: 0.6;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: var(--text-colors--main);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

/* ============================================================
   Flex card hover slider — content-section navigation
   Replaces the legacy .list-parent tier list. Each slide is a
   real anchor; on hover (or keyboard focus) the active slide
   expands while its neighbours contract. The destination page's
   hero photo is wired via --slide-bg on each .flex-slide in
   index.html — greyscale at rest, full colour when active.
   Titles use Satoshi; no description per spec.
   ============================================================ */

.flex-container {
  display: flex;
  gap: 10px;
  width: min(100% - 4rem, 1400px);
  height: 88vh;
  min-height: 460px;
  max-height: 720px;
  margin: 0 auto;
}

.flex-slide {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  text-decoration: none;
  cursor: none;
  background-color: var(--bg--cards);
  transition: flex 0.5s ease;
  will-change: flex;
}

/* Photo layer — slow Ken Burns zoom/pan. Lives on ::before so it can
   transform independently of the title and overlays. Greyscale at rest,
   full colour when the slide is active. */
.flex-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--slide-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(100%) contrast(1.05);
  transform: scale(1.08);
  transform-origin: center;
  animation: kenBurns 24s ease-in-out infinite alternate;
  animation-play-state: paused;
  transition: filter 0.5s ease;
  will-change: transform;
  pointer-events: none;
}

/* Dark legibility wash + film grain in one layer above the photo. */
.flex-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url('/images/noise-min_1noise-min.avif') repeat 0 0 / 200px 200px,
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0.9;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

/* Stagger the pan so neighbouring slides don't drift in lockstep. */
.flex-slide:nth-child(odd)::before {
  animation-direction: alternate-reverse;
  animation-duration: 28s;
}
.flex-slide:nth-child(3n)::before {
  animation-delay: -8s;
}
.flex-slide:nth-child(3n + 2)::before {
  animation-delay: -16s;
}

@keyframes kenBurns {
  0%   { transform: scale(1.08) translate(0, 0); }
  100% { transform: scale(1.18) translate(-2.5%, -2%); }
}

/* Vertical at rest (rotated 90°), straightening to horizontal on hover —
   the signature move of this slider. Satoshi per brand. */
.flex-title {
  position: relative;
  z-index: 1;
  font-family: "Satoshi", sans-serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-colors--main);
  text-align: center;
  white-space: nowrap;
  transform: rotate(90deg);
  transition: transform 0.5s ease;
}

/* "You are here" badge on the current slide. */
.flex-tag {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 1;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--bg-primary);
  font-family: "Satoshi", sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Grow the hovered/focused slide; siblings shrink proportionally. */
.flex-slide:hover,
.flex-slide:focus-visible {
  flex-grow: 3;
}

/* Photo flips to full colour and the Ken Burns pan starts only while
   the slide is active — static otherwise. */
.flex-slide:hover::before,
.flex-slide:focus-visible::before {
  filter: grayscale(0%) contrast(1);
  animation-play-state: running;
}

/* Title straightens to horizontal as the slide opens. */
.flex-slide:hover .flex-title,
.flex-slide:focus-visible .flex-title {
  transform: rotate(0deg);
}

/* Lighten the wash on the active slide so the photo reads. */
.flex-slide:hover::after,
.flex-slide:focus-visible::after {
  opacity: 0.6;
}

.flex-slide:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

/* Home slide plays a one-time intro on desktop — it opens, the title
   straightens, then it settles back so visitors see the interaction. */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .flex-slide.is-current {
    animation: flexSlideIntro 3s ease 1;
  }
  .flex-slide.is-current .flex-title {
    animation: flexTitleIntro 3s ease 1;
  }
}

@keyframes flexSlideIntro {
  0%   { flex-grow: 1; }
  35%  { flex-grow: 3; }
  65%  { flex-grow: 3; }
  100% { flex-grow: 1; }
}

@keyframes flexTitleIntro {
  0%   { transform: rotate(90deg); }
  35%  { transform: rotate(0deg); }
  65%  { transform: rotate(0deg); }
  100% { transform: rotate(90deg); }
}

/* Mobile: stack into a column with all titles visible. */
@media (max-width: 768px) {
  .flex-container {
    flex-direction: column;
    width: calc(100% - 2rem);
    height: auto;
    min-height: 0;
    max-height: none;
    gap: 8px;
  }
  .flex-slide,
  .flex-slide:hover,
  .flex-slide:focus-visible {
    flex: 1 1 auto;
    height: 22vh;
    min-height: 130px;
  }
  .flex-slide::before {
    filter: grayscale(0%) contrast(1);
  }
  .flex-title,
  .flex-slide:hover .flex-title,
  .flex-slide:focus-visible .flex-title {
    transform: rotate(0deg);
  }
  .flex-slide::after {
    opacity: 0.65;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flex-slide,
  .flex-slide::before,
  .flex-title {
    transition: none;
    animation: none;
  }
  .flex-slide::before {
    transform: scale(1.02);
  }
}
