/*
  PROPOSITION C - "Object Theater". Seven graphite rooms, one monumental
  real artifact per room, one action each, then stillness. Gauge rule:
  no arc sweeps to a value unless the fraction is real. Monospace is
  reserved exclusively for machine-produced artifacts. Letter-spacing 0.
*/
:root {
  --tx: #F4F4F0;
  --tx70: rgba(244,244,240,0.7);
  --tx40: rgba(244,244,240,0.4);
  --hair: rgba(244,244,240,0.16);
  --hair-strong: rgba(244,244,240,0.34);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-snap-type: y mandatory; }
@media (pointer: coarse) { html { scroll-snap-type: y proximity; } }
body {
  background: #0C0C0D;
  color: var(--tx);
  font-family: "Montserrat", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; }
a { color: inherit; }

/* parallax backdrop: exactly two layers, one rAF loop */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.backdrop .ringlayer {
  position: absolute;
  inset: -30%;
  will-change: transform;
}
.backdrop .ringlayer .frag {
  position: absolute;
  border: 1px solid rgba(244,244,240,0.05);
  border-radius: 50%;
  -webkit-mask-image: conic-gradient(#000 0 120deg, transparent 120deg 360deg);
  mask-image: conic-gradient(#000 0 120deg, transparent 120deg 360deg);
}
.backdrop .frag.g1 { width: 120vmax; height: 120vmax; left: -60vmax; top: -40vmax; }
.backdrop .frag.g2 { width: 80vmax; height: 80vmax; right: -45vmax; bottom: -40vmax; transform: rotate(140deg); }
.backdrop .dotlayer {
  position: absolute;
  inset: -30%;
  background-image: radial-gradient(circle, rgba(244,244,240,0.10) 1px, transparent 1.5px);
  background-size: 230px 210px;
  will-change: transform;
}

/* persistent download affordance (doctrine mitigation) */
.aff {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 20;
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--tx70);
  text-decoration: none;
  border: 1px solid var(--hair);
  padding: 8px 12px;
  background: rgba(12,12,13,0.7);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.aff:hover { color: var(--tx); border-color: var(--hair-strong); }

.folio {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--tx40);
  pointer-events: none;
}

/* ---------- rooms ------------------------------------------------------- */
.room {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  scroll-snap-align: start;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 70px 24px;
}
/* elevation arc */
#r1 { background: #0C0C0D; }
#r2 { background: #0E0E10; }
#r3 { background: #101012; }
#r4 { background: #121214; }
#r5 { background: #131316; }
#r6 { background: #111113; }
#r7 { background: #0C0C0D; }

.room .stage {
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: min(1180px, 100%);
}
.room.in .stage { opacity: 1; transform: none; }

.microlabel {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--tx40);
  margin-bottom: 22px;
}
.caption {
  margin-top: 26px;
  font-size: clamp(15px, 1.5vw, 19px);
  color: var(--tx70);
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}
.subcap { margin-top: 10px; font-size: 0.72rem; color: var(--tx40); }

/* r1 the mark */
.mark-obj {
  width: min(70vw, 760px);
  margin: 0 auto;
  perspective: 900px;
}
.mark-obj img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 80px rgba(244,244,240,0.06));
  transform: rotateY(8deg) scale(0.98);
  opacity: 0;
  transition: transform 1.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease;
}
.room.in .mark-obj img { transform: none; opacity: 1; }
.spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 45% at 50% 42%, rgba(244,244,240,0.05), transparent 70%);
  pointer-events: none;
}

/* r2 the numeral */
.numeral {
  position: relative;
  display: inline-block;
  font-size: clamp(180px, 52vh, 480px);
  font-weight: 500;
  line-height: 0.9;
}
.numeral .outline {
  position: absolute;
  left: 6px; top: 6px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244,244,240,0.3);
  opacity: 0;
  transition: opacity 0.8s ease;
}
.numeral .fill {
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease 0.5s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s;
}
.room.in .numeral .outline { opacity: 1; }
.room.in .numeral .fill { opacity: 1; transform: none; }
.numeral .ringbehind {
  position: absolute;
  width: 160%;
  height: 56%;
  left: -30%;
  top: 26%;
  border: 1px solid rgba(244,244,240,0.14);
  border-radius: 50%;
  transform: rotate(-9deg);
  pointer-events: none;
}

