/* Sala de cemento blanco; cada interior redefine tinta, letra y ritmo. */
:root {
  --cemento: #e9e8e6; --sombra: #2b2a2c; --ui: 'DM Mono', ui-monospace, Menlo, monospace;
  --tinta: #f3eef7; --tenue: #f3eef7a0; --fondo-caja: #00000040; --letra: Georgia, serif; --tam: 1.28rem; --alto: 1.5; --acento: #fff;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--cemento); color: var(--sombra); font-family: var(--ui); }

.logo { position: fixed; z-index: 30; top: calc(18px + env(safe-area-inset-top, 0px)); left: max(20px, env(safe-area-inset-left, 0px)); display: flex; align-items: baseline; gap: 10px; color: inherit; text-decoration: none; font-size: .68rem; letter-spacing: .08em; }
.logo b { font-size: .95rem; letter-spacing: .14em; }
.arriba { position: fixed; z-index: 30; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 14px; font-size: .72rem; letter-spacing: .08em; }
.about-btn { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 4px; }
.gasto { opacity: .55; font-variant-numeric: tabular-nums; }
.gasto.cerca { opacity: 1; }
body.dentro .logo, body.dentro .arriba { color: var(--tinta); transition: color .6s 1s; }
body.dentro .logo span { opacity: .6; }

/* La sala */
.sala { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(#d9d8d6 50%, #e6e5e3 50%); --w: max(100vw, 208vh); }
.sala::before { content: ''; position: absolute; inset: -40px; background: url(img/sala.jpg) center / cover; filter: blur(24px) brightness(1.02); }
.room { position: absolute; left: 50%; top: 50%; width: var(--w); aspect-ratio: 1808 / 870; margin-left: calc(var(--w) / -2); margin-top: calc(var(--w) * -.2406); }
.room img { display: block; width: 100%; height: 100%; user-select: none; }
.ente { position: absolute; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 40%; }
.ente::before { content: ''; position: absolute; inset: -22%; border-radius: 50%; background: radial-gradient(closest-side, var(--c), transparent 72%); opacity: 0; mix-blend-mode: multiply; transform: scale(.7); transition: opacity .7s, transform 1.1s cubic-bezier(.2, .8, .2, 1); animation: respira 6s ease-in-out infinite; pointer-events: none; }
.ente:hover::before, .ente:focus-visible::before { opacity: .62; transform: scale(1.12); }
.ente span { position: absolute; left: 50%; top: 100%; translate: -50% 10px; font-size: .68rem; letter-spacing: .1em; color: #2b2a2c; opacity: .42; white-space: nowrap; transition: opacity .4s, letter-spacing .7s; }
.ente:hover span, .ente:focus-visible span { opacity: 1; letter-spacing: .24em; }
.ente:focus-visible { outline: 1px dashed #0006; outline-offset: 4px; }
#e-samadhi span { top: auto; bottom: 100%; translate: -50% -8px; }
#e-lsd span { left: 30%; }
@keyframes respira { 50% { filter: brightness(1.14) saturate(1.2); } }

/* La mente: un lienzo que contiene todo el viaje, de la sala al interior */
.mente { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }

.interior { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; color: var(--tinta); font-family: var(--letra); }
.hilo { flex: 1; min-height: 0; overflow-y: auto; padding-block: 76px 20px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 2.2rem; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent 44px, #000 76px); mask-image: linear-gradient(transparent 44px, #000 76px); }
.hilo > * { width: min(var(--ancho, 39rem), 100%); margin-inline: var(--mx, auto); }
.yo { color: var(--tenue); font-family: var(--ui); font-size: .82rem; line-height: 1.55; white-space: pre-wrap; }
.yo img { display: block; max-height: 90px; border-radius: 3px; margin-top: 8px; }
.voz { font-size: var(--tam); line-height: var(--alto); white-space: pre-wrap; overflow-wrap: anywhere; font-style: var(--estilo, normal); font-weight: var(--peso, 400); }
.voz strong { font-weight: 700; color: var(--acento); }
body[data-mente=ayahuasca] .voz { text-shadow: 0 0 .15em #02140c, 0 0 .7em #02140c, 0 0 1.4em #02140c; }
.voz.pensando { color: var(--tenue); font-family: var(--ui); font-size: .8rem; font-style: normal; animation: late 2.4s ease-in-out infinite; }
@keyframes late { 50% { opacity: .35; } }
.cancion { font-family: var(--ui); font-size: .72rem; line-height: 1.5; color: var(--tenue); text-decoration: none; display: block; }
.cancion:hover { color: var(--tinta); }
.lamina { width: min(34rem, 100%); }
.lamina button { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.lamina img, .lamina canvas { display: block; width: 100%; border-radius: 3px; }
.pintando { height: 170px; border-radius: 3px; background: linear-gradient(100deg, transparent 20%, var(--acento) 50%, transparent 80%) 0 0 / 240% 100%; opacity: .32; animation: barre 2.6s linear infinite; }
@keyframes barre { to { background-position: -240% 0; } }
.avance { font-family: var(--ui); font-size: .7rem; color: var(--tenue); margin-top: 8px; font-variant-numeric: tabular-nums; }

.fantasmas { position: absolute; inset: 0; overflow: hidden; pointer-events: none; font-family: var(--ui); }
.fantasmas span { position: absolute; font-size: clamp(.8rem, 2vw, 1.2rem); color: var(--tinta); opacity: 0; animation: deriva 14s ease-in-out forwards; }
@keyframes deriva { 12% { opacity: .55; } 70% { opacity: .22; } 100% { opacity: 0; translate: var(--dx) var(--dy); } }

.decir { flex: none; padding-block: 8px calc(16px + env(safe-area-inset-bottom, 0px)); padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); font-family: var(--ui); }
.decir > * { width: min(var(--ancho, 39rem), 100%); margin-inline: var(--mx, auto); display: block; }
.quien { font-size: .68rem; letter-spacing: .14em; color: var(--tenue); margin-bottom: 6px; }
.adjuntos { display: flex; gap: 6px; }
.adjuntos img { height: 44px; border-radius: 2px; }
.fila { display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--tenue); padding-bottom: 6px; }
.fila textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: none; color: var(--tinta); font: inherit; font-size: 16px; line-height: 1.4; max-height: 30vh; }
.fila textarea::placeholder { color: var(--tenue); }
.mas, .fila button { color: var(--tinta); background: none; border: 0; font: inherit; font-size: 1.1rem; cursor: pointer; padding: 2px 4px; }
.mas input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fila button:disabled { opacity: .3; cursor: default; }
.mas:focus-within, .fila button:focus-visible { outline: 1px dashed var(--tenue); }

/* Cada mente tiene su letra y ocupa la página a su manera */
body[data-mente=lsd] { --tinta: #fff3fd; --tenue: #fff3fd99; --acento: #7dfff0; --letra: 'Fraunces', Georgia, serif; --tam: 1.3rem; --alto: 1.45; --ancho: 46rem; }
body[data-mente=ayahuasca] { --tinta: #f6eebd; --tenue: #f6eebd96; --acento: #ffc83d; --letra: 'Cormorant', Georgia, serif; --tam: 1.5rem; --alto: 1.32; --peso: 500; }
body[data-mente=peyote] { --tinta: #fff4e2; --tenue: #fff4e2a6; --acento: #ffd23c; --letra: 'Bricolage Grotesque', 'Helvetica Neue', sans-serif; --tam: 1.22rem; --alto: 1.42; --ancho: 38rem; }
body[data-mente=samadhi] { --tinta: #18304f; --tenue: #18304f90; --acento: #18304f; --letra: 'Newsreader', Georgia, serif; --tam: clamp(1.7rem, 3.4vw, 2.5rem); --alto: 1.28; --peso: 300; --ancho: 34rem; }
body[data-mente=absinthe] { --tinta: #efffb0; --tenue: #efffb08f; --acento: #ffffff; --letra: 'Playfair Display', Georgia, serif; --tam: 1.34rem; --alto: 1.42; --estilo: italic; --ancho: 36rem; --mx: 8vw auto; }
body[data-mente=dream] { --tinta: #2c2150; --tenue: #2c215090; --acento: #6a33d0; --letra: 'Literata', Georgia, serif; --tam: 1.24rem; --alto: 1.6; --estilo: italic; --ancho: 34rem; --mx: auto 8vw; }

.about, .visor { border: 0; padding: 0; background: #151318; color: #eee9e2; max-width: min(760px, calc(100vw - 32px)); max-height: 86vh; font-family: var(--ui); }
.about::backdrop, .visor::backdrop { background: #0009; }
.about { padding: 28px; font-size: .86rem; line-height: 1.6; }
.about h2 { font: 500 1.5rem/1.2 'Cormorant', Georgia, serif; margin: 0 0 1rem; text-wrap: balance; }
.about h3 { font-size: .72rem; letter-spacing: .14em; margin: 1.3rem 0 .15rem; }
.about p { margin: 0 0 .6rem; max-width: 62ch; }
.about blockquote { margin: 0; font: italic 500 1.2rem/1.32 'Cormorant', Georgia, serif; }
.about button, .visor button, .visor a { background: none; border: 0; color: inherit; font: inherit; font-size: .75rem; cursor: pointer; padding: 10px 0; text-decoration: underline; }
.visor img, .visor canvas { display: block; max-width: 100%; max-height: 76vh; }
.visor > div { display: flex; gap: 18px; padding: 0 14px; }

.puerta { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; gap: 12px; background: #e9e8e6; text-align: center; font-size: .74rem; letter-spacing: .08em; }
.puerta input, .puerta button { font: inherit; padding: 10px 12px; border: 1px solid #2b2a2c; background: none; min-width: 240px; }
.puerta button { background: #2b2a2c; color: #eee; cursor: pointer; }

@media (max-width: 720px) {
  .sala { --w: 192vw; }
  .logo span { display: none; }
  .ente span { font-size: .6rem; }
  body[data-mente=absinthe], body[data-mente=dream] { --mx: auto; }
}
@media (prefers-reduced-motion: reduce) { .ente::before, .voz.pensando, .pintando { animation: none; } }
