/* Scene surfaces share these exact tokens. Product images and films retain their colours. */
:root {
  --page-base: #eeecf3;
  --page-ink: #292722;
  --page-muted: #443930;
  --page-caption: #332c26;
  --page-wash: none;
}
html[data-page-theme="violet-dusk"] {
  --page-ink: #292139;
  --page-muted: #493d59;
  --page-caption: #372a47;
}
html[data-page-theme],
html[data-page-theme] body,
html[data-page-theme] .tvc-track,
html[data-page-theme] .features-track,
html[data-page-theme] .hero-track,
html[data-page-theme] .hero-pin,
html[data-page-theme] .story-track {
  background: var(--page-base);
}
html[data-page-theme] .scene-shell,
html[data-page-theme] .features[data-backdrop] {
  background-color: var(--page-base);
  background-image: var(--page-wash);
}
/* The TVC content sits above the shared chapter background. */
html[data-page-theme] .scene {
  background: transparent;
}
html[data-page-theme] .chapter-surface iframe {
  background: var(--page-base);
}
html[data-page-theme] .feature-heading h1,
html[data-page-theme] .section-copy h1 {
  color: var(--page-ink);
}
html[data-page-theme] .feature-heading p,
html[data-page-theme] .section-copy p {
  color: var(--page-muted);
}
html[data-page-theme] .features .feature-caption {
  color: var(--page-caption);
}

/* The integrated page owns one viewport-sized wash. Transparent chapters do not
   restart a white-to-grey gradient every time their sticky container enters. */
html[data-page-host="true"] body {
  background: transparent;
  isolation: isolate;
}
html[data-page-host="true"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--page-base);
  background-image: var(--page-wash);
}
html[data-page-host="true"] .hero-track,
html[data-page-host="true"] .tvc-track,
html[data-page-host="true"] .features-track,
html[data-page-host="true"] .chapter-surface iframe {
  background: transparent;
}
/* The tabletop remains the crisp physical edge of the product introduction. */
html[data-page-host="true"] .hero-pin {
  background: #442a12;
  -webkit-mask-image: none;
  mask-image: none;
}

/* Embedded chapters remain transparent over the parent's continuous wash. */
html[data-page-theme][data-page-embedded="true"],
html[data-page-theme][data-page-embedded="true"] body,
html[data-page-theme][data-page-embedded="true"] .scene-shell,
html[data-page-theme][data-page-embedded="true"] .scene,
html[data-page-theme][data-page-embedded="true"] .story-track,
html[data-page-theme][data-page-embedded="true"] .features[data-backdrop] {
  background: transparent;
}

html[data-page-host="true"] .conversion-section { background: transparent; }
html[data-page-host="true"] body::before { transition: background-color 700ms ease; }

