/* =========================================================
   PoindeXter — black, flame, and not much else
   ========================================================= */

:root {
  --ink:      #ece6db;
  --ink-soft: #c8bfb2;
  --dim:      #948a7d;
  --line:     rgba(255, 255, 255, 0.10);
  --fire:     #ff6a00;
  --fire-dim: rgba(255, 106, 0, 0.35);

  --serif: Georgia, "Times New Roman", "Nimbus Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SFMono-Regular", "Cascadia Mono", "Courier New", monospace;

  --gut: clamp(1.25rem, 5vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: #000;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.has-player { padding-bottom: 88px; }

::selection { background: var(--fire); color: #100600; }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }

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

/* ---------- the room ---------------------------------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #000;
}

.art {
  position: absolute;
  inset: 0;
  background-image: url("../assets/bg.jpg");
  background-size: cover;
  background-position: center 40%;
  opacity: 0.62;
  filter: saturate(0.85) contrast(1.06) brightness(0.95);
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 92% 72% at 50% 42%, transparent 0%, rgba(0,0,0,0.38) 62%, #000 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 22%, transparent 72%, #000 100%);
}

#embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

main, .foot { position: relative; z-index: 1; }

/* ---------- hero -------------------------------------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3rem, 8vh, 6rem) var(--gut) clamp(4rem, 10vh, 7rem);
  gap: 0;
}

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(0.7rem, 0.65rem + 0.25vw, 0.82rem);
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  text-transform: uppercase;
  color: #b6aa9b;
  opacity: 0.85;
}

.mark {
  width: min(880px, 84vw);
  height: auto;
  margin: 0.4rem 0 0.15rem;
  overflow: visible;
}

.mark-text,
.mark-bloom {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 140px;
  letter-spacing: -1px;
}

.mark-text { fill: url(#fire); }

.mark-bloom {
  fill: #ff3c00;
  opacity: 0.55;
  animation: flicker 5.5s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 0.52; }
  18%      { opacity: 0.44; }
  33%      { opacity: 0.60; }
  51%      { opacity: 0.40; }
  67%      { opacity: 0.58; }
  84%      { opacity: 0.46; }
}

.lede {
  max-width: 46ch;
  margin: clamp(1.6rem, 4vh, 2.6rem) auto 0;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 0.94rem + 0.3vw, 1.1rem);
  line-height: 1.75;
}

.lede em {
  color: var(--ink);
  font-style: italic;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: center;
  margin-top: clamp(1.8rem, 4.5vh, 2.8rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--fire-dim);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 220ms ease, color 220ms ease,
              border-color 220ms ease, box-shadow 220ms ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--fire);
  border-color: var(--fire);
  color: #120600;
  box-shadow: 0 0 34px rgba(255, 90, 0, 0.4);
}

.btn-ghost {
  border-color: transparent;
  background: none;
  color: var(--dim);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: none;
  border-color: transparent;
  color: var(--fire);
  box-shadow: none;
}

/* ---------- sections ---------------------------------- */

.section {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) var(--gut);
  scroll-margin-top: 2rem;
}

.label {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 0 0 clamp(1.8rem, 4vh, 2.6rem);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #a3978a;
}

.label::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 106, 0, 0.4), rgba(255, 106, 0, 0));
}

.section-note {
  max-width: 640px;
  margin: -1.1rem 0 2.2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--dim);
}

/* ---------- film -------------------------------------- */

.film { margin: 0; }

.frame {
  position: relative;
  background: #050403;
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 1px rgba(255, 106, 0, 0.08),
    0 30px 90px -30px rgba(255, 80, 0, 0.28),
    0 2px 10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.frame video {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: #000;
  object-fit: contain;
}

.veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  padding: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.05), rgba(0,0,0,0.45));
  cursor: pointer;
  transition: opacity 400ms ease;
}

.veil.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.veil-play {
  display: block;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 140, 60, 0.55);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  position: relative;
  transition: transform 260ms ease, background-color 260ms ease,
              border-color 260ms ease, box-shadow 260ms ease;
}

.veil-play::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-38%, -50%);
  border-left: 20px solid var(--ink);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

.veil:hover .veil-play,
.veil:focus-visible .veil-play {
  background: var(--fire);
  border-color: var(--fire);
  transform: scale(1.07);
  box-shadow: 0 0 46px rgba(255, 90, 0, 0.6);
}

.veil:hover .veil-play::after,
.veil:focus-visible .veil-play::after {
  border-left-color: #120600;
}

figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  margin-top: 0.95rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.cap-title { color: var(--ink-soft); }

/* ---------- tracks ------------------------------------ */

.tracks {
  list-style: none;
  max-width: 640px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.track {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 3.4rem 1.4rem;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.72rem 0.4rem 0.72rem 0.15rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease,
              padding 200ms ease;
}

.track:hover,
.track:focus-visible {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(255, 106, 0, 0.07), transparent 65%);
}

.track.is-active {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(255, 106, 0, 0.10), transparent 60%);
}

.num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #817869;
  font-variant-numeric: tabular-nums;
  transition: color 160ms ease;
}

