:root {
  --bg: #020402;
  --panel: rgba(5, 12, 6, 0.68);
  --panel-strong: rgba(10, 18, 10, 0.82);
  --line: #2cff72;
  --line-soft: rgba(44, 255, 114, 0.28);
  --text: #d6ffd6;
  --muted: #8cbe95;
  --warning: #ffcf57;
  --danger: #ff5e5e;
  --shadow: 0 0 0 1px rgba(44, 255, 114, 0.25), 0 24px 60px rgba(0, 0, 0, 0.55);
  --chrome: #b7c8d8;
  --chrome-dark: #627587;
  --chrome-edge: #edf5fc;
  --btn-face: #d8e4ee;
  --btn-shadow: #4e6274;
  --btn-highlight: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: #000;
  color: var(--text);
  font-family: "Tahoma", "Verdana", sans-serif;
  overflow-x: hidden;
  cursor: crosshair;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}

body::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04) 0,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.18;
  animation: scanlines 12s linear infinite;
}

body::after {
  border: 1px solid rgba(44, 255, 114, 0.15);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.42);
}

a,
button {
  color: inherit;
}

button {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

.crt-shell {
  position: relative;
  background: #000;
}

.boot-sequence {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: #020502;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.boot-sequence.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.xp-dialog,
.dossier {
  border: 1px solid #5e7488;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.xp-dialog--boot {
  width: min(560px, calc(100vw - 2rem));
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  background: linear-gradient(90deg, #1a3550 0%, #6d87a0 100%);
  color: #f7fbff;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.window-controls {
  display: inline-flex;
  gap: 0.3rem;
}

.window-controls i {
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid #dfeaf5;
  background: #b8c9d9;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #577086;
}

.window-body {
  padding: 1rem;
  background: rgba(2, 10, 4, 0.74);
}

.dialog-title,
.lead,
h1,
h2 {
  margin: 0;
  font-family: "Impact", "Arial Black", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dialog-copy,
.dialog-foot,
.eyebrow,
.terminal,
.evidence-list,
.meta-list,
.archive-list,
.topbar__brand,
.topbar__nav a,
.system-btn,
.site-footer__copy,
.site-footer__links a,
.bottom-ticker,
.warning-blink {
  font-family: "Courier New", monospace;
}

.dialog-copy,
.dialog-foot,
.lead,
p,
li {
  line-height: 1.45;
}

.dialog-foot,
.eyebrow,
.site-footer__copy {
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.loading-bar {
  height: 16px;
  border: 1px solid #8aa1b4;
  background: #081109;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(
    90deg,
    #19d54f 0,
    #19d54f 14px,
    #4bff82 14px,
    #4bff82 22px
  );
}

.loading-bar--large {
  margin: 1rem 0 0.75rem;
  height: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: rgba(8, 14, 9, 0.94);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__brand {
  color: var(--line);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(44, 255, 114, 0.5);
}

.topbar__nav,
.topbar__actions,
.cta-row,
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.topbar__nav a,
.site-footer__links a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
}

.system-btn {
  position: relative;
  padding: 0.75rem 1rem;
  border: 1px solid #586e81;
  background: var(--btn-face);
  color: #0a190d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 1px 1px 0 var(--btn-highlight), inset -1px -1px 0 var(--btn-shadow), 0 0 12px rgba(44, 255, 114, 0.12);
  transition: transform 0.15s steps(2), filter 0.15s steps(2), box-shadow 0.15s steps(2);
  cursor: pointer;
}

.system-btn:hover,
.system-btn:focus-visible {
  transform: translate(-1px, -1px);
  filter: brightness(1.02);
  box-shadow: inset 1px 1px 0 var(--btn-highlight), inset -1px -1px 0 var(--btn-shadow), 0 0 16px rgba(44, 255, 114, 0.35);
  animation: flicker 0.2s steps(2) 2;
}

.system-btn:active {
  transform: translate(1px, 1px);
  box-shadow: inset -1px -1px 0 var(--btn-highlight), inset 1px 1px 0 var(--btn-shadow);
}

.system-btn--primary {
  background: #caecd6;
}

.scene {
  position: relative;
  min-height: clamp(640px, 48vw, 860px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: #000;
  overflow: hidden;
}

.scene__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.scene__content {
  position: relative;
  z-index: 3;
  width: min(1440px, 100%);
  display: grid;
  gap: 0.8rem;
  padding: clamp(0.35rem, 1vw, 0.8rem);
}

.scene__content--hero {
  position: absolute;
  inset: clamp(0.75rem, 1.5vw, 1.25rem);
  width: auto;
  grid-template-columns: minmax(320px, 0.88fr) minmax(220px, 0.4fr);
  grid-template-rows: auto 1fr auto;
  align-items: start;
  align-content: space-between;
}

.hero-card .window-body,
.dossier .window-body {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.hero-card {
  max-width: 540px;
}

h1 {
  font-size: clamp(4rem, 12vw, 9rem);
  color: #f0fff0;
  text-shadow: 0 0 18px rgba(44, 255, 114, 0.2);
}

h2 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  color: #f0fff0;
}

.lead {
  margin: 0.25rem 0 0.9rem;
  color: var(--warning);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.stack,
.overlay-grid,
.analysis-grid,
.recovery-grid,
.forensics-row {
  display: grid;
  gap: 1rem;
}

.stack--status {
  align-content: start;
  gap: 0.7rem;
  justify-self: end;
  width: min(260px, 100%);
}

.mini-window strong,
.quote {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  color: #f7ff8f;
}

.overlay-grid {
  grid-column: 1 / -1;
  align-self: end;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

#evidence .mini-window .window-body {
  padding: 0.7rem 0.8rem;
}

#evidence .mini-window p,
#evidence .hero-card p,
#evidence .evidence-list li,
#evidence .terminal {
  font-size: 0.92rem;
}

#evidence .hero-card .window-body {
  padding: 0.9rem 1rem;
}

#evidence h1 {
  font-size: clamp(3.8rem, 9vw, 7rem);
  line-height: 0.88;
}

#evidence .lead {
  margin-bottom: 0.7rem;
}

#evidence .terminal {
  min-height: 96px;
}

#evidence .terminal-panel .window-body,
#evidence .evidence-panel .window-body {
  padding: 0.72rem 0.82rem;
}

