:root {
  --bg: #0a36b7;
  --bg-deep: #07288d;
  --text: #aeb7c8;
  --text-soft: #9099ab;
  --line: rgba(174, 183, 200, 0.28);
  --panel: rgba(6, 24, 87, 0.46);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

a {
  color: inherit;
}

.background-image,
.screen-bleed,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background-image {
  background:
    linear-gradient(rgba(10, 54, 183, 0.74), rgba(7, 40, 141, 0.78)),
    url("bluescreenofdeath-min%20%281%29.jpg") center center / 160% 140% no-repeat;
  filter: saturate(0.75) blur(0.3px) contrast(1.05);
  transform: scaleY(1.18) scaleX(1.05);
  opacity: 0.5;
}

.screen-bleed {
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.08), transparent 16%),
    radial-gradient(circle at 82% 70%, rgba(255, 255, 255, 0.06), transparent 22%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 15%, transparent 85%, rgba(255, 255, 255, 0.04));
}

.scanlines {
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.22;
}

.page-shell {
  position: relative;
  width: min(960px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 60px;
}

.masthead {
  margin-bottom: 34px;
}

.tiny {
  margin: 0 0 8px;
  font-size: 0.74rem;
  text-transform: lowercase;
  letter-spacing: 0.18em;
  color: var(--text-soft);
}

.masthead h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 5.8rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.06em;
  text-transform: lowercase;
}

.intro {
  max-width: 58ch;
  margin: 16px 0 0;
  line-height: 1.85;
  color: var(--text-soft);
}

.stack {
  display: grid;
  gap: 18px;
}

.split-row {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}

.note,
.quote-strip {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
}

.note p:last-child {
  margin: 0;
  line-height: 1.8;
}

.note-wide {
  max-width: 760px;
}

.terminal-note {
  max-width: 820px;
}

.quote-strip {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  text-transform: lowercase;
  color: var(--text-soft);
}

.message-form {
  display: grid;
  gap: 12px;
}

.terminal-label,
.form-note {
  color: var(--text-soft);
  line-height: 1.7;
}

.message-form textarea,
.message-form button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
}

.message-form textarea {
  resize: vertical;
  min-height: 180px;
  padding: 14px;
  color: var(--text);
  background: rgba(1, 13, 50, 0.62);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.message-form textarea::placeholder {
  color: #7f899d;
}

.message-form textarea:focus {
  border-color: rgba(196, 204, 219, 0.5);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.message-form button {
  width: auto;
  min-width: 180px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(174, 183, 200, 0.08);
  text-transform: lowercase;
  cursor: pointer;
}

.message-form button:hover,
.message-form button:focus-visible {
  background: rgba(174, 183, 200, 0.14);
}

.glitch-target {
  position: relative;
  display: inline-block;
}

.glitch-target.glitching {
  animation: text-jitter 180ms steps(2, end) 2;
}

.glitch-target.glitching::before,
.glitch-target.glitching::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.glitch-target.glitching::before {
  color: #c4ccdb;
  transform: translate(-2px, 0);
  clip-path: inset(0 0 46% 0);
}

.glitch-target.glitching::after {
  color: #8994a8;
  transform: translate(2px, 0);
  clip-path: inset(52% 0 0 0);
}

.glitch-box::after,
.note.artifact-burst::after,
.quote-strip.artifact-burst::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  top: var(--artifact-top, 45%);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(220, 226, 235, 0.72), transparent);
  opacity: 0;
}

.artifact-burst::after {
  opacity: 1;
  animation: burst-pass 320ms linear 1;
}

.phase-shift {
  animation: phase-shift 240ms ease-in-out 1;
}

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

@keyframes burst-pass {
  from {
    transform: translateX(-18px);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  to {
    transform: translateX(18px);
    opacity: 0;
  }
}

@keyframes phase-shift {
  0% { transform: translate3d(0, 0, 0); }
  35% { transform: translate3d(2px, 0, 0); }
  70% { transform: translate3d(-2px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@media (max-width: 760px) {
  .split-row,
  .quote-strip {
    grid-template-columns: 1fr;
    display: grid;
  }

  .page-shell {
    width: min(100% - 20px, 960px);
    padding-top: 18px;
  }

  .note,
  .quote-strip {
    padding: 14px;
  }

  .form-row {
    align-items: flex-start;
  }
}
