/* Estilos globais e reset */
:root {
  --hero-color: #00ff00;
  --hero-shadow: rgba(0, 255, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: #0a0a0a;
  color: #e0e0e0;

  font-family: "Space Mono", monospace;
  overflow-x: hidden;
}

/* Efeito de fogo (Doom) */
#doom-fire-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: auto;
  opacity: 0.25;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.content-layer {
  position: relative;
  z-index: 10;
  pointer-events: none !important;
}

.terminal-box {
  pointer-events: auto;
  background: rgba(15, 15, 15, 0.88);
  border: 1px solid #2a2a2a;
  box-shadow: 0 0 15px var(--hero-shadow);
  position: relative;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

/* Parafusos de fixação nos cantos (Hardware Mounting Bolts) */
.terminal-box::before,
.terminal-box::after {
  content: "+";
  position: absolute;
  font-family: monospace;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  color: #444;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  pointer-events: none;
  z-index: 20;
}

.terminal-box::before {
  top: 6px;
  left: 8px;
}

.terminal-box::after {
  top: 6px;
  right: 8px;
}

.terminal-box:hover {
  border-color: color-mix(in srgb, var(--hero-color) 40%, #2a2a2a);
  box-shadow: 0 0 25px var(--hero-shadow);
}

.terminal-box:hover::before,
.terminal-box:hover::after {
  color: var(--hero-color);
  text-shadow: 0 0 6px var(--hero-shadow);
}

/* Barra de Chassi de Servidor / Rack Superior */
.rack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 14px 6px 14px;
  margin-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: #666;
  user-select: none;
}

.rack-unit-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #888;
  font-weight: bold;
}

.rack-unit-tag span {
  color: var(--hero-color);
}

.rack-vent-grill {
  letter-spacing: 2px;
  opacity: 0.3;
  color: #888;
  font-family: monospace;
}

.rack-led-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rack-led-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: #666;
}

.led-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
  display: inline-block;
  transition: all 0.3s ease;
}

.led-dot.led-pwr {
  background: var(--hero-color);
  box-shadow: 0 0 6px var(--hero-color);
}

.led-dot.led-link {
  background: #00d9ff;
  box-shadow: 0 0 6px #00d9ff;
}

.led-dot.led-bus {
  background: var(--hero-color);
  box-shadow: 0 0 6px var(--hero-color);
  animation: led-pulse 2s infinite ease-in-out;
}

@keyframes led-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ========================================= */
/* SSH TUNNEL / WARP TRANSITION OVERLAY      */
/* ========================================= */
#ssh-tunnel-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#ssh-tunnel-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#ssh-tunnel-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ssh-hud-container {
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: 'Space Mono', monospace;
  color: var(--hero-color);
  text-shadow: 0 0 10px var(--hero-shadow);
  padding: 20px;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid var(--hero-color);
  box-shadow: 0 0 30px var(--hero-shadow);
  max-width: 500px;
  width: 90%;
}

.ssh-hud-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.ssh-hud-progress {
  font-size: 0.8rem;
  color: #00d9ff;
  letter-spacing: 1px;
}

/* Classes de texto reutilizáveis */
.prompt-line {
  color: var(--hero-color);
  transition: color 0.5s ease;
}

.cyan-text {
  color: #00d9ff;
}

/* === NOVA ARTE BLOCKY (SVG) & PIXEL TEXT === */
.block-art {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 0;
  line-height: 0;
}

/* Classe para o texto dentro do SVG (Press Start 2P) */
.pixel-text {
  font-family: 'Press Start 2P', cursive;
  font-size: 32px;
  text-transform: uppercase;
}

/* [NOVO] Classe para o Logo Principal (Orbitron Black) */
.tech-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 64px;
  text-transform: uppercase;
  letter-spacing: 6px;
}

/* Camada da Sombra (Fundo) */
.art-shadow {
  fill: var(--hero-shadow);
  transition: fill 0.5s ease;
}

/* Camada do Corpo (Frente) */
.art-body {
  fill: var(--hero-color);
  transition: fill 0.5s ease;
  filter: drop-shadow(0 0 4px var(--hero-color));
}

