/* Blackout — spoiler-free YouTube theater */

:root {
  --ink:      #0C111A;
  --panel:    #151D2B;
  --panel-hi: #1E293B;
  --line:     #2B3648;
  --paper:    #E9E7E2;
  --muted:    #7C8AA0;
  --amber:    #F5A623;
  --redact:   #000000;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --stage-w: min(1920px, calc(100vw - 80px), calc((100vh - 240px) * 16 / 9));
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

.is-off { display: none; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

body[data-mode="entry"] .theater,
body[data-mode="theater"] .entry,
.entry[hidden],
.theater[hidden] { display: none; }

button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ---------- Entry ---------- */

.entry {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 48px 32px 64px;
}

.entry__inner {
  width: min(880px, 100%);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 28px;
}

.headline {
  font-size: clamp(40px, 7.2vw, 92px);
  line-height: .96;
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  letter-spacing: -.02em;
  margin: 0 0 48px;
}

.headline__bar {
  display: inline-block;
  width: clamp(140px, 26vw, 330px);
  height: .62em;
  margin-left: .18em;
  vertical-align: baseline;
  background: var(--redact);
  border: 1px solid var(--line);
  transform: translateY(.06em);
}

.starter__label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.starter__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.starter__input {
  flex: 1 1 340px;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: .01em;
  transition: border-color .18s var(--ease);
}

.starter__input::placeholder { color: #4E5C72; }
.starter__input:focus { border-color: var(--amber); outline: none; }

.starter__note {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 14px 0 0;
  min-height: 1.6em;
}

.starter__note[data-state="error"] { color: #FF8A6B; }

.btn {
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}

.btn--go {
  background: var(--amber);
  color: #14100A;
  font-weight: 600;
  padding: 18px 28px;
}

.btn--go:hover { background: #FFBF52; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  padding: 10px 16px;
}

.btn--ghost:hover { color: var(--paper); border-color: var(--muted); }

.hides {
  list-style: none;
  margin: 72px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
}

.hides__item { display: grid; gap: 10px; }

.hides__n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hides__redact {
  position: relative;
  align-self: start;
  justify-self: start;
  font-family: var(--mono);
  font-size: 14px;
  color: transparent;
  background: var(--redact);
  padding: 6px 10px;
  border: 1px solid var(--line);
  user-select: none;
}

/* ---------- Theater ---------- */

.theater {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  padding: 20px 40px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-size: 15px;
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: .12em;
}

.wordmark__redact {
  background: var(--redact);
  color: var(--redact);
  border: 1px solid var(--line);
  padding: 1px 4px;
  margin-left: 2px;
}

.stage {
  width: var(--stage-w);
  justify-self: center;
  align-self: center;
  background: var(--redact);
  border: 1px solid var(--line);
  position: relative;
}

.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.frame {
  position: absolute;
  inset: 0;
}

.frame iframe,
.frame > div {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Full-bleed transparent lid: kills hover-reveal of title, share and watch-on-YouTube */
.shield {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: transparent;
}

.plate {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  background: #000;
  transition: opacity .5s var(--ease), visibility .5s;
}

.plate[hidden] {
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.plate--tap { cursor: pointer; }

.plate--tap .plate__label { color: var(--paper); }

.plate__label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--amber);
}

.plate__sub {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Deck ---------- */

.deck {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 14px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.deck__side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck__side--end { justify-content: flex-end; }

.deck__center {
  display: flex;
  align-items: center;
  gap: 14px;
}

.jump { display: flex; gap: 6px; }
.jump--back { flex-direction: row; }

.key {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}

.key:hover { border-color: var(--amber); color: var(--amber); }
.key:active { background: var(--panel-hi); }

.key--jump { min-width: 54px; }

.key--cc {
  min-width: 44px;
  color: var(--muted);
  letter-spacing: .1em;
  position: relative;
}

/* Off reads as struck through, so the state is legible without a colour cue. */
.key--cc::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
  background: currentColor;
  opacity: .7;
}

.key--cc.is-on {
  color: var(--amber);
  border-color: var(--amber);
}

.key--cc.is-on::after { display: none; }

.key--play, .key--sound, .key--fs {
  display: grid;
  place-items: center;
  padding: 8px;
  width: 38px;
  height: 38px;
}

.key--play {
  background: var(--amber);
  border-color: var(--amber);
  color: #14100A;
  width: 46px;
  height: 46px;
}

.key--play:hover { background: #FFBF52; border-color: #FFBF52; color: #14100A; }

.key__icon { width: 20px; height: 20px; fill: currentColor; }
.key--play .key__icon { width: 22px; height: 22px; }

.vol {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 0;
}

.vol::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
}

/* The signature: the progress bar that refuses to exist */
.redaction {
  position: relative;
  width: clamp(160px, 22vw, 360px);
  height: 34px;
  background: var(--redact);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: default;
}

.redaction__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: #2F3A4C;
  transition: color .25s var(--ease);
}

.redaction:hover .redaction__label { color: var(--muted); }

.quality { display: flex; align-items: center; gap: 8px; }

.quality__tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.quality__select {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 9px 26px 9px 11px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.quality__select:hover { border-color: var(--amber); }
.quality__select option { background: var(--panel); color: var(--paper); }

.shortcuts {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #46536A;
}

/* ---------- Full screen ---------- */

.stage:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  display: grid;
  place-items: center;
  background: #000;
}

.stage:fullscreen .screen {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
}

.stage:fullscreen .deck {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: min(1180px, calc(100vw - 60px));
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(12, 17, 26, .92);
  backdrop-filter: blur(14px);
  transition: opacity .3s var(--ease);
}

.stage:fullscreen[data-idle="true"] .deck { opacity: 0; pointer-events: none; }
.stage:fullscreen[data-idle="true"] { cursor: none; }

@media (max-width: 860px) {
  :root { --stage-w: min(1920px, calc(100vw - 24px)); }
  .theater { padding: 14px 12px 18px; }
  .deck { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
  .deck__side--end { justify-content: center; }
  .deck__center { flex-wrap: wrap; justify-content: center; }
  .shortcuts { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
