/**
 * ========================================================
 * ESTILOS — ivanibz.com
 * ========================================================
 *
 * Arquitectura:
 *   1. Custom Properties (temas)
 *   2. Reset & Base
 *   3. Tipografía
 *   4. Layout & Utilidades
 *   5. Header & Nav
 *   6. Hero
 *   7. Experiencia (Timeline)
 *   8. Skills
 *   9. Proyectos
 *  10. Contacto
 *  11. Footer
 *  12. Animaciones
 *  13. Responsive
 * ========================================================
 */

/* ── 1. CUSTOM PROPERTIES ────────────────────────────── */

:root {
  /* Paleta oscura (por defecto) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #263348;
  --bg-header: rgba(15, 23, 42, 0.85);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --accent-subtle: rgba(59, 130, 246, 0.1);
  --border: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.25);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Gradientes */
  --gradient-accent: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-card: linear-gradient(145deg, var(--bg-card), var(--bg-secondary));

  /* Badge colores */
  --badge-sn-bg: rgba(59, 130, 246, 0.12);
  --badge-sn-text: #60a5fa;
  --badge-dev-bg: rgba(16, 185, 129, 0.12);
  --badge-dev-text: #34d399;
  --badge-lang-bg: rgba(245, 158, 11, 0.12);
  --badge-lang-text: #fbbf24;
  --badge-cert-bg: rgba(139, 92, 246, 0.12);
  --badge-cert-text: #a78bfa;
}

/* Tema claro */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-header: rgba(248, 250, 252, 0.85);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --accent-subtle: rgba(37, 99, 235, 0.06);
  --border: rgba(148, 163, 184, 0.2);
  --border-hover: rgba(148, 163, 184, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.1);
  --gradient-card: linear-gradient(145deg, #ffffff, #f8fafc);

  --badge-sn-bg: rgba(37, 99, 235, 0.08);
  --badge-sn-text: #2563eb;
  --badge-dev-bg: rgba(5, 150, 105, 0.08);
  --badge-dev-text: #059669;
  --badge-lang-bg: rgba(217, 119, 6, 0.08);
  --badge-lang-text: #d97706;
  --badge-cert-bg: rgba(124, 58, 237, 0.08);
  --badge-cert-text: #7c3aed;
}


/* ── 2. RESET & BASE ─────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}


/* ── 3. TIPOGRAFÍA ───────────────────────────────────── */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}


/* ── 4. LAYOUT & UTILIDADES ──────────────────────────── */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: var(--gradient-accent);
  margin: 0.75rem auto 0;
  border-radius: var(--radius-full);
}

/* Clase para ocultar elementos (foto, blog, etc.) */
.hidden {
  display: none !important;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ── 5. HEADER & NAV ────────────────────────────────── */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition), border-color var(--transition);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color var(--transition);
}

.header__logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__links {
  display: flex;
  gap: 1.5rem;
}

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

.nav__link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
  border-radius: var(--radius-full);
}

.nav__link:hover,
.nav__link.active {
  color: var(--accent);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* Controles (idioma + tema) */
.nav__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Selector de idioma */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lang-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.lang-selector.open .lang-btn svg {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 100;
  overflow: hidden;
}

.lang-selector.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}

.lang-option:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

.lang-option.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.lang-option__flag {
  font-size: 1.1rem;
  line-height: 1;
}

