/* God Bless The United States Of Aliens — visitor + preview shared styles */

:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --bg: #f9f6ef;
  --accent: #8a2c2c;
  --accent-soft: rgba(138, 44, 44, 0.08);
  --accent-rule: rgba(138, 44, 44, 0.55);
  --rule: #d8d2c4;
  --pulse: rgba(180, 140, 90, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e4d9;
    --muted: #9a948a;
    --bg: #181816;
    --accent: #d47575;
    --accent-soft: rgba(212, 117, 117, 0.08);
    --accent-rule: rgba(212, 117, 117, 0.55);
    --rule: #2a2927;
    --pulse: rgba(212, 168, 105, 0.55);
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
}
body {
  font-family: Georgia, "Fraunces", "Playfair Display", serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Suppress the iOS Safari blue flash on tap. The Begin / End / link
     interactions get their own focus-visible rings instead. */
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Visitor player layout ---------- */

body.visitor {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr;
}

.stage {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  min-height: 100svh;
}
.stage[hidden] { display: none; }

/* Landing */

#stage-landing h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  margin: 0 0 0.5rem;
  max-width: 22ch;
  line-height: 1.15;
}
#stage-landing .subtitle {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 2.4rem;
  max-width: 30ch;
}
#stage-landing .prep {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 32ch;
  margin: 0 auto 2.6rem;
}
#stage-landing .prep strong { color: var(--fg); }

button.begin {
  font: inherit;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 2.4rem;
  border: 1px solid var(--accent-rule);
  background: var(--accent-soft);
  color: var(--fg);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
}
button.begin:hover { background: rgba(138, 44, 44, 0.14); }
button.begin:active { transform: translateY(1px); }
button.begin:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.begin:disabled {
  opacity: 0.5;
  cursor: progress;
  background: transparent;
}
button.begin:disabled:hover { background: transparent; }

#stage-landing .credit {
  margin-top: 4rem;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 36ch;
  letter-spacing: 0.02em;
}

/* Biennale status / countdown — privacy-clean, client-side only.
   Set in countdown.js once at page load. The static text inside the
   element is the fallback if the script fails to load. */
.biennale-status {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--accent);
  max-width: 36ch;
  letter-spacing: 0.04em;
  font-style: italic;
  opacity: 0.9;
}
body.submission .biennale-status {
  margin: -1rem 0 2.4rem;
  max-width: none;
}

/* Playing */

#stage-playing {
  background: #0a0908;
  color: #e8e4d9;
  position: relative;
}
@media (prefers-color-scheme: dark) {
  #stage-playing { background: #0a0908; }
}

.pulse {
  width: clamp(160px, 38vmin, 280px);
  height: clamp(160px, 38vmin, 280px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--pulse) 0%, transparent 65%);
  animation: breathe 5.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.55; }
  50%      { transform: scale(1.08); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; opacity: 0.7; }
}

#stage-playing .listening {
  margin-top: 3rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: rgba(232, 228, 217, 0.7);
  text-transform: uppercase;
}

/* End button: persistently visible on every device, including touch
   (where there is no hover). Resting contrast is high enough to read
   over the dark playing-stage background; hover/focus deepens it. */
#stage-playing .escape {
  position: fixed;
  top: 1rem;
  right: 1rem;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(232, 228, 217, 0.6);
  background: rgba(232, 228, 217, 0.04);
  color: rgba(232, 228, 217, 0.85);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
#stage-playing .escape:hover,
#stage-playing .escape:focus-visible {
  background: rgba(232, 228, 217, 0.12);
  border-color: rgba(232, 228, 217, 0.85);
  color: #fff;
}
#stage-playing .escape:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
#stage-playing .escape:active { transform: translateY(1px); }

/* Ended */

