/* SCT3 — a dark threshold, and sixteen lights that open it */
:root {
  --void: #0a0c12;
  --hall: #151821;
  --lintel: #2a3140;
  --cream: #f2ebe2;
  --muted: #a9b0bf;
  --portal: #e8f0ff;
  --ember: #e08a3a;
  --ember-hi: #f0b36a;
  --gold: #f0c36a;
  --ink: #141018;
  --display: "Fraunces", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  --gutter: clamp(.9rem, 3vw, 1.6rem);
  --measure: 40rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); color: var(--cream); scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 1.1rem/1.65 var(--body);
  background: transparent;
  min-height: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ember-hi); }
a:hover { color: var(--gold); }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--gold); color: var(--ink); padding: .6rem 1rem;
}
.skip:focus { left: var(--gutter); top: .5rem; }

/* Field: dark hall + doorway glow */
.threshold-field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 42% 55% at 72% 42%, rgba(232, 240, 255, .14), transparent 58%),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(10, 12, 18, .95), transparent 55%),
    linear-gradient(180deg, #0a0c12 0%, #12151e 48%, #0a0c12 100%);
  transition: filter .9s ease, opacity .9s ease;
}
html.is-open .threshold-field {
  background:
    radial-gradient(ellipse 48% 60% at 72% 40%, rgba(232, 240, 255, .28), transparent 60%),
    radial-gradient(ellipse 55% 40% at 30% 20%, rgba(224, 138, 58, .12), transparent 55%),
    linear-gradient(180deg, #0c1018 0%, #171b26 50%, #0a0c12 100%);
}
html.is-playing .threshold-field {
  filter: brightness(1.06);
}

.top, main, footer { position: relative; z-index: 1; }
.top {
  display: flex; justify-content: flex-end;
  padding: .55rem var(--gutter) 0;
}
.brand {
  font: 700 .78rem/1 var(--display);
  letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
}
.brand:hover { color: var(--gold); }

.hero {
  width: min(100% - 2 * var(--gutter), 56rem);
  margin: 0 auto;
  padding: .55rem 0 .85rem;
  text-align: center;
}
.kicker {
  margin: 0 0 .25rem;
  font: 600 .72rem/1.3 var(--body);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ember);
}
h1 {
  margin: 0;
  font: 700 clamp(1.35rem, 3.6vw, 2.35rem)/1.12 var(--display);
  letter-spacing: .01em;
  color: var(--cream);
}
/* Rainbow colour-cycle ≥ 1 minute (owner Fractal rule) */
h1.cycle {
  background: linear-gradient(
    100deg,
    #ff6b6b, #f0c36a, #7dcea0, #5dade2, #af7ac5, #f5b041, #ff6b6b
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-cycle 72s linear infinite;
}
@keyframes title-cycle {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.lede {
  margin: .45rem auto .7rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(.92rem, 1.5vw, 1.02rem);
  line-height: 1.45;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.stage-wrap { margin: 0 auto .55rem; width: min(100%, 52rem); }
.stage {
  position: relative;
  width: min(100%, calc((100dvh - 15.5rem) * 16 / 9));
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(232, 240, 255, .18);
  box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 18px 50px rgba(0,0,0,.5);
  background: #000;
  transition: border-color .5s ease, box-shadow .5s ease;
}
html.is-open .stage {
  border-color: rgba(224, 138, 58, .45);
}
html.is-playing .stage {
  border-color: var(--ember);
  box-shadow: 0 0 0 1px rgba(224,138,58,.35), 0 0 44px rgba(232,240,255,.12);
}
.screen { position: absolute; inset: 0; }
.stream-video, .facade, .facade img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.stream-video { z-index: 1; background: #000; }
.facade {
  z-index: 2; border: 0; padding: 0; cursor: pointer; background: #000;
}
.facade .play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 4.25rem; height: 4.25rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10, 12, 18, .55);
  border: 2px solid rgba(232, 240, 255, .75);
  color: var(--portal); font-size: 1.35rem;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.facade:hover .play,
.facade:focus-visible .play {
  transform: translate(-50%, -50%) scale(1.06);
  border-color: var(--ember);
  background: rgba(224, 138, 58, .25);
  color: var(--gold);
}
.facade:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Sixteen witness lights (not carousel dots) */
.lights {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .48rem;
  margin: .45rem auto 0; max-width: 22rem;
  list-style: none; padding: 0;
}
.lights li {
  width: .28rem; height: .95rem; border-radius: .2rem .2rem 40% 40%;
  background: linear-gradient(180deg, rgba(240, 179, 106, .35), rgba(169, 176, 191, .15) 55%, rgba(169, 176, 191, .08));
  box-shadow: 0 -1px 4px rgba(240, 179, 106, .15);
  transition: background .5s ease, box-shadow .5s ease, transform .5s ease;
}
.lights li:nth-child(3n) { height: .75rem; margin-top: .12rem; }
.lights li:nth-child(5n) { height: 1.1rem; margin-top: -.05rem; }
html.is-open .lights li {
  background: var(--ember-hi);
  box-shadow: 0 0 10px rgba(240, 179, 106, .7), 0 0 2px rgba(240, 179, 106, .9);
  transform: scale(1.12);
}
html.is-playing .lights li {
  background: var(--portal);
  box-shadow: 0 0 12px rgba(232, 240, 255, .75);
}
.lights-caption {
  margin: .35rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}

.actions {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
  align-items: center; margin: .7rem 0 .15rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .55rem 1rem;
  border-radius: .35rem;
  border: 1px solid rgba(224, 138, 58, .55);
  background: var(--ember); color: var(--ink);
  font: 600 .95rem/1.2 var(--body);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ember-hi); color: var(--ink); }
.btn.ghost {
  background: transparent; color: var(--cream);
  border-color: rgba(232, 240, 255, .28);
}
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.plate {
  width: min(100% - 2 * var(--gutter), 52rem);
  margin: 1.5rem auto;
}
.plate img {
  width: 100%; border-radius: .2rem;
  border: 1px solid rgba(232, 240, 255, .12);
}
.plate figcaption {
  margin-top: .55rem;
  color: var(--muted);
  font-size: .95rem;
  text-align: justify;
  text-justify: inter-word;
}

.panel {
  width: min(100% - 2 * var(--gutter), 42rem);
  margin: 1.75rem auto;
  padding: 1.25rem 1.2rem;
  background: rgba(21, 24, 33, .72);
  border: 1px solid rgba(42, 49, 64, .9);
  border-radius: .35rem;
}
.panel h2 {
  margin: 0 0 .75rem;
  font: 700 1.35rem/1.25 var(--display);
  color: var(--cream);
}
.panel p {
  margin: 0 0 .75rem;
  color: var(--muted);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.files {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.files a {
  min-height: 44px;
  display: inline-flex; align-items: center;
  padding: .45rem .85rem;
  border: 1px solid rgba(224, 138, 58, .4);
  border-radius: .3rem;
  text-decoration: none;
  color: var(--cream);
  background: rgba(10, 12, 18, .35);
}
.files a:hover { border-color: var(--gold); color: var(--gold); }

.related {
  width: min(100% - 2 * var(--gutter), 42rem);
  margin: 1.5rem auto 2rem;
}
.related h2 {
  margin: 0 0 .75rem;
  font: 700 1.25rem/1.25 var(--display);
  text-align: center;
}
.related ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .45rem;
}
.related a {
  display: block;
  min-height: 44px;
  padding: .65rem .85rem;
  border-left: 3px solid rgba(224, 138, 58, .45);
  background: rgba(21, 24, 33, .55);
  text-decoration: none;
  color: var(--cream);
}
.related a:hover {
  border-left-color: var(--gold);
  color: var(--gold);
}

.closing {
  text-align: center;
  padding: 1.5rem var(--gutter) 2.5rem;
  color: var(--muted);
  font-size: .95rem;
}
.mark {
  width: 2.5rem; height: 2.5rem; margin: 0 auto .75rem;
  border: 2px solid rgba(232, 240, 255, .35);
  border-radius: .2rem;
  box-shadow: inset 0 0 18px rgba(232, 240, 255, .2);
  position: relative;
}
.mark::after {
  content: "";
  position: absolute; inset: 22% 18% 22% 55%;
  background: linear-gradient(90deg, transparent, rgba(232, 240, 255, .55));
}

.rv { opacity: 0; transform: translateY(.6rem); transition: opacity .6s ease, transform .6s ease; }
.rv.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  h1.cycle { animation: none; color: var(--cream); background: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .threshold-field, .lights li, .stage { transition: none; }
}

@media (max-width: 520px) {
  .stage { width: 100%; }
  .lede { font-size: 1rem; }
}

@media print {
  .threshold-field, .facade .play, .actions { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; }
}
