/* =========================================
   DESIGN TOKENS
   ========================================= */
:root {
  --bg:          #050816;
  --bg-card:     rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(124, 58, 237, 0.12);
  --border:      rgba(255, 255, 255, 0.09);
  --border-hover: rgba(124, 58, 237, 0.6);
  --purple:      #7c3aed;
  --purple-light: #9f7aea;
  --purple-glow: rgba(124, 58, 237, 0.35);
  --blue:        #38bdf8;
  --text:        #ffffff;
  --text-muted:  #94a3b8;
  --text-soft:   #cbd5e1;
  --radius-card: 20px;
  --radius-pill: 999px;
  --transition:  0.25s ease;
  --font:        'Inter', system-ui, Arial, sans-serif;
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px; /* Offset para navbar fija */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   NAVBAR — fija con efecto glass
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8%;
  height: 68px;
  background: rgba(5, 8, 22, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--purple-light);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.btn-nav {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--purple);
  color: var(--purple-light);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.btn-nav:hover {
  background: var(--purple);
  color: #fff;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  min-height: 100vh;
  padding: 120px 8% 80px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(124, 58, 237, 0.35), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(56, 189, 248, 0.15), transparent 40%),
    var(--bg);
}

.hero-content {
  max-width: 860px;
}

.tag {
  display: inline-block;
  color: var(--purple-light);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.hero h1 span {
  background: linear-gradient(100deg, #9f7aea 20%, #38bdf8 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.description {
  max-width: 680px;
  color: var(--text-soft);
  font-size: 1.15rem;
  margin-bottom: 36px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

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

.btn.primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 4px 20px var(--purple-glow);
}

.btn.primary:hover {
  background: #6d28d9;
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
}

.btn.secondary {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn.secondary:hover {
  border-color: var(--purple-light);
  background: rgba(124, 58, 237, 0.12);
}

/* =========================================
   SECTIONS — base
   ========================================= */
.section {
  padding: 96px 8%;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 48px;
  max-width: 620px;
}

/* =========================================
   SOBRE MÍ
   ========================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 32px;
}

.about-text {
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.8;
}

.about-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-highlights li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.95rem;
  color: var(--text-soft);
  transition: border-color var(--transition);
}

.about-highlights li:hover {
  border-color: var(--purple-light);
}

.hl-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* =========================================
   EXPERIENCIA — línea de tiempo
   ========================================= */
#experiencia {
  background: radial-gradient(ellipse at 90% 50%, rgba(56, 189, 248, 0.06), transparent 60%);
}

.timeline {
  position: relative;
  margin-top: 48px;
  padding-left: 24px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 40px 36px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -33px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--purple);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

.timeline-dot--highlight {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
  width: 17px;
  height: 17px;
  left: -34px;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 26px;
  transition: border-color var(--transition);
}

.timeline-content:hover {
  border-color: var(--border-hover);
}

.timeline-content--highlight {
  border-color: rgba(245, 158, 11, 0.35);
}

.timeline-content--highlight:hover {
  border-color: rgba(245, 158, 11, 0.7);
}

.timeline-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--purple-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
}

.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-org {
  font-size: 0.88rem;
  color: var(--blue);
  font-weight: 500;
  margin-bottom: 10px !important;
}

.timeline-content p {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 100%;
}

/* =========================================
   PROYECTOS — cards
   ========================================= */
#proyectos {
  background: radial-gradient(ellipse at 5% 50%, rgba(124, 58, 237, 0.07), transparent 55%);
}

#proyectos h2 {
  margin-bottom: 8px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 0;
}

.card {
  padding: 28px;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon {
  font-size: 2rem;
  line-height: 1;
}

/* Badges */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge--featured {
  background: rgba(124, 58, 237, 0.2);
  color: var(--purple-light);
  border: 1px solid rgba(124, 58, 237, 0.4);
}

.badge--live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge--thesis {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge--award {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Card body */
.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.card-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--blue);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

/* Card button */
.card-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--purple-light);
  border: 1px solid rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.08);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  align-self: flex-start;
}

.card-btn:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.card-btn--disabled {
  color: var(--text-muted);
  border-color: var(--border);
  background: transparent;
  cursor: default;
  pointer-events: none;
}

/* =========================================
   TECNOLOGÍAS
   ========================================= */
.tech-categories {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 36px;
}

.tech-category h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--purple-light);
  margin-bottom: 14px;
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-grid span {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #e9d5ff;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.tech-grid span:hover {
  background: rgba(124, 58, 237, 0.22);
  border-color: var(--purple-light);
}

/* =========================================
   CONTACTO
   ========================================= */
.contact {
  text-align: center;
  background: radial-gradient(ellipse at 50% 60%, rgba(124, 58, 237, 0.1), transparent 60%);
}

.contact h2 {
  margin-bottom: 12px;
}

.contact > p {
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 1rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.contact-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.contact-btn--cv {
  background: var(--purple);
  border-color: var(--purple);
}

.contact-btn--cv:hover {
  background: #6d28d9;
  border-color: #6d28d9;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
  padding: 28px 8%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
}

/* =========================================
   REVEAL ANIMATION (scroll)
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 5%;
    gap: 12px;
  }

  .nav-links {
    display: none; /* En móvil solo el logo y el botón */
  }

  .hero {
    padding: 110px 5% 60px;
  }

  .section {
    padding: 72px 5%;
  }

  .timeline {
    padding-left: 16px;
  }

  .timeline-item {
    padding-left: 28px;
  }

  .timeline-dot {
    left: -25px;
  }

  .timeline-dot--highlight {
    left: -26px;
  }
}