/* r3 the artifact filename */
.filename-obj {
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: clamp(34px, 6.6vw, 96px);
  line-height: 1.15;
  overflow-wrap: anywhere;
  min-height: 2.4em;
}
.filename-obj .dim { color: var(--tx70); }
.filename-obj .ext { color: var(--tx); }
.tcaret {
  display: inline-block;
  width: 0.52em;
  height: 1em;
  vertical-align: text-bottom;
  background: var(--tx);
}
.tcaret.blink { animation: caret 1s steps(2, jump-none) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* r4 the gate */
.gate-stage { position: relative; display: inline-block; padding: 9vmin 6vmin; perspective: 800px; }
.gate-token {
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: clamp(34px, 9.5vw, 130px);
  line-height: 1.05;
  min-height: 1.1em;
}
.gate-token .bad { color: var(--tx40); text-decoration: line-through; }
.lock {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(244,244,240,0.4);
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
.lock.top {
  -webkit-mask-image: conic-gradient(from -90deg, #000 0 150deg, transparent 150deg 360deg);
  mask-image: conic-gradient(from -90deg, #000 0 150deg, transparent 150deg 360deg);
  transform: rotateX(12deg) rotate(-14deg);
}
.lock.bot {
  -webkit-mask-image: conic-gradient(from 90deg, #000 0 150deg, transparent 150deg 360deg);
  mask-image: conic-gradient(from 90deg, #000 0 150deg, transparent 150deg 360deg);
  transform: rotateX(12deg) rotate(14deg);
}
.gate-stage.locked .lock.top,
.gate-stage.locked .lock.bot { transform: rotateX(12deg) rotate(0deg); border-color: rgba(244,244,240,0.7); }
.refusal {
  margin-top: 16px;
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 0.74rem;
  color: var(--tx70);
  min-height: 1.3em;
}
.simlabel {
  margin-top: 8px;
  font-size: 0.66rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--tx40);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

/* r5 the hash arc */
.hash-arc {
  position: relative;
  width: min(86vw, 980px);
  height: clamp(220px, 42vh, 420px);
  margin: 0 auto;
}
.hash-arc .pair {
  position: absolute;
  left: 50%;
  bottom: 0;
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: clamp(13px, 1.7vw, 22px);
  transform-origin: 50% 100%;
  opacity: 0;
}
.hash-arc .pair.lit { opacity: 1; }
.hash-grid { display: none; }

/* r6 the orbit */
.orbit-obj { position: relative; width: min(80vw, 760px); margin: 0 auto; }
.orbit-obj svg { width: 100%; height: auto; display: block; overflow: visible; }
.orbit-obj .lbl {
  position: absolute;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--tx70);
}
.orbit-obj .lbl.future { color: var(--tx40); }

/* r7 the period */
.period-obj { display: grid; justify-items: center; gap: 26px; }
.period-obj img {
  height: clamp(120px, 34vh, 300px);
  width: auto;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.room.in .period-obj img { opacity: 1; }
.period-obj img.blink { animation: period-blink 1.8s steps(2, jump-none) 1; }
@keyframes period-blink { 0% { opacity: 0.25; } 33% { opacity: 1; } 66% { opacity: 0.25; } 100% { opacity: 1; } }
.closing-lines { display: grid; gap: 4px; color: var(--tx70); font-size: 0.95rem; }
.spec-plate {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 0.74rem;
  color: var(--tx70);
  text-align: left;
}
.spec-plate span { padding: 8px 2px; border-top: 1px solid var(--hair); overflow-wrap: anywhere; }
.spec-plate span:first-child { border-top: 0; }
.cta-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; justify-content: center; }
.cta {
  background: var(--tx);
  color: #0C0C0D;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 26px;
  transition: transform 0.2s ease;
}
.cta:hover { transform: translateY(-2px); }
.cta.unavailable { opacity: 0.45; cursor: not-allowed; }
.cta-alt { font-size: 0.82rem; color: var(--tx70); text-decoration: none; border-bottom: 1px solid var(--hair-strong); }
.cta-alt:hover { color: var(--tx); border-bottom-color: var(--tx); }
.status-line {
  font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--tx40);
  min-height: 1.3em;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: none; }
  .room .stage { opacity: 1; transform: none; transition: none; }
  .mark-obj img { transform: none; opacity: 1; transition: none; }
  .numeral .outline, .numeral .fill { opacity: 1; transform: none; transition: none; }
  .tcaret, .tcaret.blink { animation: none; }
  .period-obj img { opacity: 1; }
  .lock { transition: none; }
}

@media (max-width: 920px) {
  .hash-arc { display: none; }
  .hash-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 14px;
    font-family: "Cascadia Mono", Consolas, ui-monospace, monospace;
    font-size: 0.92rem;
    max-width: 340px;
    margin: 0 auto;
  }
  .hash-grid .pair { opacity: 0; }
  .hash-grid .pair.lit { opacity: 1; }
  .gate-token { font-size: clamp(26px, 9vw, 48px); }
  .aff { right: 12px; bottom: 12px; }
}
