/* Metal Cloud — deck site styles. Source-of-truth typography: per-run inline. */

@font-face {
  font-family: "DrukWideMC";
  font-weight: 700;
  font-display: block;
  src: url("./fonts/DrukWideBold.ttf") format("truetype");
}
@font-face {
  font-family: "CopperplateMC";
  font-weight: 700;
  font-display: block;
  src: url("./fonts/CopperplateSys-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "CopperplateMC";
  font-weight: 300;
  font-display: block;
  src: url("./fonts/Copperplate-Light.ttf") format("truetype");
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  background: #000;
  color: #E1D8D0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: "CopperplateMC", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  position: relative;
}

#deck {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(100vw, 177.778vh);
  height: min(56.25vw, 100vh);
  transform: translate(-50%, -50%);
  container-type: size;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.slide .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.slide .vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.55) 100%);
}

/* Slide 08 — gas-mask bg needs strong scrim for text legibility everywhere body sits */
.slide[data-slide-id="08"] .vignette {
  background:
    linear-gradient(to right,
      rgba(0,0,0,0.78) 0%,
      rgba(0,0,0,0.55) 28%,
      rgba(0,0,0,0.4) 50%,
      rgba(0,0,0,0.55) 72%,
      rgba(0,0,0,0.78) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.2) 25%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.55) 100%);
}

.slide .text-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.slide .slide-num {
  position: absolute;
  bottom: 20px;
  right: 28px;
  font-family: "CopperplateMC", serif;
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: rgba(225, 216, 208, 0.35);
  z-index: 3;
}

.slide .static-badge {
  display: none;
}

/* ─── Text layers — layer-level animation, no DOM wrapping ───── */

.text-layer {
  position: absolute;
  font-feature-settings: "kern" 1, "liga" 0;
  text-shadow:
    0 0 3px rgba(0,0,0,0.85),
    0 2px 14px rgba(0,0,0,0.7);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) var(--stagger, 0s),
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) var(--stagger, 0s);
}
.text-layer .run { display: block; }

.slide.text-in .text-layer {
  opacity: 1;
  transform: translateY(0);
}

.slide.text-out .text-layer {
  opacity: 0;
  transform: translateY(-14px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

/* ─── Transition video overlay ────────────────────────────────── */

#transition-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  background: #000;
  transition: opacity 0.18s ease;
}
#transition-video.active {
  opacity: 1;
}

/* ─── Hint ─────────────────────────────────────────────────────── */

#hint {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "CopperplateMC", serif;
  font-weight: 300;
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  color: rgba(225, 216, 208, 0.55);
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.6s;
}
#hint.hidden { opacity: 0; }

/* ─── Side TOC — thin dot rail, expands on hover ─────────────── */

#toc {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  z-index: 60;
  padding: 6px 10px 6px 32px;
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.0) 100%);
  transition: background 0.25s ease;
}
#toc:hover {
  background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 80%);
}
.toc-item {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  cursor: pointer;
  padding: 5px 0 5px 8px;
  font-family: "CopperplateMC", serif;
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(225, 216, 208, 0.42);
  white-space: nowrap;
  text-align: right;
  transition: color 0.22s ease;
}
.toc-item:hover { color: rgba(225, 216, 208, 0.95); }
.toc-item.active { color: #F22D00; }

.toc-num {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  min-width: 18px;
  text-align: right;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.28s ease, opacity 0.22s ease;
}
.toc-title {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.28s ease, opacity 0.22s ease;
}
#toc:hover .toc-num,
#toc:hover .toc-title {
  max-width: 240px;
  opacity: 1;
}

.toc-tick {
  width: 10px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  transition: width 0.22s ease, opacity 0.22s ease;
}
.toc-item:hover .toc-tick { width: 16px; opacity: 0.9; }
.toc-item.active .toc-tick { width: 28px; opacity: 1; background: #F22D00; }

/* ─── Audio control — bottom-left, mirrors hint/toc aesthetic ── */

#audio-ctrl {
  position: fixed;
  left: 22px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}
#audio-ctrl:hover { opacity: 1; }

#audio-toggle {
  all: unset;
  cursor: pointer;
  font-family: "CopperplateMC", serif;
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(225, 216, 208, 0.85);
  transition: color 0.2s ease;
  min-width: 64px;
}
#audio-toggle:hover { color: #E1D8D0; }
#audio-toggle[aria-pressed="false"] { color: rgba(225, 216, 208, 0.4); }

#audio-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 1px;
  background: rgba(225, 216, 208, 0.35);
  outline: none;
  cursor: pointer;
}
#audio-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 9px;
  height: 9px;
  background: #F22D00;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}
#audio-volume::-webkit-slider-thumb:hover { transform: scale(1.25); }
#audio-volume::-moz-range-thumb {
  width: 9px;
  height: 9px;
  background: #F22D00;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
#audio-ctrl.muted #audio-volume::-webkit-slider-thumb { background: rgba(225, 216, 208, 0.4); }
#audio-ctrl.muted #audio-volume::-moz-range-thumb { background: rgba(225, 216, 208, 0.4); }

@media (prefers-reduced-motion: reduce) {
  .text-layer { transition: opacity 0.3s ease; transform: none; }
  video.bg { display: none; }
  #transition-video { display: none; }
}
