/* =========================================================
   r1g0d // portfólio
   Preto puro, branco-fósforo, vermelho sinal.
   Ciano aparece só no rasgo RGB do glitch e no foco.
   ========================================================= */

:root {
  --void: #000000;
  --phos: #E6E3DA;   /* branco-fósforo: texto principal */
  --dim: #8F8B82;    /* texto secundário (contraste > 5:1 no preto) */
  --line: #2B2A28;   /* bordas e divisórias */
  --sig: #FF1E3C;    /* vermelho sinal: ação, alerta, identidade */
  --cyan: #19E6FF;   /* rasgo RGB do glitch e foco */
  --amber: #FFB000;  /* estado "filtered" / em andamento */

  --f-crt: "VT323", "Courier New", monospace;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: 2.75rem;

  --wrap: 72rem;
  --gut: clamp(1rem, 4vw, 2.5rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--void);
  color: var(--phos);
  font-family: var(--f-mono);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color 320ms ease;
}

::selection { background: var(--sig); color: var(--void); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

h1, h2, h3 { margin: 0; font-weight: 400; }

h2 {
  font-family: var(--f-crt);
  font-size: clamp(2rem, 8vw, var(--step-3));
  line-height: 1.05;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: var(--step-0);
  font-weight: 700;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--sig);
  color: var(--void);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; }

/* ---------- MATRIX CANVAS (MODO ROOT) ---------- */
.matrix-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 700ms ease;
}
body.is-root .matrix-bg {
  opacity: 0.2;
}
body.no-anim .matrix-bg {
  display: none !important;
}

/* ---------- CRT: scanlines + vinheta ---------- */
.crt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 50;
  background:
    url("../assets/grain.svg"),
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.25) 100%);
}

.crt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -25vh;
  height: 25vh;
  background: linear-gradient(to bottom, transparent, rgba(230, 227, 218, 0.05), transparent);
  animation: roll 6s linear infinite;
}
@keyframes roll { to { transform: translateY(150vh); } }

