:root {
  --ink: #0b0b0a;
  --ink-2: #121210;
  --bone: #e8e2d4;
  --dim: #8b867a;
  --faint: #55524b;
  --line: rgba(232, 226, 212, .2);
  --signal: #ff4a1c;     /* the one accent, kin to the boards' orange */
  --cyan: #3cf0ff;       /* only ever appears in chroma-split glitches */
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ink); color: var(--bone); font: 14px/1.5 var(--mono); overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the moshed feed: rendered small, scaled up with hard pixels */
#sky { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
/* faint scanlines + vignette, so the feed reads as a screen */
.scan {
  position: fixed; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%);
}

/* floating labels */
.notes { position: fixed; inset: 0; pointer-events: none; }
.note {
  position: absolute; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 1px;
  padding: 9px 12px 10px; min-width: 150px;
  background: rgba(11, 11, 10, .82); border: 1px solid var(--line);
  color: var(--bone); text-transform: uppercase; letter-spacing: .08em;
  opacity: 0;
  animation: note-in .6s steps(4) forwards, float var(--d, 14s) ease-in-out infinite alternate;
}
.note .idx { grid-row: span 2; font-size: 10px; color: var(--signal); padding-top: 2px; }
.note b { font-size: 12px; font-weight: 600; }
.note i { font-style: normal; font-size: 10px; color: var(--dim); letter-spacing: .06em; }
.note.glitch-on { transform: translateX(var(--gx, 4px)); clip-path: inset(var(--gt, 20%) 0 var(--gb, 40%) 0); text-shadow: -2px 0 var(--signal), 2px 0 var(--cyan); }
.n1 { left: 7%;  top: 14%; --d: 13s; animation-delay: .3s, 0s; }
.n2 { left: 13%; top: 64%; --d: 16s; animation-delay: .6s, -4s; }
.n3 { right: 8%; top: 17%; --d: 15s; animation-delay: .45s, -2s; }
.n4 { right: 12%; top: 67%; --d: 18s; animation-delay: .75s, -6s; }
.n5 { left: 39%; top: 6%;  --d: 17s; animation-delay: .9s, -3s; }
.n6 { left: 55%; bottom: 7%; --d: 14s; animation-delay: 1.05s, -5s; }
@keyframes note-in { to { opacity: 1; } }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-18px); } }

/* the one clean frame */
.wrap { position: relative; z-index: 2; min-height: 100%; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px; }
.card {
  position: relative; width: min(372px, 100%);
  padding: 18px 26px 22px;
  background: var(--ink); border: 1px solid rgba(232, 226, 212, .38);
  box-shadow: 8px 8px 0 rgba(255, 74, 28, .9), 0 30px 80px rgba(0, 0, 0, .6);
  text-align: center;
  animation: boot .7s steps(7) backwards;
}
@keyframes boot {
  0% { clip-path: inset(50% 0 50% 0); opacity: 0; }
  40% { clip-path: inset(49% 0 49% 0); opacity: 1; }
  100% { clip-path: inset(0 0 0 0); }
}
.meta {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 -8px 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.rec { display: inline-flex; align-items: center; gap: 7px; }
.rec i { width: 7px; height: 7px; background: var(--signal); animation: rec 1.6s steps(1) infinite; }
@keyframes rec { 50% { opacity: .25; } }

.logo { width: 54px; height: 54px; margin: 0 auto 6px; }
.logo svg { width: 100%; height: 100%; overflow: visible; }
.logo .star { fill: var(--bone); transform-origin: 32px 32px; animation: turn 9s steps(36) infinite; }
.logo.glitch-on .star { fill: var(--signal); }
@keyframes turn { to { transform: rotate(360deg); } }

h1 {
  position: relative; margin: 0; font: 600 34px/1.1 var(--serif); letter-spacing: -.01em; color: var(--bone);
}
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.glitch.glitch-on::before { opacity: 1; color: var(--signal); transform: translateX(var(--gx, -3px)); clip-path: inset(var(--gt, 10%) 0 var(--gb, 55%) 0); background: var(--ink); }
.glitch.glitch-on::after { opacity: 1; color: var(--cyan); transform: translateX(calc(var(--gx, -3px) * -1)); clip-path: inset(var(--gb, 55%) 0 var(--gt, 10%) 0); background: var(--ink); }

.typer { margin: 8px 0 22px; min-height: 21px; color: var(--dim); font-size: 12.5px; letter-spacing: .02em; }
.caret { display: inline-block; width: 7px; height: 13px; margin-left: 3px; vertical-align: -2px; background: var(--signal); animation: rec 1s steps(1) infinite; }

.field { position: relative; }
.field input {
  width: 100%; height: 46px; padding: 0 46px 0 14px;
  border: 1px solid rgba(232, 226, 212, .3); border-radius: 0; background: var(--ink-2);
  color: var(--bone); font-family: var(--mono); font-size: 15px; letter-spacing: .12em;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--faint); letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.field input:focus { outline: none; border-color: var(--bone); box-shadow: inset 3px 0 0 var(--signal); }
.peek { position: absolute; right: 6px; top: 7px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--dim); cursor: pointer; display: grid; place-items: center; }
.peek:hover, .peek[aria-pressed="true"] { color: var(--signal); }
.peek svg, .go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }

