/* ---------------------------------------------------
   you found the stylesheet too. hi.
--------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #090c10;
  --bg-alt: #0d1219;
  --panel: #11161dcc;
  --fg: #c9d3dc;
  --fg-dim: #566270;
  --fg-dimmer: #313a45;
  --accent: #ffb400;
  --accent-soft: #ffb40033;
  --accent-2: #37d6a0;
  --danger: #ff3b5c;
  --border: #1c2530;
  --font-display: 'Space Mono', 'Courier New', monospace;
  --font-body: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
}

#bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.018) 0px,
      rgba(255,255,255,0.018) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: normal;
}

main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
}

.panel {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  padding: 28px 30px 24px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 20px 60px -20px rgba(0,0,0,0.7);
  animation: panelFloat 9s ease-in-out infinite;
}
@keyframes panelFloat {
  0%   { transform: translate(0,0) rotate(0deg); }
  22%  { transform: translate(2px,-5px) rotate(0.15deg); }
  48%  { transform: translate(-3px,-2px) rotate(-0.1deg); }
  74%  { transform: translate(2px,4px) rotate(0.12deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}

.panel::before,
.panel::after,
.panel .br,
.panel .br2 {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  opacity: 0.85;
}
.panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.panel::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.panel .br     { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.panel .br2    { bottom: -1px; left: -1px; border-right: none; border-top: none; }

.panel-label {
  position: absolute;
  top: -10px;
  left: 18px;
  background: var(--bg);
  padding: 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.boot {
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-dim);
  white-space: pre-wrap;
  min-height: 1.7em;
}
.boot .prompt { color: var(--accent-2); }
.boot .warn { color: var(--danger); }
.cursor-blink {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  margin: 18px 0 6px;
  letter-spacing: 0.01em;
  color: var(--fg);
}
.tagline {
  color: var(--fg-dim);
  font-size: 13.5px;
  margin: 0 0 22px;
  line-height: 1.6;
}
.tagline .accent { color: var(--accent-2); }

.reveal {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.show { opacity: 1; transform: translateY(0); }

.dirlist {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dirlist a, .dirlist .entry {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 10px;
  align-items: baseline;
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  padding: 7px 6px;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.dirlist a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.dirlist a:hover .path { color: var(--accent); }
.perm { color: var(--fg-dimmer); font-size: 12px; }
.path { color: var(--fg); }
.note { color: var(--fg-dim); font-size: 12px; text-align: right; }

footer {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--fg-dimmer);
  letter-spacing: 0.03em;
}
footer span.live { color: var(--accent-2); }

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 12px;
  color: var(--fg-dim);
  text-decoration: none;
  border-bottom: 1px dashed var(--fg-dimmer);
}
.back-link:hover { color: var(--accent); border-color: var(--accent); }

.gibberish {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg-dim);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.4s ease, transform 1.6s ease;
}
.gibberish.hot { color: var(--accent); }
.gibberish.precursor {
  color: var(--fg-dimmer);
  letter-spacing: 1px;
  transition: opacity 0.15s ease;
}
.gibberish.micro {
  font-size: 10px;
  color: var(--fg-dimmer);
  transition: opacity 0.15s ease;
}
.gibberish.micro.hot { color: var(--danger); }

.word { display: inline-block; }
.word-danger { color: var(--danger); }
.word-accent2 { color: var(--accent-2); }

.text-flicker {
  animation: textFlickerAnim 220ms steps(2, end);
}
@keyframes textFlickerAnim {
  0%, 100% { opacity: 1; text-shadow: none; }
  50% { opacity: 0.35; text-shadow: 1px 0 var(--danger), -1px 0 var(--accent-2); }
}

body.glitching main {
  animation: jitter 180ms steps(2, end);
}
body.glitching #bg-grid { filter: hue-rotate(25deg); }
@keyframes jitter {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-2px, 1px); }
  40%  { transform: translate(2px, -1px); }
  60%  { transform: translate(-1px, 0); filter: drop-shadow(1px 0 var(--danger)) drop-shadow(-1px 0 var(--accent-2)); }
  80%  { transform: translate(1px, 1px); }
  100% { transform: translate(0,0); }
}

body.rgbsplit h1 {
  animation: rgbSplitAnim 180ms steps(2, end);
}
@keyframes rgbSplitAnim {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 2px 0 var(--danger), -2px 0 var(--accent-2); }
}

body.flicker .crt-overlay {
  animation: flickerAnim 240ms steps(3, end);
}
@keyframes flickerAnim {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.4; }
  50% { opacity: 1.4; }
  75% { opacity: 0.6; }
}

#tv-static {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  image-rendering: pixelated;
  mix-blend-mode: overlay;
}

#degauss-flash {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.9), rgba(255,180,0,0.25) 40%, transparent 72%);
}
body.degaussing #degauss-flash { animation: degaussFlash 560ms ease-out; }
@keyframes degaussFlash {
  0% { opacity: 0; }
  12% { opacity: 0.55; }
  35% { opacity: 0.15; }
  100% { opacity: 0; }
}
body.degaussing { animation: hueWobble 560ms linear; }
@keyframes hueWobble {
  0% { filter: hue-rotate(0deg) saturate(1); }
  25% { filter: hue-rotate(65deg) saturate(1.8); }
  50% { filter: hue-rotate(-45deg) saturate(0.55); }
  75% { filter: hue-rotate(20deg) saturate(1.4); }
  100% { filter: hue-rotate(0deg) saturate(1); }
}

main.rolling { animation: rollSnap 450ms cubic-bezier(.36,.07,.19,.97); }
@keyframes rollSnap {
  0% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  55% { transform: translateY(6px); }
  75% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

.tracking-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: -6px;
  height: 6px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.55), rgba(55,214,160,0.4), transparent);
  mix-blend-mode: screen;
}
.tracking-bar.run { animation: trackSweep 600ms linear; }
@keyframes trackSweep {
  0% { top: -6px; opacity: 0.85; }
  100% { top: 100%; opacity: 0; }
}

.scramble { display: inline-block; }

@media (max-width: 480px) {
  .panel { padding: 22px 18px 20px; }
  .dirlist a, .dirlist .entry { grid-template-columns: 60px 1fr; }
  .note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-blink { animation: none; opacity: 1; }
  body.glitching main { animation: none; }
  .reveal { transition: none; }
  .panel { animation: none; }
  .text-flicker { animation: none; }
  body.rgbsplit h1 { animation: none; }
  body.flicker .crt-overlay { animation: none; }
  body.degaussing { animation: none; }
  body.degaussing #degauss-flash { animation: none; }
  main.rolling { animation: none; }
}