/* ---------- BOOT ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--void);
  padding: var(--gut);
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
}
.js .boot { display: flex; }
.no-boot .boot { display: none !important; }
.boot__log {
  margin: 0;
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--phos);
  white-space: pre-wrap;
  max-width: 60rem;
}
.boot__log .ok { color: var(--phos); }
.boot__log .err { color: var(--sig); }
.boot__skip {
  color: var(--dim);
  font-size: var(--step--1);
  margin: 1.5rem 0 0;
}
.boot.is-out {
  animation: boot-out 380ms steps(4) forwards;
}
@keyframes boot-out {
  0%   { clip-path: inset(0 0 0 0); }
  40%  { clip-path: inset(30% 0 40% 0); transform: translateX(-8px); }
  70%  { clip-path: inset(48% 0 48% 0); transform: translateX(6px); }
  100% { clip-path: inset(50% 0 50% 0); visibility: hidden; }
}

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem var(--gut);
  background: var(--void);
  border-bottom: 1px solid var(--line);
  transition: border-color 320ms ease, box-shadow 320ms ease;
}
.topbar__id {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--f-crt);
  font-size: var(--step-2);
  line-height: 1;
}
.topbar__root-tag {
  display: none;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--void);
  background: var(--sig);
  padding: 0.15rem 0.4rem;
  letter-spacing: 0.04em;
}
body.is-root .topbar__root-tag {
  display: inline-block;
}
.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
  font-size: var(--step--1);
}
.lang {
  --c: 9px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  padding: 1px;
  background: var(--line);
  clip-path: polygon(var(--c) 0, 100% 0, 100% 100%, calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.lang::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--void);
  clip-path: polygon(calc(var(--c) - 0.59px) 0, 100% 0, 100% 100%, calc(100% - var(--c) + 0.59px) 100%, 0 100%, 0 calc(var(--c) - 0.59px));
}
.lang:focus-within { clip-path: none; }
.lang button:first-child { clip-path: polygon(calc(var(--c) - 0.59px) 0, 100% 0, 100% 100%, 0 100%, 0 calc(var(--c) - 0.59px)); }
.lang button:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - var(--c) + 0.59px) 100%, 0 100%); }
.lang button:focus-visible { clip-path: none; }
.lang button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--f-mono);
  font-size: var(--step--1);
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  line-height: 1.2;
}
.lang button:last-child { border-right: 0; }
.lang button:hover { color: var(--phos); }
.lang button[aria-pressed="true"] {
  background: var(--sig);
  color: var(--void);
  font-weight: 700;
}
.topbar__anim {
  --c: 8px;
  --bc: var(--line);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bc);
  border: 0;
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  color: var(--dim);
  font-family: var(--f-mono);
  font-size: var(--step--1);
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  line-height: 1.2;
  transition: color 140ms;
}
.topbar__anim::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--void);
  clip-path: polygon(calc(var(--c) - 0.59px) 0, 100% 0, 100% calc(100% - var(--c) + 0.59px), calc(100% - var(--c) + 0.59px) 100%, 0 100%, 0 calc(var(--c) - 0.59px));
}
.topbar__anim:hover {
  --bc: var(--phos);
  color: var(--phos);
}
.topbar__anim:focus-visible { clip-path: none; }
.btn-anim__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--sig);
  display: inline-block;
  box-shadow: 0 0 5px var(--sig);
}
.topbar__nav a {
  text-decoration: none;
  color: var(--dim);
  transition: color 140ms;
}
.topbar__nav a:hover { color: var(--phos); }
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.topbar__menu-btn {
  display: none;
}

@media (max-width: 820px) {
  .topbar {
    justify-content: space-between;
    gap: 0.75rem;
  }
  .topbar__actions {
    margin-left: auto;
    gap: 0.5rem;
  }
  .topbar__menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--phos);
    font-family: var(--f-mono);
    font-size: var(--step--1);
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    line-height: 1;
    transition: border-color 140ms, color 140ms, background 140ms;
  }
  .topbar__menu-btn:hover,
  .topbar__menu-btn[aria-expanded="true"] {
    border-color: var(--sig);
    color: var(--sig);
    background: rgba(255, 30, 60, 0.08);
  }
  .topbar__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--sig);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85);
    padding: 1.25rem var(--gut);
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin: 0;
    z-index: 50;
  }
  .topbar__nav.is-open {
    display: flex;
    animation: menu-down 180ms ease-out forwards;
  }
  @keyframes menu-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .topbar__nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--step-0);
    padding: 0.75rem 0.5rem;
    color: var(--phos);
    border-bottom: 1px dashed var(--line);
  }
  .topbar__nav a::before {
    content: ">";
    color: var(--sig);
    font-weight: 700;
  }
  .topbar__nav a:hover,
  .topbar__nav a:focus {
    color: var(--sig);
    padding-left: 0.85rem;
    background: rgba(255, 30, 60, 0.06);
  }
  .lang { align-self: flex-start; margin: 0.25rem 0 0.5rem; }
  .lang button { padding: 0.5rem 0.85rem; font-size: var(--step-0); }
  .topbar__nav .topbar__anim {
    align-self: flex-start;
    padding: 0.5rem 0.85rem;
    font-size: var(--step-0);
    margin: 0.25rem 0 0.5rem;
    border-color: var(--line);
    width: 100%;
    justify-content: flex-start;
  }
}

/* ---------- BOTÕES ---------- */
/* Botões com dois cantos cortados. A borda é a cor de fundo do botão (--bc) e
   o miolo (--fill) é uma camada 1px menor, para a diagonal também ter borda. */
