/* ===== Base ============================================================== */
:root {
  --void: #060505;          /* page bg — warm near-black */
  --card: #12100a;          /* document panel */
  --cream: #e8e1d4;         /* games' body-text cream */
  --cream-dim: #8f8678;     /* aged cream */
  --gold: #d8b66c;          /* games' link gold */
  --gold-bright: #f0d28a;   /* .ministry gold */
  --gold-dim: #6b5a34;      /* document-border brown-gold */
  --blood: #842424;         /* verdict red */
  --blood-bright: #b03030;
  --blood-ghost: #220707;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--cream-dim);
  font-family: var(--mono);
  min-height: 100vh;
  overflow-x: hidden;
  /* A guttering house lamp: slower and smaller than a strobe. */
  animation: gutter 11s infinite;
}

@keyframes gutter {
  0%, 100% { opacity: 1; }
  31%      { opacity: 0.97; }
  33%      { opacity: 1; }
  68%      { opacity: 0.96; }
  71%      { opacity: 1; }
  72%      { opacity: 0.98; }
  73%      { opacity: 1; }
}

/* ===== Decay overlay layers ============================================== */
.decay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

/* Dust: warm-tinted turbulence grain, shifted slowly — motes, not static. */
.decay-noise {
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.91   0 0 0 0 0.88   0 0 0 0 0.80   0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
  animation: dust-shift 4s steps(2) infinite;
}

@keyframes dust-shift {
  0%   { background-position: 0 0; }
  50%  { background-position: -34px 22px; }
  100% { background-position: 0 0; }
}

/* Water damage: large static blotches of sepia turbulence, multiplied in. */
.decay-stain {
  opacity: 0.3;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.30   0 0 0 0 0.22   0 0 0 0 0.12   0.7 0 0 0 0'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>");
  background-size: 700px 700px;
  mix-blend-mode: multiply;
}

/* Vignette: warmed, and pulled slightly off-center — the lamp hangs crooked. */
.decay-vignette {
  background: radial-gradient(
    ellipse at 47% 42%,
    rgba(6, 4, 2, 0) 38%,
    rgba(6, 4, 2, 0.55) 78%,
    rgba(6, 4, 2, 0.95) 100%
  );
}

/* ===== Catalog stamp + house clock (corner overlays) ===================== */
.catalog, .houseclock {
  position: fixed;
  top: 1.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--cream-dim);
  z-index: 110;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(232, 225, 212, 0.12);
}
.catalog {
  left: 1.2rem;
  text-align: left;
  line-height: 1.7;
}
.catalog .lamp {
  color: var(--gold-bright);
  animation: lamp-pulse 4s ease-in-out infinite;
}
.houseclock { right: 1.2rem; font-variant-numeric: tabular-nums; }

@keyframes lamp-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Redaction bar: ink over whatever used to be there. */
.redacted {
  background: #000;
  color: transparent;
  box-shadow: 0 0 0 1px #1a1512;
  transform: rotate(-0.3deg);
  display: inline-block;
  user-select: none;
}

/* ===== Main house ======================================================== */
.screen {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
  text-align: center;
}

/* Title as a double-exposed playbill line: gold over blood, breathing. */
.title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0 0 0.5rem;
  color: var(--cream);
  text-shadow:
    1px 1px 0 var(--blood),
    -1px -1px 0 rgba(216, 182, 108, 0.55),
    0 0 14px rgba(132, 36, 36, 0.4);
  /* Breathes on a 9.5s cycle; slips sideways once per cycle, briefly. */
  animation: title-breathe 9.5s ease-in-out infinite;
}

@keyframes title-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.012); }
  63%      { transform: scale(1.008) skewX(0deg); }
  63.5%    { transform: scale(1.008) skewX(-1.2deg); }
  64%      { transform: scale(1.008) skewX(0deg); }
}

.subtitle {
  font-family: var(--mono);
  color: var(--gold-dim);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  opacity: 0.85;
  margin: 0 0 4.5rem;
}

