/* ================================ */
/* ====== STYLE_CYBER.CSS ========= */
/* ================================ */

/* Base Body */
body {
  background: #050505;
  color: #c8facc;
  font-family: 'Share Tech Mono', monospace;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  text-shadow: 0 0 4px rgba(0,255,140,0.3);
  --cursor-x: -100px;
  --cursor-y: -100px;
  transition: transform 0.2s ease-out;
}

/* Self-hosted font face */
@font-face {
  font-family: 'Share Tech Mono';
  src: url('fonts/ShareTechMono-Regular.tff') format('tff'),
       url('fonts/ShareTechMono-Regular.tff') format('tff');
  font-weight: normal;
  font-style: normal;
}

/* ================================= */
/* CRT Scanlines + Flicker overlays */
/* ================================= */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  animation: scanDrift 8s linear infinite;
  z-index: 9998;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0,255,140,0.05), transparent 70%);
  animation: pulseFlicker 4s infinite alternate;
  z-index: 9999;
}

@keyframes scanDrift {
  0% { transform: translateY(0px); }
  100% { transform: translateY(3px); }
}

@keyframes pulseFlicker {
  0% { opacity: 0.4; }
  100% { opacity: 0.7; }
}

/* ==================== */
/* Glitch Text Effects */
/* ==================== */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}

.glitch::before {
  color: #ff00c8;
  transform: translate(-2px, 0);
  animation: glitchShift 2s infinite linear alternate-reverse;
}

.glitch::after {
  color: #00f7ff;
  transform: translate(2px, 0);
  animation: glitchShift 3s infinite linear alternate;
}

@keyframes glitchShift {
  0% { clip-path: inset(10% 0 80% 0); }
  25% { clip-path: inset(40% 0 30% 0); }
  50% { clip-path: inset(70% 0 5% 0); }
  75% { clip-path: inset(20% 0 50% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* ==================== */
/* Page Personalities */
/* ==================== */
.page-index {
  animation: slowBreath 12s infinite ease-in-out;
}

@keyframes slowBreath {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.05); }
  100% { filter: brightness(1); }
}

.page-links a {
  display: inline-block;
  transition: transform 0.1s ease;
}

.page-links a:hover {
  transform: skew(-3deg) scale(1.05);
  text-shadow: 2px 0 red, -2px 0 cyan;
}

.page-archive {
  filter: contrast(1.1) brightness(0.95);
}

.page-archive h2 {
  letter-spacing: 2px;
  opacity: 0.9;
}

/* ==================== */
/* Corruption Classes */
/* ==================== */
.corrupt {
  animation: jitter 0.2s infinite;
}

@keyframes jitter {
  0% { transform: translate(0,0); }
  25% { transform: translate(-1px,1px); }
  50% { transform: translate(1px,-1px); }
  75% { transform: translate(-1px,-1px); }
  100% { transform: translate(1px,1px); }
}

/* ==================== */
/* Cursor Reactive Layers */
/* ==================== */
body::before,
body::after {
  transition: top 0.05s, left 0.05s;
}

.heat-distortion {
  position: fixed;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,0,0.08), transparent 70%);
  mix-blend-mode: overlay;
  transform: translate(-50%, -50%);
  transition: top 0.05s, left 0.05s;
  z-index: 9997;
}

/* ==================== */
/* After Dark Escalation */
/* ==================== */
.after-dark {
  filter: contrast(1.2) brightness(0.85);
}

.after-dark h1,
.after-dark h2 {
  animation: darkGlitch 1.5s infinite;
}

@keyframes darkGlitch {
  0% { text-shadow: 2px 0 red, -2px 0 cyan; }
  50% { text-shadow: -2px 0 red, 2px 0 cyan; }
  100% { text-shadow: 2px 0 red, -2px 0 cyan; }
}

.after-dark::after {
  opacity: 0.9 !important;
}

/* =============================== */
/* === UNSTABLE GLITCH DIRECTORY === */
/* =============================== */

.drift-field {
  margin-top: 3rem;
  padding: 2rem 1rem;
  border-top: 1px solid rgba(0,255,200,0.2);
  position: relative;
  overflow: hidden;
}

/* Background scanline noise */
.drift-field::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,255,200,0.03),
    rgba(0,255,200,0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  animation: scanDrift 8s linear infinite;
}

@keyframes scanDrift {
  from { transform: translateY(0); }
  to   { transform: translateY(20px); }
}

.transmission-header {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  opacity: 0.6;
  margin-bottom: 2rem;
  text-transform: uppercase;
  animation: flickerHeader 6s infinite;
}

@keyframes flickerHeader {
  0%, 97%, 100% { opacity: 0.6; }
  98% { opacity: 0.1; }
  99% { opacity: 0.8; }
}

/* Grid */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

/* Node base */
.signal-node {
  position: relative;
  display: block;
  padding: 1rem;
  border: 1px solid rgba(0,255,200,0.15);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease;
  animation: jitter 4s infinite alternate;
}

@keyframes jitter {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-1px,1px); }
  50%  { transform: translate(1px,-1px); }
  75%  { transform: translate(-1px,-1px); }
  100% { transform: translate(1px,1px); }
}

/* Hover destabilization */
.signal-node:hover {
  border-color: rgba(0,255,200,0.8);
  box-shadow: 0 0 15px rgba(0,255,200,0.4);
  transform: scale(1.04) skewX(2deg);
}

/* Name styling */
.node-name {
  position: relative;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: rgba(0,255,200,0.9);
}

/* RGB Glitch Layers */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.8;
}

.glitch::before {
  color: #ff00ff;
  transform: translate(1px, -1px);
  animation: glitchTop 2s infinite linear alternate-reverse;
}

.glitch::after {
  color: #00ffff;
  transform: translate(-1px, 1px);
  animation: glitchBottom 3s infinite linear alternate-reverse;
}

@keyframes glitchTop {
  0% { clip-path: inset(0 0 90% 0); }
  25% { clip-path: inset(10% 0 60% 0); }
  50% { clip-path: inset(30% 0 30% 0); }
  75% { clip-path: inset(60% 0 10% 0); }
  100% { clip-path: inset(0 0 90% 0); }
}

@keyframes glitchBottom {
  0% { clip-path: inset(80% 0 0 0); }
  25% { clip-path: inset(40% 0 20% 0); }
  50% { clip-path: inset(20% 0 40% 0); }
  75% { clip-path: inset(10% 0 60% 0); }
  100% { clip-path: inset(80% 0 0 0); }
}

/* Metadata */
.node-meta {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.7rem;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: rgba(0,255,200,0.5);
}

.signal-node:hover .node-meta {
  opacity: 0.7;
  transform: translateY(0);
}

/* Random flicker bursts */
.signal-node:nth-child(3n) {
  animation: burstFlicker 7s infinite;
}

@keyframes burstFlicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.2; }
  97% { opacity: 1; }
  98% { opacity: 0.3; }
  99% { opacity: 1; }
}