/* Hero film: full-bleed video under the copy, Misoki's layer on top. */
.stage--film { background: #EEF2F7; overflow: hidden; }
.stage--film video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: filter .12s ease; opacity: 0;
}
.stage--film video.is-front { opacity: 1; }
.stage--film.is-punch video { filter: brightness(1.12) contrast(1.05); }
/* Light veil for the copy column, a soft top and a fade into the page. */
.stage--film::after {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0, rgba(255, 255, 255, 0.86) var(--fa, 40%), rgba(255, 255, 255, 0) var(--fb, 62%)),
    linear-gradient(0deg, #fff 0, rgba(255, 255, 255, 0) 16%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0) 10%);
}
/* Chapter 1's strips start right of the copy: only a short fade is needed. */
.stage--film.is-strips::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0.6) var(--fa, 40%), rgba(255, 255, 255, 0) var(--free, 50%)),
    linear-gradient(0deg, #fff 0, rgba(255, 255, 255, 0) 12%);
}
/* White until the first frame plays: the film opens from white. */
.stage--film::before {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: #fff;
  transition: opacity 1s ease;
}
.film-ready .stage--film::before { opacity: 0; }
/* Fine grain keeps the stock footage feeling like one film. */
.film-grain {
  position: absolute; inset: -50%; z-index: 1; pointer-events: none; opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .6s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(0, 0); } }

.film-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* Sensor mark: a live dot with pulses, a stem and a glass card. */
.fmark.is-violet { --dot: var(--violet); --tone: var(--violet-ink); }
.fmark { position: absolute; left: 0; top: 0; opacity: 0; --dot: var(--cyan); --tone: var(--cyan-ink); will-change: transform, opacity; }
.fmark--violet { --dot: var(--violet); --tone: var(--violet-ink); }
.fmark__dot {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--dot);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--dot) 25%, transparent), 0 0 24px 4px var(--dot);
  transform: scale(calc(.2 + var(--k, 0) * .8));
}
.fmark__pulse {
  position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%;
  border: 2px solid var(--dot); opacity: 0;
}
.fmark.is-in .fmark__pulse { animation: fpulse 1.8s cubic-bezier(.2, .7, .3, 1) infinite; }
.fmark.is-in .fmark__pulse--2 { animation-delay: .9s; }
@keyframes fpulse { 0% { transform: scale(.15); opacity: .95; } 100% { transform: scale(1.6); opacity: 0; } }
.fmark__stem {
  position: absolute; left: -1px; bottom: 10px; width: 2px; height: calc(var(--k, 0) * 64px);
  background: linear-gradient(0deg, var(--dot), rgba(255, 255, 255, 0.9));
}
.fmark__card {
  position: absolute; left: -14px; bottom: 76px; display: flex; flex-direction: column; gap: 3px;
  padding: 12px 16px 13px; border-radius: 14px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 18px 40px -16px rgba(20, 30, 60, 0.45);
  opacity: var(--k, 0); transform: translateY(calc((1 - var(--k, 0)) * 12px));
  filter: blur(calc((1 - var(--k, 0)) * 8px));
}
.fmark__card b { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--text); }
.fmark__card b::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 9px 2px 0; border-radius: 50%; background: var(--tone); vertical-align: middle; }
.fmark__card span { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.fmark--bare .fmark__dot, .fmark--bare .fmark__pulse, .fmark--bare .fmark__stem { display: none; }
.fmark--bare .fmark__card { bottom: 0; }

/* Lock-on reticle for the client's own sensors. */
.fmark__ret { position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; transform: scale(calc(2.2 - var(--k, 0) * 1.2)) rotate(calc((1 - var(--k, 0)) * 90deg)); }
.fmark__ret i { position: absolute; width: 16px; height: 16px; border: 2.5px solid var(--dot); filter: drop-shadow(0 0 6px var(--dot)); }
.fmark__ret i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.fmark__ret i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
.fmark__ret i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
.fmark__ret i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }
.fmark--lock .fmark__card { bottom: 84px; }

