/* =========================
   RESET / BASE
========================= */
*{ margin:0; padding:0; box-sizing:border-box; }
html{ scroll-behavior:smooth; }

:root{
  --bg: #07060b;
  --text: #f2f2f7;
  --muted: rgba(242,242,247,.86);

  --card: rgba(255,255,255,.06);
  --card-border: rgba(255,255,255,.10);

  --line: rgba(255,255,255,.12);
  --soft: rgba(255,255,255,.08);

  --accent: #a78bfa;            /* roxo sólido */
  --accent-soft: rgba(167,139,250,.22);

  --shadow: 0 14px 40px rgba(0,0,0,.28);
  --shadow-soft: 0 14px 40px rgba(0,0,0,.20);
}

body{
  font-family:"Montserrat",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x:hidden;
}

.container{
  width:min(1100px,92%);
  margin:0 auto;
}

.section{
  padding:90px 0;
  position:relative;
}

/* =========================
   NAVBAR (glass)
========================= */
header{ position:sticky; top:0; z-index:50; }

.navbar{
  width:min(1100px,92%);
  margin:14px auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:12px 14px;
  border-radius:18px;
  background: rgba(10,9,14,.55);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.logo img{ height:42px; width:auto; display:block; }

.nav-links{
  display:flex;
  list-style:none;
  gap:18px;
  align-items:center;
}

.nav-links a{
  color:inherit;
  text-decoration:none;
  font-weight:700;
  font-size:14px;
  opacity:.92;
  position:relative;
}

.nav-links a::after{
  content:"";
  position:absolute;
  left:0; bottom:-6px;
  width:0%;
  height:2px;
  border-radius:2px;
  background: var(--accent);
  transition: width .25s ease;
}
.nav-links a:hover::after{ width:100%; }

.nav-actions{ display:flex; align-items:center; gap:10px; }

.theme-toggle,
.hamburger{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: inherit;
  border-radius:12px;
  cursor:pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.theme-toggle{ padding:10px 12px; }
.theme-toggle:hover{ transform: translateY(-1px); background: rgba(255,255,255,.10); }

.hamburger{
  width:44px; height:40px;
  display:none;
  padding:10px;
}
.hamburger span{
  display:block;
  height:2px;
  background: currentColor;
  margin:5px 0;
  border-radius:2px;
}

/* =========================
   HERO
========================= */
.hero{
  min-height: calc(100vh - 90px);
  display:grid;
  align-items:center;
  overflow:hidden;
  padding-top:40px;
}

/* bg opcional (se usar a imagem do nome) */
.hero-bg{
  position:absolute;
  inset:-10%;
  width:120%;
  height:120%;
  object-fit:cover;
  z-index:1;
  opacity:.28;
  filter: blur(2px) brightness(.65) contrast(1.05) saturate(.85);
  transform: scale(1.03);
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  background: linear-gradient(180deg, rgba(0,0,0,.38), rgba(0,0,0,.72));
}

.hero-glow{
  position:absolute;
  right: 10%;
  bottom: 12%;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  background: rgba(79,140,255,.18);
  filter: blur(90px);
  z-index:2;
  animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse{
  0%,100%{ transform: translateY(0) scale(1); opacity:.55; }
  50%    { transform: translateY(-14px) scale(1.08); opacity:.85; }
}

.hero-noise{
  position:absolute;
  inset:0;
  z-index:3; /* acima do overlay */
  pointer-events:none;
  opacity:.08;
  mix-blend-mode: overlay;
  background-image:url("img/noise.png");
  background-repeat:repeat;
  animation: noiseMove 1.2s steps(2) infinite;
}

@keyframes noiseMove{
  0%{ transform: translate(0,0); }
  25%{ transform: translate(-2%, 1%); }
  50%{ transform: translate(1%, -2%); }
  75%{ transform: translate(2%, 2%); }
  100%{ transform: translate(0,0); }
}

.hero-character{
  position:absolute;
  right:6%;
  bottom:-2%;
  height: min(82vh, 740px);
  max-width: 52vw;
  z-index:4;
  will-change: transform;
  pointer-events:none;
  user-select:none;
  filter: drop-shadow(0 24px 46px rgba(0,0,0,.55));
}

.hero .container{
  position:relative;
  z-index:5;
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap:30px;
  align-items:center;
}

.eyebrow{
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-size:12px;
  opacity:.85;
  margin-bottom:10px;
}

.hero-title{
  font-size: clamp(34px, 4.2vw, 56px);
  line-height:1.05;
  letter-spacing:-0.02em;
  margin-bottom:14px;
}

.hero-sub{
  max-width: 54ch;
  font-size:16px;
  line-height:1.65;
  color: var(--muted);
  margin-bottom:22px;
}

.hero-cta{ display:flex; gap:12px; flex-wrap:wrap; }

/* =========================
   BUTTONS
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  text-decoration:none;
  border-radius:14px;
  padding:12px 16px;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.btn.primary{
  color:#0b0b12;
  background: var(--accent);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 18px 45px rgba(167,139,250,.16);
}
.btn.primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 26px 70px rgba(167,139,250,.22);
}

.btn.secondary{
  color: inherit;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}
.btn.secondary:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.10);
}

/* =========================
   TITLES / CARDS / GRIDS
========================= */
h2{
  font-size:28px;
  margin-bottom:20px;
  letter-spacing:-0.01em;
}

.projects-grid{
  display:grid;
  gap:16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.skill-card,
.project-card,
.contact-form{
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius:18px;
  padding:18px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .22s ease, border-color .2s ease, background .2s ease;
}

.skill-card:hover,
.project-card:hover{
  transform: translateY(-4px);
  border-color: rgba(167,139,250,.32);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.skill-head,
.project-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.skill-title h3,
.project-top h3{
  font-size:16px;
  font-weight:900;
}

.skill-badge,
.project-badge{
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}

.skill-desc,
.project-desc{
  color: var(--muted);
  line-height:1.55;
  font-size:14px;
  margin-bottom:12px;
}

.project-list{
  list-style:none;
  display:grid;
  gap:6px;
  margin:10px 0 14px;
  opacity:.95;
}

.project-tags,
.skill-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.project-tags span,
.skill-tags span{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
}

/* =========================
   PROGRESS BAR (JS usa --w)
========================= */
.progress{
  height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.10);
  overflow:hidden;
  position:relative;
}

.progress::after{
  content:"";
  position:absolute;
  inset:0;
  width: var(--w, 0%);
  background: var(--accent);
  border-radius:999px;
  transition: width 900ms ease;
}

/* =========================
   HABILIDADES: CARROSSEL (SETAS EMBAIXO)
========================= */
.skills-carousel{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.skills-track{
  display:flex;
  gap:16px;
  overflow:hidden;
  scroll-behavior:smooth;
  width:100%;
}

/* cards menores */
#habilidades .skill-card{
  flex:0 0 auto;
  min-width: 220px;
  max-width: 220px;
  padding:16px;
}

/* controls embaixo */
.carousel-controls{
  display:flex;
  justify-content:center;
  gap:14px;
}

/* setas visíveis no dark */
.carousel-btn{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #ffffff; /* GARANTE visível no modo escuro */
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.carousel-btn i{
  font-size:14px;
}

.carousel-btn:hover{
  transform: translateY(-3px);
  background: rgba(167,139,250,.18);
  border-color: rgba(167,139,250,.45);
}

/* no mobile: permite swipe com scrollbar discreta */
@media (max-width: 768px){
  .skills-track{
    overflow-x:auto;
    scroll-snap-type: x mandatory;
    padding-bottom:8px;
  }
  #habilidades .skill-card{ scroll-snap-align:start; }

  .skills-track::-webkit-scrollbar{ height: 8px; }
  .skills-track::-webkit-scrollbar-thumb{
    background: rgba(255,255,255,.14);
    border-radius:999px;
  }
}

/* =========================
   CONTACT
========================= */
.contact-form{
  display:grid;
  gap:12px;
  margin-top:16px;
}

.contact-form input,
.contact-form textarea{
  width:100%;
  border-radius:14px;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  color:inherit;
  outline:none;
}

.contact-form input:focus,
.contact-form textarea:focus{
  border-color: rgba(167,139,250,.42);
  box-shadow: 0 0 0 4px rgba(167,139,250,.14);
}

.feedback{ margin-top:10px; font-weight:800; }

/* =========================
   CONTACT LINKS (FINAL DO SITE) ✅
========================= */
.contact-links{
  width:min(1100px,92%);
  margin: 0 auto 60px;
  display:grid;
  gap:12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.contact-btn{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color: inherit;
  padding:14px 16px;
  border-radius:16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, border-color .2s ease, background .2s ease;
}

.contact-btn i{ font-size:18px; opacity:.95; }

.contact-btn:hover{
  transform: translateY(-3px);
  border-color: rgba(167,139,250,.38);
  background: rgba(255,255,255,.08);
}

/* =========================
   FOOTER
========================= */
footer{
  padding:30px 0 50px;
  text-align:center;
  opacity:.82;
}

/* =========================
   REVEAL (JS)
========================= */
.reveal{
  opacity:0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible{
  opacity:1;
  transform: translateY(0);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 880px){
  .hamburger{ display:block; }

  .nav-links{
    position:absolute;
    top:74px;
    right:4%;
    width:min(320px, 92vw);
    flex-direction:column;
    padding:14px;
    border-radius:16px;
    background: rgba(10,9,14,.88);
    border:1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 45px rgba(0,0,0,.25);
    display:none;
  }
  .nav-links.open{ display:flex; }

  .hero .container{
    grid-template-columns:1fr;
    padding-top:30px;
  }

  .hero-character{
    right:-6%;
    height:72vh;
    max-width:88vw;
    opacity:.96;
  }
}

@media (max-width: 520px){
  .hero-character{
    right:-14%;
    height:62vh;
    opacity:.94;
  }
}

/* =========================
   LIGHT MODE
========================= */
body.light{
  --bg: #f7f6fb;
  --text: #0f1020;
  --muted: rgba(15,16,32,.78);

  --card: rgba(255,255,255,.86);
  --card-border: rgba(0,0,0,.08);

  --line: rgba(0,0,0,.12);
  --soft: rgba(0,0,0,.06);

  background: var(--bg);
  color: var(--text);
}

body.light .navbar{
  background: rgba(255,255,255,.72);
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 14px 40px rgba(0,0,0,.10);
}

body.light .theme-toggle,
body.light .hamburger{
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.12);
}

body.light .contact-form input,
body.light .contact-form textarea{
  background: rgba(255,255,255,.95);
  border-color: rgba(0,0,0,.12);
}

/* setas visíveis no light também */
body.light .carousel-btn{
  color: #0f1020;
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.10);
}
body.light .carousel-btn:hover{
  background: rgba(167,139,250,.16);
  border-color: rgba(167,139,250,.35);
}

/* hero mais claro no light */
body.light .hero::before{
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.78));
}

body.light .hero-bg{
  opacity:.20;
  filter: blur(2px) brightness(.95) contrast(1.02) saturate(.92);
}


/* =========================
   FIX: CARROSSEL (sem faixa entre cards) + largura/topo
========================= */

/* garante fundo "normal" (igual ao resto) na seção e no carrossel */
#habilidades,
#habilidades .skills-carousel,
#habilidades .skills-track{
  background: transparent !important;
}

/* dá respiro pros cards não encostarem e não “vazar” sombra */
#habilidades .skills-track{
  padding: 8px 8px 2px;
  overflow: hidden;
}

/* suaviza sombra pra não criar aquelas faixas/colunas entre cards */
#habilidades .skill-card{
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}

