:root {
  --black: #050505;
  --ink: #13051f;
  --purple: #5d2679;
  --violet: #b24cff;
  --acid: #c9a7e8;
  --hot: #ff4d2e;
  --cyan: #e4d3f7;
  --white: #f8f6ef;
  --muted: #c8c1b0;
  --line: rgba(248, 246, 239, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 12% 18%, rgba(178, 76, 255, 0.2), transparent 30rem),
    radial-gradient(circle at 88% 60%, rgba(215, 255, 52, 0.11), transparent 32rem),
    var(--black);
  font-family: inherit;
  line-height: 1.5;
}

body.experience-active { padding-bottom: 126px; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: inherit; }

button,
.ending-links a {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  color: var(--black);
  background: var(--acid);
  border: 2px solid var(--acid);
  border-radius: 0;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

button:hover,
.ending-links a:hover {
  color: var(--black);
  background: var(--cyan);
  border-color: var(--cyan);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

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

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  color: var(--black);
  background: var(--acid);
  font-weight: 900;
}

.skip-link:focus { transform: translateY(0); }

.return-link {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 20;
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.threshold {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  isolation: isolate;
  padding: 90px 20px 70px;
  overflow: hidden;
  text-align: center;
}

.threshold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.38), var(--black) 98%);
}

.signal-ring {
  position: absolute;
  width: min(72vw, 680px);
  aspect-ratio: 1;
  z-index: -1;
  border: 2px solid rgba(215, 255, 52, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 90px rgba(178, 76, 255, 0.28), inset 0 0 90px rgba(178, 76, 255, 0.2);
}

.format,
.program {
  margin: 14px 0 0;
  color: var(--acid);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", Inter, sans-serif;
  line-height: 0.92;
  text-transform: uppercase;
}

h1 {
  margin-top: 10px;
  font-size: clamp(4.8rem, 15vw, 11rem);
  text-shadow: 5px 5px 0 var(--purple), -2px -2px 0 var(--acid);
}

.nugatron-title-logo {
  width: clamp(230px, 30vw, 380px);
  margin: 0;
  line-height: 1;
  text-shadow: none;
}

.nugatron-title-logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(178, 76, 255, 0.35));
}

.orientation {
  max-width: none;
  margin: 28px 0 0;
  font-size: clamp(0.68rem, 2.2vw, 1.7rem);
  white-space: nowrap;
  text-transform: uppercase;
}

.invitation {
  margin: 12px 0 28px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-style: italic;
  text-transform: uppercase;
}

.begin-button {
  width: min(100%, 620px);
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.58));
}

.begin-button img {
  width: 100%;
  height: auto;
}

.begin-button:hover {
  background: transparent;
  filter: drop-shadow(0 0 26px rgba(215, 255, 52, 0.4));
}

