/* Nexa Bath - cinematic scroll layer */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 2000;
  background: linear-gradient(90deg, var(--teal-glow), var(--copper-soft));
  transform-origin: left center;
  pointer-events: none;
}

/* --- Suite tour (scroll through the luxury bath) --- */
.suite-tour {
  position: relative;
  background: #070c10;
}

.suite-sticky {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  color: #fff;
}

.suite-stage {
  position: absolute;
  inset: 0;
}

.suite-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.suite-frame.is-active {
  opacity: 1;
  z-index: 1;
}

.suite-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08);
  will-change: transform, object-position;
}

.suite-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 12, 16, 0.72) 0%, rgba(7, 12, 16, 0.2) 45%, rgba(7, 12, 16, 0.35) 100%),
    linear-gradient(180deg, rgba(7, 12, 16, 0.25) 0%, transparent 35%, rgba(7, 12, 16, 0.55) 100%);
}

.suite-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 2rem clamp(1.15rem, 4vw, 3rem) 2.75rem;
  max-width: 32rem;
}

.suite-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9fd0d4;
  font-weight: 700;
}

.suite-title {
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: #fff;
  letter-spacing: -0.035em;
}

.suite-copy {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 28rem;
}

.suite-dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.45rem;
}

.suite-dots li {
  width: 1.65rem;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}

.suite-dots li.is-active {
  width: 2.4rem;
  background: #fff;
}

.suite-hint {
  display: none;
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 767px) {
  .suite-hint {
    display: block;
  }
}

/* --- Product orbit (Apple-style fittings turntable) --- */
.product-orbit {
  position: relative;
  background: #0a0f13;
}

.orbit-sticky {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  color: #fff;
  display: grid;
  align-items: end;
}

.orbit-ambient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 480px at 50% 35%, rgba(58, 154, 163, 0.16), transparent 60%),
    radial-gradient(700px 420px at 70% 70%, rgba(181, 122, 74, 0.1), transparent 55%),
    linear-gradient(180deg, #0a0f13 0%, #111820 50%, #0a0f13 100%);
  pointer-events: none;
}

.orbit-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 1400px;
  z-index: 1;
  padding-bottom: 18vh;
}

.orbit-turntable {
  position: relative;
  width: min(92vw, 920px);
  aspect-ratio: 16 / 10;
  transform-style: preserve-3d;
}

.orbit-item {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: rotateY(-28deg) scale(0.92);
  filter: blur(8px);
  transition: opacity 0.45s var(--ease), filter 0.45s var(--ease);
  will-change: transform, opacity, filter;
}

.orbit-item.is-active {
  opacity: 1;
  filter: blur(0);
  z-index: 2;
}

.orbit-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.25rem;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.orbit-copy {
  position: relative;
  z-index: 3;
  padding: 0 clamp(1.15rem, 4vw, 3rem) 2.5rem;
  max-width: 34rem;
  text-align: left;
}

.orbit-copy .eyebrow {
  color: #9fd0d4;
}

.orbit-copy h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(2rem, 5vw, 3.1rem);
  color: #fff;
}

.orbit-copy p {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
}

.orbit-link {
  display: inline-flex;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 0.15rem;
}

.orbit-link:hover {
  color: #9fd0d4;
  border-bottom-color: #9fd0d4;
}

.orbit-progress {
  position: absolute;
  left: clamp(1.15rem, 4vw, 3rem);
  right: clamp(1.15rem, 4vw, 3rem);
  bottom: 1.15rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
  z-index: 3;
}

.orbit-progress span {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--teal-glow), var(--copper-soft));
}

.orbit-mobile-list {
  display: none;
}

/* Craft chapter */
.craft-pin {
  position: relative;
  background: var(--paper);
}

.craft-sticky {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0;
  overflow: hidden;
}

.craft-intro {
  padding: 0 clamp(1rem, 4vw, 3rem);
  max-width: 40rem;
  margin-bottom: 2rem;
}

.craft-steps {
  list-style: none;
  margin: 0;
  padding: 0 clamp(1rem, 4vw, 3rem);
  display: grid;
  gap: 1rem;
}

.craft-step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: 0.25rem;
  padding: 1.15rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  opacity: 0.42;
  transform: translateY(12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.craft-step.is-active {
  opacity: 1;
  transform: none;
  border-color: rgba(31, 111, 120, 0.35);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(21, 32, 40, 0.08);
}

.craft-num {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--teal);
  letter-spacing: -0.03em;
}

.craft-step h3 {
  margin: 0;
  font-size: 1.2rem;
}

.craft-step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  grid-column: 2;
}

.craft-progress {
  margin: 2rem clamp(1rem, 4vw, 3rem) 0;
  height: 2px;
  background: rgba(21, 32, 40, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.craft-progress span {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--teal), var(--copper-soft));
  transform-origin: left center;
}

