/* ════════════════════════════════════════════════════════════
   Subvenciones.es — Landing
   Concepto: archivo administrativo táctil, papel + tinta carbón.
   Jerarquía por tipografía + filetes ruleados.
   Acento institucional en carmesí BOE (#C8102E) — CTAs, iconos y sellos.

   Las variables (--bg, --accent, --font-*, --step-*, …) viven en tokens.css.
   ════════════════════════════════════════════════════════════ */

/* ───────────────── Reset mínimo ───────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-2);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Énfasis: NO usamos italic editorial. <em> se distingue por peso y, donde aplica,
   por color institucional (se ajusta por componente).                            */
em { font-style: normal; font-weight: 600; }

/* text-wrap: balance reparte las líneas de titulares de forma equilibrada,
   evita la palabra huérfana suelta. Soportado en Chrome/Edge/Firefox/Safari TP. */
h1, h2, h3 { text-wrap: balance; }
p          { text-wrap: pretty; }   /* reduce orfandades en párrafos largos */

/* Selección con acento — gesto premium */
::selection { background: var(--accent); color: var(--accent-ink); }

/* ───────────────── Container ───────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: var(--container-n); }

/* ════════════════════════════════════════════════════════════
   NAV
   ════════════════════════════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(247, 242, 240, 0.85);   /* papel translúcido */
  border-bottom: 1px solid var(--border);   /* filete siempre visible, no en hover */
}

.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--step-1); font-weight: 500;
  letter-spacing: -0.01em;
}
/* Dot del logo: estático, no anima (no es un live-indicator real).
   Carmesí mate con halo sutil del mismo tono — un sello tipográfico, no un latido. */
.nav__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.nav__name-accent { color: var(--text-mute); }

.nav__links {
  display: flex; gap: 32px;
  font-size: var(--step-0);
  color: var(--text-soft);
}
.nav__links a {
  position: relative;
  transition: color var(--t-fast) var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: '';
  position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: var(--accent);
  transition: width var(--t-med) var(--ease);
}
.nav__links a:hover::after { width: 100%; }

.nav__cta {
  font-size: var(--step-0);
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  transition: all var(--t-fast) var(--ease);
}
.nav__cta:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: clamp(64px, 12vh, 140px) 0 clamp(80px, 14vh, 160px);
  /* halo decorativo eliminado: ya no es un SaaS dark-glow; el papel respira. */
}
.hero__container { position: relative; }

/* Sello administrativo decorativo (esquina sup. derecha del hero).
   Rotación ligera para gesto de cuño estampado a mano. En móvil se reduce. */
.hero__seal {
  position: absolute;
  top: clamp(-20px, -2vh, 0px);
  right: clamp(8px, 3vw, 48px);
  width: clamp(120px, 14vw, 180px);
  height: auto;
  color: var(--accent);
  opacity: 0.85;
  transform: rotate(-8deg);
  pointer-events: none;
}
.hero__seal-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; }
.hero__seal-mark { font-family: var(--font-serif); font-size: 28px; font-weight: 600; }
.hero__seal-sub  { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; }
@media (max-width: 720px) {
  /* En móvil el sello se reduce y se reposiciona para no competir con el titular. */
  .hero__seal { width: 90px; top: -8px; right: 12px; opacity: 0.7; }
}

.hero__meta { margin-bottom: 40px; }

/* Pill convertida en etiqueta administrativa con tipografía mono tabular. */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  font-weight: 500;
  color: var(--text-soft);
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;          /* esquina cuadrada admin, no pill SaaS */
  background: var(--bg-elev);              /* papel limpio sobre fondo */
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.pill__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.hero__title {
  font-family: var(--font-serif);
  font-size: var(--step-7);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 36px;
  max-width: 22ch;
}
/* El énfasis del hero ya no es italic-editorial; usamos peso fuerte
   y el mismo tono del cuerpo. El color acento llegará en colorize. */
.hero__title em {
  font-weight: 600;
  color: inherit;
}

.hero__subtitle {
  font-size: var(--step-3);
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 56ch;
  margin: 0 0 64px;
  font-weight: 400;
}

/* ════════════════════════════════════════════════════════════
   SELECTOR de entidad (paso 1 del wizard)
   ════════════════════════════════════════════════════════════ */
.selector {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  max-width: 920px;
}
/* Label del selector: mono administrativa, no uppercase tracked,
   coherente con el resto de eyebrows del lane.                    */
