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

/* Reset y variables */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colores principales */
  --bg-primary: #0a0a14;
  --bg-secondary: #12121e;
  --bg-tertiary: #1a1a2e;

  /* Colores de acento */
  --accent-purple: #8a2be2;
  --accent-blue: #00b7ff;
  --accent-pink: #ff00ff;
  --accent-rose: #ff007f;
  /* Added from root style */

  /* Colores de texto */
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0c0;
  --text-muted: #808090;

  /* Bordes y efectos */
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --glow-effect: 0 0 20px rgba(138, 43, 226, 0.2);

  /* ... rest of vars ... */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  --spacing-xxl: 6rem;

  /* Bordes redondeados */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

html {
  scroll-behavior: smooth;
}

/* ... existing body styles ... */

/* ... existing styles ... */

.logo-secondary {
  opacity: 1;
}

.dot {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 800;
}

/* Fondo con blobs animados */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.1;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  width: 60vw;
  height: 60vw;
  background: linear-gradient(45deg, var(--accent-purple), var(--accent-pink));
  top: -20%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 50vw;
  height: 50vw;
  background: linear-gradient(45deg, var(--accent-blue), #00ffaa);
  bottom: -20%;
  right: -10%;
  animation-delay: -10s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -50px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Navegación */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(10, 10, 20, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: var(--spacing-sm) 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logos {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo-secondary {
  opacity: 1;
  /* Make it distinct if needed, or keep same */
}

.dot {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 24px;
  /* Increased slightly for better breathability */
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  padding: 4px 0;
  position: relative;
}

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

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* Contenido principal */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--spacing-xl) + 60px) var(--spacing-md) var(--spacing-xxl);
}

/* Hero section */
.hero {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
  padding: 0 var(--spacing-md);
}

.hero-meta {
  font-size: 0.875rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--spacing-md);
  letter-spacing: -1px;
}

.hero .lead {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* NUEVO: Tutorial Timeline Linear */
.tutorial-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.timeline-step {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--spacing-lg);
  align-items: center;
  width: 100%;
  padding: var(--spacing-lg);
  background: rgba(18, 18, 30, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  transition: all 0.4s ease;
}

.timeline-step:hover {
  background: rgba(18, 18, 30, 0.6);
  border-color: var(--accent-purple);
  box-shadow: var(--glow-effect);
  transform: translateY(-5px);
}

/* Step Content */
.step-content {
  position: relative;
}

.step-number {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.05);
  line-height: 1;
  margin-bottom: var(--spacing-sm);
}

.step-content h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--accent-blue);
  margin-bottom: var(--spacing-sm);
}

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

/* Step Code */
.step-code-wrapper {
  background: #0d1117;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.code-header {
  background: var(--bg-tertiary);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.code-header-link {
  text-decoration: none;
  color: inherit;
  /* Inherit from .code-header (muted) */
  font-weight: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
  cursor: pointer;
}

.code-header-link:hover {
  color: var(--text-primary);
  /* Just brighten it up */
  text-decoration: none;
}

.header-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: normal;
  text-decoration: none !important;
  opacity: 0;
  /* Hide by default */
  transition: opacity 0.2s ease;
}

.code-header-link:hover .header-hint {
  opacity: 0.8;
  /* Show on hover */
}

pre {
  padding: var(--spacing-md);
  overflow-x: auto;
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre;
  word-wrap: normal;
}

/* CODE WITH LINE NUMBERS LAYOUT (ROW BASED) */
.code-with-lines {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
}

.code-row {
  display: flex;
  align-items: flex-start;
}

.code-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.line-number {
  width: 3.5rem;
  /* Fixed width */
  padding-right: 1rem;
  text-align: right;
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  margin-right: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.line-content {
  flex: 1;
  white-space: pre-wrap;
  /* Enable wrapping */
  word-wrap: break-word;
  /* Break long words */
  word-break: break-all;
  min-height: 1.5em;
  /* Ensure empty lines have height */
  color: #c9d1d9;
  padding-right: 1rem;
}

/* Override existing pre/code styles inside content */
.line-content pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  white-space: pre-wrap;
  word-wrap: break-word;
}


/* Visual Connector */
.timeline-connector {
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent-purple), transparent);
  opacity: 0.3;
}

/* Syntax Highlighting (Simple) */
.keyword {
  color: #ff7b72;
}

.string {
  color: #a5d6ff;
}

.comment {
  color: #8b949e;
  font-style: italic;
}

.function {
  color: #d2a8ff;
}

/* CTA Section */
.cta-section {
  text-align: center;
  margin: var(--spacing-xxl) 0;
  padding: var(--spacing-xl);
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.05), rgba(0, 183, 255, 0.05));
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
}

.cta-section h2 {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
}