@media (min-width: 900px) {
  .craft-steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .craft-step {
    grid-template-columns: 1fr;
    min-height: 14rem;
  }

  .craft-num {
    grid-row: auto;
    margin-bottom: 0.75rem;
  }

  .craft-step p {
    grid-column: auto;
  }
}

/* Finish split */
.finish-split {
  display: grid;
  min-height: 100svh;
}

.finish-panel {
  position: relative;
  min-height: 55svh;
  overflow: hidden;
  color: #fff;
}

.finish-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  will-change: transform;
}

.finish-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 14, 18, 0.15), rgba(8, 14, 18, 0.72));
}

.finish-caption {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 55svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
  max-width: 28rem;
}

.finish-caption .eyebrow {
  color: #9fd0d4;
}

.finish-caption h2 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 0 0 0.65rem;
  color: #fff;
}

.finish-caption p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

@media (min-width: 900px) {
  .finish-split {
    grid-template-columns: 1fr 1fr;
  }

  .finish-panel {
    min-height: 100svh;
  }

  .finish-caption {
    min-height: 100svh;
  }
}

/* Measure stage */
.measure-stage {
  padding: 5.5rem 0;
  background: #0f171c;
  color: #fff;
}

.measure-stage .eyebrow {
  color: #8fd0d6;
}

.measure-title {
  color: #fff;
  max-width: 18ch;
  margin-bottom: 2.5rem;
}

.measure-grid {
  display: grid;
  gap: 1rem;
}

.measure-card {
  padding: 1.5rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
}

.measure-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.55rem;
  color: #fff;
}

.measure-card span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.98rem;
}

@media (min-width: 768px) {
  .measure-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

/* Quote stage */
.quote-stage {
  position: relative;
  background: var(--mist);
}

.quote-sticky {
  min-height: 70svh;
  display: grid;
  place-items: center;
  padding: 4rem 1.25rem;
}

.quote-sticky blockquote {
  margin: 0;
  max-width: 38rem;
  text-align: center;
}

.quote-sticky p {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.2vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 1.25rem;
}

.quote-sticky footer {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
}

/* Optional horizontal rails (not cinema-pinned) */
.rail-section {
  position: relative;
  background: var(--paper);
  padding: 0 0 1rem;
}

.rail-header {
  padding: 4.5rem 0 1rem;
}

.rail-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rail-section {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.rail-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  padding-bottom: 2.5rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 32, 40, 0.25) transparent;
}

.rail-viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.rail-viewport::-webkit-scrollbar {
  height: 6px;
}

.rail-viewport::-webkit-scrollbar-thumb {
  background: rgba(21, 32, 40, 0.22);
  border-radius: 99px;
}

.rail-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  padding: 0.5rem calc((100vw - min(1120px, 100vw - 2rem)) / 2 + 1rem) 0.75rem;
}

.rail-card {
  flex: 0 0 min(78vw, 380px);
  text-decoration: none;
  color: inherit;
  background: var(--foam);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(21, 32, 40, 0.08);
  scroll-snap-align: start;
}

.rail-card .tile-media {
  aspect-ratio: 1 / 1;
  min-height: 260px;
}

.rail-card .tile-body {
  border-top: 1px solid var(--line);
}

@media (min-width: 768px) {
  .rail-card {
    flex-basis: 360px;
  }
}

/* Optional lookbook strip (not cinema-pinned) */
.film-section {
  position: relative;
  background: #10181d;
  color: #fff;
  padding: 4.5rem 0 3rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.film-sticky {
  position: relative;
  height: auto;
  min-height: 0;
  overflow: hidden;
  display: block;
  width: 100%;
  max-width: 100%;
}

.film-intro {
  padding: 0 clamp(1rem, 4vw, 3rem) 1.25rem;
  max-width: 40rem;
}

.film-intro .eyebrow {
  color: #8fd0d6;
}

.film-intro h2 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.film-intro p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.film-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.film-viewport {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
  padding-bottom: 0.35rem;
  touch-action: pan-x pan-y;
  cursor: grab;
}

.film-viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.film-viewport::-webkit-scrollbar {
  height: 6px;
}

.film-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
}

.film-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  max-width: none;
  padding: 0.25rem clamp(1rem, 4vw, 3rem) 0.75rem;
  margin: 0;
}

.film-track figure {
  margin: 0;
  width: min(70vw, 360px);
  aspect-ratio: 4 / 5;
  border-radius: 1.1rem;
  overflow: hidden;
  background: #1a2429;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.film-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Promise scale stage */
.promise-stage {
  position: relative;
  padding: 6rem 0;
  overflow: hidden;
}

.promise-glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 680px;
  max-height: 680px;
  border-radius: 50%;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(58, 154, 163, 0.18), transparent 65%);
  pointer-events: none;
  will-change: transform, opacity;
}

/* Soft connect between sections */
.section-bridge {
  height: 14vh;
  position: relative;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #0a1216, #0d161b);
}

.section-bridge span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--teal-glow), transparent);
  transform: translateX(-50%);
}