/* Hover Effect nos SVGs */
.block-art:hover {
  cursor: pointer;
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

/* === MENU PRINCIPAL (RACK-01) === */
.header-menu {
  display: flex;
  gap: 8px;
  font-family: "Space Mono", monospace;
}

.menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid #2a2a2a;
  background: rgba(255, 255, 255, 0.02);
  color: #999;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.menu-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #444;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.menu-item:hover:not(.is-disabled),
.menu-item:focus-visible:not(.is-disabled) {
  border-color: var(--hero-color);
  color: var(--hero-color);
  background: color-mix(in srgb, var(--hero-color) 8%, transparent);
  box-shadow: 0 0 15px var(--hero-shadow);
}

.menu-item:hover:not(.is-disabled) .menu-item-dot,
.menu-item:focus-visible:not(.is-disabled) .menu-item-dot {
  background: var(--hero-color);
  box-shadow: 0 0 6px var(--hero-color);
}

.menu-item.is-disabled {
  color: #555;
  cursor: not-allowed;
  opacity: 0.7;
}

.menu-item-tag {
  font-size: 0.55rem;
  letter-spacing: 1px;
  color: #777;
  border: 1px solid #333;
  padding: 1px 5px;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .header-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .menu-item {
    padding: 12px 8px;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
  }
}

/* Classe aplicada via JS aos SVGs quando ocorre glitch */
.glitch-effect {
  animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

@keyframes glitch-skew {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-2px, 2px);
  }

  40% {
    transform: translate(-2px, -2px);
  }

  60% {
    transform: translate(2px, 2px);
  }

  80% {
    transform: translate(2px, -2px);
  }

  100% {
    transform: translate(0);
  }
}

/* Animação do cursor piscando */
.blink {
  animation: blink-anim 1s infinite;
}

.footer-push-down {
  margin-top: auto;
}

@keyframes blink-anim {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* Cores do VIM (Syntax Highlighting) */
.vim-comment {
  color: #666;
  font-style: italic;
}

.vim-keyword {
  color: #c586c0;
}

.vim-variable {
  color: #00d9ff;
}

.vim-string {
  color: #ce9178;
}

/* ========================================= */
/*               VFX GLOBAIS                 */
/* ========================================= */

/* Scanline (Linhas de TV CRT) */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.1),
      rgba(0, 0, 0, 0.1) 1px,
      transparent 1px,
      transparent 2px);
  pointer-events: none;
  z-index: 100;
}

/* Overlay Container do Glitch */
.glitch-overlay {
  position: fixed;
  /* CRÍTICO: Isso impede que empurre o site para baixo */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
  opacity: 0;
}

/* Blocos individuais do Glitch */
.glitch-block {
  position: absolute;
  background: var(--hero-color);
  mix-blend-mode: screen;
}

@keyframes glitch-anim {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  20% {
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  40% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

.glitch-active {
  animation: glitch-anim 0.3s ease-out;
}

/* ========================================= */
/* UI POLISH (App-like Feel)                 */
/* ========================================= */

body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.post-content,
.vim-content,
.vim-command,
.blog-tree {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  cursor: auto;
}

img,
svg {
  -webkit-user-drag: none;
  user-drag: none;
}

::-webkit-scrollbar {
  width: 8px;
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border: 1px solid #00ff00;
}

/* MASCOT LOGO (Luminance Mask) */
.mascot-logo {
  /* Define a cor de fundo dinâmica */
  background-color: var(--hero-color);

  /* A Mágica: Usa a imagem como recorte */
  -webkit-mask-image: url('../img/bode-cloud.png');
  /* Caminho da sua imagem */
  mask-image: url('../img/bode-cloud.png');

  /* Ajustes da máscara */
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;

  /* Efeito de brilho interno para parecer neon */
  filter: drop-shadow(0 0 5px var(--hero-color));

  transition: background-color 0.5s ease, filter 0.5s ease;
}

/* Opcional: Glitch no Bode também */
.mascot-logo.glitch-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
  opacity: 0;
}

/* ========================================= */
/* MASCOT WATERMARK (Marca D'água do Bode)   */
/* ========================================= */

.watermark-style {
  width: 80vw;
  height: 80vw;
  max-width: 600px;
  max-height: 600px;
  opacity: 0.07;

  -webkit-mask-position: center;
  mask-position: center;
}

.watermark-style.glitch-effect {
  filter: drop-shadow(5px 0 0px rgba(255, 0, 0, 0.2)) drop-shadow(-5px 0 0px rgba(0, 255, 255, 0.2));
}

/* ========================================= */
/* RUST FERRIS COMPILER CURSOR               */
/* ========================================= */
#ferris-cursor-container {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  will-change: transform;
}

.ferris-sprite {
  fill: rgba(15, 15, 15, 0.95);
  stroke: var(--hero-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
  transform-origin: center;
}

.ferris-sprite .f-eye {
  fill: var(--hero-color);
  stroke: none;
  transition: fill 0.3s ease;
}

.ferris-sprite.compiling {
  stroke: #00d9ff;
  animation: ferris-jiggle 0.1s infinite;
}

.ferris-sprite.compiling .f-eye {
  fill: #00d9ff;
}

@keyframes ferris-jiggle {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 1px) rotate(-1deg); }
  75% { transform: translate(-1px, -1px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.ferris-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 900;
  color: #00d9ff;
  text-shadow: 0 0 5px #00d9ff;
  opacity: 1;
  transform: translateY(0) scale(0.5);
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
  will-change: transform, opacity;
}