/* MAD-VF Readings — shared styles (entrance, novels, manga).
   Dark theme, brand red #c4161c, EB Garamond (OFL) for display text, system sans for UI.
   Everything heavy is GPU-friendly (transform/opacity) and switched off with prefers-reduced-motion. */

@font-face { font-family: "EBG"; src: url("fonts/ebgaramond-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EBG"; src: url("fonts/ebgaramond-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "EBG"; src: url("fonts/ebgaramond-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "EBG"; src: url("fonts/ebgaramond-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --red: #c4161c;
  --red-hot: #ff2a31;
  --ink: #050306;
  --paper: #f3eee6;
  --muted: #a79f96;
  --line: rgba(255, 255, 255, .14);
  --glass: rgba(12, 8, 12, .55);
  --serif: "EBG", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --app-h: 100vh;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--paper); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar (shared) ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand, .back {
  font: 600 12px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .25s;
}
.back:hover, .back:focus-visible { color: var(--red-hot); outline: none; }
.langs { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; backdrop-filter: blur(8px); background: rgba(0,0,0,.35); }
.langs button {
  background: transparent; border: 0; padding: 7px 13px; cursor: pointer;
  font: 600 11px/1 var(--sans); letter-spacing: .2em; color: var(--muted); transition: background .25s, color .25s;
}
.langs button[aria-pressed="true"] { background: var(--red); color: #fff; }
.langs button:focus-visible { outline: 2px solid var(--paper); outline-offset: -2px; }

.foot {
  position: relative; z-index: 5; text-align: center; padding: 28px 16px max(24px, env(safe-area-inset-bottom));
  font: 11px/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: rgba(167,159,150,.75);
}
.foot a { text-decoration: none; }

/* ---------- age badge ---------- */
.age {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--red); color: #fff; font: 700 12px/1 var(--sans); letter-spacing: .02em;
  box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 6px 18px rgba(196,22,28,.55);
}

/* ======================================================================
   ENTRANCE (index) — 360 sky + gates
   ====================================================================== */
.p-hub { height: var(--app-h); overflow: hidden; }
.sky { position: fixed; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.6s ease; }
.is-sky .sky { opacity: 1; }
.veil {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(5,3,6,.15) 0%, rgba(5,3,6,.55) 60%, rgba(5,3,6,.92) 100%),
    linear-gradient(180deg, rgba(5,3,6,.55) 0%, rgba(5,3,6,0) 22%, rgba(5,3,6,0) 70%, rgba(5,3,6,.85) 100%);
}
.p-hub::before { /* fallback backdrop while the sky loads (or if WebGL is missing) */
  content: ""; position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, #2a0608 0%, #0b0507 45%, var(--ink) 80%);
}
.embers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--red-hot); box-shadow: 0 0 8px 2px rgba(255,42,49,.7);
  opacity: 0; animation: ember 9s linear infinite;
}
@keyframes ember {
  0% { transform: translate3d(0,0,0) scale(1); opacity: 0; }
  10% { opacity: .9; }
  100% { transform: translate3d(var(--dx, 30px), calc(-1 * var(--app-h) - 40px), 0) scale(.3); opacity: 0; }
}

.hub {
  position: relative; z-index: 10; height: var(--app-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 16px 56px; text-align: center;
}
.kicker {
  margin: 0 0 10px; font: 500 12px/1.4 var(--sans); letter-spacing: .42em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transform: translateY(10px); animation: rise 1s var(--ease-out) .2s forwards;
}
.mark {
  margin: 0; font: 500 clamp(54px, 13vw, 168px)/.9 var(--serif); letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap; padding-left: .08em;
  text-shadow: 0 0 40px rgba(196,22,28,.45), 0 2px 0 rgba(0,0,0,.5);
}
.mark span {
  display: inline-block; opacity: 0; transform: translateY(.35em) rotateX(70deg); filter: blur(8px);
  animation: letter 1.1s var(--ease-out) forwards; animation-delay: calc(.35s + var(--i) * .07s);
}
@keyframes letter { to { opacity: 1; transform: none; filter: none; } }
.rule {
  width: 0; height: 2px; margin: 18px auto 0; background: linear-gradient(90deg, transparent, var(--red-hot), transparent);
  animation: draw 1.4s var(--ease-out) 1.1s forwards;
}
@keyframes draw { to { width: min(320px, 60vw); } }
.tag {
  margin: 14px 0 0; font: italic 400 clamp(17px, 2.2vw, 22px)/1.3 var(--serif); color: var(--paper);
  opacity: 0; animation: rise 1s var(--ease-out) 1.3s forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* loader */
.loader {
  margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: opacity .5s, transform .5s;
}
.loader__bar { width: min(260px, 60vw); height: 2px; background: rgba(255,255,255,.12); overflow: hidden; border-radius: 2px; }
.loader__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--red-hot)); box-shadow: 0 0 12px var(--red-hot); transition: width .25s; }
.loader__txt { font: 600 10px/1 var(--sans); letter-spacing: .4em; text-transform: uppercase; color: var(--muted); }
.is-open .loader { opacity: 0; transform: translateY(-8px); pointer-events: none; position: absolute; }

