/* =====================================================
   Renato Almeida — cybersecurity portfolio
   Tema: dark, detalhes em verde (#00ff9d) + roxo azulado
   ===================================================== */

:root {
  --bg: #070b09;
  --bg-2: #0b110e;
  --bg-3: #101713;
  --panel: #0d1410;
  --border: rgba(0, 255, 157, 0.14);
  --border-strong: rgba(0, 255, 157, 0.35);
  --text: #d7e2dc;
  --text-dim: #8fa39a;
  --accent: #00ff9d;
  --accent-dim: rgba(0, 255, 157, 0.55);
  --violet: #7b6cff;
  --amber: #ffc857;
  --red: #ff5c5c;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 255, 157, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 90% 110%, rgba(123, 108, 255, 0.05), transparent);
}

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.hidden { display: none !important; }

::selection { background: rgba(0, 255, 157, 0.25); }

/* barra de scroll discreta */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1c2a22; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #2a4033; }

/* =====================================================
   BOOT OVERLAY
   ===================================================== */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #04070560;
  backdrop-filter: blur(2px);
  background: #040705;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity .8s ease;
}

.boot.fade-out { opacity: 0; pointer-events: none; }

.boot-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0 2px, rgba(0, 255, 157, 0.025) 2px 4px);
  animation: scan-drift 12s linear infinite;
}

@keyframes scan-drift {
  from { background-position-y: 0; }
  to { background-position-y: 120px; }
}

.boot-frame {
  width: min(760px, 96vw);
  background: #060a08;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(0, 255, 157, 0.08), 0 0 12px rgba(0, 255, 157, 0.08);
  overflow: hidden;
}

.boot-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #0a0f0c;
  border-bottom: 1px solid var(--border);
}

.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }

.boot-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
}

.boot-log {
  font-family: var(--mono);
  font-size: clamp(.72rem, 2vw, .88rem);
  color: #9ff5cf;
  padding: 22px 24px;
  min-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
}

.boot-log .ok { color: var(--accent); }
.boot-log .warn { color: var(--amber); }
.boot-log .dim { color: var(--text-dim); }
.boot-log .alert { color: var(--accent); font-weight: 700; text-shadow: 0 0 14px rgba(0,255,157,.7); }

.boot-cursor {
  display: inline-block;
  width: .55em; height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.boot-actions { padding: 0 24px 30px; text-align: center; }

.decrypt-btn {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent);
  background: rgba(0, 255, 157, 0.06);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 14px 34px;
  cursor: pointer;
  animation: pulse-glow 1.8s ease-in-out infinite;
  transition: background .2s, transform .15s;
}

.decrypt-btn:hover {
  background: rgba(0, 255, 157, 0.16);
  transform: translateY(-1px);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 157, 0.25); }
  50% { box-shadow: 0 0 26px rgba(0, 255, 157, 0.55); }
}

.boot-skip {
  position: absolute;
  bottom: 18px; right: 22px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: .78rem;
  cursor: pointer;
  opacity: .6;
}
.boot-skip:hover { color: var(--accent); opacity: 1; }

/* =====================================================
   NAV
   ===================================================== */

.site { animation: site-in .7s ease both; }
@keyframes site-in { from { opacity: 0; } to { opacity: 1; } }

/* chuva de código no fundo (muito subtil) */
#bg-matrix {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
}

main, .footer { position: relative; z-index: 1; }

/* revelação suave ao fazer scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .site, .decrypt-btn, .boot-scanlines { animation: none; }
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(1rem, 5vw, 3.5rem);
  background: rgba(7, 11, 9, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: .95rem;
}

.nav-links { display: flex; gap: clamp(.8rem, 2.5vw, 2rem); }

.nav-links a {
  font-family: var(--mono);
  font-size: .84rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: .8rem; }

.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: .78rem;
  cursor: pointer;
  color: var(--text-dim);
  transition: border-color .2s;
}
.lang-toggle:hover { border-color: var(--border-strong); }
.lang-toggle .lang-sep { opacity: .4; margin: 0 3px; }
.lang-toggle span[data-lang] { transition: color .2s; }
.lang-toggle span[data-lang].active { color: var(--accent); font-weight: 700; }

.nav-burger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  font-size: 1.3rem;
  padding: 2px 10px;
  cursor: pointer;
}

/* =====================================================
   HERO
   ===================================================== */

