@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --fondo: #F4F2F8;
  --purpura: #3D2F6B;
  --lavanda: #B3A3D9;
  --lavanda-hover: #9B8EC4;
  --lavanda-clara: #C4BAD9;
  --salvia: #A6C4B4;
  --arena: #E6DDBB;
  --gris: #EFEAF4;
  --borde: #D8D0E3;
  --radio: 1rem;
  --ancho: 72rem;
  --lado: clamp(1.25rem, 5vw, 4rem);
  --margen: max(var(--lado), calc((100vw - var(--ancho)) / 2));
  --lento: 900ms cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--purpura);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--purpura); outline-offset: 3px; border-radius: .5rem; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--purpura); color: #fff; padding: .6rem 1rem; border-radius: .6rem;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Cabecera */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.25rem var(--margen);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-mark { width: 34px; height: auto; }
.brand-name { font-weight: 600; letter-spacing: -0.01em; }
.nav { display: none; gap: 1.75rem; margin-left: 1.5rem; }
.nav a, .link-quiet { text-decoration: none; font-size: .95rem; }
.nav a:hover, .link-quiet:hover { text-decoration: underline; text-underline-offset: .25em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.top-actions .link-quiet { display: none; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .75rem 1.4rem;
  border-radius: 999px; font-weight: 500; font-size: 1rem; text-decoration: none;
  transition: background-color .3s ease, color .3s ease;
}
.btn--small { min-height: 2.5rem; padding: .5rem 1.1rem; font-size: .95rem; }
.btn--solid { background: var(--purpura); color: #fff; }
.btn--solid:hover { background: #2E2354; }
.btn--ghost { color: var(--purpura); box-shadow: inset 0 0 0 1.5px var(--purpura); }
.btn--ghost:hover { background: var(--gris); }

/* ---------- El recorrido ---------- */
.story { position: relative; height: 420vh; }
/* 100vh para navegadores sin svh; svh para que la barra del móvil no tape la escena */
.stage { position: -webkit-sticky; position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.scene { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; }
.landscape { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.window { transition: fill 2.4s ease 1s; }
.glow { opacity: 0; transition: opacity 3s ease 1.4s; }
.lamp { opacity: 0; transition: opacity 1.2s ease 1.2s; }
.is-lit .window { fill: #E6DDBB; }
.is-lit .glow { opacity: 1; }
.is-lit .lamp { opacity: 1; }

.mist-a { animation: drift 90s ease-in-out infinite alternate; }
.mist-b { animation: drift 70s ease-in-out infinite alternate-reverse; }
.mist-c { animation: drift 110s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(80px); } }

.beat {
  position: absolute; z-index: 2;
  left: var(--margen); right: var(--margen);
  opacity: 0;
  will-change: opacity, transform;
  pointer-events: none; /* los textos del recorrido no tapan nada; los enlaces sí reciben el toque */
}
.beat a, .beat button { pointer-events: auto; }

/* 1. Antes */
.beat--hero { top: 7rem; opacity: 1; }
.hero-title {
  max-width: 13em;
  font-size: clamp(2.5rem, 8.6vw, 5.4rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-weight: 600;
  text-wrap: balance;
}
.hero-time { display: block; }
.hero-sub { margin-top: 1.1rem; font-size: clamp(1rem, 1.5vw, 1.15rem); font-weight: 500; }
.hero-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* Textos de los momentos */
.beat--caption, .end-title {
  top: 7rem;
  font-size: clamp(1.7rem, 4.3vw, 3.2rem);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.08;
  max-width: 36rem;
  text-wrap: balance;
}
.beat--caption { right: auto; }
.beat--big { font-size: clamp(2.3rem, 7vw, 5rem); letter-spacing: -0.035em; line-height: 1.02; max-width: 11em; }
.beat--end { top: 7rem; }
.end-title { position: static; max-width: 14em; }

/* 2. Notas sueltas alrededor de la ventana (las coloca js/main.js) */
.beat--notes { list-style: none; margin: 0; padding: 0; top: 0; left: 0; right: 0; bottom: 0; opacity: 1; z-index: 3; /* por encima de la pantalla limpia */ }
.note {
  position: absolute; left: 0; top: 0;
  white-space: nowrap;
  padding: .55rem .95rem;
  border-radius: .8rem;
  background: var(--fondo);
  font-size: .95rem; font-weight: 500; line-height: 1.3;
  box-shadow: 0 1px 0 var(--borde), 0 12px 26px -18px rgba(61, 47, 107, .45);
  opacity: 0;
}
.note--arena { background: var(--arena); }

/* 3. La bisagra: la pantalla limpia donde se ordenan las notas */
.beat--panel { top: 15.5rem; display: flex; justify-content: flex-start; }
.panel {
  width: min(100%, 24rem);
  background: var(--fondo);
  border-radius: 1.5rem;
  padding: .9rem .6rem .6rem;
  box-shadow: 0 1px 0 var(--borde), 0 22px 44px -28px rgba(61, 47, 107, .45);
}
.panel-head { display: flex; align-items: center; gap: .5rem; padding: 0 .4rem .7rem; font-weight: 600; font-size: .95rem; }
.panel-head img { width: 24px; height: auto; }
.panel-rows { list-style: none; margin: 0; padding: 0; }
.panel-row { border-top: 1px solid var(--borde); }
.slot-text {
  display: inline-block; white-space: nowrap;
  padding: .55rem .95rem; font-size: .95rem; font-weight: 500; line-height: 1.3;
  visibility: hidden; /* en la versión completa llegan las notas volando a este hueco */
}
.is-reduced .slot-text, .is-static .slot-text { visibility: visible; }

/* 4. El futuro cercano */
.beat--future { top: 7rem; max-width: 34rem; right: auto; display: grid; gap: .8rem; }
.line { font-size: clamp(1.15rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; opacity: 0; }
.line--lead { font-size: clamp(1.7rem, 4.3vw, 3.2rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; margin-bottom: .4rem; }

.progress { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 3px; }
.progress span { display: block; height: 100%; width: 100%; background: var(--purpura); transform-origin: left; transform: scaleX(0); opacity: .5; }

/* ---------- Debajo del recorrido: quieto, alineado y en cajas ---------- */
.week, .about, .explore { padding: clamp(4.5rem, 10vw, 7.5rem) var(--margen) 0; }
.week h2, .about h2, .explore h2, .closing h2 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; }

.week-head { display: none; }
.week-list { list-style: none; margin: 2.25rem 0 0; padding: 0; display: grid; gap: 1rem; }
.day {
  display: grid; gap: .5rem;
  padding: 1rem; border-radius: 1.25rem;
  border: 1px solid var(--borde); background: var(--fondo);
}
.day-name { font-size: 1.15rem; letter-spacing: -0.01em; padding: 0 .25rem .25rem; }
.day-now, .day-with { border-radius: var(--radio); padding: .8rem 1rem; }
.day-now { background: var(--gris); }
.day-with { background: var(--salvia); font-weight: 500; }
.day-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .15rem; }
.day p { font-size: 1rem; line-height: 1.45; }

.about-box {
  display: grid; gap: 2rem;
  background: var(--gris); border-radius: 2rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
}
.about-who p { margin-top: 1rem; max-width: 34rem; text-wrap: pretty; }
.about-not h3 { font-size: 1.25rem; letter-spacing: -0.015em; }
.about-not ul { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.about-not li { background: var(--fondo); border-radius: var(--radio); padding: .8rem 1rem; line-height: 1.45; }
.about-not strong { font-weight: 600; }

.explore { padding-bottom: clamp(4rem, 9vw, 6rem); }
.explore-list { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; }
.explore-list a {
  display: grid; gap: .25rem;
  padding: 1.4rem 0; border-top: 1px solid var(--lavanda);
  text-decoration: none;
}
.explore-list li:last-child a { border-bottom: 1px solid var(--lavanda); }
.explore-name { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; letter-spacing: -0.02em; }
.explore-line { font-size: 1rem; }
.explore-list a:hover .explore-name, .explore-list a:focus-visible .explore-name { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 2px; }

/* Cierre */
.closing {
  text-align: center;
  padding: clamp(4rem, 10vw, 7rem) var(--lado);
  background: var(--gris);
  border-radius: 2rem 2rem 0 0;
}
.closing-mark { width: 6.5rem; margin: 0 auto 1.5rem; }
.closing-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.promises {
  list-style: none; padding: 0; margin: 3.5rem auto 0;
  max-width: 56rem;
  display: grid; gap: .9rem;
  font-size: .98rem;
}

/* Pie */
.foot {
  background: var(--gris);
  border-top: 1px solid var(--borde);
  padding: 3rem var(--margen) 4rem;
  display: grid; gap: 2rem;
  font-size: .95rem;
}
.foot-brand { display: grid; gap: .25rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; }
.foot-links a, .foot-brand a { text-decoration: none; }
.foot-links a:hover, .foot-brand a:hover { text-decoration: underline; text-underline-offset: .25em; }
.foot-patient h2 { font-size: 1rem; letter-spacing: -0.01em; margin-bottom: .35rem; }
.foot-patient p { max-width: 36rem; }

/* Móviles bajos (iPhone SE, o con la barra del navegador a la vista) */
@media (max-width: 759px) and (max-height: 640px) {
  .beat--hero, .beat--caption, .beat--end, .beat--future { top: 5.25rem; }
  .hero-title { font-size: 2.2rem; }
  .beat--caption, .end-title, .line--lead { font-size: 1.45rem; }
  .beat--big { font-size: 1.95rem; }
  .line { font-size: 1.05rem; }
  .beat--panel { top: 11.5rem; }
  .panel-head { padding-bottom: .45rem; }
  .note, .slot-text { padding: .42rem .85rem; font-size: .9rem; }
}

/* Tableta y escritorio */
@media (min-width: 760px) {
  .nav { display: flex; }
  .top-actions .link-quiet { display: inline; }
  .beat--hero, .beat--caption, .beat--end, .beat--future { top: 8.5rem; }
  .beat--panel { top: 8.5rem; justify-content: flex-end; }
  .panel { width: 26rem; padding: 1.1rem .8rem .8rem; }
  .note, .slot-text { font-size: 1.05rem; padding: .65rem 1.05rem; }
  .beat--future { gap: 1rem; }

  .week-head, .day { display: grid; grid-template-columns: 9rem 1fr 1fr; gap: 1rem; align-items: stretch; }
  .week-head { margin-top: 2.25rem; padding: 0 0 .25rem; font-size: .95rem; font-weight: 600; }
  .week-head span:nth-child(2), .week-head span:nth-child(3) { padding-left: 1.1rem; }
  .week-list { margin-top: .75rem; gap: .75rem; }
  .day { padding: 0; border: 0; background: none; border-radius: 0; }
  .day-name { padding: 1rem 0 0; font-size: 1.2rem; }
  .day-now, .day-with { padding: 1rem 1.1rem; }
  .day-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .about-box { grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; }

  .explore-list { grid-template-columns: repeat(2, 1fr); column-gap: 3rem; }
  .explore-list li:nth-last-child(2) a { border-bottom: 1px solid var(--lavanda); }
  .promises { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
  .promises li { padding-top: 1rem; border-top: 1px solid var(--lavanda); text-align: left; }
  .foot { grid-template-columns: 1fr 2fr; align-items: start; }
  .foot-patient { grid-column: 2; }
}
/* Tableta: el texto y la pantalla no caben lado a lado */
@media (min-width: 760px) and (max-width: 1099px) {
  .beat--panel { top: auto; bottom: 9%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* La luz de la consulta se enciende igual: es un fundido de color, no movimiento. */
  .window { transition: fill 2.4s ease 1s !important; }
  .glow { transition: opacity 3s ease 1.4s !important; }
  .lamp { transition: opacity 1.2s ease 1.2s !important; }
}

/* Versión estática, último recurso: todo apilado, con la escena. La activa js/main.js solo cuando
   la página no puede desplazarse por dentro (marcos a altura completa) o sticky no actúa. */
.is-static .mist, .is-static .progress { display: none; }
.is-static .story { height: auto; }
.is-static .stage { position: relative; height: auto; overflow: visible; display: flex; flex-direction: column; gap: 2.25rem; padding: 7rem 0 1rem; }
.is-static .scene {
  position: relative; order: 1;
  height: 56vw; max-height: 30rem; /* en vw: en un marco sin scroll las vh no sirven */
  margin: 0 var(--margen); border-radius: 2rem; overflow: hidden;
  background: var(--gris);
}
.is-static .beat, .is-static .note, .is-static .line { position: static; opacity: 1 !important; transform: none !important; visibility: visible !important; }
.is-static .beat { margin: 0 var(--margen); }
.is-static .beat--hero { order: 0; }
.is-static .beat[data-beat="lose"] { order: 2; }
.is-static .beat--notes { order: 3; display: flex; flex-wrap: wrap; gap: .6rem; }
.is-static .note { transform: rotate(var(--r)) !important; }
.is-static .beat[data-beat="hinge"] { order: 4; margin-top: 1.5rem; }
.is-static .beat--panel { order: 5; justify-content: flex-start; }
.is-static .beat--future { order: 6; margin-top: 1.5rem; }
.is-static .beat--end { order: 7; margin-top: 1.5rem; }

/* Menú del móvil (sin JavaScript: un desplegable) */
.menu-m { position: relative; }
.menu-m summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: .45rem .9rem;
  border-radius: 999px; font-weight: 600; font-size: .95rem;
  box-shadow: inset 0 0 0 1.5px var(--purpura); background: var(--fondo);
}
.menu-m summary::-webkit-details-marker { display: none; }
.menu-m[open] summary { background: var(--purpura); color: #fff; }
.menu-m nav {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30;
  min-width: 15rem; display: grid; gap: .1rem; padding: .5rem;
  background: var(--fondo); border-radius: 1.25rem;
  box-shadow: 0 0 0 1px var(--borde), 0 20px 40px -24px rgba(61, 47, 107, .45);
}
.menu-m nav a { padding: .75rem .9rem; border-radius: .8rem; text-decoration: none; font-weight: 500; }
.menu-m nav a:hover, .menu-m nav a:focus-visible { background: var(--gris); }
.top-actions + .menu-m { margin-left: .6rem; }
@media (min-width: 760px) { .menu-m { display: none; } }

/* Portada: lo que nos preguntan */
.asks { padding: clamp(4.5rem, 10vw, 7.5rem) var(--margen) 0; }
.asks h2 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; }
.asks-list { margin-top: 1.75rem; max-width: 48rem; }
.ask { border-top: 1px solid var(--borde); }
.ask:last-child { border-bottom: 1px solid var(--borde); }
.ask summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; font-weight: 600; font-size: 1.08rem; }
.ask summary::-webkit-details-marker { display: none; }
.ask summary::after { content: "+"; flex: none; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--purpura); font-weight: 600; line-height: 1; }
.ask[open] summary::after { content: "−"; }
.ask p { padding: 0 2.5rem 1.15rem 0; max-width: 40rem; }
.about-more { display: inline-block; margin-top: 1.25rem; font-weight: 600; text-underline-offset: .25em; }
@media (max-width: 759px) {
  .top { gap: .6rem; }
  .brand-name { white-space: nowrap; }
  .top-actions .btn--small { padding: .5rem .95rem; }
  .menu-m summary { padding: .45rem .8rem; }
  .top-actions + .menu-m { margin-left: 0; }
}
.foot-more { display: inline-block; margin-top: .5rem; font-weight: 600; text-underline-offset: .25em; }

/* Giro de cada nota del recorrido (antes en el HTML; fuera para la CSP sin estilos en línea) */
.beat--notes .note:nth-child(1) { --r: -4deg; }
.beat--notes .note:nth-child(2) { --r: 3deg; }
.beat--notes .note:nth-child(3) { --r: -2deg; }
.beat--notes .note:nth-child(4) { --r: 5deg; }
.beat--notes .note:nth-child(5) { --r: -3deg; }
