@import url("/css/scrollcraft.css") layer(scrollcraft);
/* App page template: a filmic one-shot (docs/features/site-scroll/stories/02-app-page-template.md).
   The app's own screencast is scrubbed by the scroll, and its feature list is the
   film's chapter list. Tokens only (css/site.css). The scroll engine (css/scrollcraft.css)
   is vendored unchanged and imported into the scrollcraft layer that site.css declares
   first, so brand components always win. No shadows, gradients or tilts. Pages without a
   screencast (.app-still) keep the same chrome and close with a still in the frame. */
:root{
  --sc-canvas:var(--color-surface);--sc-surface:var(--color-surface-sunken);
  --sc-ink:var(--color-ink);--sc-ink-soft:var(--color-ink-muted);
  --sc-accent:var(--color-focus);--sc-accent-ink:var(--color-white);
  --sc-font-display:var(--font-sans);--sc-font-text:var(--font-sans);--sc-font-mono:var(--font-mono);
  --hdr:65px;
}
.app-main{--app-bar:49px;padding-bottom:0}
.app-main p{margin:0}
.app-main h1,.app-main h2,.app-main h3{margin:0;color:var(--color-ink);text-wrap:balance}

/* The chrome: a sticky app bar under the site header. It carries the one
   action of the page for the whole scroll. */
.app-bar{position:sticky;top:var(--hdr,65px);z-index:9;background:var(--color-surface);border-bottom:1px solid var(--color-line-subtle)}
.app-bar-inner{max-width:var(--container-site);margin:0 auto;padding:0 16px;height:48px;display:flex;align-items:center;gap:12px}
.app-bar-back{font-size:14px;color:var(--color-ink-muted);margin-right:8px;padding-right:16px;border-right:1px solid var(--color-line-subtle)}
.app-bar-back:hover{color:var(--color-ink);text-decoration:underline;text-underline-offset:3px}
.app-bar img{border-radius:var(--radius-sm)}
.app-bar strong{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.app-bar-short{display:none}
.app-bar .btn-primary,.app-bar .btn-soon{margin-left:auto;min-height:36px;padding:0 16px;font-size:14px;white-space:nowrap}

/* 1 · The film: copy and chapters left, the screen right. */
.app-stage{background:var(--color-surface)}
.app-stage-inner{max-width:var(--container-site);height:100%;margin:0 auto;padding:calc(var(--hdr,65px) + var(--app-bar) + 28px) 16px 24px;display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.35fr);gap:48px;align-items:center}
.app-copy{min-width:0}
.app-copy h1{font-size:36px;line-height:1.1;font-weight:700;letter-spacing:-.02em}
.app-copy h1 span{color:inherit}
.app-intro{margin-top:12px!important;font-size:17px;line-height:1.5;max-width:42ch}
.app-links{margin-top:10px!important;font-size:14px;color:var(--color-ink-muted)}
.app-links a{color:var(--color-link);font-weight:600}
.app-links a:hover{color:var(--color-link-hover);text-decoration:underline;text-underline-offset:3px}
.app-chapters{margin-top:24px}
.app-chapters-title{font-size:13px;font-weight:600;color:var(--color-ink-muted);padding-bottom:6px;border-bottom:1px solid var(--color-line-subtle);font-variant-numeric:tabular-nums}
.app-chapters ol{list-style:none;margin:0;padding:0}
.app-chapters li{border-bottom:1px solid var(--color-line-subtle)}
.app-chapters a{display:grid;grid-template-columns:40px minmax(0,1fr);gap:8px;padding:7px 0;color:var(--color-ink-muted);text-decoration:none;font-size:14px;line-height:1.4;transition:color .15s ease}
.app-chapters a:hover{color:var(--color-ink)}
.app-chapters time{font-variant-numeric:tabular-nums;font-size:13px;padding-top:1px}
.app-chapters a span{overflow:hidden;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}
.app-chapters b{font-weight:600}
.app-chapters li.is-past a{color:var(--color-ink)}
.app-chapters li.is-now a{color:var(--color-ink)}
.app-chapters li.is-now a span{-webkit-line-clamp:2}
.app-chapters li.is-now time{color:var(--color-white);background:var(--color-navy);border-radius:var(--radius-sm);text-align:center;align-self:start}

