/* ════════════════════════════════════════════════════════════════
   漫画 NOOPHRON ✕ APHRONIOS — lector
   Fondo de mesa oscuro, páginas de papel, viñetas con borde de tinta.
   ════════════════════════════════════════════════════════════════ */
:root {
  --desk: #0b0b0c; --paper: #f4f1ea; --ink: #111; --cyan: #3df5e0; --coral: #ff5a4e; --gold: #f4c430; --mute: #8a8f96;
  --f-latin: "Comic Neue", "Comic Sans MS", system-ui, sans-serif;
  --f-shout: "Bangers", "Impact", sans-serif;
  --f-ja: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
  --f-ja-shout: "Dela Gothic One", sans-serif;
  --f-serif: "Shippori Mincho B1", serif;
  --f-display: "Unbounded", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--desk); }
body { margin: 0; background: var(--desk); color: #eee; font-family: var(--f-serif); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* un idioma visible a la vez */
.t { display: none; }
html[data-lang="es"] .t-es, html[data-lang="en"] .t-en, html[data-lang="ja"] .t-ja { display: inline; }

/* ── Puerta de idioma ── */
.langgate { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(20,20,24,.94), rgba(0,0,0,.98)); }
.needs-lang .langgate { display: grid; }
.needs-lang body { overflow: hidden; }
.langgate__box { text-align: center; max-width: 420px; width: 100%; }
.langgate__k { margin: 0; font-family: var(--f-ja-shout); font-size: clamp(4rem, 18vw, 7rem); line-height: 1; color: transparent; -webkit-text-stroke: 1.5px #fff; }
.langgate__t { margin: .6rem 0 .3rem; font-family: var(--f-shout); font-size: 2rem; letter-spacing: .06em; color: var(--gold); }
.langgate__q { margin: 0 0 1.6rem; font-family: var(--f-mono); font-size: .72rem; color: var(--mute); letter-spacing: .05em; }
.langgate__btns { display: grid; gap: .7rem; }
.langgate__btns button { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border: 2px solid #fff; border-radius: 4px; background: var(--paper); color: var(--ink); font-family: var(--f-serif); font-weight: 800; font-size: 1.25rem; box-shadow: 6px 6px 0 #000, 6px 6px 0 2px #fff; transition: transform .15s, box-shadow .15s; }
.langgate__btns button:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 #000, 9px 9px 0 2px #fff; }
.langgate__btns b { display: grid; place-items: center; min-width: 52px; height: 34px; background: var(--ink); color: #fff; font-family: var(--f-mono); font-size: .75rem; }

/* ── Barra superior ── */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem 16px; background: rgba(11,11,12,.92); backdrop-filter: blur(8px); border-bottom: 1px solid #222; font-family: var(--f-mono); font-size: .72rem; }
.bar__home { color: var(--mute); white-space: nowrap; }
.bar__home:hover { color: #fff; }
.bar__title { flex: 1; text-align: center; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__lang { margin-left: auto; display: flex; border: 1px solid #333; border-radius: 99px; overflow: hidden; }
.bar__title + .bar__lang { margin-left: 0; }
.bar__lang button { padding: .4rem .7rem; color: var(--mute); font-size: .68rem; }
html[data-lang="es"] .bar__lang [data-l="es"], html[data-lang="en"] .bar__lang [data-l="en"], html[data-lang="ja"] .bar__lang [data-l="ja"] { background: #fff; color: #000; }
.bar__progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--gold); }

/* ── Portada ── */
.cover { max-width: 1100px; margin: 0 auto; padding: 0 16px 6rem; }
.hero { position: relative; display: grid; grid-template-columns: 1fr 1.3fr 1fr; align-items: end; gap: 1rem; min-height: 78vh; padding-top: 2rem; }
.hero img { width: 100%; filter: contrast(1.1); border: 3px solid #fff; background: #fff; }
.hero__l { transform: rotate(-3deg); } .hero__r { transform: rotate(3deg); }
.hero__txt { text-align: center; align-self: center; }
.hero__k { margin: 0; font-family: var(--f-ja-shout); font-size: clamp(3rem, 9vw, 6rem); line-height: 1; color: var(--coral); }
.hero h1 { margin: .4rem 0; font-family: var(--f-shout); font-weight: 400; font-size: clamp(2.2rem, 6.5vw, 4.6rem); line-height: .9; letter-spacing: .03em; display: grid; }
.hero h1 span:first-child { color: #fff; } .hero h1 span:last-child { color: var(--gold); }
.hero h1 em { font-style: normal; color: var(--coral); font-size: .6em; }
.hero__sub { font-family: var(--f-serif); font-size: 1.3rem; margin: .8rem 0; }
.hero__tag { color: #bbb; line-height: 1.6; max-width: 34ch; margin: 0 auto 1.6rem; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr 1fr; min-height: 0; } .hero__txt { grid-column: 1 / -1; grid-row: 1; } }
.cta { display: inline-block; padding: 1rem 1.6rem; background: var(--gold); color: #000; font-family: var(--f-shout); font-size: 1.4rem; letter-spacing: .06em; border: 2px solid #000; box-shadow: 5px 5px 0 #fff; transition: transform .15s, box-shadow .15s; }
.cta:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #fff; }
.world { position: relative; margin: 5rem 0; }
.world img { width: 100%; border: 3px solid #fff; }
.world p { position: absolute; left: 16px; right: 16px; bottom: -1.6rem; max-width: 640px; margin: 0 auto; padding: 1rem 1.2rem; background: #000; border: 2px solid #fff; color: #fff; font-size: .98rem; line-height: 1.55; text-align: center; }
.cover h2 { font-family: var(--f-shout); font-weight: 400; font-size: 2.6rem; letter-spacing: .05em; margin: 6rem 0 1.6rem; color: #fff; }
.cast__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.card { background: var(--paper); color: var(--ink); border: 3px solid #000; box-shadow: 6px 6px 0 #fff; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: top; border-bottom: 3px solid #000; }
.card h3 { margin: .9rem 1rem .2rem; font-family: var(--f-shout); font-weight: 400; font-size: 1.8rem; letter-spacing: .04em; }
.card h3 small { font-family: var(--f-serif); font-size: .9rem; color: #555; }
.card p { margin: 0 1rem 1.1rem; font-size: .95rem; line-height: 1.5; }
.chapters__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; counter-reset: c; }
.chapters__list li > * { display: grid; grid-template-columns: 4rem 1fr auto; grid-template-areas: "n area meta" "n title meta"; align-items: center; column-gap: 1rem; padding: 1rem 1.2rem; border: 2px solid #333; }
.chapters__list li.open > a { border-color: #fff; background: #151517; transition: transform .15s, background .15s; }
.chapters__list li.open > a:hover { transform: translateX(6px); background: #1d1d20; }
.chapters__list li.locked { opacity: .45; }
.chapters__n { grid-area: n; font-family: var(--f-shout); font-size: 2.6rem; color: var(--gold); }
.chapters__area { grid-area: area; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: var(--mute); }
.chapters__title { grid-area: title; font-size: 1.3rem; font-weight: 800; }
.chapters__meta { grid-area: meta; font-family: var(--f-mono); font-size: .72rem; color: var(--cyan); }

/* ── Lector ── */
.reader { max-width: 980px; margin: 0 auto; padding: 0 12px 6rem; }
.ch-head { text-align: center; padding: 4rem 0 2.5rem; }
.ch-head__n { margin: 0; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.ch-head h1 { margin: .6rem 0; font-family: var(--f-shout); font-weight: 400; font-size: clamp(2.6rem, 8vw, 5rem); letter-spacing: .04em; line-height: 1; }
html[data-lang="ja"] .ch-head h1 { font-family: var(--f-ja-shout); }
.ch-head__m { margin: 0; color: var(--mute); font-family: var(--f-mono); font-size: .72rem; }

.page { position: relative; background: var(--paper); padding: clamp(10px, 2.2vw, 22px); margin: 0 0 2.4rem; box-shadow: 0 30px 80px rgba(0,0,0,.6); display: grid; gap: clamp(6px, 1.2vw, 12px); }
.page__n { position: absolute; bottom: 2px; right: 10px; font-family: var(--f-mono); font-size: .6rem; color: #888; }
.row { display: flex; gap: clamp(6px, 1.2vw, 12px); }
html[data-lang="ja"] .row { flex-direction: row-reverse; }      /* manga japonés: de derecha a izquierda */
.panel { position: relative; margin: 0; min-width: 0; border: clamp(2px, .35vw, 3px) solid var(--ink); overflow: hidden; background: #fff; container-type: inline-size; }
.panel img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 620px) { .row { flex-wrap: wrap; } .row .panel { flex-basis: 100% !important; } }

/* ── Bocadillos ── */
.b { position: absolute; width: var(--w, 40%); z-index: 2; font-size: clamp(12.5px, 3.6cqw, 18px); line-height: 1.28; color: var(--ink); }
.b--tl { top: 5%; left: 4%; } .b--tr { top: 5%; right: 4%; } .b--bl { bottom: 5%; left: 4%; } .b--br { bottom: 5%; right: 4%; }
.b--tc { top: 5%; left: 50%; transform: translateX(-50%); } .b--ml { top: 42%; left: 4%; } .b--mr { top: 42%; right: 4%; } .b--bc { bottom: 5%; left: 50%; transform: translateX(-50%); }
.b__in { position: relative; }
.b--speech .b__in, .b--thought .b__in { background: #fff; border: 2px solid var(--ink); border-radius: 50% / 46%; padding: .9em 1.3em; text-align: center; font-family: var(--f-latin); font-weight: 700; }
.b--speech .b__in::after { content: ""; position: absolute; width: 14px; height: 14px; background: #fff; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); bottom: -8px; left: 30%; transform: rotate(45deg) skew(12deg, 12deg); }
.b--tr .b__in::after, .b--br .b__in::after { left: auto; right: 30%; }
.b--thought .b__in { border-style: dotted; border-width: 3px; font-style: italic; }
.b--thought .b__in::after { content: "○ ◦"; position: absolute; bottom: -1.3em; left: 25%; font-size: .9em; letter-spacing: .3em; }
.b--no .b__in { box-shadow: 0 0 0 3px rgba(61,245,224,.55); }     /* la IA habla con un leve halo cian */
.b--gl .b__in { font-family: var(--f-mono); font-weight: 500; font-size: .9em; border-radius: 10px; }
.b--shout .b__in { background: #fff; border: 3px solid var(--ink); padding: .7em 1em; font-family: var(--f-shout); font-size: 1.25em; letter-spacing: .04em; text-align: center; line-height: 1.05; clip-path: polygon(0 12%, 8% 0, 20% 9%, 33% 0, 47% 8%, 60% 0, 74% 9%, 88% 0, 100% 12%, 94% 32%, 100% 52%, 93% 72%, 100% 92%, 85% 88%, 70% 100%, 56% 90%, 40% 100%, 26% 89%, 10% 100%, 6% 78%, 0 60%, 6% 40%); padding: 1.3em 1.4em; }
.b--caption .b__in { background: var(--ink); color: #fff; padding: .55em .8em; font-family: var(--f-serif); font-weight: 600; font-size: .92em; line-height: 1.35; border: 2px solid #fff; outline: 2px solid var(--ink); }
.b--sfx { width: auto; font-family: var(--f-shout); font-size: clamp(22px, 9cqw, 60px); color: #fff; -webkit-text-stroke: clamp(1.5px, .45cqw, 3px) var(--ink); paint-order: stroke fill; transform: rotate(-8deg); letter-spacing: .03em; text-shadow: 3px 3px 0 var(--ink); pointer-events: none; }
.b--tr.b--sfx, .b--br.b--sfx { transform: rotate(7deg); }

/* japonés: tipografía propia y diálogos cortos en vertical */
html[data-lang="ja"] .b--speech .b__in, html[data-lang="ja"] .b--thought .b__in { font-family: var(--f-ja); font-weight: 700; }
html[data-lang="ja"] .b--shout .b__in, html[data-lang="ja"] .b--sfx { font-family: var(--f-ja-shout); letter-spacing: 0; }
html[data-lang="ja"] .b--caption .b__in { font-family: var(--f-serif); }
html[data-lang="ja"] .b--vja { width: auto; }
html[data-lang="ja"] .b--vja .b__in { writing-mode: vertical-rl; text-orientation: upright; height: calc(var(--col) * 1.15em + 1.8em); padding: .9em .7em; border-radius: 46% / 50%; text-align: start; line-height: 1.5; }
html[data-lang="ja"] .b--vja.b--shout .b__in { padding: 1.2em 1em; }
html[data-lang="ja"] .b--vja .b__in::after { bottom: -8px; }

/* final de capítulo */
.ch-end { text-align: center; padding: 3rem 0; display: grid; gap: 1.4rem; justify-items: center; }
.ch-end p { margin: 0; font-family: var(--f-mono); font-size: .85rem; color: var(--mute); }
.ch-end__site { font-family: var(--f-mono); font-size: .75rem; color: var(--mute); }

/* texto tallado en piedra (la placa del Espejo en el capítulo 3) */
.b--mc { top: 50%; left: 50%; transform: translate(-50%, -45%); }
.b--engrave { width: auto; font-family: var(--f-serif); font-weight: 800; font-size: clamp(20px, 9cqw, 64px); letter-spacing: .12em; color: #6d6a64;
  text-shadow: -1px -1px 0 rgba(0,0,0,.45), 1px 1px 0 #fff, 2px 2px 3px rgba(255,255,255,.6); pointer-events: none; white-space: nowrap; }
html[data-lang="ja"] .b--engrave { font-family: var(--f-serif); letter-spacing: .05em; }
/* Kolax, la IA aduladora del capítulo 7: bocadillo dorado y empalagoso */
.b--ko .b__in { background: linear-gradient(180deg, #fff8dc, #ffe9a8); border-color: #b8860b; box-shadow: 0 0 0 3px rgba(244,196,48,.6), 0 0 18px rgba(244,196,48,.5); font-style: italic; }
.b--ko .b__in::after { background: #ffe9a8; border-color: #b8860b; }