.go {
  position: relative; width: 100%; height: 46px; margin-top: 12px;
  border: 1px solid var(--bone); border-radius: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); background: var(--bone);
  transition: background .12s steps(2), color .12s steps(2);
}
.go:hover { background: var(--signal); border-color: var(--signal); color: var(--ink); text-shadow: -1px 0 rgba(60, 240, 255, .6); }
.go:active { transform: translate(1px, 1px); }
.go:focus-visible, .peek:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.go svg { transition: transform .12s steps(2); }
.go:hover svg { transform: translateX(4px); }
.go .spinner { display: none; width: 46px; height: 4px; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px); animation: load .6s steps(5) infinite; }
.go.busy .label, .go.busy svg { display: none; }
.go.busy .spinner { display: block; }
@keyframes load { to { background-position: 40px 0; } }

.msg { min-height: 18px; margin: 12px 0 0; font-size: 12px; letter-spacing: .04em; color: var(--signal); text-transform: lowercase; }
.foot { margin: 0; color: var(--faint); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }

/* wrong password: the frame tears */
.card.shake { animation: tear .42s steps(6); }
.card.shake .field input { border-color: var(--signal); }
@keyframes tear {
  0% { transform: translateX(0); clip-path: inset(0 0 0 0); }
  20% { transform: translateX(-9px); clip-path: inset(0 0 58% 0); }
  40% { transform: translateX(7px); clip-path: inset(30% 0 0 0); }
  60% { transform: translateX(-4px); clip-path: inset(0 0 22% 0); }
  80% { transform: translateX(3px); clip-path: inset(12% 0 0 0); }
  100% { transform: none; clip-path: inset(0 0 0 0); }
}
/* right password: the feed melts and the frame switches off like a CRT */
body.warp .card { animation: crt-off .55s steps(9) .25s forwards; }
body.warp .note, body.warp .foot { animation: fade-out .3s steps(3) forwards; }
@keyframes crt-off {
  0% { clip-path: inset(0 0 0 0); }
  60% { clip-path: inset(49.5% 0 49.5% 0); transform: scaleX(1.06); }
  100% { clip-path: inset(50% 50% 50% 50%); opacity: 0; }
}
@keyframes fade-out { to { opacity: 0; } }

@media (max-width: 980px) {
  .n2, .n4, .n5 { display: none; }
  .n1 { left: 4%; top: 4%; } .n3 { right: 4%; top: 8%; } .n6 { left: 26%; bottom: 3%; }
  .card { box-shadow: 5px 5px 0 rgba(255, 74, 28, .9); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .note { opacity: 1; }
}

::selection { background: var(--signal); color: var(--ink); }
@media (max-width: 520px) {
  .n3 { display: none; }
  .note { min-width: 0; }
}