/* Each chapter has its own lighting composition on the shared viewport stage. */
html[data-dusk-arc] {
  --art-ground: linear-gradient(#efefed, #f4f3ef);
  --art-surface: radial-gradient(ellipse 78% 90% at 19% 115%, #ffe3bc 3%, #ffc280 41%, transparent 88%),
    linear-gradient(112deg, #ffc267 8%, #ff9e07 48%, #f47800 82%, #e66200);
}
html[data-dusk-arc] :where(.chapter-art-paint, .chapter-pin, .feature-pin, .uc-pin, .conversion-section, .scene-shell, .features)::before {
  --rim-width: var(--arc-width, 66%);
  --rim-height: var(--arc-height, 104%);
  --rim-center: var(--arc-x, 50%) var(--arc-y, 154%);
  --core-width: calc(var(--rim-width) * .84);
  --core-height: var(--rim-height);
}
html[data-dusk-arc] :is(.feature-pin, [data-art-chapter="features"]) { --arc-x: 21%; --arc-y: 155%; --arc-width: 91%; }
html[data-dusk-arc] :is(.uc-pin, [data-art-chapter="usecases"]) { --arc-x: 53%; --arc-y: 167%; --arc-width: 74%; }
html[data-dusk-arc] :is(.conversion-section, [data-art-chapter="closing"]) { --arc-x: 80%; --arc-y: 135%; --arc-width: 80%; }

/* The narrower inner ellipse gives the crown a shorter falloff. Along the
   flanks only the wider, softer mask remains. Both move with the painted arc. */
html[data-dusk-arc]
  :where(.chapter-art-paint, .chapter-pin, .feature-pin, .uc-pin, .conversion-section, .scene-shell, .features)::before {
  --art-mask:
    radial-gradient(ellipse var(--core-width) var(--core-height) at var(--rim-center),
      #000 92%, #000e 96%, #0008 99%, #0002 102%, transparent 106%),
    radial-gradient(ellipse var(--rim-width) var(--rim-height) at var(--rim-center),
      #000 78%, #000e 85%, #000a 92%, #0005 99%, #0001 107%, transparent 114%);
}

/* All artwork occupies the same viewport behind the scrolling content. Only
   the outgoing and incoming chapters paint during a handoff. */
.chapter-art-stage { display: none; }
html.chapter-art-ready .chapter-art-stage {
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
  background: #fcfbfd;
}
.chapter-art-paint {
  position: absolute;
  inset: 0;
  isolation: isolate;
}
.chapter-art-paint[hidden] { display: none; }

html[data-page-host].chapter-art-ready .closing-store { background: transparent; }
.purchase-art-wash { position: absolute; inset: 0; pointer-events: none; background: var(--purchase-wash); opacity: .62; }
/* The feather is tied to the section edge in document space in either scroll direction. */
.chapter-art-paint[data-feathered] {
  mask-image: linear-gradient(180deg, transparent var(--blend-start), black calc(var(--blend-start) + var(--blend-height)));
}
html.chapter-art-ready .chapter-art-stage[hidden] { display: none; }
.chapter-art-paint[data-art-chapter="dusk"] { display: none; }
html[data-dusk-arc] .chapter-art-paint[data-art-chapter="dusk"] {
  display: block;
  visibility: hidden;
  opacity: 0;
}
html[data-dusk-arc] .chapter-art-stage[data-everyday-title] [data-art-chapter="dusk"] {
  visibility: visible;
  opacity: 1;
}
html[data-dusk-arc] .chapter-art-paint[data-art-chapter="dusk"]::before {
  --art-mask: none;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-dusk-arc] .chapter-art-paint[data-art-chapter="dusk"] {
    transition: opacity 420ms ease-in-out, visibility 0s linear 420ms;
  }
  html[data-dusk-arc] .chapter-art-stage[data-everyday-title] [data-art-chapter="dusk"] {
    transition-delay: 0s;
  }
}
html[data-bold-background][data-page-host] .chapter-art-paint,
html[data-bold-background]:not([data-page-embedded="true"]) :is(.scene-shell, .features[data-backdrop]) {
  isolation: isolate;
  background: var(--art-ground);
}
html[data-bold-background][data-page-host] .chapter-art-paint::before,
html[data-bold-background]:not([data-page-embedded="true"]) :is(.scene-shell, .features[data-backdrop])::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--art-bleed, 0px));
  z-index: -1;
  pointer-events: none;
  background: var(--art-surface);
  -webkit-mask-image: var(--art-mask);
  mask-image: var(--art-mask);
}
@media (max-width: 700px) {
  html[data-dusk-arc] :is(.chapter-art-paint, .chapter-pin, .feature-pin, .uc-pin, .conversion-section) {
    --arc-width: 107%; --arc-height: 79%; --arc-y: 145%;
  }
}

/* Two depths share one scroll sample and have different travel distances. */
html[data-dusk-arc] {
  --art-depth: radial-gradient(ellipse 70% 80% at 102% 72%, #e2d5c58c, #e2d5c500 88%);
}
html[data-bold-background][data-page-host] .chapter-art-paint::after,
html[data-bold-background]:not([data-page-embedded="true"]) :is(.scene-shell, .features[data-backdrop])::after {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--art-bleed, 0px));
  z-index: -2;
  pointer-events: none;
  background: var(--art-depth);
}
@media (prefers-reduced-motion: no-preference) {
  html[data-bold-background][data-page-host] .chapter-art-paint {
    --art-bleed: clamp(40px, 8vmin, 86px);
  }
  /* Overscan accommodates the tilted arc even on a wide, shallow display. */
  html[data-page-host][data-dusk-arc] .chapter-art-paint::before {
    inset: calc(-9svh - 4vw) calc(-12vw - 4svh);
    transform: var(--solar-arc-pose, none);
  }
  html[data-page-host][data-dusk-arc] .chapter-art-paint::after {
    inset: -4svh -5vw;
    transform: var(--solar-halo-pose, none);
  }
}