/* ===== Programme cards =================================================== */
.programmes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.programme-link {
  display: block;
  padding: 1.6rem 1.85rem;
  border: 1px solid var(--gold-dim);
  /* Inner dashed stitch, inset from the deckled edge. */
  outline: 1px dashed rgba(216, 182, 108, 0.22);
  outline-offset: -8px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='700'><filter id='s'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.30   0 0 0 0 0.22   0 0 0 0 0.12   0.35 0 0 0 0'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>"),
    linear-gradient(178deg, rgba(30, 24, 12, 0.55), rgba(10, 7, 4, 0.75));
  background-size: 700px 700px, auto;
  color: var(--cream-dim);
  text-decoration: none;
  text-align: left;
  transition: border-color 0.15s, outline-color 0.15s, transform 0.2s ease-out;
  position: relative;
}

/* Each programme was filed by a different hand: torn differently, hung
   crooked differently. Hover straightens it — the archive snapping to
   attention is meant to feel quietly wrong. */
.programme:nth-child(1) .programme-link {
  transform: rotate(-0.6deg);
  margin-right: 0.6rem;
  clip-path: polygon(0.6% 3%, 3% 0%, 27% 1.2%, 52% 0.2%, 74% 1.6%, 97% 0%,
    99.6% 6%, 99% 32%, 100% 55%, 99.2% 78%, 99.7% 96%, 96% 100%,
    70% 98.9%, 46% 100%, 21% 98.8%, 3% 99.6%, 0% 95%, 0.9% 70%, 0% 44%, 0.8% 18%);
}
.programme:nth-child(2) .programme-link {
  transform: rotate(0.45deg);
  margin-left: 0.7rem;
  clip-path: polygon(0% 5%, 2.4% 0.4%, 24% 1.4%, 49% 0%, 76% 1.2%, 98% 0.4%,
    100% 4%, 99.1% 27%, 99.8% 52%, 99% 76%, 100% 94%, 97% 99.6%,
    73% 98.7%, 50% 100%, 26% 99%, 4% 100%, 0.4% 96%, 1% 73%, 0.2% 49%, 1.1% 24%);
}
.programme:nth-child(3) .programme-link {
  transform: rotate(-0.35deg);
  margin-right: 0.4rem;
  margin-left: 0.3rem;
  clip-path: polygon(1% 2%, 4% 0.6%, 29% 0%, 55% 1.4%, 78% 0.2%, 97.5% 1%,
    99.5% 5%, 100% 30%, 99% 54%, 99.9% 79%, 99% 97%, 95% 100%,
    68% 99.2%, 44% 98.8%, 19% 100%, 2.5% 99%, 0% 94%, 0.7% 68%, 0.1% 42%, 0.6% 16%);
}

.programme-link:hover,
.programme-link:focus-visible {
  border-color: var(--gold);
  outline-color: rgba(240, 210, 138, 0.45);
  transform: rotate(0deg);
  outline-style: dashed;
}
.programme-link:hover .programme-title,
.programme-link:focus-visible .programme-title {
  color: var(--gold-bright);
  text-shadow:
    1px 0 0 var(--blood-bright),
    0 0 10px rgba(240, 210, 138, 0.35);
}
.programme-link:active { transform: translateY(1px); }

.programme-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--cream-dim);
  margin-bottom: 0.7rem;
}
.programme-status { color: var(--gold-dim); }

.programme-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin: 0.2rem 0 0.45rem;
  transition: color 0.15s, text-shadow 0.15s;
}

.programme-warn {
  font-family: var(--serif);
  font-style: italic;
  color: var(--cream-dim);
  opacity: 0.85;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  margin-bottom: 1.05rem;
}

.programme-cta {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.3em;
  color: var(--blood-bright);
}

/* ===== Usher ============================================================= */
.usher {
  margin-top: 4.5rem;
  font-family: var(--mono);
  color: var(--gold-dim);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  opacity: 0.75;
}
.usher .plea {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 0.18em;
  color: var(--blood);
}

/* ===== Accessibility: respect reduced motion ============================= */
@media (prefers-reduced-motion: reduce) {
  html, body,
  .decay-noise,
  .title,
  .catalog .lamp {
    animation: none;
  }
  .programme-link,
  .programme-link:hover,
  .programme-link:focus-visible {
    transition: none;
  }
}
