/* xIPTV site: the scroll story. Full-screen chapters over a fixed, slowly drifting background that
   crossfades per chapter; a pinned device (iPhone → iPad → Mac → TV → car display) for the platform
   chapters; full-width Premium, Features, Gallery and Privacy chapters. Driven by story.js.
   Without story.js, with reduced motion or on narrow screens (no html.story-live), chapters read top to
   bottom with their own background and their own device image (.chapter-shot). */

/* Lenis (from lenis/dist/lenis.css) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

:root {
  --story-text: #eef0f6;
  --story-muted: #cfd5e2;
  --story-accent: #9fb0ff;
  --gold-1: #f7dc94;
  --gold-2: #d39b3a;
  --glass: rgba(255, 255, 255, .055);
  --glass-border: rgba(255, 255, 255, .11);
  --text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 2px 18px rgba(0, 0, 0, .55);
}
html { background: #07080d; }

/* Header floats over the hero and the chapters. */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; }
.hero-full { min-height: 100vh; min-height: 100svh; padding-top: var(--header-h); box-sizing: border-box; }
.hero-full .hero-actions { align-items: center; }
.hero-actions .store > summary, .hero-actions .appstore { display: block; height: 54px; }
.hero-actions .appstore img { height: 54px; width: auto; display: block; }
.hero-actions .button { height: 54px; box-sizing: border-box; display: inline-flex; align-items: center; padding: 0 1.4rem; border-radius: 12px; font-size: 1rem; }

