:root {
  --fade: 1600ms;
  --ink: rgba(232, 228, 220, 0.92);
  --ink-dim: rgba(232, 228, 220, 0.42);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  color: var(--ink);
  font-family: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { cursor: default; }
body.immersed { cursor: none; }

#gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #000;
  touch-action: none;
}

/* Camera element: alive but never perceptible. */
#cam {
  position: fixed;
  left: -10px;
  top: -10px;
  width: 2px;
  height: 2px;
  opacity: 0.001;
  pointer-events: none;
  transform: scaleX(-1); /* mirror, only relevant internally */
  z-index: -1;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vw;
  background: radial-gradient(120% 120% at 50% 50%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.85) 100%);
  opacity: 1;
  transition: opacity var(--fade) ease;
  z-index: 10;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.intro-inner { max-width: 38rem; }

#line {
  font-size: clamp(1.5rem, 4.2vw, 2.75rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-wrap: balance;
  animation: breathe 7s ease-in-out infinite;
}

#begin {
  margin-top: 3.2rem;
  background: transparent;
  border: 1px solid var(--ink-dim);
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-indent: 0.42em;
  padding: 0.85em 2.2em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 600ms ease, border-color 600ms ease, color 600ms ease, letter-spacing 600ms ease;
}
#begin:hover, #begin:focus-visible {
  background: rgba(232, 228, 220, 0.06);
  border-color: var(--ink);
  letter-spacing: 0.5em;
  outline: none;
}

.fineprint {
  margin-top: 2.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Optional background-track control: quiet, low-contrast, in keeping with the stillness. */
.film-opt {
  margin-top: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.film-hint {
  max-width: min(86vw, 30rem);
  font-size: 0.82rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  text-wrap: balance;
}
.film-file-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 0.55em 1.2em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 400ms ease, border-color 400ms ease, background 400ms ease;
}
.film-file-btn:hover, .film-file-btn:focus-visible { color: var(--ink); outline: none; }
.film-status {
  min-height: 1.1em;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  max-width: min(82vw, 27rem);
}
/* Highlight the drop target while dragging an audio file over the intro. */
.film-opt.dragover .film-file-btn {
  color: var(--ink);
  border-color: var(--ink-dim);
  background: rgba(232, 228, 220, 0.10);
  text-decoration: none;
}

.status {
  position: fixed;
  left: 0; right: 0;
  bottom: 7vh;
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-indent: 0.34em;
  color: var(--ink-dim);
  opacity: 0;
  transition: opacity 900ms ease;
  pointer-events: none;
  z-index: 9;
}
.status.show { opacity: 1; }

@keyframes breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #line { animation: none; }
}
