:root {
  --bg: #07090e;
  --bg-surface: #0d121d;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-solid: #121826;
  --bg-navbar: rgba(7, 9, 14, 0.85);
  --bg-footer: #040609;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.4);
  --text: #f1f5f9;
  --text-muted: #8b9bb4;
  --primary: #3b82f6;
  --accent: #00f2fe;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --glow: rgba(0, 242, 254, 0.15);
  --radius: 16px;
  --chip-bg: rgba(255, 255, 255, 0.05);
  --techbar-bg: rgba(13, 18, 29, 0.85);
  --copy-bg: rgba(255, 255, 255, 0.03);
  --featured-bg: linear-gradient(135deg, rgba(18, 24, 38, 0.85), rgba(30, 27, 75, 0.4));
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-surface: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-navbar: rgba(255, 255, 255, 0.9);
  --bg-footer: #e2e8f0;
  --border: rgba(15, 23, 42, 0.12);
  --border-hover: rgba(37, 99, 235, 0.45);
  --text: #0f172a;
  --text-muted: #475569;
  --glow: rgba(37, 99, 235, 0.12);
  --chip-bg: rgba(15, 23, 42, 0.05);
  --techbar-bg: rgba(255, 255, 255, 0.95);
  --copy-bg: rgba(15, 23, 42, 0.04);
  --featured-bg: linear-gradient(135deg, #ede9fe, #e0f2fe);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Canvas de fondo con partículas */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Barra de navegación */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--bg-navbar);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.mobile-menu-btn span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  transform: scale(1.08);
}

.icon-moon {
  display: none;
}

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

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease;
}

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

.logo-emblem {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card-solid);
  border: 1px solid rgba(0, 242, 254, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
  transition: all 0.3s ease;
}

.logo:hover .logo-emblem {
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(0, 242, 254, 0.45);
  transform: scale(1.06);
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

[data-theme="light"] .accent {
  color: #0284c7;
}

[data-theme="light"] .project-tagline {
  color: #0284c7;
}

[data-theme="light"] .highlight-badge {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #059669;
}

[data-theme="light"] .model-badge {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(217, 119, 6, 0.5);
  color: #b45309;
}

[data-theme="light"] .gemini-badge {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
}

[data-theme="light"] .deepseek-badge {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(2, 132, 199, 0.45);
  color: #0369a1;
}

[data-theme="light"] .project-badge {
  color: #0369a1;
}

[data-theme="light"] .badge-sub {
  color: #0369a1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
}

.nav-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #34d399;
}

/* Hero */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 70px;
  z-index: 1;
}

.hero-content {
  max-width: 820px;
  margin: 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  border-radius: 99px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 28px;
}

[data-theme="light"] .status-pill {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #0369a1;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 30%, #8b5cf6 70%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.typewriter-container {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: 24px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cursor {
  animation: blink 1s infinite;
  color: var(--accent);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 99px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #00f2fe, #3b82f6);
  color: #050b14;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px rgba(0, 242, 254, 0.6);
}

.btn-secondary {
  background: var(--chip-bg);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--chip-bg);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.tech-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: var(--techbar-bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  backdrop-filter: blur(10px);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tech-pill {
  color: var(--text);
  opacity: 0.85;
}

.tech-dot {
  color: var(--accent);
}

/* Secciones Generales */
.section {
  padding: 110px 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.08), transparent);
}

.section-heading {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px;
}

.badge-sub {
  display: inline-block;
  font-family: 'Space Grotesk', monospace;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Sobre Mí */
.about-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 48px;
  align-items: center;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
}

.avatar-glow {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.3);
}

.avatar {
  width: 100%;
  height: 100%;
  background: var(--bg-card-solid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
}

.profile-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.role {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.about-content .text-lead {
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.6;
}

.about-content .text-body {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 32px;
  line-height: 1.7;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.value-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--copy-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.value-icon {
  font-size: 1.5rem;
}

.value-item strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.value-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Intereses / Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.glass-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 30px;
  backdrop-filter: blur(12px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-hover);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 242, 254, 0.1);
}

.card-icon-box {
  width: 56px;
  height: 56px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 24px;
}

.glass-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.glass-card p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.card-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.8rem;
  color: var(--accent);
}

/* Proyectos */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  backdrop-filter: blur(12px);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 242, 254, 0.1);
}

.featured-project {
  border-color: rgba(139, 92, 246, 0.35);
  background: var(--featured-bg);
}

.featured-project:hover {
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3), 0 0 40px rgba(139, 92, 246, 0.25);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Proyecto Top & Logos */
.project-top {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}

.project-logo-wrap {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.round-wrap {
  border-radius: 50%;
  background: #ffffff;
}

.project-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.project-card:hover .project-logo-wrap {
  transform: scale(1.06) rotate(1deg);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.25);
}

.project-main-info {
  flex: 1;
  min-width: 0;
}

.badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-badge {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.highlight-badge {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.model-badge {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Space Grotesk', monospace;
}

.gemini-badge {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #60a5fa;
}

.deepseek-badge {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(14, 165, 233, 0.25));
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #00f2fe;
}

.project-year {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.project-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.7rem;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.project-tagline {
  color: var(--accent);
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.project-desc {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

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

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

.project-tech span {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 8px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.project-card:hover .project-tech span {
  border-color: var(--border-hover);
  color: var(--text);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 45px 0;
  background: var(--bg-footer);
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.footer-copy p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 868px) {
  .about-grid { grid-template-columns: 1fr; }
  .project-card { padding: 24px; }
  .project-card h3 { font-size: 1.4rem; }
  .project-top { flex-direction: column; align-items: flex-start; gap: 16px; }
  .contact-card { grid-template-columns: 1fr; padding: 32px 24px; }
  .hero { min-height: auto; padding: 110px 20px 60px; }
  .hero-title { font-size: 2.3rem; }
  .hero-description { font-size: 1rem; }
  .nav-controls { gap: 10px; }
  .nav-badge { display: none; }
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-navbar);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 0; font-size: 1.05rem; }
  .mobile-menu-btn { display: flex; }
}

@media (max-width: 480px) {
  .logo-text { font-size: 1.15rem; }
  .hero-title { font-size: 2rem; }
  .section-title { font-size: 1.7rem; }
  .tech-bar { font-size: 0.75rem; padding: 8px 14px; }
  .project-logo-wrap { width: 72px; height: 72px; }
  .project-card h3 { font-size: 1.25rem; }
  .project-desc { font-size: 0.95rem; }
  .footer-content { flex-direction: column; text-align: center; }
}
