/* ============================================================
   REX-3D PORTFOLIO — Professional Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg-color: #070b14;
  --bg-secondary: #0a0f1a;
  --card-bg: #0d1420;
  --card-bg-hover: #111a2a;
  --text-primary: #e8f4ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-color: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-dark: #0284c7;
  --accent-violet: #a78bfa;
  --accent-violet-glow: rgba(167, 139, 250, 0.25);
  --accent-glow: rgba(56, 189, 248, 0.25);
  --accent-subtle: rgba(56, 189, 248, 0.08);
  --gradient-accent: linear-gradient(135deg, #38bdf8, #a78bfa, #0284c7);
  --gradient-bg: linear-gradient(180deg, #070b14 0%, #0a0f1a 100%);
  --border-color: rgba(56, 189, 248, 0.15);
  --border-hover: rgba(56, 189, 248, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.25);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-main);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Global Text Selection --- */
::selection {
  background: var(--accent-light) !important;
  color: #101014 !important;
  -webkit-text-fill-color: #101014 !important;
}

::-moz-selection {
  background: var(--accent-light) !important;
  color: #101014 !important;
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 6px;
  border: 3px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* --- Interactive Particle Background --- */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none; /* NUNCA interceptar toques — los eventos van en window */
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  /* background-image: var(--gradient-bg); removed for vignette */
  color: var(--text-primary);
  font-size: 16.5px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(60px) scale(0.95);
  transition: opacity 1s cubic-bezier(0.25, 0.8, 0.25, 1),
              transform 1s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: opacity, transform;
}

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

.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; }

/* --- Advanced Animations --- */
@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.floating {
  animation: float 4s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.shimmer-effect {
  position: relative;
  overflow: hidden;
}

.shimmer-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  transition: transform var(--transition-smooth);
}

.shimmer-effect:hover::after {
  animation: shimmer 1s ease-out forwards;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: rgba(10, 10, 11, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 0 2rem;
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
}

/* Hide logo link (text removed from header) */
.logo-link {
  display: none;
}

nav {
  display: flex;
  align-items: center;
}

.header-lang-wrapper {
  position: absolute;
  right: 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.lang-selector-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-selector-header .lang-btn svg,
.lang-selector-header .lang-icon {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
}

.lang-selector-header .lang-text {
  display: none;
}

header.scrolled {
  background: rgba(10, 10, 11, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  height: 64px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: 0.05em;
  transition: all var(--transition-smooth);
}

header.scrolled .logo-text {
  font-size: 1.5rem;
}

.logo-text:hover {
  transform: scale(1.06);
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* --- Language Selector --- */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  margin-right: 1.5rem;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem;
  transition: all var(--transition-fast);
}

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

.lang-btn.active {
  color: var(--accent-light);
  transform: scale(1.1);
}

.lang-divider {
  color: var(--border-color);
  font-size: 0.9rem;
}

/* --- Navigation --- */
nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
}

nav ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  transition: all var(--transition-fast);
  position: relative;
  letter-spacing: 0.01em;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

nav ul li a.active {
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
}

/* --- Mobile Menu Button --- */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* ============================================================
   HERO / ABOUT SECTION (Modern Redesign)
   ============================================================ */
.hero-modern {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  padding: 4rem 2rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: visible;
}

.hero-content {
  flex: 1 1 500px;
  max-width: 650px;
  z-index: 2;
}

.subtitle-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1.5rem;
  padding: 0.4rem 1.2rem;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 50px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.typing-container {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  min-height: 2rem;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all var(--transition-smooth);
}

.btn-primary {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
}

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

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

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

.hero-contact-chips .chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.hero-contact-chips .chip:hover {
  color: var(--text-primary);
  border-color: var(--accent-color);
  background: rgba(56, 189, 248, 0.05);
}

.hero-contact-chips .chip svg {
  color: var(--accent-color);
}

/* Right Side: Avatar */
.hero-visual {
  flex: 1 1 400px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.avatar-container {
  position: relative;
  width: 350px;
  height: 350px;
}

.glow-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 60px rgba(56, 189, 248, 0.3), inset 0 0 40px rgba(56, 189, 248, 0.1);
  z-index: -1;
  animation: pulseGlowRing 4s infinite alternate ease-in-out;
}

@keyframes pulseGlowRing {
  0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(0,0,0,0.5));
}

.badge {
  position: absolute;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.75rem 1.2rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  z-index: 3;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: floatBadge 4s ease-in-out infinite;
  color: var(--text-primary);
  text-align: center;
}

.badge svg {
  color: var(--accent-light);
}

.badge-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-light);
}

