/* ===== RESET ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  font-family: 'Courier New', monospace;
  color: #d0d0d0;
  overflow: hidden;
}

/* ===== SCANLINES ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.04) 1px,
    transparent 2px
  );
  pointer-events: none;
}

/* ===== MAIN SCREEN ===== */
#screen {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 640px;
  height: 480px;
  transform: translate(-50%, -50%);
  background: #0b0b0b;
  border: 1px solid #333;
  box-shadow: 0 0 60px rgba(0,0,0,0.9);
}

/* ===== TITLE BAR ===== */
#titlebar {
  height: 22px;
  padding: 4px 8px;
  font-size: 12px;
  background: #141414;
  border-bottom: 1px solid #000;
  color: #888;
}

/* ===== CONTENT ===== */
#content {
  padding: 18px;
  position: relative;
}

p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 10px;
}

/* ===== DESYNC TEXT (MICRO SLIP) ===== */
.desync {
  position: relative;
  display: inline-block;
}

.desync::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 2px;
  width: 100%;
  color: rgba(255, 60, 60, 0.7);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: textSlip 2.8s infinite;
}

@keyframes textSlip {
  0%   { transform: translate(0, 0); opacity: 0.3; }
  50%  { transform: translate(1px, 0); opacity: 0.8; }
  100% { transform: translate(0, 0); opacity: 0.3; }
}

/* ===== RGB TEXT SPLIT ===== */
.rgb::before,
.rgb::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  width: 100%;
  pointer-events: none;
}

.rgb::before {
  left: -1px;
  color: rgba(0,255,255,0.5);
}

.rgb::after {
  left: 1px;
  color: rgba(255,0,255,0.5);
}

/* ===== ARTIFACT BOX (CANVAS) ===== */
#artifact {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 180px;
  height: 180px;
  border: 1px solid #333;
  background: #000; /* canvas will paint over this */
}

/* ===== GLITCH OVERLAY ===== */
.glitch::before,
.glitch::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.03) 1px,
    transparent 2px
  );
  animation: scanDrift 6s linear infinite;
}

.glitch::after {
  background: linear-gradient(
    90deg,
    rgba(255,0,0,0.04),
    transparent 40%,
    rgba(0,0,255,0.04)
  );
  animation: colorBleed 4s infinite alternate;
}

@keyframes scanDrift {
  from { transform: translateY(0); }
  to   { transform: translateY(-6px); }
}

@keyframes colorBleed {
  from { opacity: 0.2; }
  to   { opacity: 0.5; }
}

/* ===== SCREEN JITTER ===== */
@keyframes jitter {
  0% { transform: translate(-50%, -50%); }
  98% { transform: translate(-50%, -50%); }
  99% { transform: translate(-49.5%, -50.2%); }
  100% { transform: translate(-50%, -50%); }
}

#screen {
  animation: jitter 7s infinite;
}



/* ===== UNEVEN ARTIFACT ROT ===== */
@keyframes unevenRot {
  0%   { clip-path: inset(0 0 0 0); }
  85%  { clip-path: inset(0 0 0 0); }
  88%  { clip-path: inset(10% 0 60% 0); }
  90%  { clip-path: inset(0 30% 0 0); }
  92%  { clip-path: inset(50% 0 10% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* ===== APPLY UNEVEN ROT TO ARTIFACT ===== */
#artifact {
  animation: unevenRot 18s infinite steps(1);
}

/* ===== GRIT OVERLAY ===== */
#artifact::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-radial-gradient(
      circle at 30% 40%,
      rgba(255,255,255,0.03),
      rgba(255,255,255,0.03) 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.2),
      rgba(0,0,0,0.2) 1px,
      transparent 3px
    );
  mix-blend-mode: overlay;
  opacity: 0.4;
  pointer-events: none;
}

.hidden-text {
    color: white;               /* text color matches background */
    background-color: white;    /* forces highlight to reveal */
    cursor: pointer;
    user-select: text;          /* allows text to be highlighted */
    padding: 0 2px;             /* optional, expands hover area */
}

