/* The ownership story (Ray, 2026-11-30, after the Utopia site's artist). The same mechanics as the
   Stoin Sites "Story" section (stoin-site-starter: styles/story.css), in stoin.ai's colours: one
   statement per screen; each scene's art in front is painted in the NEXT scene's colour, so the next
   scene grows out of its silhouette; words sit between the art behind and the art in front; the old
   world is red and black, the turn is Stoin's mint. Art: /story/*.svg (shapes only, CSS masks). */

.story { --story-dark: #08090b; --story-light: #f4f6fa; --story-main: #8cf7cf; --story-red: #d42a2a; margin: 0; }
.story-scenes { list-style: none; margin: 0; padding: 0; }

.story-scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14svh 20px;
  text-align: center;
  background: var(--tone-bg);
  color: var(--tone-ink);
}
.story-scene[data-has-front] { padding-top: 12svh; padding-bottom: 48svh; }

.story-scene[data-tone="dark"] { --tone-bg: var(--story-dark); --tone-ink: #f4f6fa; }
.story-scene[data-tone="light"] { --tone-bg: var(--story-light); --tone-ink: #08090b; }
.story-scene[data-tone="main"] { --tone-bg: var(--story-main); --tone-ink: #08090b; }
.story-scene[data-tone="red"] { --tone-bg: var(--story-red); --tone-ink: #fff; }
.story-scene[data-next="dark"], .story-scene[data-next="page"] { --next-bg: var(--story-dark); }
.story-scene[data-next="light"] { --next-bg: var(--story-light); }
.story-scene[data-next="main"] { --next-bg: var(--story-main); }
.story-scene[data-next="red"] { --next-bg: var(--story-red); }
.story-scene[data-words="red"] { --words: var(--story-red); }
.story-scene[data-words="main"] { --words: var(--story-main); }

.story-words { position: relative; z-index: 2; max-width: min(1200px, 100%); }
.story-words .story-line {
  margin: 0;
  font-size: clamp(2.6rem, 8.6vw, 8.4rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--words, currentColor);
  max-width: none;
  opacity: 1;
}
.story-words p { max-width: 44ch; margin: 1.3em auto 0; font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.55; color: inherit; opacity: 0.88; }

.story-art {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  pointer-events: none;
  -webkit-mask: var(--art) bottom center / cover no-repeat;
  mask: var(--art) bottom center / cover no-repeat;
}
.story-back {
  z-index: 1;
  height: max(38svh, min(46vw, 82svh));
  background: color-mix(in srgb, var(--tone-ink) 17%, var(--tone-bg));
  transform: translateY(var(--story-drift, 0px));
  will-change: transform;
}
.story-front { z-index: 3; height: max(32svh, min(37.5vw, 62svh)); background: var(--next-bg); }
/* Under the art in front: a strip of the next colour. It covers the hairline seam where scenes meet,
   and fills the space the art rises from while it is still lowered (--rise, story.js). */
.story-scene[data-has-front]::after { content: ""; position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: calc(var(--rise, 0px) + 4px); background: var(--next-bg); }
.story-art[data-art="skyline-far"] { --art: url("/story/skyline-far.svg"); }
.story-art[data-art="skyline-near"] { --art: url("/story/skyline-near.svg"); }
.story-art[data-art="crowd"] { --art: url("/story/crowd.svg"); }
.story-art[data-art="hands"] { --art: url("/story/hands.svg"); }
.story-art[data-art="neighborhood"] { --art: url("/story/neighborhood.svg"); }

/* Each statement rises in as its scene arrives (story.js adds .in; without script, all show). */
.story.moving .story-words { opacity: 0; transform: translateY(40px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1); }
.story.moving .story-words.in { opacity: 1; transform: none; }

/* Layers move at their own speeds (Ray, 2026-12-01; story.js sets the values). The words' own
   rise-in is on .story-words, so the linger goes on its children. */
.story-front { transform: translateY(var(--rise, 0px)); will-change: transform; }
.story-words .story-line, .story-words p { transform: translateY(var(--linger, 0px)); }
.story-scene[data-move="sideways"] .story-words { max-width: none; width: 100%; }
.story-band { display: block; width: max-content; white-space: nowrap; transform: translateX(var(--slide, 0px)); will-change: transform; }
.story-band > span { display: inline-block; padding-right: 0.5em; }
.story-band > span::after { content: "\2022"; padding-left: 0.5em; opacity: 0.5; }

@media (max-width: 700px) {
  .story-scene[data-has-front] { padding-top: 10svh; padding-bottom: 42svh; }
  .story-front { height: 40svh; }
  .story-art[data-art="skyline-near"] { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .story-back, .story-front, .story-words .story-line, .story-words p { transform: none; }
}