.badge-subtitle, .badge span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.badge-tl { top: 0; left: -30px; animation-delay: 0s; }
.badge-tr { top: 20px; right: -40px; animation-delay: 1s; }
.badge-bl { bottom: 20px; left: -10px; animation-delay: 2s; }
.badge-br { bottom: -10px; right: 0px; animation-delay: 3s; }

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

/* Stats Bar */
.hero-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20, 25, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 2rem 3rem;
  margin-bottom: 5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-info h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  line-height: 1.1;
}

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

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive Hero */
@media (max-width: 992px) {
  .hero-modern {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem; /* Reducir espacio entre foto y texto */
    padding: 1.5rem 0;
  }
  
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .hero-contact-chips {
    justify-content: center;
  }
  
  .hero-stats-bar {
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    justify-content: center;
  }
  
  .stat-divider {
    display: none;
  }
  
  .stat-item {
    width: 40%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.4rem; }
  .avatar-container { width: 220px; height: 220px; }
  .glow-ring { width: 270px; height: 270px; }
  /* Ocultar badges flotantes en móvil — generan espacio extra */
  .badge { display: none; }
  .stat-item { width: 100%; }
  /* Reducir el margen del contenedor del avatar */
  .hero-visual { flex: 0 0 auto; padding-bottom: 0; margin-bottom: 0; }
  .hero-modern { gap: 1rem !important; padding-top: 1rem; }
}

/* Contact Section — Direct Info Cards */
.contact-direct {
  text-align: center;
}

.contact-cards {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 3rem;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-smooth);
  min-width: 250px;
}

.contact-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px var(--accent-violet-glow);
}

.contact-card svg {
  color: var(--accent-color);
}

.contact-card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 600;
}

.contact-card-value {
  font-size: 1.05rem;
  color: var(--accent-light);
  font-weight: 500;
}

/* Hide logo link (text removed from header) */
.logo-link {
  display: none;
}

/* ============================================================
   SECTION BLOCKS
   ============================================================ */
.bloques_main {
  margin-bottom: 5rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-header .section-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  font-size: 1.2rem;
  border: 1px solid rgba(99, 102, 241, 0.15);
  flex-shrink: 0;
}

.section-header h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Legacy header style */
.bloques_main > .texto-titulo2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--accent-color);
  text-transform: none;
}

/* ============================================================
   CONNECT SECTION
   ============================================================ */
.connect-section {
  margin-bottom: 5rem;
}

.section-header-inline {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-header-inline h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.line-divider {
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.5) 0%, transparent 100%);
}

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

.connect-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(20, 25, 35, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-smooth);
}

.connect-card:hover {
  background: rgba(20, 25, 35, 0.8);
  border-color: var(--accent-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.connect-icon,
.connect-card i {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.connect-info {
  display: flex;
  flex-direction: column;
}

.connect-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.connect-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ============================================================
   HEADER LANGUAGE SELECTOR
   ============================================================ */
.header-lang-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-selector-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-subtle);
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.lang-selector-header .lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.lang-selector-header .lang-btn.active {
  background: var(--accent-color);
  color: white;
}

@media (max-width: 768px) {
  .nav-text {
    display: none;
  }
}

/* ============================================================
   SERVICES GRID (Desarrollo & Automatización)
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.service-card {
  background: linear-gradient(145deg, rgba(30, 35, 45, 0.4) 0%, rgba(15, 15, 20, 0.8) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.15);
}

.service-img-container {
  width: 100%;
  aspect-ratio: 3 / 1; /* Formato panorámico extremo solicitado */
  overflow: hidden;
  position: relative;
  background: rgba(30, 30, 35, 0.3); /* Fondo neutro */
}

.service-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.service-card:hover .service-img-container img {
  transform: scale(1.08);
}

.service-info {
  padding: 1.5rem;
  flex-grow: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.service-info h4 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--accent-light);
  margin-bottom: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.service-info p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  .service-img-container {
    height: 200px;
  }
}

/* ============================================================
   TABS & TRAYECTORIA
   ============================================================ */
.tabs-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tabs-header {
  display: flex;
  gap: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1.5rem;
  position: relative;
  transition: all var(--transition-smooth);
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -0.65rem;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent-color);
  transition: width var(--transition-smooth);
  border-radius: 50px;
}

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

.tab-btn.active {
  color: var(--text-primary);
}

.tab-btn.active::after {
  width: 100%;
}

