:root {
  --panel: rgba(10, 12, 16, 0.78);
  --text: #e8eaef;
  --muted: #8b95a5;
  --accent: #6eb0ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #050608;
  color: var(--text);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.video-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  pointer-events: none;
}

#scrub-video {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  vertical-align: middle;
  background: #000;
}

.scroll-track {
  position: relative;
  z-index: 1;
  /* Scroll distance maps 1:1 to full video; tuned via JS after metadata */
  min-height: 450vh;
  width: 100%;
  pointer-events: none;
}

.ui-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: auto;
  padding: 0;
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
  font-size: clamp(0.75rem, 2.8vw, 0.875rem);
  line-height: 1.4;
}

.ui-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.65rem 1rem 0;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.ui-bar p {
  margin: 0;
  flex: 1 1 200px;
  color: var(--muted);
}

.ui-bar a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.ui-bar a:hover,
.ui-bar a:focus-visible {
  text-decoration: underline;
}

#time-label {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 500;
}

.progress-wrap {
  width: 100%;
  height: 3px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

#scroll-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3d7eef, var(--accent));
  transform-origin: left center;
}

#load-hint {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050608;
  color: var(--muted);
  font-size: 0.9375rem;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#load-hint.hidden {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 480px) {
  .ui-bar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
