:root {
  --bg: #242220;
  --cream: #D8CBB2;
  --rust: #A65336;
  --mono: "Courier New", Courier, "Liberation Mono", monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--mono);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* faint paper grain so the charcoal isn't dead flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* viewfinder corner brackets */
.corner {
  position: fixed;
  width: 18px;
  height: 18px;
  border: 0 solid var(--cream);
  opacity: 0.7;
}
.tl { top: 22px; left: 22px; border-top-width: 1.5px; border-left-width: 1.5px; }
.tr { top: 22px; right: 22px; border-top-width: 1.5px; border-right-width: 1.5px; }
.bl { bottom: 22px; left: 22px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.br { bottom: 22px; right: 22px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 4rem);
  padding: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 6vw, 6rem);
  max-width: 1800px;
  margin: 0 auto;
}

.observer { width: 100%; opacity: 0; transition: opacity 1.6s ease; }
.observer svg { overflow: visible; touch-action: manipulation; display: block; width: 100%; height: auto; max-height: 86vh; }
.is-ready .observer { opacity: 1; }

/* svg styling (mirrors psyop-spiral.svg) */
.cream { stroke: var(--cream-live, var(--cream)); }
.rust { stroke: var(--rust-live, var(--rust)); }
.label { fill: var(--cream-live, var(--cream)); font: 22px Georgia, "Times New Roman", serif; dominant-baseline: middle; text-anchor: middle; }
.ray { stroke-width: 1.35; stroke-linecap: round; }
.spoke { stroke-width: 2.6; stroke-linecap: round; }
.curve { stroke-width: 3.8; stroke-linecap: round; stroke-linejoin: round; }
.point { fill: var(--cream-live, var(--cream)); }

/* readout */
.readout {
  font-size: clamp(0.8rem, 1.15vw, 1.1rem);
  letter-spacing: 0.14em;
  line-height: 1;
  padding-top: 2rem;
}
.readout .line { font: inherit; font-weight: 400; margin-bottom: 1.75em; min-height: 1em; white-space: nowrap; }
.readout h1.line { margin-bottom: 2em; }

.cursor {
  display: inline-block;
  width: 0.7em;
  height: 1.2em;
  background: var(--rust);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* spiral life: rust spokes pulse, symbols drift in */
#rust-spokes { animation: pulse 4.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.label text { opacity: 0; transition: opacity 1.2s ease; }
.is-ready .label text { opacity: 1; }
.label text:nth-child(1) { transition-delay: .6s; }
.label text:nth-child(2) { transition-delay: .8s; }
.label text:nth-child(3) { transition-delay: 1.0s; }
.label text:nth-child(4) { transition-delay: 1.2s; }
.label text:nth-child(5) { transition-delay: 1.4s; }
.label text:nth-child(6) { transition-delay: 1.6s; }
.label text:nth-child(7) { transition-delay: 1.8s; }
.label text:nth-child(8) { transition-delay: 2.0s; }
.label text:nth-child(9) { transition-delay: 2.2s; }
.label text:nth-child(10) { transition-delay: 2.4s; }

/* stack on narrow screens */
@media (max-width: 820px) {
  .stage {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 1rem;
    padding: 4rem 1.75rem 3rem;
  }
  .readout { font-size: 0.85rem; padding-top: 0; text-align: left; }
  .readout .line { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .observer, .label text { transition: none; }
  #rust-spokes, .cursor { animation: none; }
}
