:root {
  --ink: #071225;
  --panel: #0c1f3d;
  --panel-deep: #09182f;
  --green: #18ff62;
  --lime: #b7ff2a;
  --cyan: #18e9ff;
  --yellow: #f4e929;
  --red: #ff3158;
  --blue: #1788ff;
  --paper: #f8f5e9;
  --muted: #afbed2;
  --display: "Courier New", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(24, 233, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 233, 255, 0.035) 1px, transparent 1px);
  background-size: 16px 16px;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(7, 18, 37, 0.08) 3px 4px);
}

::selection {
  color: var(--ink);
  background: var(--yellow);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--ink);
  background: var(--yellow);
  font-weight: 900;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.holding-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.2rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 3px solid var(--cyan);
  background: rgba(7, 18, 37, 0.96);
}

.tnaf-logo {
  position: relative;
  display: grid;
  width: 7.2rem;
  height: 4.4rem;
  overflow: hidden;
  place-items: center;
  border: 3px solid var(--paper);
  color: var(--yellow);
  background: var(--panel);
  box-shadow: inset 6px 0 0 var(--red), inset -6px 0 0 var(--blue);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.tnaf-logo span {
  position: relative;
}

.brand-copy p,
.channel {
  margin: 0;
  font-weight: 900;
}

.brand-name {
  color: var(--green);
  font-size: clamp(1.25rem, 2.5vw, 2.25rem);
  letter-spacing: 0.035em;
  line-height: 1.05;
}

.brand-description {
  margin-top: 0.35rem !important;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
}

.channel {
  padding: 0.45rem 0.6rem;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.85rem;
}

.channel span {
  color: var(--ink);
  background: var(--cyan);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.45rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 2px dashed var(--cyan);
  color: var(--cyan);
  background: var(--panel-deep);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

main {
  display: grid;
  min-height: calc(100vh - 12rem);
  align-content: center;
  gap: 1.25rem;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 3.5rem);
}

.holding-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(430px, 1.15fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 3px solid var(--cyan);
  background: var(--panel-deep);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}

.holding-copy,
.signal-machine {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  color: var(--green);
  font-size: clamp(4.2rem, 9vw, 8.5rem);
  font-weight: 900;
  letter-spacing: -0.09em;
  line-height: 0.72;
  text-shadow: 6px 6px 0 rgba(23, 136, 255, 0.58);
}

h1 span {
  color: var(--yellow);
}

.cursor {
  display: inline-block;
  width: 0.42em;
  height: 0.17em;
  margin-left: 0.08em;
  background: var(--red);
  animation: cursor-blink 1.45s steps(1, end) infinite;
}

.standfirst {
  max-width: 48ch;
  margin: 2rem 0 1.2rem;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 700;
}

.verdict {
  display: inline-block;
  margin: 0;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  background: var(--red);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.35;
}

.signal-machine {
  position: relative;
  padding: 0.8rem;
  border: 3px solid var(--cyan);
  background: var(--ink);
  box-shadow: inset 0 0 0 5px var(--panel);
}

.machine-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0.45rem 0.75rem;
  color: var(--cyan);
  font-size: 0.65rem;
  font-weight: 900;
}

.signal-lamp i {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.3rem;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green), 0 0 0.85rem var(--green);
}

.machine-screen {
  position: relative;
  display: grid;
  min-height: clamp(18rem, 34vw, 29rem);
  overflow: hidden;
  align-content: center;
  justify-items: center;
  border: 3px solid var(--paper);
  background:
    radial-gradient(circle at 50% 40%, rgba(24, 255, 98, 0.08), transparent 55%),
    var(--panel);
}

.machine-screen::after {
  position: absolute;
  right: 5%;
  bottom: 8%;
  width: 18%;
  height: 3px;
  content: "";
  background: var(--red);
  box-shadow: -355px -240px 0 var(--yellow), -315px -240px 0 var(--yellow), -275px -240px 0 var(--yellow);
}

.screen-label,
.screen-code {
  margin: 0;
  color: var(--cyan);
  font-size: clamp(0.58rem, 1vw, 0.78rem);
  font-weight: 900;
  letter-spacing: 0.1em;
}

.screen-label {
  margin-bottom: 1.2rem;
}

.screen-code {
  margin-top: 1.2rem;
  color: var(--muted);
}

.screen-mark {
  display: flex;
  filter: drop-shadow(5px 5px 0 var(--blue));
}

.screen-mark span {
  display: grid;
  width: clamp(3.6rem, 7.5vw, 6.8rem);
  aspect-ratio: 1;
  place-items: center;
  color: var(--ink);
  background: var(--green);
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  font-weight: 900;
}

.screen-mark span:nth-child(even) {
  color: var(--panel);
  background: var(--yellow);
}

.screen-corner {
  position: absolute;
  width: 2rem;
  height: 2rem;
  border-color: var(--cyan);
}

.screen-corner--tl { top: 0.8rem; left: 0.8rem; border-top: 4px solid; border-left: 4px solid; }
.screen-corner--tr { top: 0.8rem; right: 0.8rem; border-top: 4px solid; border-right: 4px solid; }
.screen-corner--bl { bottom: 0.8rem; left: 0.8rem; border-bottom: 4px solid; border-left: 4px solid; }
.screen-corner--br { right: 0.8rem; bottom: 0.8rem; border-right: 4px solid; border-bottom: 4px solid; }