.app-frame{margin:0;min-width:0}
.app-screen{position:relative;aspect-ratio:16/9;max-width:100%;border:1px solid var(--color-line);border-radius:var(--radius-lg);overflow:hidden;background:var(--color-surface-sunken)}
.app-screen>img,.app-screen>video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.app-native{z-index:2;object-fit:contain;background:var(--color-surface-sunken)}
.app-playhead{display:flex;align-items:center;gap:12px;margin-top:12px}
.app-track{position:relative;flex:1;height:4px;border-radius:var(--radius-pill);background:var(--color-line-subtle);overflow:visible}
.app-fill{position:absolute;inset:0;border-radius:var(--radius-pill);background:var(--color-navy);transform-origin:left center;transform:scaleX(0)}
.app-track .app-tick{position:absolute;top:-3px;width:2px;height:10px;border-radius:1px;background:var(--color-line)}
.app-track .app-tick.is-past{background:var(--color-navy)}
.app-clock{font-size:13px;color:var(--color-ink-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.app-frame figcaption{margin-top:10px;font-size:13px;line-height:1.5;color:var(--color-ink-muted);max-width:72ch}

/* 2 · The details: a ledger, each line pointing back into the film. */
.app-details{padding:96px 0 64px;border-top:1px solid var(--color-line-subtle)}
.app-details-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.7fr);gap:48px;align-items:start}
.app-details-head h2{font-size:28px;line-height:1.15;font-weight:700;letter-spacing:-.015em}
.app-details-head p{font-size:17px;line-height:1.6;max-width:none}
.app-ledger{list-style:none;margin:48px 0 0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:48px;border-top:1px solid var(--color-line-subtle)}
.app-ledger li{padding:24px 0;border-bottom:1px solid var(--color-line-subtle);display:flex;flex-direction:column;gap:8px;scroll-margin-top:calc(var(--hdr,65px) + var(--app-bar) + 16px)}
.app-ledger-tag{font-size:13px;font-weight:600;color:var(--color-ink-muted)}
.app-ledger h3{font-size:19px;line-height:1.3;font-weight:600}
.app-ledger li>p:not(.app-ledger-tag){font-size:15px;line-height:1.6}
.app-seen{margin-top:4px;font-size:14px;font-weight:600;color:var(--color-link);align-self:flex-start}
.app-seen:hover{color:var(--color-link-hover);text-decoration:underline;text-underline-offset:3px}
.app-seen-none{color:var(--color-ink-muted);font-weight:400}

/* 3 · The close: the film's last frame, held, beside the facts and the one action. */
.app-close-stage{background:var(--color-surface-sunken)}
.app-close-inner{max-width:var(--container-site);height:100%;margin:0 auto;padding:calc(var(--hdr,65px) + var(--app-bar) + 24px) 16px 32px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:56px;align-items:center}
.app-end{margin:0;border:1px solid var(--color-line);border-radius:var(--radius-lg);overflow:hidden;background:var(--color-surface)}
.app-end img{width:100%;height:auto}
.app-close-copy h2{font-size:34px;line-height:1.15;font-weight:700;letter-spacing:-.015em}
.app-facts{display:grid;gap:16px;margin:24px 0 32px}
.app-facts div{padding-top:16px;border-top:1px solid var(--color-line)}
.app-facts h3{font-size:17px;font-weight:600}
.app-facts p{margin-top:4px!important;font-size:15px;line-height:1.55}
html:not(.sc-ready) .app-close-stage{min-height:0}
/* Without the engine (no JavaScript) nothing is left waiting for an entrance. */
html:not(.sc-ready) .app-main [data-sc-in],html:not(.sc-ready) .app-main [data-sc-stagger]>*{opacity:1;transform:none}

/* Pages without a screencast: the frame holds a still (or the page's own figure), the
   chapters are a plain feature index, and the ledger links keep pointing at the guides. */
.app-still .app-screen>img{object-fit:cover;object-position:top left}
.app-still .app-chapters a{grid-template-columns:minmax(0,1fr)}
/* Never pinned, so it does not pad for the header and app bar a pinned stage sits under. */
.app-still .app-stage-inner{padding-top:56px;padding-bottom:56px}
.app-guide{margin-top:4px;font-size:14px;font-weight:600;color:var(--color-link);align-self:flex-start}
.app-guide:hover{color:var(--color-link-hover);text-decoration:underline;text-underline-offset:3px}
.app-more{margin-top:32px!important;font-size:15px;line-height:1.6;color:var(--color-ink)}
.app-more a{color:var(--color-link);font-weight:600}
.app-more a:hover{color:var(--color-link-hover);text-decoration:underline;text-underline-offset:3px}
.app-close-solo .app-close-inner{grid-template-columns:minmax(0,1fr);max-width:var(--container-site)}
.app-close-solo .app-close-copy{max-width:720px}
.app-close-solo .app-close-stage{min-height:0}
.app-close-solo .app-close-inner{height:auto;padding-top:96px;padding-bottom:96px}