html:is([data-page-theme="violet-dusk"], [data-violet-solar]) {
  --arc-center: #d5b7fa; --arc-body: #ac82e9; --arc-rim: #a37ae1dc; --arc-fringe: #bf9de848;
  --art-ground: linear-gradient(145deg, #eeedf4, #f1edf1);
  --art-surface: radial-gradient(ellipse 78% 90% at 19% 115%, #ead6ff 3%, #cda7fc 43%, transparent 88%),
    linear-gradient(112deg, #d7c4fa 8%, #b691ef 46%, #a278e8 75%, #976cda);
  --art-depth: radial-gradient(ellipse 75% 81% at 96% 79%, #c0b6d6a6, #c0b6d600 90%);
}
@media (prefers-reduced-motion: no-preference) {
  /* Move the feathered ellipse itself on longer paths. Its transparent perimeter
     can cross the viewport without exposing an edge of the paint rectangle. */
  html[data-page-host][data-dusk-arc][data-arc-motion="breathe"]
    .chapter-art-paint:is([data-art-chapter="tvc"], [data-art-chapter="features"], [data-art-chapter="usecases"], [data-art-chapter="closing"])::before {
    inset: auto;
    left: var(--arc-x, 50%);
    top: var(--arc-y, 154%);
    width: calc(var(--arc-width, 66%) * 2.3);
    height: calc(var(--arc-height, 104%) * 2.3);
    translate: -50% -50%;
    transform-origin: 50% 25%;
    /* All four edges reach zero alpha inside the paint bounds, even while rotating. */
    mask-image: none;
    background: radial-gradient(ellipse closest-side at center,
      var(--arc-center, #ffc477) 35%, var(--arc-body, #ff9b1a) 70%,
      var(--arc-rim, #fd9010dc) 79%, var(--arc-fringe, #ffac5148) 91%, transparent 100%);

  }
  html[data-page-host][data-dusk-arc][data-arc-motion="breathe"]
    [data-art-chapter="dusk"]::before {
    inset: -10%;
    background: radial-gradient(ellipse 38% 44% at 61% 60%, var(--dusk-glow, #c65d32a6), transparent 99%);
  }
}

/* Keep the dark chapter glow transparent at its perimeter as it drifts. */
html[data-dusk-arc] .chapter-art-stage [data-art-chapter="dusk"]::before {
  inset: -14%;
  background: radial-gradient(ellipse 40% 42% at 55% 55%, var(--dusk-glow, #c65d32a6), transparent 100%);
}
/* Crossfade from the purple film and voice chapters into the amber everyday light. */
html[data-violet-solar] :is([data-art-chapter="usecases"], [data-art-chapter="closing"]) {
  --arc-center: #ffc477; --arc-body: #ff9b1a; --arc-rim: #fd9010dc; --arc-fringe: #ffac5148;
  --art-ground: linear-gradient(#efefed, #f4f3ef);
  --art-surface: radial-gradient(ellipse 78% 90% at 19% 115%, #ffe3bc 3%, #ffc280 41%, transparent 88%),
    linear-gradient(112deg, #ffc267 8%, #ff9e07 48%, #f47800 82%, #e66200);
  --art-depth: radial-gradient(ellipse 70% 80% at 102% 72%, #e2d5c58c, transparent 88%);
}
@media (prefers-reduced-motion: no-preference) {
  html[data-dusk-arc] { --idle-travel: 2.4vw; --idle-lift: 1.8svh; --idle-time: 6.8s; }
  html[data-dusk-arc][data-arc-motion="breathe"] { --idle-travel: 5vw; --idle-lift: 4svh; --idle-time: 5.8s; }
  html[data-dusk-arc] .chapter-art-paint::before {
    animation: arc-idle-drift var(--idle-time) ease-in-out calc(var(--idle-phase, 0ms) - 2s) infinite alternate;
  }
  html[data-dusk-arc] .chapter-art-paint::after {
    animation: arc-afterglow 8.6s ease-in-out calc(var(--idle-phase, 0ms) - 3s) infinite alternate;
  }
}
@keyframes arc-idle-drift {
  from { transform: var(--solar-arc-pose, translate(0)) translate3d(calc(0px - var(--idle-travel)), var(--idle-lift), 0) scale(.98,.94); opacity: .72; }
  to { transform: var(--solar-arc-pose, translate(0)) translate3d(var(--idle-travel), calc(0px - var(--idle-lift)), 0) scale(1.07,1.10); opacity: 1; }
}
@keyframes arc-afterglow { from { opacity:.58; } to { opacity:1; } }

/* The hardware portion shares a backdrop with the voice wall. Its violet light
   dissolves in as the hardware enters and leaves with the entire chapter. */
.device-light { display: none; }
html[data-page-theme="violet-solar"] .device-light {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(146deg, #f0edf7 5%, #e6dfed 52%, #c8b8d1);
}
.device-light::before,
.device-light::after {
  content: "";
  position: absolute;
  inset: -19% -24%;
}
.device-light::before {
  background: radial-gradient(ellipse 34% 46% at 31% 65%,
    #804ccfdf, #9a6fd7ce 28%, #af8bdc83 56%, #b396dc35 79%, transparent);
}
.device-light::after {
  background:
    radial-gradient(ellipse 28% 36% at 72% 58%, #a990dccc, #b29ed871 49%, transparent),
    radial-gradient(ellipse 33% 29% at 52% 31%, #faf5ffdb, #f8f0fc61 55%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .device-light::before, .device-light::after {
    transform: var(--mist-scroll-pose, none);
  }
  .device-light::before {
    animation: device-violet-drift 10.5s ease-in-out var(--idle-phase, 0ms) infinite alternate;
  }
  .device-light::after {
    animation: device-pearl-drift 9s ease-in-out calc(var(--idle-phase, 0ms) - 2.8s) infinite alternate;
  }
}
@keyframes device-violet-drift {
  0% { translate: -11vw 3svh; scale: 1 .95; opacity: .78; }
  48% { translate: 1vw -6svh; scale: 1.09 1.07; opacity: 1; }
  100% { translate: 13vw 4svh; scale: 1.02 1.04; opacity: .88; }
}
@keyframes device-pearl-drift {
  from { translate: 7vw -3svh; scale: 1.08 1; opacity: .68; }
  to { translate: -8vw 5svh; scale: .98 1.07; opacity: 1; }
}