.btn {
  --c: 10px;
  --bc: var(--phos);
  --fill: var(--void);
  --cut: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  --cut-in: polygon(calc(var(--c) - 0.59px) 0, 100% 0, 100% calc(100% - var(--c) + 0.59px), calc(100% - var(--c) + 0.59px) 100%, 0 100%, 0 calc(var(--c) - 0.59px));
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 0;
  background: var(--bc);
  clip-path: var(--cut);
  font-family: var(--f-mono);
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--phos);
  cursor: pointer;
  transition: color 120ms;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--fill);
  clip-path: var(--cut-in);
  transition: background 120ms;
}
.btn:hover { --fill: var(--phos); color: var(--void); }
.btn--solid {
  --bc: var(--sig);
  --fill: var(--sig);
  color: var(--void);
  font-weight: 700;
}
.btn--solid:hover { --bc: var(--phos); }
/* o corte esconderia o contorno de foco: com foco, o botão volta a ser reto */
.btn:focus-visible { clip-path: none; }
.btn__short { display: none; }
@media (max-width: 420px) {
  .btn__long { display: none; }
  .btn__short { display: inline; }
}

/* ---------- LAYOUT DE SEÇÃO ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.sec {
  padding: 5rem 0 2rem;
  border-top: 1px solid var(--line);
  transition: border-color 320ms ease;
}
.sec__cmd {
  color: var(--sig);
  font-size: var(--step--1);
  margin: 0 0 0.75rem;
}
.sec__lead {
  color: var(--dim);
  margin: 0 0 2.5rem;
  max-width: 60ch;
}

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 4rem);
  padding: 3rem 0 4rem;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
}

.hero__name { container-type: inline-size; min-width: 0; }
.hero__pre {
  color: var(--dim);
  font-size: var(--step--1);
  margin: 0 0 0.25rem;
}
.hero__real {
  font-size: var(--step-1);
  margin: 0.5rem 0 1rem;
}
.hero__role {
  color: var(--dim);
  max-width: 42ch;
  margin: 0 0 1.5rem;
}
.hero__status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--step--1);
  margin: 0;
}
.dot {
  width: 0.6rem;
  height: 0.6rem;
  background: var(--sig);
  animation: blink 1.2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- GLITCH (o nome) ---------- */
