/* ============================================
   Hero Promo Movie — 5 scenes (18s) then a resting state
   Circle-wipe scene changes, kinetic giant type,
   line art + dot grid with pointer parallax.
   Scenes are driven by js/hero-movie.js (.is-active / .is-prev)
   ============================================ */

.hero-movie {
  --hm-bar-h: 150px;
  --hm-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --hm-wipe: cubic-bezier(0.76, 0, 0.24, 1);
  --hm-in: 0.45s; /* content waits for the wipe */
  --mx: 0;
  --my: 0;

  position: relative;
  /* sticky header sits above the hero; --hm-header is set from JS */
  /* floor keeps the resting scene from clipping on short viewports */
  min-height: max(640px, calc(100vh - var(--hm-header, 96px)));
  min-height: max(640px, calc(100svh - var(--hm-header, 96px)));
  overflow: hidden;
  background: #5d9228;
  isolation: isolate;
}

.hm-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Scene layer + circle wipe
   ========================================== */
.hm-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  padding-bottom: var(--hm-bar-h);
  background: var(--bg);
  color: var(--fg);
  visibility: hidden;
  clip-path: circle(0% at var(--ox) var(--oy));
}

.hm-scene.is-prev {
  z-index: 1;
  visibility: visible;
  clip-path: circle(150% at var(--ox) var(--oy));
}

.hm-scene.is-active {
  z-index: 2;
  visibility: visible;
  clip-path: circle(150% at var(--ox) var(--oy));
  transition: clip-path 1.1s var(--hm-wipe);
}

.hm-scene__inner {
  position: relative;
  z-index: 3;
}

/* scenes that are not on screen do not need to animate */
.hm-scene:not(.is-active):not(.is-prev) * {
  animation-play-state: paused !important;
}

/* keep copy clear of the right-hand visual */
.hm-scene--emotion .hm-sub,
.hm-scene--system .hm-sub,
.hm-scene--ai .hm-sub,
.hm-scene--field .hm-sub {
  max-width: 46vw;
  font-size: clamp(1.125rem, 0.8rem + 1.1vw, 1.875rem);
}

/* site-wide p / h1 colors (base.css) must not leak into scenes */
.hero-movie p,
.hero-movie h1 {
  color: inherit;
}

/* Eyebrow */
.hm-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin-bottom: var(--space-4);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.hm-eyebrow span { opacity: 0.6; }

.hm-eyebrow::after {
  content: '';
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}

.is-active .hm-eyebrow {
  opacity: 0.85;
  transform: none;
  transition: opacity 0.6s ease var(--hm-in), transform 0.8s var(--ease-out) var(--hm-in);
}

.is-active .hm-eyebrow::after {
  width: 72px;
  transition: width 1.2s var(--ease-out) calc(var(--hm-in) + 0.2s);
}

/* Kinetic giant type (chars wrapped by JS)
   ========================================== */
.hm-giant {
  font-family: 'Plus Jakarta Sans', var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 1rem + 8.2vw, 10.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
}

.hm-giant--full {
  font-size: clamp(3.25rem, 0.5rem + 9.6vw, 12.5rem);
}

.hm-row {
  display: block;
  overflow: hidden;
  padding: 0 0.04em 0.1em 0;
  margin-bottom: -0.1em;
  white-space: nowrap;
}

