@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-wght.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("../fonts/dm-mono-latin-500.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
:root {
  --paper: #F4EADB; --ink: #231A15; --achiote: #C2452D; --meer: #0F5E5A; --platano: #E0A526; --rosa: #E58C8A; --nacht: #1B2A33;
  --serif: "Fraunces", Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.3, .7, .2, 1);
  --dock-h: 76px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 var(--sans); padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); overflow-x: hidden; }
body.home { padding-bottom: 24px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.1; margin: 0; font-weight: 700; }
a { color: var(--meer); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--meer); outline-offset: 2px; }
.btn { min-height: 48px; padding: 0 20px; border: 2px solid var(--ink); background: var(--paper); border-radius: 4px; box-shadow: 2px 2px 0 var(--ink); font-weight: 600; transition: transform 120ms var(--ease), box-shadow 120ms var(--ease); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 16px; background: var(--paper); border-bottom: 2px solid var(--ink); }
.top .brand { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 48px; }
.lang { display: inline-flex; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.lang button { min-width: 48px; min-height: 44px; border: 0; background: transparent; font-weight: 700; font-family: var(--mono); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.term { border: 0; background: none; display: inline-block; padding: 10px 4px; margin: -10px -4px; color: var(--meer); font-weight: 600; text-decoration: underline dotted 2px; text-underline-offset: 3px; position: relative; }

.dispute { white-space: nowrap; border: 0; background: none; padding: 10px 2px; margin: -10px -2px; font: inherit; color: inherit; text-decoration: underline dotted var(--achiote) 2px; text-underline-offset: 4px; }
.dispute { position: relative; }
.dispute::after { content: "?"; display: inline; margin-left: 1px; vertical-align: super; font: 600 11px/0 var(--mono); color: var(--achiote); text-decoration: none; }
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(35, 26, 21, .45); display: flex; align-items: flex-end; }
.sheet[hidden] { display: none; }
.sheet-in { width: 100%; background: var(--paper); border-top: 3px solid var(--ink); padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-h { font-family: var(--serif); font-size: 22px; display: block; }
.sheet-p { margin: 8px 0 16px; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--ink); color: var(--paper); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.dock-now { margin: 0 0 4px; font-size: 14px; font-family: var(--mono); line-height: 18px; text-align: center; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-now::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--platano); }
.dock-now[hidden] { display: none; }
.dock-ups { display: flex; justify-content: center; gap: 6px; height: 8px; margin-top: 3px; }
.dock-ups i { width: 8px; height: 8px; border-radius: 50%; background: transparent; border: 1.5px solid #cdbfa8; }
.dock-ups i.on { background: var(--platano); border-color: var(--platano); }
.dock-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 4px; }
.dock-chap { width: 56px; box-sizing: border-box; overflow: hidden; white-space: nowrap; height: 48px; border: 2px solid var(--paper); background: none; border-radius: 4px; padding: 0; font: 500 10px var(--mono); letter-spacing: -.02em; color: var(--paper); }
.dock-slots { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.slot { min-width: 0; height: 48px; border-radius: 4px; display: grid; place-items: center; background: transparent; color: var(--paper); transition: background 160ms var(--ease), transform 160ms var(--ease); }
.slot .ico-w { width: 34px; height: 34px; display: block; }
.slot:not(.have):not(.txt) { position: relative; border: 2px dashed #f3c24a; background: rgba(243, 194, 74, .12); }
.slot:not(.have):not(.txt)::after { content: "+"; position: absolute; right: 3px; bottom: 0; font: 700 13px/1 var(--mono); color: #f3c24a; }
.slot:not(.have):not(.txt) svg { opacity: 1; }
.slot svg { width: 100%; height: 100%; display: block; }
.slot.have { background: var(--paper); color: var(--ink); }
.slot.live { background: var(--platano); }
.slot.joined { animation: join 620ms var(--ease); }
@keyframes join { 0% { transform: translateY(14px) scale(.7); } 60% { transform: translateY(-5px) scale(1.12); } 100% { transform: none; } }
.dock-play { width: 56px; height: 48px; border: 2px solid var(--paper); background: var(--achiote); color: #fff; border-radius: 4px; display: grid; place-items: center; }
.dock-play .ico { width: 0; height: 0; border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 4px; }
.dock-play.on .ico { width: 16px; height: 18px; border: 0; margin: 0; background: #fff; }
.dock-note { margin: 4px 0 0; font-size: 14px; text-align: center; color: var(--platano); }
.chlist { position: absolute; left: 8px; right: 8px; bottom: 100%; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); border-radius: 4px; }
.chlist[hidden] { display: none; }
.chbtn { min-width: 48px; height: 48px; border: 2px solid var(--ink); background: var(--paper); border-radius: 4px; font: 500 16px var(--mono); }
.chbtn.cur { background: var(--platano); }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; } }
.top a { white-space: nowrap; }
.top .sib { font-family: var(--mono); font-size: 14px; display: inline-flex; align-items: center; min-height: 44px; color: var(--meer); margin-left: auto; margin-right: 4px; }
.slot.txt { font-size: 14px; font-family: var(--mono); line-height: 1.05; font-weight: 500; color: var(--paper); text-align: center; border: 2px solid var(--paper); }
.slot.txt.have, .slot.txt.live { color: var(--ink); }

footer.legal{max-width:60rem;margin:2rem auto 1.5rem;padding:0 1rem;font-size:.8rem;opacity:.65;text-align:center}
footer.legal a{color:inherit;display:inline-block;padding:15px .5rem;margin:-15px -.5rem}

/* salsa dock: collected slots only, one clave control */
body.salsa .slot:not(.have):not(.live) { display: none; }
.dock-clave { flex: none; height: 48px; padding: 0 10px; border: 2px solid var(--paper); border-radius: 4px; background: none; color: var(--paper); font: 600 13px var(--mono); }
.dock-clave.live, .dock-clave[aria-pressed="true"] { background: var(--platano); color: var(--ink); border-color: var(--platano); }

/* photos: one duotone treatment (ink shadows, paper highlights), lazy loaded */
.photo { position: relative; margin: 12px 0; background: var(--ink); border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.photo img { display: block; width: 100%; height: auto; filter: grayscale(1) contrast(1.1); mix-blend-mode: lighten; }
.photo::after { content: ""; position: absolute; inset: 0; background: var(--achiote); mix-blend-mode: multiply; pointer-events: none; }
.photo figcaption { position: relative; z-index: 1; padding: 6px 10px; font: 13px/1.3 var(--mono); background: var(--paper); color: var(--ink); }
body.salsa .dock-row { grid-template-columns: 56px minmax(0, 1fr) 48px 52px; gap: 6px; } /* four children: chapter, slots, clave, play on ONE row */
body.salsa .dock-clave { width: 48px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 11px; line-height: 1; } body.salsa .dock-clave .clave-ico { width: 22px; height: 22px; margin: 0; } body.salsa .dock-play { width: 52px; } body.salsa .slot .ico-w { width: 100%; max-width: 40px; height: auto; aspect-ratio: 1; }