.glitch {
  position: relative;
  font-family: var(--f-crt);
  font-size: clamp(3.5rem, 26cqi, 11rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--phos);
  animation: jitter 3.2s infinite steps(1);
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.glitch::before {
  color: var(--sig);
  transform: translate(-3px, 0);
  animation: tear-a 3.2s infinite steps(1);
}
.glitch::after {
  color: var(--cyan);
  transform: translate(3px, 0);
  animation: tear-b 3.2s infinite steps(1);
}
@keyframes jitter {
  0%, 62%, 72%, 86%, 100% { transform: none; }
  63% { transform: translate(3px, -1px) skewX(-7deg); }
  65% { transform: translate(-4px, 1px) skewX(6deg); }
  68% { transform: translate(2px, 0) skewX(-3deg); }
  87% { transform: translate(4px, 0); }
}
@keyframes tear-a {
  0%, 62%, 100% { transform: translate(-3px, 0); clip-path: inset(0 0 0 0); }
  63% { transform: translate(-14px, 0); clip-path: inset(8% 0 62% 0); }
  65% { transform: translate(10px, 0); clip-path: inset(55% 0 18% 0); }
  67% { transform: translate(-7px, 2px); clip-path: inset(30% 0 45% 0); }
  69% { transform: translate(16px, 0); clip-path: inset(76% 0 4% 0); }
  71% { transform: translate(-3px, 0); clip-path: inset(0 0 0 0); }
  86% { transform: translate(-10px, 0); clip-path: inset(20% 0 55% 0); }
  88% { transform: translate(-3px, 0); clip-path: inset(0 0 0 0); }
}
@keyframes tear-b {
  0%, 62%, 100% { transform: translate(3px, 0); clip-path: inset(0 0 0 0); }
  64% { transform: translate(14px, 0); clip-path: inset(42% 0 33% 0); }
  66% { transform: translate(-11px, 0); clip-path: inset(4% 0 82% 0); }
  68% { transform: translate(8px, -2px); clip-path: inset(66% 0 8% 0); }
  70% { transform: translate(-15px, 0); clip-path: inset(18% 0 58% 0); }
  72% { transform: translate(3px, 0); clip-path: inset(0 0 0 0); }
  87% { transform: translate(11px, 0); clip-path: inset(50% 0 25% 0); }
  89% { transform: translate(3px, 0); clip-path: inset(0 0 0 0); }
}
.glitch.is-hit,
.glitch.is-hit::before,
.glitch.is-hit::after { animation-duration: 0.6s; }

/* títulos de seção */
.glitch-h { position: relative; }
.glitch-h::before,
.glitch-h::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.glitch-h::before { color: var(--sig); }
.glitch-h::after { color: var(--cyan); }
.glitch-h.is-glitching::before { animation: h-tear-a 0.5s steps(1); }
.glitch-h.is-glitching::after { animation: h-tear-b 0.5s steps(1); }
@keyframes h-tear-a {
  0%   { opacity: 1; transform: translate(-6px, 0); clip-path: inset(0 0 55% 0); }
  25%  { opacity: 1; transform: translate(5px, 0); clip-path: inset(40% 0 20% 0); }
  50%  { opacity: 1; transform: translate(-4px, 0); clip-path: inset(70% 0 0 0); }
  75%  { opacity: 1; transform: translate(3px, 0); clip-path: inset(10% 0 60% 0); }
  100% { opacity: 0; transform: none; }
}
@keyframes h-tear-b {
  0%   { opacity: 1; transform: translate(6px, 0); clip-path: inset(50% 0 10% 0); }
  25%  { opacity: 1; transform: translate(-5px, 0); clip-path: inset(5% 0 70% 0); }
  50%  { opacity: 1; transform: translate(4px, 0); clip-path: inset(25% 0 45% 0); }
  75%  { opacity: 1; transform: translate(-3px, 0); clip-path: inset(65% 0 5% 0); }
  100% { opacity: 0; transform: none; }
}

/* quadro inteiro "rasga" por um instante */
.is-frame-hit main { animation: frame-hit 0.22s steps(2) 1; }
@keyframes frame-hit {
  0%   { transform: translateX(-5px); filter: drop-shadow(4px 0 var(--sig)) drop-shadow(-4px 0 var(--cyan)); }
  50%  { transform: translateX(6px) skewX(-1.5deg); filter: drop-shadow(-5px 0 var(--sig)) drop-shadow(5px 0 var(--cyan)); }
  100% { transform: none; filter: none; }
}

.topbar__id span:first-of-type { text-shadow: 2px 0 rgba(255, 30, 60, 0.7), -2px 0 rgba(25, 230, 255, 0.55); }

/* ---------- TERMINAL ---------- */
.term {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color 320ms ease, box-shadow 320ms ease;
}
.term__bar {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--dim);
}
.term__flags { color: var(--sig); }
.term__flags.is-root { color: var(--void); background: var(--sig); padding: 0 0.45rem; font-weight: 700; }

.term__out {
  height: 22rem;
  overflow-y: auto;
  padding: 0.9rem;
  font-size: var(--step--1);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-color: var(--line) transparent;
}
.term__out:focus-visible { outline-offset: -2px; }
.term__out p { margin: 0; }
.term__out .cmd { color: var(--phos); }
.term__out .cmd::before { content: "r1g0d@kali:~$ "; color: var(--sig); }
.term__out .cmd--root::before { content: "root@r1g0d:~# "; color: var(--sig); font-weight: 700; }
.t-dim { color: var(--dim); }
.t-red { color: var(--sig); }
.t-cyan { color: var(--cyan); }
.t-amber { color: var(--amber); }

/* ---------- TERMINAL: ALERTA DE INTRUSÃO ---------- */
.term.is-taunt {
  border-color: var(--sig);
  box-shadow: 0 0 0 1px var(--sig), 0 0 28px rgba(255, 30, 60, 0.35);
  animation: taunt-shake 0.45s linear 2;
}
.term__out .taunt-bar { color: var(--amber); }
@keyframes taunt-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.term__out a { color: var(--phos); text-decoration-color: var(--sig); }

