/* METEOR/CITY — documentary coverage chrome.
   Desaturated UI, mono labels, fire-orange accents, cinematic letterbox. */

:root {
  --ink: #d7d9dd;
  --dim: #8b9098;
  --faint: #565b63;
  --accent: #ff7a2f;
  --accent-hot: #ffc46b;
  --panel: rgba(12, 14, 17, 0.72);
  --line: rgba(255, 255, 255, 0.10);
  --mono: "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #0b0d10; }
body { font-family: var(--mono); color: var(--ink); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#app { position: fixed; inset: 0; pointer-events: none; }
#app > * { pointer-events: auto; }
#app .letterbox, #app #flash, #app #vignette, #app #grain { pointer-events: none; }

/* ---------- cinematic frame ---------- */
.letterbox {
  position: absolute; left: 0; right: 0; height: 34px; z-index: 5;
  background: #050607;
}
#lb-top { top: 0; } #lb-bottom { bottom: 0; }

#vignette {
  position: absolute; inset: 0; z-index: 4;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.42) 100%);
}
#grain {
  position: absolute; inset: -60%; z-index: 4; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 33% { transform: translate(-2.5%,1.6%); }
  66% { transform: translate(1.8%,-2.2%); } 100% { transform: translate(0,0); }
}

#flash {
  position: absolute; inset: 0; z-index: 30; background: #fff8ee;
  opacity: 0; transition: opacity 60ms linear;
}

/* ---------- status bar ---------- */
#statusbar {
  position: absolute; top: 34px; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 22px;
  background: linear-gradient(rgba(5,6,7,0.55), transparent);
}
.brand-mark { font-size: 17px; letter-spacing: 0.22em; font-weight: 700; }
.brand-mark span { color: var(--accent); }
.brand-sub { font-size: 9.5px; letter-spacing: 0.34em; color: var(--dim); margin-top: 3px; }
.status-right { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.rec { font-size: 10px; letter-spacing: 0.28em; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.rec i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; animation: blink 1.6s infinite; }
@keyframes blink { 0%,55% { opacity: 1; } 60%,100% { opacity: 0.15; } }
.timecode { font-size: 21px; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.chapterslug { font-size: 10px; letter-spacing: 0.26em; color: var(--accent-hot); }

/* ---------- lower third ---------- */
.lowerthird {
  position: absolute; left: 26px; bottom: 132px; z-index: 9;
  padding: 12px 18px; border-left: 3px solid var(--accent);
  background: var(--panel); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(10px);
}
.lowerthird.show { animation: lt 4.6s ease forwards; }
@keyframes lt {
  0% { opacity: 0; transform: translateY(12px); }
  8% { opacity: 1; transform: translateY(0); }
  82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); }
}
.lt-kicker { font-size: 9px; letter-spacing: 0.4em; color: var(--accent); margin-bottom: 5px; }
.lt-title { font-size: 19px; letter-spacing: 0.16em; font-weight: 700; }
.lt-sub { font-size: 9.5px; letter-spacing: 0.3em; color: var(--dim); margin-top: 4px; }

/* ---------- side panels ---------- */
.panel {
  position: absolute; z-index: 10; background: var(--panel);
  border: 1px solid var(--line); backdrop-filter: blur(7px);
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
}
.panel-title { font-size: 9px; letter-spacing: 0.34em; color: var(--faint); margin-bottom: 4px; }

#chapters { left: 22px; top: 50%; transform: translateY(-50%); min-width: 208px; }
#layers { right: 22px; top: 50%; transform: translateY(-50%); min-width: 196px; }

.chapter-btn, .layer {
  display: flex; align-items: baseline; gap: 8px; text-align: left;
  background: none; border: 1px solid transparent; border-left: 2px solid var(--faint);
  color: var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  padding: 7px 10px; cursor: pointer; transition: all 120ms;
}
.chapter-btn b { color: var(--accent); font-weight: 400; }
.chapter-btn span { margin-left: auto; font-size: 8.5px; color: var(--faint); letter-spacing: 0.18em; }
.chapter-btn:hover, .layer:hover { background: rgba(255,255,255,0.05); }
.chapter-btn.on { border-left-color: var(--accent); background: rgba(255,122,47,0.10); }
.chapter-btn.free { border-left-style: dashed; }

.layer { border-left: none; gap: 10px; align-items: center; }
.layer i {
  width: 12px; height: 12px; border: 1px solid var(--faint); display: inline-block;
  position: relative; flex: none;
}
.layer.on i { border-color: var(--accent); background: rgba(255,122,47,0.25); }
.layer.on i::after {
  content: ""; position: absolute; inset: 2px; background: var(--accent);
}