.cta-section p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto var(--spacing-xl);
  color: var(--text-secondary);
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all 0.3s ease;
  text-align: left;
}

.card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-blue);
  box-shadow: 0 20px 40px rgba(0, 183, 255, 0.1);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
}

.card h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

/* Footer */
footer {
  text-align: center;
  padding: var(--spacing-xl) 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 10%;
}

/* Animaciones */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Landing Refined Styles */
.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.tutorial-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all 0.4s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.tutorial-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-purple);
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.15);
}

.tutorial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-blue));
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.card-level {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--spacing-md);
}

.btn-start {
  display: inline-block;
  margin-top: auto;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Hero Landing adjustments */
.landing-hero {
  padding: var(--spacing-xxl) 0 var(--spacing-xl);
  text-align: center;
}

.landing-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: var(--spacing-md) auto;
}



/* Examples Page Styles */
.tabs-header {
  display: flex;
  gap: 2px;
  background: #0d1117;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: thin;
  /* Firefox */
}

.tabs-header::-webkit-scrollbar {
  height: 4px;
}

.tabs-header::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
  background: var(--bg-tertiary);
  /* Matches code window header/bg */
  color: var(--accent-blue);
  border-color: var(--border-color);
}

.examples-container {
  max-width: 1000px;
  width: 100%;
  /* Ensure it adapts */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-x: hidden;
  /* Prevent container itself from causing scroll */
}

/* Bulletproof Code Container Styles */
.code-window-large {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-effect);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  /* Rounds corners, clips header */
}

.code-content-large {
  padding: var(--spacing-md);
  flex: 1;
  width: 100%;
  overflow: auto;
  /* The generic scroll container */
  -webkit-overflow-scrolling: touch;
}

/* New: Ensure flex items inside scroll area create context */
/* New: Ensure flex items inside scroll area create context */
.code-with-lines {
  display: flex;
  flex-direction: column;
  /* width: max-content removed to allow wrapping on desktop */
  width: 100%;
}

/* Override line-content to prevent wrapping and ensure exact width */
.line-content {
  flex: 1;
  white-space: pre-wrap;
  /* Restore wrapping for desktop */
  word-break: break-word;
  /* Ensure long words break */
  padding-right: 1rem;
}

/* Ensure rows stretch to max-content */
.code-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

/* Specific override for code transition in examples */
code {
  transition: opacity 0.15s ease-in-out;
  white-space: pre;
}

/* Force pre to handle overflow properly inside flex items - RESET */
.code-content-large pre {
  margin: 0;
  padding: 0;
  max-width: none;
  overflow: visible;
}


/* Badge Styles for File Labels */
.file-label {
  font-family: var(--font-mono);
}

.file-label.explanation {
  color: #ff5f56;
  /* Rojo tipo terminal error/alerta */
  font-weight: 300;
  /* Thin */
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 95, 86, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 95, 86, 0.05);
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* Responsive Design */

/* ==================== */
/* MEDIA QUERIES CORREGIDAS */
/* ==================== */

/* Tablet & Smaller Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  :root {
    --spacing-xxl: 4rem;
    --spacing-xl: 3rem;
  }

  .main-content {
    padding: calc(var(--spacing-xl) + 60px) var(--spacing-sm) var(--spacing-lg);
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  /* Ajuste específico para el contenedor de ejemplos */
  .examples-container {
    max-width: 95vw;
    margin: 0 auto;
  }

  /* Force horizontal scroll for code on tablet (Learning & Examples) */
  .code-with-lines,
  .step-code-wrapper .code-with-lines {
    width: max-content;
    min-width: 100%;
  }

  .line-content {
    white-space: pre;
    padding-right: 1rem;
  }
}

