/* Base Reset & Variables */
:root {
  /* Dark Theme Colors (Default) */
  --bg-color: #050505;
  --surface-color: rgba(255, 255, 255, 0.03);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.05);
  
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1aa;
  
  --primary-color: #3b82f6; /* Blue */
  --primary-hover: #2563eb;
  
  --glow-1: rgba(59, 130, 246, 0.2);
  --glow-2: rgba(139, 92, 246, 0.2);
  
  --glass-bg: rgba(10, 10, 10, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg-color: #fafafa;
  --surface-color: rgba(0, 0, 0, 0.02);
  --surface-border: rgba(0, 0, 0, 0.08);
  --surface-hover: rgba(0, 0, 0, 0.04);
  
  --text-primary: #171717;
  --text-secondary: #52525b;
  
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  
  --glow-1: rgba(59, 130, 246, 0.1);
  --glow-2: rgba(139, 92, 246, 0.1);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.05);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Background Effects */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.7;
}

.glow-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--glow-1) 0%, transparent 70%);
}

.glow-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--glow-2) 0%, transparent 70%);
}

/* Layout */
.container {
  width: min(1000px, 90%);
  margin: 0 auto;
}

.section {
  padding: 5rem 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(to right, #3b82f6, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.title-icon {
  color: var(--primary-color);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  font-size: 1.5rem;
  font-family: var(--font-display);
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

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

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

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

/* Language Selector */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-right: 0.5rem;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.3s ease;
}

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

.lang-btn.active {
  color: var(--primary-color);
  pointer-events: none;
}

.lang-separator {
  color: var(--glass-border);
  font-weight: 300;
  opacity: 0.5;
}

.theme-toggle, .menu-toggle {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.theme-toggle:hover, .menu-toggle:hover {
  background: var(--surface-hover);
}

.menu-toggle {
  display: none;
}

/* Glass Card styling */
.glass {
  background: var(--surface-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .glass:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-color);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

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

[data-theme="light"] .btn-secondary:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
  padding-top: 10rem;
  padding-bottom: 5rem;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981; /* emerald */
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 650px;
}

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

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

/* Timeline (Experiencia) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 2px;
  background: var(--surface-border);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 1.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid var(--bg-color);
  box-shadow: 0 0 0 4px var(--surface-border);
  z-index: 2;
}

.timeline-content {
  padding: 1.5rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.role {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.company {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 500;
}

.period {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  background: var(--surface-color);
  border-radius: 20px;
  border: 1px solid var(--surface-border);
}

.timeline-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.timeline-content strong {
  color: var(--text-primary);
}

/* Certifications */
.certifications-section {
  margin-top: 3rem;
}

.subsection-title {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--primary-color);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.cert-item:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
}

.cert-item .dev-icon {
  width: 36px;
  height: 36px;
  background-color: var(--primary-color);
  flex-shrink: 0;
}

.cert-info h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.cert-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Projects Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-content {
  padding: 1.5rem;
  flex-grow: 1;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.project-header .project-title {
  margin-bottom: 0;
}

.project-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

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

.tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-weight: 500;
}

.project-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--surface-border);
  display: flex;
  gap: 0.5rem;
}

/* About Section */
.about-content {
  padding: 2rem;
}

.about-content p {
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

.about-content strong {
  color: var(--text-primary);
}

/* Contact Section */
.contact-card {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contact-desc {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 1rem auto 2rem;
  font-size: 1.05rem;
}

.contact-btn {
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--surface-border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  .nav {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-150%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 40;
  }
  
  .nav.open {
    transform: translateY(0);
    opacity: 1;
  }
  
  .timeline-header {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Skills Section */
.skills-container {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.skills-group h3 {
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.tags.large {
  gap: 0.8rem;
}

.tags.large .tag {
  font-size: 0.95rem;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.tags.large .tag:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.tags.outline .tag {
  background: transparent;
  border: 1px dashed var(--surface-border);
}

.tags.outline .tag:hover {
  border: 1px solid var(--primary-color);
}

/* Icon specific styling */
.tag {
  display: inline-flex;
  align-items: center;
}

.dev-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  background-color: currentColor;
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

.tag-highlight {
  border-color: var(--primary-color) !important;
  background: rgba(59, 130, 246, 0.05) !important;
}

.tag-highlight:hover {
  background: rgba(59, 130, 246, 0.1) !important;
}
