/* ============ Presentación: secciones de pantalla completa, scroll continuo ============ */
html {
  scroll-behavior: smooth;
}

.slide {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--top-h) + clamp(1.25rem, 4.5vh, 3.25rem)) 0 clamp(2rem, 6vh, 4rem);
  display: grid;
  align-content: center;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: 0 -0.8rem 2rem -1rem rgba(0, 12, 16, 0.5);
  outline: none;
  overflow-x: clip; /* el lienzo 3D es más grande que su caja */
}
.slide:first-child {
  border-radius: 0;
  box-shadow: none;
}
/* Cada sección sube como una hoja sobre la anterior */
.slide + .slide {
  margin-top: calc(var(--radius-sheet) * -1);
}
.slide--hero {
  background: var(--bg-a);
}
.slide--deep {
  background: var(--bg-b);
}
.slide--light {
  background: var(--plate);
  color: var(--on-plate);
  color-scheme: light;
}
.slide > * {
  min-width: 0;
}

.slide h2 {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  max-width: 17ch;
}
.lead {
  margin-top: 1rem;
  max-width: 54ch;
  font-size: clamp(1.02rem, 0.97rem + 0.32vw, 1.22rem);
  line-height: 1.5;
  color: var(--on-blue-soft);
}
.slide--light .lead {
  color: var(--on-plate-soft);
}

/* Entrada de cada sección (una vez): el titular sube palabra por palabra y el resto aparece escalonado */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.js .w > span {
  display: inline-block;
  transform: translateY(108%);
}
.js .is-in .w > span,
.js .is-in.w > span {
  transform: none;
  transition: transform 760ms var(--ease-out) calc(var(--i) * 32ms);
}
.js .rv {
  opacity: 0;
  transform: translateY(22px);
}
.js .rv.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 520ms ease, transform 760ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 35ms + 60ms);
}
.still .w > span,
.still .rv {
  transform: none !important;
  opacity: 1 !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .w > span,
  .js .rv {
    transform: none;
    opacity: 1;
    transition: none !important;
  }
}

/* ============ Cabecera ============ */
.top {
  --tone-ink: #fff;
  --tone-soft: rgba(208, 228, 230, 0.74);
  --tone-bar: rgba(4, 34, 42, 0.78);
  --tone-line: rgba(179, 212, 214, 0.14);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--top-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0 var(--gutter);
  background: var(--tone-bar);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--tone-line);
  color: var(--tone-ink);
  transition: background-color 300ms ease, border-color 300ms ease, color 300ms ease;
}
.top[data-tone="light"] {
  --tone-ink: #0f1e24;
  --tone-soft: #475a60;
  --tone-bar: rgba(238, 244, 244, 0.86);
  --tone-line: rgba(14, 30, 36, 0.1);
}
.brand {
  position: relative;
  justify-self: start;
  display: inline-flex;
  border-radius: 6px;
  transition: transform 160ms var(--ease-out);
}
.brand:active {
  transform: scale(0.97);
}
.brand img {
  height: 1.9rem;
  width: auto;
  transition: opacity 300ms ease;
}
.brand__l {
  position: absolute;
  inset: 0 auto auto 0;
  opacity: 0;
}
.top[data-tone="light"] .brand__l {
  opacity: 1;
}
.top[data-tone="light"] .brand__d {
  opacity: 0;
}
.now {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.92rem;
  white-space: nowrap;
}
.now__n {
  color: var(--tone-soft);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.now__name {
  font-family: var(--font-plate);
  font-weight: 600;
}
.top__end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.client {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--tone-soft);
}
.client img {
  height: 1.3rem;
  width: auto;
  filter: brightness(0) invert(1);
  transition: filter 300ms ease;
}
.top[data-tone="light"] .client img {
  filter: none;
}
.idx-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.4rem;
  padding: 0 0.95rem 0 0.75rem;
  border-radius: 99px;
  border: 1px solid var(--tone-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--tone-ink);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.top[data-tone="light"] .idx-btn {
  background: rgba(14, 30, 36, 0.05);
  border-color: rgba(14, 30, 36, 0.16);
}
.idx-btn .ic {
  width: 1.1rem;
  height: 1.1rem;
}
.idx-btn:active {
  transform: scale(0.97);
}
@media (hover: hover) and (pointer: fine) {
  .idx-btn:hover {
    background: rgba(255, 255, 255, 0.14);
  }
  .top[data-tone="light"] .idx-btn:hover {
    background: rgba(14, 30, 36, 0.1);
  }
}

