/* scroll-story.css — S12 Scroll story (#153), the section's own stylesheet: the theme ships it with the section (assets/section-scroll-story.css),
   the HTML demo loads it after extreme.css, and the /scroll-story prototype page loads it too, on the three demos' tokens. It reads Concept's
   tokens (--color-foreground, --color-background, --color-highlight, --rounded-block, --font-medium) and Extrême's --ext-surface. */
/* #153 S12 Scroll story (spec 2026-10-23): a sticky frame and a timeline — the line (foreground 12 %) fills with lime to the activation line, the
   markers go upcoming (graphite, outline, number 60 %) → passed (lime, ink number) → current (+ a lime halo), the step text .3 / .5 / 1.
   scroll-story.js sets --ext-story-top / --ext-story-frame (stuck in the middle of the screen under the header, never above the scroll-spy pill), the line's top / height and --ext-fill.
   Below 1024 the frames column hides and each step shows its photo. A step's caption: a glass pill (as the scroll-spy's Glass) 16 px inside its photo's bottom. The fill is an empty div — display: block against Concept's div:empty. */
.ext-story__header { margin-block-end: clamp(32px, 4vw, 64px); }
.ext-story { --ext-marker: 40px; gap: clamp(32px, 5vw, 96px); }
/* width (Artem 2026-10-23): Narrow — 1280 and centred, the frame and the timeline close together; Page — the page width */
.ext-story[data-width="narrow"] { max-width: 1280px; margin-inline: auto; }
.ext-story__media { display: none; }
.ext-story__frame img, .ext-story__photo img { width: 100%; height: 100%; object-fit: cover; }
.ext-story__timeline { position: relative; }
.ext-story__line { position: absolute; inset-inline-start: calc(var(--ext-marker) / 2 - 1px); width: 2px; background: rgb(var(--color-foreground) / .12); pointer-events: none; }
.ext-story__line > .ext-story__fill { display: block; position: absolute; inset: 0; background: rgb(var(--color-highlight)); transform-origin: top; transform: scaleY(var(--ext-fill, 0)); }
.ext-story__steps { display: grid; }
.ext-story__step { display: grid; grid-template-columns: var(--ext-marker) minmax(0, 1fr); column-gap: clamp(16px, 2vw, 32px); align-items: start; padding-block-end: 48px; }
.ext-story__step:last-child { padding-block-end: 0; }
.ext-story__marker { position: relative; z-index: 1; display: grid; place-items: center; width: var(--ext-marker); height: var(--ext-marker); border-radius: 50%; background: var(--ext-surface); box-shadow: inset 0 0 0 1px rgb(var(--color-foreground) / .12); color: rgb(var(--color-foreground) / .6); font-family: var(--font-heading-family); font-weight: var(--font-heading-weight); font-size: 15px; line-height: 1; transition: background-color .4s, color .4s, box-shadow .4s; }
.ext-story__step[data-status="active"] .ext-story__marker { background: rgb(var(--color-highlight)); color: rgb(var(--color-background)); box-shadow: none; } /* the number in the page's ground: ink on lime, white on Tech's black */
.ext-story__step[data-current] .ext-story__marker { box-shadow: 0 0 0 8px rgb(var(--color-highlight) / .16); }
.ext-story[data-markers="dots"] .ext-story__step:not([data-ext-step="buy"]) .ext-story__marker { width: 12px; height: 12px; margin: calc((var(--ext-marker) - 12px) / 2); }
.ext-story[data-markers="dots"] .ext-story__step:not([data-ext-step="buy"]) .ext-story__num { display: none; } /* the numbers stay in the markup (review #3) */
.ext-story__photo { aspect-ratio: 4 / 5; border-radius: var(--rounded-block); margin-block-end: 20px; background: var(--ext-surface); }
.ext-story__photo .ext-story__caption, .ext-story__frame .ext-story__caption { position: absolute; inset-inline: 16px; bottom: 16px; z-index: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 20px; border-radius: var(--rounded-button, 999px); background: rgb(9 9 11 / .55); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgb(245 245 244 / .12); font-size: 14px; line-height: 1; font-weight: 600; color: rgb(245 245 244); } /* over a photo: light on dark glass in every scheme */
.ext-story__caption span { white-space: nowrap; }
.ext-story__caption small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit; font-weight: 400; color: rgb(245 245 244 / .6); }
/* the step photo below 1024 is narrow (294 on a phone): a compact pill on one line */
.ext-story__photo .ext-story__caption { inset-inline: 12px; bottom: 12px; padding: 10px 14px; font-size: 12px; }
.ext-story__content, .ext-story__buy { opacity: .3; transition: opacity .25s; }
.ext-story__step[data-status="active"] :is(.ext-story__content, .ext-story__buy) { opacity: .5; }
.ext-story__step[data-current] :is(.ext-story__content, .ext-story__buy) { opacity: 1; }
.ext-story__step:focus-within :is(.ext-story__content, .ext-story__buy) { opacity: 1; } /* keyboard: a focused chip or button is never faint (review #9) */
.ext-story__content { gap: 12px; max-width: 28em; padding-block-start: calc((var(--ext-marker) - 1em) / 2); }
.ext-story__heading { font-size: clamp(24px, 2.2vw, 32px); }
.ext-story__text { font-size: clamp(16px, 1.1vw, 18px); line-height: 1.5; opacity: .7; }
/* the buy step: a card on the surface with the light edge (#152), the variant pills of the product page */
.ext-story__buy { gap: 16px; padding: clamp(20px, 2.5vw, 32px); border-radius: var(--rounded-block); background: var(--ext-surface); } /* no outline — the surface alone (Artem 2026-10-24) */
.ext-story__title { font-size: clamp(24px, 2.2vw, 32px); }
.ext-story__chips .label-swatch { padding: 12px 20px; border-radius: var(--rounded-button, 999px); box-shadow: inset 0 0 0 1px rgb(var(--color-foreground) / .2); background: none; color: rgb(var(--color-foreground)); }
.ext-story__chips .label-swatch[aria-pressed="true"] { background: rgb(var(--color-foreground)); color: rgb(var(--color-background)); box-shadow: none; }
.ext-story__chips .label-swatch:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.ext-story__price .price__regular { font-size: clamp(22px, 1.8vw, 28px); font-weight: var(--font-medium); }
/* Products mode (Artem 2026-10-23): the step's product under its text, the set's rows, the set's frame — the products' photos 2 × 2 on the surface */
.ext-story__product { margin-block-start: 4px; }
.ext-story__product .price__regular { font-weight: var(--font-medium); }
.ext-story__set-list { gap: 12px; }
.ext-story__set-item { padding-block-end: 12px; box-shadow: inset 0 -1px 0 rgb(var(--color-foreground) / .12); }
.ext-story__set-thumb { width: 56px; height: 70px; object-fit: cover; border-radius: calc(var(--rounded-block) / 2); background: rgb(var(--color-background)); flex: none; }
.ext-story__set-name { flex: 1; min-width: 0; }
/* a row's variant select (Artem 2026-10-25): a pill with the fields' fill — 5 / 8 / 11 % (#154), dark options, a chevron */
.ext-story__set-select { justify-self: start; max-width: 100%; appearance: none; -webkit-appearance: none; color-scheme: var(--ext-scheme, dark); /* the options' list: dark on Extrême, a light scheme sets --ext-scheme: light */ margin-block-start: 2px; padding: 5px 30px 5px 12px; border: 0; border-radius: 999px;
  background: rgb(var(--color-foreground) / .05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23a1a1aa' stroke-width='1.5'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center / 12px;
  color: rgb(var(--color-foreground)); font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; transition: background-color .2s; }
.ext-story__set-select:hover { background-color: rgb(var(--color-foreground) / .08); }
@media (hover: none) and (pointer: coarse) { .ext-story__set-select { font-size: 16px; } } /* below 16 px iOS zooms the page on focus */
.ext-story__set-select:focus-visible { background-color: rgb(var(--color-foreground) / .11); outline: 2px solid rgb(var(--color-foreground)); outline-offset: 2px; }
.ext-story__set-total .price__regular { font-size: clamp(22px, 1.8vw, 28px); font-weight: var(--font-medium); }
.ext-story__set-total .price__sale { color: rgb(var(--color-foreground) / .6); }
.ext-story__kit { position: absolute; inset: 0; grid-template-columns: 1fr 1fr; gap: 2px; background: rgb(var(--color-background)); }
.ext-story__kit img { width: 100%; height: 100%; object-fit: cover; background: var(--ext-surface); }
/* while a story's buy card is on screen Concept's sticky Add to cart steps aside (scroll-story.js sets html[data-ext-story-buy]) */
html[data-ext-story-buy] .product-sticky-form__card { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
@media screen and (min-width: 1024px) {
  .ext-story { --ext-marker: 48px; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .ext-story[data-media="right"] { grid-template-columns: minmax(0, 1fr) auto; } /* the frame keeps its own column on the right (review #2) */
  .ext-story[data-media="right"] .ext-story__media { order: 2; }
  .ext-story__media { display: block; position: sticky; top: var(--ext-story-top, 160px); height: var(--ext-story-frame, calc(100svh - 300px)); aspect-ratio: 4 / 5; border-radius: var(--rounded-block); overflow: hidden; background: var(--ext-surface); }
  .ext-story[data-ratio="1-1"] .ext-story__media { aspect-ratio: 1; }
  .ext-story__frame { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
  .ext-story__frame[data-active] { opacity: 1; }
  .ext-story__photo { display: none; }
  /* marker 01 starts on the frame's centre once the section sticks — the heading above the steps (in this column, Artem 2026-10-23) gives up its
     height (--ext-story-head, scroll-story.js); every step is half a frame tall, so the next one is in view */
  .ext-story__steps { padding-block-start: max(0px, calc(var(--ext-story-frame, 600px) / 2 - var(--ext-marker) / 2 - var(--ext-story-head, 0px))); }
  .ext-story__step { min-height: calc(var(--ext-story-frame, 600px) / 2); padding-block-end: 0; }
  /* the last step half a frame + half a marker tall: when the timeline's foot meets the frame's foot its marker has just crossed the centre — the buy
     step lands on the frame's bottom edge active, then the section scrolls away */
  .ext-story__step:last-child { min-height: calc(var(--ext-story-frame, 600px) / 2 + var(--ext-marker) / 2 + 2px); }
  /* the buy step: one step below 04 like every step, the card hugs its content from its marker down (Artem 2026-10-24) — the step is only as tall
     as the card, so the section ends on the card's foot: flush with the frame's foot when the frame stops sticking (Artem 2026-10-23); its marker
     can't reach the frame's centre by then, so the line's last stretch is spread over the scroll left (storyState's end, scroll-story.js) */
  .ext-story__step.ext-story__step--buy { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ext-story__frame, .ext-story__marker, .ext-story__content, .ext-story__buy { transition: none; }
}