.hm-row--accent { color: #4c8a1c; }

.hm-ch {
  display: inline-block;
  transform: translateY(110%) rotate(12deg);
  transform-origin: 0 100%;
  transition: transform 0.35s cubic-bezier(0.5, 0, 0.75, 0);
}

/* Latin period sits too far from the preceding glyph in the display font */
.hm-ch--dot { margin-left: -0.08em; }

.is-active .hm-ch {
  transform: none;
  transition: transform 0.95s var(--hm-spring)
    calc(var(--hm-in) + var(--row) * 0.12s + var(--ci) * 0.03s);
}

/* Sub copy */
.hm-sub {
  margin-top: var(--space-5);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.9rem + 1.4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-wrap: balance;
  /* break Japanese at phrase boundaries where supported */
  word-break: auto-phrase;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.is-active .hm-sub {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease calc(var(--hm-in) + 0.55s), transform 0.9s var(--ease-out) calc(var(--hm-in) + 0.55s);
}

/* Line art, dot grid, grain, HUD
   ========================================== */
.hero-movie::after {
  /* film grain */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hm-grid {
  --dot: color-mix(in srgb, var(--fg) 22%, transparent);
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.6px);
  background-size: 32px 32px;
  background-position: center;
}

/* cursor spotlight: bigger dots only near the pointer */
.hm-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--fg) 70%, transparent) 2px, transparent 2.6px);
  background-size: 32px 32px;
  background-position: center;
  -webkit-mask: radial-gradient(circle 200px at var(--px, -999px) var(--py, -999px), #000, transparent);
  mask: radial-gradient(circle 200px at var(--px, -999px) var(--py, -999px), #000, transparent);
}

/* AI scene: scanning band across the grid */
.hm-grid--scan::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--fg) 80%, transparent) 1.6px, transparent 2.2px);
  background-size: 32px 32px;
  background-position: center;
  -webkit-mask: linear-gradient(180deg, transparent 0 40%, #000 50%, transparent 60% 100%) 0 0 / 100% 300% no-repeat;
  mask: linear-gradient(180deg, transparent 0 40%, #000 50%, transparent 60% 100%) 0 0 / 100% 300% no-repeat;
  animation: hmScan 2.8s linear infinite;
}

@keyframes hmScan {
  from { -webkit-mask-position: 0 100%; mask-position: 0 100%; }
  to   { -webkit-mask-position: 0 0; mask-position: 0 0; }
}

.hm-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  stroke: color-mix(in srgb, var(--fg) 55%, transparent);
  stroke-width: 1;
  transform: translate(calc(var(--mx) * -18px), calc(var(--my) * -12px));
}

.hm-art * { vector-effect: non-scaling-stroke; }

.hm-hair { stroke: color-mix(in srgb, var(--fg) 22%, transparent); }
.hm-art--blueprint { stroke: color-mix(in srgb, var(--fg) 40%, transparent); }

.hm-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.4s ease;
}

.is-active .hm-draw {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 2.2s cubic-bezier(0.65, 0, 0.35, 1) calc(var(--hm-in) * 0.5 + var(--dd, 0s));
}

.hm-dash {
  stroke-dasharray: 2 9;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.is-active .hm-dash {
  opacity: 1;
  transition: opacity 1.2s ease calc(var(--hm-in) + 0.6s);
}

.hm-fill {
  fill: var(--fg);
  stroke: none;
}

.hm-ring {
  fill: var(--bg);
  stroke: var(--fg);
  stroke-width: 1.5;
}

.hm-spin {
  animation: hmSpin var(--dur, 20s) linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.is-active .hm-spin {
  opacity: 1;
  transition: opacity 0.8s ease calc(var(--hm-in) + 1s);
}

.hm-spin--rev { animation-direction: reverse; }

@keyframes hmSpin {
  to { transform: rotate(360deg); }
}

.hm-ripple {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.1);
  opacity: 0;
}

.is-active .hm-ripple {
  animation: hmRippleLine 4s cubic-bezier(0.2, 0.6, 0.3, 1) calc(var(--hm-in) + var(--i) * 1s) infinite;
}

@keyframes hmRippleLine {
  0%   { transform: scale(0.1); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* HUD: timecode and registration marks */
.hm-hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  color: #fff;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.6s ease;
}

.hero-movie[data-tone='light'] .hm-hud { color: var(--temple-ink); }

.hm-hud__time {
  position: absolute;
  top: 22px;
  right: 44px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.hm-hud__time b { font-weight: 600; }

.hero-movie.is-rest .hm-hud__time { opacity: 0; transition: opacity 0.6s ease; }

.hm-mark {
  position: absolute;
  width: 14px;
  height: 14px;
  opacity: 0.55;
}

.hm-mark::before,
.hm-mark::after {
  content: '';
  position: absolute;
  background: currentColor;
}

.hm-mark::before { left: 6.5px; top: 0; width: 1px; height: 14px; }
.hm-mark::after { top: 6.5px; left: 0; height: 1px; width: 14px; }

.hm-mark--tl { top: 16px; left: 16px; }
.hm-mark--tr { top: 16px; right: 16px; }
.hm-mark--bl { bottom: 16px; left: 16px; }
.hm-mark--br { bottom: 16px; right: 16px; }

/* Rotating circular text badge */
.hm-badge {
  position: absolute;
  z-index: 3;
  right: max(var(--container-padding), calc((100% - 1440px) / 2 + var(--container-padding)));
  bottom: calc(var(--hm-bar-h) + 8px);
  width: 132px;
  height: 132px;
  color: var(--fg);
  opacity: 0;
  transform: scale(0.6) rotate(-60deg);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.is-active .hm-badge {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s ease calc(var(--hm-in) + 0.8s), transform 1.2s var(--ease-out) calc(var(--hm-in) + 0.8s);
}

.hm-badge svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: hmSpin 18s linear infinite;
}

.hm-badge text {
  fill: currentColor;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
}

.hm-badge i {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  translate: -50% -50%;
  box-shadow: inset 0 0 0 1px currentColor;
}

.hm-badge i::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  translate: -50% -50%;
}

.hm-scene--rest .hm-badge { bottom: 96px; }

/* Right-side visual slot
   ========================================== */
.hm-visual {
  position: absolute;
  z-index: 2;
  right: max(var(--container-padding), calc((100% - 1440px) / 2 + var(--container-padding)));
  top: calc(50% - var(--hm-bar-h) / 2);
  width: min(40vw, 560px);
  transform: translateY(-50%)
    translate(calc(var(--mx) * -14px), calc(var(--my) * -10px));
}

/* Scene 2: Emotion — marquee + cards
   ========================================== */
.hm-marquee {
  position: absolute;
  inset: auto 0 calc(var(--hm-bar-h) - 10px) 0;
  z-index: 0;
  display: grid;
  gap: 0.1em;
  font-family: 'Plus Jakarta Sans', var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 7rem);
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.14);
  transform: rotate(-4deg) scale(1.1);
}

