/* Motion layer: the hero opening, the translation scroll, stage lights, the living ISLA report,
   count-ups and the micro-habit grid. Engine scenes come from /cinema/1.29 (Cinematic Shell).
   Everything here turns off for reduced motion and falls back to the finished state. */
:root { --bg: var(--kelp); --font-display: var(--serif); --muted: var(--sage-2); }

/* ---------- Home hero: slow push-in on load, headline writes itself in ---------- */
@keyframes heroPush { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes hwRise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes hwFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-photo { overflow: hidden; }
.hero-photo img { animation: heroPush 2.8s cubic-bezier(.22,1,.36,1) both; transform-origin: 62% 40%; }
.hero h1 .hw { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; margin-bottom: -.06em; }
.hero h1 .hw > span { display: inline-block; animation: hwRise 1.1s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(.25s + var(--i, 0) * .16s); }
.hero .eyebrow, .hero .lede, .hero .translate, .hero .hero-actions { animation: hwFade .9s cubic-bezier(.22,1,.36,1) both; }
.hero .eyebrow { animation-delay: .1s; }
.hero .lede { animation-delay: .75s; }
.hero .translate { animation-delay: .95s; }
.hero .hero-actions { animation-delay: 1.1s; }
.hero-creds li { animation: hwFade .8s cubic-bezier(.22,1,.36,1) both; animation-delay: calc(1.1s + var(--i, 0) * .08s); }
.hero [data-reveal] { opacity: 1; transform: none; transition: none; }

/* ---------- Translation scroll (engine scene: rewrite) ---------- */
.scene-rewrite { --rw-bg: transparent; --rw-pen: var(--apricot); --rw-to: #f6f4ee; --rw-from-font: var(--mono); color: var(--paper); background: var(--kelp); }
.scene-rewrite .stage { background: radial-gradient(900px 600px at 85% 15%, rgba(47, 107, 98, .55), transparent 60%), linear-gradient(90deg, rgba(23, 36, 31, .96) 0%, rgba(23, 36, 31, .9) 55%, rgba(23, 36, 31, .62) 100%), url(/img/stage-white.webp) right center / cover no-repeat, var(--kelp); max-width: none; }
.rw-head { max-width: 1240px; width: 100%; margin: 0 auto; }
.rw-head h2 { font-size: clamp(34px, 4vw, 56px); line-height: 1.04; color: var(--paper); max-width: 18ch; }
.rw-head h2 em { color: #9fd3c6; }
.scene-rewrite .rw-list, .scene-rewrite .rw-foot { max-width: 1240px; width: 100%; margin: 0 auto; }
.scene-rewrite .rw-k { font-family: var(--mono); color: #c8b48f; opacity: 1; font-size: 12px; }
.scene-rewrite .rw-from { color: #cbd5ce; opacity: .85; }
.scene-rewrite .rw-to { font-style: italic; color: #f6f4ee; max-width: 16ch; }
.scene-rewrite .rw-to em { color: #9fd3c6; }
.rw-foot { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.scene-rewrite .rw-count { font-family: var(--mono); color: #c8b48f; }
.rw-dots { display: flex; gap: 6px; }
.rw-after { display: flex; gap: 12px; flex-wrap: wrap; }
.is-reduced .scene-rewrite .rw-after, .scene-rewrite:not(.rw-live) .rw-after { opacity: 1; visibility: visible; }
.scene-rewrite:not(.rw-live) .rw-count { display: none; }
@media (max-width: 760px) {
  .scene-rewrite .stage { background: linear-gradient(0deg, rgba(23, 36, 31, .97) 0%, rgba(23, 36, 31, .9) 70%, rgba(23, 36, 31, .7) 100%), url(/img/stage-white.webp) 60% center / cover no-repeat, var(--kelp); }
  .scene-rewrite .rw-to { font-size: clamp(34px, 10vw, 46px); }
  .rw-live .rw-list { min-height: 300px; }
}

/* ---------- Speaking: stage lights (engine scene: ignite) ---------- */
.scene-ignite.sp-hero { color: var(--paper); background: #050404; }
.sp-hero .ig-copy { left: 0; right: 0; bottom: 0; top: 0; display: flex; flex-direction: column; justify-content: center; padding: 120px max(32px, calc((100vw - 1240px) / 2)) 80px; background: linear-gradient(90deg, rgba(5, 4, 4, .82) 0%, rgba(5, 4, 4, .5) 40%, rgba(5, 4, 4, 0) 62%); }
.sp-hero .ig-copy .crumb { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: #c8b48f; margin: 0 0 26px; display: flex; gap: 10px; }
.sp-hero .ig-copy .crumb a { color: #dfe6e1; text-decoration: none; }
.sp-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 7vw, 110px); line-height: .96; letter-spacing: -.035em; max-width: 11ch; margin: 0; }
.sp-hero h1 em { color: #9fd3c6; font-style: italic; }
.sp-hero .lede { color: #e2e8e4; margin: 24px 0 0; max-width: 560px; }
.sp-hero .ig-base img, .sp-hero .ig-lights img { object-position: 72% 50%; }
@media (max-width: 760px) {
  .scene-ignite.sp-hero { height: 92svh; }
  .sp-hero .ig-copy { justify-content: flex-end; padding: 0 16px 48px; background: linear-gradient(0deg, rgba(5, 4, 4, .94) 0%, rgba(5, 4, 4, .7) 45%, rgba(5, 4, 4, 0) 75%); }
  .sp-hero h1 { font-size: clamp(46px, 13vw, 64px); }
}
.is-reduced .scene-ignite.sp-hero, html:not(.is-cinema):not(.ig-pre) .scene-ignite.sp-hero { min-height: 640px; }

/* ghost words behind the reel */
.reel-sec { position: relative; overflow: clip; }
.reel-sec.sec { padding-top: calc(clamp(72px, 10vw, 150px) + 56px); }
.reel-ghost { position: absolute; left: 0; top: 28px; white-space: nowrap; font-family: var(--serif); font-size: clamp(72px, 10vw, 150px); line-height: 1; letter-spacing: -.03em; color: transparent; -webkit-text-stroke: 1px rgba(159, 211, 198, .2); pointer-events: none; z-index: 0; }
.reel-ghost .gw-fill { color: rgba(227, 154, 59, .1); -webkit-text-stroke: 0; }
.reel-sec .wrap { position: relative; z-index: 1; }

/* ---------- Living ISLA report ---------- */
.report .marker .bar i { transform-origin: 0 50%; }
.is-cinema .report .marker[data-in] .bar i { transform: scaleX(0); transition: transform 1.3s cubic-bezier(.22,1,.36,1); transition-delay: calc(.25s + var(--d, 0) * .12s); }
.is-cinema .report .marker[data-in].is-in .bar i { transform: none; }
.is-cinema .report .marker[data-in] .chip { opacity: 0; transform: scale(.8); transition: opacity .5s, transform .5s cubic-bezier(.34,1.56,.64,1); transition-delay: calc(1.1s + var(--d, 0) * .12s); }
.is-cinema .report .marker[data-in].is-in .chip { opacity: 1; transform: none; }
.report-ring { width: 64px; height: 64px; flex: 0 0 auto; }
.report-ring path { fill: none; stroke-width: 10; stroke-linecap: round; }

/* ---------- Count-ups ---------- */
[data-countup] { font-variant-numeric: tabular-nums; }
.stat-row { display: flex; gap: clamp(20px, 4vw, 56px); flex-wrap: wrap; margin-top: 34px; }
.stat-row div { border-left: 1px solid rgba(246, 244, 238, .2); padding-left: 14px; }
.stat-row b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4vw, 56px); line-height: 1; color: #9fd3c6; }
.stat-row > div > span { font-size: 13.5px; color: #cbd5ce; }
.jcount-hero b { font-family: var(--serif); font-weight: 400; color: var(--accent); }

/* ---------- Micro-habit grid fills one square at a time ---------- */
.is-cinema .mx-art i[data-in] { opacity: 0; transform: scale(.6); transition: opacity .45s, transform .6s cubic-bezier(.34,1.56,.64,1), background-color .6s; transition-delay: calc(var(--d, 0) * 140ms); }
.is-cinema .mx-art i[data-in].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .hero-photo img, .hero h1 .hw > span, .hero .eyebrow, .hero .lede, .hero .translate, .hero .hero-actions, .hero-creds li { animation: none !important; }
}