.track.is-active .num { color: var(--fire); }

.name {
  font-size: 1rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qual { color: var(--dim); font-size: 0.9em; }

.dur {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #8a8174;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* little equaliser on the playing row */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  opacity: 0;
  transition: opacity 200ms ease;
}

.track.is-active .spark { opacity: 1; }

.spark i {
  display: block;
  width: 2px;
  height: 3px;
  background: var(--fire);
  box-shadow: 0 0 6px rgba(255, 106, 0, 0.8);
}

.is-playing .spark i {
  animation: bounce 900ms ease-in-out infinite;
}

.is-playing .spark i:nth-child(2) { animation-duration: 700ms; animation-delay: -200ms; }
.is-playing .spark i:nth-child(3) { animation-duration: 1100ms; animation-delay: -420ms; }

@keyframes bounce {
  0%, 100% { height: 3px; }
  50%      { height: 12px; }
}

/* ---------- about ------------------------------------- */

.prose { max-width: 58ch; }
.prose p { margin: 0 0 1.15rem; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }

.keep {
  margin-top: 1.8rem !important;
  color: var(--ink) !important;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.12rem;
}

/* ---------- footer ------------------------------------ */

.foot {
  padding: clamp(3rem, 8vh, 5rem) var(--gut) clamp(4rem, 9vh, 6rem);
  text-align: center;
}

.foot-mark {
  margin: 0 auto 1.6rem;
  width: 240px;
  height: auto;
  opacity: 0.5;
  filter: saturate(0.9);
}

.foot-line {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a8174;
}

.foot-line a {
  color: #8d8377;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 106, 0, 0.28);
  padding-bottom: 2px;
  transition: color 180ms ease, border-color 180ms ease;
}

.foot-line a:hover { color: var(--fire); border-color: var(--fire); }
.dot { color: #817a6d; margin: 0 0.55rem; }

/* ---------- player ------------------------------------ */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, 1.9fr) auto;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.6rem);
  padding: 0.7rem clamp(0.9rem, 3vw, 1.8rem);
  background: rgba(7, 5, 4, 0.93);
  backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid rgba(255, 106, 0, 0.22);
  box-shadow: 0 -20px 50px -20px rgba(255, 80, 0, 0.22);
  animation: rise 420ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.player[hidden] { display: none; }

@keyframes rise {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.pp {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid var(--fire-dim);
  border-radius: 50%;
  background: rgba(255, 106, 0, 0.08);
  color: var(--fire);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease,
              box-shadow 180ms ease;
}

.pp:hover { background: var(--fire); color: #120600; box-shadow: 0 0 26px rgba(255, 90, 0, 0.55); }

.pp svg, .transport svg { width: 20px; height: 20px; fill: currentColor; }
.pp .ico-pause { display: none; }
.player.is-playing .pp .ico-play  { display: none; }
.player.is-playing .pp .ico-pause { display: block; }

.now { min-width: 0; }

.now-title {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.scrub { min-width: 0; }

.scrub input[type="range"] {
  width: 100%;
  margin: 0 0 0.25rem;
  --p: 0%;
}

.times {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  color: #8a8174;
}

.transport { display: flex; gap: 0.35rem; }

.transport button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--dim);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.transport button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }

/* range inputs, both of them */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg,
    var(--fire) 0 var(--p, 0%),
    rgba(255, 255, 255, 0.16) var(--p, 0%) 100%);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
}

input[type="range"]::-moz-range-progress {
  height: 2px;
  background: var(--fire);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: var(--fire);
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.85);
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: var(--fire);
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.85);
}

input[type="range"]:disabled { cursor: default; opacity: 0.45; }

/* ---------- small screens ----------------------------- */

@media (max-width: 640px) {
  .art { background-position: 72% 88%; opacity: 0.42; }

  .hero { padding-top: 3.5rem; }

  .mark { width: 92vw; }

  .kicker { letter-spacing: 0.45em; text-indent: 0.45em; }

  .lede { font-size: 1rem; }

  .btn { padding: 0.85rem 1.15rem; }

  .track {
    grid-template-columns: 2rem minmax(0, 1fr) 2.9rem 1.2rem;
    gap: 0.55rem;
  }

  .name {
    font-size: 0.94rem;
    /* let the longer titles wrap rather than chop "(Instrumental)" in half */
    white-space: normal;
    overflow: visible;
  }

  .player {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "pp now transport"
      "scrub scrub scrub";
    gap: 0.5rem 0.8rem;
    padding: 0.65rem 1rem 0.8rem;
  }

  .pp { grid-area: pp; width: 42px; height: 42px; }
  .now { grid-area: now; }
  .transport { grid-area: transport; }
  .scrub { grid-area: scrub; }

  body.has-player { padding-bottom: 108px; }
}

@media (max-width: 380px) {
  .track { grid-template-columns: 1.8rem minmax(0, 1fr) 2.6rem; }
  .spark { display: none; }
}

/* ---------- preferences ------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .mark-bloom { animation: none; opacity: 0.52; }
  #embers { display: none; }
}
