/* =========================================================
   BASE
   Reset, tipografía de marca, retícula y recursos gráficos
   (líneas verticales y degradado solar) que usa toda la web.
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: inherit;
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss03" 1, "ss05" 1, "ss06" 1;
}
a {
  color: inherit;
}
img,
svg {
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--solar);
  outline-offset: 3px;
}
#app:focus {
  outline: none;
}

/* ---------- Tipografía ---------- */

/* Titular condensado en mayúsculas. <span class="x"> pone una letra en expanded */
.display {
  margin: 0;
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.005em;
}
.display .x {
  font-stretch: 75%;
  animation: desplegar 1.4s var(--io) .15s forwards;
}
@keyframes desplegar {
  from { font-stretch: 75%; }
  to   { font-stretch: 125%; }
}

/* Etiqueta pequeña en mayúsculas */
.label {
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

/* Etiqueta con punto solar delante, como «● OPCIÓN A» del presupuesto */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.eyebrow::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--solar);
  flex: none;
}
.eyebrow--impulso::before {
  background: var(--impulso);
}

.lead {
  font-size: var(--t-md);
  line-height: 1.5;
  margin: 0;
  max-width: 46ch;
}
.muted {
  color: var(--ink-soft);
}
.hint {
  font-size: 13px;
  color: var(--ink-soft);
}
.byline {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Retícula ---------- */
.wrap {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Líneas verticales de marca. El color lo da --l (por defecto, --line).
   Cada <i> es una línea independiente, para poder animarlas una a una. */
.lines {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  left: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
  right: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
}
.lines i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--l, var(--line));
  transform: scaleY(0);
  transform-origin: top;
  animation: revelar-linea .9s var(--io) forwards;
}
.lines i:nth-child(1) { left: 0; }
.lines i:nth-child(2) { left: 25%; animation-delay: .08s; }
.lines i:nth-child(3) { left: 50%; animation-delay: .16s; }
.lines i:nth-child(4) { left: 75%; animation-delay: .24s; }
.lines i:nth-child(5) { left: 100%; animation-delay: .32s; }
@keyframes revelar-linea {
  to { transform: scaleY(1); }
}

/* Degradado solar difuminado (recurso de la guía) */
.glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  width: 55vw;
  height: 55vw;
  max-width: 780px;
  max-height: 780px;
  background: radial-gradient(
    circle,
    var(--solar) 0%,
    rgba(248, 168, 17, 0.5) 38%,
    rgba(248, 168, 17, 0) 70%
  );
  filter: blur(28px);
  animation: respirar 9s var(--io) infinite alternate;
}
@keyframes respirar {
  from { opacity: .82; }
  to   { opacity: 1; }
}

/* Página interior en dos columnas: título a la izquierda, contenido a la derecha,
   separados por una línea vertical (como las páginas del presupuesto) */
.split {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  gap: 0;
  align-items: start;
}
.split-side {
  padding: var(--s-7) var(--s-6) var(--s-7) 0;
  position: sticky;
  top: 0;
}
.split-main {
  padding: var(--s-7) 0 var(--s-7) var(--s-6);
  border-left: 1px solid var(--line-strong);
  min-height: 60vh;
  min-width: 0;
}
.split-side .display {
  font-size: var(--d-title);
}
.split-side .lead {
  margin-top: var(--s-4);
  font-size: var(--t-base);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.empty-msg {
  padding: var(--s-7) 0;
  font-size: var(--t-md);
  margin: 0;
}
.loading {
  padding: 120px var(--pad);
  color: var(--ink-soft);
}
.empty {
  padding: 120px 0;
  text-align: center;
}

@media (max-width: 960px) {
  .lines i:nth-child(2),
  .lines i:nth-child(4) {
    display: none;
  }
}
@media (max-width: 760px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split-side {
    position: static;
    padding: var(--s-6) 0 var(--s-5);
  }
  .split-main {
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    padding: var(--s-5) 0 var(--s-7);
  }
}
/* Revelado en scroll (solo si js-reveal.js lo activa; ver utils.js → revelar()).
   Sin esa clase, .rv no se oculta nunca: el contenido es siempre visible. */
.js-reveal .rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--io), transform .9s var(--io);
}
.js-reveal .rv.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
