/* ==========================================================================
   EL EFECTO BULLET — ESTILO EDITORIAL CLARO (Inspirado en Refactoring Guru)
   Limpio, visual, amigable, de alta jerarquía y contraste.
   ========================================================================== */

:root {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.95);
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --text-title: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  
  /* Acentos estilo Refactoring Guru */
  --accent-red: #e53e3e;
  --accent-red-hover: #c53030;
  --accent-amber: #d97706;
  --accent-blue: #2563eb;
  --accent-emerald: #059669;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.1);
}

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

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: light;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Tipografía */
h1, h2, h3, h4 {
  color: var(--text-title);
  font-weight: 800;
  line-height: 1.25;
}

p {
  color: var(--text-body);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* HEADER / NAVBAR */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-title);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-icon {
  font-size: 1.35rem;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #0f172a;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.brand-icon svg {
  color: #f8fafc;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-body);
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent-red);
  text-decoration: none;
}

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

/* BOTONES ESTILO REFACTORING GURU */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary, .btn-action {
  background: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.btn-primary:hover, .btn-action:hover {
  background: var(--accent-red-hover);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(229, 62, 62, 0.4);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-title);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

.btn-zenodo {
  background: #eff6ff;
  color: var(--accent-blue);
  border: 1px solid #bfdbfe;
}

.btn-zenodo:hover {
  background: #dbeafe;
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

/* PILLS & BADGES */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.pill-doi {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--accent-blue);
}

.pill-doi .doi-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-blue);
  border-radius: 50%;
}

.pill-red {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--accent-red);
}

/* HERO SECTION (Limipio, centrado y directo) */
.hero {
  padding: 3.5rem 0 3rem 0;
  text-align: center;
}

.hero-pill-row {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 3.2rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero-title span.highlight {
  color: var(--accent-red);
}

.hero-subtitle {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-body);
  max-width: 820px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.55;
  text-wrap: balance;
}

.hero-subtitle strong {
  color: var(--text-title);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* EL TRÍPTICO DE ESCENARIOS (3 Columnas Visuales como Refactoring Guru) */
.scenarios-section {
  padding: 1.5rem 0 4rem 0;
}

.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
}

.scenario-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.scenario-card.highlight {
  border: 2px solid var(--accent-red);
  box-shadow: 0 8px 24px rgba(229, 62, 62, 0.15);
}

.scenario-img-wrapper {
  width: 100%;
  height: 220px;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.scenario-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.scenario-card:hover .scenario-img-wrapper img {
  transform: scale(1.03);
}

.scenario-badge-overlay {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-title);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.scenario-body {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.scenario-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.scenario-tag.tag-blue { color: var(--accent-blue); }
.scenario-tag.tag-red { color: var(--accent-red); }
.scenario-tag.tag-green { color: var(--accent-emerald); }

.scenario-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--text-title);
}

.scenario-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-body);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.scenario-stats {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-item .val {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-title);
}

.stat-item .lbl {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.scenario-btn {
  width: 100%;
}

/* SECCIÓN MÓDULOS DE PROFUNDIZACIÓN (Cards compactas con botones "Más sobre...") */
.modules-section {
  padding: 3.5rem 0;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
}

.section-intro h2 {
  font-size: 2.2rem;
  margin-bottom: 0.65rem;
}

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

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

.module-card {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.module-card:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.module-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.module-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  color: var(--text-title);
}

.module-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* WIDGET CALCULADORA 10+10 COMPACTO */
.calc-section {
  padding: 3.5rem 0;
}

.calc-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-label-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-label-row span.val {
  color: var(--accent-red);
  font-family: var(--font-mono);
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: var(--bg-subtle);
  height: 6px;
  border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-red);
  cursor: pointer;
}

.select-styled {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-title);
  font-size: 0.9rem;
}

.calc-results {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calc-res-item {
  display: flex;
  flex-direction: column;
}

.calc-res-item .lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calc-res-item .val {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-red);
}

/* BANNER DE DESCARGA / PAPER FORMAL */
.paper-cta-box {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  color: #ffffff;
  margin: 3rem 0;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2.5rem;
  align-items: center;
}

.paper-cta-box h2 {
  color: #ffffff;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.paper-cta-box p {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.6;
}

.paper-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.paper-cta-actions .btn {
  width: 100%;
}

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.45);
}

/* MODAL DE DETALLE (Para que no esté todo apiñado en la home) */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: min(620px, calc(100vw - 2rem));
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 1.75rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  animation: modalIn 0.25s ease-out;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-title);
}

.modal-title {
  font-size: 1.45rem;
  margin-bottom: 1rem;
  padding-right: 2.25rem;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-body p {
  margin-bottom: 1rem;
}

.modal-body ul {
  margin: 0 0 1.25rem 1.25rem;
  padding-left: 0;
}

.modal-body blockquote {
  border-left: 3px solid var(--accent-red);
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* FOOTER */
.footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-body);
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .scenarios-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
  }
  
  .paper-cta-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none !important;
  }
  .nav-actions .pill-doi {
    display: none !important;
  }
  .hero-title {
    font-size: 2.3rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .modal-overlay {
    padding: 0.75rem !important;
  }
  
  .modal-box {
    padding: 1.25rem 1rem !important;
    max-height: 85vh;
    border-radius: 14px;
    max-width: calc(100vw - 1.5rem) !important;
    width: 100% !important;
  }
  
  .modal-title {
    font-size: 1.18rem !important;
    padding-right: 2rem !important;
  }
  
  .modal-body {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
  }
  
  .modal-body blockquote {
    padding: 0.5rem 0.65rem !important;
    margin: 0.75rem 0 !important;
    font-size: 0.84rem !important;
  }
  
  .modal-body ul {
    margin-left: 1rem !important;
  }
  
  .modal-close {
    top: 0.75rem !important;
    right: 0.75rem !important;
    font-size: 1.25rem !important;
  }
  
  .paper-cta-box {
    padding: 1.75rem 1.15rem;
  }
  
  .paper-cta-box h2 {
    font-size: 1.5rem;
  }
}