/* ajusta largura um pouco maior pra não quebrar “Avançado” */
#habilidades .skill-card{
  min-width: 240px;   /* antes 220 */
  max-width: 240px;
}

/* topo do card: deixa quebrar linha se precisar, sem estourar */
#habilidades .skill-head{
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

#habilidades .skill-title h3{
  line-height: 1.1;
}

/* badge nunca corta e fica mais compacto */
#habilidades .skill-badge{
  white-space: nowrap;
  font-size: 11px;
  padding: 5px 9px;
}

/* no light mode, também garante que não apareça faixa */
body.light #habilidades .skill-card{
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}



/* =========================
   CHAT WIDGET (canto inferior direito)
   - botão fica embaixo
   - painel abre acima do botão
   - sem "open-up" (nunca sobe pro topo)
========================= */

.chat-widget{
  position: fixed !important;
  right: 18px !important;
  bottom: 18px !important;
  top: auto !important;
  left: auto !important;

  z-index: 9999;

  display: flex;
  flex-direction: column-reverse; /* ✅ botão embaixo, painel em cima */
  align-items: flex-end;
  gap: 12px;

  transform: none !important; /* ✅ impede qualquer subida */
}

/* iPhone safe-area (não cola no “home”) */
@supports (padding: max(0px)) {
  .chat-widget{
    right: max(18px, env(safe-area-inset-right)) !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
  }
}

