/* RC Querétaro — caso de Racha Solutions
   Vocabulario de misal: las instrucciones y avisos van en rojo de rúbrica; el domingo, en rojo
   como en un calendario litúrgico. El verde (tiempo ordinario) solo marca lo confirmado o disponible.
   El cobalto de Racha solo vive en el pie. Nada se anima con el scroll. */

:root {
  --paper: #FAF6F5;
  --paper-2: #F1E8E7;
  --white: #FFFFFF;
  --ink: #0E1219;
  --ink-2: #3A3F4B;
  --fog: #5A606C;
  --line: rgb(14 18 25 / .16);
  --rojo: #D1243F;          /* identidad; texto blanco encima: 5.2:1 */
  --rubric: #B81F37;        /* rojo para texto chico sobre papel: 5.9:1 */
  --rubric-dark: #FF9AA9;   /* rúbrica sobre tinta: 9.3:1 */
  --verde: #1F6B4E;
  --cobalt: #1F2FD1;
  --focus: var(--ink);

  --font: "Archivo", system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 88rem;
  --section: clamp(4.5rem, 10vw, 8.5rem);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--white); padding: .6rem 1rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Titulares: Archivo angosto y pesado, como en la casa Racha */
h2 {
  font-weight: 840;
  font-stretch: 62%;
  font-size: clamp(2.7rem, 6.6vw, 6.6rem);
  line-height: .9;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Rúbrica: lo que en un misal va en rojo, instrucciones y avisos */
.rubric {
  color: var(--rubric);
  font-size: .95rem;
  line-height: 1.4;
  font-stretch: 88%;
  font-weight: 500;
}

.pill {
  display: inline-flex; align-items: center; width: fit-content;
  padding: .2rem .65rem; border-radius: 999px;
  font-size: .82rem; font-weight: 650; font-style: normal; line-height: 1.3;
  white-space: nowrap;
}
.pill--wait { border: 1.5px dashed var(--fog); color: var(--ink-2); }
.pill--ok { background: var(--verde); color: var(--white); }
.pill--red { background: var(--rojo); color: var(--white); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: 0 var(--gutter) clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}
.hero > * { max-width: var(--max); margin-inline: auto; }

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.25rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none;
  font-weight: 820; font-stretch: 75%; font-size: 1.4rem; letter-spacing: -.005em;
}
.brand__mark { width: 2rem; height: 2rem; fill: var(--rojo); }
.nav__links { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 2rem); font-size: .95rem; }
.nav__links a { text-decoration: none; font-weight: 500; }
.nav__links a:hover { text-decoration: underline; text-underline-offset: .3em; }
.nav__links .nav__cta {
  font-weight: 650; padding: .5rem 1.05rem; border-radius: 999px;
  background: var(--ink); color: var(--white);
}
.nav__links .nav__cta:hover { text-decoration: none; background: var(--rojo); }

.hero__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 5rem);
  align-items: end;
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(2.5rem, 5vw, 4rem);
}

/* El listón del misal: cuelga desde el borde de arriba y marca dónde empieza */
.ribbon {
  position: absolute;
  left: calc(var(--gutter) * -.55 - 6px);
  top: -8rem; bottom: 1.25rem;
  width: 16px;
  background: var(--rojo);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 14px), 0 100%);
}

.hero__title {
  font-weight: 860;
  font-stretch: 62%;
  font-size: clamp(3rem, 7.6vw, 7.9rem);
  line-height: .88;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 15ch;
}
.hero__copy { display: grid; gap: 1.1rem; padding-bottom: .4rem; }
.hero__lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.45; max-width: 34rem; }
.hero__by { color: var(--fog); max-width: 30rem; font-size: 1rem; }

