/* CLIPZYN v7. THE TRANSMISSION.
   The photograph is the room; the CRT glass is live markup; the screen is the
   landing itself. Everything inside the glass speaks in old terminal type.
   Motion: scroll-scrubbed off the damped value, cursor-caused, or one-time
   load choreography. The block cursor blink is the one ambient voice, it is
   the carrier light of the terminal. Reduced motion renders complete, static. */

:root {
  --bg: #050708;
  --ph: #4FB8FF;                          /* phosphor */
  --ph-bright: #A8DBFF;
  --ph-dim: rgba(79, 184, 255, 0.58);
  --ph-faint: rgba(79, 184, 255, 0.30);
  --ph-trace: rgba(79, 184, 255, 0.12);
  --ink: #F2F7FA;
  --ink-dim: rgba(242, 247, 250, 0.78);
  --glow: 0 0 6px rgba(79, 184, 255, 0.5), 0 0 22px rgba(79, 184, 255, 0.18);
  --glow-soft: 0 0 5px rgba(79, 184, 255, 0.35);
  --mono: "VT323", "JetBrains Mono", monospace;
  --fine: "JetBrains Mono", monospace;
  --col: 860px;
  /* glass geometry, fractions of the photograph */
  --gx: 0.487; --gy: 0.526; --gw: 0.387; --gh: 0.180;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ph);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }
::selection { background: var(--ph); color: #041018; }
a { color: inherit; }

/* ============ ACT I: the room ============ */

.zoom-track { position: relative; height: 200vh; }
.rig { position: sticky; top: 0; height: 100vh; overflow: hidden; background: #0A0805; }

.world {
  position: absolute;
  will-change: transform;
  transform-origin: 0 0;
}
.photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: fill;
  display: block;
  user-select: none; -webkit-user-select: none;
  filter: brightness(calc(1 - var(--tvfade, 0) * 0.75)) blur(calc(var(--tvfade, 0) * 6px));
}
.room-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 46%, transparent 40%, rgba(0,0,0,0.55) 100%);
  opacity: calc(1 - var(--tvz, 0));
}

/* the live glass, positioned over the photograph's screen */
.crt-mini {
  position: absolute;
  cursor: pointer;
  left: calc((var(--gx) - var(--gw) / 2) * 100%);
  top: calc((var(--gy) - var(--gh) / 2) * 100%);
  width: calc(var(--gw) * 100%);
  height: calc(var(--gh) * 100%);
  border-radius: 7% / 16%;
  overflow: hidden;
  container-type: size;
}
.mini-on {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 80% at 50% 42%, rgba(79,184,255,0.10), transparent 70%),
    radial-gradient(ellipse 140% 120% at 50% 50%, #0A1219 0%, #060A0E 62%, #030507 100%);
  opacity: 0;
}
.pwr .mini-on { opacity: 1; transition: opacity 0.5s ease; }

.mini-body {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6cqh 7cqw 8cqh;
  text-align: center;
  opacity: calc(1 - var(--tvhide, 0));
}
.m-logo {
  height: 30cqh; width: auto; margin-top: 2cqh;
  color: var(--ph); overflow: visible;
  filter: drop-shadow(0 0 5px rgba(79, 184, 255, 0.45));
}
.m-spacer { flex: 1; }
.m-line { margin: 0; text-shadow: var(--glow-soft); }
.m-id { font-size: 4.2cqh; letter-spacing: 0.08em; white-space: nowrap; color: var(--ph-faint); margin-top: 3cqh; }
.m-phrase {
  font-size: 9.6cqh; line-height: 1.22; letter-spacing: 0.02em;
  color: var(--ph-bright); text-shadow: var(--glow);
  margin-top: 4.5cqh;
}
.m-play {
  font-family: var(--mono); font-size: 7.2cqh; letter-spacing: 0.05em;
  color: var(--ph); background: transparent;
  border: 0.6cqh solid var(--ph-faint); border-radius: 1.5cqh;
  padding: 1.6cqh 4cqw; cursor: pointer;
  text-shadow: var(--glow-soft);
  animation: playBreathe 9s ease-in-out infinite;
}
.m-play:hover, .m-play:focus-visible {
  background: var(--ph); color: #041018; text-shadow: none;
  box-shadow: 0 0 30px rgba(79,184,255,0.45);
  animation-play-state: paused; outline: none;
}
@keyframes playBreathe {
  0%, 100% { box-shadow: 0 0 12px rgba(79,184,255,0.10); }
  50% { box-shadow: 0 0 26px rgba(79,184,255,0.30); }
}

