/* Decoherence Studio — Meridian film only (v20) */
:root {
  --night: #0B1016;
  --paper: #EDE8DF;
  --paper-muted: #A39E94;
  --bronze: #B8A58A;
  --hair: rgba(237, 232, 223, 0.22);
  --font-sans: "Source Sans 3", system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--night);
  color: var(--paper);
  font-family: var(--font-sans);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.stage {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--night);
}

.film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  background: var(--night);
  display: block;
}

.film[hidden], .play[hidden] { display: none; }

/* Portrait / narrow screens: a centred band showing the middle ~62% of the
   frame, so the brain (and the title card) stay whole and readable, with the
   band edges feathered into the page colour */
@media (max-aspect-ratio: 1/1) {
  .film {
    top: 50%;
    bottom: auto;
    height: min(100%, calc(100vw * 0.5625 * 1.6));
    transform: translateY(-50%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  }
}

.sound, .play {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--hair);
  background: rgba(7, 9, 13, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.sound {
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(2.6rem + env(safe-area-inset-bottom));
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sound[aria-pressed="true"] { border-color: var(--bronze); color: var(--bronze); }

.play {
  left: 50%;
  top: 76%;
  width: 4.25rem;
  height: 4.25rem;
  margin: -2.125rem 0 0 -2.125rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.sound:hover, .play:hover { border-color: var(--bronze); color: var(--bronze); }

.sound:focus-visible, .play:focus-visible, .footer a:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.6rem max(1rem, env(safe-area-inset-right)) calc(0.7rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  text-align: center;
  pointer-events: none;
}

.footer p {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--paper-muted);
  opacity: 0.75;
}

.footer a {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.footer a:hover { color: var(--bronze); }

@media (max-width: 480px) {
  .footer p { font-size: 0.66rem; letter-spacing: 0.03em; line-height: 1.5; }
  .sound { bottom: calc(3.4rem + env(safe-area-inset-bottom)); }
}