/* ---------- La semana ---------- */
.week { border-top: 3px solid var(--ink); }
.week__days, .week__events {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.week__days span {
  grid-column: var(--d);
  display: flex; flex-direction: column;
  padding: .7rem .8rem .2rem;
  border-left: 1px solid var(--line);
  font-stretch: 125%; font-weight: 300; font-size: clamp(.85rem, 1.05vw, 1rem);
}
.week__days span:first-child, .week__events .ev[style*="--d:1"] { border-left: 0; padding-left: 0; }
.week__days b {
  font-stretch: 62%; font-weight: 820;
  font-size: clamp(2.4rem, 4.4vw, 4.4rem); line-height: 1;
  letter-spacing: -.02em;
}
.week__days span:nth-child(7) { color: var(--rubric); }

.week__events { min-height: 11.5rem; }
.ev {
  grid-column: var(--d) / span var(--span, 1);
  grid-row: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  padding: .6rem .8rem 1rem;
  border-left: 1px solid var(--line);
  font-size: .98rem; line-height: 1.3;
}
.ev__day { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ev__time { font-stretch: 62%; font-weight: 800; font-size: 1.5rem; line-height: 1; }
.ev__what { font-weight: 500; max-width: 13rem; }
.ev__chip {
  margin-top: .3rem;
  padding: .18rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 650; white-space: nowrap;
  border: 1.5px solid var(--ink);
}
.ev__chip--wait { border-style: dashed; border-color: var(--fog); color: var(--ink-2); text-decoration: none; }
.ev__chip--wait:hover { border-color: var(--ink); color: var(--ink); }
.ev__chip--light { border-color: rgb(255 255 255 / .8); color: var(--white); }

.ev--band {
  margin: .6rem 0 0 .8rem;
  align-self: start;
  background: var(--rojo); color: var(--white);
  border-left: 0;
  padding: .9rem 1.1rem 1.1rem;
  transform-origin: left center;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%);
}
.ev--band .ev__time { font-size: 1.05rem; font-stretch: 100%; font-weight: 600; opacity: .9; }
.ev--band .ev__what { font-stretch: 62%; font-weight: 820; font-size: clamp(1.6rem, 2.4vw, 2.3rem); line-height: .95; max-width: none; }

.week .rubric { margin-top: 1rem; max-width: 46rem; }

/* El único momento de carga: el retiro se extiende sobre su fin de semana */
@media (prefers-reduced-motion: no-preference) {
  .ev--band { animation: band-in .9s cubic-bezier(.2, .8, .2, 1) .35s both; }
  .ev--band > * { animation: band-text .4s ease-out 1.05s both; }
}
@keyframes band-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes band-text { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   Antes
   ========================================================= */
.before {
  max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto;
  padding: var(--section) var(--gutter);
}
.before__head h2 { max-width: 15ch; }
.before__head p { margin-top: 1.5rem; max-width: 36rem; font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--ink-2); }

.asks { margin-top: clamp(2.5rem, 6vw, 4.5rem); border-top: 3px solid var(--ink); }
.ask {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: .75rem clamp(2rem, 5vw, 5rem);
  padding-block: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.ask dt {
  font-stretch: 62%; font-weight: 800;
  font-size: clamp(1.8rem, 3.6vw, 3.2rem); line-height: .98;
}
.ask dd { color: var(--ink-2); max-width: 32rem; }
.ask dd strong {
  display: block; margin-bottom: .2rem;
  color: var(--rubric); font-weight: 650; font-stretch: 88%;
}

/* =========================================================
   Un día cualquiera
   ========================================================= */
.day {
  background: var(--paper-2);
  padding: var(--section) var(--gutter);
}
.day > * { max-width: var(--max); margin-inline: auto; }
.day__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 3rem; }
.day__head p { max-width: 26rem; color: var(--ink-2); }

.beats {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 3px solid var(--ink);
}
.beat {
  display: flex; flex-direction: column; gap: .9rem;
  padding: 1.4rem clamp(1.2rem, 2.4vw, 2.2rem) 0;
  border-left: 1px solid var(--line);
}
.beat:first-child { border-left: 0; padding-left: 0; }
.beat:last-child { padding-right: 0; }
.beat__when { display: flex; align-items: baseline; gap: .7rem; }
.beat__dow { font-stretch: 125%; font-weight: 300; font-size: 1.05rem; }
.beat__time { font-stretch: 62%; font-weight: 820; font-size: clamp(2.6rem, 4.6vw, 4.2rem); line-height: .9; letter-spacing: -.02em; }
.beat h3 { font-stretch: 75%; font-weight: 780; font-size: 1.55rem; line-height: 1.05; }
.beat > p:not(.beat__when) { color: var(--ink-2); font-size: 1.02rem; }

/* Ecos de la interfaz real */
.mini {
  margin-top: auto;
  display: flex; flex-direction: column; gap: .4rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  font-size: .92rem;
}
.beat .mini { margin-top: .6rem; }
.mini__k { font-size: .8rem; font-weight: 600; color: var(--fog); }
.mini__big { font-stretch: 62%; font-weight: 820; font-size: 1.9rem; line-height: 1; }
.mini__sub { color: var(--ink-2); margin-bottom: .3rem; }
.mini__row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding-block: .45rem; border-top: 1px solid var(--line);
}
.mini__row:first-of-type { border-top: 0; }
.mini__date { font-weight: 650; }
.mini__lines { display: grid; gap: .4rem; padding-block: .3rem .2rem; }
.mini__lines i { display: block; height: .45rem; border-radius: 2px; background: var(--paper-2); }
.mini__lines i:nth-child(2) { width: 92%; }
.mini__lines i:nth-child(4) { width: 64%; }
.mini__note { color: var(--rubric); font-size: .85rem; line-height: 1.35; font-stretch: 88%; font-weight: 500; }

