/* ============================================
   Madrid Escucha · PSOE-M · Numeral8 España
   Estilo editorial institucional
   Paleta: navy + rojo PSOE + crema · rojo oso para alertas
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --navy: #0c1420;
  --navy-soft: #182236;
  --navy-light: #2a3650;
  --gold: #c8203a;            /* rojo PSOE como acento principal */
  --gold-soft: #a31a30;
  --gold-light: #e04a60;
  --cream: #f5f1e8;
  --cream-soft: #ebe4d3;
  --white-off: #fbfaf6;
  --senyera: #d60a1c;         /* rojo vivo madrileño */
  --senyera-soft: #b0091a;
  --grey-100: #e6ecf4;
  --grey-300: #b8c2d1;
  --grey-500: #6b7689;
  --grey-700: #3a4458;
  --grey-900: #1a2233;

  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --container: 1280px;
  --gap: 24px;

  --shadow-sm: 0 1px 3px rgba(12, 20, 32, 0.08);
  --shadow-md: 0 4px 16px rgba(12, 20, 32, 0.12);
  --shadow-lg: 0 12px 48px rgba(12, 20, 32, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--navy);
  background: var(--white-off);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============================================
   TIPOGRAFÍA
   ============================================ */

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: 0.6em; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin-bottom: 0.5em; }
h4 { font-size: 1.15rem; margin-bottom: 0.4em; font-weight: 600; }

p { margin-bottom: 1em; max-width: 70ch; }

a { color: var(--gold-soft); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); }

.lead { font-size: 1.2rem; line-height: 1.55; color: var(--grey-700); max-width: 60ch; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1em;
  display: inline-block;
}

.serif-italic { font-family: var(--serif); font-style: italic; }

.mono { font-family: var(--mono); font-size: 0.92em; }

.numeral {
  font-family: var(--serif);
  font-weight: 600;
  font-feature-settings: 'lnum';
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.section-lg { padding: 140px 0; }

.section-dark {
  background: var(--navy);
  color: var(--cream);
}

.section-dark h1, .section-dark h2,
.section-dark h3, .section-dark h4 { color: var(--cream); }

.section-cream { background: var(--cream); }

.divider-gold {
  width: 56px;
  height: 2px;
  background: var(--gold);
  margin: 0 0 2em 0;
}

.divider-center { margin-left: auto; margin-right: auto; }

/* ============================================
   NAVEGACIÓN
   ============================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 20, 32, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 168, 71, 0.15);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 32px; height: 32px;
  background: var(--gold);
  position: relative;
  border-radius: 2px;
}

.brand-mark::before, .brand-mark::after {
  content: '';
  position: absolute;
  background: var(--navy);
}

.brand-mark::before {
  top: 8px; left: 0; right: 0; height: 2px;
}

.brand-mark::after {
  top: 16px; left: 0; right: 0; height: 2px;
}

.brand-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
  margin-left: 4px;
}

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

.nav-links a {
  color: var(--grey-300);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

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

.nav-links a.active { position: relative; }

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}

.lang-switch {
  display: flex;
  gap: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  border: 1px solid var(--navy-light);
  border-radius: 4px;
  overflow: hidden;
}

.lang-switch button {
  background: transparent;
  border: none;
  padding: 6px 12px;
  color: var(--grey-300);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: all 0.2s;
}

.lang-switch button.active {
  background: var(--gold);
  color: var(--navy);
}

.lang-switch button:hover:not(.active) { color: var(--cream); }

/* ============================================
   HERO
   ============================================ */

.hero {
  background: var(--navy);
  color: var(--cream);
  padding: 120px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(212, 168, 71, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 920px;
}

.hero h1 {
  color: var(--cream);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.1;
  margin-bottom: 0.4em;
  letter-spacing: -0.02em;
}

.hero h1 .highlight {
  color: var(--gold);
  font-style: italic;
  font-weight: 500;
}

.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--grey-300);
  max-width: 680px;
  line-height: 1.5;
  margin-top: 24px;
}

.hero-meta {
  margin-top: 48px;
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--navy-light);
}

.hero-meta-item .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey-500);
  margin-bottom: 6px;
}