/* gates — hidden until the sky is on screen */
.gates {
  margin-top: 34px; display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); gap: clamp(14px, 2.4vw, 34px);
  perspective: 1200px; visibility: hidden;
}
.is-open .gates { visibility: visible; }
.gate {
  position: relative; display: flex; flex-direction: column; align-items: center; text-decoration: none;
  padding: 22px 14px 18px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(30,10,14,.62), rgba(8,5,8,.72));
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  opacity: 0; transform: translate3d(0, 60px, -200px) rotateX(25deg);
  transform-style: preserve-3d; will-change: transform;
  transition: border-color .35s, box-shadow .35s;
}
.is-open .gate { animation: gateIn 1.1s var(--ease-out) forwards; animation-delay: calc(var(--i) * .14s); }
@keyframes gateIn { to { opacity: 1; transform: translate3d(0,0,0) rotateX(0); } }
.gate::before { /* travelling light around the border */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, var(--red-hot) 80%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .0; transition: opacity .35s;
  animation: spin 4s linear infinite;
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }
.gate:hover::before, .gate:focus-visible::before { opacity: 1; }
.gate:hover, .gate:focus-visible { border-color: rgba(196,22,28,.6); box-shadow: 0 26px 70px rgba(0,0,0,.6), 0 0 60px rgba(196,22,28,.28); outline: none; }

.fan { position: relative; width: 150px; height: 150px; margin-bottom: 14px; transform: translateZ(40px); }
.fan img {
  position: absolute; left: 50%; top: 0; width: 96px; height: 144px; object-fit: cover; border-radius: 4px;
  box-shadow: 0 10px 24px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.08);
  transform-origin: 50% 120%; transition: transform .6s var(--ease-out);
}
.fan img:nth-child(1) { transform: translateX(-50%) rotate(-12deg) translateX(-14px); }
.fan img:nth-child(2) { transform: translateX(-50%) rotate(12deg) translateX(14px); }
.fan img:nth-child(3) { transform: translateX(-50%) translateY(-4px); z-index: 2; }
.gate:hover .fan img:nth-child(1), .gate:focus-visible .fan img:nth-child(1) { transform: translateX(-50%) rotate(-24deg) translateX(-34px) translateY(4px); }
.gate:hover .fan img:nth-child(2), .gate:focus-visible .fan img:nth-child(2) { transform: translateX(-50%) rotate(24deg) translateX(34px) translateY(4px); }
.gate:hover .fan img:nth-child(3), .gate:focus-visible .fan img:nth-child(3) { transform: translateX(-50%) translateY(-14px) scale(1.06); }

.gate__text { display: flex; flex-direction: column; align-items: center; }
.gate__name { font: 500 26px/1.1 var(--serif); letter-spacing: .06em; transform: translateZ(30px); }
.gate__name em { font-style: italic; color: var(--muted); font-weight: 400; }
.gate__name .slash { color: var(--red-hot); margin: 0 .2em; }
.gate__sub {
  margin-top: 8px; font: 600 10px/1.5 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--muted);
  transform: translateZ(20px);
}
.gate__go {
  margin-top: 14px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); font-size: 15px; transition: background .3s, border-color .3s, transform .3s;
  transform: translateZ(25px);
}
.gate:hover .gate__go, .gate:focus-visible .gate__go { background: var(--red); border-color: var(--red); transform: translateZ(25px) translateX(4px); }
.hint {
  position: fixed; left: 50%; bottom: max(40px, calc(env(safe-area-inset-bottom) + 34px)); transform: translateX(-50%);
  z-index: 11; font: 600 10px/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: rgba(167,159,150,.6);
  opacity: 0; transition: opacity 1s 1.2s; pointer-events: none; white-space: nowrap;
}
.is-open .hint { opacity: 1; }
.p-hub .foot { position: fixed; left: 0; right: 0; bottom: 0; padding-top: 0; z-index: 11; }
.p-hub.is-drag { cursor: grabbing; }
.p-hub .sky { cursor: grab; }