.mini-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0.22) 0, rgba(0,0,0,0.22) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse 70% 45% at 38% 20%, rgba(210,235,255,0.07), transparent 60%);
  border-radius: inherit;
  box-shadow: inset 0 0 6cqh rgba(0, 0, 0, 0.85);
}

/* ============ the fixed CRT frame, on once inside ============ */

.crt-frame {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  opacity: var(--frame, 0);
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0.20) 0, rgba(0,0,0,0.20) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse 130% 110% at 50% 50%, transparent 58%, rgba(0,0,0,0.44) 88%, rgba(0,0,0,0.8) 100%);
}
.crt-frame::before {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.85), inset 0 0 34px rgba(79, 184, 255, 0.05);
  border-radius: 18px;
}
.crt-frame::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 65% 40% at 34% 12%, rgba(210, 235, 255, 0.035), transparent 60%);
}

/* ============ the terminal bar ============ */

.term-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px 10px;
  font-size: clamp(18px, 2.2vw, 22px); letter-spacing: 0.1em;
  color: var(--ph-dim);
  opacity: var(--frame, 0);
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(5, 7, 8, 0.96) 45%, rgba(5, 7, 8, 0.75) 72%, transparent);
}
.term-bar > * { pointer-events: auto; }
.tb-brand { text-decoration: none; color: var(--ph); text-shadow: var(--glow-soft); }
.tb-ch { margin: 0; color: var(--ph-faint); }
.tb-sep { opacity: 0.5; }
.tb-nav { display: flex; gap: 20px; }
.tb-nav a { text-decoration: none; color: var(--ph-faint); }
.tb-nav a.on { color: var(--ph-bright); text-shadow: var(--glow-soft); }
.tb-nav a:hover { color: #041018; background: var(--ph); text-shadow: none; }

/* ============ ACT II: the terminal ============ */

/* the archive, faint on the walls; the mask keeps the text column clean
   structurally, so no opacity tuning can ever put it behind the copy */
.term-cassettes {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: url("media/term-cassettes.jpg") center top / cover no-repeat;
  opacity: calc(var(--frame, 0) * 0.07);
  -webkit-mask-image: radial-gradient(ellipse 55% 60% at 50% 50%, transparent 0 38%, #000 78%);
  mask-image: radial-gradient(ellipse 55% 60% at 50% 50%, transparent 0 38%, #000 78%);
}

.term {
  position: relative; z-index: 10;
  background: transparent;
  /* the claim shares scroll territory with the flight's final stretch:
     it materializes inside the glass and the reader lands already reading */
  margin-top: -100vh;
}
.t-sec { padding: 14vh 26px; }
.t-claim {
  padding-top: 16vh;
  pointer-events: none;
  opacity: var(--arrive, 0);
}
.t-foot { padding-bottom: 18vh; }
.col { max-width: var(--col); margin: 0 auto; text-align: center; }

.t-line {
  margin: 0 0 0.55em;
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.35; letter-spacing: 0.03em;
  text-shadow: var(--glow-soft);
  overflow-wrap: break-word;
}
.dim { color: var(--ph-dim); }
.bright { color: var(--ph-bright); text-shadow: var(--glow); }
/* the brand word, always in phosphor, wherever it is said */
.zyn { color: var(--ph); text-shadow: var(--glow-soft); }
.err { color: #FF9C6B; min-height: 1.4em; }

.t-kicker {
  margin: 0 0 7vh; font-size: clamp(17px, 2vw, 21px);
  letter-spacing: 0.12em; color: var(--ph-faint);
  white-space: nowrap; overflow: hidden;
  text-overflow: clip;
}
.t-h2 {
  margin: 0 0 0.6em; font-weight: 400;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.14; letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(79, 184, 255, 0.22);
}
.t-h2.bright { color: var(--ph-bright); text-shadow: var(--glow); }
.t-big {
  margin: 4vh 0 0.4em; font-weight: 400;
  font-size: clamp(32px, 4.8vw, 56px);
  line-height: 1.18; letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(79, 184, 255, 0.22);
}
.t-sub { margin-top: 3vh; }

/* the message voice: white, sentence case, set for reading */
.read {
  font-family: var(--fine);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.65; letter-spacing: 0;
  color: var(--ink-dim);
  text-shadow: none;
  max-width: 34em;
  margin: 0 auto 0.7em;
}

/* the logo, drawn in phosphor as you arrive */
.logo-stage { width: clamp(120px, 16vw, 190px); margin: 0 auto; }
.logo-big { display: block; width: 100%; height: auto; overflow: visible; }
.logo-big g { filter: drop-shadow(0 0 5px rgba(79, 184, 255, 0.45)); }
.sa { stroke-dasharray: none; }

/* records */
.rec { margin-top: 8vh; }
.rec-n {
  margin: 0 0 0.6em;
  font-size: clamp(16px, 1.9vw, 20px);
  letter-spacing: 0.22em; color: var(--ph);
  text-shadow: var(--glow-soft);
}
.rec-h {
  margin: 0 0 0.4em;
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-shadow: 0 0 14px rgba(79, 184, 255, 0.22);
}
.rec:hover .rec-n { color: var(--ph-bright); text-shadow: var(--glow); }

/* the film: the one moving image on the page */
.film-frame {
  position: relative;
  margin: 5vh auto;
  max-width: 880px;
  border: 2px solid var(--ph-trace);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(79, 184, 255, 0.08), inset 0 0 30px rgba(0, 0, 0, 0.6);
}
.film-frame video { display: block; width: 100%; height: auto; }
.film-play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: clamp(22px, 2.6vw, 30px); letter-spacing: 0.05em;
  color: var(--ph); background: rgba(5, 7, 8, 0.7);
  border: 2px solid var(--ph-faint); border-radius: 8px;
  padding: 10px 22px; cursor: pointer;
  text-shadow: var(--glow-soft);
}
.film-play:hover { background: var(--ph); color: #041018; text-shadow: none; }

/* access form as a command line */
.t-form {
  display: flex; align-items: baseline; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-top: 6vh;
  font-size: clamp(20px, 2.6vw, 27px);
}
.t-form input { text-align: left; }
.t-prompt { letter-spacing: 0.03em; text-shadow: var(--glow-soft); }
.t-form input {
  flex: 1; min-width: 240px;
  font-family: var(--mono); font-size: inherit; letter-spacing: 0.03em;
  color: var(--ph-bright); background: transparent;
  border: none; border-bottom: 2px solid var(--ph-faint);
  padding: 2px 4px; outline: none;
  text-shadow: var(--glow-soft);
  caret-color: var(--ph);
  text-transform: uppercase;
}
.t-form input::placeholder { color: var(--ph-trace); }
.t-form input:focus { border-bottom-color: var(--ph); }
.t-form button {
  font-family: var(--mono); font-size: inherit; letter-spacing: 0.05em;
  color: var(--ph); background: transparent; border: none; cursor: pointer;
  text-shadow: var(--glow-soft); padding: 2px 6px;
}
.t-form button:hover, .t-form button:focus-visible { background: var(--ph); color: #041018; text-shadow: none; outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.t-receipt { display: none; margin-top: 6vh; }
.t-receipt.show { display: block; }

/* footer */
.t-foot .giant {
  margin: 2vh 0 7vh;
  font-size: clamp(90px, 17vw, 250px);
  line-height: 0.9; letter-spacing: 0.01em;
  color: var(--ph); text-shadow: var(--glow), 0 0 80px rgba(79, 184, 255, 0.25);
  user-select: none;
}
.eot { letter-spacing: 0.18em; }

/* ============ typing machinery ============ */

/* hidden characters keep their space: the layout never reflows while typing,
   so every measured position stays true */
[data-type] .tc { visibility: hidden; }
[data-type] .tc.on { visibility: visible; }
[data-type].done .tc { visibility: visible; }
.cur {
  display: none;
  width: 0.55em; height: 1em;
  background: var(--ph);
  vertical-align: text-bottom;
  margin-left: 2px;
  box-shadow: var(--glow-soft);
}
.cur.on { display: inline-block; animation: curBlink 1.06s steps(1) infinite; }
@keyframes curBlink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }

/* ============ small screens ============ */

@media (max-width: 680px) {
  .zoom-track { height: 190vh; }
  .term-bar { padding: 12px 16px 8px; font-size: 15px; gap: 12px; }
  .tb-ch { display: none; }
  .tb-nav { gap: 14px; }
  .tb-nav a { white-space: nowrap; }
  .term-cassettes { display: none; }
  .tb-nav a[data-nav="01"], .tb-nav a[data-nav="03"] { display: none; }
  .t-sec { padding: 12vh 18px; }
  .rec { padding-left: 14px; }
}

/* ============ reduced motion: everything complete, page never blank ============ */

@media (prefers-reduced-motion: reduce) {
  .term { margin-top: 0; }
  .t-claim { opacity: 1; }
  .rv { opacity: 1; transform: none; }
  .zoom-track { height: auto; }
  .rig { position: relative; height: 100vh; }
  .mini-on { opacity: 1 !important; animation: none !important; }
  .mini-body { opacity: 1 !important; }
  .m-play { animation: none; }
  .crt-frame, .term-bar { opacity: 1; }
  .cur.on { animation: none; }
  .photo { filter: none; }
}