.screen-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.screen-noise i {
  position: absolute;
  display: none;
  width: 0.7rem;
  height: 0.35rem;
  background: var(--cyan);
}

.screen-noise i:nth-child(1) { top: 18%; left: 13%; }
.screen-noise i:nth-child(2) { top: 26%; right: 18%; background: var(--red); }
.screen-noise i:nth-child(3) { top: 49%; left: 6%; background: var(--yellow); }
.screen-noise i:nth-child(4) { right: 9%; bottom: 34%; background: var(--green); }
.screen-noise i:nth-child(5) { bottom: 17%; left: 26%; }
.screen-noise i:nth-child(6) { top: 10%; left: 48%; background: var(--yellow); }
.screen-noise i:nth-child(7) { right: 32%; bottom: 8%; background: var(--red); }
.screen-noise i:nth-child(8) { top: 64%; left: 43%; background: var(--paper); }

.machine-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0.25rem 0.15rem;
}

.control-pad {
  display: grid;
  grid-template-columns: 1rem 1rem;
  gap: 0.28rem;
}

.control-pad i {
  width: 1rem;
  height: 1rem;
  background: var(--yellow);
}

.data-slot {
  height: 0.7rem;
  border: 2px solid var(--cyan);
  background: var(--panel);
}

.data-slot span {
  display: block;
  width: 61%;
  height: 100%;
  background: var(--green);
}

.control-key {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--ink);
  background: var(--red);
  font-weight: 900;
}

.dropout {
  position: absolute;
  z-index: 4;
  display: block;
  opacity: 0;
  background: var(--ink);
}

.dropout--one { top: 18%; left: 35%; width: 1rem; height: 0.45rem; }
.dropout--two { right: 22%; bottom: 19%; width: 0.55rem; height: 0.8rem; background: var(--cyan); }
.dropout--three { top: 38%; left: -3px; width: 1.2rem; height: 0.55rem; }
.dropout--four { right: 8%; bottom: -3px; width: 0.7rem; height: 0.55rem; background: var(--red); }

.signal-sensitive.is-dropping-packets .dropout {
  opacity: 1;
}

.signal-sensitive.is-dropping-packets .screen-noise i:nth-child(2n + 1) {
  display: block;
}

.boot-panel {
  padding: 1rem 1.25rem;
  border: 3px solid var(--cyan);
  background: var(--panel-deep);
}

.boot-heading-row,
.boot-message-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.boot-heading-row h2,
.boot-heading-row span,
.boot-message-row p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 900;
}

.boot-heading-row h2,
.boot-heading-row span {
  color: var(--cyan);
}

.load-track {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: clamp(0.2rem, 0.6vw, 0.55rem);
  margin: 0.75rem 0;
}

.load-track i {
  height: clamp(1rem, 2vw, 1.45rem);
  border: 2px solid var(--green);
  background: transparent;
}

.load-track i.is-loaded {
  background: var(--green);
}

.load-track i.is-problem {
  border-color: var(--yellow);
  background: var(--yellow);
}

.boot-message-row p:first-child {
  color: var(--green);
}

.boot-note {
  color: var(--muted);
}

.holding-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0.85rem clamp(1rem, 4vw, 3.5rem) 1.2rem;
  border-top: 2px dashed var(--cyan);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.holding-footer p {
  margin: 0;
}

.packet-field {
  position: fixed;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.packet {
  position: absolute;
  left: var(--packet-x);
  top: var(--packet-y);
  width: var(--packet-w);
  height: var(--packet-h);
  opacity: 0;
  background: var(--packet-colour);
}

.packet.is-visible {
  opacity: 0.9;
}

@keyframes cursor-blink {
  0%, 72% { opacity: 1; }
  73%, 100% { opacity: 0; }
}

@media (max-width: 850px) {
  .holding-panel {
    grid-template-columns: 1fr;
  }

  .holding-copy {
    display: grid;
    justify-items: start;
  }

  .standfirst {
    max-width: 62ch;
  }
}

@media (max-width: 600px) {
  .holding-header {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.9rem 0.75rem;
  }

  .tnaf-logo {
    width: 5.4rem;
    height: 3.5rem;
    font-size: 1.45rem;
  }

  .brand-name {
    font-size: 1.08rem;
    overflow-wrap: anywhere;
  }

  .brand-description {
    font-size: 0.59rem;
  }

  .channel {
    display: none;
  }

  .status-strip {
    display: grid;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  main {
    padding: 1rem 0.75rem 1.5rem;
  }

  .holding-panel {
    gap: 1.25rem;
    padding: 0.9rem;
    box-shadow: none;
  }

  h1 {
    font-size: clamp(4rem, 22vw, 6rem);
  }

  .machine-screen {
    min-height: 16rem;
  }

  .screen-mark span {
    width: clamp(3.4rem, 18vw, 5rem);
  }

  .machine-screen::after {
    box-shadow: none;
  }

  .boot-panel {
    padding: 0.8rem;
  }

  .boot-message-row,
  .holding-footer {
    display: grid;
  }

  .load-track {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }
}