#stage-ended h2 {
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 500;
  font-style: italic;
  margin: 0 0 2rem;
  color: var(--muted);
}
#stage-ended .links {
  list-style: none;
  padding: 0;
  margin: 0 auto 3rem;
  max-width: 30ch;
  display: grid;
  gap: 0.85rem;
  font-size: 0.95rem;
}
#stage-ended .links a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
#stage-ended .links a:hover,
#stage-ended .links a:focus-visible {
  text-decoration-color: var(--accent);
  color: var(--accent);
}
/* External-link affordance: a small ↗ after links that open in a new tab,
   so visitors can see at a glance which links leave the performance and
   which (preview.html) stay within the site. */
#stage-ended .links a[target="_blank"]::after {
  content: " ↗";
  color: var(--muted);
  font-size: 0.85em;
  margin-left: 0.1em;
  text-decoration: none;
}
#stage-ended .credit {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 42ch;
  margin: 0 auto;
  letter-spacing: 0.02em;
}
#stage-ended .credit + .credit {
  margin-top: 0.9rem;
}
#stage-ended .qr {
  margin-top: 2rem;
  width: 110px;
  height: 110px;
  opacity: 0.65;
}

/* ---------- Submission page (the dedicated jury introduction) ---------- */

body.submission {
  padding: 3rem 1.5rem 5rem;
  max-width: 44rem;
  margin: 0 auto;
}
body.submission h1 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 600;
  margin: 0 0 0.3rem;
  line-height: 1.2;
}
body.submission .subtitle {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 2.4rem;
}
body.submission .intro-video {
  margin: 0 0 3rem;
}
body.submission .intro-video video {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #000;
  aspect-ratio: 16 / 9;
}
body.submission .intro-video figcaption {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}
body.submission section {
  border-top: 1px solid var(--rule);
  padding-top: 1.8rem;
  margin-top: 2.4rem;
}
body.submission h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
}
body.submission p,
body.submission li {
  font-size: 0.98rem;
}
body.submission dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.2rem;
  margin: 0;
  font-size: 0.92rem;
}
body.submission dt {
  font-weight: 600;
  color: var(--muted);
}
body.submission dd {
  margin: 0;
}
body.submission a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-rule);
  text-underline-offset: 3px;
}
body.submission a:hover,
body.submission a:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
body.submission footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--muted);
}
body.submission .imprint h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.6rem 0 0.4rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
body.submission .imprint .licence-grid {
  grid-template-columns: 1fr;
  gap: 0.8rem 0;
  margin: 0.6rem 0 1rem;
}
body.submission .imprint .licence-grid dt {
  color: var(--fg);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
body.submission .imprint ul.attribution {
  margin: 0.4rem 0 0;
  padding-left: 1.2em;
  list-style: square;
}
body.submission .imprint ul.attribution li {
  margin-bottom: 0.4rem;
}

/* "100% open-source" line on the visitor end-state — smaller than the
   main credit so it reads as a footer note rather than competing copy. */
#stage-ended .credit.licence {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  max-width: 44ch;
  margin-top: 1.4rem;
}
#stage-ended .credit.licence a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-rule);
  text-underline-offset: 3px;
}

/* ---------- Preview page (the dev/jury per-scene listing) ---------- */

body.preview {
  padding: 3rem 1.5rem 5rem;
  max-width: 42rem;
  margin: 0 auto;
}
body.preview h1 {
  font-size: 1.9rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  line-height: 1.2;
}
body.preview .subtitle {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 2rem;
}
body.preview section {
  border-top: 1px solid var(--rule);
  padding-top: 1.8rem;
  margin-top: 2.4rem;
}
body.preview section.master {
  border: 1px solid var(--accent);
  padding: 1.5rem;
  margin-top: 3rem;
  background: var(--accent-soft);
}
body.preview h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
}
body.preview p.note {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.8rem;
}
body.preview audio {
  width: 100%;
  margin-top: 0.5rem;
}
body.preview .scene-meta {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.2rem;
}
body.preview .missing {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--rule);
  border-radius: 2px;
  margin-top: 0.4rem;
}
body.preview .warning {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  margin-top: 1.6rem;
}
body.preview footer {
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}
body.preview footer a { color: inherit; }
