:root {
  --bg: #05060d;
  --green: #39ff14;
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --yellow: #ffe600;
  --text: #b6ffcb;
  --font: "JetBrains Mono", "Fira Code", "Source Code Pro", "DejaVu Sans Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg) url("fundo.gif") center / cover no-repeat fixed;
  min-height: 100vh;
}

.bg-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(5,6,13,.25) 0%, rgba(5,6,13,.75) 100%);
}

/* ---------- header ---------- */
.site-header {
  position: relative; z-index: 2;
  padding: 22px 16px;
  text-align: center;
  background: rgba(5, 6, 13, .78);
  border-bottom: 2px solid var(--cyan);
  box-shadow: 0 0 18px rgba(0,240,255,.55), 0 4px 30px rgba(255,43,214,.25);
  backdrop-filter: blur(4px);
}
.site-header h1 {
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 2rem);
  letter-spacing: .08em;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan), 0 0 18px rgba(0,240,255,.7);
}

.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.glitch::before { color: var(--magenta); text-shadow: none; animation: glitch1 3.5s infinite steps(1); clip-path: inset(0 0 60% 0); }
.glitch::after  { color: var(--green);   text-shadow: none; animation: glitch2 3.5s infinite steps(1); clip-path: inset(60% 0 0 0); }
@keyframes glitch1 {
  0%, 92%, 100% { transform: translate(0); opacity: 0; }
  93% { transform: translate(-3px, 1px); opacity: .8; }
  96% { transform: translate(3px, -1px); opacity: .8; }
}
@keyframes glitch2 {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  91% { transform: translate(3px, 1px); opacity: .8; }
  95% { transform: translate(-3px, -1px); opacity: .8; }
}

/* ---------- CRT monitor ---------- */
.stage {
  position: relative; z-index: 1;
  display: flex; justify-content: center;
  padding: 28px 16px 48px;
}

.crt { width: min(960px, 100%); display: flex; flex-direction: column; align-items: center; }

.crt-bezel {
  width: 100%;
  padding: 34px 34px 14px;
  background: linear-gradient(145deg, #3a3d4a 0%, #22242d 45%, #15161c 100%);
  border-radius: 38px / 34px;
  border: 2px solid #4b4f61;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,.15),
    inset 0 -6px 12px rgba(0,0,0,.6),
    0 0 0 4px #0b0c11,
    0 0 40px rgba(0,240,255,.35),
    0 20px 60px rgba(0,0,0,.8);
}

.crt-screen {
  position: relative;
  height: clamp(420px, 68vh, 640px);
  display: flex; flex-direction: column;
  background: #02070a;
  border-radius: 28px / 24px;
  overflow: hidden;
  border: 3px solid #07090d;
  box-shadow:
    inset 0 0 60px rgba(57,255,20,.15),
    inset 0 0 8px #000,
    0 0 18px rgba(57,255,20,.25);
  animation: flicker 6s infinite;
}
@keyframes flicker {
  0%, 100% { filter: brightness(1); }
  47% { filter: brightness(1); }
  48% { filter: brightness(.93); }
  49% { filter: brightness(1.04); }
  50% { filter: brightness(1); }
}

.scanlines {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.22) 3px);
}
.vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,.05) 0%, rgba(0,0,0,0) 55%, rgba(0,0,0,.6) 100%);
  border-radius: inherit;
}

.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  background: rgba(10, 20, 25, .95);
  border-bottom: 1px solid rgba(0,240,255,.35);
  font-size: .78rem;
  color: #6aa;
  flex: 0 0 auto;
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.r { background: #ff4d6d; } .dot.y { background: #ffd23f; } .dot.g { background: #39ff14; }
.term-title { margin-left: 10px; color: var(--cyan); }

.term-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 22px 28px;
  font-size: clamp(.8rem, 1.5vw, 1rem);
  line-height: 1.6;
  color: var(--green);
  text-shadow: 0 0 5px rgba(57,255,20,.55);
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--green) #031;
}
.term-body::-webkit-scrollbar { width: 8px; }
.term-body::-webkit-scrollbar-thumb { background: var(--green); border-radius: 4px; }
.term-body::-webkit-scrollbar-track { background: #031; }

.line { margin: 0 0 .15em; white-space: pre-wrap; word-wrap: break-word; min-height: 1.6em; }
.line.prompt { color: var(--cyan); text-shadow: 0 0 6px rgba(0,240,255,.6); }
.line.label  { color: var(--yellow); text-shadow: 0 0 6px rgba(255,230,0,.5); margin-top: .6em; }
.line.heading { color: var(--magenta); text-shadow: 0 0 7px rgba(255,43,214,.6); margin-top: 1.1em; font-weight: bold; }
.line.heading + .line.heading { margin-top: 0; }
.line.title { color: var(--cyan); font-size: 1.15em; text-shadow: 0 0 8px rgba(0,240,255,.7); }
.line.bullet { padding-left: 1.6em; text-indent: -1.1em; color: var(--text); text-shadow: 0 0 3px rgba(182,255,203,.35); }
.line.text { color: var(--text); text-shadow: 0 0 3px rgba(182,255,203,.35); }

.menu-item {
  display: block; width: fit-content;
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--green); text-shadow: inherit;
  cursor: pointer; text-align: left; text-decoration: none;
}
.menu-item .num { color: var(--yellow); }
.menu-item:hover, .menu-item:focus-visible {
  color: #000; background: var(--green); text-shadow: none; outline: none;
}
.menu-item:hover .num, .menu-item:focus-visible .num { color: #000; }

a.mail { color: var(--cyan); text-decoration: none; border-bottom: 1px dashed var(--cyan); }
a.mail:hover { background: var(--cyan); color: #000; }

.back-btn {
  margin-top: 1.4em;
  font: inherit; font-weight: bold;
  color: var(--bg); background: var(--magenta);
  border: 0; padding: .45em 1.1em; cursor: pointer;
  box-shadow: 0 0 14px rgba(255,43,214,.7);
  text-shadow: none;
  letter-spacing: .05em;
}
.back-btn:hover, .back-btn:focus-visible { background: var(--cyan); box-shadow: 0 0 16px rgba(0,240,255,.8); outline: none; }

.cmd-line { display: flex; align-items: center; gap: .6em; margin-top: 1em; color: var(--cyan); }
.cmd-line input {
  flex: 1; background: transparent; border: 0; outline: none;
  font: inherit; color: var(--green); caret-color: var(--green);
  text-shadow: inherit; min-width: 0;
}
.cursor { display: inline-block; width: .6em; height: 1.1em; background: var(--green); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.crt-panel {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px 0;
  color: #7d8296; font-size: .75rem; letter-spacing: .25em;
}
.knobs { display: flex; align-items: center; gap: 10px; }
.knobs i { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #6b6f82, #1a1b22); border: 1px solid #000; }
.led { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green), 0 0 16px var(--green); animation: blink 3s steps(1) infinite; }

.crt-neck { width: 22%; height: 26px; background: linear-gradient(#1a1b22, #2b2d38 60%, #15161c); border-left: 2px solid #3a3d4a; border-right: 2px solid #3a3d4a; }
.crt-base { width: 42%; height: 16px; border-radius: 6px 6px 18px 18px; background: linear-gradient(#3a3d4a, #14151a); box-shadow: 0 10px 30px rgba(0,0,0,.7), 0 0 20px rgba(255,43,214,.25); border: 1px solid #4b4f61; }

@media (max-width: 640px) {
  .crt-bezel { padding: 16px 14px 8px; border-radius: 24px; }
  .crt-screen { border-radius: 16px; height: 70vh; }
  .term-body { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
