/* ── reset & root ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #080808;
  --bg2:      #0d0d0d;
  --fg:       #c8c8c0;
  --fg-dim:   #505048;
  --fg-faint: #282824;
  --accent:   #7a9e7e;
  --danger:   #8b3a3a;
  --mono:     'Courier New', Courier, monospace;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #000; }

a { color: var(--fg-dim); text-decoration: none; }
a:hover { color: var(--fg); }

/* ── noise overlay (lightweight, CSS only) ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.55;
  mix-blend-mode: overlay;
  animation: noiseShift 8s steps(1) infinite;
}

@keyframes noiseShift {
  0%   { background-position: 0 0; }
  10%  { background-position: -50px 20px; }
  20%  { background-position: 30px -10px; }
  30%  { background-position: -20px 50px; }
  40%  { background-position: 60px 30px; }
  50%  { background-position: -40px -30px; }
  60%  { background-position: 10px 60px; }
  70%  { background-position: 80px -50px; }
  80%  { background-position: -60px 40px; }
  90%  { background-position: 40px -20px; }
  100% { background-position: 0 0; }
}

/* ── scanline ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

/* ── layout helpers ── */
.page-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.stamp {
  color: var(--fg-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── glitch text utility ── */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0;
}
.glitch.active::before {
  opacity: 0.7;
  color: #4a7a6e;
  clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
  transform: translateX(-2px);
  animation: glitchA 0.15s steps(1) forwards;
}
.glitch.active::after {
  opacity: 0.7;
  color: #7a4a4a;
  clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%);
  transform: translateX(2px);
  animation: glitchB 0.15s steps(1) forwards;
}

@keyframes glitchA {
  0%   { clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%); transform: translateX(-3px); }
  50%  { clip-path: polygon(0 55%, 100% 55%, 100% 65%, 0 65%); transform: translateX(2px); }
  100% { opacity: 0; }
}
@keyframes glitchB {
  0%   { clip-path: polygon(0 65%, 100% 65%, 100% 80%, 0 80%); transform: translateX(3px); }
  50%  { clip-path: polygon(0 20%, 100% 20%, 100% 35%, 0 35%); transform: translateX(-2px); }
  100% { opacity: 0; }
}

/* ── flicker ── */
@keyframes flicker {
  0%, 97%, 100% { opacity: 1; }
  98%           { opacity: 0.7; }
  99%           { opacity: 0.3; }
}

/* ── nav dot ── */
.nav-corner {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  gap: 1rem;
  z-index: 100;
}
.nav-corner a {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--fg-faint);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-corner a:hover { color: var(--fg-dim); border-color: var(--fg-dim); }

/* ── cursor blink ── */
.cursor-blink::after {
  content: '_';
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