/* Tablet (max-width: 900px) */
@media (max-width: 900px) {
  .timeline-step {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .step-number {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
  }

  .timeline-connector {
    display: none;
  }

  .tutorial-timeline {
    gap: var(--spacing-lg);
  }

  /* Ajuste específico para código en tablet */
  .code-window-large {
    min-height: 50vh;
    width: 100%;
    margin: 0 auto;
  }

  /* Ajuste del contenedor de código */
  .code-content-large {
    padding: var(--spacing-sm);
  }

  /* Reducir ancho de números de línea */
  .line-number {
    width: 2.5rem;
    padding-right: 0.75rem;
    margin-right: 0.75rem;
  }
}

/* Mobile landscape & Tablets (max-width: 768px) */
@media (max-width: 768px) {
  :root {
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
  }

  .nav-container {
    padding: 0 var(--spacing-sm);
  }

  .nav-logos {
    gap: var(--spacing-sm);
  }

  .logo {
    font-size: 1.2rem;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-link {
    font-size: 0.9rem;
  }

  .hero h1 {
    font-size: 2.8rem;
    margin-top: 2rem;
  }

  .hero .lead {
    font-size: 1.1rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .landing-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  /* Ajustes críticos para código en móvil */
  .examples-container {
    gap: 1rem;
    width: 100%;
    max-width: 100vw;
    padding: 0;
    overflow-x: hidden;
  }

  .code-window-large {
    width: 100%;
    border-radius: var(--radius-md);
    margin: 0;
    min-height: 45vh;
  }

  .code-content-large {
    padding: var(--spacing-sm);
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Forzar que el código se adapte */
  .code-with-lines {
    width: max-content;
    min-width: 100%;
  }

  .code-row {
    min-width: 100%;
  }

  .line-content {
    white-space: pre-wrap;
    /* Cambiado a pre-wrap para móvil */
    word-break: break-word;
    overflow-wrap: break-word;
    padding-right: 0.5rem;
  }

  /* Reducir tamaño de fuente en código */
  .line-content,
  .line-content code {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .line-number {
    width: 2rem;
    padding-right: 0.5rem;
    margin-right: 0.5rem;
    font-size: 0.75rem;
  }
}

/* Mobile (max-width: 600px) */
@media (max-width: 600px) {
  .navbar {
    padding: var(--spacing-xs) 0;
  }

  .nav-container {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
  }

  .code-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
  }

  /* Ajustes específicos para pantallas pequeñas */
  .hero h1 {
    font-size: 2.4rem;
  }

  .main-content {
    padding-left: 1rem;
    padding-right: 1rem;
    overflow-x: hidden;
  }

  /* Mejoras para el contenedor de código */
  .code-window-large {
    min-height: 40vh;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
  }

  .tabs-header {
    padding: 8px 50px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
    white-space: nowrap;
  }

  /* Ajuste de timeline steps */
  .timeline-step {
    padding: var(--spacing-md);
    margin: 0 -0.5rem;
    width: calc(100% + 1rem);
  }

  .step-content h3 {
    font-size: 1.4rem;
  }

  .step-content p {
    font-size: 1rem;
  }
}

/* Small Mobile (max-width: 480px) - NUEVO BREAKPOINT CRÍTICO */
@media (max-width: 480px) {
  :root {
    --spacing-xl: 2rem;
    --spacing-xxl: 2.5rem;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero .lead {
    font-size: 1rem;
  }

  .timeline-step {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }

  .step-number {
    font-size: 1.8rem;
  }

  .step-content h3 {
    font-size: 1.3rem;
  }

  .cta-section h2 {
    font-size: 1.8rem;
  }

  .cta-section p {
    font-size: 0.95rem;
  }

  .card-grid,
  .landing-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Ajustes ultra-críticos para código en móviles pequeños */
  .code-window-large {
    min-height: 35vh;
    max-width: 100vw;
    margin: 0 -1rem;
    width: calc(100% + 2rem);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .code-content-large {
    padding: 0.75rem;
  }

  .line-number {
    width: 1.8rem;
    font-size: 0.7rem;
  }

  .line-content,
  .line-content code {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  /* Forzar que el contenido de código sea más legible */
  .line-content {
    white-space: pre;
    /* Force scroll, do not wrap */
    word-break: normal;
    overflow-wrap: normal;
  }

  /* Tutorial specific scroll fix - SCOPED TO CONTENT */
  .step-code-wrapper {
    overflow: hidden;
    /* rounded corners mask */
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
  }

  .step-code-wrapper .code-with-lines {
    overflow-x: auto;
    /* SCROLL HERE ONLY */
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding: var(--spacing-sm);
  }

  .step-code-wrapper .code-row {
    min-width: max-content;
    /* Force rows to be wide */
    width: 100%;
  }
}

/* Closing 480px block */

/* Móviles muy pequeños (max-width: 360px) - BREAKPOINT ADICIONAL */
@media (max-width: 360px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.8rem;
  }

  .code-window-large {
    min-height: 30vh;
  }

  .line-number {
    width: 1.5rem;
    padding-right: 0.25rem;
    margin-right: 0.25rem;
  }

  .tab-btn {
    padding: 5px 8px;
    font-size: 0.65rem;
  }
}

/* ==================== */
/* REGLAS GLOBALES PARA PREVENIR OVERFLOW */
/* ==================== */

/* Asegurar que el body no tenga overflow horizontal */
body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* Contenedor principal */
.main-content {
  width: 100%;
  overflow-x: hidden;
}

/* Asegurar que las imágenes y otros elementos no causen overflow */
img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Para el código, permitir scroll horizontal pero controlado */
.code-content-large {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-purple) var(--bg-secondary);
}

.code-content-large::-webkit-scrollbar {
  height: 6px;
}

.code-content-large::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.code-content-large::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 3px;
}