/* ======================================
   ESTADÍSTICA ABIERTA
   Portada v1
   ====================================== */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --text: #10203f;
  --text-2: #52617a;
  --border: #dfe7f2;
  --primary: #0b63f6;
  --primary-dark: #0048c7;
  --primary-soft: #eaf3ff;
  --green: #18a957;
  --green-soft: #eaf9f0;
  --amber: #e7a10d;
  --amber-soft: #fff7df;
  --rose: #ef4b5f;
  --rose-soft: #fff0f2;
  --purple: #7a51dc;
  --purple-soft: #f1ecff;
  --shadow: 0 14px 40px rgba(14, 39, 82, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(223, 231, 242, 0.8);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-text {
  font-size: 1.18rem;
}

.brand-mark {
  width: 34px;
  height: 30px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.brand-mark span {
  width: 7px;
  border-radius: 3px 3px 1px 1px;
  background: var(--primary);
}

.brand-mark span:nth-child(1) { height: 12px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 28px; }

.brand-mark.small {
  width: 28px;
  height: 24px;
}

.brand-mark.small span {
  width: 6px;
}

.brand-mark.small span:nth-child(1) { height: 10px; }
.brand-mark.small span:nth-child(2) { height: 16px; }
.brand-mark.small span:nth-child(3) { height: 22px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  padding: 9px 13px;
  border-radius: 10px;
  color: #203252;
  font-size: 0.94rem;
  font-weight: 650;
  transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

/* Hero */

.hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 24%, rgba(120, 184, 255, 0.20), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-bottom: 1px solid #edf2f8;
}

.hero-grid {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  align-items: center;
  gap: 56px;
  padding-top: 68px;
  padding-bottom: 68px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.65rem, 5vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero h1 span {
  display: block;
  color: var(--primary);
}

.hero-description {
  max-width: 650px;
  margin: 26px 0 0;
  font-size: clamp(1.04rem, 1.8vw, 1.28rem);
  color: var(--text-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 21px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(11, 99, 246, 0.23);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--primary);
  border: 1.5px solid var(--primary);
  background: #fff;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 28px;
  color: #324464;
  font-size: 0.94rem;
  font-weight: 650;
}

.hero-features > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.feature-icon {
  color: var(--primary);
  font-size: 1.25rem;
}

.hero-visual {
  position: relative;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -42px -70px -42px -25px;
  border-radius: 46% 54% 60% 40% / 46% 40% 60% 54%;
  background: rgba(129, 188, 255, 0.16);
  z-index: 0;
}

.visual-window {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(212, 224, 239, 0.95);
  box-shadow: var(--shadow);
}

.window-top {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid #e7edf5;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ff6e67; }
.dot.yellow { background: #ffbf4c; }
.dot.green { background: #4ecf77; }

.visual-content {
  display: grid;
  grid-template-columns: 122px 1fr;
  min-height: 320px;
}

.visual-sidebar {
  padding: 16px 11px;
  background: #f7faff;
  border-right: 1px solid #e5edf7;
}

.visual-tab {
  width: 100%;
  border: 0;
  background: transparent;
  color: #65748d;
  text-align: left;
  padding: 10px 11px;
  border-radius: 9px;
  font-size: 0.78rem;
  cursor: default;
}

.visual-tab.active {
  color: var(--primary);
  background: #eaf3ff;
  font-weight: 800;
}

.visual-main {
  padding: 20px;
}

.visual-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.9rem;
}

.visual-title-row span {
  color: var(--text-2);
  font-size: 0.78rem;
}

.normal-chart {
  margin-top: 12px;
}

.normal-chart .axis {
  stroke: #9eacc0;
  stroke-width: 1.2;
}

.normal-chart .center-line {
  stroke: var(--primary);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.normal-chart .curve {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
}

.normal-chart .area {
  fill: rgba(11, 99, 246, 0.12);
}

.normal-chart text {
  fill: #6a7890;
  font-size: 13px;
}

.formula-card {
  margin-top: 8px;
}

.parameters {
  border-radius: 12px;
  background: #f4f8fd;
  padding: 15px 16px;
  color: #52617a;
  font-size: 0.78rem;
}

.parameters strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.82rem;
}

.parameter-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.parameter-symbol {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e8f2ff;
  color: var(--primary);
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
}

/* Sections */

.section {
  padding: 42px 0;
}

.section.compact {
  padding-top: 24px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--text-2);
}

.split-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.text-link {
  color: var(--primary);
  font-weight: 750;
  white-space: nowrap;
}

.muted-link {
  color: #8290a6;
}

.cards-grid {
  display: grid;
  gap: 16px;
}

.cards-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-card,
.tool-card,
.topic-card {
  min-height: 138px;
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.choice-card:hover,
.tool-card:hover,
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 41, 82, 0.08);
}

.choice-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 13px;
  padding: 20px;
}

.choice-card.blue { background: #eff6ff; }
.choice-card.green { background: var(--green-soft); }
.choice-card.amber { background: var(--amber-soft); }
.choice-card.rose { background: var(--rose-soft); }

.card-icon,
.tool-icon,
.topic-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 900;
}

.card-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.65);
  font-size: 1.25rem;
}