/* phones: gates become compact rows */
@media (max-width: 760px) {
  .hub { justify-content: flex-start; padding-top: max(84px, 12vh); overflow-y: auto; height: var(--app-h); }
  .p-hub { overflow-y: auto; }
  .gates { grid-template-columns: 1fr; width: min(420px, 100%); gap: 12px; margin-top: 26px; }
  .gate { flex-direction: row; align-items: center; text-align: left; padding: 12px 14px; gap: 14px; border-radius: 14px; }
  .fan { width: 82px; height: 92px; margin: 0; flex: none; }
  .fan img { width: 56px; height: 84px; }
  .fan img:nth-child(1) { transform: translateX(-50%) rotate(-10deg) translateX(-10px); }
  .fan img:nth-child(2) { transform: translateX(-50%) rotate(10deg) translateX(10px); }
  .gate__text { flex: 1; min-width: 0; align-items: flex-start; }
  .gate__name { font-size: 23px; }
  .gate__sub { margin-top: 4px; letter-spacing: .2em; }
  .gate__go { margin: 0; flex: none; }
  .hint { display: none; }
  .p-hub .foot { position: relative; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .mark { font-size: clamp(48px, 10vh, 110px); }
  .gates { margin-top: 20px; }
  .fan { width: 120px; height: 120px; } .fan img { width: 76px; height: 114px; }
}

/* ======================================================================
   CATALOGUE PAGES (novels / manga)
   ====================================================================== */
.p-cat { min-height: 100vh; }
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.stage__img {
  position: absolute; inset: -8%; background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.3) brightness(.38); transform: scale(1.1);
  opacity: 0; transition: opacity 1.4s ease, background-image .6s;
}
.stage__img.is-on { opacity: 1; }
.stage::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(196,22,28,.22), transparent 55%),
              linear-gradient(180deg, rgba(5,3,6,.4), rgba(5,3,6,.85) 70%, var(--ink));
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)} 60%{transform:translate(-2%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

.cat-head { position: relative; z-index: 5; text-align: center; padding: 120px 16px 30px; text-shadow: 0 2px 14px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.8); }
.cat-title { margin: 0; font: 500 clamp(52px, 11vw, 132px)/.95 var(--serif); letter-spacing: .04em; }
.cat-title em { display: block; font: italic 400 .38em/1.2 var(--serif); color: var(--muted); letter-spacing: .12em; margin-top: .25em; }
.cat-title .w { display: inline-block; opacity: 0; transform: translateY(30px); filter: blur(10px); animation: letter 1.1s var(--ease-out) forwards; animation-delay: calc(.15s + var(--i, 0) * .12s); }
.cat-lead { margin: 18px auto 0; max-width: 34ch; font: italic 400 clamp(18px, 2.4vw, 23px)/1.4 var(--serif); color: var(--paper); opacity: 0; transform: translateY(10px); animation: rise 1s var(--ease-out) .8s forwards; }
.cat-head .rule { animation-delay: .6s; }

.shelf {
  position: relative; z-index: 5; max-width: 1180px; margin: 0 auto; padding: 30px 16px 40px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 44px);
  perspective: 1400px;
}
.book {
  position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  text-decoration: none; color: inherit;
  opacity: 0; transform: translateY(70px) rotateX(18deg);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * .12s);
}
.book.is-in { opacity: 1; transform: none; }
.book__tilt { display: block;
  position: relative; transform-style: preserve-3d; will-change: transform;
  transition: transform .5s var(--ease-out);
  transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
}
.book__cover {
  position: relative; margin: 0; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: #111;
  box-shadow: 0 30px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.07);
  transition: box-shadow .4s;
}
.book__cover img, .book__cover video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.book:hover .book__cover img, .book:focus-visible .book__cover img { transform: scale(1.05); }
.book:hover .book__cover, .book:focus-visible .book__cover { box-shadow: 0 40px 80px rgba(0,0,0,.75), 0 0 0 1px rgba(196,22,28,.7), 0 0 70px rgba(196,22,28,.3); }
.book:focus-visible { outline: none; }
/* black & white by default, colour revealed as a circle from the pointer (touch: from the centre) */
.book__cover--swap img.col {
  position: absolute; inset: 0;
  clip-path: circle(0% at var(--gx, 50%) var(--gy, 50%));
  transition: clip-path .9s var(--ease-out), transform 1.2s var(--ease-out);
}
.book:hover .book__cover--swap img.col, .book:focus-visible .book__cover--swap img.col, .book.is-color .book__cover--swap img.col {
  clip-path: circle(150% at var(--gx, 50%) var(--gy, 50%));
}
.book__cover--swap img.bw { filter: contrast(1.08); }
.book__shine { /* glare that follows the pointer */
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255,255,255,.75), transparent 45%);
}
.book:hover .book__shine { opacity: 1; }
.book__spine { position: absolute; inset: 0 auto 0 0; width: 10px; background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(0,0,0,.25), transparent); pointer-events: none; }