.term__in {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
}
.term__prompt { color: var(--sig); white-space: nowrap; }
.term__in input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--phos);
  font: inherit;
  caret-color: var(--sig);
}
.term__in input:focus { outline: none; }
.term__in:focus-within { box-shadow: inset 0 0 0 2px var(--cyan); }

.term__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.8rem 0.9rem 0.9rem;
  border-top: 1px solid var(--line);
}
.term__hint {
  width: 100%;
  color: var(--dim);
  font-size: var(--step--1);
}
.term__quick button {
  font: inherit;
  font-size: var(--step--1);
  color: var(--phos);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.term__quick button::before { content: "[ "; color: var(--sig); }
.term__quick button::after { content: " ]"; color: var(--sig); }
.term__quick button:hover { border-color: var(--sig); }
.term__quick-root {
  display: none;
  border-color: var(--sig) !important;
}
body.is-root .term__quick-root {
  display: inline-block;
}

/* ---------- KILL CHAIN ---------- */
.chain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  counter-reset: phase;
}
.chain__step {
  position: relative;
  padding: 2rem 1.25rem 0 0;
  counter-increment: phase;
}
.chain__step::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 0;
  right: 0;
  border-top: 2px solid var(--sig);
}
.chain__step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1rem;
  height: 1rem;
  background: var(--sig);
}
.chain__step.is-active::before { border-top-style: dashed; }
.chain__step.is-active::after {
  background: var(--void);
  border: 2px solid var(--sig);
  animation: blink 1.2s steps(1) infinite;
}
.chain__step.is-active::before { border-top-color: var(--amber); }
.chain__step.is-active::after { border-color: var(--amber); }
.chain__step.is-active .chain__phase { color: var(--amber); }
.chain__step:not(.is-done):not(.is-active)::before { border-top: 2px dashed var(--line); }
.chain__step:not(.is-done):not(.is-active)::after { background: var(--void); border: 2px solid var(--dim); }

.chain__phase {
  display: block;
  font-family: var(--f-crt);
  font-size: clamp(1.1rem, 1.7vw, 1.5rem);
  line-height: 1;
  color: var(--sig);
  margin-bottom: 0.4rem;
}
.chain__phase::before { content: counter(phase) ". "; color: var(--dim); }
.chain__step:not(.is-done):not(.is-active) .chain__phase { color: var(--dim); }
.chain__step h3 { margin-bottom: 0.4rem; }
.chain__step p { margin: 0; color: var(--dim); font-size: var(--step--1); }

@media (max-width: 900px) {
  .chain__phase { font-size: var(--step-2); }
  .chain { grid-template-columns: 1fr; }
  .chain__step { padding: 0 0 2rem 2rem; }
  .chain__step::before {
    top: 0; bottom: 0; left: 0.45rem; right: auto;
    border-top: 0;
    border-left: 2px solid var(--sig);
  }
  .chain__step.is-active::before { border-left-style: dashed; border-left-color: var(--amber); border-top: 0; }
  .chain__step:not(.is-done):not(.is-active)::before { border-top: 0; border-left: 2px dashed var(--line); }
}

/* ---------- LOG DE MISSÕES ---------- */
.log { display: grid; gap: 2.5rem; margin-top: 2rem; }
.log__entry {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 1.5rem;
}
.log__ts { margin: 0; color: var(--sig); font-size: var(--step--1); }
.log__role { margin: 0.1rem 0 0.6rem; color: var(--dim); }
.log__entry ul, .edu ul {
  margin: 0;
  padding-left: 1.1rem;
  max-width: 70ch;
}
.log__entry li::marker, .edu li::marker { content: "> "; color: var(--sig); }
.log__entry li + li { margin-top: 0.35rem; }

