/* "How Medge works" — one continuous scroll-scrubbed film + live data layer (built by js/story.js, round 23) */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap"); /* MIRA dashboard (canvas) */
.how-story { position: relative; background: #08060e; color: #f4ecff; isolation: isolate; }
.how-story.hs-live { height: 450vh; }   /* owner 1 Nov 2026: was 820vh */
.how-story.hs-live.hs-mobile { height: 280vh; height: 280svh; }   /* phones: 4 Nov 2026 shorter (was 350vh / 720vh); story stops are spaced by progress, so not shorter than this */

.hs-stage { position: sticky; top: 0; height: 100vh; height: 100svh; width: 100%; overflow: hidden; contain: layout paint; background: #08060e center / cover no-repeat; }
.hs-canvas { position: absolute; inset: 0; display: block; max-width: none !important; }

/* legibility: a soft scrim bottom-left (desktop) / bottom (phones) for the captions; a hairline at the top for the rail */
.hs-scrim { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse 62% 48% at 0% 100%, rgba(6,4,12,.78) 0%, rgba(6,4,12,.42) 45%, rgba(6,4,12,0) 75%),
    linear-gradient(180deg, rgba(6,4,12,.55) 0%, rgba(6,4,12,0) 16%); }

/* ---------- captions: five big beats, bottom-left ---------- */
.hs-copy { position: absolute; z-index: 3; left: clamp(20px, 4vw, 64px); bottom: clamp(36px, 8vh, 84px); width: min(620px, 46vw); height: 0; pointer-events: none; }
.hs-eyebrow { position: absolute; z-index: 3; top: clamp(84px, 12vh, 118px); left: clamp(20px, 4vw, 64px); white-space: nowrap; opacity: calc(1 - var(--end, 0)); }
.hs-beat { position: absolute; left: 0; bottom: 0; width: 100%; opacity: 0; visibility: hidden; will-change: opacity, transform; }
.hs-beat:first-of-type { opacity: 1; visibility: visible; }
.hs-kicker { display: inline-block; font: 500 13.5px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .2em; text-transform: uppercase; color: #c7a6ff; padding: 7px 10px; border: 1px solid rgba(184,140,255,.3); border-radius: 999px; background: rgba(20,12,36,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hs-h { font: 700 clamp(36px, 4.6vw, 76px)/1.0 "Unbounded", "Inter", system-ui, sans-serif; letter-spacing: -.04em; margin: 16px 0 0; color: #fff; text-shadow: 0 2px 30px rgba(0,0,0,.55); text-wrap: balance; }
.hs-p { font: 400 clamp(15px, 1.2vw, 18px)/1.55 "Inter", system-ui, sans-serif; color: #e2d8f0; margin: 14px 0 0; max-width: 460px; text-shadow: 0 1px 14px rgba(0,0,0,.8); }

/* ---------- process rail (top centre) ---------- */
.hs-rail { position: absolute; z-index: 4; left: 50%; top: 76px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 999px; background: rgba(12,8,22,.86); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: calc(1 - var(--end, 0) * .6); }
.hs-rail-track { position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.hs-rail-fill { position: absolute; inset: 0; background: linear-gradient(90deg, #b88cff, #7fd8ff); transform-origin: 0 50%; transform: scaleX(0); }
.hs-rail-step { flex: none; display: flex; align-items: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: 999px; background: none; color: #bdb2d3; font: 500 14.5px/1 "Inter", sans-serif; cursor: pointer; transition: color .3s, background .3s; white-space: nowrap; }
.hs-rail-step svg { width: 15px; height: 15px; flex: none; }
.hs-rail-step b { font: 600 13px/1 "JetBrains Mono", monospace; color: inherit; opacity: .95; }
.hs-rail-step.done { color: #d2c6e6; }
.hs-rail-step.on { color: #fff; background: rgba(155,92,255,.28); box-shadow: inset 0 0 0 1px rgba(184,140,255,.45); }
.hs-rail-step:hover { color: #fff; }
.hs-rail-step:focus-visible { outline: 2px solid #b88cff; outline-offset: 2px; }

/* ---------- scroll hint ---------- */
.hs-hint { position: absolute; z-index: 3; right: clamp(20px, 4vw, 64px); bottom: clamp(36px, 8vh, 84px); display: flex; flex-direction: column; align-items: center; gap: 8px; font: 500 12.5px/1 "JetBrains Mono", monospace; letter-spacing: .24em; text-transform: uppercase; color: #d9cdee; pointer-events: none; text-shadow: 0 1px 10px rgba(0,0,0,.8); }
.hs-hint i { width: 1px; height: 30px; background: linear-gradient(#b88cff, transparent); }

/* ---------- loader (only if the playhead outruns the download) ---------- */
.hs-loader { position: absolute; z-index: 5; right: 18px; top: 18px; width: 18px; height: 18px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.hs-loader i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: #b88cff; animation: hs-spin .9s linear infinite; }
@keyframes hs-spin { to { transform: rotate(1turn); } }

/* ---------- end card ---------- */
.hs-end { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; padding: 0 20px; }
.hs-end::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(6,4,12,.82), rgba(6,4,12,.45) 70%, rgba(6,4,12,.3)); }
.hs-end-k { font: 500 13.5px/1 "JetBrains Mono", monospace; letter-spacing: .26em; text-transform: uppercase; color: #c7a6ff; margin: 0 0 22px; }
.hs-end-h { font: 800 clamp(40px, 6.8vw, 108px)/1 "Unbounded", "Inter", system-ui, sans-serif; letter-spacing: -.045em; margin: 0; color: #fff; text-shadow: 0 4px 40px rgba(0,0,0,.7); }
.hs-grad { background: linear-gradient(100deg, #e98bff 0%, #b88cff 35%, #9da8ff 65%, #7fd8ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 18px rgba(155,92,255,.35)); }
.how-story .hs-end-h .hs-grad { padding-bottom: .06em; }
.hs-copy, .hs-eyebrow, .hs-hint { transition: none; }
.hs-stage .hs-copy { opacity: calc(1 - var(--end, 0)); }

/* ---------- anchored live tags ---------- */
.hs-tags { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.hs-tag { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; will-change: transform, opacity; white-space: nowrap; translate: -50% -100%; transform-origin: 50% 100%; }
.hs-tag--chip { display: grid; gap: 2px; padding: 8px 12px 9px; border-radius: 12px; background: linear-gradient(180deg, rgba(24,16,44,.84), rgba(10,6,20,.84)); border: 1px solid rgba(184,140,255,.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0,0,0,.45); min-width: 116px; }
.hs-tag--chip small { font: 500 12.5px/1.1 "JetBrains Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: #b3a5cc; }
.hs-tag--chip b { font: 600 20px/1.1 "Unbounded", "Inter", sans-serif; letter-spacing: -.02em; color: #fff; }
.hs-tag--chip b em { font-style: normal; font-variant-numeric: tabular-nums; }
.hs-tag--chip span { font: 500 13px/1.2 "JetBrains Mono", monospace; color: #8fdcff; }
.hs-tag--chip::after, .hs-tag--gw::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 1px; height: 14px; background: linear-gradient(rgba(184,140,255,.7), transparent); }
.hs-tag--gw { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 12px; background: rgba(12,8,22,.74); border: 1px solid rgba(184,140,255,.36); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.hs-tag--gw b { font: 600 14px/1.1 "Unbounded", "Inter", sans-serif; letter-spacing: -.01em; color: #fff; }
.hs-tag--gw span { font: 500 13.5px/1.2 "JetBrains Mono", monospace; color: #c2b4d8; letter-spacing: .02em; }
.hs-tag--cloud { display: grid; justify-items: center; gap: 4px; padding: 10px 16px 8px; border-radius: 14px; background: rgba(12,8,22,.7); border: 1px solid rgba(127,216,255,.36); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hs-tag--cloud b { font: 600 15px/1.1 "Unbounded", sans-serif; color: #fff; }
.hs-tag--cloud span { font: 500 13.5px/1.2 "JetBrains Mono", monospace; color: #a6e4ff; }
.hs-tag--cloud span em { font-style: normal; font-variant-numeric: tabular-nums; color: #fff; }
.hs-spark { width: 120px; height: 26px; display: block; }
.hs-spark path { fill: none; stroke: #b88cff; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.hs-tag--sec { translate: 0 -50%; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; font: 500 15px/1 "Inter", sans-serif; color: #f1eaff; background: rgba(20,14,36,.8); border: 1px solid rgba(184,140,255,.48); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 26px rgba(0,0,0,.35); }
.hs-tag--sec svg { width: 14px; height: 14px; color: #c9a8ff; flex: none; }
.hs-tag--toast { translate: -50% -100%; width: 300px; white-space: normal; padding: 12px 14px 13px; border-radius: 16px; background: rgba(17,27,33,.95); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(37,211,102,.18); }
.hs-toast-h { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.hs-toast-h b { font: 600 14px/1 "Inter", sans-serif; color: #e9edef; }
.hs-toast-h em { margin-left: auto; font: 400 14px/1 "Inter", sans-serif; font-style: normal; color: #8696a0; }
.hs-av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 13.5px/1 "Unbounded", sans-serif; color: #fff; background: linear-gradient(135deg, #850083, #7d6bff); }
.hs-tag--toast p { margin: 0; font: 400 15px/1.45 "Inter", sans-serif; color: #e9edef; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .hs-scrim { background: linear-gradient(180deg, rgba(6,4,12,.6) 0%, rgba(6,4,12,0) 15%, rgba(6,4,12,0) 54%, rgba(6,4,12,.8) 68%, rgba(6,4,12,.94) 100%); }
  .hs-copy { left: 16px; right: 16px; width: auto; bottom: calc(104px + env(safe-area-inset-bottom)); }   /* clears the site's Ollie dock */
  .hs-eyebrow { display: none; }
  .hs-kicker { font-size: 12.5px; letter-spacing: .16em; padding: 6px 9px; }
  .hs-h { font-size: clamp(28px, 8.6vw, 38px); margin-top: 12px; }
  .hs-p { font-size: 14.5px; margin-top: 10px; }
  .hs-rail { top: 96px; left: 10px; right: 10px; width: auto; max-width: none; transform: none; justify-content: space-between; padding: 3px 4px; gap: 0; }
  .hs-rail-step { min-width: 44px; min-height: 44px; justify-content: center; padding: 0 9px; gap: 0; }
  .hs-rail-step span { display: none; }
  .hs-rail-step.on span { display: inline; margin-left: 6px; font-size: 13px; }
  .hs-rail-step.on b { display: none; }
  .hs-rail-track { left: 10px; right: 10px; }
  .hs-hint { right: 16px; bottom: auto; top: 156px; }
  .hs-tag--chip { min-width: 0; padding: 6px 9px 7px; } .hs-tag--chip b { font-size: 15px; } .hs-tag--chip span { display: none; } .hs-tag--chip small { font-size: 11.5px; }
  .hs-tag--gw { padding: 7px 10px; } .hs-tag--gw b { font-size: 14.5px; } .hs-tag--gw span { display: none; }
  .hs-tag--cloud span { font-size: 12.5px; } .hs-spark { width: 96px; }
  .hs-tag--sec { translate: -50% -50%; font-size: 13px; padding: 6px 9px; gap: 6px; }
  .hs-tag--sec svg { width: 12px; height: 12px; }
  .hs-tag--toast { width: min(290px, calc(100vw - 32px)); }
  .hs-end-h { font-size: clamp(28px, 8.6vw, 40px); }
  .hs-end-k { margin-bottom: 16px; }
}

/* ---------- static beats (reduced motion) ---------- */
.how-story.hs-static { padding: clamp(80px, 12vw, 150px) 0; background: #04020a; }
.hs-static-wrap { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.hs-static-title { font: 700 clamp(32px, 4.6vw, 64px)/1.04 "Unbounded", "Inter", sans-serif; letter-spacing: -.04em; margin: 16px 0 0; }
.hs-static-list { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.hs-static-beat:last-child { grid-column: 1 / -1; }
.hs-static-beat { border: 1px solid rgba(255,255,255,.09); border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)); }
.hs-static-fig { margin: 0; aspect-ratio: 16 / 9; background: #07040f; }
.hs-static-fig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hs-static-beat.no-img .hs-static-fig img { display: none; }
.hs-static-copy { padding: 22px 24px 26px; }
.hs-static-copy h3 { font: 700 clamp(22px, 2.4vw, 32px)/1.1 "Unbounded", sans-serif; letter-spacing: -.03em; margin: 14px 0 0; }
.hs-static-copy p { color: #d4c9e4; margin: 10px 0 0; font-size: 15.5px; line-height: 1.6; }
.hs-static-alert { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(17,27,33,.9); border: 1px solid rgba(255,255,255,.08); display: grid; gap: 4px; font-size: 14px; color: #e9edef; max-width: 420px; }
.hs-static-alert b { font-size: 15px; color: #9fe3c8; }
@media (max-width: 760px) { .hs-static-list { grid-template-columns: 1fr; } .hs-static-wrap { width: calc(100% - 32px); } }
.hs-clean .hs-copy, .hs-clean .hs-rail, .hs-clean .hs-hint, .hs-clean .hs-scrim, .hs-clean .hs-tag--toast { display: none !important; }

/* "Explain this to me" sits above the film: give it room so it never touches the scroll stage */
#how > .explain-btn { display: flex; width: fit-content; margin: 8px 0 40px clamp(14px, 2.8vw, 48px); }

/* film progress + "Skip film" (owner, 1 Nov 2026) */
.hs-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.08); z-index: 6; pointer-events: none; }
.hs-progress i { display: block; height: 100%; background: linear-gradient(90deg, #7c5cff, #c06bff); transform-origin: 0 50%; transform: scaleX(0); }
.hs-skip { position: absolute; right: clamp(14px, 2.8vw, 48px); bottom: 22px; z-index: 7; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: rgba(10,6,20,.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font: 600 14px/1 var(--f-body, system-ui); cursor: pointer; transition: opacity .3s, background .2s, border-color .2s; }
.hs-skip:hover { background: rgba(124,92,255,.35); border-color: rgba(196,166,255,.6); }
.hs-skip:focus-visible { outline: 2px solid #c4a6ff; outline-offset: 3px; }
.hs-skip.is-off { opacity: 0; pointer-events: none; }
@media (max-width: 760px) { .hs-skip { bottom: 16px; padding: 9px 14px; font-size: 13.5px; } }

/* phones in landscape (4 Nov 2026): the step rail shows icons + the current label (it ran off the 844 px screen), and the film scrolls through in fewer screens */
@media (max-height: 500px) and (orientation: landscape) {
  .how-story.hs-live { height: 360vh; height: 360svh; }
  .hs-rail { top: 66px; left: 10px; right: 10px; width: auto; max-width: none; transform: none; justify-content: space-between; padding: 3px 4px; gap: 0; }
  .hs-rail-step { min-width: 44px; min-height: 44px; justify-content: center; padding: 0 9px; gap: 0; }
  .hs-rail-step span { display: none; }
  .hs-rail-step.on span { display: inline; margin-left: 6px; font-size: 13px; }
  .hs-rail-step.on b { display: none; }
  .hs-rail-track { left: 10px; right: 10px; }
}

/* clip-fix 7 Nov 2026: on tablets the five labelled steps are wider than the stage; show icons + the current label like on phones */
@media (min-width: 761px) and (max-width: 1040px) {
  .hs-rail { max-width: calc(100% - 20px); }
  .hs-rail-step { padding: 7px 10px; }
  .hs-rail-step span { display: none; }
  .hs-rail-step.on span { display: inline; margin-left: 6px; }
  .hs-rail-step.on b { display: none; }
}