/* =========================================================
   Qué hay adentro: índice de misal
   ========================================================= */
.mods {
  max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto;
  padding: var(--section) var(--gutter);
}
.mods__head h2 { max-width: 12ch; }
.mods__head p { margin-top: 1.5rem; max-width: 38rem; color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.25rem); }

.index { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.index__legend {
  display: flex; justify-content: space-between;
  max-width: 50rem;
  padding-bottom: .5rem; border-bottom: 3px solid var(--ink);
  font-size: .85rem; color: var(--fog); font-stretch: 125%; font-weight: 300;
}
.entry {
  display: grid;
  grid-template-columns: minmax(0, 50rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(2rem, 5vw, 5rem);
  padding-block: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--line);
}
.entry > :not(.art) { grid-column: 1; }
.entry__line {
  display: flex; align-items: baseline; gap: .2rem 0;
  font-weight: inherit; font-size: inherit; line-height: inherit;
}
.entry__name {
  flex: 1; display: flex; align-items: baseline; min-width: 0;
  font-stretch: 62%; font-weight: 820;
  font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1;
}
.entry__name::after {
  content: ""; flex: 1; min-width: 1.5rem;
  margin: 0 .7rem .2em;
  border-bottom: 2.5px dotted var(--fog);
}
.entry__who { font-size: .98rem; font-weight: 600; text-align: right; white-space: nowrap; line-height: 1.25; }
.entry__desc { align-self: start; margin-top: .55rem; color: var(--ink-2); max-width: 44rem; font-size: 1.02rem; }
.entry__desc a { color: var(--ink); font-weight: 600; text-underline-offset: .2em; }
.entry__desc a:hover { color: var(--rubric); }

.entry--soon .entry__name { color: var(--fog); }
.entry--soon .entry__who {
  padding: .15rem .6rem; border-radius: 999px; border: 1.5px dashed var(--fog);
  font-size: .85rem; color: var(--ink-2);
}

.art {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: center; justify-self: start;
  width: 100%; max-width: 24rem;
  display: flex; flex-direction: column; gap: .35rem;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  font-size: .9rem; line-height: 1.35;
}
.art--retiro { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .85rem; row-gap: .25rem; align-items: center; }
.art__logo {
  grid-row: 1 / span 2;
  width: 3rem; height: 3rem; border-radius: 10px;
  background: var(--paper-2); display: grid; place-items: center;
}
.art__logo svg { width: 1.9rem; height: 1.9rem; fill: var(--rojo); }
.art__title { font-stretch: 75%; font-weight: 780; font-size: 1.2rem; line-height: 1.05; }
.art__meta { color: var(--fog); font-size: .85rem; }
.art--retiro > :nth-child(n+4) { grid-column: 1 / -1; }
.art__resp { margin-top: .5rem; color: var(--ink-2); }
.art__resp span { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.art--retiro .pill { margin-top: .3rem; }
.art__note { margin-top: .35rem; color: var(--rubric); font-size: .82rem; font-stretch: 88%; font-weight: 500; }
.art__k { font-size: .8rem; font-weight: 600; color: var(--fog); margin-bottom: .2rem; }

.check { display: flex; align-items: center; gap: .6rem; padding-block: .25rem; }
.check::before {
  content: ""; flex: none; width: 1.05rem; height: 1.05rem; border-radius: 4px;
  border: 1.5px solid var(--ink-2);
}
.check.is-done::before {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center / 80% no-repeat;
  border-color: var(--ink);
}
.check.is-done { color: var(--fog); }

.fr {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: .6rem; align-items: center;
  padding-block: .45rem; border-top: 1px solid var(--line);
}
.fr:first-child { border-top: 0; }
.fr b { font-stretch: 62%; font-weight: 800; font-size: 1.15rem; }
.fr__blank { color: var(--fog); font-style: normal; }

/* ---------- Ramas ---------- */
.branch {
  margin-top: clamp(4rem, 8vw, 6.5rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.branch h3 {
  font-stretch: 62%; font-weight: 840;
  font-size: clamp(2.2rem, 4.4vw, 4rem); line-height: .92;
}
.branch__text p { margin-top: 1.1rem; max-width: 34rem; color: var(--ink-2); }
.branch__text .branch__except { color: var(--ink); font-weight: 600; }

.seg {
  display: inline-flex; padding: 4px; gap: 4px;
  border-radius: 999px; background: var(--paper-2);
}
.seg button {
  border: 0; background: transparent; border-radius: 999px;
  padding: .55rem 1.1rem; min-height: 2.75rem;
  font-weight: 600; font-size: .98rem;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.seg button:not([aria-pressed="true"]):hover { background: rgb(14 18 25 / .07); }

.teams {
  margin-top: 1.1rem;
  border-top: 3px solid var(--ink);
}
.teams__k { padding-block: .8rem .4rem; font-size: .95rem; color: var(--fog); }
.teams__list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding-block: .55rem .6rem; border-bottom: 1px solid var(--line);
}
.teams__name { font-stretch: 62%; font-weight: 820; font-size: 1.9rem; line-height: 1; }
.teams__list li > span:last-child { color: var(--ink-2); }
.teams__absent { margin-top: .9rem; font-weight: 600; max-width: 30rem; }
.branch__view .rubric { margin-top: .6rem; }
@media (prefers-reduced-motion: no-preference) {
  .teams.is-swapping .teams__list { animation: swap .35s ease-out; }
}
@keyframes swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =========================================================
   Demo: el díptico
   ========================================================= */
.demo {
  background: var(--ink); color: var(--white);
  padding: var(--section) var(--gutter);
  --focus: var(--white);
}
.demo > * { max-width: var(--max); margin-inline: auto; }
.demo__head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem); align-items: end;
}
.demo__intro p { color: #C9CDD6; max-width: 36rem; font-size: clamp(1.05rem, 1.4vw, 1.2rem); }

.diptych {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 16rem) minmax(0, 1fr);
  grid-template-areas: "guide guide guide" "diego hinge julian";
  gap: 1.25rem clamp(1rem, 2vw, 1.75rem);
  align-items: stretch;
}
.guide {
  grid-area: guide;
  color: var(--rubric-dark); font-weight: 500; font-stretch: 88%;
  font-size: 1.05rem; min-height: 1.5em;
  border-top: 1px solid rgb(255 255 255 / .18); padding-top: 1rem;
}
.tabs { display: none; }
.leaf--diego { grid-area: diego; }
.leaf--julian { grid-area: julian; }
.hinge { grid-area: hinge; }

.leaf {
  background: var(--white); color: var(--ink);
  border-radius: 18px;
  display: flex; flex-direction: column;
  min-height: 29rem;
  overflow: hidden;
  --focus: var(--ink);
  transition: box-shadow .5s ease;
}
.leaf.is-new { box-shadow: 0 0 0 4px var(--rojo); transition: none; }
.leaf__bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .9rem 1.25rem;
  background: var(--paper-2);
  font-size: .85rem; color: var(--ink-2);
}
.leaf__bar h3 { font-size: .95rem; font-weight: 700; color: var(--ink); }
.leaf__body { padding: 1.4rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; flex: 1; }
.leaf__body:focus { outline: none; }

.d-k { font-size: .82rem; font-weight: 600; color: var(--fog); }
.d-title { font-stretch: 75%; font-weight: 800; font-size: 1.5rem; line-height: 1.05; }
.d-who { display: flex; align-items: center; gap: .8rem; }
.d-avatar {
  flex: none; width: 2.9rem; height: 2.9rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--white);
  font-weight: 700; font-size: .95rem; font-stretch: 100%;
}
.d-name { font-weight: 700; line-height: 1.2; }
.d-sub { font-size: .88rem; color: var(--fog); }