#analysis .scene__content,
#recovery .scene__content {
  position: absolute;
  inset: clamp(0.75rem, 1.5vw, 1.25rem);
  width: auto;
  align-content: space-between;
}

#analysis .dossier,
#recovery .dossier {
  max-width: 760px;
  background: rgba(5, 12, 6, 0.62);
}

#analysis .dossier .window-body,
#recovery .dossier .window-body {
  padding: 0.9rem 1rem;
}

#analysis .analysis-grid,
#recovery .recovery-grid {
  justify-self: end;
  width: min(860px, 100%);
  gap: 0.75rem;
}

#analysis .forensics-row,
#recovery .terminal-panel--wide {
  width: min(960px, 100%);
}

#analysis .forensics-row {
  justify-self: start;
}

#recovery .terminal-panel--wide {
  justify-self: start;
}

#analysis .panel-card .window-body,
#recovery .archive-window .window-body,
#recovery .terminal-panel--wide .window-body,
#analysis .terminal-panel--wide .window-body,
#analysis .scan-box .window-body {
  padding: 0.72rem 0.82rem;
}

#analysis .panel-card p,
#recovery .archive-window p,
#recovery .archive-list li,
#analysis .meta-list li,
#analysis .panel-card li,
#analysis .terminal,
#recovery .terminal {
  font-size: 0.9rem;
}

.terminal {
  min-height: 180px;
  color: var(--line);
  font-size: 0.79rem;
  white-space: pre-line;
}

.terminal span {
  display: block;
  opacity: 0;
  animation: typeIn 0.25s steps(2) forwards;
}

.evidence-list,
.meta-list,
.archive-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text);
}

.analysis-grid,
.recovery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-card,
.archive-window,
.scan-box,
.terminal-panel {
  min-height: 100%;
}

.metadata-box {
  grid-column: span 2;
}

.forensics-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.terminal-panel--wide .terminal {
  min-height: 220px;
}

