/* ============================================================
   MAIN STYLESHEET — Portfolio
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&family=Outfit:wght@400;600;700;900&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('design-system.css');

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-h);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Progreso Láser de Lectura ─────────────────────────────────── */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 2000;
  pointer-events: none;
}

.scroll-progress-bar {
  height: 100%;
  background: var(--gradient-accent);
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: var(--shadow-glow);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ── Noise texture 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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 3px;
}

/* ── Selection ──────────────────────────────────────────────── */
::selection {
  background: rgba(139, 0, 0, 0.4);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-h);
  z-index: 1000;
  transition: all var(--transition-base);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: var(--color-surface);
  /* Dinámico */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.nav-logo-img {
  height: 60px;
  /* Tamaño máximo para mejor distinción */
  width: auto;
  display: block;
  transition: transform var(--transition-base);
}

.navbar-brand:hover .nav-logo-img {
  transform: scale(1.08);
  /* Micro-interacción más pronunciada */
}

/* Theme Toggle Button & Logo Visibility Logic */
[data-theme="dark"] .nav-logo-img {
  filter: invert(1) brightness(1.5) !important;
  /* Forzamos color blanco en modo oscuro */
}

[data-theme="light"] .nav-logo-img {
  filter: none !important;
  /* Logo original (negro) en modo claro */
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  z-index: 1001;
}

.theme-toggle {
  background: var(--color-surface);
  border: none;
  color: var(--color-text);
  width: 60px;
  height: 35px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  /* Sombra base (Raised - Modo Oscuro por defecto) */
  box-shadow: 6px 6px 12px #0b0c10, -6px -6px 12px #111217;
}

/* Estado Presionado (Modo Claro) */
[data-theme="light"] .theme-toggle {
  background: #f8fafc;
  box-shadow: inset 4px 4px 8px #d1d9e6, inset -4px -4px 8px #ffffff;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.theme-toggle i {
  position: absolute;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, color 0.4s;
}

/* Colores de iconos específicos */
.moon-icon {
  color: #fde047;
  /* Dorado claro */
}

.sun-icon {
  color: #475569;
  /* Gris carbón / Azul suave */
}

/* Theme sensitive icon transitions */
[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: translateY(24px) rotate(90deg);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: translateY(-24px) rotate(-90deg);
}


.brand-mark {
  width: 38px;
  height: 38px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: #fff;
  box-shadow: var(--shadow-accent);
  transition: transform var(--transition-fast);
}

.navbar-brand:hover .brand-mark {
  transform: rotate(-5deg) scale(1.05);
}

.brand-text {
  color: var(--color-title);
}

.brand-dot {
  color: var(--color-accent-2);
}

/* Nav links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  position: relative;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  letter-spacing: 0.02em;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 1px;
  transition: all var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-title);
  background: rgba(139, 0, 0, 0.05);
}

.nav-link:hover::after,
.nav-link.active::after {
  left: 20%;
  right: 20%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all var(--transition-base);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav */
.mobile-nav {
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  background: var(--color-surface);
  /* Dinámico */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--container-pad) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transform: translateY(-110%);
  opacity: 0;
  transition: all var(--transition-slow);
  z-index: 999;
}

.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav a {
  padding: var(--space-4) var(--space-4);
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.mobile-nav a:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-border);
}

/* ═══════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--navbar-h);
}

/* Animated grid background */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 80%);
}

.hero-glow {
  position: absolute;
  top: 20%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 0, 0, 0.12) 0%, transparent 65%);
  pointer-events: none;
  animation: pulseGlow 4s ease-in-out infinite;
}

.hero-glow-2 {
  position: absolute;
  bottom: 10%;
  left: 5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 0, 0, 0.06) 0%, transparent 65%);
  pointer-events: none;
  animation: pulseGlow 4s ease-in-out infinite reverse;
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Hero content */

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(139, 0, 0, 0.1);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #ff7070;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-6);
  animation: fadeInDown 0.6s ease both;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: #8B0000;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(139, 0, 0, 0.8);
  animation: blink 1.5s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: var(--font-black);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--color-title);
  margin-bottom: var(--space-5);
  animation: fadeInUp 0.7s 0.1s ease both;
}

.hero-title .line-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-typewriter {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: var(--font-medium);
  color: var(--color-accent-2);
  margin-bottom: var(--space-6);
  min-height: 3rem; /* Evita que la página salte mientras escribe */
  animation: fadeInUp 0.7s 0.15s ease both;
  display: flex;
  align-items: center;
}

