/* remlam.dev · base de Lambda's Vault (negro absoluto, texto #e8e8e8, grises de sw.html)
   y un entorno por sección: el acento sale del matiz de la orquídea que la acompaña. */

/* ---------- fuentes (Bunny Fonts, solo los cortes que se usan) ---------- */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(https://fonts.bunny.net/instrument-serif/files/instrument-serif-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(https://fonts.bunny.net/instrument-serif/files/instrument-serif-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Hubot Sans"; font-weight: 300; font-display: swap;
  src: url(https://fonts.bunny.net/hubot-sans/files/hubot-sans-latin-300-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Hubot Sans"; font-weight: 400; font-display: swap;
  src: url(https://fonts.bunny.net/hubot-sans/files/hubot-sans-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Hubot Sans"; font-weight: 600; font-display: swap;
  src: url(https://fonts.bunny.net/hubot-sans/files/hubot-sans-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Klee One"; font-weight: 400; font-display: swap;
  src: url(https://fonts.bunny.net/klee-one/files/klee-one-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
/* el japonés pesa 1.9 MB: solo se descarga si aparece texto japonés en pantalla */
@font-face { font-family: "Klee One"; font-weight: 400; font-display: swap;
  src: url(https://fonts.bunny.net/klee-one/files/klee-one-japanese-400-normal.woff2) format("woff2");
  unicode-range: U+3000-30FF, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF; }

/* ---------- tokens ---------- */
@property --acento { syntax: "<color>"; inherits: true; initial-value: #ececec; }
@property --acento2 { syntax: "<color>"; inherits: true; initial-value: #ececec; }
@property --halo { syntax: "<color>"; inherits: true; initial-value: #101010; }
@property --hx { syntax: "<percentage>"; inherits: true; initial-value: 70%; }

:root {
  --fondo: #000; /* negro absoluto: identidad del sitio (decisión de RemLam sobre la regla genérica de no-#000) */
  --texto: #e8e8e8;
  --suave: #c4c4c4;
  --dim: #8c8c8c;
  --linea: #222;
  --tinta: #ececec;
  --epiciclo: rgba(236, 236, 236, 0.26);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hubot Sans", system-ui, sans-serif;
  --mano: "Klee One", "Hubot Sans", system-ui, sans-serif;
}

body { --acento: #f99bd1; --acento2: #ff9f9f; --halo: #490a34; --hx: 70%;
  transition: --acento 1.1s ease, --acento2 1.1s ease, --halo 1.4s ease, --hx 1.4s ease; }
body[data-env="quien"] { --acento: #efb062; --acento2: #c9c261; --halo: #3c2200; --hx: 30%; }
body[data-env="datos"] { --acento: #a9cd63; --acento2: #5ed99e; --halo: #212e00; --hx: 72%; }
body[data-env="diseno"] { --acento: #b6b4ff; --acento2: #e59ff6; --halo: #261a5c; --hx: 28%; }
body[data-env="escritura"] { --acento: #cfb1dd; --acento2: #e1acc4; --halo: #33203c; --hx: 72%; }
body[data-env="taller"] { --acento: #d0bf5e; --acento2: #9ccf7f; --halo: #302900; --hx: 28%; }
body[data-env="libros"] { --acento: #97c1f7; --acento2: #bcb4f4; --halo: #0c294b; --hx: 50%; }
body[data-env="contacto"] { --acento: #5cd0ea; --acento2: #89c3ff; --halo: #002f38; --hx: 72%; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 400 1.0625rem/1.65 var(--sans);
  overflow-x: hidden;
}
:lang(ja) body, body:lang(ja) { font-family: var(--mano); line-height: 1.9; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--acento); color: #0a0a0a; }

.visualmente-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saltar { position: fixed; left: 1rem; top: -4rem; z-index: 10; padding: .5rem .8rem; background: var(--texto); color: #0a0a0a; border-radius: 4px; text-decoration: none; }
.saltar:focus { top: 1rem; }

/* capas: halo (color del entorno) < jardín (3D) < contenido */
.halo {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at var(--hx) 46%, color-mix(in oklch, var(--halo) 85%, transparent), transparent 70%);
}
#jardin { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
main, .pie, .barra { position: relative; z-index: 2; }
.sin3d #jardin { display: none; }

/* ---------- barra ---------- */
.barra {
  position: fixed; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: center;
  padding: max(.9rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 2.5rem) .9rem; z-index: 5;
}
.marca img { width: 28px; height: 28px; filter: drop-shadow(0 0 6px var(--acento)); }
.marca { display: grid; place-items: center; width: 40px; height: 40px; }
.idiomas { display: flex; gap: .35rem; }
.idiomas button {
  display: grid; place-items: center; width: 40px; height: 36px; padding: 0; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 6px; opacity: .5; transition: opacity .2s, border-color .2s;
}
.idiomas button img { width: 24px; height: 18px; border-radius: 2px; }
.idiomas button:hover { opacity: .85; }
.idiomas button[aria-pressed="true"] { opacity: 1; border-color: color-mix(in oklch, var(--acento) 60%, transparent); }

/* ---------- secciones ---------- */
.seccion {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(5rem, 12vh, 8rem) clamp(1.25rem, 6vw, 6rem);
}
.seccion[data-lado="der"] > .col { grid-column: 1; }
.seccion[data-lado="izq"] > .col { grid-column: 2; }
.col { max-width: 38rem; }
.col > p { color: var(--suave); max-width: 60ch; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; line-height: 1.02; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { font-family: var(--mano); font-weight: 400; letter-spacing: 0; }
h1 { font-size: clamp(3rem, 9vw, 7.25rem); margin: .1em 0 .2em; }
h2, .seccion h3:not(.proyecto h3) { font-size: clamp(2.3rem, 5vw, 3.75rem); }
.alias { display: block; font: 400 clamp(1rem, 1.6vw, 1.25rem)/1.2 var(--mano); color: var(--acento); letter-spacing: .04em; margin-top: .45em; }
.sub { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--suave); }

.nota { font-family: var(--mano); color: var(--acento); font-size: .98rem; line-height: 1.6; }
.titulo { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.glifo { width: clamp(64px, 8vw, 96px); aspect-ratio: 1; flex: none; }
.glifo-grande { width: clamp(130px, 18vw, 220px); margin-left: -1rem; }
.especie {
  position: absolute; bottom: clamp(1.5rem, 6vh, 3rem); margin: 0; opacity: .8; font-style: italic;
}
.seccion[data-lado="der"] .especie { right: clamp(1.25rem, 6vw, 6rem); }
.seccion[data-lado="izq"] .especie { left: clamp(1.25rem, 6vw, 6rem); }

.inicio .col { padding-top: 2rem; }
.bajar {
  position: absolute; left: 50%; bottom: clamp(1rem, 4vh, 2rem); translate: -50% 0;
  display: grid; place-items: center; width: 44px; height: 44px; color: var(--dim);
}
.bajar svg { width: 22px; height: 22px; fill: currentColor; }
.bajar:hover { color: var(--acento); }

/* ---------- retrato ---------- */
.quien { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.retrato { margin: 0; justify-self: center; width: min(100%, 34rem); }
.retrato-lienzo { position: relative; aspect-ratio: 640 / 1139; max-height: 78svh; margin-inline: auto; touch-action: pan-y; }
.retrato-lienzo > svg, .retrato-foto { position: absolute; inset: 0; width: 100%; height: 100%; }
.retrato-svg { --p0: color-mix(in oklch, var(--acento) 14%, #161616); --p1: color-mix(in oklch, var(--acento) 26%, #262626);
  --p2: color-mix(in oklch, var(--acento) 62%, #5a5a5a); --p3: color-mix(in oklch, var(--acento) 55%, #a8a8a8);
  --p4: color-mix(in oklch, var(--acento) 38%, #c4c4c4); --p5: color-mix(in oklch, var(--acento) 24%, #e0e0e0); }
/* la foto termina abajo en corte recto: se desvanece */
/* la foto completa, con su fondo, se desvanece hacia el negro en los bordes */
.retrato-svg { -webkit-mask-image: radial-gradient(ellipse 62% 56% at 50% 56%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 62% 56% at 50% 56%, #000 62%, transparent 100%); }
.retrato-svg path { stroke: var(--acento); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-opacity: 0; transition: fill 1.1s ease; }
.retrato-svg .t0 { fill: color-mix(in oklch, var(--acento) 5%, #050505); } /* fondo de la foto */
.retrato-svg .t1 { fill: var(--p0); } .retrato-svg .t2 { fill: var(--p1); } .retrato-svg .t3 { fill: var(--p2); }
.retrato-svg .t4 { fill: var(--p3); } .retrato-svg .t5 { fill: var(--p4); } .retrato-svg .t6 { fill: var(--p5); }
/* los lentes rosas se quedan rosas en todos los entornos; el armazón toma el acento */
.retrato-svg .lente { fill: #ff9fb0; fill-opacity: .62; stroke: #d6a862; stroke-width: 3px; stroke-opacity: 1; }
.retrato-svg .armazon { fill: none; stroke: #d6a862; stroke-width: 3px; stroke-opacity: 1; }
.retrato.preparado .retrato-svg .lente, .retrato.preparado .retrato-svg .armazon { fill-opacity: 0; }
.retrato.dibujando .retrato-svg .lente { animation: trazo 1.2s ease 2.6s forwards, lente .8s ease 3.4s forwards; }
@keyframes lente { to { fill-opacity: .62; } }
/* animación: el estado de reposo es el retrato lleno; estas clases solo las pone el script */
.retrato.preparado .retrato-svg path { fill-opacity: 0; stroke-opacity: .9; stroke-dasharray: 1; stroke-dashoffset: 1; }
.retrato.dibujando .retrato-svg path { animation: trazo 1.8s cubic-bezier(.55, .1, .3, 1) var(--d, 0s) forwards, tinta 1.2s ease calc(var(--d, 0s) + 1.4s) forwards; }
@keyframes trazo { to { stroke-dashoffset: 0; } }
@keyframes tinta { to { fill-opacity: 1; stroke-opacity: 0; } }
.retrato-foto { object-fit: cover; opacity: 0; border-radius: 2px;
  -webkit-mask-image: radial-gradient(circle var(--r, 130px) at var(--mx, -500px) var(--my, -500px), #000 55%, transparent 72%);
  mask-image: radial-gradient(circle var(--r, 130px) at var(--mx, -500px) var(--my, -500px), #000 55%, transparent 72%);
  transition: opacity .35s ease; }
.retrato.revelando .retrato-foto { opacity: 1; }
.retrato figcaption { margin-top: .8rem; font-size: .9rem; text-align: center; }

/* ---------- datos ---------- */
.cifras { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 2.2rem; margin: 2rem 0 1.4rem; }
.cifras div { display: flex; flex-direction: column-reverse; }
.cifras dd { margin: 0; font: 400 clamp(2.1rem, 4vw, 3rem)/1 var(--serif); color: var(--acento); font-variant-numeric: tabular-nums; }
.cifras dt { color: var(--dim); font-size: .9rem; margin-top: .35rem; }
.barras { margin: 0; }
.barras svg { width: 100%; height: 92px; overflow: visible; }
.barras rect { transition: opacity .2s; }
.barras svg:hover rect { opacity: .45; }
.barras svg rect:hover { opacity: 1; }
.barras figcaption { font-size: .88rem; margin-top: .6rem; }

/* ---------- taller ---------- */
.taller { align-items: start; }
.proyectos { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.8rem; }
.proyecto { --pc: var(--acento); padding: .2rem 0 .2rem .9rem; border-left: 1px solid var(--linea); transition: border-color .3s; }
.proyecto h3 { font: 400 1.35rem/1.15 var(--serif); color: var(--pc); }
:lang(ja) .proyecto h3 { font-family: var(--mano); }
.proyecto p { margin: .3rem 0 .4rem; font-size: .9rem; line-height: 1.5; color: var(--dim); }
.proyecto:hover, .proyecto:focus-within { border-color: var(--pc); }
.proyecto:hover p, .proyecto:focus-within p { color: var(--suave); }
.enlaces { display: flex; gap: .2rem; align-items: center; }
.enlaces a { display: grid; place-items: center; width: 32px; height: 32px; color: var(--dim); border-radius: 6px; }
.enlaces a:hover { color: var(--pc); }
.enlaces svg { width: 17px; height: 17px; fill: currentColor; }
.pronto { font: .85rem var(--mano); color: var(--pc); padding-left: .3rem; }

/* ---------- constelaciones ---------- */
.libros { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.cielo { position: relative; }
#cielo { width: 100%; height: min(72svh, 640px); cursor: grab; touch-action: pan-y; }
#cielo:active { cursor: grabbing; }
.cielo > .nota { text-align: center; font-size: .9rem; margin: .4rem 0 0; }
.estrella-info {
  position: absolute; left: 0; top: 0; pointer-events: none; padding: .45rem .7rem; max-width: 18rem;
  background: rgba(8, 8, 10, .88); border: 1px solid color-mix(in oklch, var(--acento) 45%, transparent); border-radius: 6px;
  font-size: .88rem; line-height: 1.35;
}
.estrella-info b { display: block; font-weight: 400; color: var(--texto); }
.estrella-info span { font: .8rem var(--mano); color: var(--acento); }

/* ---------- contacto ---------- */
.redes, .salidas { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.redes a, .salidas a { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--linea); border-radius: 50%; color: var(--suave); transition: color .2s, border-color .2s, box-shadow .3s; }
.redes a:hover, .salidas a:hover { color: var(--acento); border-color: var(--acento); box-shadow: 0 0 18px -4px var(--acento); }
.redes svg, .salidas svg { width: 22px; height: 22px; fill: currentColor; }
.salidas img { width: 22px; height: 22px; }
.salidas { margin-top: .8rem; }

.pie { padding: 3rem clamp(1.25rem, 6vw, 6rem) 2.5rem; color: var(--dim); font-size: .85rem; border-top: 1px solid var(--linea); }
.pie p { margin: .3rem 0; max-width: 70ch; }
.pie a { color: var(--suave); }

/* ---------- vertical ---------- */
@media (max-width: 760px) {
  .seccion, .quien, .libros { grid-template-columns: 1fr; align-items: end; }
  .seccion[data-lado] > .col { grid-column: 1; }
  .seccion[data-flor]:not([data-flor="none"]) { padding-top: 52svh; }
  .seccion[data-flor]:not([data-flor="none"]) > .col {
    position: relative; padding-top: 2.5rem;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .86) 2.5rem);
  }
  .inicio { padding-top: 48svh; }
  .glifo-grande { width: 120px; margin-left: -.6rem; }
  .especie { top: 5.2rem; bottom: auto; }
  .seccion[data-lado] .especie { left: 1.25rem; right: auto; }
  .proyectos { grid-template-columns: 1fr; }
  .cifras { gap: 1.2rem; }
  .retrato { width: min(100%, 22rem); }
  #cielo { height: 62svh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  .retrato-svg path { transition: none; }
}

/* horizontal en teléfono: el hero cabe sin que el λ empuje el nombre fuera de pantalla */
@media (max-height: 520px) and (min-width: 761px) {
  .glifo-grande { width: 84px; margin-left: -.4rem; }
  h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
  .inicio .col { padding-top: 0; }
}
