:root {
  color-scheme: dark;
  --bg: #05060a;
  --panel: rgba(7, 9, 18, 0.28);
  --panel-strong: rgba(7, 9, 18, 0.48);
  --text: #fff9cf;
  --muted: #9cecff;
  --yellow: #fff200;
  --cyan: #00e5ff;
  --pink: #ff2bd6;
  --danger: #ff395f;
  --shadow: 0 0 28px rgba(0, 229, 255, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Rajdhani", system-ui, sans-serif;
  background:
    linear-gradient(120deg, rgba(5, 6, 10, 0.18), rgba(5, 6, 10, 0.42)),
    url("int.jpg") center / cover fixed,
    radial-gradient(circle at 20% 15%, rgba(255, 43, 214, 0.26), transparent 35%),
    radial-gradient(circle at 80% 75%, rgba(0, 229, 255, 0.2), transparent 32%),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: overlay;
}

button {
  border: 1px solid rgba(0, 229, 255, 0.7);
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  font: 700 0.95rem/1 "Orbitron", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

button:hover:not(:disabled),
button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--yellow);
  box-shadow: 0 0 18px rgba(255, 242, 0, 0.28);
  outline: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.shell {
  display: grid;
  min-height: 100vh;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  align-content: center;
  gap: 22px;
  padding: 48px 0;
}

.hero-panel,
.radio-panel,
.gallery-panel,
.gate-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.45);
  background: linear-gradient(135deg, var(--panel), var(--panel-strong));
  box-shadow: var(--shadow), inset 0 0 24px rgba(255, 242, 0, 0.03);
  backdrop-filter: blur(2px);
}

.hero-panel::after,
.radio-panel::after,
.gallery-panel::after,
.gate-panel::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(255, 242, 0, 0.16);
  clip-path: polygon(0 0, 44% 0, 44% 2px, 2px 2px, 2px 100%, 0 100%);
}

.hero-panel {
  padding: clamp(28px, 6vw, 72px);
}

.radio-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(20px, 4vw, 34px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font: 700 0.82rem/1.2 "Orbitron", system-ui, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.65);
}

h1,
h2 {
  margin: 0;
  font-family: "Orbitron", system-ui, sans-serif;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  color: var(--yellow);
  font-size: clamp(2.6rem, 9vw, 7.8rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  text-shadow: 3px 0 var(--pink), -3px 0 var(--cyan), 0 0 26px rgba(255, 242, 0, 0.36);
}

h2 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  letter-spacing: 0.04em;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(24px, 6vw, 52px);
}

.time-card {
  min-height: 132px;
  padding: 18px 12px 14px;
  border: 1px solid rgba(255, 242, 0, 0.38);
  background: rgba(0, 0, 0, 0.32);
  text-align: center;
}

.time-card strong {
  display: block;
  color: white;
  font: 900 clamp(2.4rem, 8vw, 5.2rem)/0.95 "Orbitron", system-ui, sans-serif;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.46);
}

.time-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status,
.track-title {
  margin: 18px 0 0;
  color: rgba(255, 249, 207, 0.78);
  font-size: 1.2rem;
  font-weight: 600;
}

.track-title {
  margin-top: 6px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.controls button {
  min-width: 86px;
  padding: 14px 16px;
}

.controls .primary {
  min-width: 112px;
  border-color: var(--yellow);
  color: #060606;
  background: var(--yellow);
  box-shadow: 0 0 22px rgba(255, 242, 0, 0.24);
}

.gallery-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 36px);
}

.gallery-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.gallery-intro {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 249, 207, 0.78);
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------- relay dossier
   The intercepted log reads as a machine artifact, so it is typeset as one: a
   monospace terminal block with a stamped header, key/value metadata grid, and
   bracketed fragment markers. Colours come from the existing palette; the two
   personalities get the page's own blue/red pair.
   The body background is a photograph under a scanline overlay, so every text
   surface below carries its own dark backing plate for contrast. */