/* Progreso: una línea fina bajo la cabecera */
.progress {
  position: fixed;
  inset: var(--top-h) 0 auto 0;
  z-index: 51;
  height: 2px;
  pointer-events: none;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--blue-lit);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 500ms var(--ease-out);
}

@media (max-width: 999px) {
  .now,
  .idx-btn {
    display: none;
  }
  .top {
    grid-template-columns: auto 1fr;
  }
}
@media (max-width: 560px) {
  :root {
    --top-h: 3.6rem;
  }
  .brand img {
    height: 1.45rem;
  }
  .client span {
    display: none;
  }
  .client img {
    height: 1.05rem;
  }
}

/* ============ Riel de secciones (escritorio) ============ */
.rail {
  --dot: rgba(255, 255, 255, 0.5);
  --dot-on: #fff;
  position: fixed;
  right: clamp(0.5rem, 1.2vw, 1.3rem);
  top: 50%;
  translate: 0 -50%;
  z-index: 40;
  display: grid;
  gap: 0.05rem;
}
.rail[data-tone="light"] {
  --dot: rgba(14, 30, 36, 0.32);
  --dot-on: var(--blue);
}
.rail a {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.7rem;
  text-decoration: none;
}
.rail a.rail__gap {
  margin-top: 0.55rem;
}
.rail a::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 99px;
  background: var(--dot);
  transition: height 260ms var(--ease-out), background-color 200ms ease;
}
.rail a[aria-current="true"]::before {
  height: 1.15rem;
  background: var(--dot-on);
}
.rail__label {
  position: absolute;
  right: 2.1rem;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
  background: var(--blue-ink);
  color: var(--on-blue);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(0.35rem);
  transition: opacity 150ms ease, transform 200ms var(--ease-out);
  pointer-events: none;
}
.rail a:focus-visible .rail__label {
  opacity: 1;
  transform: none;
}
@media (hover: hover) and (pointer: fine) {
  .rail a:hover .rail__label {
    opacity: 1;
    transform: none;
  }
  .rail a:hover::before {
    background: var(--dot-on);
  }
}
@media (max-width: 999px) {
  .rail {
    display: none;
  }
}