/* overlay title on covers without printed text */
.ovl {
  position: absolute; inset: auto 0 0 0; padding: 60% 8% 9%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.25) 40%, rgba(0,0,0,.85));
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; pointer-events: none;
}
.ovl__title {
  font: 900 italic clamp(19px, 2.7vw, 34px)/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff 0%, #dfe6ee 45%, #8d99a8 55%, #f4f7fa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.6)) drop-shadow(0 0 18px rgba(0,0,0,.6));
  transform: skewX(-6deg);
}
.ovl__title--db { background-image: linear-gradient(180deg, #f2fdff 0%, #9fefff 45%, #1aa6c4 56%, #e9fdff 100%); }
.ovl__title--hb { background-image: linear-gradient(180deg, #fff8ec 0%, #ffd38a 45%, #e5781c 56%, #fff3dd 100%); }
.ovl__img { width: 92%; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.8)); }
.ovl__kind { font: 600 10px/1 var(--sans); letter-spacing: .34em; text-transform: uppercase; color: rgba(255,255,255,.75); }

.ribbon {
  position: absolute; top: 30px; right: -54px; z-index: 3; width: 200px; padding: 7px 0; transform: rotate(45deg);
  background: var(--red); color: #fff; text-align: center; font: 800 10px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
}
.book .age { position: absolute; left: 12px; top: 12px; z-index: 3; transform: translateZ(30px); }
.book__meta { margin-top: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.book__name { margin: 0; font: 500 clamp(19px, 2vw, 24px)/1.15 var(--serif); letter-spacing: .03em; }
.book__cta {
  flex: none; font: 700 10px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--red-hot);
  white-space: nowrap; transition: transform .3s;
}
.book:hover .book__cta { transform: translateX(4px); }
.book--soon .book__cta { color: var(--muted); }

@media (max-width: 860px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf > :first-child { grid-column: 1 / -1; width: min(70%, 360px); justify-self: center; }
}
@media (max-width: 480px) {
  .cat-head { padding-top: 96px; }
  .shelf { gap: 16px; }
  .ribbon { top: 22px; right: -60px; font-size: 8px; padding: 5px 0; }
  .book .age { width: 32px; height: 32px; font-size: 10px; left: 8px; top: 8px; }
  .book__meta { flex-direction: column; gap: 6px; margin-top: 12px; }
  .book__name { font-size: 17px; }
}

/* ---------- manga variant ---------- */
.p-cat .sky { z-index: 0; }
.p-cat .sky + .stage::after { background: radial-gradient(ellipse at 50% 0%, rgba(196,22,28,.18), transparent 55%), linear-gradient(180deg, rgba(5,3,6,.35), rgba(5,3,6,.55) 40%, rgba(5,3,6,.88) 85%, var(--ink)); }
.p-cat::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 30%, #1d0709 0%, var(--ink) 70%); }
.speed {
  position: absolute; inset: -50%; opacity: .16;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.9) 0deg .6deg, transparent .6deg 6deg);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 18%, #000 60%); mask: radial-gradient(circle at 50% 50%, transparent 0 18%, #000 60%);
  animation: speed 40s linear infinite;
}
@keyframes speed { to { transform: rotate(360deg); } }
.tone {
  position: absolute; inset: 0; opacity: .22;
  background-image: radial-gradient(rgba(196,22,28,.9) 1.2px, transparent 1.4px);
  background-size: 9px 9px;
  -webkit-mask: linear-gradient(180deg, #000, transparent 55%); mask: linear-gradient(180deg, #000, transparent 55%);
}
.kanji {
  position: absolute; right: 2vw; top: 90px; writing-mode: vertical-rl; font: 700 clamp(80px, 16vw, 220px)/1 var(--serif);
  color: transparent; -webkit-text-stroke: 1px rgba(196,22,28,.35); letter-spacing: .1em; user-select: none;
}
.p-manga .cat-title { font-family: var(--sans); font-weight: 900; font-style: italic; letter-spacing: .02em; text-transform: uppercase; }
.p-manga .cat-title .w {
  color: #fff; -webkit-text-stroke: 2px #000;
  text-shadow: 6px 6px 0 var(--red), 12px 12px 0 rgba(0,0,0,.6);
}
.p-manga .cat-title em { font-family: var(--serif); font-weight: 400; text-transform: none; }
.p-manga .cat-title em .w { color: var(--muted); -webkit-text-stroke: 0; text-shadow: none; }
.stamp {
  position: absolute; left: 50%; top: 42%; z-index: 3; transform: translate(-50%, -50%) rotate(-14deg);
  padding: 8px 16px; border: 3px solid var(--red-hot); color: var(--red-hot); border-radius: 6px;
  font: 900 clamp(13px, 1.9vw, 20px)/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  background: rgba(0,0,0,.55); box-shadow: 0 0 0 3px rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,42,49,.25);
  opacity: 0; transition: opacity .35s, transform .5s var(--ease-out);
}
.p-manga .book .age { top: auto; bottom: 12px; }
.p-manga .stamp { top: auto; bottom: 7%; transform: translateX(-50%) rotate(-8deg); }
.book.is-in .stamp { opacity: .95; animation: stamp .6s var(--ease-out) both; animation-delay: calc(.6s + var(--i, 0) * .15s); }
@keyframes stamp { from { transform: translateX(-50%) rotate(-8deg) scale(2.2); opacity: 0; } to { transform: translateX(-50%) rotate(-8deg) scale(1); opacity: .95; } }

