/* ==========================================
   MÁQUINA — Consultoría y Formación en IA
   Carbon Design System Dark Theme & Enhancements
   ========================================== */

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

:root {
  --bg: #161616;
  --layer-01: #262626;
  --layer-02: #393939;
  --layer-03: #525252;
  --border-subtle: #393939;
  --border-strong: #525252;
  --text-primary: #f4f4f4;
  --text-secondary: #c6c6c6;
  --text-helper: #8d8d8d;
  --accent: #0f62fe;
  --accent-hover: #0043ce;
  --accent-light: #4589ff;
  --accent-glow: rgba(15, 98, 254, 0.25);
  --on-accent: #ffffff;
  --success: #24a148;
  --font-main: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1240px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* ---------- Typography & Utility ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-main);
  font-weight: 300;
  text-wrap: balance;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 b, h2 b, h3 b, h4 b {
  font-weight: 600;
  color: var(--accent-light);
}

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

a {
  color: inherit;
  transition: color var(--transition-fast);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
}

.eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--accent-light);
  display: inline-block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 0;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-ghost:hover {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(22, 22, 22, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.wordmark {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.wordmark-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.wordmark-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

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

.nav-links a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 6px;
}

/* Mobile Drawer Navigation */
.mobile-drawer {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  height: calc(100vh - 64px);
  background: var(--bg);
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  border-top: 1px solid var(--border-subtle);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--transition-smooth), opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.mobile-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.mobile-drawer-links a {
  font-size: 1.3rem;
  font-weight: 300;
  text-decoration: none;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ---------- Hero Section ---------- */
.hero {
  padding: 72px 0 0;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(22,22,22,0) 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-top {
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1.06;
  margin: 18px 0 24px;
  max-width: 16ch;
}

.hero-lede {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.hero p {
  max-width: 48ch;
  color: var(--text-secondary);
  font-size: 1.08rem;
  margin: 0;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-actions .secondary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
}

.hero-actions .secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* Stats Row */
.stats-wrap {
  padding: 40px 40px 64px;
  position: relative;
  z-index: 1;
}

.stats {
  background: var(--layer-01);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border-subtle);
}

.stat {
  padding: 32px 28px;
  transition: background-color var(--transition-fast);
}

.stat:hover {
  background: var(--layer-02);
}

.stat + .stat {
  border-left: 1px solid var(--border-subtle);
}

.stat .value {
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
  font-feature-settings: "tnum";
}

.stat .label {
  font-size: 0.85rem;
  color: var(--text-helper);
  line-height: 1.4;
}

/* ---------- Standard Sections ---------- */
section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border-subtle);
}

section:last-of-type {
  border-bottom: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  font-weight: 300;
}

.section-head .lede {
  max-width: 38ch;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

/* ---------- Offerings (Qué Hacemos) ---------- */
.offer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border-subtle);
}

.offer {
  padding: 36px;
  background: var(--layer-01);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background-color var(--transition-fast);
}

.offer:hover {
  background: rgba(38, 38, 38, 0.85);
}

.offer + .offer {
  border-left: 1px solid var(--border-subtle);
}

.offer .num {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 18px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.offer h3 {
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 14px;
  line-height: 1.2;
  max-width: 24ch;
}

.offer p {
  color: var(--text-secondary);
  margin: 0 0 22px;
}

.offer ul {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.offer li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 12px 0 12px 22px;
  position: relative;
  border-top: 1px solid var(--border-subtle);
}

.offer li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 8px;
  height: 8px;
  background: var(--accent);
}

/* ---------- Interactive Range / Levels (Rango) ---------- */
.rango-track {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  margin-bottom: 0;
}

.rango-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border-subtle);
  border-top: none;
}

.rango-cell {
  padding: 28px;
  background: var(--layer-01);
  position: relative;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.rango-cell + .rango-cell {
  border-left: 1px solid var(--border-subtle);
}

.rango-cell::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 10px;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-fast);
}

.rango-cell:hover,
.rango-cell.active {
  background: var(--layer-02);
}

.rango-cell.active::before {
  width: 100%;
}

.rango-cell .tier {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-helper);
  margin-bottom: 10px;
}

.rango-cell h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 6px;
}

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

/* Dynamic Level Details Card */
.level-detail-box {
  background: var(--layer-01);
  border: 1px solid var(--border-subtle);
  border-top: none;
  padding: 32px 36px;
  margin-top: -1px;
}

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

.level-detail-header h4 {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
}