.slots legend { font-size: .82rem; font-weight: 600; color: var(--fog); margin-bottom: .55rem; }
.slots__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.slot span {
  display: flex; flex-direction: column;
  padding: .6rem .8rem; border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: .85rem; color: var(--fog); line-height: 1.25;
}
.slot b { font-size: 1.15rem; font-stretch: 75%; font-weight: 780; color: var(--ink); }
.slot input:checked + span { border-color: var(--ink); background: var(--ink); color: #C9CDD6; }
.slot input:checked + span b { color: var(--white); }
.slot input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.slot input:disabled { cursor: not-allowed; }
.slot input:disabled + span { border-style: dashed; background: var(--paper); }
.slot input:disabled + span b { color: var(--fog); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.slot input:not(:disabled):not(:checked):hover + span { border-color: var(--ink-2); }

.act {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: .6rem 1.2rem;
  border-radius: 999px; border: 2px solid var(--ink);
  background: var(--white); color: var(--ink);
  font-weight: 650; font-size: .98rem;
}
.act:hover { background: var(--paper-2); }
.act--primary { background: var(--ink); color: var(--white); }
.act--primary:hover { background: var(--rojo); border-color: var(--rojo); }
.act--red { background: var(--rojo); border-color: var(--rojo); color: var(--white); }
.act--red:hover { background: var(--rubric); border-color: var(--rubric); }
.act:disabled { opacity: .4; cursor: not-allowed; }
.act:disabled:hover { background: var(--ink); border-color: var(--ink); }
.acts { display: flex; flex-wrap: wrap; gap: .6rem; }
.leaf__body > .act { align-self: flex-start; margin-top: auto; }

.status {
  border-radius: 14px; padding: 1.1rem 1.15rem 1.2rem;
  display: flex; flex-direction: column; gap: .5rem;
  border: 1.5px dashed var(--fog);
}
.status--ok { border: 0; background: var(--verde); color: var(--white); }
.status--no { border: 1.5px solid var(--ink); }
.status__k { font-stretch: 62%; font-weight: 840; font-size: 2.2rem; line-height: .95; }
.status__when { font-weight: 650; }
.status p { font-size: .95rem; line-height: 1.4; }
.status--ok p { color: rgb(255 255 255 / .9); }
.status:not(.status--ok) p { color: var(--ink-2); }

.d-sec { display: flex; flex-direction: column; gap: .6rem; }
.d-sec + .d-sec { padding-top: 1rem; border-top: 1px solid var(--line); }
.d-toggle { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .95rem; }
.d-toggle b {
  padding: .15rem .7rem; border-radius: 999px; background: var(--verde); color: var(--white);
  font-size: .82rem; font-weight: 650;
}
.req {
  border: 1.5px solid var(--ink); border-radius: 14px;
  padding: .95rem 1rem 1rem;
  display: flex; flex-direction: column; gap: .7rem;
}
.req__top { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.req__when { font-stretch: 75%; font-weight: 780; font-size: 1.25rem; }
.req__msg { font-size: .95rem; line-height: 1.4; color: var(--ink-2); }
.req__msg strong { color: var(--ink); }
.req--hold { border-color: var(--rojo); border-width: 2px; }
.empty { font-size: .95rem; color: var(--fog); }
.done { font-size: .92rem; color: var(--ink-2); display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: center; }
.chosen { display: flex; flex-wrap: wrap; gap: .4rem; }
.chosen span { padding: .25rem .7rem; border-radius: 999px; background: var(--paper-2); font-size: .88rem; font-weight: 550; }

/* La bisagra: lo que pasa por dentro */
.hinge {
  display: flex; flex-direction: column; gap: 1.4rem;
  padding-top: .3rem;
  font-size: .95rem;
}
.truth { display: grid; gap: 1rem; }
.truth div { border-top: 1px solid rgb(255 255 255 / .22); padding-top: .7rem; }
.truth dt { color: #A9AFBC; font-size: .85rem; }
.truth dd { font-stretch: 75%; font-weight: 780; font-size: 1.35rem; line-height: 1.1; margin-top: .2rem; }
.truth [data-truth].is-diff { color: var(--rubric-dark); }
.inbox__k { color: #A9AFBC; font-size: .85rem; border-top: 1px solid rgb(255 255 255 / .22); padding-top: .7rem; }
.inbox__list { margin-top: .5rem; display: grid; gap: .5rem; }
.inbox__list li { line-height: 1.35; }
.inbox__list li:not(.inbox__none) { padding-left: .8rem; border-left: 3px solid var(--white); }
.inbox__none { color: #A9AFBC; }
.hinge__note { color: var(--rubric-dark); font-size: 1rem; font-weight: 600; }
.hinge__reset {
  margin-top: auto; align-self: flex-start; justify-self: start;
  background: transparent; border: 0; padding: .3rem 0;
  color: var(--white); font-size: .92rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: .25em;
}
.hinge__reset:hover { color: var(--rubric-dark); }

.demo__foot { margin-top: 1.5rem; color: #A9AFBC; font-size: .92rem; padding-right: max(0px, calc(100% - 46rem)); }
.demo noscript .rubric { color: var(--rubric-dark); margin-top: 1rem; }

/* =========================================================
   Regla #1
   ========================================================= */
.rule {
  background: var(--rojo); color: var(--white);
  padding: var(--section) var(--gutter);
  --focus: var(--white);
}
.rule > * { max-width: var(--max); margin-inline: auto; }
.rule__k { font-size: 1rem; font-weight: 600; }
.rule__text { margin-top: 1.25rem; font-size: inherit; line-height: inherit; letter-spacing: 0; }
.rule__said {
  display: block;
  font-stretch: 62%; font-weight: 880;
  font-size: clamp(3.2rem, 9.6vw, 10.4rem); line-height: .86; letter-spacing: -.015em;
}
.rule__unsaid {
  display: block; margin-top: .35em;
  font-stretch: 125%; font-weight: 300;
  font-size: clamp(1.9rem, 5vw, 5.6rem); line-height: 1; letter-spacing: -.01em;
}
.rule__body {
  margin-top: clamp(3rem, 6vw, 5rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  padding-top: 1.5rem; border-top: 2px solid rgb(255 255 255 / .5);
}
.rule__lead { font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.4; max-width: 28rem; }
.rule__list { display: grid; gap: .1rem; }
.rule__list li {
  padding: .7rem 0 .8rem 1.6rem; position: relative;
  border-bottom: 1px solid rgb(255 255 255 / .3);
  font-size: 1.08rem;
}
.rule__list li::before {
  content: ""; position: absolute; left: 0; top: 1.25rem;
  width: .6rem; height: .6rem; background: var(--white);
}

/* =========================================================
   Cómo trabajamos
   ========================================================= */
.process {
  max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto;
  padding: var(--section) var(--gutter);
}
.process h2 { max-width: 13ch; }
.steps {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 3px solid var(--ink);
}
.step {
  display: flex; flex-direction: column; gap: .8rem;
  padding: 1.3rem clamp(1.2rem, 2.4vw, 2.2rem) 0;
  border-left: 1px solid var(--line);
}
.step:first-child { border-left: 0; padding-left: 0; }
.step:last-child { padding-right: 0; }
.step__when { font-stretch: 125%; font-weight: 300; font-size: 1.15rem; color: var(--rubric); }
.step h3 { font-stretch: 75%; font-weight: 780; font-size: 1.55rem; line-height: 1.08; }
.step > p:not(.step__when) { color: var(--ink-2); font-size: 1.02rem; }

.tags { display: grid; gap: .7rem; margin-top: .3rem; }
.tags li { font-size: .95rem; line-height: 1.4; }
.tag {
  display: inline-block; margin-right: .45rem;
  padding: .1rem .55rem; border-radius: 4px;
  font-size: .8rem; font-weight: 650;
}
.tag--ok { background: var(--verde); color: var(--white); }
.tag--sup { border: 1.5px dashed var(--ink-2); color: var(--ink); }
.tag--open { border: 1.5px solid var(--rubric); color: var(--rubric); }

/* =========================================================
   Otra sección
   ========================================================= */
.other {
  background: var(--paper-2);
  padding: var(--section) max(var(--gutter), calc((100% - var(--max)) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.other__sun { width: min(100%, 13rem); height: auto; fill: var(--rojo); justify-self: end; }
.other__text { max-width: 44rem; }
.other h2 { font-size: clamp(2.5rem, 5.4vw, 5.4rem); }
.other p { margin-top: 1.4rem; color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 2rem; min-height: 3.25rem; padding: .75rem 1.5rem;
  border-radius: 999px; background: var(--rojo); color: var(--white);
  font-weight: 650; text-decoration: none;
  overflow-wrap: anywhere; text-align: center;
}
.btn:hover { background: var(--ink); }

/* =========================================================
   Pie
   ========================================================= */
.foot {
  padding: 2rem var(--gutter) 2.5rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  color: var(--cobalt);
  --focus: var(--cobalt);
}
.foot__racha { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; font-weight: 650; }
.foot__racha svg { width: 8.5rem; height: auto; fill: currentColor; }
.foot__racha:hover span { text-decoration: underline; text-underline-offset: .25em; }
.foot p { font-size: .88rem; color: var(--fog); max-width: 40rem; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .diptych {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "guide guide" "diego julian" "hinge hinge";
  }
  .hinge { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem 1.5rem; }
  .hinge__note { grid-column: 1 / -1; }
  .hinge__reset { grid-column: 1 / -1; }
  .entry { grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); }
}

@media (max-width: 900px) {
  .nav__links li:not(:last-child) { display: none; }
  .hero__body { grid-template-columns: minmax(0, 1fr); }
  .hero__title { max-width: 15ch; }

  .week { border-top-width: 3px; }
  .week__days { display: none; }
  .week__events { display: flex; flex-direction: column; min-height: 0; }
  .ev, .week__events .ev[style*="--d:1"] {
    display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); column-gap: 1rem; row-gap: .25rem;
    align-items: baseline;
    border-left: 0; border-bottom: 1px solid var(--line);
    padding: .85rem 0;
  }
  .ev__day {
    position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
    grid-row: 1 / span 3;
    font-stretch: 125%; font-weight: 300; font-size: .9rem; line-height: 1.25;
  }
  .ev > :not(.ev__day) { grid-column: 2; }
  .ev__chip { justify-self: start; margin-top: .15rem; }
  .ev--band { margin: .9rem 0 0; padding: 1rem 1.1rem 1.1rem; border-bottom: 0; }
  .ev--band .ev__day { color: rgb(255 255 255 / .9); }

  .ask, .branch, .demo__head, .rule__body, .other { grid-template-columns: minmax(0, 1fr); }
  .beats, .steps { grid-template-columns: minmax(0, 1fr); }
  .beat, .step, .beat:first-child, .step:first-child {
    border-left: 0; padding: 1.5rem 0 1.75rem;
    border-bottom: 1px solid var(--line);
  }
  .beat:last-child, .step:last-child { border-bottom: 0; }

  .entry { grid-template-columns: minmax(0, 1fr); }
  .art { grid-column: 1; grid-row: auto; margin-top: 1rem; }

  .other__sun { justify-self: start; width: 6rem; }

  /* Díptico en pantallas chicas: una hoja a la vez, como al pasar de una sesión a otra */
  .diptych {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "guide" "tabs" "leaf" "hinge";
  }
  .tabs {
    grid-area: tabs;
    display: flex; padding: 4px; gap: 4px; border-radius: 999px;
    background: rgb(255 255 255 / .1);
  }
  .tabs button {
    flex: 1; position: relative;
    border: 0; background: transparent; color: var(--white);
    border-radius: 999px; min-height: 2.9rem; padding: .5rem .75rem;
    font-weight: 600; font-size: .92rem;
  }
  .tabs button[aria-pressed="true"] { background: var(--white); color: var(--ink); }
  .tabs button[data-dot]::after {
    content: ""; position: absolute; top: .55rem; right: .8rem;
    width: .5rem; height: .5rem; border-radius: 50%; background: var(--rojo);
  }
  .leaf--diego, .leaf--julian { grid-area: leaf; }
  .diptych[data-view="diego"] .leaf--julian,
  .diptych[data-view="julian"] .leaf--diego { display: none; }
  .leaf { min-height: 0; }
  .hinge { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .entry__line { flex-wrap: wrap; }
  .entry__name { flex-basis: 100%; }
  .entry__name::after { display: none; }
  .entry__who { text-align: left; white-space: normal; margin-top: .35rem; font-size: .92rem; color: var(--rubric); }
  .entry--soon .entry__who { color: var(--ink-2); }
  .index__legend { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .hero__body { padding-top: 2rem; }
  .brand { font-size: 1.25rem; }
  .brand__mark { width: 1.75rem; height: 1.75rem; }
  .ribbon { display: none; }
  .ev, .week__events .ev[style*="--d:1"] { grid-template-columns: 5.6rem minmax(0, 1fr); }
  .slots__grid { grid-template-columns: minmax(0, 1fr); }
  .leaf__bar { flex-wrap: wrap; gap: .1rem 1rem; }
  .foot__racha svg { width: 7.5rem; }
}