/* ---------- coming-soon popup ---------- */
.soon {
  width: min(880px, calc(100vw - 24px)); max-height: calc(var(--app-h) - 24px); padding: 0; border: 0; border-radius: 16px;
  background: #0b080b; color: var(--paper); overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.8), 0 0 0 1px rgba(196,22,28,.5), 0 0 80px rgba(196,22,28,.25);
}
.soon::backdrop { background: rgba(3,2,4,.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.soon[open] { animation: popIn .6s var(--ease-out); }
.soon[open]::backdrop { animation: fade .4s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(30px) scale(.94); clip-path: inset(10% 10% 10% 10% round 16px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 16px); } }
@keyframes fade { from { opacity: 0; } }
.soon__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.soon__media { position: relative; aspect-ratio: 2 / 3; background: #000; overflow: hidden; }
.soon__media img, .soon__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.soon__media video { opacity: 0; transition: opacity .8s; }
.soon__media video.is-playing { opacity: 1; }
.soon__body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 16px; position: relative; }
.soon__kind { font: 700 10px/1 var(--sans); letter-spacing: .36em; text-transform: uppercase; color: var(--muted); }
.soon__title { margin: 0; font: 900 italic clamp(22px, 3.7vw, 42px)/1 var(--sans); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.soon__title img { width: 100%; height: auto; }
.soon__status {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  background: rgba(196,22,28,.14); border: 1px solid rgba(196,22,28,.6);
  font: 800 12px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: #fff;
}
.soon__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red-hot); box-shadow: 0 0 10px var(--red-hot); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.soon__note { margin: 0; font: italic 400 18px/1.45 var(--serif); color: var(--muted); }
.soon__close {
  position: absolute; top: 12px; right: 12px; z-index: 4; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(0,0,0,.5); cursor: pointer; font-size: 18px; line-height: 1; transition: background .25s, transform .25s;
}
.soon__close:hover, .soon__close:focus-visible { background: var(--red); transform: rotate(90deg); outline: none; }
@media (max-width: 640px) {
  .soon__grid { grid-template-columns: 1fr; }
  .soon__media { aspect-ratio: 4 / 5; }
  .soon__media img, .soon__media video { object-position: 50% 35%; }
  .soon__body { padding: 20px 20px 24px; gap: 12px; }
  .soon__title { font-size: clamp(24px, 9vw, 40px); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .embers, .grain, .speed { display: none; }
}