.tab-content {
  display: none;
  animation: modalFadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-color), rgba(99, 102, 241, 0.05));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.timeline-dot {
  position: absolute;
  left: -34px;
  top: 20px;
  width: 12px;
  height: 12px;
  background: var(--accent-color);
  border-radius: 50%;
  border: 3px solid var(--bg-color);
  box-shadow: 0 0 0 3px var(--accent-subtle), 0 0 12px var(--accent-glow);
  z-index: 2;
  transition: all var(--transition-smooth);
  animation: pulseDot 2s infinite;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.5);
  box-shadow: 0 0 0 4px var(--accent-subtle), 0 0 20px var(--accent-violet-glow);
}

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  width: 100%;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  transform-style: preserve-3d;
}

.timeline-content:hover {
  transform: perspective(800px) rotateY(5deg) translateX(10px) translateZ(10px);
  border-color: var(--border-hover);
  box-shadow: -10px 10px 30px var(--accent-violet-glow);
  background: var(--card-bg-hover);
}

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

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.02em;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--accent-light);
  font-weight: 600;
  background: var(--accent-subtle);
  padding: 0.2rem 0.75rem;
  border-radius: 50px;
  white-space: nowrap;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.timeline-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   SKILLS — TECHNICAL ABILITIES
   ============================================================ */
.skills-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.skill-badge {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  cursor: default;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-badge svg {
  color: var(--accent-light);
}

.skill-badge:hover {
  background: var(--accent-color);
  border-color: var(--accent-light);
  color: #101014;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.skill-badge:hover svg {
  color: #101014;
}

.skill-badge::selection,
.skill-badge *::selection {
  background: var(--accent-light) !important;
  color: #101014 !important;
  -webkit-text-fill-color: #101014 !important;
}

/* ============================================================
   SOFTWARE & TECHNOLOGIES — CATEGORY SECTIONS
   ============================================================ */
.tech-categories-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.tech-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.tech-category {
  margin-bottom: 0;
}

.tech-category:last-child {
  margin-bottom: 0;
}

.tech-category-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tech-category-label .cat-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.6rem;
}