.scan-frame {
  position: relative;
  min-height: 180px;
  border: 1px solid var(--line-soft);
  background: rgba(5, 20, 8, 0.38);
  overflow: hidden;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(44, 255, 114, 0.9);
  box-shadow: 0 0 18px rgba(44, 255, 114, 0.7);
  animation: scan 3s linear infinite;
}

.evidence-tag {
  position: absolute;
  padding: 0.25rem 0.4rem;
  border: 1px solid #f7ff8f;
  color: #f7ff8f;
  font-size: 0.74rem;
  background: rgba(0, 0, 0, 0.6);
}

.evidence-tag--a {
  top: 1rem;
  left: 1rem;
}

.evidence-tag--b {
  right: 1rem;
  bottom: 1rem;
}

.warning-blink {
  margin: 0.9rem 0 0;
  color: var(--danger);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  animation: blink 1.2s steps(2) infinite;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1rem 4.6rem;
  border-top: 1px solid var(--line-soft);
  background: #030703;
}

.site-footer__title {
  margin: 0;
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer__copy {
  margin: 0.2rem 0 0;
}

.bottom-ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  overflow: hidden;
  border-top: 1px solid #44634c;
  background: #041208;
  color: #f7ff8f;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bottom-ticker__track {
  display: flex;
  gap: 2rem;
  width: max-content;
  padding: 0.7rem 0;
  animation: ticker 28s linear infinite;
}

.popup-layer {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

.popup {
  position: absolute;
  width: min(320px, calc(100vw - 2rem));
  animation: popupIn 0.22s steps(2), popupOut 0.4s ease 5.2s forwards;
}

.popup .window-body {
  background: rgba(11, 16, 11, 0.96);
}

.popup p {
  margin: 0 0 0.6rem;
}

.cursor-trail {
  position: fixed;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border: 1px solid rgba(44, 255, 114, 0.65);
  background: rgba(44, 255, 114, 0.12);
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: screen;
}

.glitching {
  animation: glitchFlash 0.16s steps(2) 2;
}

@media (max-width: 1100px) {
  .analysis-grid,
  .recovery-grid,
  .forensics-row,
  .overlay-grid {
    grid-template-columns: 1fr;
  }

  .scene__content--hero {
    position: relative;
    inset: auto;
    width: min(1440px, 100%);
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-content: start;
  }

  #evidence .hero-card {
    max-width: 720px;
  }

  #evidence .overlay-grid {
    align-self: auto;
  }

  #analysis .scene__content,
  #recovery .scene__content {
    position: relative;
    inset: auto;
    width: min(1440px, 100%);
    align-content: start;
  }

  #analysis .analysis-grid,
  #recovery .recovery-grid,
  #analysis .forensics-row,
  #recovery .terminal-panel--wide {
    width: auto;
    justify-self: stretch;
  }

  .metadata-box {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar__nav,
  .topbar__actions {
    width: 100%;
  }

  .topbar__actions .system-btn {
    flex: 1 1 180px;
  }

  .scene {
    min-height: auto;
    padding-top: 5.5rem;
    padding-bottom: 5rem;
  }

  .scene__content--hero {
    position: relative;
    inset: auto;
    width: min(1440px, 100%);
  }

  h1 {
    font-size: clamp(3rem, 22vw, 5rem);
  }

  h2 {
    font-size: clamp(2rem, 12vw, 3.4rem);
  }

  .window-body {
    padding: 0.9rem;
  }

  #evidence .hero-card .window-body {
    padding: 0.9rem;
  }

  #evidence .hero-card p,
  #evidence .mini-window p,
  #evidence .evidence-list li,
  #evidence .terminal {
    font-size: 0.88rem;
  }

  .bottom-ticker {
    font-size: 0.72rem;
  }
}

@keyframes scanlines {
  from { transform: translateY(0); }
  to { transform: translateY(6px); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes scan {
  from { top: 0; }
  to { top: calc(100% - 3px); }
}

@keyframes typeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popupIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popupOut {
  to { opacity: 0; transform: translateY(16px); }
}

@keyframes glitchFlash {
  0%, 100% { transform: translateX(0); filter: none; }
  33% { transform: translateX(-2px); filter: contrast(1.1); }
  66% { transform: translateX(2px); filter: saturate(1.1); }
}
