/* Homepage story ("Covered"), a player that plays on its own. Light-DOM parts
   only: the frame, the controls row at its top, the captions docked at its
   bottom, and the still list that is the story without motion. The art itself is styled inside story.js's shadow
   root. Decisions: docs/scroll-story-bowready.md. */

.story{position:relative; background:var(--paper)}
.story-track{position:relative}
.story-track[hidden]{display:none}
/* One screen tall, under the sticky nav (--navh, set by story.js), so the page
   scrolls past it like any other section. */
.story-stage{position:relative; height:calc(100vh - var(--navh,56px)); height:calc(100svh - var(--navh,56px)); max-height:900px;
  overflow:hidden; background:#CFE6E2; scroll-margin-top:var(--navh,56px)}
.story-art{position:absolute; inset:0}

/* Captions: one at a time, docked at the bottom. Nothing covers the middle. */
.story-layer{position:absolute; inset:0; pointer-events:none; z-index:5}
.story-layer > [data-seg]{opacity:0}
.story-layer > .on{pointer-events:auto}
.story-layer .story-cap,.story-layer .story-aside{position:absolute; left:max(16px,env(safe-area-inset-left,0px)); right:max(16px,env(safe-area-inset-right,0px));
  bottom:calc(16px + env(safe-area-inset-bottom,0px)); max-width:470px; box-shadow:0 14px 36px rgba(14,33,30,.24); will-change:transform,opacity}
.story-cap,.story-aside{border-radius:18px; padding:14px 18px 6px}
.story-cap{background:var(--surface); border-top:4px solid var(--teal)}
.story-aside{background:var(--spruce); color:var(--paper)}
.story-k{margin:0; font:500 11.5px/1.2 var(--mono); letter-spacing:.06em; text-transform:uppercase; color:var(--teal)}
.story-aside .story-k{color:var(--teal-soft)}
.story-cap h3,.story-big{margin:8px 0 4px; font:700 25px/1.12 var(--display); letter-spacing:-.01em; color:inherit}
.story-cap p:not(.story-k),.story-aside p:not(.story-k):not(.story-big){margin:0 0 8px; font-size:16.5px; line-height:1.5}
.story-cap p:not(.story-k){color:var(--stone)}
.story-aside p:not(.story-k):not(.story-big){color:#CFE6E2}
.story-more{display:flex; justify-content:space-between; align-items:center; min-height:44px; border-top:1px solid var(--line); font-weight:600; color:var(--teal)}
.story-aside .story-more{color:var(--paper); border-color:rgba(246,245,241,.2)}
.story-more:hover{text-decoration:none}

/* Controls: play/pause (Replay at the end), then one segment per scene, as wide
   as its share of the running time. Tapping a segment plays from there. */
/* A paper pill behind the row, so the bar reads on the night scenes and the day ones alike. */
.story-ctl{position:absolute; z-index:6; top:5px; height:calc(var(--hh,44px) - 8px); left:max(8px,env(safe-area-inset-left,0px)); right:max(8px,env(safe-area-inset-right,0px));
  display:flex; align-items:center; gap:8px; padding:0 12px 0 2px; border-radius:999px;
  background:rgba(246,245,241,.9); box-shadow:0 4px 14px rgba(14,33,30,.16); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px)}
.story-play{flex:none; width:32px; height:32px; padding:0; border:0; border-radius:50%; display:grid; place-items:center; cursor:pointer;
  background:var(--spruce); color:var(--paper); box-shadow:0 4px 12px rgba(14,33,30,.22)}
.story-play svg{width:17px; height:17px}
.story-play .i-play,.story-play .i-replay{display:none}
.story-play[data-state="paused"] .i-pause,.story-play[data-state="ended"] .i-pause{display:none}
.story-play[data-state="paused"] .i-play,.story-play[data-state="ended"] .i-replay{display:inline}
.story-play:hover{background:var(--teal)}
.story-chapters{flex:1; display:flex; gap:3px; min-width:0}
.story-chap{flex:1 1 0; min-width:0; height:32px; padding:0; border:0; background:none; cursor:pointer; position:relative}
.story-chap::before,.story-chap i{content:""; position:absolute; left:0; right:0; top:50%; height:4px; margin-top:-2px; border-radius:2px}
.story-chap::before{background:rgba(12,64,59,.2)}
.story-chap i{background:var(--teal); transform:scaleX(0); transform-origin:left center}
.story-chap:hover::before{background:rgba(12,64,59,.32)}
/* The chapter playing now, by name (the segments carry it as a tooltip and in their labels). */
.story-now{flex:none; width:7.4em; font:500 11.5px/1 var(--mono); letter-spacing:.03em; color:var(--spruce); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:right}
.story-play:focus:not(:focus-visible),.story-chap:focus:not(:focus-visible){outline:none}
.story-play:focus-visible,.story-chap:focus-visible{outline:2px solid var(--teal-bright); outline-offset:2px}

@media (min-width:900px){
  .story-layer .story-cap,.story-layer .story-aside{bottom:40px; left:max(40px,6vw)}
}
@media (orientation:landscape) and (max-height:520px){
  .story-layer .story-cap,.story-layer .story-aside{top:calc(var(--hh,56px) + 12px); bottom:auto; width:42%; max-width:none}
}

/* Without motion: the same story as a list. Stills are drawn into .story-still
   under reduced motion; with no JavaScript at all the captions read on their own. */
html.story-live .story-list{display:none}
.story-list{list-style:none; margin:0 auto; padding:32px 16px; max-width:560px; display:grid; gap:22px}
.story-still{display:none}
.story-still.on{display:block; position:relative; height:min(640px,85vh); border-radius:18px 18px 0 0; overflow:hidden}
.story-list .story-still.on + .story-cap{border-radius:0 0 18px 18px}
.story-list .story-cap{box-shadow:0 1px 0 var(--line)}


/* Short phones (an iPhone SE is 667px tall): tighter captions, so more of the
   scene stays visible above them. story.js measures them for the layout. */
@media (max-height:760px) and (max-width:899px){
  .story-layer .story-cap,.story-layer .story-aside{padding:11px 14px 3px; bottom:calc(10px + env(safe-area-inset-bottom,0px)); left:max(10px,env(safe-area-inset-left,0px)); right:max(10px,env(safe-area-inset-right,0px))}
  .story-layer .story-cap h3,.story-layer .story-big{font-size:21px; margin:5px 0 3px}
  .story-layer .story-cap p:not(.story-k),.story-layer .story-aside p:not(.story-k):not(.story-big){font-size:15px; line-height:1.42; margin-bottom:6px}
  .story-layer .story-more{min-height:40px}
}

/* Thin captions while the story plays: headline plus one line, no chapter label
   (the progress line already says where you are). The still list keeps the label. */
.story-layer .story-cap,.story-layer .story-aside{padding:10px 16px 10px; border-top-width:3px}
.story-layer .story-k{display:none}
.story-layer .story-cap h3,.story-layer .story-big{margin:0 0 2px; font-size:20px; line-height:1.2}
.story-layer .story-cap p:not(.story-k){margin:0; font-size:15px; line-height:1.35}
.story-layer .story-more{display:inline-flex; gap:6px; min-height:36px; border-top:0; padding:0}
.story-layer .story-aside .story-more{color:var(--teal-soft)}
@media (max-height:760px) and (max-width:899px){
  .story-layer .story-cap,.story-layer .story-aside{padding:9px 14px 9px}
  .story-layer .story-cap h3,.story-layer .story-big{font-size:19px; margin:0 0 1px}
  .story-layer .story-cap p:not(.story-k){font-size:14.5px; margin:0}
}
.story-layer .story-replay{margin-left:18px; border:0; font:inherit; font-weight:600; color:var(--teal); background:none; cursor:pointer}
.story-replay[hidden]{display:none}

/* Laptops: the player sits in the hero's right-hand column as a portrait frame
   (story.js moves it there and sets html.story-hero). It replaces the old app
   screenshot and lets the hero fit one screen. */
.hero-player[hidden]{display:none}
html.story-hero .hero .phone{display:none}
html.story-hero .hero-tour-wrap{display:none}
html.story-hero .hero-inner{padding-top:36px; padding-bottom:40px}
.hero-player{align-self:start; color:var(--ink); text-align:left; --ph:clamp(560px, calc(100vh - var(--navh,67px) - 76px), 780px); justify-self:center; width:min(100%, calc(var(--ph) * .6)); height:var(--ph)}
.hero-player .story-track,.hero-player .story-still{height:100%}
.hero-player .story-stage,.hero-player .story-still{height:100%; max-height:none; border-radius:28px; box-shadow:0 30px 70px rgba(4,24,21,.45), 0 0 0 1px rgba(255,255,255,.08)}
.hero-player .story-layer .story-cap,.hero-player .story-layer .story-aside{left:12px; right:12px; bottom:12px; max-width:none}
.hero-player .story-still{border-radius:28px}