/* ---------- transport ---------- */
#transport {
  position: absolute; left: 0; right: 0; bottom: 34px; z-index: 10;
  padding: 10px 26px 8px;
  background: linear-gradient(transparent, rgba(5,6,7,0.72));
}
.transport-row { display: flex; align-items: center; gap: 14px; }
.tbtn {
  background: none; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 14px; width: 40px; height: 40px;
  cursor: pointer; flex: none; transition: all 120ms;
}
.tbtn:hover { border-color: var(--accent); color: var(--accent-hot); }
.tbtn.play { font-size: 13px; }
.tbtn.paused { color: var(--accent); border-color: var(--accent); }

.scrub { flex: 1; padding: 12px 0; cursor: pointer; }
.scrub-track { position: relative; height: 26px; }
.scrub-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px;
  background: rgba(255,255,255,0.13);
  /* film-strip sprocket feel */
  background-image: repeating-linear-gradient(90deg, transparent 0 7px, rgba(0,0,0,0.55) 7px 9px);
}
.scrub-fill {
  position: absolute; left: 0; top: 11px; height: 4px; width: 0;
  background: var(--accent); box-shadow: 0 0 9px rgba(255,122,47,0.6);
}
.scrub-head {
  position: absolute; top: 5px; width: 3px; height: 16px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.8);
}
.scrub-ticks { position: absolute; inset: 0; }
.tick {
  position: absolute; top: -2px; height: 3px; border-left: 1px solid rgba(255,255,255,0.35);
}
.tick span {
  position: absolute; top: -13px; left: 3px; font-size: 8px; letter-spacing: 0.2em;
  color: var(--faint); white-space: nowrap;
}
.impact-tick {
  position: absolute; top: 4px; width: 2px; height: 18px; margin-left: -1px;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}

.speed { display: flex; align-items: center; gap: 8px; flex: none; }
.speed > span { font-size: 8.5px; letter-spacing: 0.3em; color: var(--faint); }
#speed-btns { display: flex; }
#speed-btns button {
  background: none; border: 1px solid var(--line); border-left: none;
  color: var(--dim); font-family: var(--mono); font-size: 10.5px;
  padding: 6px 9px; cursor: pointer; min-width: 40px;
}
#speed-btns button:first-child { border-left: 1px solid var(--line); }
#speed-btns button:hover { color: var(--ink); }
#speed-btns button.on { color: var(--accent-hot); border-color: var(--accent); background: rgba(255,122,47,0.10); }

.hint {
  margin-top: 7px; font-size: 9px; letter-spacing: 0.16em; color: var(--faint);
  text-align: center;
}

/* ---------- loading ---------- */
#loading {
  position: fixed; inset: 0; z-index: 60; background: #07080a;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 600ms ease;
}
#loading.done { opacity: 0; pointer-events: none; }
.load-card { text-align: center; }
.load-title { font-size: 26px; letter-spacing: 0.3em; font-weight: 700; }
.load-title span { color: var(--accent); }
.load-sub { font-size: 9.5px; letter-spacing: 0.4em; color: var(--dim); margin: 12px 0 18px; }
.load-bar { width: 220px; height: 2px; background: rgba(255,255,255,0.12); margin: 0 auto; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 40%; background: var(--accent); animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  #chapters { left: 12px; top: 96px; transform: none; min-width: 0; max-width: 44vw; }
  #layers { right: 12px; top: 96px; transform: none; min-width: 0; max-width: 44vw; }
  .chapter-btn span, .layer span#dust-label { display: none; }
  .chapter-btn, .layer { font-size: 10px; padding: 9px 10px; }
  .lowerthird { bottom: 118px; left: 12px; padding: 9px 12px; }
  .lt-title { font-size: 15px; }
  #statusbar { padding: 10px 14px; }
  .brand-sub { display: none; }
  .timecode { font-size: 16px; }
  .chapterslug { font-size: 8.5px; }
  #transport { padding: 8px 12px 6px; }
  .hint { display: none; }
  .tick span { display: none; }
  .tbtn { width: 44px; height: 44px; }
  .speed > span { display: none; }
  #speed-btns button { min-width: 34px; padding: 8px 6px; }
}
@media (max-width: 520px) {
  #chapters { max-width: 46vw; }
  .chapter-btn { font-size: 9px; letter-spacing: 0.06em; }
  .letterbox { height: 22px; }
  #statusbar { top: 22px; }
  #transport { bottom: 22px; }
}