/* Hero cinema upgrades */
.hero-media img,
.hero-dock {
  will-change: transform, opacity;
}

/* --- Mobile cinema (pinned tour + orbit, touch-friendly) --- */
@media (max-width: 767px) {
  .suite-sticky {
    height: 100svh;
    min-height: 100svh;
  }

  .suite-stage {
    position: absolute;
    inset: 0;
    display: block;
  }

  .suite-frame {
    position: absolute;
    inset: 0;
    height: auto;
    opacity: 0;
  }

  .suite-frame.is-active {
    opacity: 1;
  }

  .suite-frame img {
    transform: scale(1.08);
  }

  .suite-veil {
    display: block;
    background:
      linear-gradient(180deg, rgba(7, 12, 16, 0.2) 0%, transparent 35%, rgba(7, 12, 16, 0.78) 100%),
      linear-gradient(90deg, rgba(7, 12, 16, 0.45) 0%, transparent 55%);
  }

  .suite-hud {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    padding: 1.25rem 1.15rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
    background: transparent;
  }

  .suite-title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .suite-copy {
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
  }

  .suite-hint {
    display: block;
    margin-bottom: 0.85rem;
  }

  .suite-tour.is-mobile-stack .suite-hud {
    display: none;
  }

  .suite-mobile-caption {
    display: none;
  }

  /* Orbit: keep Apple stage, stack copy under product */
  .orbit-sticky {
    height: 100svh;
    min-height: 100svh;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .orbit-ambient {
    display: block;
  }

  .orbit-stage {
    display: grid !important;
    position: absolute;
    inset: 0 0 38% 0;
    padding: calc(var(--nav-h) + 0.5rem) 1rem 0;
    place-items: center;
  }

  .orbit-turntable {
    width: 100%;
    aspect-ratio: 16 / 11;
    height: auto;
  }

  .orbit-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    filter: blur(6px);
    transform: rotateY(-18deg) scale(0.94);
  }

  .orbit-item.is-active {
    opacity: 1;
    filter: blur(0);
  }

  .orbit-item img {
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }

  .orbit-copy {
    display: block !important;
    position: relative;
    z-index: 3;
    padding: 0 1.15rem 1.75rem;
    max-width: none;
  }

  .orbit-copy h2 {
    font-size: clamp(1.65rem, 7vw, 2.1rem);
  }

  .orbit-copy p {
    font-size: 0.95rem;
  }

  .orbit-progress {
    display: block !important;
    left: 1.15rem;
    right: 1.15rem;
    bottom: 0.65rem;
  }

  .orbit-mobile-list {
    display: none !important;
  }

  /* Product rail + lookbook inherit optional horizontal scroll from base */
  .rail-header {
    padding: 3.25rem 0 1rem;
  }

  .rail-track {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .rail-card {
    flex-basis: min(78vw, 300px);
  }

  .rail-card .tile-media {
    min-height: 200px;
  }

  .film-section {
    padding: 3.25rem 0 2.25rem;
  }

  .film-intro {
    padding: 0 1.15rem 1.15rem;
  }

  .film-track {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .film-track figure {
    width: min(72vw, 280px);
  }

  .craft-sticky {
    min-height: 0;
    padding: 3.5rem 0;
  }

  .craft-step {
    opacity: 0.45;
    transform: translateY(8px);
  }

  .craft-step.is-active {
    opacity: 1;
    transform: none;
  }

  .finish-panel {
    min-height: 70svh;
  }

  .finish-caption {
    min-height: 70svh;
  }

  .quote-sticky {
    min-height: 0;
    padding: 3.5rem 1.15rem;
  }

  .measure-stage {
    padding: 3.75rem 0;
  }

  .section-bridge {
    height: 8vh;
  }

  .hero-scroll {
    display: block;
    bottom: 1.25rem;
    left: 1rem;
    right: auto;
    font-size: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .suite-sticky,
  .orbit-sticky,
  .film-sticky,
  .craft-sticky,
  .quote-sticky {
    height: auto;
    min-height: 0;
  }

  .suite-stage {
    position: relative;
    display: flex;
    flex-direction: column;
  }

  .suite-frame,
  .orbit-item {
    position: relative;
    opacity: 1;
    filter: none;
    transform: none;
    height: 55svh;
  }

  .suite-hud {
    position: relative;
    background: #070c10;
  }

  .orbit-stage,
  .orbit-copy,
  .orbit-progress,
  .orbit-ambient {
    display: none !important;
  }

  .orbit-mobile-list {
    display: block !important;
  }

  .orbit-sticky {
    height: auto;
    display: block;
    padding: 2rem 0;
  }

  .rail-track,
  .film-track {
    flex-wrap: wrap;
    width: 100%;
    padding: 1rem;
  }

  .rail-card,
  .film-track figure {
    flex-basis: 100%;
    width: 100%;
  }

  .craft-step {
    opacity: 1;
    transform: none;
  }
}