.typed-cursor {
  color: var(--color-accent);
  font-weight: 300;
  font-size: 1.2em;
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: var(--space-8);
  animation: fadeInUp 0.7s 0.2s ease both;
}

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  animation: fadeInUp 0.7s 0.3s ease both;
}

.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
  animation: fadeInUp 0.7s 0.4s ease both;
}


.stat-number {
  font-size: var(--text-3xl);
  font-weight: var(--font-black);
  color: var(--color-title);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-number span {
  color: var(--color-accent-2);
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: var(--space-1);
}

/* Hero visual */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeInRight 0.8s 0.2s ease both;
}

.avatar-wrapper {
  position: relative;
  width: 400px;
  height: 400px;
}

.avatar-ring {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid rgba(139, 0, 0, 0.2);
  animation: spin 20s linear infinite;
}

.avatar-ring::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  background: var(--color-accent-2);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-accent);
  transform: translateY(-50%);
}

.avatar-ring-2 {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  border: 1px solid rgba(139, 0, 0, 0.1);
  animation: spin 30s linear infinite reverse;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.avatar-img {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  object-fit: cover;
  padding: 10px;
  background: var(--glass-bg);
  border: 3px solid rgba(139, 0, 0, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), var(--shadow-lg), var(--shadow-glow);
  position: relative;
  z-index: 1;
}

.avatar-placeholder {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-surface-2), var(--color-surface));
  border: 3px solid rgba(139, 0, 0, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), var(--shadow-lg), var(--shadow-glow);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.avatar-placeholder svg {
  width: 80px;
  height: 80px;
  color: var(--color-accent-2);
  opacity: 0.8;
}

.avatar-placeholder span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  letter-spacing: 0.1em;
}

/* Floating tech tags */
.float-tag {
  position: absolute;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  /* Dinámico */
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  z-index: 2;
}

.float-tag-1 {
  top: 10%;
  right: -10%;
  animation: floatTag 3s ease-in-out infinite;
}

.float-tag-2 {
  bottom: 20%;
  left: -12%;
  animation: floatTag 3.5s 0.5s ease-in-out infinite;
}

.float-tag-3 {
  top: 55%;
  right: -15%;
  animation: floatTag 4s 1s ease-in-out infinite;
}

@keyframes floatTag {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-dim);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  animation: fadeInUp 1s 1s ease both;
}

.scroll-mouse {
  width: 22px;
  height: 35px;
  border: 1px solid var(--color-text-dim);
  border-radius: 11px;
  position: relative;
}

.scroll-mouse::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 6px;
  background: var(--color-accent-2);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDown 1.8s ease-in-out infinite;
}

@keyframes scrollDown {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0);
  }

  40% {
    opacity: 1;
  }

  80% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  100% {
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   SECTION WRAPPER
═══════════════════════════════════════════════════════════ */
.section {
  padding: var(--section-pad) 0;
  position: relative;
}

.section-alt {
  background: var(--color-surface);
  /* Dinámico */
}

.section-header {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

/* ═══════════════════════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: rgba(139, 0, 0, 0.35);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(139, 0, 0, 0.15);
  transform: translateY(-6px);
}

.project-thumb {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16/9;
  background: var(--color-surface-2);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  cursor: pointer;
}

.project-card:hover .project-thumb img {
  transform: scale(1.06);
}

.project-impact {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  font-size: 13px;
  color: var(--color-white);
  font-weight: var(--font-medium);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--color-accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.project-impact span {
  font-style: italic;
  opacity: 0.9;
  color: var(--color-title);
}


.project-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-surface-2), #0d0d0d);
}

.project-thumb-placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--color-text-dim);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.9) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-overlay .btn {
  flex: 1;
  justify-content: center;
}

.project-body {
  padding: var(--space-5) var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-title);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: var(--space-4);
  flex: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tech-tag {
  padding: 3px 10px;
  background: rgba(139, 0, 0, 0.1);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-family: var(--font-mono);
  color: #d47070;
  transition: all var(--transition-fast);
}

.project-card:hover .tech-tag {
  background: rgba(139, 0, 0, 0.15);
  border-color: rgba(139, 0, 0, 0.35);
}

/* ═══════════════════════════════════════════════════════════
   SKILLS - TECH CARDS REDESIGN
   ═══════════════════════════════════════════════════════════ */
.skills-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.skill-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.skill-category-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-title);
  letter-spacing: -0.01em;
  position: relative;
  padding-left: var(--space-4);
}

.skill-category-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
}

.tech-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all var(--transition-base);
  cursor: default;
}

.tech-card:hover {
  border-color: rgba(139, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 0, 0, 0.1);
}

.tech-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tech-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0.9);
  transition: all var(--transition-base);
}

