/* Story sections for scene pages (see scene.css): the For teachers and For learners pages.
   A photographic hero intro, glass cards over a photograph, steps joined by a rail that fills as you
   scroll, a conversation panel over a photograph, and a closing section with an arched image.
   Motion (story.js) only reveals content that is already in the page. */
.story-page {
  --story-paper: light-dark(#fbf7ef, #1a110c);
  --story-panel: light-dark(#f6efe3, #21150e);
  --story-icon-bg: light-dark(rgb(255 250 242 / .9), rgb(255 255 255 / .08));
  --story-card: light-dark(rgb(251 247 239 / .78), rgb(26 17 12 / .74));
  --scene-wave-fill: var(--story-panel);
  --story-photo-height: calc(100vw * 941 / 1672);   /* the hero photographs are 1672 × 941 */
  --story-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0 28 C250 -12 530 125 860 92 C1120 66 1260 25 1440 8 L1440 100 L0 100 Z'/%3E%3C/svg%3E");
}
html body.landing-page .story-page :is(.story-head, .story-closing) h2 { font-size: calc(clamp(2rem, 3.675vw, 3.5rem) * var(--heading-scale, 1)); }
.story-head { max-width: 40rem; }
.story-head p:not(.landing-kicker) { margin: 1.1rem 0 0; font-size: clamp(1.0625rem, 1.35vw, 1.25rem); line-height: 1.35; color: var(--scene-copy); text-wrap: pretty; }
.story-head--center { margin-inline: auto; text-align: center; }

/* Buttons in the pricing style: a gold pill and an outline pill. */
.story-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.story-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 12px 26px; border-radius: 99px; border: 1px solid transparent; background: linear-gradient(180deg, #efd3a2, var(--scene-gold-deep)) border-box; color: #2d190b; font-size: .8125rem; font-weight: 500; text-decoration: none; box-shadow: 0 10px 22px -14px rgb(120 70 20 / .8); transition: filter .2s, transform .2s, background .2s; }
.story-button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.story-button--outline { background: light-dark(rgb(255 250 242 / .35), rgb(26 17 12 / .5)); border-color: var(--scene-accent); color: var(--scene-accent); box-shadow: none; backdrop-filter: blur(6px); }
.story-button--outline:hover { background: light-dark(rgb(124 74 30 / .08), rgb(26 17 12 / .7)); filter: none; }

/* Hero intro: copy over the calm side of the photograph. */
.story-hero__inner { position: relative; }
.story-intro { max-width: 34rem; animation: story-rise 1s var(--landing-ease-out) .1s backwards; }
.story-intro h1 { max-width: 13ch; }
.story-intro .scene-lede { max-width: 36ch; }
@keyframes story-rise { from { opacity: 0; transform: translateY(24px); } }
/* The hero is as tall as the photograph at this width, so the photograph is not enlarged to fill it.
   The scene.css minimum is only for pages whose copy needs the room. */
.story-page .scene-hero { min-height: var(--story-photo-height); }
/* No gradient behind the copy: in dark mode the whole photograph dims a little more instead, so the
   light copy keeps its contrast without a shape over the person. */
:root[data-theme="dark"] .story-page .scene-hero { --scene-photo-opacity: .4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .story-page .scene-hero { --scene-photo-opacity: .4; }
}

/* Cards over a photograph, which fades in from the right. */
/* The section rises into the hero's bottom curve, so its colour and photograph fill the curve.
   The mask is the home_wave shape: clear above the curve, solid below it. */
.story-cards { margin-top: calc(-1 * var(--scene-curve)); padding-block: calc(var(--scene-curve) + clamp(4rem, 8vw, 7rem)) clamp(4rem, 8vw, 7rem); background: var(--story-panel);
  -webkit-mask: var(--story-wave) top / 100% var(--scene-curve) no-repeat, linear-gradient(#000, #000) bottom / 100% calc(100% - var(--scene-curve) + 1px) no-repeat;
  mask: var(--story-wave) top / 100% var(--scene-curve) no-repeat, linear-gradient(#000, #000) bottom / 100% calc(100% - var(--scene-curve) + 1px) no-repeat; }
.story-cards .scene-photo { object-position: 100% 50%; -webkit-mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .3) 40%, #000 75%); mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .3) 40%, #000 75%); }
.story-cards__list { container: story-cards / inline-size; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; max-width: 54rem; margin: 2.75rem 0 0; }
.story-card { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); column-gap: 1.1rem; align-items: start; padding: 1.15rem 1.35rem 1.25rem 1.1rem; border-radius: 1.25rem; background: var(--story-card); backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1); border: 1px solid var(--scene-glass-rule); box-shadow: 0 1px 0 rgb(255 255 255 / .45) inset; transition: transform .3s var(--landing-ease-out), box-shadow .3s var(--landing-ease-out); }
.story-icon { display: grid; place-items: center; grid-row: 1 / span 2; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--story-icon-bg); box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset, 0 10px 20px -14px rgb(41 24 14 / .5); color: var(--scene-accent); transition: transform .3s var(--landing-ease-out), background .3s; }
.story-card dt { margin: .15rem 0 .4rem; font-family: var(--font-display); font-size: calc(1.3rem * var(--heading-scale, 1)); line-height: 1.2; letter-spacing: -.03em; color: var(--landing-ink); }
.story-card dd { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--scene-copy-soft); }
/* At a large Text size on a phone, the icon moves above the text so the text keeps the card's width. */
@container story-cards (max-width: 16rem) {
  .story-card { grid-template-columns: minmax(0, 1fr); }
  .story-icon { grid-row: auto; margin-bottom: .75rem; }
}
@media (hover: hover) and (pointer: fine) {
  .story-card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgb(255 255 255 / .45) inset, 0 24px 44px -30px rgb(41 24 14 / .55); }
  .story-card:hover .story-icon { transform: scale(1.06) rotate(-5deg); background: var(--scene-gold); color: #4a2a0c; }
}

/* Steps: screenshots beside the copy, joined by a rail that fills as you scroll. */
.story-steps { padding-block: calc(var(--scene-curve) + clamp(4rem, 8vw, 6.5rem)) clamp(4rem, 8vw, 6.5rem); background: var(--story-paper); }
.story-steps .listening-wave--top { fill: var(--story-panel); }
.story-steps__list { position: relative; display: grid; gap: clamp(4rem, 8vw, 6.5rem); margin: clamp(3rem, 6vw, 4.5rem) 0 0; padding: 0 0 0 clamp(1.75rem, 4vw, 3.5rem); list-style: none; }
.story-steps__list::before, .story-steps__list::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 7px; width: 2px; border-radius: 2px; background: var(--landing-rule); }
.story-steps__list::after { background: linear-gradient(var(--scene-gold), var(--scene-gold-deep)); transform-origin: top; }
@supports (animation-timeline: view()) {
  [data-story-motion] .story-steps__list::after { animation: story-rail linear both; animation-timeline: view(); animation-range: entry 35% exit 65%; }
}
@keyframes story-rail { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.story-step { position: relative; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.story-step:nth-child(even) { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.story-step:nth-child(even) .story-step__copy { order: 2; }
.story-step::before { content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: calc(-1 * clamp(1.75rem, 4vw, 3.5rem)); width: 16px; height: 16px; margin-block-start: -8px; border-radius: 50%; background: var(--story-paper); border: 2px solid var(--scene-gold-deep); transition: background .4s, box-shadow .4s; }
.story-step.is-revealed::before, html:not([data-story-motion]) .story-step::before { background: var(--scene-gold-deep); box-shadow: 0 0 0 7px color-mix(in oklab, var(--scene-gold) 30%, transparent); }
.story-step__number { display: inline-block; margin-bottom: .9rem; padding: .3rem .8rem; border-radius: 99px; background: var(--scene-gold); color: #4a2a0c; font-size: .6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
html body.landing-page .story-page .story-step h3 { font-size: calc(clamp(1.6rem, 2.6vw, 2.25rem) * var(--heading-scale, 1)); line-height: 1.15; letter-spacing: -.035em; }
.story-step__copy p { max-width: 36rem; margin: 1rem 0 0; font-size: 1.05rem; line-height: 1.5; color: var(--scene-copy); }
.story-step__copy .story-step__note { font-size: .9rem; color: var(--landing-muted); }
.story-step__shot { border-radius: 1.25rem; box-shadow: 0 40px 70px -46px rgb(41 24 14 / .65); transition: transform .45s var(--landing-ease-out); }
@media (hover: hover) and (pointer: fine) { .story-step__shot:hover { transform: translateY(-5px); } }

/* A conversation in a glass panel over a photograph. */
.story-chat { position: relative; isolation: isolate; margin: 0; padding: clamp(1.25rem, 3vw, 2rem); min-height: 27rem; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; justify-items: start; border-radius: 1.5rem; overflow: hidden; box-shadow: 0 40px 70px -46px rgb(41 24 14 / .65); }
.story-chat__photo { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: 75% 50%; }
.story-chat__glass { width: min(100%, 22rem); padding: 1rem; border-radius: 1.25rem; background: var(--scene-glass); border: 1px solid var(--scene-glass-rule); backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1); box-shadow: 0 20px 40px -28px rgb(41 24 14 / .6); }
.story-chat figcaption { margin: 0 0 .75rem; color: var(--landing-muted); font-size: .78rem; }
.story-chat ol { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; margin: 0; padding: 0; list-style: none; }
.story-chat__bubble { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .3rem .7rem; max-width: 92%; padding: .6rem .85rem; border-radius: 16px 16px 16px 4px; background: light-dark(rgb(255 255 255 / .85), rgb(255 255 255 / .07)); font-size: .82rem; }
.story-chat__bubble > span:last-child { grid-column: 1 / -1; color: var(--scene-copy); }
.story-chat__bubble--you { justify-self: end; border-radius: 16px 16px 4px 16px; background: color-mix(in oklab, var(--scene-gold) 60%, transparent); }
.story-chat__who { font-weight: 600; font-size: .72rem; color: var(--landing-ink); }
.story-chat__wave { display: flex; align-items: center; gap: 3px; height: 20px; }
.story-chat__wave i { width: 3px; height: calc(30% + mod(var(--i) * 37, 9) * 8%); border-radius: 2px; background: var(--scene-accent); opacity: .8; }
.story-chat__bubble.is-revealed .story-chat__wave i { animation: story-wave 1.1s var(--landing-ease-out) both; animation-delay: calc(var(--reveal-index, 0) * 120ms + 300ms + var(--i) * 35ms); }
@keyframes story-wave { 0% { transform: scaleY(.2); } 55% { transform: scaleY(1.3); } 100% { transform: scaleY(1); } }

/* Closing: copy beside an arched still life, like the pricing page's teacher section. */
.story-closing { padding-block: clamp(4rem, 8vw, 6.5rem); background: var(--story-panel); }
.story-closing__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.story-closing__copy p { max-width: 46ch; margin: 1.25rem 0 0; font-size: 1.2rem; line-height: 1.4; color: var(--scene-copy); }
.story-closing__media { margin: 0; }
.story-closing__media img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 72% 50%; border-radius: 12rem 12rem 1.5rem 1.5rem; box-shadow: 0 30px 60px -40px rgb(41 24 14 / .6); }

/* Scroll reveals: opacity and vertical movement only. */
[data-story-motion] .story-page [data-reveal] { transition: opacity .7s var(--landing-ease-out), transform .7s var(--landing-ease-out); transition-delay: calc(var(--reveal-index, 0) * 90ms); }
[data-story-motion] .story-page [data-reveal]:not(.is-revealed) { opacity: 0; transform: translateY(28px); }

@media (max-width: 63.999rem) {
  .story-cards__list { grid-template-columns: minmax(0, 1fr); }
  /* One column: no fades or dimming over the photographs. In dark mode the hero keeps the desktop
     dimming while its copy sits over the photograph. */
  .story-page .scene-hero, .story-page .story-cards { --scene-photo-opacity: 1; }
  :root[data-theme="dark"] .story-page .scene-hero { --scene-photo-opacity: .4; }
  .story-cards .scene-photo { -webkit-mask-image: none; mask-image: none; }
  /* Without the fade, the section heading sits in the same glass as the cards so it reads over any part of the photograph. */
  .story-cards .story-head { padding: 1.35rem 1.35rem 1.5rem; border-radius: 1.25rem; background: var(--story-card); backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1); border: 1px solid var(--scene-glass-rule); }
  .story-cards .story-cards__list { margin-top: 1rem; }
}
@media (max-width: 47.999rem) {
  /* Below 48rem, where the header shows the menu button (public-header.css), the copy sits on the
     hero colour and the photograph sits below it, so no text covers a face. The photograph's top edge
     is the home page curve. The band has the photograph's shape, so nothing is cropped. */
  .story-page .scene-hero { min-height: 0; padding-bottom: var(--story-photo-height); }
  .story-page .scene-hero .scene-photo { top: auto; height: var(--story-photo-height);
    -webkit-mask: var(--story-wave) top / 100% var(--scene-curve) no-repeat, linear-gradient(#000, #000) bottom / 100% calc(100% - var(--scene-curve) + 1px) no-repeat;
    mask: var(--story-wave) top / 100% var(--scene-curve) no-repeat, linear-gradient(#000, #000) bottom / 100% calc(100% - var(--scene-curve) + 1px) no-repeat; }
  /* The closing image stays beside the copy until here, then moves below it. */
  .story-closing__inner { grid-template-columns: minmax(0, 1fr); }
  .story-step, .story-step:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .story-step:nth-child(even) .story-step__copy { order: 0; }
  .story-steps__list { padding-inline-start: 1.5rem; }
  .story-step::before { inset-block-start: .3rem; margin-block-start: 0; inset-inline-start: -1.5rem; }
  .story-chat { min-height: 24rem; padding: 1rem; }
}
@media (max-width: 63.999rem) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .story-page .story-cards { --scene-photo-opacity: 1; }
  :root:not([data-theme="light"]) .story-page .scene-hero { --scene-photo-opacity: .4; }
}
@media (max-width: 63.999rem) { :root[data-theme="dark"] .story-page .story-cards { --scene-photo-opacity: 1; } }
@media (max-width: 47.999rem) { :root:is([data-theme="dark"], :not([data-theme="light"])) .story-page .scene-hero { --scene-photo-opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .story-intro, .story-chat__wave i { animation: none !important; }
  .story-steps__list::after { animation: none !important; transform: none; }
  .story-card, .story-icon, .story-step__shot, .story-button { transition: none; }
}