/* Our sensor landing on the motor. */
.fdrop { position: absolute; left: 0; top: 0; }
.fdrop__puck { position: absolute; left: -48px; top: -60px; width: 96px; height: 96px; transform: translateY(var(--fall, 0)); filter: drop-shadow(0 10px 16px rgba(20, 30, 60, 0.35)); }
.fdrop__puck svg { width: 100%; height: 100%; display: block; }
.fdrop.is-hit .fdrop__puck { animation: fsquash .35s ease-out; }
@keyframes fsquash { 0% { transform: scale(1.12, .86); } 60% { transform: scale(.97, 1.03); } 100% { transform: none; } }
.fdrop__wave {
  position: absolute; left: -150px; top: -60px; width: 300px; height: 100px; border-radius: 50%;
  border: 3px solid var(--cyan); box-shadow: 0 0 24px var(--cyan), inset 0 0 18px rgba(0, 212, 255, .5);
  opacity: calc((1 - var(--w, 0)) * 1.2); transform: scale(calc(.1 + var(--w, 0) * 2.4));
}
.fdrop__wave--2 { transform: scale(calc(.1 + var(--w, 0) * 1.6)); border-color: #7AE6FF; }
.fdrop__wave--3 { transform: scale(calc(.1 + var(--w, 0) * 3.4)); border-width: 1.5px; }
.fdrop:not(.is-hit) .fdrop__wave { opacity: 0; }

/* Live waveform drawn over the scope. */
.fwave { position: absolute; left: 0; top: 0; width: 600px; height: 120px; transform-origin: 0 0; opacity: 0; }
.fwave svg { width: 100%; height: 100%; overflow: visible; }
.fwave path { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linejoin: round; filter: drop-shadow(0 0 6px var(--cyan)) drop-shadow(0 0 14px rgba(0, 212, 255, .7)); }

/* End card of each film. */
.fend {
  position: absolute; right: 7%; top: 26%; opacity: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 18px 26px 20px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.78); border: 1px solid rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 24px 50px -20px rgba(20, 30, 60, 0.5);
  transform: translateY(calc((1 - var(--k, 0)) * 16px)); filter: blur(calc((1 - var(--k, 0)) * 10px));
}
.fend b { font-size: clamp(24px, 2vw, 34px); font-weight: 600; letter-spacing: -0.025em; }
.fend span { font-size: 15px; font-weight: 500; color: var(--text-muted); }

/* Badge + icon inside a card. */
.fbadge {
  align-self: flex-start; margin-bottom: 4px; padding: 2px 9px; border-radius: 999px;
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--tone);
  background: color-mix(in srgb, var(--dot) 14%, #fff); border: 1px solid color-mix(in srgb, var(--dot) 35%, transparent);
}
.fic { display: inline-flex; width: 20px; height: 20px; margin-right: 8px; vertical-align: -4px; color: var(--tone); }
.fic svg { width: 100%; height: 100%; }
.fmark__card b:has(.fic)::before { display: none; }