/* Toggle tema */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition);
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* Icono sol/luna swap */
.icon-sun,
.icon-moon {
  transition: opacity var(--transition), transform var(--transition);
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.hamburger:hover {
  border-color: var(--accent);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ── 6. HERO ──────────────────────────────────────────── */

.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding-top: 64px;
  position: relative;
  overflow: hidden;
}

/* Fondo decorativo */
.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 10s ease-in-out infinite reverse;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero__text {
  flex: 1;
}

.hero__greeting {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

.hero__name {
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.hero__role {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero__role span {
  color: var(--accent);
  font-weight: 600;
}

.hero__tags {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero__tag {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

.hero__tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.hero__tag--sn {
  background: var(--badge-sn-bg);
  color: var(--badge-sn-text);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.hero__tag--java {
  background: var(--badge-dev-bg);
  color: var(--badge-dev-text);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-theme="light"] .hero__tag--sn {
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .hero__tag--java {
  border-color: rgba(5, 150, 105, 0.2);
}

.hero__bio {
  max-width: 580px;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Foto de perfil */
.hero__photo {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-glow);
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ── BOTONES ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  color: #ffffff;
}

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn--linkedin {
  background: #0a66c2;
  color: #ffffff;
}

.btn--linkedin:hover {
  background: #004182;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  position: relative;
}

.btn--disabled:hover {
  transform: none;
}

/* Tooltip para botón deshabilitado */
.btn--disabled .btn__tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  box-shadow: var(--shadow-md);
}

.btn--disabled:hover .btn__tooltip {
  opacity: 1;
  pointer-events: auto;
}


/* ── 7. EXPERIENCIA (TIMELINE) ───────────────────────── */

.timeline {
  position: relative;
  padding-left: 2.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: var(--radius-full);
}

.timeline__item {
  position: relative;
  padding-bottom: 2.5rem;
}

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

.timeline__dot {
  position: absolute;
  left: -2.5rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transition: background-color var(--transition), border-color var(--transition);
}

.timeline__card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition);
}

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

.timeline__role {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.timeline__company {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.timeline__date {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: block;
}

.timeline__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.timeline__desc-list {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.timeline__desc-list li {
  margin-bottom: 0.25rem;
}

/* Nombre de empresa (tarjeta agrupada) */
.timeline__company-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Separador entre puestos dentro de la misma empresa */
.timeline__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* Cada puesto dentro de una tarjeta de empresa */
.timeline__position .timeline__role {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.experience__cta {
  text-align: center;
  margin-top: 2.5rem;
}


/* ── 8. SKILLS ────────────────────────────────────────── */

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all var(--transition);
}

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

.skill-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-card__icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.skill-card__badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--badge-cert-bg);
  color: var(--badge-cert-text);
  white-space: nowrap;
}

.skill-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  transition: all var(--transition);
}

.skill-tag:hover {
  transform: translateY(-1px);
}

/* Colores de tags por categoría */
.skill-card--sn .skill-tag {
  background: var(--badge-sn-bg);
  color: var(--badge-sn-text);
}

.skill-card--dev .skill-tag {
  background: var(--badge-dev-bg);
  color: var(--badge-dev-text);
}

.skill-card--lang .skill-tag {
  background: var(--badge-lang-bg);
  color: var(--badge-lang-text);
}


/* ── 9. PROYECTOS ─────────────────────────────────────── */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition);
}

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

.project-card:hover::before {
  opacity: 1;
}

.project-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.project-card__icon svg {
  width: 24px;
  height: 24px;
}

.project-card__name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

.project-card__tech {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.project-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  gap: 0.75rem;
}

/* Tarjeta placeholder "Próximamente" */
.project-card--soon {
  border-style: dashed;
  background: transparent;
}

.project-card--soon .project-card__icon {
  background: var(--badge-cert-bg);
  color: var(--badge-cert-text);
}

.project-card--soon .project-card__name {
  color: var(--text-muted);
}


/* ── 10. CONTACTO ─────────────────────────────────────── */

.contact {
  background: var(--bg-secondary);
  transition: background-color var(--transition);
}

.contact__inner {
  max-width: 600px;
  margin: 0 auto;
}

.contact__subtitle {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form__group {
  position: relative;
}

.form__label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form__input,
.form__textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  outline: none;
}

.form__input:focus,
.form__textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--text-muted);
}

.form__textarea {
  min-height: 140px;
  resize: vertical;
}

.form__submit {
  align-self: flex-start;
}

/* Status del formulario */
.form__status {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}

.form__status--success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.form__status--error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}


/* ── MODALES ──────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal.open .modal__content {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}

.modal__close:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

.modal__close svg {
  width: 20px;
  height: 20px;
}

.modal__title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.modal__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.modal__tech {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.modal__repo-link {
  margin-top: 0.5rem;
}


/* ── 11. FOOTER ───────────────────────────────────────── */

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  transition: border-color var(--transition);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__copy {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer__made {
  font-size: 0.825rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.footer__heart {
  color: #ef4444;
  font-size: 1rem;
  animation: heartbeat 1.5s ease infinite;
}

.footer__socials {
  display: flex;
  gap: 0.75rem;
}

.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.footer__social:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer__social svg {
  width: 18px;
  height: 18px;
}


/* ── 12. ANIMACIONES ──────────────────────────────────── */

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

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

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger para grids */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.4s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Loading spinner para botón de envío */
.btn--loading {
  pointer-events: none;
  position: relative;
}

.btn--loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.5rem;
}

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


/* ── 13. RESPONSIVE ───────────────────────────────────── */

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    background: var(--bg-primary);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 999;
  }

  .nav__links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav__link {
    font-size: 1.25rem;
  }

  .hero__content {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero__bio {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__photo {
    width: 150px;
    height: 150px;
  }

  .skills__grid {
    grid-template-columns: 1fr;
  }

  .projects__grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline__dot {
    left: -2rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  section {
    padding: 3.5rem 0;
  }

  .container {
    padding: 0 1rem;
  }

  .hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 3rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}
