/* Herz der Tardis – shared styles */

:root {
  --space: #050b18;
  --space-2: #0b1a33;
  --tardis: #1d4f9c;
  --tardis-light: #3a78d8;
  --glow: #7cc8ff;
  --ink: #e9f0fb;
  --muted: #a7b9d6;
  --panel: rgba(9, 19, 40, 0.82);
  --panel-border: rgba(124, 200, 255, 0.22);
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  line-height: 1.7;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(58, 120, 216, 0.25), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(124, 200, 255, 0.08), transparent 70%),
    var(--space);
  background-attachment: fixed;
}

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

a {
  color: var(--glow);
}

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

/* ---------- Hero: scene image with title ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(260px, 56vh, 620px);
  padding: 1.25rem 1rem 5.5rem;
  overflow: hidden;
  isolation: isolate;
}

.hero__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, center);
  /* the source images are bleached for black text – bring the colour back */
  filter: saturate(1.4) contrast(1.35) brightness(0.82);
  transform: scale(1.04);
  animation: materialise 1.6s ease-out both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(5, 11, 24, 0.55) 0%, rgba(5, 11, 24, 0) 30%),
    linear-gradient(to top, var(--space) 0%, rgba(5, 11, 24, 0.75) 35%, rgba(5, 11, 24, 0) 75%);
}

.hero__inner {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(5, 11, 24, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--glow);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 1.3rem + 3.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

.logo {
  width: min(260px, 60vw);
  margin-bottom: 1rem;
  filter: invert(1) drop-shadow(0 0 18px rgba(124, 200, 255, 0.55));
  mix-blend-mode: screen;
}

/* ---------- Progress through the stations ---------- */

.stations {
  display: flex;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.stations li {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(167, 185, 214, 0.35);
}

.stations li.done {
  background: var(--tardis-light);
}

.stations li.current {
  background: var(--glow);
  box-shadow: 0 0 10px var(--glow);
}

/* ---------- Story panel ---------- */

.log {
  position: relative;
  width: calc(100% - 2rem);
  max-width: 46rem;
  margin: -4rem auto 3rem;
  padding: clamp(1.25rem, 1rem + 2vw, 2.5rem);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.log > :first-child {
  margin-top: 0;
}

.log p {
  margin: 0 0 1.1em;
}

.log .lead {
  font-family: var(--serif);
  font-size: 1.2em;
  line-height: 1.55;
}

.quote {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--glow);
  border-radius: 0 10px 10px 0;
  background: rgba(124, 200, 255, 0.07);
  font-family: var(--serif);
  font-style: italic;
}

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

/* ---------- Clues, media ---------- */

.clue {
  margin: 2rem auto;
  text-align: center;
}

.clue a {
  display: inline-block;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.clue a:hover {
  transform: scale(1.03) rotate(-0.6deg);
}

.clue img {
  margin: 0 auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
}

.clue figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.clue--small img {
  width: min(220px, 60vw);
}

.clue--medium img {
  width: min(320px, 80vw);
}

.clue--large img {
  width: min(500px, 100%);
}

.player {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(5, 11, 24, 0.55);
}

.player img {
  width: min(160px, 45vw);
}

.player audio {
  flex: 1 1 240px;
  width: 100%;
  max-width: 360px;
}

/* ---------- "Weiter" button ---------- */

.travel {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 3.5rem;
  padding: 0.7rem 1.6rem 0.7rem 1.1rem;
  border: 1px solid rgba(124, 200, 255, 0.5);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--tardis-light), var(--tardis));
  box-shadow:
    0 0 0 0 rgba(124, 200, 255, 0.5),
    0 10px 30px -8px rgba(58, 120, 216, 0.8);
  color: #fff;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.15s ease, box-shadow 0.3s ease;
  animation: pulse 2.8s ease-in-out infinite;
}

.next img {
  width: 1.6rem;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

.next:hover {
  transform: translateY(-2px);
}

.next:active {
  transform: translateY(1px);
}

@media (max-width: 480px) {
  .next {
    width: 100%;
  }
}

.finale {
  margin: 2.5rem 0 0;
  color: var(--glow);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

button.next {
  cursor: pointer;
}

/* ---------- Start screen ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem 1rem;
  background:
    radial-gradient(ellipse 60% 45% at 50% 40%, rgba(58, 120, 216, 0.35), transparent 70%),
    var(--space);
  text-align: center;
  transition: opacity 0.7s ease, visibility 0.7s;
}

.gate.is-open {
  opacity: 0;
  visibility: hidden;
}

html:has(.gate:not(.is-open)) {
  overflow: hidden;
}

.gate img {
  width: auto;
  height: min(42vh, 340px);
  filter: drop-shadow(0 0 30px rgba(124, 200, 255, 0.55));
  animation: drift 5s ease-in-out infinite;
}

.gate__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 1.3rem + 3.6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
}

.gate__hint {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ---------- Fullscreen clue viewer (Brief, Botschaft) ---------- */

.viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background: #000;
}

.viewer img {
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 6rem);
  object-fit: contain;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
}

.back:hover {
  color: var(--ink);
  border-color: var(--glow);
}

/* ---------- Terminal (Tokio 2087) ---------- */

.terminal {
  --green: #43ff26;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  background: #000;
  color: var(--green);
  font-family: var(--mono);
}

.terminal::after {
  /* scanlines */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0 1px, transparent 1px 3px);
}

.screen {
  max-width: 54ch;
  margin: 0;
  font-size: clamp(1rem, 0.7rem + 1.6vw, 1.75rem);
  line-height: 1.6;
  text-align: center;
  text-shadow: 0 0 8px rgba(67, 255, 38, 0.6);
  word-spacing: 0.15em;
}

.cursor::after {
  content: "▋";
  margin-left: 0.2em;
  animation: blink 1s steps(1) infinite;
}

.terminal .back {
  border-color: rgba(67, 255, 38, 0.35);
  color: var(--green);
}

/* ---------- Motion ---------- */

@keyframes materialise {
  0% { opacity: 0; transform: scale(1.12); filter: saturate(0) contrast(1.35) brightness(1.4) blur(6px); }
  40% { opacity: 0.6; }
  60% { opacity: 0.3; }
  100% { opacity: 1; transform: scale(1.04); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 200, 255, 0.45), 0 10px 30px -8px rgba(58, 120, 216, 0.8); }
  50% { box-shadow: 0 0 0 10px rgba(124, 200, 255, 0), 0 10px 30px -8px rgba(58, 120, 216, 0.8); }
}

@keyframes drift {
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