.dossier {
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.34);
  background: rgba(2, 4, 10, 0.66);
  box-shadow: inset 0 0 40px rgba(0, 229, 255, 0.06);
  /* Corner cut, matching the gallery cards' clipped corners. */
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.dossier-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.24);
  background: rgba(0, 229, 255, 0.07);
  font: 700 0.74rem/1.2 "Orbitron", system-ui, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.dossier-tag {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.dossier-corp {
  color: var(--muted);
}

.dossier-sev {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: rgba(255, 57, 95, 0.1);
  /* A stamp, not a label: slightly off-axis reads as pressure-printed. */
  transform: rotate(-1.2deg);
  text-shadow: 0 0 12px rgba(255, 57, 95, 0.45);
}

.dossier-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 18px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  background: rgba(0, 0, 0, 0.3);
}

.dossier-meta dt {
  color: var(--cyan);
  font: 700 0.72rem/1.5 "Orbitron", system-ui, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dossier-meta dd {
  margin: 0;
  color: rgba(255, 249, 207, 0.86);
  font-size: 1rem;
  font-weight: 600;
}

.dossier-hot {
  color: var(--yellow) !important;
  text-shadow: 0 0 12px rgba(255, 242, 0, 0.4);
}

.dossier-log {
  padding: clamp(16px, 3vw, 26px);
  font-family: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  line-height: 1.62;
}

.dossier-log p {
  margin: 0 0 12px;
}

.dossier-log p:last-child {
  margin-bottom: 0;
}

.log-frag {
  margin: 22px 0 12px !important;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.3);
  color: var(--cyan);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.45);
}

.log-frag-blue {
  color: #6ea8ff;
  border-bottom-color: rgba(110, 168, 255, 0.42);
  text-shadow: 0 0 12px rgba(110, 168, 255, 0.5);
}

.log-frag-red {
  color: var(--danger);
  border-bottom-color: rgba(255, 57, 95, 0.42);
  text-shadow: 0 0 12px rgba(255, 57, 95, 0.5);
}

.log-line {
  color: rgba(226, 255, 244, 0.9);
}

.log-speaker {
  color: var(--yellow);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.log-mark {
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 242, 0, 0.45);
}

/* The line where the transmission itself is corrupted. */
.log-glitch {
  color: #9cecff;
  text-shadow: 1px 0 rgba(255, 43, 214, 0.55), -1px 0 rgba(0, 229, 255, 0.55);
}

.log-terminal {
  color: var(--danger);
  text-shadow: 0 0 14px rgba(255, 57, 95, 0.5);
}

/* The AI answering the reader directly. */
.log-breach {
  margin-top: 22px !important;
  padding: 14px 16px;
  border: 1px solid rgba(255, 57, 95, 0.5);
  color: var(--danger);
  background: rgba(255, 57, 95, 0.08);
  box-shadow: inset 0 0 26px rgba(255, 57, 95, 0.12);
  text-shadow: 0 0 14px rgba(255, 57, 95, 0.45);
}

.log-breach strong {
  display: inline-block;
  margin-top: 4px;
  color: var(--yellow);
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan), 0 0 22px rgba(255, 242, 0, 0.5);
}

/* ---------------------------------------------------------------- final journal
   The closing record is a timestamped terminal log shared by two voices, so each entry
   is a ruled block whose rail and heading take that speaker's colour: blue for the
   Architect, red for the Destroyer. Neutral entries (system + loop narration) keep the
   cyan rail. The aside lines carry the source's *emphasis* — stage directions, notes and
   warnings — which is italic-and-dimmed rather than a separate colour, so emphasis never
   competes with speaker identity. */

.journal-log {
  padding: clamp(16px, 3vw, 26px);
}

.journal-entry {
  margin: 0 0 18px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid rgba(0, 229, 255, 0.4);
}

.journal-entry:last-of-type {
  margin-bottom: 10px;
}

