:root {
  --ink: #eef6f2;
  --muted: #8e9b96;
  --mint: #77e3a7;
  --cyan: #68c8d5;
  --line: rgba(222, 238, 230, .2);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --runtime-footer-clearance: 84px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #020403; }
body { display: grid; place-items: center; color: var(--ink); font-family: "Avenir Next", "Helvetica Neue", sans-serif; font-variant-numeric: tabular-nums; }
button { color: inherit; font: inherit; }
.reel-return { position: fixed; z-index: 20; top: 16px; left: 16px; min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; color: var(--muted); border: 1px solid var(--line); background: rgba(3, 7, 6, .82); font-size: 9px; font-weight: 700; text-decoration: none; backdrop-filter: blur(12px); }
.reel-return:hover { color: var(--ink); border-color: rgba(119, 227, 167, .6); }
.reel-return:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.reel-return::first-letter { color: var(--mint); }

.reel { position: relative; width: min(100vw, 177.7778vh); aspect-ratio: 16 / 9; overflow: hidden; background: #050807; isolation: isolate; }
#hmi-runtime { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; border: 0; background: #07100d; }
.reel-shade { position: absolute; z-index: 2; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(180deg, rgba(1, 4, 3, .5), transparent 18%, transparent 78%, rgba(1, 4, 3, .58)); transition: opacity .5s ease; }

.reel-meta { display: none; }
.reel-meta > b { justify-self: end; color: var(--cyan); font-size: 9px; }
.reel-brand { display: flex; align-items: center; gap: 9px; }
.reel-brand i { width: 18px; height: 18px; border: 1px solid var(--mint); background: linear-gradient(135deg, transparent 43%, var(--mint) 44% 48%, transparent 49%); }
.reel-brand strong { font-size: 10px; }
.reel-chapter { display: grid; grid-template-columns: auto auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); background: rgba(3, 7, 6, .7); backdrop-filter: blur(14px); }
.reel-chapter span { color: var(--muted); font-size: 8px; }
.reel-chapter strong { color: var(--mint); font-size: 9px; }

.title-card { position: absolute; z-index: 7; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; background: #030605; transition: opacity .8s var(--ease), visibility 0s linear .8s; }
.title-card::before { position: absolute; inset: 12%; content: ""; border: 1px solid rgba(119, 227, 167, .08); transform: scale(.92); opacity: 0; transition: transform 1.2s var(--ease), opacity 1s ease; }
.title-mark { width: 54px; height: 54px; border: 1px solid var(--mint); background: linear-gradient(135deg, transparent 43%, var(--mint) 44% 48%, transparent 49%); box-shadow: 0 0 42px rgba(119, 227, 167, .11); }
.title-card p { margin: 24px 0 0; color: var(--mint); font-size: 11px; font-weight: 700; }
.title-card h1, .title-card h2 { margin: 8px 0 4px; font-size: clamp(70px, 10vw, 150px); font-weight: 450; line-height: .9; }
.title-card span { color: var(--muted); font-size: 10px; font-weight: 600; }
.outro { visibility: hidden; opacity: 0; }

.load-error { position: absolute; z-index: 10; inset: 0; display: grid; place-content: center; justify-items: center; padding: 8vw; text-align: center; background: #030605; }
.load-error[hidden] { display: none; }
.load-error .title-mark { width: 42px; height: 42px; }
.load-error p { margin: 22px 0 0; color: #f0b75d; font-size: 11px; font-weight: 700; }
.load-error h2 { margin: 10px 0 8px; font-size: clamp(32px, 5vw, 72px); font-weight: 450; line-height: 1; }
.load-error > span { max-width: 560px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.load-error a { margin-top: 26px; padding: 12px 18px; border: 1px solid rgba(119, 227, 167, .48); color: var(--mint); font-size: 11px; font-weight: 700; text-decoration: none; }
.load-error a:hover { border-color: var(--mint); background: rgba(119, 227, 167, .08); }
.load-error a:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.reel-footer { position: absolute; z-index: 8; left: 18px; right: 18px; bottom: calc(18px + var(--runtime-footer-clearance)); display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 12px; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.reel-progress { height: 1px; overflow: hidden; background: rgba(220, 235, 228, .18); }
.reel-progress { position: absolute; left: -18px; right: -18px; bottom: calc(-18px - var(--runtime-footer-clearance)); }
.reel-progress i { display: block; width: 100%; height: 100%; background: var(--mint); transform: scaleX(0); transform-origin: left; will-change: transform; }
.reel-footer > span { grid-column: 2; align-self: center; color: var(--muted); font-size: 9px; }
.reel-caption { grid-column: 1; grid-row: 1; max-width: min(620px, 60vw); justify-self: center; padding: 8px 13px; border: 1px solid rgba(222, 238, 230, .12); border-radius: 18px; background: rgba(3, 7, 6, .72); color: var(--ink); font-size: clamp(9px, 1vw, 13px); line-height: 1.35; text-align: center; backdrop-filter: blur(14px); }
.reel-caption:empty { visibility: hidden; }
.reel-controls { display: flex; gap: 8px; pointer-events: auto; }
.reel-controls button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(3, 7, 6, .82); cursor: pointer; backdrop-filter: blur(12px); }
.reel-controls button:hover { border-color: rgba(119, 227, 167, .6); color: var(--mint); }
.reel-controls button:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.reel-controls button:disabled { cursor: wait; opacity: .42; }
#play-pause[aria-pressed="false"] { border-color: rgba(119, 227, 167, .48); color: var(--mint); }

.reel[data-phase="intro"] .intro::before, .reel[data-phase="outro"] .outro::before { opacity: 1; transform: scale(1); }
.reel:not([data-phase="loading"]):not([data-phase="intro"]) .intro { visibility: hidden; opacity: 0; }
.reel[data-phase="outro"] .outro { visibility: visible; opacity: 1; transition-delay: 0s; }
.reel[data-phase="navigation"] .reel-shade,
.reel[data-phase="drive"] .reel-shade,
.reel[data-phase="navigation-return"] .reel-shade,
.reel[data-phase="media"] .reel-shade,
.reel[data-phase="track"] .reel-shade { opacity: 1; }
.reel:not([data-phase="loading"]):not([data-phase="intro"]) .reel-footer { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .reel-meta, .title-card, .title-card::before, .reel-shade, .reel-footer { transition: none; }
}

@media (max-width: 760px) {
  :root { --runtime-footer-clearance: 66px; }
  .reel-meta { height: 54px; padding: 0 14px; }
  .reel-brand, .reel-meta > b { display: none; }
  .reel-meta { grid-template-columns: 1fr; }
  .reel-chapter { justify-self: center; }
  .reel-footer { left: 10px; right: 10px; bottom: calc(10px + var(--runtime-footer-clearance)); grid-template-columns: 1fr auto; gap: 8px; }
  .reel-progress { left: -10px; right: -10px; bottom: calc(-10px - var(--runtime-footer-clearance)); }
  .reel-footer > span { display: none; }
  .reel-caption { max-width: none; justify-self: stretch; padding: 7px 10px; }
  .reel-controls { gap: 6px; }
  .reel-controls button { width: 34px; height: 34px; }
  .title-card h1, .title-card h2 { font-size: 58px; }
  .reel-return { top: 10px; left: 10px; width: 36px; min-height: 36px; justify-content: center; padding: 0; }
  .reel-return span { display: none; }
}