.hero-meta-item .value {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 500;
}

/* ============================================
   GRID, CARDS
   ============================================ */

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white-off);
  border: 1px solid var(--cream-soft);
  padding: 32px;
  border-radius: 6px;
  transition: all 0.25s;
}

.card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-dark {
  background: var(--navy-soft);
  border: 1px solid var(--navy-light);
  color: var(--cream);
  padding: 32px;
  border-radius: 6px;
}

.card-dark h3, .card-dark h4 { color: var(--cream); }

.card-num {
  font-family: var(--serif);
  font-size: 3rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.3em;
  font-weight: 500;
}

.card-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-soft);
  margin-bottom: 0.8em;
  display: block;
}

/* ============================================
   STATS row
   ============================================ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  border-top: 1px solid var(--cream-soft);
  border-bottom: 1px solid var(--cream-soft);
}

.stats-row .stat {
  padding: 32px 24px;
  border-right: 1px solid var(--cream-soft);
}

.stats-row .stat:last-child { border-right: none; }

.stat-num {
  font-family: var(--serif);
  font-size: 2.6rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-num .unit {
  font-size: 1.2rem;
  color: var(--gold-soft);
  font-weight: 400;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-500);
}

.stats-row.dark { border-color: var(--navy-light); }
.stats-row.dark .stat { border-color: var(--navy-light); }
.stats-row.dark .stat-num { color: var(--cream); }
.stats-row.dark .stat-num .unit { color: var(--gold); }
.stats-row.dark .stat-label { color: var(--grey-300); }

/* ============================================
   QUOTE / PULL QUOTE
   ============================================ */

.pullquote {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--navy);
  border-left: 3px solid var(--gold);
  padding: 8px 0 8px 32px;
  margin: 48px 0;
  max-width: 800px;
}

.pullquote-dark { color: var(--cream); border-color: var(--gold); }

.pullquote-author {
  display: block;
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-top: 16px;
}

/* ============================================
   AGENTS / ORQUESTRA cards
   ============================================ */

.orquestra-section {
  margin-bottom: 64px;
}

.orquestra-section-header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cream-soft);
}

.orquestra-section-header .num {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--gold);
  font-weight: 500;
}

.agent-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.agent-card {
  background: var(--white-off);
  border: 1px solid var(--cream-soft);
  border-left: 3px solid var(--gold);
  padding: 24px;
  border-radius: 4px;
}

.agent-card h4 {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.agent-card p {
  font-size: 0.95rem;
  color: var(--grey-700);
  line-height: 1.55;
  margin: 0;
}

/* ============================================
   TIMELINE / FUNNEL stages
   ============================================ */

.stages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 20px 24px;
  background: var(--white-off);
  border: 1px solid var(--cream-soft);
  border-radius: 4px;
  transition: all 0.2s;
}

.stage:hover {
  border-color: var(--gold);
  transform: translateX(4px);
}

.stage-num {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--gold);
  font-weight: 500;
  line-height: 1;
}

.stage-title { font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.stage-desc { font-size: 0.92rem; color: var(--grey-700); margin: 0; }
.stage-metric {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--gold-soft);
  font-weight: 500;
  white-space: nowrap;
}

/* ============================================
   TRACK RECORD / TRAJECTÒRIA
   ============================================ */

.track-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0;
  position: relative;
  margin-top: 64px;
}

.track-divider {
  background: var(--senyera);
  opacity: 0.35;
  margin: 16px 0;
}

.track-col {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 0 48px;
}

.track-col:first-child { padding-left: 0; }
.track-col:last-child { padding-right: 0; }

.track-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-item .year {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.track-item .name {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 0;
}

.track-item .desc {
  color: var(--grey-700);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 4px 0 0;
}

.track-item .flags {
  display: inline-block;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  background: var(--cream-soft);
  padding: 4px 12px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 4px;
}

.track-item.is-current {
  position: relative;
  padding-left: 20px;
  border-left: 3px solid var(--gold);
  margin-left: -20px;
}

.track-item .badge-actual {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 4px;
}

.track-item .badge-actual::before {
  content: '★';
  font-size: 0.85rem;
  color: var(--gold);
}

@media (max-width: 900px) {
  .track-grid { grid-template-columns: 1fr; }
  .track-divider { display: none; }
  .track-col { padding: 0; gap: 48px; }
  .track-col:not(:first-child) {
    border-top: 1px solid var(--cream-soft);
    padding-top: 48px;
    margin-top: 48px;
  }
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--navy);
  color: var(--grey-300);
  padding: 64px 0 32px;
  border-top: 1px solid var(--navy-light);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; font-size: 0.92rem; }