.hm-marquee__row span {
  display: inline-block;
  animation: hmMarquee 22s linear infinite;
}

.hm-marquee__row--rev span {
  animation-direction: reverse;
  -webkit-text-stroke-color: rgba(255, 111, 92, 0.3);
}

@keyframes hmMarquee {
  to { transform: translateX(-50%); }
}

.hm-cards {
  height: min(52vh, 480px);
}

.hm-card {
  position: absolute;
  top: 0;
  left: calc(var(--i) * 30%);
  width: 44%;
  height: 86%;
  margin: calc(var(--i) * 4%) 0 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transform: translateY(80%) rotate(calc(var(--r) * 3)) scale(0.8);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.hm-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.3);
  transition: transform 0.4s ease;
}

.is-active .hm-card {
  opacity: 1;
  transform: rotate(var(--r));
  transition:
    transform 1.1s var(--hm-spring) calc(var(--hm-in) + 0.2s + var(--i) * 0.14s),
    opacity 0.4s ease calc(var(--hm-in) + 0.2s + var(--i) * 0.14s);
}

.is-active .hm-card img {
  transform: scale(1.05);
  transition: transform 4s cubic-bezier(0.2, 0.6, 0.2, 1) var(--hm-in);
}

/* Scene 3: System — flow chart
   ========================================== */
.hm-funnel {
  aspect-ratio: 520 / 320;
}

.hm-funnel__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hm-funnel__path {
  fill: none;
  stroke: #1a1a2e;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  transition: stroke-dashoffset 0.3s ease;
}

.is-active .hm-funnel__path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.5s var(--ease-out) calc(var(--hm-in) + 0.2s);
}

.hm-funnel__dot {
  fill: #6EA832;
  opacity: 0;
}

.is-active .hm-funnel__dot {
  opacity: 1;
  transition: opacity 0.4s ease calc(var(--hm-in) + 1.2s);
}

.hm-funnel__steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hm-funnel__steps li {
  position: absolute;
  left: var(--x);
  top: var(--y);
  padding: 0.45em 1.1em;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  background: #fff;
  box-shadow: 0 10px 24px rgba(26, 26, 46, 0.12), 0 0 0 1px rgba(26, 26, 46, 0.08);
  transform: scale(0);
  transition: transform 0.3s ease;
}

.is-active .hm-funnel__steps li {
  transform: none;
  transition: transform 0.8s var(--hm-spring) calc(var(--hm-in) + 0.35s + var(--i) * 0.35s);
}

.hm-funnel__steps li:last-child {
  background: #6EA832;
  color: #fff;
  box-shadow: 0 12px 30px rgba(110, 168, 50, 0.45);
}

/* Scene 4: AI — console + floating chips
   ========================================== */