.journal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  margin: 0 0 8px;
  font: 400 0.95rem/1.4 "Share Tech Mono", ui-monospace, monospace;
}

.journal-time {
  color: var(--muted);
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.journal-subject {
  color: var(--yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(255, 242, 0, 0.4);
}

.journal-entry p {
  margin: 0 0 6px;
  color: rgba(226, 255, 244, 0.9);
}

.journal-entry p:last-child {
  margin-bottom: 0;
}

.journal-line::before {
  /* The source marks agent speech with ">"; kept as a marker rather than pasted text so
     it stays out of the reading flow. */
  content: ">";
  margin-right: 8px;
  color: rgba(0, 229, 255, 0.55);
}

.journal-aside {
  margin-left: 10px !important;
  padding-left: 10px;
  border-left: 1px dotted rgba(156, 236, 255, 0.35);
  color: rgba(156, 236, 255, 0.7) !important;
  font-style: italic;
}

/* Speaker identity. */
.journal-blue {
  border-left-color: #6ea8ff;
}

.journal-blue .journal-subject {
  color: #6ea8ff;
  text-shadow: 0 0 12px rgba(110, 168, 255, 0.5);
}

.journal-red {
  border-left-color: var(--danger);
}

.journal-red .journal-subject {
  color: var(--danger);
  text-shadow: 0 0 12px rgba(255, 57, 95, 0.5);
}

.journal-alert {
  color: var(--danger) !important;
  letter-spacing: 0.04em;
  text-shadow: 0 0 14px rgba(255, 57, 95, 0.45);
}

/* The two ideologies, side by side, each in its own colour. */
.ideology {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
}

.ideology li {
  padding: 10px 14px;
  border: 1px solid;
  background: rgba(0, 0, 0, 0.35);
}

.ideology-blue {
  border-color: rgba(110, 168, 255, 0.45);
}

.ideology-blue strong {
  color: #6ea8ff;
  text-shadow: 0 0 12px rgba(110, 168, 255, 0.5);
}

.ideology-red {
  border-color: rgba(255, 57, 95, 0.45);
}

.ideology-red strong {
  color: var(--danger);
  text-shadow: 0 0 12px rgba(255, 57, 95, 0.5);
}

.journal-end {
  margin: 20px 0 8px;
  padding-top: 14px;
  border-top: 1px dashed rgba(0, 229, 255, 0.3);
  color: var(--yellow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.journal-idle {
  color: rgba(156, 236, 255, 0.8) !important;
}

.journal-idle::after {
  /* Blinking cursor: the system is waiting for input that never comes. */
  content: "_";
  margin-left: 4px;
  animation: journal-blink 1.1s steps(1, end) infinite;
}

.journal-lock {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 57, 95, 0.5);
  color: var(--danger);
  background: rgba(255, 57, 95, 0.08);
  box-shadow: inset 0 0 26px rgba(255, 57, 95, 0.12);
  letter-spacing: 0.18em;
  text-align: center;
  text-shadow: 0 0 16px rgba(255, 57, 95, 0.5);
}

@keyframes journal-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journal-idle::after {
    animation: none;
  }
}

/* ---------------------------------------------------------------- cipher image */

.cipher-frame {
  margin: 0;
  max-width: 680px;
}

/* Any image inside a .cipher-frame is a content slot. The guarded artifacts are square
   (the relay QR and the deep-node knot), so reserve a square and letterbox the artwork
   inside it — that keeps the space held before the image loads rather than shifting the
   page. Keyed to the frame rather than a per-page class so every slot stays consistent. */
.cipher-frame .gallery-trigger img {
  aspect-ratio: 1 / 1;
  background:
    repeating-linear-gradient(45deg, rgba(0, 229, 255, 0.06) 0 10px, transparent 10px 20px),
    rgba(0, 0, 0, 0.55);
}

.cipher-frame figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cipher-note {
  max-width: 680px;
  margin: 14px 0 0;
  color: rgba(255, 249, 207, 0.62);
  font-size: 0.95rem;
  font-weight: 600;
}

/* The plain-text brief slot. Empty until the worker answers, so it reserves no space and
   collapses entirely rather than leaving a gap. */
.cipher-brief {
  border: 0;
  background: none;
  font-size: 1.1rem;
  white-space: pre-line;
}

.cipher-brief:empty {
  display: none;
}

/* The cipher section is the "evidence bag": same panel language, but a red-tinted
   artifact accent so it reads as the sealed attachment rather than more prose. */
.cipher-panel {
  border-color: rgba(255, 57, 95, 0.4);
  background: linear-gradient(135deg, rgba(24, 5, 12, 0.4), rgba(10, 4, 14, 0.56));
}

.cipher-panel .eyebrow {
  color: var(--danger);
  text-shadow: 0 0 14px rgba(255, 57, 95, 0.55);
}

.cipher-panel .gallery-intro {
  color: rgba(255, 226, 233, 0.8);
}

.cipher-panel::after {
  border-color: rgba(255, 57, 95, 0.22);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  margin: 0;
}

.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-color: rgba(255, 242, 0, 0.45);
  background: rgba(0, 0, 0, 0.28);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.gallery-trigger img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0.9;
  filter: saturate(1.2) contrast(1.06);
  transition: transform 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.gallery-trigger:hover img,
.gallery-trigger:focus-visible img {
  transform: scale(1.045);
  opacity: 1;
  filter: saturate(1.5) contrast(1.16);
}

.gallery-card figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightbox {
  width: min(1040px, calc(100% - 28px));
  padding: 18px;
  border: 1px solid rgba(0, 229, 255, 0.62);
  color: var(--text);
  background: rgba(3, 4, 10, 0.92);
  box-shadow: 0 0 44px rgba(0, 229, 255, 0.35);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border: 1px solid rgba(255, 242, 0, 0.28);
}

.lightbox p {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightbox-close {
  display: block;
  margin: 0 0 12px auto;
  padding: 10px 14px;
}

.gate-panel {
  padding: clamp(22px, 4vw, 36px);
}

.gate-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.gate-intro {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 249, 207, 0.78);
  font-size: 1.1rem;
  font-weight: 600;
}

.gate-form {
  display: grid;
  gap: 10px;
  max-width: 620px;
}

.gate-label {
  color: var(--muted);
  font: 700 0.82rem/1.2 "Orbitron", system-ui, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gate-row {
  display: flex;
  gap: 10px;
}

.gate-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(0, 229, 255, 0.55);
  color: var(--text);
  background: rgba(0, 0, 0, 0.42);
  font: 700 1.05rem/1 "Orbitron", system-ui, sans-serif;
  letter-spacing: 0.16em;
}

.gate-input::placeholder {
  color: rgba(156, 236, 255, 0.42);
}

.gate-input:focus {
  border-color: var(--yellow);
  outline: none;
  box-shadow: 0 0 20px rgba(255, 242, 0, 0.24);
}

.gate-row button {
  min-width: 132px;
  padding: 14px 16px;
}

.gate-status {
  min-height: 1.4em;
  margin: 0;
  color: rgba(255, 249, 207, 0.78);
  font-size: 1.05rem;
  font-weight: 600;
}

.gate-status[data-state="ok"] {
  color: var(--yellow);
  text-shadow: 0 0 14px rgba(255, 242, 0, 0.5);
}

.gate-status[data-state="error"] {
  color: var(--danger);
  text-shadow: 0 0 14px rgba(255, 57, 95, 0.45);
}

.gate-status[data-state="pending"] {
  color: var(--muted);
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 520px);
    padding: 28px 0;
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .radio-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .controls {
    justify-content: stretch;
  }

  .controls button {
    flex: 1 1 0;
    min-width: 0;
  }

  .gate-row {
    flex-direction: column;
  }

  .gate-row button {
    min-width: 0;
  }

  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