.selector__label {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  color: var(--text-mute);
  margin: 0 0 16px;
  letter-spacing: 0;
  font-weight: 500;
}

.selector__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 720px) {
  .selector__grid { grid-template-columns: repeat(2, 1fr); }
}

/* Celdas tabulares de selección — esquina cuasi-cuadrada (4px) admin, no SaaS pill. */
.chip {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text);
  font-size: var(--step-2);
  font-weight: 500;
  text-align: left;
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
  position: relative;
}
.chip:hover {
  border-color: var(--accent);
  background: var(--bg-elev-2);
  transform: translateY(-1px);
}
.chip:hover .chip__icon { color: var(--accent); }

.chip__icon {
  width: 22px; height: 22px;
  color: var(--text-mute);
  transition: color var(--t-fast) var(--ease);
  flex-shrink: 0;
}

/* Seleccionado: NO pintamos todo el chip de carmesí (sería excesivo en light).
   Borde carmesí + fondo lavado + tinta carbón. El sello visual viene en polish. */
.chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--text);
}
.chip.is-selected .chip__icon { color: var(--accent); }

.selector__micro {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: var(--step-0);
  color: var(--text-mute);
  margin: 0;
}
.selector__micro span[aria-hidden] { color: var(--text-faint); }

/* ════════════════════════════════════════════════════════════
   SECTION genérica
   ════════════════════════════════════════════════════════════ */
.section {
  padding: clamp(80px, 12vh, 140px) 0;
  border-top: 1px solid var(--border);
}
.section--alt {
  background: var(--bg-alt);
}

.section__head {
  margin-bottom: 72px;
  max-width: 800px;
}
/* Eyebrow administrativa: mono tabular, sin uppercase tracked
   (el tropo AI "tiny uppercase tracked eyebrow above every section").  */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  color: var(--text-mute);
  letter-spacing: 0;
  margin-bottom: 24px;
  font-weight: 500;
}
.section__title {
  font-family: var(--font-serif);
  font-size: var(--step-6);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
/* Énfasis en titulares de sección: color institucional (lo aplica colorize)
   y peso fuerte. Adiós al italic. */
.section__title em {
  font-weight: 600;
  color: var(--accent);
}

/* ───────────────── Source (fuente / BDNS) ─────────────────
   Layout editorial en 2 columnas por fila: pregunta a la izda,
   respuesta a la dcha. Líneas finas separando bloques.
   ─────────────────────────────────────────────────────────── */
.source {
  border-top: 1px solid var(--border-strong);
}
.source__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 64px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.source__q h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
  max-width: 22ch;
}
.source__a p {
  margin: 0;
  font-size: var(--step-3);
  line-height: 1.5;
  color: var(--text-soft);
  font-weight: 400;
  max-width: 56ch;
}

/* Highlight editorial: texto principal en blanco + subrayado verde lima fino.
   Usa background-image (no border-bottom) para que el grosor sea constante
   y respete los descendientes de letras como "g", "p", etc. */
.hl {
  color: var(--text);
  background-image: linear-gradient(to top, var(--accent) 0, var(--accent) 2px, transparent 2px);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0 2px;
}

@media (max-width: 900px) {
  .source__row {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 36px 0;
  }
}