main { max-width: 1060px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

.hero { padding: clamp(4.5rem, 12vh, 8rem) 0 3.5rem; }

.hero-pre { font-size: .85rem; margin-bottom: 1rem; opacity: .9; }

.hero-name {
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
}

/* cursor de terminal a piscar no fim do nome */
.hero-name::after {
  content: "_";
  color: var(--accent);
  font-weight: 400;
  animation: blink 1.2s steps(1) infinite;
}

/* rotator de "roles" por baixo do nome */
.hero-roles {
  margin-top: .9rem;
  font-size: clamp(.9rem, 2.5vw, 1.1rem);
  color: var(--text);
  min-height: 1.5em;
}

.role-cursor {
  display: inline-block;
  width: .55em;
  height: 1.1em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

.hero-title {
  margin-top: .6rem;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  color: var(--text-dim);
  font-weight: 600;
}

.hero-tagline { margin-top: 1.1rem; max-width: 620px; color: var(--text-dim); }

.hero-location { margin-top: .8rem; font-size: .8rem; color: var(--text-dim); }
.hero-location::before { content: "▸ "; color: var(--accent); }

.hero-cta { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.btn {
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid var(--border-strong);
  display: inline-block;
}

.btn-solid {
  background: var(--accent);
  color: #04140c;
  border-color: var(--accent);
}
.btn-solid:hover { box-shadow: 0 0 22px rgba(0, 255, 157, 0.45); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: rgba(0, 255, 157, 0.08); }

.hero-links { display: flex; gap: .8rem; margin-top: 2rem; flex-wrap: wrap; }

.hero-links a {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  transition: all .2s;
}
.hero-links a:hover { color: var(--accent); border-color: var(--border-strong); }
.hero-links a::before { content: "↗ "; color: var(--accent); }

/* =====================================================
   SECÇÕES
   ===================================================== */

.section { padding: 4rem 0; border-top: 1px dashed rgba(0, 255, 157, 0.1); }

.section-title {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 700;
  margin-bottom: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
}

.about-bio { color: var(--text-dim); font-size: 1.02rem; white-space: pre-line; }

.skill-group { margin-bottom: 1.2rem; }

.skill-group h3 {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: .5rem;
}

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }

.chip {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
}

/* ---------- formação académica (timeline) ---------- */

.edu-list {
  position: relative;
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.edu-list::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-dim), rgba(123, 108, 255, 0.35));
}

.edu-item { position: relative; }

.edu-item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.35);
}

.edu-item:last-child::before { border-color: var(--violet); box-shadow: 0 0 10px rgba(123, 108, 255, 0.35); }

.edu-item h3 { font-size: 1.05rem; font-weight: 600; }

.edu-inst { color: var(--text-dim); font-size: .9rem; }

.edu-date {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--accent);
  display: inline-block;
  margin: .25rem 0;
}

.edu-details { color: var(--text-dim); font-size: .88rem; max-width: 640px; }

/* ---------- projetos ---------- */

.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.8rem; }

.filter {
  font-family: var(--mono);
  font-size: .78rem;
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all .2s;
}
.filter:hover { color: var(--accent); }
.filter.active { color: #04140c; background: var(--accent); border-color: var(--accent); font-weight: 700; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 18px rgba(0, 255, 157, 0.07);
}

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }

.card h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.35; }

.badge {
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge.completed { color: var(--accent); background: rgba(0, 255, 157, 0.1); border: 1px solid rgba(0, 255, 157, 0.35); }
.badge.in-progress { color: var(--amber); background: rgba(255, 200, 87, 0.08); border: 1px solid rgba(255, 200, 87, 0.35); }
.badge.planned { color: var(--violet); background: rgba(123, 108, 255, 0.1); border: 1px solid rgba(123, 108, 255, 0.4); }

.card-date { font-family: var(--mono); font-size: .72rem; color: var(--text-dim); }

.card p.desc { font-size: .9rem; color: var(--text-dim); flex-grow: 1; }

.card .chips { margin-top: auto; }

.card-media-hint {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent-dim);
}
.card-media-hint::before { content: "▶ "; }