.skill-card {
  width: 120px;
  flex-grow: 1;
  max-width: 140px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.skill-card.shimmer-effect::after {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* ============================================================
   VOXEL SPAWN EFFECT
   ============================================================ */
.voxel-particle {
  position: absolute;
  background-color: var(--accent-light);
  box-shadow: 0 0 10px var(--accent-color);
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  animation: voxelSpawn 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes voxelSpawn {
  0% {
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale(0) rotate(0deg);
  }
  30% {
    opacity: 0.8;
    transform: translate3d(0, 0, 0) scale(1) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--vx), var(--vy), 0) scale(0.1) rotate(90deg);
  }
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.skill-card:hover {
  transform: perspective(800px) rotateX(15deg) rotateY(-15deg) scale(1.05) translateZ(20px);
  background: var(--card-bg-hover);
  border-color: var(--border-hover);
  box-shadow: -15px 15px 40px var(--accent-violet-glow), inset 0 0 20px rgba(56, 189, 248, 0.1);
}

.skill-icon {
  font-size: 42px;
  transition: transform var(--transition-bounce);
  z-index: 1;
}

.skill-card:hover .skill-icon {
  transform: scale(1.12);
}

.skill-icon-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  transition: transform var(--transition-bounce);
  z-index: 1;
}

.skill-card:hover .skill-icon-img {
  transform: scale(1.12);
}

.skill-card span {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 1;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.skill-card:hover span {
  color: var(--text-primary);
}

/* ============================================================
   PORTFOLIO PAGE — IMAGE GRID & CAROUSEL
   ============================================================ */
.portfolio-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
  /* side mask to fade out edges */
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.portfolio-grid.carousel {
  display: flex;
  overflow-x: scroll;
  gap: 2rem;
  padding: 1rem 0 3rem 0;
  /* hide native scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: auto; /* Handle smoothly in JS instead of CSS snap */
}

.portfolio-grid.carousel::-webkit-scrollbar {
  display: none;
}

.portfolio-grid.carousel .image-container {
  flex: 0 0 320px;
  cursor: grab;
}

.portfolio-grid.carousel.active .image-container {
  cursor: grabbing;
}

.image-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  aspect-ratio: 1/1;
  border: 1px solid var(--border-color);
  transition: all var(--transition-smooth);
}

.image-container:hover {
  border-color: var(--border-hover);
  box-shadow: 15px 15px 40px var(--accent-violet-glow), -15px -15px 40px rgba(167, 139, 250, 0.15);
  transform: perspective(1000px) rotateY(-10deg) rotateX(5deg) scale(1.02) translateZ(30px);
  z-index: 10;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.image-container:hover img {
  transform: scale(1.08);
}

.image-container .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(10, 10, 11, 0.92) 0%, rgba(10, 10, 11, 0.3) 40%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.image-container:hover .overlay {
  opacity: 1;
}

.image-container .description {
  color: white;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  transform: translateY(12px);
  transition: transform var(--transition-smooth);
  letter-spacing: 0.02em;
}

.image-container:hover .description {
  transform: translateY(0);
}

/* Legacy table support for portfolio */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1rem;
  background: transparent;
}

td {
  padding: 0;
  border: none;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(10px);
  cursor: pointer;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  margin: auto;
  display: block;
  width: 85%;
  max-width: 1100px;
  max-height: 90vh;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-md);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
  animation: modalZoomIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modalZoomIn {
  from {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
  text-align: center;
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

footer .footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

footer .footer-links a:hover {
  color: var(--accent-light);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 768px) {
  header {
    padding: 0 1.5rem;
    height: 64px;
  }

  .menu-toggle {
    display: flex;
  }

  nav {
    position: fixed;
    top: 0;
    left: auto;
    right: -100%;
    transform: none;
    width: 280px;
    height: 100vh;
    background: rgba(16, 16, 20, 0.98);
    backdrop-filter: blur(20px);
    padding: 5rem 2rem 2rem;
    transition: right var(--transition-smooth);
    border-left: 1px solid var(--border-color);
    z-index: 999;
  }

  nav.open {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  nav ul li a {
    display: block;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
  }

  .main-content {
    padding: 2.5rem 1.25rem 4rem;
  }

  .sobremi {
    flex-direction: column;
    text-align: center;
    padding: 2.5rem 2rem;
    gap: 2.5rem;
  }

  .profile-img {
    width: 200px;
    height: 200px;
  }

  .texto-titulo {
    font-size: 2rem;
  }

  .parrafo {
    text-align: center;
    max-width: 100%;
  }

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

  .skills-grid {
    gap: 0.75rem;
  }

  .skill-card {
    padding: 1rem 0.75rem;
  }

  .skills-list {
    grid-template-columns: 1fr;
  }

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

  table {
    border-spacing: 0.5rem;
  }
}

@media (max-width: 480px) {
  .texto-titulo {
    font-size: 1.65rem;
  }

  .section-header h3 {
    font-size: 1.3rem;
  }

  .profile-img {
    width: 170px;
    height: 170px;
  }
}

/* ============================================================
   UTILITY — PAGE LOADER
   ============================================================ */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 30px; /* Bajado para versión web estándar */
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  opacity: 1; /* SIEMPRE VISIBLE como solicitó el usuario */
  visibility: visible;
  transform: translateY(0);
  transition: all var(--transition-smooth);
  z-index: 900;
}

.back-to-top.visible {
  /* Ya no necesita ser modificado porque siempre está visible */
}

.back-to-top:hover {
  background: var(--accent-dark);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.3);
}

/* ============================================================
   TYPING CURSOR & TEXT (Matched to Main Title)
   ============================================================ */
.typing-container {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 400;
  margin: -1.75rem 0 1.5rem 0; /* Margen negativo para acercarlo al título principal */
  line-height: 1.15;
  letter-spacing: 0.05em;
  color: var(--accent-light);
}

.typing-cursor {
  font-weight: 300;
  animation: blink 0.8s step-end infinite;
  color: var(--accent-light);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-md);
}

.contact-intro {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.btn-submit {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-color), var(--accent-light), var(--accent-dark));
  background-size: 300% 300%;
  color: #000;
  border: none;
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  animation: gradientMove 3s ease infinite;
}

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

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-wrapper {
    padding: 2rem 1.5rem;
  }

  .btn-submit {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   ACCESSIBILITY - FOCUS STATES
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px var(--accent-subtle);
  border-radius: var(--radius-sm);
  transition: outline-color var(--transition-fast);
}

.image-container:focus-visible {
  border-color: var(--accent-light);
  outline-offset: 6px;
  transform: perspective(1000px) rotateY(-5deg) rotateX(2deg) scale(1.02);
}

.image-container:focus-visible .overlay {
  opacity: 1;
}

.image-container:focus-visible .description {
  transform: translateY(0);
}

.lang-btn:focus-visible {
  outline-offset: 2px;
}

/* Double Carousel Styles */
.portfolio-grid.carousel {
  padding: 0.5rem 0 1rem 0; /* Reduced padding between the two rows */
}

/* Ensure the right-scrolling carousel logic handles clones */
.portfolio-grid.carousel-right {
  /* direction: rtl removed to avoid conflict with JS scrollLeft logic */
}

