:root {
  color-scheme: dark;
  --screen: #070806;
  --screen-soft: #11110d;
  --panel: rgba(12, 13, 10, 0.72);
  --amber: #f2b85b;
  --amber-dim: #a97736;
  --paper: #e8ddc7;
  --muted: #8f8a7d;
  --warning: #d66c53;
  --cyan: #8eb6ae;
  --line: rgba(242, 184, 91, 0.26);
  --glow: 0 0 18px rgba(242, 184, 91, 0.18);
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 49% 48%, rgba(69, 63, 47, 0.22), transparent 40%),
    linear-gradient(135deg, #0d0e0b 0%, #040504 56%, #0e100c 100%);
  color: var(--paper);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.workstation {
  width: 100vw;
  min-height: 100svh;
  padding: 0;
}

.crt {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025), transparent 16%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    var(--screen);
  box-shadow:
    inset 0 0 110px rgba(0, 0, 0, 0.84),
    inset 0 0 24px rgba(242, 184, 91, 0.12);
}

.crt::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(242, 184, 91, 0.12);
  opacity: 0.85;
}

.noise,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.noise {
  opacity: 0.055;
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 1px),
    radial-gradient(circle at 80% 60%, #fff 0 1px, transparent 1px),
    radial-gradient(circle at 42% 82%, #fff 0 1px, transparent 1px);
  background-size: 37px 41px, 59px 53px, 83px 79px;
  animation: staticDrift 0.34s steps(2) infinite;
}

.scanlines {
  opacity: 0.18;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.62) 4px,
    rgba(0, 0, 0, 0.62) 5px
  );
}

.system-bar {
  position: relative;
  z-index: 1;
  height: 72px;
  padding: 17px 24px 14px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 7, 0.74);
  color: var(--amber);
  text-shadow: var(--glow);
}

.system-bar strong,
.system-bar span {
  display: block;
}

.system-bar strong {
  font-size: clamp(0.94rem, 1.5vw, 1.16rem);
  letter-spacing: 0;
}

.system-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.status-cluster {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  text-align: right;
}

.status-cluster span {
  margin: 0;
  color: var(--paper);
  opacity: 0.82;
}

.terminal-watermark {
  position: absolute;
  inset: 72px 0 0;
  display: grid;
  place-items: center;
  opacity: 0.095;
  color: var(--paper);
  pointer-events: none;
}

.async-mark {
  width: min(56vw, 520px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  transform: rotate(-9deg);
  font-size: clamp(2.5rem, 9vw, 7.4rem);
  font-weight: 700;
}

.async-mark span {
  display: none;
}

.async-mark span:first-child {
  display: block;
}

.diagram {
  position: absolute;
  width: min(78vw, 780px);
  height: min(42vw, 420px);
  border: 1px solid currentColor;
  transform: translateY(22px) skewX(-8deg);
}

.diagram span {
  position: absolute;
  border: 1px solid currentColor;
}

.diagram span:nth-child(1) {
  inset: 8% 12% 16% 14%;
}

.diagram span:nth-child(2) {
  inset: 19% 22% 31% 43%;
}

.diagram span:nth-child(3) {
  width: 48%;
  left: 6%;
  top: 52%;
}

.diagram span:nth-child(4) {
  height: 70%;
  left: 65%;
  top: 10%;
}

.boot-screen,
.terminal {
  position: relative;
  z-index: 1;
  height: calc(100% - 72px);
  padding: clamp(18px, 3vw, 34px);
}

.boot-screen pre,
.output {
  margin: 0;
  color: var(--amber);
  text-shadow: var(--glow);
  white-space: pre-wrap;
}

.boot-screen pre {
  font-size: clamp(0.96rem, 1.6vw, 1.28rem);
  line-height: 1.62;
}

.terminal {
  display: flex;
  flex-direction: column;
  background: rgba(5, 6, 4, 0.2);
}

.hidden {
  display: none;
}

.output {
  flex: 1;
  overflow: auto;
  padding-right: 8px;
  font-size: clamp(0.86rem, 1.24vw, 1rem);
  line-height: 1.5;
  scrollbar-color: var(--amber-dim) transparent;
}

.output-entry {
  margin-bottom: 18px;
}

.prompt {
  color: var(--paper);
}

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

.warning {
  color: var(--warning);
}

.accent {
  color: var(--cyan);
}

.record {
  display: grid;
  gap: 6px;
}

.record-title {
  color: var(--paper);
  font-weight: 700;
}

.record-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 3px;
  max-width: 780px;
}

.record-grid span:nth-child(odd) {
  color: var(--muted);
}

.window-layer {
  position: absolute;
  inset: 72px 0 0;
  z-index: 3;
  pointer-events: none;
}

.archive-window {
  position: absolute;
  width: min(720px, calc(100vw - 44px));
  max-height: min(660px, calc(100svh - 118px));
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  border: 1px solid rgba(242, 184, 91, 0.56);
  background: #11110d;
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.68),
    0 0 22px rgba(242, 184, 91, 0.1),
    inset 0 0 0 1px rgba(232, 221, 199, 0.06);
}

.active-window {
  border-color: rgba(242, 184, 91, 0.88);
}

.window-titlebar {
  min-height: 34px;
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: stretch;
  border-bottom: 1px solid rgba(242, 184, 91, 0.42);
  background:
    repeating-linear-gradient(90deg, rgba(242, 184, 91, 0.08) 0 1px, transparent 1px 7px),
    #181710;
  color: var(--paper);
  cursor: move;
  user-select: none;
}