/* Data flowing along lines into one point. */
.fflow { position: absolute; inset: 0; }
.fflow svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fflow path { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-dasharray: 1; stroke-linecap: round; filter: drop-shadow(0 0 5px var(--cyan)); opacity: .85; }
.fflow circle { fill: #fff; stroke: var(--cyan); stroke-width: 2.5; filter: drop-shadow(0 0 8px var(--cyan)); }
.fflow.is-mix path:nth-child(2n), .fflow.is-mix circle:nth-child(2n) { stroke: var(--violet); filter: drop-shadow(0 0 6px var(--violet)); }

/* Product panels: Prism, diagnosis, work order. */
.fpanel {
  position: absolute; right: 6%; top: 50%; width: min(540px, 40vw); padding: 20px 22px 22px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.86); border: 1px solid rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 30px 70px -28px rgba(20, 30, 60, 0.55), 0 0 0 1px rgba(10, 11, 16, 0.04);
  transform: translateY(calc(-50% + (1 - var(--k, 0)) * 24px)) scale(calc(.97 + var(--k, 0) * .03));
  filter: blur(calc((1 - var(--k, 0)) * 10px));
}
.fpanel__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fpanel__logo { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #00D4FF, #7C5CFF); box-shadow: 0 4px 12px -2px rgba(124, 92, 255, .6); }
.fpanel__head b { font-size: 16px; font-weight: 600; }
.fpanel__meta { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.fpanel__live { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.fpanel__live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.fpanel__spec { width: 100%; height: 110px; display: block; border-radius: 12px; background: linear-gradient(180deg, #F4F7FB, #fff); border: 1px solid var(--border); }
.fpanel__line { fill: none; stroke: #00A9D6; stroke-width: 2; stroke-linejoin: round; }
.fpanel__area { fill: url(#brand-grad); opacity: .14; }
.fpanel__label { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.fpanel__causes { display: grid; gap: 8px; }
.fcause { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }
.fcause__bar { height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.fcause__bar i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); border-radius: 4px; background: linear-gradient(90deg, #7FDDF5, #00A9D6); }
.fcause--warn .fcause__bar i { background: linear-gradient(90deg, #FFC46B, var(--warn)); box-shadow: 0 0 12px rgba(224, 138, 0, .5); }
.fcause--warn { color: var(--warn-ink); font-weight: 600; }
.fcause__v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.fpanel__verdict {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px;
  background: var(--warn-soft); border: 1px solid rgba(224, 138, 0, .3);
  opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .5s cubic-bezier(.16, 1, .3, 1);
}
.fpanel.is-verdict .fpanel__verdict { opacity: 1; transform: none; }
.fpanel__verdict b { color: var(--warn-ink); font-size: 16px; }
.fpanel__verdict span { font-size: 13px; color: var(--text-muted); }
.fdiag__title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 14px; }
.fdiag__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fdiag__grid > div { padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 3px; }
.fdiag__grid span { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.fdiag__grid b { font-size: 18px; font-weight: 600; }
.fdiag__grid b.is-warn { color: var(--warn-ink); }
.fdiag__scale { display: flex; gap: 4px; margin-top: 4px; }
.fdiag__scale i { flex: 1; height: 5px; border-radius: 3px; background: var(--border-strong); }
.fdiag__scale i:nth-child(-n+2) { background: var(--warn); }
.fdiag__rec { margin-top: 12px; font-size: 14.5px; color: var(--text-muted); }
.fwo__num { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.fwo__rows { display: grid; gap: 1px; border-radius: 12px; overflow: hidden; background: var(--border); }
.fwo__rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; background: #fff; font-size: 14px; }
.fwo__rows span { color: var(--text-dim); }
.fwo__send { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-dim); }
.fwo__send em { font-style: normal; font-weight: 600; padding: 5px 11px; border-radius: 999px; color: var(--violet-ink); background: rgba(124, 92, 255, .1); border: 1px solid rgba(124, 92, 255, .25); }
.fend .btn { margin-top: 10px; pointer-events: auto; }
.fend { pointer-events: none; }

@media (max-width: 900px) {
  .stage--film::after { background: linear-gradient(0deg, #fff 0, rgba(255, 255, 255, 0.88) 50%, rgba(255, 255, 255, 0.25) 80%); }
  .film-layer { display: none; }
}
@media (prefers-reduced-motion: reduce) { .film-grain { animation: none; } }

/* Industry label on a chapter-1 strip. */
.ftag {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 14px 9px 11px; border-radius: 999px; translate: -50% -50%;
  background: rgba(255, 255, 255, 0.86); border: 1px solid rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 14px 32px -14px rgba(20, 30, 60, 0.45);
  opacity: var(--k, 0); filter: blur(calc((1 - var(--k, 0)) * 6px));
  margin-top: calc((1 - var(--k, 0)) * 14px);
}
.ftag { --dot: var(--cyan); --tone: var(--cyan-ink); }
.ftag.is-violet { --dot: var(--violet); --tone: var(--violet-ink); }
.ftag .fbadge { align-self: center; margin: 0 0 0 2px; }
.ftag b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.ftag__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 25%, transparent); }

/* Card to the left of its dot, for marks near the right edge of the frame. */
.fmark--flip .fmark__card { left: auto; right: -14px; }

/* Prism AI chapter: panels pinned to a frame point (top-left corner). */
.fpanel--at { right: auto; top: 0; left: 0; width: min(380px, 26vw); transform: translateY(calc((1 - var(--k, 0)) * 20px)) scale(calc(.97 + var(--k, 0) * .03)); }
.fcause2 { display: grid; grid-template-columns: 10px 1fr 1.1fr; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; font-weight: 500; color: var(--text-muted); }
.fcause2 i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.fcause2__bar { height: 6px; border-radius: 3px; background: rgba(10, 11, 16, .06); overflow: hidden; }
.fcause2__bar em { display: block; height: 100%; border-radius: 3px; background: var(--c); transform-origin: left; transform: scaleX(0); }
.fcause2.is-hot { color: var(--text); font-weight: 600; }
.fcause2.is-hot i { animation: fhot 1s ease-in-out infinite; }
@keyframes fhot { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent), 0 0 18px var(--c); } }
.fanswer { width: min(400px, 27vw); }
.fans__row, .fans__foot { opacity: clamp(0, calc(var(--p, 0) * 5 - var(--i)), 1); transform: translateY(calc((1 - clamp(0, calc(var(--p, 0) * 5 - var(--i)), 1)) * 8px)); }
.fans__row { display: flex; flex-direction: column; gap: 3px; padding: 9px 0; border-top: 1px solid rgba(10, 11, 16, .07); }
.fans__row > span { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.fans__row > b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.fans__sev { font-style: normal; font-size: 12px; font-weight: 600; margin-left: 6px; padding: 2px 8px; border-radius: 999px; color: #A35F00; background: #FFF1DC; border: 1px solid #F7CF94; white-space: nowrap; }
.fans__row ol { margin: 2px 0 0; padding-left: 18px; font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--text); }
.fans__foot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(10, 11, 16, .07); font-size: 12.5px; font-weight: 600; }
.fans__ok { display: inline-flex; align-items: center; color: #15803D; }
.fans__ok .fic { width: 16px; height: 16px; margin-right: 5px; color: #16A34A; }
.fans__off { padding: 2px 9px; border-radius: 999px; color: var(--violet-ink); background: color-mix(in srgb, var(--violet) 12%, #fff); border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); }
.fmark--pin { --dot: #F2A23A; }
