@import url('./film-atmosphere.css');
/* Scoped to this pre-rendered overlay; the live Lilies story keeps its own styling. */
.sequence-story-live { z-index: 10000; background: transparent!important; }
.sequence-story[hidden].is-prewarming { display:block; visibility:hidden; pointer-events:none; }
.sequence-load-hint { position:absolute; inset:auto 12px 12px; width:max-content; max-width:calc(100% - 24px); padding:5px 9px; border-radius:20px; background:#111b; color:#fff; pointer-events:none; font:11px/1.5 var(--sans,Arial); z-index:1; }
.sequence-story .story-product { position:absolute; inset:0; width:100%; height:100%; z-index:3; pointer-events:none; }
.sequence-story .story-scrim { position:absolute; inset:0; z-index:1; pointer-events:none; }
.sequence-story-live:not(.is-ready) .story-scrim { visibility:hidden; }
.sequence-story-live.is-transitioning .story-product { visibility:hidden; }
.sequence-story-live:not(.is-ready) .story-product { visibility:hidden; }
/* Back keeps the frozen scene until the prepared return flight paints. Its
   native reverse clock then fades these surfaces together under the grains. */
.sequence-story-live.is-return-scene .story-product,
.sequence-story-live.is-return-scene .film-atmosphere[data-active="1"] { visibility:visible; }
.sequence-story-live .story-scroll { z-index: 2; pointer-events: none; }
.sequence-story-live.is-ready .story-scroll { pointer-events: auto; }
.sequence-story-live .story-bar { z-index: 5; opacity: 1; }
.sequence-story.sequence-story-live .seq-status { display: none; }
.sequence-story-live:is(.is-loading,.is-error) .seq-status { display: grid; }
.sequence-story-live .seq-status a { text-decoration: underline; text-underline-offset: 5px; }
.sequence-story-live .seq-status a:hover { opacity: .65; }
.sequence-story-live.is-transitioning :is(.story-bar,.seq-footnote,.seq-labels) { visibility: hidden; }
.sequence-story-live .sequence-sand { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.sequence-story-live .sequence-source { max-width: min(70vw,500px); }
.sequence-story {
  --ground: #e8e4dc;
  --ink: #302b24;
  --ink-soft: #60584c;
  --muted: #6a6256;
  --line: rgb(93 74 50 / .15);
  --line-strong: rgb(93 74 50 / .28);
  --display: 'Clash Display', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(.2,.75,.2,1);
  position: fixed; inset: 0; isolation: isolate; overflow: hidden;
  background: var(--ground); color: var(--ink); font-family: var(--sans);
}
.sequence-story *, .sequence-story *::before, .sequence-story *::after { box-sizing: border-box; }
.sequence-story[hidden] { display: none; }
.sequence-story .story-back { position: absolute; inset: 0; background: radial-gradient(ellipse at 65% 36%,#f5f1e8 0%,transparent 60%),linear-gradient(155deg,#e5e0d6,#eeeae2 55%,#dbd5c9); }
.sequence-story .story-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sequence-story .story-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: none; outline: none; opacity: 0; transition: opacity .6s var(--ease); }
.sequence-story .story-scroll::-webkit-scrollbar { display: none; }
.sequence-story.is-ready .story-scroll { opacity: 1; }
.sequence-story .st-ch { position: relative; height: 115vh; padding-top: 1px; }
.sequence-story .st-ch:first-child { height: 100vh; }
.sequence-story .st-ch.st-end { height: 150vh; }
.sequence-story .st-panel { position: sticky; top: clamp(100px,22vh,240px); margin-left: clamp(24px,4.6vw,100px); width: min(335px,32vw); padding: 24px; border: 1px solid rgb(255 255 255 / .62); border-radius: 18px; background: linear-gradient(145deg,rgb(255 253 246 / .90),rgb(244 239 228 / .67)); box-shadow: 0 1px 0 rgb(255 255 255 / .6) inset,0 20px 55px -30px rgb(84 62 32 / .27); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease),transform .65s var(--ease); }
.sequence-story .st-ch.is-on .st-panel { opacity: 1; transform: none; }
.sequence-story .st-ch:not(.is-on) .st-panel { visibility: hidden; pointer-events: none; }
.sequence-story .st-panel-right { margin-left: auto; margin-right: clamp(24px,4.6vw,100px); }
.sequence-story .st-panel-wide { width: min(420px,36vw); }
.sequence-story .st-k { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font: 400 9px/1.5 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.sequence-story .st-panel h2 { margin: 20px 0 12px; max-width: 12ch; color: var(--ink); font: 400 clamp(28px,3.1vw,46px)/1.02 var(--display); letter-spacing: -.045em; text-wrap: balance; }
.sequence-story .st-panel p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.sequence-story .st-panel p+p { margin-top: 10px; }
.sequence-story .st-src { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px!important; color: var(--muted)!important; font: 9px/1.65 var(--mono)!important; letter-spacing: .015em; }
.sequence-story .st-cue { display: flex; align-items: center; gap: 9px; margin-top: 26px; color: var(--muted); font: 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.sequence-story .st-cue i { display: block; width: 1px; height: 21px; transform-origin: top; background: var(--muted); animation: seq-cue 2.4s var(--ease) infinite; }
@keyframes seq-cue { 0%,8% { transform: scaleY(0); opacity: 0; } 50%,65% { transform: scaleY(1); opacity: .9; } 100% { transform: scaleY(1); opacity: 0; } }
.sequence-story button, .sequence-story a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sequence-story button:not(.tn-link) { font: inherit; cursor: pointer; }
.sequence-story a { color: inherit; text-decoration: none; }
.sequence-story .st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 10px 15px; background: transparent; color: var(--ink); font: 500 12px/1.3 var(--sans); transition: background-color .22s var(--ease),color .22s var(--ease),transform .35s var(--ease),box-shadow .22s var(--ease); }
.sequence-story .st-btn.dark { background: var(--ink); color: #fbf7ee; border-color: var(--ink); }
.sequence-story .st-btn:hover { background: #ded5c5; transform: translateY(-2px); box-shadow: 0 7px 18px -10px rgb(67 48 20 / .5); }
.sequence-story .st-btn.dark:hover { background: #63523d; color: #fffaf0; }
.sequence-story .st-btn:active { transform: scale(.97); }
.sequence-story :is(a,button):focus-visible { outline: 2px solid #96703e; outline-offset: 4px; }
.sequence-story button:disabled { cursor: default; opacity: .55; transform: none; }
.sequence-story .st-play-cta { margin-top: 18px; min-width: 150px; justify-content: space-between; }
.sequence-story .st-play-arrow { font-size: 17px; font-weight: 400; }
.sequence-story .st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sequence-story .st-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.sequence-story .st-next { display: flex; align-items: center; gap: 9px; min-height: 63px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: rgb(255 255 255 / .2); transition: transform .3s var(--ease),background-color .25s var(--ease),border-color .25s var(--ease); }
.sequence-story .st-next img { width: 40px; height: 46px; object-fit: cover; border-radius: 5px; }
.sequence-story .st-next small { display: block; color: var(--muted); font: 8px/1.4 var(--mono); letter-spacing: .025em; }
.sequence-story .st-next b { display: block; margin-top: 5px; font-size: 12px; font-weight: 500; }
.sequence-story .st-next:hover { background: rgb(255 255 255 / .6); border-color: var(--line-strong); transform: translateY(-2px); }
.sequence-story .st-next:active { transform: scale(.98); }
.sequence-story .seq-footnote { position: absolute; bottom: max(21px,env(safe-area-inset-bottom)); left: clamp(24px,4.6vw,100px); right: 24px; z-index: 2; display: flex; justify-content: space-between; gap: 20px; pointer-events: none; color: var(--muted); font: 9px/1.4 var(--mono); letter-spacing: .075em; text-transform: uppercase; }
.sequence-story .seq-footnote span:last-child { text-align: right; }
.sequence-story .seq-status { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; gap: 10px; padding: 30px; color: var(--ink-soft); background: var(--ground); text-align: center; font: 12px/1.7 var(--mono); transition: opacity .35s var(--ease); }
.sequence-story.is-ready .seq-status { opacity: 0; pointer-events: none; }
.sequence-story .seq-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.sequence-story .seq-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 9px; color: #60523f; opacity: 0; font: 9px/1.35 var(--mono); white-space: nowrap; }
.sequence-story .seq-label:not([hidden]) { opacity: 1; }
.sequence-story .seq-label[hidden] { display: none; }
.sequence-story .seq-label i { width: 5px; height: 5px; border: 1px solid #826842; border-radius: 50%; box-shadow: 0 0 0 3px rgb(249 244 232 / .75); }
.sequence-story .seq-label span { padding: 5px 7px; border: 1px solid rgb(255 255 255 / .5); border-radius: 4px; background: rgb(245 240 229 / .82); }
.sequence-story .seq-label--left { flex-direction: row-reverse; }
.sequence-story .seq-label--left span { position: absolute; right: 15px; }
@media (max-width: 700px) {
  .sequence-story .st-panel { top: max(86px,calc(env(safe-area-inset-top) + 68px)); margin-left: 18px; margin-right: 18px; width: calc(100% - 36px); max-width: 440px; padding: 17px 19px; border-radius: 15px; }
  .sequence-story .st-panel h2 { max-width: none; margin-top: 12px; margin-bottom: 9px; font-size: 29px; }
  .sequence-story .st-panel p { font-size: 12px; line-height: 1.6; }
  .sequence-story .st-k { font-size: 8px; letter-spacing: .12em; }
  .sequence-story .st-cue { display: inline-flex; margin-top: 14px; font-size: 8px; }
  .sequence-story .st-cue i { height: 15px; }
  .sequence-story .st-play-cta { margin-top: 13px; margin-left: 18px; min-width: 130px; min-height: 36px; font-size: 11px; }
  .sequence-story .st-src { margin-top: 11px!important; padding-top: 9px; font-size: 8px!important; }
  .sequence-story .seq-footnote { left: 20px; right: 20px; bottom: max(17px,env(safe-area-inset-bottom)); font-size: 7px; letter-spacing: .05em; }
  .sequence-story .seq-footnote span:first-child { max-width: 190px; }
  .sequence-story .st-end .st-panel h2 { font-size: 27px; }
  .sequence-story .st-nav { margin-top: 12px; }
  .sequence-story .st-actions { margin-top: 12px; }
  .sequence-story .st-actions .st-btn { min-height: 37px; padding: 8px 12px; font-size: 11px; }
  .sequence-story .seq-label { font-size: 7px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .sequence-story .st-panel { top: 84px; padding: 15px; width: min(300px,35vw); margin-left: 22px; }
  .sequence-story .st-panel h2 { font-size: 26px; margin-top: 10px; }
  .sequence-story .st-panel p { font-size: 11px; line-height: 1.5; }
  .sequence-story .st-src { font-size: 7px!important; margin-top: 10px!important; padding-top: 8px; }
  .sequence-story .seq-footnote { font-size: 7px; bottom: 12px; }
  .sequence-story .st-end .st-panel { width: min(430px,44vw); top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .sequence-story *, .sequence-story *::before, .sequence-story *::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
  .sequence-story .st-cue i { transform: none; opacity: .7; }
}

/* Media tone belongs to the film, never the surrounding site's theme. */
.sequence-story[data-tone="dark"] { --ground:#0c0d0f; --ink:#fbf7ee; --ink-soft:#eee9df; --muted:#cdc7bd; --line:#ffffff26; --line-strong:#ffffff52; }
.sequence-story[data-tone="light"] { --ground:#efede7; --ink:#252a2c; --ink-soft:#394043; --muted:#51585b; --line:#18202a26; --line-strong:#18202a52; }
.sequence-story[data-tone="dark"] .story-back { background:#080808; }
.sequence-story[data-tone="dark"] .story-scrim { background:linear-gradient(to top,#0c0d0fd9,transparent 65%); }
.sequence-story[data-tone="light"] .story-scrim { background:linear-gradient(to top,#fbf7eee0,transparent 65%); }
/* Jun: keep Eco Hub's delivered colours clear of the bottom and side scrims. */
.sequence-story[data-project="a02"] :is(.story-scrim,.sm-scrim) { background:none!important; }
.sequence-story[data-tone="dark"] .st-panel { background:linear-gradient(145deg,#101215dc,#101215a6); border-color:#ffffff30; box-shadow:0 16px 45px -25px #000b; }
.sequence-story[data-tone="light"] .st-panel { background:linear-gradient(145deg,#fffdf5ef,#f5f1e7db); }
@media (prefers-reduced-motion: reduce) {
  .shared-story-bar, .shared-story-bar * { transition: none!important; }
}
.sequence-story[data-tone="dark"] .st-btn.dark { color:#15191b; }
.sequence-story[data-tone="dark"] .st-btn:hover,.sequence-story[data-tone="dark"] .st-next:hover { background:#ffffff20; color:#fffaf0; }
.sequence-story[data-tone="dark"] .seq-label { color:#fbf7ee; }
.sequence-story[data-tone="dark"] .seq-label span { background:#14171bdc; border-color:#ffffff30; }
.sequence-story-live .sequence-sand { z-index:6; }
/* Film annotations raise the scroll layer to 4. The shared template's later
   z-index:3 used to steal hover hits from Back/Play despite click forwarding. */
.sequence-story .story-bar.shared-story-bar { z-index:7; }

/* Lilies uses its real day/night signal while remaining independent of the site toggle. */
#story { --ground:#eeeae2; --ground-2:#f8f5ee; --ink:#302b24; --ink-soft:#60584c; --muted:#817667; --line:#352c2226; --line-strong:#352c2247; }
#story.is-night { --ground:#0c0d0f; --ground-2:#14161b; --ink:#fbf7ee; --ink-soft:#eee9df; --muted:#cdc7bd; --line:#ffffff26; --line-strong:#ffffff47; }
#story.is-night .st-panel { background:linear-gradient(to top,#0c0d0fe6,#0c0d0fa8); border-color:#ffffff30; }
#story.is-night .st-btn.dark { background:#fbf7ee; color:#15191b; }
#story .story-gl{z-index:0}#story .story-scroll{z-index:2}#story .story-bar{z-index:5}
#story::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(to top,#0c0d0fcc,transparent 65%);opacity:0;transition:opacity .45s var(--ease)}
#story.is-night.is-ready::before{opacity:1}
#story.is-returning .story-gl{clip-path:inset(var(--sand-return-top,0px) 0 var(--sand-return-bottom,0px) 0)}

/* Apply to the whole stacking context, not just its sand canvas. A fading
   backdrop or the last 2D/product frame can otherwise cover the page chrome. */
.sequence-story:is(.is-returning,.is-opening),#story:is(.is-returning,.is-opening){
  clip-path:inset(var(--sand-return-top,0px) 0 var(--sand-return-bottom,0px) 0);pointer-events:none;
}

/* Live Lilies returns through the same independent film flight surface. */
#story > .sequence-sand{position:absolute;inset:0;width:100%;height:100%;z-index:6;pointer-events:none}

/* One balanced action row for live and film story heroes. */
:is(.story,.sequence-story) .st-hero-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:20px;margin-top:18px}
:is(.story,.sequence-story) .st-hero-actions>.st-cue{margin:0;line-height:1}
:is(.story,.sequence-story) .st-hero-actions>.st-play-cta{display:inline-flex;align-items:center;justify-content:center;gap:9px;margin:0;min-height:44px;padding:12px 18px;line-height:1}
:is(.story,.sequence-story) .st-play-arrow{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;line-height:0;flex:none}
.st-play-arrow svg{display:block;width:16px;height:16px}
@media(max-width:760px){:is(.story,.sequence-story) .st-hero-actions{gap:12px}:is(.story,.sequence-story) .st-hero-actions>.st-cue{font-size:8px;letter-spacing:.12em}:is(.story,.sequence-story) .st-hero-actions>.st-play-cta{min-width:130px;padding:11px 14px}}

/* Jun: one standard backdrop behind every story transition: the light page colour in light mode, near-black in dark
   mode, like Lilies. The film's own dark stage only takes over once its frame is fully in. */
html.light .sequence-story:is(.is-transitioning,.is-opening,.is-returning,.is-revealing) .story-back{ background:radial-gradient(125% 95% at 50% 22%, #faf7f0 0%, #efeadd 58%, #e6dfce 100%); }
html:not(.light) .sequence-story:is(.is-transitioning,.is-opening,.is-returning,.is-revealing) .story-back{ background:var(--ground,#0c0d0f); }
