/* =============================================
   CSS VARIABLES (Custom Properties)
   ============================================= */
:root {
  --color-primary: #6c63ff;
  --color-primary-light: #8b85ff;
  --color-primary-dark: #4f46e5;
  --color-primary-glow: rgba(108, 99, 255, 0.35);

  --color-secondary: #06b6d4;
  --color-accent: #f59e0b;

  --color-bg: #0a0a0f;
  --color-bg-section: #0d0d14;
  --color-bg-dark: #07070d;
  --color-bg-card: #13131e;
  --color-bg-card-hover: #1a1a2e;

  --color-border: rgba(255, 255, 255, 0.07);
  --color-border-hover: rgba(108, 99, 255, 0.5);

  --color-text: #e2e8f0;
  --color-text-muted: #8892a4;
  --color-text-faint: #4a5568;

  --font-primary: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px var(--color-primary-glow);

  --transition-fast: 200ms ease;
  --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  --nav-height: 70px;
  --section-padding: 100px 24px;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* =============================================
   SCROLLBAR CUSTOM
   ============================================= */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-smooth);
}

.navbar--scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.navbar__container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-text);
}

.navbar__logo-dot {
  color: var(--color-primary);
}

.navbar__links {
  display: flex;
  gap: 36px;
}

.navbar__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-smooth);
}

.navbar__link:hover {
  color: var(--color-text);
}

.navbar__link:hover::after {
  width: 100%;
}

/* =============================================
   BOTÓN VOLVER ARRIBA
   ============================================= */
.btn-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--color-primary-glow);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth), background var(--transition-fast);
  pointer-events: none;
}

.btn-top.btn-top--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.btn-top:hover {
  background: var(--color-primary-light);
  transform: translateY(-3px) scale(1.05);
}

.btn-top__icon {
  width: 20px;
  height: 20px;
  color: #fff;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  border-radius: var(--radius-full);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 2px solid transparent;
  white-space: nowrap;
}

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

.btn--primary:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--color-primary-glow);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-hover);
}

.btn--outline:hover {
  background: rgba(108, 99, 255, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary-light);
  transform: translateY(-2px);
}

.btn--full {
  width: 100%;
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--nav-height) 24px 60px;
  overflow: hidden;
  background: var(--color-bg-dark);
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(108, 99, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 99, 255, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero__glow {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(80px);
  pointer-events: none;
}

.hero__glow--1 {
  width: 500px;
  height: 500px;
  background: rgba(108, 99, 255, 0.15);
  top: -100px;
  left: -100px;
  animation: float 8s ease-in-out infinite;
}

.hero__glow--2 {
  width: 400px;
  height: 400px;
  background: rgba(6, 182, 212, 0.1);
  bottom: -80px;
  right: -80px;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -20px); }
}

.hero__container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.3);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-primary-light);
  letter-spacing: 0.02em;
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

.hero__photo-wrapper {
  position: relative;
  margin-top: 8px;
}

.hero__photo {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--color-primary);
  box-shadow: 0 0 0 6px rgba(108, 99, 255, 0.15), var(--shadow-glow);
}

.hero__photo-ring {
  position: absolute;
  inset: -8px;
  border-radius: var(--radius-full);
  border: 2px dashed rgba(108, 99, 255, 0.3);
  animation: spin 20s linear infinite;
}

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

.hero__name {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--color-text);
}

.hero__title {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 400;
  color: var(--color-text-muted);
}

.hero__title-highlight {
  color: var(--color-primary-light);
  font-weight: 700;
}

.hero__subtitle {
  font-size: 0.9rem;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.hero__actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* =============================================
   SECTIONS SHARED
   ============================================= */
.section {
  padding: var(--section-padding);
  background: var(--color-bg-section);
}

.section--dark {
  background: var(--color-bg-dark);
}

.section__container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding: 4px 12px;
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.25);
  border-radius: var(--radius-full);
}

.section__title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--color-text);
  margin-bottom: 56px;
}

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

