:root {
  --bg: #080b14;
  --bg2: #0d1120;
  --bg3: #111827;
  --card: #131929;
  --card2: #1a2236;
  --border: rgba(120, 100, 255, 0.15);
  --border2: rgba(120, 100, 255, 0.08);
  --purple: #7c5cfc;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --pink: #e879f9;
  --grad: linear-gradient(135deg, #7c5cfc, #3b82f6);
  --grad2: linear-gradient(135deg, #7c5cfc 0%, #e879f9 50%, #3b82f6 100%);
  --text: #f0f4ff;
  --muted: #8892a4;
  --muted2: #5a6478;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 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.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* Glow orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}
.orb-1 { width: 500px; height: 500px; background: var(--purple); top: -150px; left: -150px; }
.orb-2 { width: 400px; height: 400px; background: var(--blue); bottom: 10%; right: -100px; }
.orb-3 { width: 300px; height: 300px; background: var(--pink); top: 40%; left: 30%; }

/* ========== NAV ========== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 5%;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 11, 20, 0.75);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border2);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--grad);
  color: #fff !important;
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  font-weight: 500 !important;
  font-size: 0.85rem !important;
  transition: opacity 0.2s !important;
}
.nav-cta:hover { opacity: 0.85; color: #fff !important; }

/* ========== HERO ========== */
#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 5% 80px;
  position: relative;
  z-index: 1;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124, 92, 252, 0.12);
  border: 1px solid rgba(124, 92, 252, 0.3);
  color: #a78bfa;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: fadeUp 0.6s ease both;
}

.hero-tag::before {
  content: '';
  width: 6px; height: 6px;
  background: #7c5cfc;
  border-radius: 50%;
  box-shadow: 0 0 8px #7c5cfc;
  animation: pulse 2s infinite;
}

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

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 1.4rem;
  animation: fadeUp 0.6s 0.1s ease both;
}

.hero-title .grad-text {
  background: var(--grad2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 460px;
  margin-bottom: 2.2rem;
  animation: fadeUp 0.6s 0.2s ease both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeUp 0.6s 0.3s ease both;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  padding: 0.75rem 1.8rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 30px rgba(124, 92, 252, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 40px rgba(124, 92, 252, 0.5); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1.8rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: rgba(124,92,252,0.4); background: rgba(124,92,252,0.06); }

.hero-socials {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  animation: fadeUp 0.6s 0.4s ease both;
}

.social-link {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.social-link:hover { border-color: rgba(124,92,252,0.5); color: var(--purple); background: rgba(124,92,252,0.08); }

/* Hero image */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeUp 0.6s 0.2s ease both;
  position: relative;
}

.avatar-ring {
  position: relative;
  width: 340px;
  height: 340px;
}

.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--grad2);
  animation: spin 8s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
}

@keyframes spin { to { transform: rotate(360deg); } }

.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  position: relative;
  z-index: 1;
  border: 4px solid var(--bg);
}

.hero-badge {
  position: absolute;
  bottom: 10px;
  right: -10px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(10px);
  z-index: 2;
}
.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 2s infinite;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== SECTIONS COMMON ========== */
section { padding: 100px 5%; position: relative; z-index: 1; }
.section-inner { max-width: 1100px; margin: 0 auto; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section-sub {
  color: var(--muted);
  font-size: 1rem;
  max-width: 520px;
  margin-bottom: 3rem;
}

/* ========== ABOUT ========== */
#about { background: var(--bg2); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-img-wrap { position: relative; }

.about-img-wrap img {
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  object-fit: cover;
  object-position: top center;
  aspect-ratio: 3/4;
  display: block;
  border: 1px solid var(--border);
}

.about-img-card {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.4rem;
  backdrop-filter: blur(12px);
}

.about-stat { text-align: center; }
.about-stat .num {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.about-stat .label { font-size: 0.75rem; color: var(--muted); margin-top: 0.1rem; }

.about-text p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}
.about-text p strong { color: var(--text); font-weight: 500; }

.about-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.info-item {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 0.8rem 1rem;
}
.info-item .info-label {
  font-size: 0.7rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}
.info-item .info-val { font-size: 0.88rem; font-weight: 500; color: var(--text); }

/* ========== SKILLS ========== */
#skills { background: var(--bg); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 1.8rem;
  transition: border-color 0.25s, transform 0.25s;
}
.skill-card:hover { border-color: rgba(124,92,252,0.35); transform: translateY(-4px); }

.skill-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(124, 92, 252, 0.12);
  border: 1px solid rgba(124, 92, 252, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}

.skill-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.3px;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ========== PROJECTS ========== */
#projects { background: var(--bg2); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.project-card:hover { border-color: rgba(124,92,252,0.35); transform: translateY(-4px); }

.project-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--card2);
}

.project-body { padding: 1.5rem; }

.project-stack { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }

.stack-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--purple);
  background: rgba(124,92,252,0.1);
  border: 1px solid rgba(124,92,252,0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

.project-body h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.4px;
}

.project-body p { color: var(--muted); font-size: 0.875rem; line-height: 1.65; }

.project-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple);
  margin-top: 1rem;
  letter-spacing: 0.02em;
}

/* ========== CAREER ========== */
#trajetoria { background: var(--bg); }

.career-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.career-col h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border2);
}

.timeline { display: flex; flex-direction: column; gap: 0; }

.tl-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 1rem;
  padding-bottom: 2rem;
  position: relative;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 5px;
}

.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--grad);
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(124,92,252,0.5);
}

.tl-connector {
  width: 1px;
  flex: 1;
  background: linear-gradient(to bottom, rgba(124,92,252,0.3), transparent);
  margin-top: 4px;
}
.tl-item:last-child .tl-connector { display: none; }

.tl-period {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.tl-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  letter-spacing: -0.3px;
}

.tl-org { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }

.tl-desc { font-size: 0.83rem; color: var(--muted2); line-height: 1.6; }

/* ========== CONTACT ========== */
#contact {
  background: #0d1120;
  display: block;
  width: 100%;
  position: relative;
  z-index: 1;
}

.contact-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner .section-label,
.contact-inner .section-title,
.contact-inner .section-sub { margin-left: auto; margin-right: auto; }

.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  margin-top: 1rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1.3rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}
.contact-link:hover { border-color: rgba(124,92,252,0.4); background: rgba(124,92,252,0.08); }
.contact-link svg { color: var(--purple); }

/* ========== FOOTER ========== */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border2);
  padding: 2rem 5%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted2);
  position: relative;
  z-index: 1;
}

footer span {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(124,92,252,0.4); border-radius: 3px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-visual { order: -1; }
  .avatar-ring { width: 240px; height: 240px; }
  .hero-actions, .hero-socials { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .about-grid { grid-template-columns: 1fr; }
  .about-img-wrap { display: none; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .career-cols { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 600px) {
  nav { padding: 0 4%; }
  .nav-links { display: none; }
  section { padding: 70px 4%; }
  .skills-grid { grid-template-columns: 1fr; }
}