@media (max-width: 600px) {
  .term__out { height: 15rem; }
}

@media (max-width: 700px) {
  .log__entry { grid-template-columns: 1fr; gap: 0.3rem; }
}

.edu {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px dashed var(--line);
}
.edu h3 { margin-bottom: 0.8rem; }
.edu li + li { margin-top: 0.35rem; }

/* ---------- FINDINGS ---------- */
.finding {
  border: 1px solid var(--line);
  border-left: 4px solid var(--sig);
  background: rgba(0, 0, 0, 0.85);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  max-width: 52rem;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.finding--info { border-left-color: var(--dim); }
.finding--med { border-left-color: var(--amber); }
.finding__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: var(--step--1);
  margin-bottom: 0.75rem;
}
.finding__id { color: var(--dim); }
.sev { padding: 0 0.5rem; }
.sev--high { background: var(--sig); color: var(--void); font-weight: 700; }
.sev--info { border: 1px solid var(--dim); color: var(--dim); }
.sev--med { border: 1px solid var(--amber); color: var(--amber); }
.finding h3 {
  font-family: var(--f-crt);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.finding > p { margin: 0 0 1.25rem; max-width: 65ch; }
.finding__meta { margin: 0 0 1.25rem; display: grid; gap: 0.6rem; }
.finding__meta div {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  font-size: var(--step--1);
}
.finding__meta dt { color: var(--sig); }
.finding__meta dd { margin: 0; color: var(--dim); }
@media (max-width: 560px) {
  .finding__meta div { grid-template-columns: 1fr; gap: 0; }
}
.finding__poc {
  margin: 0 0 1.25rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--dim);
  overflow-x: auto;
}