.footer-col a { color: var(--grey-300); }
.footer-col a:hover { color: var(--cream); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--navy-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--grey-500);
  letter-spacing: 0.04em;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  color: var(--navy);
}

.btn-outline {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--gold);
}

.btn-outline:hover {
  background: var(--gold);
  color: var(--navy);
}

.btn-arrow::after {
  content: '→';
  transition: transform 0.2s;
}

.btn-arrow:hover::after { transform: translateX(4px); }

/* ============================================
   ALERT BANNER
   ============================================ */

.alert-banner {
  background: linear-gradient(90deg, var(--senyera) 0%, var(--senyera-soft) 100%);
  color: white;
  padding: 14px 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.alert-banner .container {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.alert-banner .pulse {
  width: 8px; height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================
   CASE / SCENARIO blocks
   ============================================ */

.case-block {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  margin-bottom: 96px;
  align-items: center;
}

@media (max-width: 900px) {
  .case-block { grid-template-columns: 1fr; gap: 32px; }
}

.case-block:nth-child(even) .case-visual { order: 2; }
.case-block:nth-child(even) .case-text { order: 1; }

.case-visual {
  background: var(--navy);
  color: var(--cream);
  padding: 48px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.case-visual::before {
  content: '';
  position: absolute;
  top: -30%; right: -30%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(212, 168, 71, 0.15) 0%, transparent 70%);
}

.case-name {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--gold);
  margin-bottom: 12px;
  position: relative;
}

.case-meta {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--grey-300);
  letter-spacing: 0.04em;
  margin-bottom: 32px;
  position: relative;
}

.case-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  position: relative;
}

.case-stat {
  border-top: 1px solid var(--navy-light);
  padding-top: 16px;
}

.case-stat .num {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--gold-light);
  font-weight: 500;
}

.case-stat .lbl {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grey-300);
  margin-top: 4px;
}

/* ============================================
   AUDIENCIAS DEMO
   ============================================ */

.demo-frame {
  background: var(--navy);
  border-radius: 8px;
  border: 1px solid var(--navy-light);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.demo-header {
  background: var(--navy-soft);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--navy-light);
}

.demo-title {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1.1rem;
}

.demo-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--grey-300);
}

.demo-status .dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.demo-body {
  padding: 32px;
  color: var(--cream);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
}

@media (max-width: 800px) {
  .demo-body { grid-template-columns: 1fr; }
}

.demo-controls h4 {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.control-group {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--navy-light);
}

.control-group:last-child { border: none; }

.control-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--grey-300);
  margin-bottom: 6px;
}

.control-group .value {
  font-family: var(--mono);
  color: var(--cream);
  font-size: 0.95rem;
}

.demo-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-result .estimate {
  font-family: var(--serif);
  font-size: 4rem;
  color: var(--gold);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 8px;
}

.demo-result .estimate-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--grey-300);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 32px;
}

.demo-json {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--grey-300);
  white-space: pre;
  overflow-x: auto;
  border: 1px solid var(--navy-light);
}

.demo-json .key { color: var(--gold-light); }
.demo-json .str { color: #93c5fd; }
.demo-json .num { color: #86efac; }

/* ============================================
   UTILS
   ============================================ */

.text-center { text-align: center; }
.mt-1 { margin-top: 16px; } .mt-2 { margin-top: 32px; } .mt-3 { margin-top: 48px; }
.mb-1 { margin-bottom: 16px; } .mb-2 { margin-bottom: 32px; } .mb-3 { margin-bottom: 48px; }

[hidden] { display: none !important; }

/* Animations */
.fade-in { animation: fadeIn 0.6s ease forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