/* Footer above the story's fixed background, dark like the page. */
.site-footer { position: relative; z-index: 2; background: #05060a; border-top: 1px solid rgba(255, 255, 255, .08); color: #9aa1ad; }
.site-footer a { color: #d4d9e6; }

/* Header: dark, blurred, nearly black, like the hero. */
.site-header {
  background: rgba(6, 7, 11, .62);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  color: #eef0f6;
}
.site-header .brand, .site-header nav a, .site-header nav a:hover, .site-header nav a[aria-current="page"] { color: #eef0f6; }
.site-header nav a { color: rgba(238, 240, 246, .72); }
.site-header .lang-menu summary { color: #eef0f6; border-color: rgba(255, 255, 255, .22); }

/* Hero: the Premium button stands out (gold). */
.button.premium {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  color: #1d1406;
  border: 0;
  box-shadow: 0 10px 34px rgba(211, 155, 58, .38);
}
.button.premium:hover { box-shadow: 0 12px 40px rgba(211, 155, 58, .55); }

/* The story: dark, light text. */
.story { position: relative; background: #07080d; color: var(--story-text); isolation: isolate; }

/* Fixed background layer: one image per chapter, crossfaded, drifting slowly. */
.story-bg { position: fixed; inset: 0; z-index: -1; opacity: 0; transition: opacity .8s ease; pointer-events: none; overflow: hidden; }
.story.in-view .story-bg { opacity: 1; }
.story-bg-img {
  position: absolute;
  top: -8%;
  left: -8%;
  width: 116%;
  height: 116%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
  animation: story-drift 26s ease-in-out infinite alternate;
}
.story-bg-img.is-active { opacity: 1; }
/* Scrim: darker behind the text column, all over in the full-width chapters. */
.story-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 5, 9, .78) 0%, rgba(4, 5, 9, .5) 42%, rgba(4, 5, 9, .12) 100%); transition: background .8s ease; }
.story-bg.is-full::after { background: rgba(4, 5, 9, .55); }
.story-bg-img:nth-child(2n) { animation-duration: 31s; animation-direction: alternate-reverse; }
@keyframes story-drift {
  0% { transform: translate3d(-2.5%, 1%, 0) scale(1.02); filter: hue-rotate(0deg) saturate(1); }
  50% { transform: translate3d(1.5%, -1.5%, 0) scale(1.08); filter: hue-rotate(-12deg) saturate(1.15); }
  100% { transform: translate3d(3%, 1.5%, 0) scale(1.04); filter: hue-rotate(8deg) saturate(1.05); }
}

.story-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  column-gap: 3rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.story-track > .chapter { grid-column: 1; }
.stage {
  grid-column: 2;
  grid-row: 1 / span 20;
  position: sticky;
  top: 0;
  height: 100vh;
  padding-top: var(--header-h);
  box-sizing: border-box;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.2rem;
}

.chapter {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 2.5rem) 0 3rem;
  box-sizing: border-box;
}
.chapter h2 {
  font-size: clamp(2rem, 4.1vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 1.1rem;
  color: var(--story-text);
}
.chapter .eyebrow-chip {
  align-self: flex-start;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--story-accent);
  margin: 0 0 .9rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: rgba(159, 176, 255, .12);
  border: 1px solid rgba(159, 176, 255, .22);
}
.chapter p { color: var(--story-muted); font-size: 1.06rem; line-height: 1.6; max-width: 36rem; }
.chapter h2, .chapter p, .chapter li, .chapter h3, .store-note { text-shadow: var(--text-shadow); }
.callout { display: grid; grid-template-columns: 1.6rem 1fr; gap: .8rem; padding: .9rem 1.1rem; border-radius: 14px; background: rgba(150, 120, 255, .16); border: 1px solid rgba(190, 170, 255, .38); color: #fff !important; font-weight: 500; }
.callout svg { width: 1.4rem; height: 1.4rem; color: #d9ceff; margin-top: .1rem; }
.callout strong { color: #fff; text-decoration: underline; text-decoration-color: rgba(217, 206, 255, .7); text-underline-offset: 3px; }
.chapter p strong { color: var(--story-text); }
.chapter a { color: #c9d3ff; }
.chapter .notice { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 1rem 1.2rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); max-width: 36rem; }
.chapter .notice p { margin: 0; }
.chapter-points { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .85rem; max-width: 36rem; }
.chapter-points li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .15rem .8rem; }
.chapter-points.two { grid-template-columns: 1fr 1fr; gap: .9rem 1.4rem; max-width: 40rem; }
.chapter-points.two p { font-size: .9rem; }
.chapter-points svg { width: 1.35rem; height: 1.35rem; color: var(--story-accent); grid-row: span 2; margin-top: .15rem; }
.chapter-points h3 { margin: 0; font-size: 1rem; color: var(--story-text); }
.chapter-points p { margin: 0; font-size: .95rem; }
.chapter .soon { margin-left: .5rem; vertical-align: middle; }
.chapter-store { margin-top: 1.6rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.appstore img { height: 48px; width: auto; }
a.appstore[aria-disabled="true"] { cursor: default; }
.store-note { font-size: .86rem; color: var(--story-muted); }

/* The pinned device: one frame whose size and corners follow data-shape. Sizes follow the viewport:
   never taller than the space under the header, never wider than the stage column. */
.stage { --room-h: calc(100vh - var(--header-h) - 120px); --room-w: calc(50vw - 4rem); }
.device {
  position: relative;
  --w: min(300px, calc(var(--room-h) * .4615));
  --h: calc(var(--w) / .4615);
  width: var(--w);
  height: var(--h);
  border-radius: calc(var(--w) * .17);
  padding: calc(var(--w) * .04);
  box-sizing: border-box;
  background: linear-gradient(145deg, #2c303b, #0b0d12);
  box-shadow: 0 0 0 2px #3a3f4c, 0 40px 120px rgba(0, 0, 0, .6), 0 0 160px rgba(110, 130, 255, .14);
  transition: width .95s cubic-bezier(.65, 0, .35, 1), height .95s cubic-bezier(.65, 0, .35, 1),
              border-radius .95s cubic-bezier(.65, 0, .35, 1), padding .9s ease, box-shadow .9s ease, background .9s ease;
  touch-action: pan-y;
}
.device[data-shape="tablet"] { --w: min(600px, var(--room-w), calc(var(--room-h) / .75)); --h: calc(var(--w) * .75); border-radius: 34px; padding: 14px; }
.device[data-shape="laptop"] { --w: min(660px, var(--room-w), calc(var(--room-h) / .625)); --h: calc(var(--w) * .625); border-radius: 16px; padding: 10px; }
.device[data-shape="laptop"]::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -18px;
  height: 18px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(#d3d7e0, #8e939f);
}
/* Apple TV: a thin OLED panel on the living-room wall. */
.device[data-shape="tv"] { --w: min(760px, calc(var(--room-w) + 2rem), calc(var(--room-h) / .5625)); --h: calc(var(--w) * .5625); border-radius: 6px; padding: 4px; background: #050505; box-shadow: 0 0 0 1px #1d1f24, 0 30px 80px rgba(0, 0, 0, .7), 0 0 140px rgba(60, 150, 255, .28); }
.device[data-shape="car"] { --w: min(640px, var(--room-w), calc(var(--room-h) / .565)); --h: calc(var(--w) * .565); border-radius: 26px; padding: 14px; background: linear-gradient(160deg, #1b1d24, #050608); box-shadow: 0 0 0 1px #2c2f38, 0 40px 120px rgba(0, 0, 0, .7), 0 0 120px rgba(150, 110, 255, .25); }
.remote {
  position: absolute;
  right: 4%;
  bottom: 9%;
  width: clamp(70px, 7vw, 120px);
  height: auto;
  transform: perspective(900px) rotateX(32deg) rotateZ(-24deg) translateY(30px);
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .6));
  opacity: 0;
  transition: opacity .7s ease, transform 1s cubic-bezier(.2, .7, .1, 1);
  pointer-events: none;
}
.stage.shape-tv .remote { opacity: 1; transform: perspective(900px) rotateX(32deg) rotateZ(-24deg) translateY(0); }
/* The Apple TV box beside the remote, on the same "table" in front of the screen. */
.tv-box {
  position: absolute;
  right: calc(4% + clamp(70px, 7vw, 120px) + 1rem);
  bottom: 6%;
  width: clamp(96px, 10.5vw, 170px);
  height: auto;
  transform: perspective(900px) rotateX(18deg) rotateZ(-6deg) translateY(30px);
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .6));
  opacity: 0;
  transition: opacity .7s ease .12s, transform 1s cubic-bezier(.2, .7, .1, 1) .12s;
  pointer-events: none;
}
.stage.shape-tv .tv-box { opacity: 1; transform: perspective(900px) rotateX(18deg) rotateZ(-6deg) translateY(0); }
.tab-hotspots { position: absolute; left: 3%; right: 3%; bottom: 1.5%; height: 8%; display: flex; z-index: 2; }
.tab-hotspots[hidden] { display: none; }
.tab-hotspots button { flex: 1; border: 0; background: transparent; color: transparent; font-size: 0; cursor: pointer; border-radius: 18px; transition: background .2s; }
.tab-hotspots button:hover, .tab-hotspots button:focus-visible { background: rgba(80, 120, 255, .14); outline: none; }
.try-hint { margin: 0; padding: .4rem .9rem; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; font-size: .9rem; text-shadow: none; animation: hint-pulse 2.4s ease-in-out infinite; }
.try-hint[hidden] { display: none; }
@keyframes hint-pulse { 50% { box-shadow: 0 0 0 6px rgba(159, 176, 255, .14); } }
.device-glass { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 40px; background: #000; transition: border-radius .95s cubic-bezier(.65, 0, .35, 1); }
.device[data-shape="tablet"] .device-glass { border-radius: 22px; }
.device[data-shape="laptop"] .device-glass, .device[data-shape="tv"] .device-glass { border-radius: 6px; }
.device[data-shape="car"] .device-glass { border-radius: 14px; }
.device-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .6s ease, transform .9s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.device-screen.is-active { opacity: 1; transform: none; }
.device-controls { display: flex; align-items: center; gap: .9rem; }
.device-controls[hidden] { display: none; }
.device-controls button, .gallery-nav button {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .25s, transform .25s;
}
.device-controls button:hover, .gallery-nav button:hover { background: rgba(255, 255, 255, .18); transform: scale(1.06); }
.device-dots { display: flex; gap: .45rem; }
.device-dots button { width: .55rem; height: .55rem; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .35); font-size: 0; backdrop-filter: none; }
.device-dots button[aria-current="true"] { background: #fff; transform: scale(1.3); }

/* Headline words rising in sequence (story.js wraps them). */
.chapter h2 .word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; }
.chapter h2 .word > span { display: inline-block; transform: translateY(108%); transition: transform .85s cubic-bezier(.2, .7, .1, 1); transition-delay: calc(var(--i, 0) * 45ms); }
.chapter.was-active h2 .word > span { transform: none; }
.chapter .rise { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; transition-delay: calc(.25s + var(--i, 0) * 90ms); }
.chapter.was-active .rise { opacity: 1; transform: none; }

/* Full-width chapters (Premium, Features, Gallery, Privacy). */
.chapter.full { padding-left: 1.5rem; padding-right: 1.5rem; }
.full-wrap { width: 100%; max-width: 72rem; margin: 0 auto; display: flex; flex-direction: column; }
.full-wrap.narrow { max-width: 52rem; }
.lead-text { font-size: 1.15rem !important; color: #cfd4e2 !important; max-width: 46rem !important; }
.glass-grid { list-style: none; padding: 0; margin: 1.6rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.glass-grid li {
  padding: 1.2rem 1.25rem;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform .35s ease, background .35s ease, border-color .35s ease;
}
.glass-grid li:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .085); border-color: rgba(255, 255, 255, .2); }
.glass-grid svg { width: 1.5rem; height: 1.5rem; color: var(--story-accent); }
.glass-grid h3 { margin: .7rem 0 .35rem; font-size: 1.02rem; color: var(--story-text); }
.glass-grid p { margin: 0; font-size: .93rem; line-height: 1.55; }
.glass-grid.compact { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.glass-grid.compact li { padding: 1rem 1.1rem; }
.glass-grid.gold li { background: linear-gradient(160deg, rgba(247, 220, 148, .12), rgba(211, 155, 58, .05)); border-color: rgba(247, 220, 148, .28); }
.glass-grid.gold svg { color: var(--gold-1); }
#premium .eyebrow-chip { color: var(--gold-1); background: rgba(247, 220, 148, .12); border-color: rgba(247, 220, 148, .3); }
#premium h2 { background: linear-gradient(135deg, #fff3cf, var(--gold-1) 45%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-pills { list-style: none; padding: 0; margin: .6rem 0 1.2rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.plan-pills li { padding: .55rem 1rem; border-radius: 999px; border: 1px solid rgba(247, 220, 148, .35); background: rgba(247, 220, 148, .08); }
.plan-pills strong { color: var(--gold-1); margin-right: .45rem; }
.plan-pills span { color: var(--story-muted); font-size: .88rem; }
.glass-note { padding: 1rem 1.2rem; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); max-width: 46rem; }
.glass-note p { margin: 0; }
.fine { font-size: .86rem !important; max-width: 46rem !important; }
.group-title { margin: 2rem 0 .3rem; font-size: 1.5rem; color: var(--story-text); }

/* Gallery: one highlighted slide, the neighbours dimmed; drag, swipe, arrows or keys. */
.gallery { margin-top: 1.2rem; -webkit-user-select: none; user-select: none; }
.gallery-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.4rem; }
.gallery-tabs button {
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
  color: var(--story-text);
  font: inherit;
  font-size: .92rem;
  cursor: pointer;
}
.gallery-tabs button[aria-selected="true"] { background: #fff; color: #0b0d14; border-color: #fff; }
.gallery-viewport { position: relative; overflow: hidden; height: min(62vh, 560px); cursor: grab; outline: none; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%); }
.gallery-viewport.dragging { cursor: grabbing; }
.gallery-track { position: absolute; top: 0; bottom: 0; left: 50%; display: flex; align-items: center; gap: 2rem; will-change: transform; }
.gallery-track.animate { transition: transform .6s cubic-bezier(.2, .7, .1, 1); }
.slide { margin: 0; flex: none; height: 82%; display: flex; flex-direction: column; align-items: center; gap: .7rem; opacity: .35; transform: scale(.84); transition: opacity .5s ease, transform .5s ease; }
.slide.is-active { opacity: 1; transform: scale(1); }
.slide picture { height: 100%; display: block; }
.slide img { height: 100%; width: auto; border-radius: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, .55); user-select: none; -webkit-user-drag: none; pointer-events: none; }
.slide.tall img { border-radius: 26px; }
.slide figcaption { color: var(--story-muted); font-size: .92rem; }
.slide.is-active figcaption { color: var(--story-text); }
.gallery-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.gallery-hint { margin: 0 !important; font-size: .86rem !important; }

/* Privacy and the final call to action. */
.privacy-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .8rem; }
.privacy-list li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .8rem; color: var(--story-muted); line-height: 1.55; }
.privacy-list svg { width: 1.3rem; height: 1.3rem; color: #c7cede; margin-top: .15rem; }
.cta { margin-top: 2.2rem; padding: 1.8rem; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.cta h3 { margin: 0 0 .4rem; font-size: 1.6rem; color: var(--story-text); }
.cta p { margin: 0 0 1.2rem; }
.cta-stores { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; }
.cta-stores li { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }

/* Dot rail. */
.chapter-rail {
  position: fixed;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: grid;
  justify-items: center;
  gap: .5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.chapter-rail.is-shown { opacity: 1; pointer-events: auto; }
/* Other chapters: an open ring with a filled dot in its centre, slightly dimmed. */
.chapter-rail button {
  position: relative;
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .6);
  background: transparent;
  opacity: .55;
  cursor: pointer;
  transition: height .35s ease, width .35s ease, background .3s, border-color .3s, opacity .3s;
}
.chapter-rail button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: #fff;
  transition: opacity .3s;
}
.chapter-rail button:hover { opacity: 1; }
/* Current chapter: a taller filled pill. */
.chapter-rail button[aria-current="true"] { width: 7px; height: 24px; background: #fff; border-color: #fff; opacity: 1; }
.chapter-rail button[aria-current="true"]::before { opacity: 0; }
/* Hover label to the left of each dot. */
.chapter-rail button::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  padding: .32rem .62rem;
  border-radius: .55rem;
  background: rgba(16, 18, 26, .88);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.chapter-rail button:hover::after,
.chapter-rail button:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
@media (hover: none) { .chapter-rail button::after { display: none; } }
.chapter-rail button:focus-visible, .gallery-tabs button:focus-visible, .device-controls button:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 3px; }

/* Each chapter's own image: used only by the static layout. */
.chapter-shot { display: none; }

/* Static layout: reduced motion, no JavaScript, narrow screens. Each chapter carries its own background. */
html:not(.story-live) .story-bg { display: none; }
html:not(.story-live) .story-track { display: block; }
html:not(.story-live) .stage { display: none; }
html:not(.story-live) .chapter { min-height: 0; padding: 4rem 1.25rem; background: #07080d center / cover no-repeat; }
html:not(.story-live) .story-track > .chapter { margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }
html:not(.story-live) .chapter[data-bg="about"] { background-image: url("/assets/story/bg/about.webp"); }
html:not(.story-live) .chapter[data-bg="iphone"] { background-image: url("/assets/story/bg/iphone.webp"); }
html:not(.story-live) .chapter[data-bg="ipad"] { background-image: url("/assets/story/bg/ipad.webp"); }
html:not(.story-live) .chapter[data-bg="mac"] { background-image: url("/assets/story/bg/mac.webp"); }
html:not(.story-live) .chapter[data-bg="appletv"] { background-image: url("/assets/story/bg/appletv.webp"); }
html:not(.story-live) .chapter[data-bg="carplay"] { background-image: url("/assets/story/bg/carplay.webp"); }
html:not(.story-live) .chapter[data-bg="premium"] { background-image: url("/assets/story/bg/premium.webp"); }
html:not(.story-live) .chapter[data-bg="features"] { background-image: url("/assets/story/bg/features.webp"); }
html:not(.story-live) .chapter[data-bg="screenshots"] { background-image: url("/assets/story/bg/screenshots.webp"); }
html:not(.story-live) .chapter[data-bg="privacy"] { background-image: url("/assets/story/bg/privacy.webp"); }
html:not(.story-live) .chapter-shot { display: block; width: min(100%, 20rem); height: auto; margin: 2rem 0 0; border-radius: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
html:not(.story-live) .chapter-shot.wide { width: min(100%, 40rem); border-radius: 12px; }
html:not(.story-live) .chapter h2 .word > span, html:not(.story-live) .chapter .rise { opacity: 1; transform: none; transition: none; }
html:not(.story-live) .chapter-rail { display: none; }
@media (max-width: 767px) {
  .gallery-viewport { height: 58vh; }
  .gallery-track { gap: 1rem; }
  .cta-stores { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .story-bg-img { animation: none; }
  .slide, .gallery-track.animate { transition: none; }
}
/* Short screens (laptops at 720–800 px): tighter chapters so each fits in one view. */
@media (max-height: 820px) and (min-width: 1024px) {
  .chapter { padding: calc(var(--header-h) + 1.2rem) 0 1.5rem; }
  .chapter h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); margin-bottom: .8rem; }
  .chapter p { font-size: .98rem; line-height: 1.5; margin: .5rem 0; }
  .chapter .eyebrow-chip { margin-bottom: .6rem; }
  .chapter-points { gap: .55rem; margin-top: .6rem; }
  .chapter-points p, .chapter-points.two p { font-size: .87rem; }
  .chapter-store { margin-top: 1rem; }
  .appstore img { height: 42px; }
}

/* Language menu: dark, like the header. */
.site-header .lang-menu summary { color: #eef0f6; }
.site-header .lang-menu ul {
  background: rgba(10, 12, 20, .92);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.site-header .lang-menu li a { color: #e6e9f2; }
.site-header .lang-menu li a:hover, .site-header .lang-menu li a:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; }
.site-header .lang-menu li a[aria-current="true"] { color: #a9b8ff; font-weight: 700; }

/* WebGL background: on top of the images, which hide once the canvas is drawing and come back if it stops. */
.story-bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s ease; }
.story-bg.gl-on .story-bg-canvas { opacity: 1; }
.story-bg.gl-on .story-bg-img { opacity: 0 !important; transition: opacity 1s ease; animation-play-state: paused; }
