/* Monitor CRT — versão animada. Medidas conforme handoff/README.md, seção B.
   Herda tokens e a fonte de style.css. */

body.crt {
  height: 100vh;
  overflow: hidden;
  background: #02040a;
}

/* O overlay CRT global de style.css já cobre a página; aqui a tela tem o seu. */
body.crt::after {
  display: none;
}

.scene {
  position: relative;
  height: 100vh;
  overflow: hidden;
  padding: clamp(10px, 1.6vw, 22px);
}

/* Cenário: linhas ao fundo, grade em perspectiva no chão, halo central. */
.bg-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgb(74 222 128 / 0.06) 1px, transparent 1px);
  background-size: 100% 40px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 70%, transparent);
}

@keyframes floatGrid {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 120px;
  }
}

.floor {
  position: absolute;
  left: 50%;
  bottom: -6vh;
  width: 220vw;
  height: 46vh;
  transform: translateX(-50%) perspective(700px) rotateX(76deg);
  transform-origin: bottom center;
  background-image: linear-gradient(rgb(74 222 128 / 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgb(74 222 128 / 0.16) 1px, transparent 1px);
  background-size: 120px 120px;
  animation: floatGrid 6s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
  mask-image: linear-gradient(180deg, transparent, #000 60%);
}

.halo {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 50% at 50% 42%,
    rgb(74 222 128 / 0.1),
    transparent 70%
  );
}

/* Aparelho */
.monitor {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes flicker {
  0%,
  96%,
  100% {
    opacity: 1;
  }
  97% {
    opacity: 0.96;
  }
  98% {
    opacity: 1;
  }
  99% {
    opacity: 0.98;
  }
}

.bezel {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 2vw, 30px) clamp(12px, 1.4vw, 20px) clamp(10px, 1.2vw, 16px);
  border: 1px solid #1b2620;
  border-radius: clamp(16px, 2vw, 28px);
  background: linear-gradient(#14181c, #0a0d10 60%, #05070a);
  box-shadow: 0 0 0 1px rgb(74 222 128 / 0.06),
    0 40px 90px -44px rgb(74 222 128 / 0.3),
    inset 0 1px 0 rgb(255 255 255 / 0.05);
}

.screen {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #05080b;
  box-shadow: inset 0 0 110px rgb(74 222 128 / 0.08),
    inset 0 0 24px rgb(0 0 0 / 0.9);
  animation: flicker 7s linear infinite;
}

.screen-bar {
  flex: none;
  margin: 0;
  padding: 13px clamp(24px, 4vw, 56px);
  background: #080c0f;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}

.screen-bar span[aria-hidden] {
  color: #4f6b5b;
}

.screen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(26px, 3.4vw, 46px) clamp(24px, 4vw, 56px) clamp(30px, 3.6vw, 52px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Camadas de vidro por cima do conteúdo */
.scan,
.glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scan {
  background: repeating-linear-gradient(
    180deg,
    rgb(74 222 128 / 0.04) 0 1px,
    transparent 1px 5px
  );
}

.glass {
  background: radial-gradient(
    120% 80% at 20% -12%,
    rgb(255 255 255 / 0.06),
    transparent 58%
  );
}

/* ---------- Conteúdo da tela ---------- */

.line-cmd {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 19px);
  color: var(--text-hi);
  word-break: break-word;
}

.line-cmd .host {
  color: var(--accent);
  text-shadow: 0 0 14px rgb(74 222 128 / 0.5);
}

.cursor2 {
  display: inline-block;
  width: 10px;
  height: 1.05em;
  margin-left: 6px;
  background: var(--accent);
  vertical-align: -2px;
  box-shadow: 0 0 12px rgb(74 222 128 / 0.6);
  animation: blink 1.1s step-end infinite;
}

.line-loading {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim);
}

.crt-name {
  margin: 6px 0 0;
  font-size: clamp(30px, 5.6vw, 58px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-hi);
  text-shadow: 0 0 26px rgb(74 222 128 / 0.22);
}

.crt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.crt-badges b {
  color: var(--accent);
  font-weight: 400;
}

.crt-bio {
  margin: 0;
  max-width: 74ch;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
}

.crt-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crt-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: auto;
  padding-top: 12px;
}

.open-btn {
  padding: 12px 20px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 0 26px rgb(74 222 128 / 0.35);
}

.open-btn:hover {
  background: var(--accent-hover);
  color: var(--bg);
}

.hint {
  font-size: 12.5px;
  color: var(--text-dim);
}

.crt-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
  font-size: 12.5px;
}

/* ---------- Base e pedestal ---------- */

.base {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 6px 2px;
}

.pwr {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #4f6b5b;
}

.pwr i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 10px rgb(74 222 128 / 0.8);
}

.crt-btn {
  padding: 5px 11px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: transparent;
  color: #5c7767;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
}

.crt-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pedestal {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
}

.pedestal span {
  height: 14px;
  width: min(300px, 40vw);
  border-radius: 99px;
  background: linear-gradient(#12171a, #0a0e11);
  box-shadow: 0 10px 26px -14px rgb(74 222 128 / 0.35);
}

.pedestal span:last-child {
  height: 12px;
  width: min(420px, 62vw);
}

/* ---------- Revelações do boot ---------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Só esconde quando o JS assume a animação. Sem JS, ou com movimento
   reduzido, o perfil aparece completo — nada depende da animação. */
#boot.booting .reveal {
  opacity: 0;
}

#boot.booting .reveal.shown {
  animation: fadeUp 0.35s ease both;
}