.card-thumb {
  width: calc(100% + 2.8rem);
  margin: -1.4rem -1.4rem 0;
  border-radius: 9px 9px 0 0;
  aspect-ratio: 16/8;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.empty-note { font-family: var(--mono); color: var(--text-dim); font-size: .85rem; }

/* ---------- certificados ---------- */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.2rem;
}

.cert-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: border-color .2s, transform .2s;
}
.cert-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.cert-card h3 { font-size: .98rem; font-weight: 600; line-height: 1.4; }
.cert-issuer { font-size: .82rem; color: var(--text-dim); }
.cert-desc { font-size: .82rem; color: var(--text-dim); margin-top: .2rem; }
.cert-date { font-family: var(--mono); font-size: .74rem; color: var(--text-dim); }

.cert-thumb {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: .4rem;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.cert-link {
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: .3rem;
}
.cert-link:hover { text-decoration: underline; }

/* ---------- contacto ---------- */

.contact-wrap { max-width: 640px; }

.contact-note { color: var(--text-dim); margin-bottom: 1.6rem; }

.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .8rem;
  color: var(--accent);
}

.contact-form input,
.contact-form textarea {
  font-family: var(--mono);
  font-size: .92rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.08);
}

.contact-form .btn { align-self: flex-start; }

.contact-status { font-size: .8rem; min-height: 1.2em; }
.contact-status.ok { color: var(--accent); }
.contact-status.err { color: var(--red); }

/* =====================================================
   MODAL
   ===================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 7, 5, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 255, 157, 0.1);
}

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: .95rem;
  padding: 4px 10px;
  cursor: pointer;
}
.modal-close:hover { color: var(--red); border-color: var(--red); }

.modal-box h3 { font-size: 1.4rem; margin-bottom: .3rem; padding-right: 2.5rem; }

.modal-meta { display: flex; gap: .8rem; align-items: center; margin: .4rem 0 1rem; flex-wrap: wrap; }

.modal-video { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--border); border-radius: 8px; margin: 1rem 0; background: #000; }
.modal-video iframe, .modal-video video { width: 100%; height: 100%; border: 0; border-radius: 8px; }

.modal-img { width: 100%; border-radius: 8px; border: 1px solid var(--border); margin: 1rem 0; }

.modal-details {
  white-space: pre-line;
  color: var(--text-dim);
  font-size: .95rem;
  margin: 1rem 0;
}

.modal-links { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }

.modal-subtitle {
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 1.6rem;
  margin-bottom: .6rem;
}
.modal-subtitle::before { content: "// "; opacity: .6; }

/* galeria de imagens do projeto */
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .6rem;
  margin: .6rem 0 1rem;
}

.modal-gallery img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: zoom-in;
  transition: transform .2s, border-color .2s;
}
.modal-gallery img:hover { transform: scale(1.04); border-color: var(--border-strong); }

/* arquitetura (diagrama ascii + imagem) */
.arch-box {
  background: #060a08;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: .6rem 0;
}

.arch-box pre {
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.5;
  color: #9ff5cf;
}

.arch-img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: .6rem 0;
  cursor: zoom-in;
}

/* lightbox de imagem */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(4, 7, 5, 0.93);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
  animation: site-in .25s ease both;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0, 255, 157, 0.15);
}

/* =====================================================
   FOOTER
   ===================================================== */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2rem clamp(1rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  font-size: .75rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.footer-admin {
  color: rgba(143, 163, 154, 0.4);
  text-decoration: none;
  transition: color .2s;
}
.footer-admin:hover { color: var(--accent); }

/* =====================================================
   RESPONSIVO
   ===================================================== */

@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 1rem clamp(1rem, 5vw, 3.5rem);
    gap: 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-burger { display: block; }
  .about-grid { grid-template-columns: 1fr; }
  .boot-log { min-height: 260px; }
}