.hm-console {
  border-radius: 20px;
  background: rgba(10, 30, 90, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 40px 80px rgba(8, 20, 70, 0.45);
  backdrop-filter: blur(12px);
  clip-path: inset(50% 50% 50% 50% round 20px);
  transition: clip-path 0.3s ease;
}

.is-active .hm-console {
  clip-path: inset(-40% -40% -40% -40% round 20px);
  transition: clip-path 0.9s var(--hm-wipe) var(--hm-in);
}

.hm-console__bar,
.hm-console__body {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.is-active .hm-console__bar,
.is-active .hm-console__body {
  opacity: 1;
  transition: opacity 0.4s ease calc(var(--hm-in) + 0.4s);
}

.hm-console__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.14);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.hm-console__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.hm-console__bar span { margin-left: 8px; }

.hm-console__body {
  padding: 22px 22px 26px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: clamp(12px, 0.7rem + 0.3vw, 15px);
  line-height: 2.1;
}

.hm-type {
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.is-active .hm-type {
  animation: hmType 0.5s steps(22, end) calc(var(--hm-in) + var(--d)) forwards;
}

.hm-type--ok { color: #b9f06a; }

@keyframes hmType {
  to { width: 100%; }
}

.hm-chips {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hm-chips li {
  position: absolute;
  left: var(--x);
  top: var(--y);
  padding: 0.5em 1.1em;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #1a47b8;
  background: #fff;
  box-shadow: 0 12px 28px rgba(8, 20, 70, 0.3);
  transform: scale(0);
  transition: transform 0.3s ease;
}

.is-active .hm-chips li {
  transform: scale(1);
  transition: transform 0.8s var(--hm-spring) calc(var(--hm-in) + 0.6s + var(--i) * 0.12s);
  animation: hmBob 2.6s ease-in-out calc(var(--i) * -0.4s) infinite alternate;
}

@keyframes hmBob {
  to { translate: 0 -10px; }
}

/* Scene 5: B2C field — photos riding an orbit
   ========================================== */
.hm-orbit {
  aspect-ratio: 1;
  /* satellites + captions need ~1.28x the box height: cap by viewport height too */
  width: min(34vw, 460px, max(300px, 78vh - 242px));
}

.hm-orbit__track {
  position: absolute;
  inset: 0;
  animation: hmSpin 40s linear infinite;
}

.hm-orbit__item {
  --rad: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  margin: 0;
  translate: -50% -50%;
  transform: rotate(var(--a)) translateX(calc(var(--rad) * 2.2)) rotate(calc(var(--a) * -1));
}

.hm-orbit__item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 0 8px rgba(255, 255, 255, 0.08);
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.3s ease;
}

/* keep photo + caption upright while the track spins */
.hm-orbit__inner {
  position: relative;
  display: block;
  animation: hmSpin 40s linear infinite reverse;
}

.is-active .hm-orbit__item img {
  clip-path: circle(50% at 50% 50%);
  transition: clip-path 1s var(--hm-wipe) calc(var(--hm-in) + 0.2s + var(--i) * 0.18s);
}

.hm-orbit__item figcaption {
  position: absolute;
  left: 50%;
  bottom: -2.4em;
  translate: -50% 0;
  white-space: nowrap;
  text-align: center;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hm-orbit__item figcaption small {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.is-active .hm-orbit__item figcaption {
  opacity: 1;
  transition: opacity 0.6s ease calc(var(--hm-in) + 0.9s + var(--i) * 0.18s);
}

/* Resting state (ntvart-like calm end frame)
   ========================================== */
.hm-scene--rest {
  padding-bottom: 88px;
}

.hm-giant--rest {
  font-size: clamp(2.75rem, 1rem + 5.6vw, 7.5rem);
  line-height: 0.98;
}

.hm-rest__title {
  font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.625rem);
}

.hm-rest__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hm-rest__fields li {
  padding: 0.2em 1.2em 0.2em 0;
  margin-right: 1.2em;
  box-shadow: 1px 0 0 rgba(26, 26, 46, 0.2);
}

.hm-rest__fields li:last-child { box-shadow: none; }

.hm-rest__fields small {
  margin-left: 0.6em;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.6;
}

.is-active .hm-rest__fields {
  opacity: 1;
  transition: opacity 0.8s ease calc(var(--hm-in) + 0.7s);
}

.hm-rest__lead {
  max-width: 44ch;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.9;
  color: rgba(26, 26, 46, 0.72);
  text-wrap: pretty;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hm-rest__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.is-active .hm-rest__lead {
  opacity: 1;
  transition: opacity 0.8s ease calc(var(--hm-in) + 0.8s);
}

.is-active .hm-rest__cta {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s ease calc(var(--hm-in) + 1s), transform 0.9s var(--ease-out) calc(var(--hm-in) + 1s);
}

.hm-scene--rest .hm-btn--primary,
.hm-scene--rest .hm-btn--primary:hover {
  color: #fff;
  background: var(--temple-ink);
}

.hm-rest__foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--space-5);
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.is-active .hm-rest__foot {
  opacity: 1;
  transition: opacity 0.8s ease calc(var(--hm-in) + 1.2s);
}

.hm-rest__foot > * { margin: 0; }

.hm-scroll {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.08em;
}

.hm-scroll i {
  position: relative;
  width: 1px;
  height: 40px;
  overflow: hidden;
  background: rgba(26, 26, 46, 0.15);
}

.hm-scroll i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  animation: hmScroll 2s cubic-bezier(0.76, 0, 0.24, 1) infinite;
}

@keyframes hmScroll {
  0%   { transform: translateY(-100%); }
  50%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

.hm-replay {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.55em 1.1em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 46, 0.2);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.hm-replay:hover {
  background: var(--temple-ink);
  color: #fff;
}

.hm-replay svg { width: 10px; height: 10px; fill: currentColor; }

/* Cursor-following dot with soft ripples */
.hm-dot {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform: translate(var(--dx, 70vw), var(--dy, 40%));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.is-active .hm-dot {
  opacity: 1;
  transition: opacity 0.8s ease calc(var(--hm-in) + 1s);
}

.hm-dot i,
.hm-dot::before,
.hm-dot::after {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  translate: -50% -50%;
}

.hm-dot i {
  width: 16px;
  height: 16px;
  background: var(--temple-ink);
}

.hm-dot::before,
.hm-dot::after {
  content: '';
  width: 320px;
  height: 320px;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 46, 0.45);
  scale: 0.2;
  opacity: 0;
  animation: hmRipple 3.6s ease-out infinite;
}

.hm-dot::after { animation-delay: 1.8s; }

@keyframes hmRipple {
  0%   { scale: 0.1; opacity: 0.9; }
  100% { scale: 1; opacity: 0; }
}

/* Persistent bar
   ========================================== */
.hero-movie__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: var(--space-5) 0 var(--space-6);
  color: #fff;
  transition: color 0.6s ease, opacity 0.5s ease, transform 0.6s var(--ease-out);
}

.hero-movie.is-rest .hero-movie__bar {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  /* also drop it from the tab order once faded out */
  visibility: hidden;
  transition: color 0.6s ease, opacity 0.5s ease, transform 0.6s var(--ease-out), visibility 0s linear 0.6s;
}

.hero-movie[data-tone='light'] .hero-movie__bar { color: var(--temple-ink); }

.hero-movie__bar-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: '. cta' 'progress progress';
  align-items: end;
  gap: var(--space-4) var(--space-6);
}

.hero-movie__cta {
  grid-area: cta;
  display: flex;
  gap: var(--space-3);
}

.hm-btn {
  display: inline-block;
  padding: 0.75em 1.7em;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, transform 0.35s var(--ease-out);
}

.hm-btn span {
  display: inline-block;
  transition: transform 0.35s var(--ease-out);
}

.hm-btn--primary {
  color: var(--temple-ink);
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.hm-btn--primary:hover { color: var(--temple-ink); }

.hm-btn--ghost {
  color: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
}

.hm-btn--ghost:hover { color: inherit; }

.hero-movie[data-tone='light'] .hm-btn--primary,
.hero-movie[data-tone='light'] .hm-btn--primary:hover {
  color: #fff;
  background: var(--temple-ink);
}

.hero-movie__progress {
  grid-area: progress;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hm-progress {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hm-progress li {
  position: relative;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
}

.hm-progress li::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0.3;
}

.hm-progress i {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
}

.hm-progress li.is-done i { transform: scaleX(1); }
.hm-progress li.is-current i {
  animation: hmProgress var(--hm-scene-dur, 3800ms) linear forwards;
}

@keyframes hmProgress {
  to { transform: scaleX(1); }
}

.hero-movie.is-paused * {
  animation-play-state: paused !important;
}

.hm-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1px currentColor;
  color: inherit;
  cursor: pointer;
}

.hm-skip {
  padding: 0.4em 1em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px currentColor;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.hm-toggle svg { width: 12px; height: 12px; fill: currentColor; }
.hm-toggle__play { display: none; }
.hero-movie.is-paused .hm-toggle__play { display: block; }
.hero-movie.is-paused .hm-toggle__pause { display: none; }

.hm-toggle:focus-visible,
.hm-skip:focus-visible,
.hm-replay:focus-visible,
.hm-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Responsive
   ========================================== */
@media (max-width: 900px) {
  .hero-movie {
    --hm-bar-h: 170px;
    min-height: max(620px, calc(100vh - var(--hm-header, 96px)));
    min-height: max(620px, calc(100svh - var(--hm-header, 96px)));
  }

  .hm-scene { align-items: flex-start; padding-top: var(--space-8); }

  .hm-scene--emotion .hm-sub,
  .hm-scene--system .hm-sub,
  .hm-scene--ai .hm-sub,
  .hm-scene--field .hm-sub { max-width: none; }

  .hm-visual {
    left: var(--container-padding);
    right: var(--container-padding);
    top: auto;
    bottom: calc(var(--hm-bar-h) + var(--space-4));
    width: auto;
    max-width: 440px;
    margin-left: auto;
    transform: none;
  }

  .hm-cards { height: min(30vh, 260px); }
  .hm-funnel { max-height: 30vh; }
  .hm-chips li:nth-child(n+4) { display: none; }

  /* satellites reach ~0.14x beyond the orbit box and captions hang below it */
  .hm-orbit {
    width: min(44vw, 22vh, 260px);
    max-width: none;
    margin: 0 auto;
    bottom: calc(var(--hm-bar-h) + min(44vw, 22vh, 260px) * 0.14 + 56px);
  }
}

@media (max-width: 768px) {
  .hero-movie { --hm-bar-h: 118px; }

  .hm-scene { padding-top: var(--space-6); }

  .hm-giant { font-size: 14vw; }
  .hm-giant--full { font-size: 12.6vw; }
  .hm-sub { margin-top: var(--space-4); font-size: 1.125rem; }

  .hero-movie__bar { padding: var(--space-4) 0; }

  .hero-movie__bar-inner {
    grid-template-columns: 1fr;
    grid-template-areas: 'cta' 'progress';
  }

  .hero-movie__cta .hm-btn { flex: 1; text-align: center; padding-inline: 0.8em; }

  .hm-scene--rest { padding-bottom: 96px; }
  .hm-giant--rest { font-size: 10.8vw; }
  .hm-rest__cta .hm-btn { flex: 1; text-align: center; padding-inline: 0.8em; }
  .hm-rest__foot { grid-template-columns: auto 1fr; }
  .hm-scroll { display: none; }
  .hm-dot { display: none; }

  .hm-badge { display: none; }
  .hm-hud__time { right: 40px; top: 12px; }
  .hm-rest__fields li { margin-bottom: 6px; }
  .hm-marquee { font-size: 3.2rem; }
  .hm-console__body { padding: 14px 16px 18px; line-height: 1.9; }
  .hm-chips { display: none; }
  .hm-funnel__steps li { font-size: 11px; }
}

/* small landscape windows: copy left, visual right, type sized by height */
@media (max-width: 900px) and (orientation: landscape) {
  .hm-giant,
  .hm-giant--full { font-size: min(9vw, 96px); }
  .hm-giant--rest { font-size: min(7vw, 72px); }
  .hm-visual { max-width: 38vw; bottom: calc(var(--hm-bar-h) + var(--space-5)); }
  .hm-cards { height: 240px; }
  .hm-orbit {
    width: min(26vw, 200px);
    margin: 0 8vw 0 auto;
    bottom: calc(var(--hm-bar-h) + min(26vw, 200px) * 0.14 + 64px);
  }
  .hm-scene--emotion .hm-sub,
  .hm-scene--system .hm-sub,
  .hm-scene--ai .hm-sub,
  .hm-scene--field .hm-sub { max-width: 50vw; font-size: 1.125rem; }
}

/* Reduced motion: JS jumps straight to the resting state */
@media (prefers-reduced-motion: reduce) {
  .hero-movie *,
  .hero-movie *::after {
    transition: none !important;
    animation: none !important;
  }

  /* no movie to control: JS shows the resting scene only */
  .hm-progress,
  .hm-toggle,
  .hm-skip,
  .hm-replay { display: none; }
}