.level-badge {
  background: rgba(15, 98, 254, 0.15);
  color: var(--accent-light);
  border: 1px solid var(--accent);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.level-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.level-col h5 {
  font-size: 0.85rem;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  font-weight: 500;
}

.level-col p, .level-col ul {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.level-col ul {
  list-style: none;
  padding: 0;
}

.level-col li {
  margin-bottom: 6px;
  position: relative;
  padding-left: 14px;
}

.level-col li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--accent-light);
}

.callout {
  background: var(--layer-02);
  padding: 24px 28px;
  margin-top: 32px;
  font-size: 0.98rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
}

.callout b {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------- Calculator / ROI Estimator Widget ---------- */
.calculator-card {
  background: var(--layer-01);
  border: 1px solid var(--border-subtle);
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-field label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.calc-range-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calc-range-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.calc-num-badge {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 48px;
  text-align: right;
}

.calc-select {
  background: var(--layer-02);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 16px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  cursor: pointer;
}

.calc-select:focus {
  border-color: var(--accent);
}

.calc-results {
  background: var(--layer-02);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 2px solid var(--accent);
}

.calc-res-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
  margin-bottom: 16px;
  display: block;
}

.calc-metric {
  margin-bottom: 24px;
}

.calc-metric-val {
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.calc-metric-lbl {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.calc-cta {
  margin-top: 16px;
}

/* ---------- Process (Cómo Trabajamos) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step {
  padding: 0 16px 0 0;
}

.step-rule {
  height: 2px;
  background: var(--accent);
  margin-bottom: 22px;
}

.step .num {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text-helper);
  display: block;
  margin-bottom: 10px;
}

.step h3 {
  font-size: 1.02rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.step p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 26ch;
}

/* ---------- FAQ Section ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.faq-item {
  background: var(--layer-01);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-strong);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 22px 28px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1.02rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-icon {
  font-size: 1.2rem;
  color: var(--accent-light);
  transition: transform var(--transition-fast);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 28px 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* ---------- Contact Section ---------- */
.contact {
  background: var(--accent);
  border-bottom: none;
}

.contact .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  padding-top: 56px;
  padding-bottom: 56px;
}

.contact h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
  max-width: 14ch;
}

.contact-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-meta .line {
  font-size: 0.95rem;
  color: #fff;
}

.contact-meta .line.muted {
  color: #d0e2ff;
}

.contact-meta a {
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.contact-meta a:hover {
  border-color: #ffffff;
  color: #ffffff;
}

/* ---------- Footer ---------- */
footer {
  padding: 28px 0;
  border-top: 1px solid var(--border-subtle);
}

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

footer .wordmark {
  font-size: 1rem;
}

footer .meta {
  font-size: 0.8rem;
  color: var(--text-helper);
  display: flex;
  gap: 20px;
}

/* ---------- Floating Action Button ---------- */
.floating-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  background: var(--accent);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.floating-cta:hover {
  transform: translateY(-3px);
  background: var(--accent-hover);
}

.floating-cta-dot {
  width: 8px;
  height: 8px;
  background: #25D366;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #25D366;
}

/* ---------- Modal Dialog ---------- */
dialog.booking-modal {
  background: var(--layer-01);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  max-width: 540px;
  width: 90%;
  margin: auto;
  padding: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  outline: none;
}

dialog.booking-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-header {
  padding: 24px 28px;
  background: var(--layer-02);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

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

.modal-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-body label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.modal-body input,
.modal-body select,
.modal-body textarea {
  background: var(--layer-02);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 14px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  outline: none;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--accent);
}

.modal-footer {
  padding: 20px 28px;
  background: var(--layer-02);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ---------- Media Queries ---------- */
@media (max-width: 980px) {
  .calculator-card {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .level-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .hamburger {
    display: block;
  }
  .hero-lede {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat:nth-child(3) {
    border-left: none;
  }
  .stat:nth-child(3),
  .stat:nth-child(4) {
    border-top: 1px solid var(--border-subtle);
  }
  .offer-grid {
    grid-template-columns: 1fr;
  }
  .offer + .offer {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
  .rango-grid {
    grid-template-columns: 1fr 1fr;
  }
  .rango-cell:nth-child(3) {
    border-left: none;
  }
  .rango-cell:nth-child(3),
  .rango-cell:nth-child(4) {
    border-top: 1px solid var(--border-subtle);
  }
  .steps {
    grid-template-columns: 1fr 1fr;
    row-gap: 28px;
  }
  .step {
    padding-right: 0;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .contact .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .contact-meta {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 0 20px;
  }
  .stats,
  .rango-grid,
  .steps {
    grid-template-columns: 1fr;
  }
  .stat + .stat,
  .rango-cell + .rango-cell {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
  .floating-cta {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }
}
