/* Stationary artwork framing, shared by the early preview and WebGL surface. */
.dreamchord-page {
  margin: 0;
  background: #000;
  color: #d4d4d4;
  min-height: 100svh;
  height: 100dvh;
  overflow: hidden;
}
.dreamchord-field {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  background: #000;
  isolation: isolate;
  overflow: hidden;
}
.dreamchord-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0; /* Prepare against black; the score supplies the joint entrance. */
  pointer-events: none;
}
.dreamchord-threshold {
  position: absolute;
  inset-inline: 1.5rem;
  bottom: max(12vh, 5.5rem);
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
}
.dreamchord-status { margin: 0; font-size: 0.95rem; max-width: 32rem; }
.dreamchord-page[data-loading-visible] .dreamchord-threshold {
  inset: 0;
  place-content: center;
  pointer-events: none;
}
.dreamchord-page[data-loading-visible] .dreamchord-status {
  color: rgb(255 255 255 / 75%);
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
}
.dreamchord-action,
.dreamchord-leave {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: transparent;
  color: #c4c4c4;
  border: 0;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
}
.dreamchord-leave {
  position: fixed;
  left: max(1.25rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 2;
}
.dreamchord-action:hover, .dreamchord-leave:hover { color: #fff; }
.dreamchord-action:focus-visible, .dreamchord-leave:focus-visible {
  outline: 1px solid #ddd;
  outline-offset: 4px;
}
.dreamchord-leave {
  left: auto;
  right: max(40px, env(safe-area-inset-right));
  bottom: max(32px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  padding: 12px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.08em;
  color: #fff;
  opacity: calc(0.58 * var(--leave-entrance, 0));
  transition: opacity 200ms ease;
}
.dreamchord-leave:not([data-entrance-complete]) { transition: none; }
.dreamchord-leave:hover {
  color: #fff;
  opacity: var(--leave-entrance, 0);
}
.dreamchord-leave:focus-visible {
  color: #fff;
  opacity: 1;
  transition: none;
}
.dreamchord-leave::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #fff;
  border-radius: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 5s ease;
}
.dreamchord-leave[data-post-audio]::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .dreamchord-leave::after { transition: none; }
}
.dreamchord-page [hidden] { display: none; }
.dreamchord-noscript { position: absolute; bottom: 20%; }

/* Opt-in Milestone B instrumentation; absent without ?debug=conductor. */
.dreamchord-diagnostics {
  position: fixed;
  z-index: 3;
  top: 1rem;
  right: 1rem;
  max-width: min(25rem, calc(100vw - 2rem));
  max-height: calc(100svh - 7rem);
  overflow: auto;
  padding: 0.8rem;
  border: 1px solid #555;
  border-radius: 0.3rem;
  background: rgb(0 0 0 / 85%);
  color: #ddd;
  font: 12px/1.4 monospace;
}
.dreamchord-diagnostics pre { margin: 0.65rem 0; }
.dreamchord-diagnostics button, .dreamchord-diagnostics select {
  padding: 0.4rem;
  margin: 0.2rem;
  background: #222;
  color: #eee;
  border: 1px solid #777;
  font: inherit;
}
.dreamchord-diagnostics output { display: block; margin-top: 0.6rem; }

.dreamchord-canvas { position: absolute; inset: 0; pointer-events: none; }
.dreamchord-diagnostics label { display: block; margin-top: 0.4rem; }
.dreamchord-diagnostics input { max-width: 6rem; color: #eee; background: #222; border: 1px solid #777; }

/* One fresh-entry threshold: direct visit or observed activation restriction.
   Retry/continuation controls and the homepage invitation retain their styles. */
.dreamchord-page[data-activation-required] .dreamchord-threshold {
  inset: 0;
  place-content: center;
  pointer-events: none;
}
.dreamchord-page[data-activation-required] .dreamchord-action {
  box-sizing: border-box;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid #fff;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.08em;
  opacity: 0.76;
  transition: opacity 200ms ease;
  pointer-events: auto;
}
.dreamchord-page[data-activation-required] .dreamchord-action:hover,
.dreamchord-page[data-activation-required] .dreamchord-action:focus-visible {
  opacity: 1;
}

/* Only enabled after BEGIN for an idle fine pointer; controls reveal it. */
.dreamchord-page[data-cursor-hidden],
.dreamchord-page[data-cursor-hidden] * { cursor: none; }

/* Outside the centering flow: 22px below the 44px BEGIN button. */
.dreamchord-entry-guidance { display: none; }
.dreamchord-page[data-activation-required] .dreamchord-entry-guidance {
  display: block;
  position: absolute;
  top: calc(50% + 44px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: #fff;
  opacity: 0.58;
  font-family: "Atkinson Hyperlegible Next", sans-serif;
  font-style: italic;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
}