/* Botão flutuante */
.chat-fab{
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.chat-fab i{ font-size: 20px; }

.chat-fab:hover{
  transform: translateY(-3px);
  background: rgba(167,139,250,.18);
  border-color: rgba(167,139,250,.45);
  box-shadow: 0 22px 55px rgba(0,0,0,.42);
}

/* Painel (abre acima do botão porque o container é column-reverse) */
.chat-panel{
  width: min(360px, calc(100vw - 32px));
  height: min(460px, calc(100vh - 160px));
  border-radius: 18px;

  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,9,14,.86);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  overflow: hidden;

  display: grid;
  grid-template-rows: auto 1fr auto;

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.chat-panel.open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Cabeçalho */
.chat-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.chat-title strong{ display:block; }
.chat-title span{
  display:block;
  font-size:12px;
  opacity:.75;
  margin-top:2px;
}

.chat-close{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.chat-close:hover{
  background: rgba(255,255,255,.10);
  transform: translateY(-2px);
}

/* Corpo do chat */
.chat-body{
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.chat-body::-webkit-scrollbar{ width: 10px; }
.chat-body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.10);
  border-radius: 999px;
}

/* Mensagens */
.chat-msg{
  display: flex;
  margin: 10px 0;
  gap: 10px;
}

.chat-msg.bot{ justify-content: flex-start; }
.chat-msg.user{ justify-content: flex-end; }

.chat-bubble{
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid rgba(255,255,255,.10);
  word-wrap: break-word;
}

.chat-msg.bot .chat-bubble{
  background: rgba(255,255,255,.06);
}

.chat-msg.user .chat-bubble{
  background: rgba(167,139,250,.18);
  border-color: rgba(167,139,250,.35);
}

/* Links dentro das mensagens */
.chat-bubble a{
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: .95;
}
.chat-bubble a:hover{ opacity: 1; }

/* Opções (rolam se tiver muitas) */
.chat-choices{
  padding: 12px;
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);

  max-height: 170px;
  overflow: auto;
}

.chat-choices::-webkit-scrollbar{ height: 8px; width: 8px; }
.chat-choices::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}

.chat-choice{
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.chat-choice:hover{
  background: rgba(255,255,255,.10);
  transform: translateY(-2px);
}

.chat-choice:focus-visible,
.chat-fab:focus-visible,
.chat-close:focus-visible{
  outline: 3px solid rgba(167,139,250,.35);
  outline-offset: 2px;
}

/* Mobile */
@media (max-width: 768px){
  .chat-widget{
    right: 14px !important;
    bottom: 14px !important;
  }

  .chat-panel{
    width: min(360px, calc(100vw - 24px));
    height: min(480px, calc(100vh - 150px));
  }
}

/* Light mode */
body.light .chat-panel{
  background: rgba(255,255,255,.92);
  border-color: rgba(0,0,0,.10);
}

body.light .chat-fab,
body.light .chat-close,
body.light .chat-choice{
  color: #0f1020;
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.10);
}

body.light .chat-choice:hover{
  background: rgba(167,139,250,.14);
  border-color: rgba(167,139,250,.30);
}

body.light .chat-msg.bot .chat-bubble{
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.08);
}

body.light .chat-bubble a{
  color: #0f1020;
}
