/* oldlight.css — the overlay chrome over a full-screen canvas.
 *
 * Everything visual is the canvas; this file styles only the few DOM text
 * layers (the cold-open line, the drive title, the begin hint, the one drop
 * line) plus reduced-motion rules.
 *
 * No font files (CSP + convention): system UI stack for the lines, system
 * monospace for the cold-open line. NO DASHES in copy.
 */

:root {
  --text: #e8e6f0;
  --dim: #8a86a3;
  --cyan: #29ffe3;
  --sky: #05040f;
  --ui-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ui-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #030208;
  color: var(--text);
  overflow: hidden;
}

.ol-body {
  position: fixed;
  inset: 0;
  font-family: var(--ui-sans);
  /* the whole surface is one begin gesture then a self-driving scene: no
     scroll, no pinch, no long-press callout. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
}

#sky {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ---------- shared line behavior (opacity + a few px rise) ----------
   duration is set per show/hide in JS; easing lives here so tweens feel
   authored, not linear. GPU-composited (opacity + transform only). */
.ol-cold, .ol-title, .ol-prompt, .ol-big {
  position: fixed;
  z-index: 3;
  opacity: 0;
  transform: translateY(8px);
  transition-property: opacity, transform;
  transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-duration: 1.4s;
  pointer-events: none;
  will-change: opacity, transform;
}
.ol-cold.show, .ol-title.show, .ol-prompt.show, .ol-big.show {
  opacity: 1;
  transform: translateY(0);
}

/* the cold-open line: centered monospace, slow */
.ol-cold {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(8px);
  max-width: 90vw;
  text-align: center;
  font-family: var(--ui-mono);
  font-size: clamp(13px, 3.4vw, 22px);
  letter-spacing: 0.03em;
  line-height: 1.6;
  color: #d9d5e8;
  /* pre-wrap keeps the typed spaces intact but lets the line wrap on a narrow
     phone instead of overflowing (the drive title/credit fit small widths too). */
  white-space: pre-wrap;
  /* reserve two line-heights up front so the vertically-centered box has a FIXED
     height: when the 45-char line crosses from one line to two mid-type on a
     narrow phone, the centered box (and the first line in it) never jumps. the
     second line simply grows down into the space already held below. */
  min-height: calc(2 * 1.6em);
}
.ol-cold.show { transform: translate(-50%, -50%) translateY(0); }
.ol-cold.typing::after {
  content: "\258B";           /* a slim block caret while typing */
  margin-left: 2px;
  color: var(--cyan);
  opacity: 0.85;
  animation: ol-blink 1s steps(1) infinite;
}
@keyframes ol-blink { 50% { opacity: 0; } }

/* the drive title / track credit reveal, small and low */
.ol-title {
  left: 50%;
  bottom: calc(20% + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  max-width: 90vw;
  text-align: center;
  font-size: clamp(13px, 3.4vw, 17px);
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--dim);
  font-weight: 400;
}
.ol-title.show { transform: translateX(-50%) translateY(0); }

/* the one begin hint, bottom center, dim */
.ol-prompt {
  left: 50%;
  bottom: calc(8% + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  max-width: 90vw;
  text-align: center;
  font-size: clamp(12px, 3.2vw, 15px);
  letter-spacing: 0.18em;
  color: var(--dim);
}
.ol-prompt.show { transform: translateX(-50%) translateY(0); }

/* the one line at the drop, screen center, larger */
.ol-big {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(10px);
  width: min(88vw, 820px);
  text-align: center;
  font-size: clamp(19px, 3vw, 30px);
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--text);
  font-weight: 300;
}
.ol-big.show { transform: translate(-50%, -50%) translateY(0); }

/* ---------- the persistent now-playing credit (bottom corner) ----------
   a credit, not a player UI: very low opacity, small, no controls, no motion
   (opacity-only crossfade on track change). safe-area inset so a notch/home bar
   never clips it. kept on under reduced motion, just static. must never fight
   the visuals, so opacity stays low and a soft shadow keeps it legible over the
   bright warp without raising it. */
.ol-credit {
  position: fixed;
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  max-width: min(70vw, 340px);
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
  text-align: left;
  font-size: clamp(10px, 2.8vw, 12px);
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--dim);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  will-change: opacity;
}
.ol-credit.show { opacity: 0.32; }

/* screen-reader-only soft notes */
.ol-sr {
  position: fixed;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.ol-noscript {
  position: fixed;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vw;
  text-align: center;
  font-size: clamp(15px, 2.2vw, 20px);
  line-height: 1.7;
  color: var(--dim);
  background: #05040f;
  z-index: 9;
}

/* ---------- reduced motion: calm, but intact ----------
   the fast warp and the flash are tamed in JS; here we drop the rise on the
   lines and kill the caret blink so nothing shimmers. */
@media (prefers-reduced-motion: reduce) {
  .ol-cold, .ol-title, .ol-prompt, .ol-big {
    transition-timing-function: ease;
    transform: none;
  }
  .ol-cold.show, .ol-title.show, .ol-prompt.show, .ol-big.show { transform: none; }
  .ol-cold { transform: translate(-50%, -50%); }
  .ol-cold.show { transform: translate(-50%, -50%); }
  .ol-big { transform: translate(-50%, -50%); }
  .ol-big.show { transform: translate(-50%, -50%); }
  .ol-title, .ol-prompt { transform: translateX(-50%); }
  .ol-title.show, .ol-prompt.show { transform: translateX(-50%); }
  .ol-cold.typing::after { animation: none; }
}