.choice-card h3,
.tool-card h3,
.topic-card h3,
.principle h3 {
  margin: 0;
  line-height: 1.25;
}

.choice-card h3 {
  font-size: 1rem;
}

.choice-card p,
.tool-card p,
.topic-card p,
.principle p {
  margin: 7px 0 0;
  color: var(--text-2);
  font-size: 0.88rem;
}

.arrow {
  align-self: end;
  color: var(--primary);
  font-weight: 900;
}

.tool-card,
.topic-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  background: #fff;
}

.tool-icon,
.topic-icon {
  width: 46px;
  height: 46px;
  font-size: 1.35rem;
}

.tool-icon.blue,
.topic-icon.blue { color: #0b63f6; background: var(--primary-soft); }
.tool-icon.green,
.topic-icon.green { color: var(--green); background: var(--green-soft); }
.tool-icon.amber,
.topic-icon.amber { color: var(--amber); background: var(--amber-soft); }
.tool-icon.rose,
.topic-icon.rose { color: var(--rose); background: var(--rose-soft); }
.tool-icon.purple,
.topic-icon.purple { color: var(--purple); background: var(--purple-soft); }

.tool-card h3,
.topic-card h3 {
  font-size: 0.96rem;
}

.status {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #6d7a8f;
  font-size: 0.7rem;
  font-weight: 700;
}

.active-topic {
  border-color: rgba(11, 99, 246, 0.35);
  background: #fbfdff;
}

.topic-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.66rem;
  font-weight: 800;
}

.pill.soft {
  color: #7b8799;
  background: #f2f4f7;
}

/* Principles */

.principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(90deg, #eef7ff 0%, #f7fbff 100%);
  border: 1px solid #dceafa;
}

.principle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 20px;
}

.principle + .principle {
  border-left: 1px solid #d9e5f4;
}

.principle-icon {
  color: var(--primary);
  font-size: 1.8rem;
  line-height: 1;
}

.principle h3 {
  font-size: 0.92rem;
}

.principle p {
  font-size: 0.8rem;
}

.ad-ready {
  min-height: 24px;
  padding: 0;
}

/* Footer */

.site-footer {
  margin-top: 20px;
  padding: 30px 0;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 24px;
}

.footer-brand p {
  margin: 5px 0 0;
  color: #8591a3;
  font-size: 0.76rem;
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.footer-nav a {
  color: #69768a;
  font-size: 0.78rem;
}

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

.footer-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #8c97a8;
  font-size: 0.72rem;
  text-align: right;
}

/* Tablet */

@media (max-width: 980px) {
  .main-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    width: 100%;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 48px;
    padding-bottom: 54px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-visual {
    max-width: 760px;
  }

  .cards-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principles {
    grid-template-columns: repeat(2, 1fr);
  }

  .principle:nth-child(3) {
    border-left: none;
    border-top: 1px solid #d9e5f4;
  }

  .principle:nth-child(4) {
    border-top: 1px solid #d9e5f4;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand .brand {
    justify-content: center;
  }

  .footer-note {
    text-align: center;
  }
}

/* Mobile */

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, var(--container));
  }

  .nav-wrap {
    min-height: 64px;
  }

  .main-nav {
    top: 64px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .brand-mark {
    width: 30px;
    height: 26px;
  }

  .hero-grid {
    min-height: auto;
    padding-top: 38px;
    padding-bottom: 42px;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 13vw, 3.45rem);
  }

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

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .hero-features {
    display: grid;
    gap: 10px;
  }

  .visual-content {
    grid-template-columns: 1fr;
  }

  .visual-sidebar {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    border-right: 0;
    border-bottom: 1px solid #e5edf7;
  }

  .visual-tab {
    width: auto;
    flex: 0 0 auto;
  }

  .visual-main {
    padding: 15px;
  }


  .section {
    padding: 34px 0;
  }

  .section.compact {
    padding-top: 18px;
  }

  .split-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .cards-grid.four {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 0;
  }

  .tool-card,
  .topic-card {
    min-height: 0;
  }

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

  .principle + .principle,
  .principle:nth-child(3),
  .principle:nth-child(4) {
    border-left: 0;
    border-top: 1px solid #d9e5f4;
  }

  .footer-nav {
    gap: 10px 14px;
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

:focus-visible {
  outline: 3px solid rgba(11, 99, 246, 0.35);
  outline-offset: 3px;
}