.tech-card:hover .tech-icon img {
  filter: brightness(1);
  transform: rotate(8deg) scale(1.1);
}

.tech-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.tech-card:hover .tech-name {
  color: var(--color-title);
}

.tech-fallback {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--color-accent-2);
}

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX / PROJECT MODAL
   ═══════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: var(--space-8);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 1200px;
  width: 95%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-img-wrapper {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.lightbox-nav:hover {
  background: var(--color-accent);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
}

.lightbox-nav.prev {
  left: var(--space-6);
}

.lightbox-nav.next {
  right: var(--space-6);
}

.lightbox-img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  /* Imagen más grande */
  display: block;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: var(--color-accent);
  transform: rotate(90deg) scale(1.1);
}


.lightbox-close span {
  display: none;
}

.lightbox-info {
  text-align: center;
  padding: var(--space-6) var(--space-8);
  background: var(--color-surface);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  z-index: 5;
  position: relative;
}

.lightbox-title {
  font-size: var(--text-2xl);
  /* Título más grande */
  font-weight: var(--font-bold);
  color: var(--color-title);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.lightbox-desc {
  color: #a0a0a0;
  /* Gris más claro para mejor lectura en fondo oscuro */
  font-size: var(--text-sm);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.lightbox-counter {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent-2);
  font-weight: 500;
}

/* Project Actions */
.project-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gallery:hover {
  box-shadow: 0 0 15px rgba(139, 0, 0, 0.3);
}


/* ═══════════════════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════════════════ */
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-16);
  align-items: start;
}

.contact-info {
  /* layout defined by parent grid */
}

.contact-info-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-title);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.contact-info-text {
  color: var(--color-text-muted);
  line-height: 1.75;
  font-size: var(--text-base);
  margin-bottom: var(--space-8);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-link-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════════
   BACK TO TOP BUTTON
   ═══════════════════════════════════════════════════════════ */
.back-to-top,
.whatsapp-btn {
  position: fixed;
  bottom: var(--space-8);
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  /* Dinámico */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top {
  right: var(--space-8);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--color-title);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.whatsapp-btn {
  left: var(--space-8);
  background: #25D366;
  border: 1px solid #1eaa51;
  color: white;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.back-to-top.visible,
.whatsapp-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--gradient-accent);
  border-color: transparent;
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.whatsapp-btn:hover {
  background: #1eaa51;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 16px rgba(37, 211, 102, 0.4);
}

@media (max-width: 768px) {

  .back-to-top,
  .whatsapp-btn {
    bottom: var(--space-6);
    width: 40px;
    height: 40px;
  }

  .back-to-top {
    right: var(--space-6);
  }

  .whatsapp-btn {
    left: var(--space-6);
  }
}


.contact-link-icon {
  width: 36px;
  height: 36px;
  background: rgba(139, 0, 0, 0.1);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-2);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.contact-link-icon img {
  display: block;
}

.contact-link-item:hover .contact-link-icon {
  background: rgba(139, 0, 0, 0.2);
}

/* Form */
.contact-form-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-10);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.form-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-title);
  margin-bottom: var(--space-6);
  letter-spacing: -0.01em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  outline: none;
  transition: all var(--transition-base);
  resize: none;
}

.form-control::placeholder {
  color: var(--color-text-dim);
}

.form-control:focus {
  border-color: rgba(139, 0, 0, 0.5);
  background: rgba(139, 0, 0, 0.04);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

textarea.form-control {
  min-height: 130px;
}

.form-msg {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  display: none;
  border: 1px solid transparent;
}

.form-msg.success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  display: block;
}

.form-msg.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-10) 0;
  background: var(--color-surface);
  /* Dinámico */
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-copy {
  font-size: var(--text-sm);
  color: var(--color-text-dim);
}

.footer-copy strong {
  color: var(--color-accent-2);
  font-weight: var(--font-semi);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
}

.footer-link {
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-title);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

.footer-brand-dot {
  color: var(--color-accent-2);
  font-size: 20px;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-visual {
    order: -1;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-description {
    margin: 0 auto var(--space-8);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-inner {
    grid-template-columns: 1fr;
  }

  .contact-form-card {
    padding: var(--space-6) var(--space-6);
  }
}

@media (max-width: 768px) {
  .navbar-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .tech-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .avatar-wrapper {
    width: 300px;
    height: 300px;
  }

  .avatar-img,
  .avatar-placeholder {
    width: 300px;
    height: 300px;
  }

  .float-tag {
    display: none;
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-5);
  }

  .contact-form-card {
    padding: var(--space-5);
  }
}