:root {
  --bg: #0a0a0a;
  --panel: #121212;
  --line: #2a2a2a;
  --text: #ececec;
  --muted: #a3a3a3;
  --red: #690000;
  --red-hi: #a30000;
  --focus: #ff6b6b;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.card {
  margin: auto 0;
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 12px;
  padding: 24px 20px;
}
.brand { margin: 0 0 4px; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red-hi); }
h1 { margin: 0 0 8px; font-size: 1.6rem; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop {
  display: grid; gap: 4px; place-items: center; text-align: center;
  min-height: 170px; padding: 24px 16px; cursor: pointer;
  border: 2px dashed #444; border-radius: 10px; background: #0e0e0e;
  transition: border-color .4s ease, background-color .4s ease;
}
.drop:hover, .drop.over { border-color: var(--red-hi); background: #160808; }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.drop-title { font-size: 1.15rem; font-weight: 600; }
.drop-sub, .types, small { color: var(--muted); }
.types { font-size: .85rem; margin: 10px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--red-hi); flex: none; }
.fname { margin: 0 0 10px; font-weight: 600; overflow-wrap: anywhere; }
progress { width: 100%; height: 14px; appearance: none; border: 0; border-radius: 7px; background: #222; overflow: hidden; }
progress::-webkit-progress-bar { background: #222; }
progress::-webkit-progress-value { background: var(--red-hi); transition: width .4s ease; }
progress::-moz-progress-bar { background: var(--red-hi); }
.status { color: var(--muted); min-height: 1.5em; margin: 10px 0; }
.btn {
  display: inline-block; min-height: 44px; padding: 10px 20px; border: 1px solid var(--red-hi);
  border-radius: 8px; background: var(--red); color: #fff; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red-hi); }
.btn.ghost { background: transparent; border-color: #555; color: var(--text); }
.btn.ghost:hover { border-color: var(--text); background: transparent; }
.btn:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.linkrow { display: flex; gap: 8px; flex-wrap: wrap; }
.linkrow input {
  flex: 1 1 240px; min-height: 44px; padding: 8px 12px; border: 1px solid #444; border-radius: 8px;
  background: #0e0e0e; color: var(--text); font: inherit;
}
.error { margin: 16px 0 0; padding: 12px; border: 1px solid #7a2a2a; border-radius: 8px; background: #240c0c; color: #ffd0d0; }
.note { color: var(--muted); font-size: .9rem; }
.meta { font-size: 1.05rem; overflow-wrap: anywhere; }
.foot { margin: 24px 0 0; font-size: .8rem; color: #777; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.card.wide { max-width: 760px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.logo img { width: 32px; height: 32px; }
.logo b { color: var(--red-hi); }
video { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list a { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; }
.list a:hover { border-color: var(--red-hi); }
.list a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.field { display: grid; gap: 4px; margin: 12px 0; }
.field input[type=text] { min-height: 44px; padding: 8px 12px; border: 1px solid #444; border-radius: 8px; background: #0e0e0e; color: var(--text); font: inherit; }
.radio { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.radio input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--red-hi); flex: none; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { padding: 0; font-weight: 600; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid a { display: block; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0e0e0e; transition: border-color .4s ease; }
.grid a:hover { border-color: var(--red-hi); }
.grid a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.grid img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; background: #1a0b0b; }
.grid span { display: block; padding: 10px 12px; overflow-wrap: anywhere; }
.note a { color: inherit; }

/* ---- chrome: header, BETA, nav, footer ---- */
.brand-row { display: inline-flex; align-items: center; gap: 10px; }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.nav .btn { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.beta {
  position: relative; overflow: hidden; display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .62rem; font-weight: 800; letter-spacing: .14em; color: #ffd7d7;
  background: linear-gradient(160deg, #8a0000, #3a0000 70%); border: 1px solid #a30000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 8px rgba(163,0,0,.35);
}
.beta::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-130%);
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.38) 50%, transparent 65%);
  animation: beta-shine 1.6s ease-out 1.2s 1 forwards;
}
@keyframes beta-shine { to { transform: translateX(130%); } }
.foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: #8a8a8a; }
.foot a { color: #b8b8b8; text-decoration: none; border-bottom: 1px dotted #555; }
.foot a:hover { color: #fff; border-color: #fff; }
.foot a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.heart { display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.9)) drop-shadow(0 0 1px rgba(255,255,255,.12)); }

/* ---- inline settings toolbar ---- */
#tb-panel { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #0e0e0e; }
.tb-grid { display: grid; gap: 2px 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tb-grid .radio { margin: 6px 0; }
.tb-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.tb-actions .btn { min-height: 36px; padding: 4px 12px; font-size: .85rem; }
.soon { color: #777; font-size: .8rem; margin: 6px 0 0; }

/* ---- notices (large file, unsupported type, compression) ---- */
.notice { margin: 14px 0; padding: 12px 14px; border: 1px solid #5a2a2a; border-left: 4px solid var(--red-hi); border-radius: 8px; background: #170b0b; }
.notice p { margin: 0 0 8px; }
.notice .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.notice .btn { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
details.mini { margin: 8px 0; }
details.mini summary { cursor: pointer; color: #ff9a9a; }
details.mini summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
details.mini > div { margin-top: 6px; color: var(--muted); font-size: .95rem; }
.sel { min-height: 40px; padding: 6px 10px; border: 1px solid #444; border-radius: 8px; background: #0e0e0e; color: var(--text); font: inherit; }

/* ---- player ---- */
.player { position: relative; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid #251010; }
.player video { display: block; width: 100%; max-height: 72vh; border-radius: 0; background: #000; }
.player.js video { cursor: pointer; }
.pl-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 22px 10px 8px;
  background: linear-gradient(0deg, rgba(10,0,0,.88), rgba(10,0,0,0)); color: #eee; font-size: .85rem;
}
.pl-bar.hide { opacity: 0; pointer-events: none; }
.pl-btn {
  flex: none; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: #f0f0f0;
  font: 600 .85rem system-ui, sans-serif; cursor: pointer;
}
.pl-btn:hover { background: rgba(163,0,0,.35); }
.pl-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.pl-btn[aria-pressed="true"] { color: #ff6b6b; }
.pl-btn svg { width: 20px; height: 20px; fill: currentColor; display: block; margin: auto; }
.pl-time { flex: none; font-variant-numeric: tabular-nums; min-width: 6.5em; text-align: center; color: #cfcfcf; }
.pl-bar input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 24px; margin: 0; cursor: pointer; }
.pl-bar input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--red-hi) var(--p, 0%), #3a3a3a var(--p, 0%)); }
.pl-bar input[type=range]::-moz-range-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--red-hi) var(--p, 0%), #3a3a3a var(--p, 0%)); }
.pl-bar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 50%; background: #fff; border: 2px solid var(--red-hi); }
.pl-bar input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--red-hi); }
.pl-bar input[type=range]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pl-seek { flex: 1 1 auto; min-width: 60px; }
.pl-vol { flex: none; width: 84px; }
.pl-vl { flex: none; min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; color: #cfcfcf; }
.pl-big { position: absolute; inset: 0 0 56px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; }
.pl-big span { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(10,0,0,.62); border: 3px solid var(--red-hi); }
.pl-big svg { width: 34px; height: 34px; fill: #fff; margin-left: 4px; }
.pl-big:focus-visible span { outline: 3px solid var(--focus); outline-offset: 3px; }
.pl-osd { position: absolute; top: 14px; right: 18px; font: 600 1.2rem system-ui, sans-serif; color: #fff; opacity: 0; pointer-events: none; text-shadow: 0 1px 4px #000; }
.player:fullscreen .pl-osd.on { opacity: .5; }
.player:fullscreen { border: 0; border-radius: 0; }
.player:fullscreen video { max-height: none; height: 100%; }
.player:fullscreen.idle { cursor: none; }
.volosd { min-height: 1.5em; margin: 8px 0 0; text-align: right; font-variant-numeric: tabular-nums; color: #bdbdbd; font-size: .95rem; }
.resume { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
.resume button { background: none; border: 0; color: #ff9a9a; font: inherit; cursor: pointer; text-decoration: underline; padding: 4px; }

/* auto-theatre: the video takes the stage, everything else steps back and goes still */
body.theatre .card.wide { max-width: min(1500px, 100%); background: transparent; border-color: transparent; }
body.theatre .player video { max-height: 82vh; }
body.playing .top, body.playing h1, body.playing .meta-line, body.playing .foot, body.playing #dt-help { opacity: .35; }
body.playing .top:hover, body.playing .top:focus-within, body.playing .meta-line:hover, body.playing #dt-help:hover, body.playing #dt-help:focus-visible { opacity: 1; }
body.playing *, body.playing *::before, body.playing *::after { animation: none !important; transition: none !important; }

/* about + learn pages */
.prose h2 { margin-top: 24px; }
.prose p, .prose li { color: #cfcfcf; }
.prose a { color: #ff9a9a; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9rem; margin: 8px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.prose textarea { width: 100%; min-height: 110px; padding: 10px 12px; border: 1px solid #444; border-radius: 8px; background: #0e0e0e; color: var(--text); font: inherit; }
.prose .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.vr { display: inline-flex; align-items: center; gap: 6px; }
.vr img { width: 22px; height: 22px; }

html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }
@media (max-width: 520px) { .pl-vol, .pl-vl { display: none; } .nav .btn { padding: 6px 10px; } }

.prose .sel { width: 100%; }

/* Audio watch page: a canvas visualiser over the track, native audio controls, style strip underneath. */
.artist { margin: -6px 0 12px; color: #bdbdbd; }
.aplayer { position: relative; background: #0a0a0a; border: 1px solid #251010; border-radius: 10px; overflow: hidden; }
.aplayer canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0a0a0a; }
.aplayer audio { display: block; width: 100%; background: #111; }
.vizbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 12px; border-top: 1px solid #251010; font-size: .95rem; }
.vizbar select { background: #111; color: #ececec; border: 1px solid #3a2020; border-radius: 6px; padding: 6px 8px; font: inherit; }
.vizcalm { display: inline-flex; gap: 6px; align-items: center; }
.aplayer:fullscreen { display: flex; flex-direction: column; justify-content: center; border: 0; border-radius: 0; background: #000; }
.aplayer:fullscreen canvas { max-height: 80vh; width: auto; margin: 0 auto; max-width: 100%; }

/* Home: three short pillars and the main buttons. */
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.pillars { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pillars li { background: #111; border: 1px solid #251010; border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.pillars strong { color: #ff4d4d; }
.pillars span { color: #bdbdbd; font-size: .95rem; }
.field select { min-height: 44px; padding: 8px 12px; border: 1px solid #444; border-radius: 8px; background: #0e0e0e; color: var(--text); font: inherit; }