.about__paragraph {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  line-height: 1.8;
}

.about__paragraph strong {
  color: var(--color-text);
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: border-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.stat-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.stat-card__number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary-light);
  font-family: var(--font-mono);
  line-height: 1;
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* =============================================
   TIMELINE / EXPERIENCIA
   ============================================= */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), transparent);
}

.timeline__item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 24px;
  padding-bottom: 40px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__marker {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-bg-dark);
  box-shadow: 0 0 12px var(--color-primary-glow);
  margin-top: 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.timeline__card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  transition: border-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.timeline__card:hover {
  border-color: var(--color-border-hover);
  transform: translateX(6px);
  box-shadow: var(--shadow-glow);
}

.timeline__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.timeline__company {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.timeline__company-link {
  color: var(--color-primary-light);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.timeline__company-link:hover {
  color: var(--color-secondary);
}

.timeline__link-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.timeline__contact {
  font-size: 0.82rem;
}

.timeline__email-link {
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition-fast);
}

.timeline__email-link:hover {
  color: var(--color-secondary);
}

.timeline__email-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.timeline__period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-faint);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  white-space: nowrap;
  align-self: flex-start;
}

.timeline__description {
  font-size: 0.925rem;
  color: var(--color-text-muted);
  line-height: 1.75;
  margin-bottom: 18px;
}

.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.25);
  color: var(--color-primary-light);
  font-weight: 500;
}

/* =============================================
   HABILIDADES
   ============================================= */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.skill-category {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color var(--transition-smooth);
}

.skill-category:hover {
  border-color: var(--color-border-hover);
}

.skill-category__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary-light);
  margin-bottom: 20px;
  font-family: var(--font-mono);
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.skill-item__name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
}

.skill-item__level {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.skill-item__bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-item__fill {
  height: 100%;
  width: var(--skill-width, 0%);
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: var(--radius-full);
  transform-origin: left;
  animation: growBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes growBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.skills__extra {
  text-align: center;
}

.skills__extra-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  font-family: var(--font-mono);
}

.skills__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  cursor: default;
}

.badge:hover {
  background: rgba(108, 99, 255, 0.1);
  border-color: var(--color-border-hover);
  color: var(--color-primary-light);
}

/* =============================================
   CONTACTO
   ============================================= */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: start;
}

.contact__description {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 32px;
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact__detail-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.contact__detail-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.contact__detail-link {
  color: var(--color-primary-light);
  transition: color var(--transition-fast);
}

.contact__detail-link:hover {
  color: var(--color-secondary);
}

/* Form */
.contact__form-wrapper {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 36px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.contact-form__input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  outline: none;
  resize: none;
}

.contact-form__input::placeholder {
  color: var(--color-text-faint);
}

.contact-form__input:focus {
  border-color: var(--color-primary);
  background: rgba(108, 99, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.contact-form__textarea {
  min-height: 130px;
}

.contact-form__feedback {
  font-size: 0.875rem;
  text-align: center;
  padding: 0;
  border-radius: var(--radius-md);
  min-height: 0;
  transition: all var(--transition-smooth);
}

.contact-form__feedback--success {
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
  animation: fadeIn 0.4s ease;
}

.contact-form__feedback--error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  animation: fadeIn 0.4s ease;
}

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

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--color-bg-dark);
  border-top: 1px solid var(--color-border);
  padding: 40px 24px;
  text-align: center;
}

.footer__container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer__text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer__subtext {
  font-size: 0.78rem;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

/* =============================================
   ANIMACIONES DE ENTRADA (Intersection Observer)
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

@media (max-width: 680px) {
  .navbar__links {
    display: none;
  }
  .about__stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero__actions {
    flex-direction: column;
    align-items: center;
  }
  .timeline__item {
    grid-template-columns: 22px 1fr;
    gap: 16px;
  }
  .timeline__card {
    padding: 20px;
  }
  .timeline__header {
    flex-direction: column;
  }
}