/* ============ Barra inferior (celular y tablet) ============ */
.pager {
  position: fixed;
  left: 50%;
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 45;
  display: none;
  align-items: center;
  gap: 0.25rem;
  width: min(100% - 1.5rem, 26rem);
  padding: 0.3rem;
  border-radius: 99px;
  background: rgba(2, 22, 28, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(179, 212, 214, 0.18);
  box-shadow: 0 0.8rem 1.6rem -0.8rem rgba(0, 12, 16, 0.7);
  color: var(--on-blue);
}
.pager__btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 140ms var(--ease-out), opacity 160ms ease;
}
.pager__btn:active {
  transform: scale(0.94);
}
.pager__btn:disabled {
  opacity: 0.3;
}
.pager__btn .ic {
  width: 1.15rem;
  height: 1.15rem;
}
.pager__now {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  background: none;
  font-size: 0.9rem;
}
.pager__now .now__n {
  color: var(--on-blue-soft);
  font-size: 0.78rem;
  flex: none;
}
.pager__now .now__name {
  font-family: var(--font-plate);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pager__now .ic {
  width: 1rem;
  height: 1rem;
  flex: none;
  transform: rotate(180deg);
}
@media (max-width: 999px) {
  .pager {
    display: flex;
  }
  .slide {
    padding-bottom: 6.5rem;
  }
}
.idx-open .pager {
  visibility: hidden;
}

/* ============ Índice ============ */
.indice {
  margin: 0 0 0 auto;
  width: min(100%, 31rem);
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  background: var(--blue-ink);
  color: var(--on-blue);
  overflow: auto;
  overscroll-behavior: contain;
}
.indice[open] {
  animation: sheet-in 340ms var(--ease-drawer);
}
.indice::backdrop {
  background: rgba(0, 10, 14, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.indice[open]::backdrop {
  animation: fade-in 260ms ease;
}
@keyframes sheet-in {
  from {
    transform: translateX(100%);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.idx {
  padding: 1.2rem clamp(1.2rem, 4vw, 2rem) 2.5rem;
}
.idx__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -1.2rem calc(clamp(1.2rem, 4vw, 2rem) * -1) 0;
  padding: 1rem clamp(1.2rem, 4vw, 2rem);
  background: var(--blue-ink);
  border-bottom: 1px solid var(--line-dark);
}
.idx__head h2 {
  font-size: 1.25rem;
  max-width: none;
}
.idx__close {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 140ms var(--ease-out);
}
.idx__close:active {
  transform: scale(0.94);
}
.idx__list {
  margin-top: 0.8rem;
  display: grid;
}
.idx__list > li {
  border-bottom: 1px solid var(--line-dark);
  padding: 0.25rem 0;
}
.idx__sec {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.6rem;
  margin-inline: -0.6rem;
  border-radius: 0.6rem;
  text-decoration: none;
  font-family: var(--font-plate);
  font-weight: 600;
  font-size: 1.12rem;
  transition: background-color 150ms ease;
}
.idx__sec small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--on-blue-soft);
}
.idx__n {
  width: 1.9rem;
  flex: none;
  color: var(--on-blue-soft);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
}
.idx__sec[aria-current="true"] {
  background: rgba(184, 224, 216, 0.14);
}
.idx__sec[aria-current="true"] .idx__n {
  color: var(--blue-lit);
}
@media (hover: hover) and (pointer: fine) {
  .idx__sec:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}
.idx__feats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0 0.8rem 2.9rem;
}

/* Chips de funcionalidad (índice y flujo) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem 0.32rem 0.4rem;
  border-radius: 99px;
  border: 1px solid rgba(179, 212, 214, 0.26);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 140ms var(--ease-out);
}
.chip:active {
  transform: scale(0.97);
}
.chip__n {
  display: grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 99px;
  background: rgba(184, 224, 216, 0.18);
  color: var(--blue-lit);
  font-size: 0.72rem;
  font-weight: 700;
}
@media (hover: hover) and (pointer: fine) {
  .chip:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(179, 212, 214, 0.5);
  }
}

/* Aviso de borrador (marcadores sin completar) */
.draft {
  position: fixed;
  left: var(--gutter);
  bottom: 1rem;
  z-index: 60;
  max-width: min(30rem, calc(100% - 2rem));
  padding: 0.6rem 0.9rem;
  border-radius: 0.7rem;
  background: var(--soon);
  color: #1d1406;
  font-size: 0.85rem;
  line-height: 1.35;
  box-shadow: 0 0.6rem 1.4rem -0.6rem rgba(0, 0, 0, 0.5);
}
.draft[hidden] {
  display: none;
}
@media (max-width: 999px) {
  .draft {
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(max(0.8rem, env(safe-area-inset-bottom)) + 3.9rem);
    max-width: none;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }
  .draft strong {
    font-weight: 700;
  }
}
.tbd {
  display: inline-block;
  padding: 0.05em 0.3em;
  border-radius: 0.2em;
  outline: 2px dashed var(--soon);
  outline-offset: 2px;
  color: var(--soon);
}

/* Entrada corta para contenido que cambia (paneles, mensajes) */
.swap {
  animation: swap-in 360ms var(--ease-out);
}
@keyframes swap-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