/* Hide icons on desktop, show only text */
nav ul li a .nav-icon {
  display: none;
}

@media (max-width: 768px) {
  /* Hide the hamburger menu completely */
  .menu-toggle {
    display: none !important;
  }

  /* Make header smaller and handle layout without menu toggle */
  header {
    height: 60px;
    justify-content: space-between;
    padding: 0 1rem; /* Margen para pantallas pequeñas */
  }

  /* Switch style lang selector en móvil */
  .lang-selector-header {
    background: rgba(40, 40, 45, 0.6);
    border-radius: 20px;
    padding: 3px;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
    position: relative;
    display: flex;
    /* NO pointer-events:none aquí — los botones deben ser clickeables */
  }

  /* El bloque deslizante (la luz del switch) */
  .lang-selector-header::before {
    content: '';
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    background: var(--accent-color);
    border-radius: 15px;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
    z-index: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  }

  /* Si el idioma de la página es inglés, deslizar a la derecha */
  html[lang="en"] .lang-selector-header::before {
    transform: translateX(100%);
  }

  .lang-divider {
    display: none !important;
  }

  .lang-selector-header .lang-btn {
    padding: 6px 12px;
    position: relative;
    z-index: 10;
    pointer-events: auto; /* Fuerza clicabilidad en el botón */
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 15px;
    flex: 1;
    display: flex;
    justify-content: center;
  }

  .lang-selector-header .lang-icon {
    display: none !important;
  }

  .lang-selector-header .lang-text {
    display: block !important;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
  }

  .lang-selector-header .lang-btn.active .lang-text {
    color: #000; /* Texto oscuro para destacar sobre el neón verde */
  }
  
  .logo-text {
    display: none !important; /* Ocultar nombre en móvil para liberar espacio */
  }

  .logo-link {
    flex-shrink: 1;
    overflow: hidden;
  }

  .mobile-img {
    display: flex !important;
    margin-bottom: 1.5rem;
  }

  .desktop-img {
    display: none !important;
  }

  .back-to-top {
    bottom: 90px !important; /* Altura de seguridad para no chocar con el nav móvil */
  }

  /* Evitar saltos de línea y descuadre en el Hero durante la escritura */
  .typing-container {
    font-size: 1.3rem !important; /* Aún más pequeño para máxima seguridad */
    min-height: 2.5rem; /* Reserva de espacio vertical estricta */
    margin-top: -0.5rem;
    white-space: nowrap; /* Obliga a mantener todo en 1 sola línea */
  }

  /* Navigation Bar for Mobile (Inside Header) */
  nav {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    backdrop-filter: none;
    border: none;
    padding: 0;
    flex: 1;
    display: flex;
    justify-content: flex-start;
    transform: none !important;
  }

  nav ul {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
  }

  nav ul li {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
  }

  nav ul li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    color: var(--text-muted);
  }

  /* Show icons and hide text on mobile */
  nav ul li a .nav-icon {
    display: block !important;
    margin-bottom: 2px;
  }
  
  nav ul li a .nav-text {
    display: none !important;
  }

  nav ul li a:hover,
  nav ul li a:active {
    background: transparent;
    color: var(--accent-light);
  }

  /* Fix: Forzar el wrapper de idioma a participar en el flex del header */
  .header-lang-wrapper {
    position: static !important;
    right: auto !important;
    flex-shrink: 0;
    z-index: 1001;
  }

  /* Separar un poco la imagen del texto */
  .subtitle-label {
    margin-top: 0.8rem;
  }

  /* Remove bottom padding since nav is at the top again */
  .main-content {
    padding-bottom: 0px; 
  }
}

/* ============================================================
   VIGNETTE / SPOTLIGHT EFFECT
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 30%, rgba(56, 189, 248, 0.08) 0%, rgba(167, 139, 250, 0.04) 30%, rgba(10, 10, 11, 0.7) 60%, rgba(5, 5, 6, 0.95) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   TABS — PERFIL TÉCNICO / ARTÍSTICO
   ============================================================ */
.tabs-container {
  width: 100%;
}

.tabs-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: rgba(20, 20, 22, 0.6);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  border: 1px solid var(--border-color);
  width: fit-content;
}

.tab-btn {
  padding: 0.6rem 1.6rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
}

.tab-btn:hover {
  color: var(--accent-light);
  background: rgba(56, 189, 248, 0.08);
}

.tab-btn.active {
  background: var(--gradient-accent);
  color: #000;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

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

/* Aplicar suavidad a la transición de texto */
[data-i18n] {
  transition: opacity 0.3s ease;
}