/* ───────────────── Grid 3 columnas (features) ───────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; gap: 56px; }
}

.feature {
  padding-top: 32px;
  border-top: 1px solid var(--border-strong);
}
.feature__icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  color: var(--accent);
  margin-bottom: 28px;
}
.feature__icon svg { width: 22px; height: 22px; }
.feature h3 {
  font-family: var(--font-serif);
  font-size: var(--step-4);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.feature p {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--step-2);
  line-height: 1.55;
  font-weight: 400;
}

/* ───────────────── Steps (cómo funciona) ───────────────── */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  gap: 0;
}
.step {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.step:last-child { border-bottom: 1px solid var(--border); }
/* Números de paso: ahora son tabulares en mono. Justifica el uso del 3er font
   family porque cumplen función de dato (orden), no decoración. */
.step__num {
  font-family: var(--font-mono);
  font-size: var(--step-5);
  font-weight: 500;
  color: var(--text-mute);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.step__body h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.step__body p {
  margin: 0;
  color: var(--text-soft);
  font-size: var(--step-3);
  max-width: 58ch;
  font-weight: 400;
}
@media (max-width: 720px) {
  .step { grid-template-columns: 1fr; gap: 12px; }
  .step__num { font-size: var(--step-4); }
}

.steps__note {
  margin-top: 48px;
  font-size: var(--step-1);
  color: var(--text-mute);
  max-width: 70ch;
}

/* Diferencia: párrafos separados por filetes ruleados,
   mismo gesto editorial que la sección BDNS. NO son cards. */
.diffs {
  border-top: 1px solid var(--border-strong);
}
.diff {
  margin: 0;
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.1vw, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 64ch;
}
.diff:last-child { border-bottom: 1px solid var(--border-strong); }
.diff em { color: var(--accent); font-weight: 600; }

/* ───────────────── Scope (sí cubre / todavía no) ───────────────── */
.scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}
@media (max-width: 900px) {
  .scope { grid-template-columns: 1fr; }
}
.scope__col {
  padding: 48px 40px;
  border-right: 1px solid var(--border);
}
.scope__col:last-child { border-right: 0; }
@media (max-width: 900px) {
  .scope__col { border-right: 0; border-bottom: 1px solid var(--border); }
  .scope__col:last-child { border-bottom: 0; }
}

.scope__head {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-serif);
  font-size: var(--step-4);
  margin-bottom: 24px;
  font-weight: 600;
}
.scope__head svg {
  width: 28px; height: 28px;
  padding: 5px;
  border-radius: 50%;
}
.scope__col--yes .scope__head svg {
  background: var(--accent-wash);
  color: var(--accent);
}
.scope__col--no .scope__head svg {
  background: rgba(27, 24, 22, 0.05);   /* lavado de tinta carbón */
  color: var(--text-mute);
}
.scope__col p {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.55;
  color: var(--text-soft);
  font-weight: 400;
}

/* ════════════════════════════════════════════════════════════
   FAQ — acordeón con <details>
   ════════════════════════════════════════════════════════════ */
.faq {
  border-top: 1px solid var(--border);
}
.faq__item {
  border-bottom: 1px solid var(--border);
}
.faq__item > summary {
  list-style: none;
  cursor: pointer;
  padding: 28px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  transition: color var(--t-fast) var(--ease);
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary:hover { color: var(--accent); }

.faq__chevron {
  position: relative;
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.faq__chevron::before,
.faq__chevron::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  background: currentColor;
  transition: transform var(--t-med) var(--ease);
}
.faq__chevron::before { /* vertical (|) */
  width: 1.5px; height: 14px;
  transform: translate(-50%, -50%);
}
.faq__chevron::after  { /* horizontal (—) */
  width: 14px; height: 1.5px;
  transform: translate(-50%, -50%);
}
.faq__item[open] > summary .faq__chevron::before {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.faq__body {
  padding: 0 0 28px;
  color: var(--text-soft);
  font-size: var(--step-2);
  max-width: 70ch;
  font-weight: 400;
  animation: faqIn var(--t-med) var(--ease);
}
.faq__body p { margin: 0; }
@keyframes faqIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   CTA FINAL
   ════════════════════════════════════════════════════════════ */
.cta {
  padding: clamp(100px, 16vh, 180px) 0 clamp(120px, 18vh, 200px);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);             /* sección final un paso más material */
  position: relative;
}
/* halo decorativo eliminado: ya no es un SaaS dark-glow. */
/* Sello rectangular tipo cuño de "convocatorias abiertas".
   Gesto de estampa administrativa: borde grueso, mono caps, rotación. */
.cta__stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 6px 12px;
  margin: 0 0 28px;
  transform: rotate(-2deg);
}

.cta__title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 64px;
  max-width: 22ch;
  position: relative;
}
.cta__title em {
  font-weight: 600;
  color: var(--accent);
}
.selector--cta {
  border-top: 1px solid var(--border);
  position: relative;
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: var(--step-0);
  color: var(--text-mute);
}
.footer__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.footer__brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text);
  font-weight: 500;
}
.footer__note, .footer__legal { margin: 0; }

/* Bloque "Datos oficiales" con los dos logotipos institucionales (BDNS + Gobierno).
   Altura común para que los dos logos compongan visualmente bien con el texto. */
.footer__note {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.footer__logo {
  display: block;
  height: 64px;
  width: auto;
}
.footer__logo--gob { height: 72px; }    /* Gobierno con más peso visual a petición del proyecto */

@media (max-width: 720px) {
  .footer__inner { justify-content: flex-start; }
  .footer__logo      { height: 56px; }
  .footer__logo--gob { height: 60px; }
}

/* ════════════════════════════════════════════════════════════
   Reveal-on-scroll
   ════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