.consent-note {
  max-width: 600px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.reader {
  min-height: 100vh;
  padding: 62px clamp(12px, 4vw, 52px) 90px;
  background:
    linear-gradient(rgba(5, 5, 5, 0.86), rgba(5, 5, 5, 0.98)),
    repeating-linear-gradient(45deg, var(--purple) 0 2px, transparent 2px 20px);
}

.reader-heading {
  width: min(100%, 900px);
  margin: 0 auto 28px;
  text-align: center;
}

.reader-heading h2,
.ending h2 {
  color: var(--white);
  font-size: clamp(3.5rem, 9vw, 7rem);
  text-shadow: 4px 4px 0 var(--purple);
}

.reader-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.page-status {
  width: min(100%, 940px);
  margin: 0 auto 10px;
  color: var(--acid);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.comic-page {
  width: min(100%, 940px);
  margin: 0 auto;
}

.comic-expand {
  width: 100%;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.58);
}

.comic-expand:hover { background: transparent; }

.comic-expand img {
  width: 100%;
  max-height: calc(100svh - 190px);
  object-fit: contain;
  background: var(--black);
}

.page-controls {
  width: min(100%, 940px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px auto 0;
}

.ending {
  width: min(100%, 940px);
  margin: 54px auto 0;
  padding: clamp(28px, 6vw, 70px);
  text-align: center;
  background: linear-gradient(135deg, rgba(93, 38, 121, 0.72), rgba(215, 255, 52, 0.08));
  border: 1px solid var(--line);
}

.ending > p:not(.format) {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.ending-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.ending-links a { text-decoration: none; }

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 12px;
  color: var(--white);
  background: rgba(5, 5, 5, 0.97);
  border: 0;
}

.lightbox::backdrop { background: rgba(5, 5, 5, 0.96); }

.lightbox-frame {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.lightbox-close {
  grid-column: 1 / -1;
  justify-self: end;
}

.lightbox-image-viewport {
  grid-column: 2;
  width: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y pinch-zoom;
  background: var(--black);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-image-viewport.is-dragging { cursor: grabbing; }

.lightbox img {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  object-fit: contain;
  object-position: top center;
  transform-origin: top center;
  cursor: zoom-in;
}

.lightbox-nav {
  min-width: 112px;
}

.lightbox-nav::before {
  width: 14px;
  height: 14px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  content: "";
}

.lightbox-previous::before {
  transform: rotate(-135deg);
}

.lightbox-next::before {
  transform: rotate(45deg);
}

.lightbox-toolbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.lightbox-toolbar button {
  min-height: 40px;
  padding: 5px 14px;
  font-size: 0.72rem;
}

.lightbox-frame p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--acid);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 104px;
  padding: 14px clamp(14px, 3vw, 38px);
  color: var(--white);
  background: rgba(19, 5, 31, 0.97);
  border-top: 2px solid var(--acid);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.55);
}

.player audio { display: none; }

.player-copy { display: grid; }

.player-identity {
  color: var(--acid);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.player-copy strong { text-transform: uppercase; }

.player-controls {
  display: flex;
  gap: 8px;
}

.player-controls button {
  min-width: 88px;
  min-height: 44px;
  padding: 6px 12px;
  font-size: 0.78rem;
}

.player-progress {
  display: grid;
  gap: 5px;
  text-align: right;
}

.player-progress progress {
  width: 100%;
  height: 8px;
  accent-color: var(--acid);
}

.player-progress span {
  font-size: 0.78rem;
  font-weight: 900;
}

@media (max-width: 768px) {
  body.experience-active { padding-bottom: 150px; }

  .return-link {
    top: 14px;
    left: 14px;
  }

  .threshold { padding-inline: 14px; }

  .signal-ring { width: 88vw; }

  h1 { font-size: clamp(4rem, 22vw, 7rem); }

  .reader {
    padding: 50px 8px 70px;
  }

  .reader-heading,
  .page-status {
    padding-inline: 8px;
  }

  .comic-expand img { max-height: none; }

  .page-controls { gap: 8px; }

  .page-controls button { padding-inline: 8px; }

  .player {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    min-height: 136px;
    padding: 10px 12px;
  }

  .player-copy { min-width: 0; }

  .player-copy strong {
    overflow: hidden;
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-controls { grid-column: 2; grid-row: 1; }

  .player-controls button {
    min-width: 0;
    min-height: 42px;
    padding: 5px 9px;
    font-size: 0.68rem;
  }

  .player-progress {
    grid-column: 1 / -1;
    text-align: left;
  }

  .lightbox-frame {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .lightbox img { grid-column: 1 / -1; }

  .lightbox-image-viewport { grid-column: 1 / -1; }

  .lightbox-previous { grid-column: 1; }

  .lightbox-next { grid-column: 2; }

  .lightbox-toolbar { grid-row: 4; }

  .lightbox-frame p { grid-row: 5; }
}

@media (max-width: 430px) {
  body.experience-active { padding-bottom: 142px; }

  .program span { display: none; }

  .program {
    display: grid;
    gap: 2px;
  }

  .ending-links,
  .ending-links a { width: 100%; }

  .player { min-height: 132px; }

  .player-identity { font-size: 0.61rem; }

  .player-controls button {
    width: 42px;
    padding-inline: 4px;
    font-size: 0;
  }

  .player-controls button::after {
    content: attr(data-short-label);
    color: var(--black);
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