.window-titlebar div {
  min-width: 0;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.window-titlebar strong {
  color: var(--amber);
  white-space: nowrap;
}

.window-titlebar span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.window-close {
  width: 34px;
  border: 0;
  border-left: 1px solid rgba(242, 184, 91, 0.38);
  background: transparent;
  color: var(--amber);
  cursor: pointer;
}

.window-close:hover,
.window-close:focus-visible {
  outline: 0;
  background: rgba(214, 108, 83, 0.26);
  color: var(--paper);
}

.window-content {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  scrollbar-color: var(--amber-dim) transparent;
}

.document-page {
  position: relative;
  min-height: 440px;
  padding: clamp(20px, 3.4vw, 38px);
  overflow: hidden;
  background:
    linear-gradient(rgba(48, 43, 31, 0.06), rgba(12, 11, 8, 0.04)),
    #ded0b4;
  color: #1f1b15;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.45;
  text-shadow: none;
}

.document-page::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(31, 27, 21, 0.28);
  pointer-events: none;
}

.document-page::after {
  content: "A";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(31, 27, 21, 0.06);
  font-family: "Courier New", Courier, monospace;
  font-size: 16rem;
  font-weight: 700;
  pointer-events: none;
}

.document-stamp {
  position: absolute;
  right: clamp(22px, 3vw, 38px);
  top: clamp(70px, 8vw, 96px);
  z-index: 1;
  border: 2px solid rgba(114, 31, 24, 0.62);
  color: rgba(114, 31, 24, 0.74);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  padding: 6px 12px;
  transform: rotate(-7deg);
}

.document-header,
.document-grid,
.document-section,
.document-footer,
.document-media {
  position: relative;
  z-index: 1;
}

.document-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(31, 27, 21, 0.7);
}

.document-header p {
  margin: 0 0 7px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem;
}

.document-header h1 {
  margin: 0;
  max-width: 480px;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.document-header strong {
  align-self: flex-start;
  border: 1px solid rgba(31, 27, 21, 0.52);
  padding: 5px 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

.document-grid {
  margin: 18px 0 22px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.83rem;
}

.document-grid span:nth-child(odd) {
  font-weight: 700;
}

.document-section {
  margin-top: 18px;
}

.document-section h2 {
  margin: 0 0 7px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.84rem;
  text-transform: uppercase;
}

.document-section p {
  margin: 0;
}

.document-section ul {
  margin: 0;
  padding-left: 20px;
}

.document-section li + li {
  margin-top: 7px;
}

.document-footer {
  margin-top: 30px;
  padding-top: 10px;
  border-top: 1px solid rgba(31, 27, 21, 0.44);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.72rem;
}

.document-media {
  margin-top: 18px;
  width: min(520px, 100%);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 1px solid rgba(31, 27, 21, 0.42);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 4px),
    #171815;
  color: var(--paper);
  font-family: "Courier New", Courier, monospace;
  text-align: center;
}

.document-media a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 184, 91, 0.45);
}

.command-line {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding-top: 14px;
  border-top: 1px solid rgba(242, 184, 91, 0.18);
  color: var(--paper);
}

#commandInput {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--amber);
  caret-color: var(--amber);
  text-shadow: var(--glow);
}

.vhs-file {
  margin-top: 10px;
  width: min(640px, 100%);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 221, 199, 0.22);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px),
    linear-gradient(135deg, rgba(28, 31, 28, 0.94), rgba(5, 6, 5, 0.94));
  color: var(--paper);
  text-align: center;
}

.vhs-file a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 184, 91, 0.45);
}

@keyframes staticDrift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(2px, -1px);
  }
}

@media (max-width: 720px) {
  .workstation {
    min-height: 100svh;
    padding: 0;
  }

  .crt {
    min-height: 100svh;
    height: 100svh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .system-bar {
    height: auto;
    min-height: 86px;
    align-items: flex-start;
    flex-direction: column;
  }

  .status-cluster {
    justify-content: flex-start;
    text-align: left;
  }

  .terminal-watermark {
    inset: 86px 0 0;
  }

  .window-layer {
    inset: 86px 0 0;
  }

  .boot-screen,
  .terminal {
    height: calc(100% - 86px);
  }

  .archive-window {
    left: 10px !important;
    top: 10px !important;
    width: calc(100vw - 20px);
    max-height: calc(100svh - 112px);
  }

  .window-titlebar {
    min-height: 38px;
    grid-template-columns: 1fr 40px;
  }

  .window-close {
    width: 40px;
  }

  .document-page {
    padding: 22px 18px;
  }

  .document-page::after {
    font-size: 9rem;
  }

  .document-stamp {
    position: static;
    width: max-content;
    margin: 12px 0;
    font-size: 0.92rem;
    transform: rotate(-4deg);
  }

  .document-header {
    display: block;
  }

  .document-header strong {
    display: inline-block;
    margin-top: 12px;
  }

  .document-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .document-grid span:nth-child(even) {
    margin-bottom: 8px;
  }

  .command-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .record-grid {
    grid-template-columns: 1fr;
    row-gap: 1px;
  }

  .record-grid span:nth-child(even) {
    margin-bottom: 7px;
  }
}
