@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600&family=Space+Mono:wght@400;700&display=swap');

:root {
  --graphite: #1b1d21;
  --graphite-light: #26292f;
  --paper: #eef0ec;
  --line: #3a3e46;
  --sun: #e8843c;
  --sun-dim: #a85f2c;
  --text-dim: #8b8f98;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--graphite);
  color: var(--paper);
  font-family: 'Archivo', sans-serif;
}

/* ---------- loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--graphite);
  z-index: 10;
}
#loader[hidden] {
  display: none;
}
#loader-inner { width: min(320px, 80vw); text-align: left; }
#loader-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}
#loader-bar {
  height: 2px;
  background: var(--line);
  width: 100%;
}
#loader-fill {
  height: 100%;
  width: 0%;
  background: var(--sun);
  transition: width 0.15s ease-out;
}
#loader-count {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 10px 0 0;
}

/* ---------- layout ---------- */
#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 32px;
}

header {
  width: 100%;
  max-width: 900px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
h1 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}
.subtitle {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- stage ---------- */
#stage {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border: 1px solid var(--line);
}
#frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#time-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  background: rgba(27, 29, 33, 0.75);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 5px 10px;
  letter-spacing: 0.03em;
}

/* ---------- controls ---------- */
#controls {
  width: 100%;
  max-width: 900px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

#play-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--graphite-light);
  color: var(--paper);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
#play-btn:hover { border-color: var(--sun); color: var(--sun); }

#slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 1px;
  background: var(--line);
  outline: none;
}
#slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sun);
  border: 2px solid var(--paper);
  cursor: pointer;
  margin-top: -1px;
}
#slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sun);
  border: 2px solid var(--paper);
  cursor: pointer;
}

#range-labels {
  flex: none;
  display: none;
}

@media (min-width: 640px) {
  #range-labels {
    display: flex;
    gap: 18px;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
  }
}

@media (max-width: 640px) {
  header { margin-bottom: 14px; }
  h1 { font-size: 1rem; }
}