/* ---------- SCAN ---------- */
.scan {
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  max-width: 52rem;
}
.scan__row {
  display: grid;
  grid-template-columns: 6.5rem 5.5rem 8rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.scan__row--head { color: var(--dim); }
.st-open { color: var(--sig); }
.st-filt { color: var(--amber); }
@media (max-width: 600px) {
  .scan__row { grid-template-columns: 5.5rem 5rem minmax(0, 1fr); gap: 0.25rem 0.75rem; }
  .scan__row > span:last-child { grid-column: 1 / -1; color: var(--dim); }
  .scan__row--head > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- CONTATO ---------- */
.sec--contact { padding-bottom: 5rem; }
.contact { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- FOOTER & EASTER EGG PLANETA ---------- */
.foot {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 3rem var(--gut) 4rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: var(--step--1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.planet-egg {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--sig);
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
  transition: border-color 160ms, background 160ms, transform 160ms;
  color: inherit;
  width: fit-content;
  max-width: 100%;
}
.planet-egg:hover,
.planet-egg:focus-visible {
  border-color: var(--sig);
  background: rgba(255, 30, 60, 0.06);
  transform: translateY(-2px);
}
.planet-svg {
  flex-shrink: 0;
  display: block;
}
.planet-ring {
  transform-origin: 32px 32px;
  animation: planet-spin 9s linear infinite;
}
@keyframes planet-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.planet-title {
  margin: 0 0 0.15rem;
  font-family: var(--f-crt);
  font-size: var(--step-1);
  color: var(--phos);
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.planet-sub {
  margin: 0;
  font-size: var(--step--1);
  color: var(--dim);
}
.foot__copy {
  margin: 0;
  color: var(--dim);
}

/* ---------- BOTÃO VOLTAR AO TOPO ---------- */
.btn-top {
  position: fixed;
  bottom: 2rem;
  right: var(--gut);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--f-mono);
  font-size: var(--step--1);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease, border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.btn-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-top:hover,
.btn-top:focus-visible {
  border-color: var(--sig);
  color: var(--phos);
  background: rgba(255, 30, 60, 0.1);
  transform: translateY(-2px);
}

.btn-top__icon {
  color: var(--sig);
  font-size: 0.75rem;
  transition: transform 140ms ease;
}

.btn-top:hover .btn-top__icon {
  transform: translateY(-2px);
}

/* ---------- OVERLAY PÓS-ROOT: SISTEMA COMPROMETIDO ---------- */
.breach {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gut);
}
.breach[hidden] {
  display: none;
}
.breach__box {
  width: 100%;
  max-width: 44rem;
  border: 2px solid var(--sig);
  background: var(--void);
  box-shadow: 0 0 50px rgba(255, 30, 60, 0.4), inset 0 0 24px rgba(255, 30, 60, 0.12);
  padding: 1.5rem;
  animation: breach-in 260ms steps(3) forwards;
}
@keyframes breach-in {
  0%   { opacity: 0; transform: scale(0.96) translateX(-6px); }
  50%  { opacity: 1; transform: scale(1.01) translateX(4px); }
  100% { opacity: 1; transform: none; }
}
.breach__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--step--1);
}
.breach__tag {
  color: var(--sig);
  font-weight: 700;
}
.breach__timer {
  color: var(--dim);
}
.breach__log {
  margin: 0;
  font-family: var(--f-mono);
  font-size: var(--step--1);
  line-height: 1.65;
  color: var(--phos);
  white-space: pre-wrap;
}
.breach__log .b-ok { color: var(--phos); }
.breach__log .b-sig { color: var(--sig); font-weight: 700; }
.breach__cta {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--sig);
  animation: menu-down 240ms ease-out forwards;
}
.breach__cta[hidden] {
  display: none;
}
.breach__title {
  font-family: var(--f-crt);
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  color: var(--sig);
  letter-spacing: 0.03em;
  text-shadow: 2px 0 var(--phos), -2px 0 rgba(255, 30, 60, 0.6);
  margin-bottom: 0.6rem;
}
.breach__desc {
  margin: 0 0 1.4rem;
  color: var(--phos);
  font-size: var(--step--1);
  max-width: 58ch;
}
.breach__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.breach__btn-close {
  --bc: var(--line);
  color: var(--dim);
}
.breach__btn-close:hover {
  --bc: var(--sig);
  --fill: var(--void);
  color: var(--sig);
}

/* ---------- ROOT OVERRIDE (TODAS AS FLAGS CONQUISTADAS) ---------- */
body.is-root {
  --line: #52131E;
  --dim: #B59E9A;
}
body.is-root .crt {
  background:
    repeating-linear-gradient(to bottom, rgba(255, 30, 60, 0.045) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 52%, rgba(255, 30, 60, 0.16) 100%);
}
body.is-root .topbar {
  border-bottom-color: var(--sig);
  box-shadow: 0 2px 24px rgba(255, 30, 60, 0.22);
}
body.is-root .glitch::before,
body.is-root .glitch::after {
  animation-duration: 1.2s;
}
body.is-root .term {
  border-color: var(--sig);
  box-shadow: 0 0 28px rgba(255, 30, 60, 0.2);
}
body.is-root .term__title {
  color: var(--sig);
  font-weight: 700;
}
body.is-root .term__prompt {
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 30, 60, 0.65);
}
body.is-root .finding {
  box-shadow: -3px 0 18px rgba(255, 30, 60, 0.12);
}

/* ---------- PREFERÊNCIA DO SISTEMA: MENOS MOVIMENTO ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .crt::after { display: none; }
}

/* ---------- MODO SEM ANIMAÇÃO (TOGGLE MANUAL DO USUÁRIO) ---------- */
body.no-anim,
body.no-anim * {
  animation: none !important;
  transition: none !important;
}
body.no-anim .crt::after {
  display: none !important;
}
body.no-anim .topbar__anim .btn-anim__dot {
  background: var(--dim);
  box-shadow: none;
}
body.no-anim .topbar__anim {
  color: var(--dim);
  border-color: var(--line);
}
body.no-anim .glitch::before,
body.no-anim .glitch::after {
  opacity: 0.25 !important;
  transform: none !important;
}