/* ─── CSS Variables ───────────────────────────────────────────── */
:root {
  --bg: #282a36;
  --bg2: #44475a;
  --bg3: #1e2030;
  --text: #f8f8f2;
  --muted: #6272a4;
  --purple: #bd93f9;
  --green: #50fa7b;
  --cyan: #8be9fd;
  --pink: #ff79c6;
  --red: #ff5555;
  --orange: #ffb86c;
  --yellow: #f1fa8c;
  --font-mono: "Space Mono", monospace;
  --font-body: "DM Sans", sans-serif;
}

/* ─── Reset & Base ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ─── Noise texture overlay ───────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35;
}

section,
nav,
footer {
  position: relative;
  z-index: 1;
}

/* ─── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg3);
}
::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 99px;
}

/* ─── Typography helpers ────────────────────────────────────────── */
.mono {
  font-family: var(--font-mono);
}
.text-purple {
  color: var(--purple) !important;
}
.text-green {
  color: var(--green) !important;
}
.text-cyan {
  color: var(--cyan) !important;
}
.text-pink {
  color: var(--pink) !important;
}
.text-muted-custom {
  color: var(--muted) !important;
}

/* ─── Navbar ────────────────────────────────────────────────────── */
.navbar {
  background: rgba(30, 32, 48, 0.82) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(98, 114, 164, 0.18);
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease;
}

.navbar-brand {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--purple) !important;
  letter-spacing: 0.03em;
}

.navbar-brand span {
  color: var(--green);
}

.nav-link {
  color: var(--text) !important;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 1rem !important;
  position: relative;
  transition: color 0.2s;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: var(--purple);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-link:hover {
  color: var(--purple) !important;
}
.nav-link:hover::after {
  transform: scaleX(1);
}

/* ─── Hero ──────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  background:
    radial-gradient(
      ellipse 60% 50% at 80% 40%,
      rgba(189, 147, 249, 0.08) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 40% at 10% 70%,
      rgba(80, 250, 123, 0.06) 0%,
      transparent 60%
    ),
    var(--bg);
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-label::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--green);
}

.hero-headline {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5.5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-headline .line-1 {
  color: var(--text);
}
.hero-headline .line-2 {
  color: var(--purple);
}
.hero-headline .line-3 {
  color: var(--cyan);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
  font-style: italic;
}

.btn-primary-custom {
  background: var(--green);
  color: var(--bg);
  border: none;
  padding: 0.75rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 4px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary-custom:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(80, 250, 123, 0.25);
  color: var(--bg);
}

.btn-outline-custom {
  background: transparent;
  color: var(--purple);
  border: 1px solid var(--purple);
  padding: 0.75rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border-radius: 4px;
  transition:
    transform 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-outline-custom:hover {
  background: rgba(189, 147, 249, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(189, 147, 249, 0.15);
  color: var(--purple);
}

/* animated cursor */
.cursor-blink {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* hero decorative code block */
.hero-code {
  background: var(--bg3);
  border: 1px solid rgba(98, 114, 164, 0.25);
  border-radius: 8px;
  padding: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  position: relative;
  overflow: hidden;
}

.hero-code::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--green));
}

.hero-code .ln {
  color: var(--muted);
  user-select: none;
  margin-right: 1.5rem;
}
.hero-code .kw {
  color: var(--pink);
}
.hero-code .fn {
  color: var(--green);
}
.hero-code .str {
  color: var(--yellow);
}
.hero-code .cmt {
  color: var(--muted);
  font-style: italic;
}
.hero-code .cls {
  color: var(--cyan);
}
.hero-code .num {
  color: var(--purple);
}

/* ─── Section headings ──────────────────────────────────────────── */
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-title span {
  color: var(--purple);
}

.section-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  margin-bottom: 2.5rem;
}

/* ─── About ─────────────────────────────────────────────────────── */
#sobre {
  padding: 7rem 0;
  background: var(--bg);
}

.about-card {
  background: var(--bg3);
  border: 1px solid rgba(98, 114, 164, 0.2);
  border-radius: 12px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.about-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--purple), var(--cyan));
}

.about-stat {
  text-align: center;
  padding: 1.25rem;
  background: rgba(68, 71, 90, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(98, 114, 164, 0.15);
}

.about-stat .num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--purple);
  display: block;
}

.about-stat .lbl {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ─── Skills ────────────────────────────────────────────────────── */
#skills {
  padding: 7rem 0;
  background:
    radial-gradient(
      ellipse 70% 60% at 50% 50%,
      rgba(139, 233, 253, 0.04) 0%,
      transparent 70%
    ),
    var(--bg2);
}

.skill-card {
  background: var(--bg);
  border: 1px solid rgba(139, 233, 253, 0.15);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  height: 100%;
}

.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border-color: var(--cyan);
}

.skill-card .icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.skill-card .name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.skill-card .level {
  margin-top: 0.75rem;
  height: 3px;
  background: rgba(98, 114, 164, 0.25);
  border-radius: 99px;
  overflow: hidden;
}

.skill-card .level-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card .level-fill.animated {
  width: var(--pct);
}

/* ─── Projects ──────────────────────────────────────────────────── */
#projetos {
  padding: 7rem 0;
  background: var(--bg);
}

.project-card {
  background: var(--bg2);
  border: 1px solid rgba(98, 114, 164, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  border-color: var(--purple);
}

.project-card-header {
  background: var(--bg3);
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(98, 114, 164, 0.15);
}

.project-icon {
  font-size: 1.8rem;
}

.project-links a {
  color: var(--muted);
  font-size: 1.2rem;
  margin-left: 0.75rem;
  transition: color 0.2s;
  text-decoration: none;
}

.project-links a:hover {
  color: var(--purple);
}

.project-body {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
  margin-bottom: 1.25rem;
}

.tech-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.2rem 0.15rem;
}

.badge-purple {
  background: rgba(189, 147, 249, 0.15);
  color: var(--purple);
  border: 1px solid rgba(189, 147, 249, 0.3);
}
.badge-cyan {
  background: rgba(139, 233, 253, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(139, 233, 253, 0.25);
}
.badge-green {
  background: rgba(80, 250, 123, 0.12);
  color: var(--green);
  border: 1px solid rgba(80, 250, 123, 0.25);
}
.badge-pink {
  background: rgba(255, 121, 198, 0.12);
  color: var(--pink);
  border: 1px solid rgba(255, 121, 198, 0.25);
}
.badge-orange {
  background: rgba(255, 184, 108, 0.12);
  color: var(--orange);
  border: 1px solid rgba(255, 184, 108, 0.25);
}

/* ─── Contact / Footer ──────────────────────────────────────────── */
#contato {
  padding: 7rem 0 4rem;
  background: var(--bg3);
  text-align: center;
}

.contact-tagline {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 2.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(98, 114, 164, 0.3);
  color: var(--muted);
  font-size: 1.35rem;
  margin: 0 0.5rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.social-link:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(189, 147, 249, 0.1);
  transform: translateY(-4px);
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(98, 114, 164, 0.15);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ─── Fade-in animation ─────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Navbar toggler (mobile) ───────────────────────────────────── */
.navbar-toggler {
  border-color: rgba(98, 114, 164, 0.4) !important;
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28248,248,242,0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ─── Responsive tweaks ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #hero {
    padding-top: 5rem;
  }
  .hero-code {
    padding: 1rem 0.85rem;
    font-size: 0.68rem;
    line-height: 1.65;
    overflow-x: auto;
  }
  .hero-code pre {
    min-width: 0;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .hero-code .ln {
    margin-right: 0.75rem;
  }
}