@media(min-width:768px){.app-bar-inner,.app-stage-inner,.app-close-inner{padding-left:24px;padding-right:24px}.app-copy h1{font-size:44px}}
@media(max-width:1000px){.app-stage-inner{gap:28px}.app-chapters a span{-webkit-line-clamp:1}}
@media(max-width:760px){
  .app-bar-back{display:none}
  .app-bar strong{font-size:14px;white-space:normal;overflow:visible;line-height:1.2}
  .app-bar .btn-primary,.app-bar .btn-soon{font-size:14px;padding:0 14px}
  .app-bar-long{display:none}
  .app-bar-short{display:inline}
  .app-stage-inner{grid-template-columns:1fr;align-content:center;gap:14px;padding-top:calc(var(--hdr,65px) + var(--app-bar) + 16px)}
  .app-copy h1{font-size:24px}
  .app-intro{font-size:15px;margin-top:6px!important}
  .app-links{display:none}
  .app-chapters{margin-top:12px}
  /* A short rolling list under the clip: the current chapter and the next two
     (the first three before the film starts), so the phone stage reads full. */
  .app-chapters-title{display:block;margin-top:4px}
  .app-chapters li{display:none}
  .app-chapters li.in-window{display:block}
  .app-still .app-chapters li{display:block}
  .app-still .app-stage-inner{padding-top:32px;padding-bottom:32px}
  .app-still .app-links{display:block}
  .app-chapters a{padding:8px 0;font-size:15px}
  .app-chapters li.is-now a span{-webkit-line-clamp:3}
  .app-chapters li:not(.is-now) a span{-webkit-line-clamp:2}
  .app-close-stage{min-height:0}
  .app-close-inner{height:auto;padding-top:56px;padding-bottom:56px}
  .app-details{padding:64px 0 32px}
  .app-details-head{grid-template-columns:1fr;gap:16px}
  .app-details-head h2{font-size:24px}
  .app-ledger{grid-template-columns:1fr;margin-top:32px}
  .app-close-solo .app-close-inner{padding-top:56px;padding-bottom:56px}
  .app-close-inner{grid-template-columns:1fr;gap:20px;align-content:start;padding-top:calc(var(--hdr,65px) + var(--app-bar) + 16px)}
  .app-close-copy h2{font-size:24px}
  .app-facts{gap:10px;margin:14px 0 20px}
  .app-facts div{padding-top:10px}
  .app-facts p{font-size:14px}
}
@media(max-width:760px) and (max-height:700px){.app-intro{display:none}.app-chapters li.is-now a span,.app-chapters li:not(.is-now) a span{-webkit-line-clamp:1}.app-chapters a{padding:6px 0}.app-frame figcaption{display:none}.app-facts p{display:none}}
/* The film runs when the engine will run it: scripting on and motion allowed (js/app-page.js
   decides the same way). Its boxes are drawn from the first paint, as css/home.css does, so the
   engine's mount moves nothing (it moved the screen 77px and the page below it, CLS 0.30, when
   these waited for the script). Heights match data-sc-span. On phones the close is not pinned. */
@media (scripting:enabled) and (prefers-reduced-motion:no-preference){
  .app-film[data-sc-act]{height:420vh}
  .app-film[data-sc-act] [data-sc-stage]{position:sticky;top:0;height:100vh;height:100svh;overflow:clip}
  .app-film[data-sc-act] .app-native{display:none}
}
@media (scripting:enabled) and (prefers-reduced-motion:no-preference) and (min-width:761px){
  .app-close[data-sc-act]{height:130vh}
  .app-close[data-sc-act] [data-sc-stage]{position:sticky;top:0;height:100vh;height:100svh;overflow:clip}
}
@media (max-width:760px) and (scripting:enabled) and (prefers-reduced-motion:no-preference){
  /* The film starts under the sticky header and app bar, so a phone's first screen is the
     pinned frame itself (as the home page's first act), not that frame pushed down by the
     chrome it already pads for: the chapter rows would run off the bottom. Desktop keeps the
     board's first screen (02-desktop-1-film-start). */
  .app-film[data-sc-act]{margin-top:calc(-1 * (var(--hdr) + var(--app-bar)))}
  .app-film[data-sc-act] .app-frame{order:-1}
  .app-film[data-sc-act] .app-frame figcaption{display:none}
  /* Until the script marks the rolling window, its first rows hold the place. */
  html:not(.sc-film-on) .app-film[data-sc-act] .app-chapters li:nth-child(-n+3){display:block}
}
@media (max-width:760px) and (min-height:880px) and (scripting:enabled) and (prefers-reduced-motion:no-preference){
  html:not(.sc-film-on) .app-film[data-sc-act] .app-chapters li:nth-child(4){display:block}
}
/* Without the engine (no JavaScript, or reduced motion) the native player takes the frame. */
@media (scripting:none),(prefers-reduced-motion:reduce){
  .app-screen>video[data-sc-scrub]{display:none}
  .app-playhead{display:none}
}
@media (max-width:760px) and (scripting:none),(max-width:760px) and (prefers-reduced-motion:reduce){
  .app-chapters li{display:block;border-bottom:1px solid var(--color-line-subtle)}
  .app-chapters a{padding:6px 0}
}
@media(prefers-reduced-motion:reduce){.app-main *{transition:none!important}}
