/* NEZI · mesin cerita komik: panggung lengket, kamera per panel, sorotan, tinta tergambar, balik halaman 3D.
   Desktop = mode "guided" (kamera). HP / reduced-motion = mode "strip" (panel bertumpuk). */

:root { --hdr: 62px; --page-ink: #17130f; --page-paper: #f7f1e3; }

/* ── bagian cerita ── */
.story { position: relative; }
.story.is-guided .story-stage { position: sticky; top: var(--hdr); height: calc(100svh - var(--hdr)); overflow: hidden; perspective: 2600px; perspective-origin: 20% 50%; background: #1b2a20; isolation: isolate; }
.story-under { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; background: var(--page-paper); }
.story-under .under-card { width: min(92%, 1100px); }
.story-turn { position: absolute; inset: 0; z-index: 2; transform-origin: 0 50%; transform-style: preserve-3d; will-change: transform; }
.story-shade { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 60%); }
.story-page { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: var(--page-paper); box-shadow: 0 30px 80px rgba(0,0,0,.45); backface-visibility: hidden; -webkit-backface-visibility: hidden; will-change: transform; }
.story-spot { position: absolute; z-index: 20; pointer-events: none; box-shadow: 0 0 0 4000px rgba(10, 18, 12, 0.66); opacity: 0; }
.story-edge { position: absolute; z-index: 30; left: 18px; top: 14px; pointer-events: none; }
.story-edge span, .ch-tag { display: inline-block; font-family: var(--f-hand); font-weight: 800; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; background: var(--ai); color: #f4ead2; padding: 5px 10px; border: 2.5px solid var(--ink); }
.folio { position: absolute; right: 2.2%; bottom: 1.6%; z-index: 5; font-family: var(--f-title); font-size: 15px; color: var(--ink); }

/* ── panel (bentuk poligon) ── */
.pg-panel { position: absolute; overflow: hidden; background: #fff; }
.pg-panel .pg-fill { position: absolute; inset: 0; }
.pg-panel .pg-art { position: absolute; inset: 0; background-color: #22302a; background-repeat: no-repeat; background-size: cover; background-position: center; transform: scale(1.06); transition: transform 6s ease-out; }
.pg-panel.inked .pg-art { transform: scale(1); }
.pg-panel .pg-body { position: absolute; inset: 0; padding: 4.5% 5%; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.pg-ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; overflow: visible; }
.pg-ink polygon { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.9s cubic-bezier(.6,.05,.3,1); }
.pg-ink polygon.inked { stroke-dashoffset: 0; }
.is-guided .pg-panel .pg-art, .is-guided .pg-panel .pg-body > *:not(.bubble) { opacity: 0; transition: opacity .45s ease .25s, transform 6s ease-out; }
.is-guided .pg-panel.inked .pg-art, .is-guided .pg-panel.inked .pg-body > *:not(.bubble) { opacity: 1; }
.is-guided .pg-panel .bubble { opacity: 0; transform: scale(.9); transition: opacity .3s ease .55s, transform .35s cubic-bezier(.2,1.6,.4,1) .55s; }
.is-guided .pg-panel.inked .bubble { opacity: 1; transform: none; }

/* isi panel */
.pg-title { font-family: var(--f-title); color: #fff8e8; line-height: 0.98; font-size: clamp(26px, 4.4vw, 64px); text-shadow: 3px 3px 0 var(--ink); }
.pg-title small { display: block; font-family: var(--f-hand); font-weight: 800; font-size: 0.26em; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px; color: var(--yellow); text-shadow: none; }
.pg-cap { align-self: flex-start; font-family: var(--f-hand); font-weight: 800; font-size: clamp(10px, 0.95vw, 13px); letter-spacing: 0.06em; text-transform: uppercase; background: #fffdf6; color: var(--ink); border: 2.5px solid var(--ink); padding: 4px 9px; }
.pg-cap.dark { background: var(--ink); color: #f4ead2; }
.pg-cap .n { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; background: var(--ink); color: #fff; font-size: 11px; }
.pg-cap.dark .n { background: var(--yellow); color: var(--ink); }
.pg-line { font-family: var(--f-hand); font-weight: 700; font-size: clamp(11px, 1.15vw, 16px); line-height: 1.3; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink); }
.pg-line.light { color: #fff8e8; }
.pg-big { font-family: var(--f-title); font-size: clamp(30px, 5.2vw, 78px); line-height: 0.95; color: var(--ink); }
.pg-big.out { color: #fff; -webkit-text-stroke: 3px var(--ink); text-shadow: 5px 5px 0 var(--ink); }
.pg-big.shu { color: var(--shu); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--ink); }
.pg-panel .bubble { position: absolute; z-index: 6; font-size: clamp(10px, 1.05vw, 15px); text-transform: uppercase; text-align: center; letter-spacing: 0.02em; text-wrap: balance; padding: 1.2% 1.6%; border-radius: 50%; line-height: 1.25; }
.pg-panel .bubble.box { border-radius: 18px; text-align: left; text-transform: none; }
.pg-panel .slips { gap: 6px; }
.pg-panel .slip { font-size: clamp(9px, 0.85vw, 12px); padding: 6px 10px 10px; }
.pg-panel .slip .amt { font-size: clamp(12px, 1.2vw, 17px); }
.pg-mono { font-family: var(--mono); font-size: clamp(9px, 0.9vw, 12.5px); background: var(--ink); color: #f4ead2; padding: 7px 10px; word-break: break-all; }
.pg-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: clamp(10px, 0.95vw, 13px); }
.pg-kv b { font-family: var(--f-hand); font-size: 0.85em; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.pg-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.pg-hours i { height: clamp(22px, 3vw, 44px); border: 1.5px solid var(--ink); background: #fff; }
.pg-tone { position: absolute; inset: 0; background-image: radial-gradient(rgba(23,19,15,.22) 1.2px, transparent 1.4px); background-size: 8px 8px; }

/* ── halaman alat (setelah halaman dibalik) ── */
.tools { position: relative; padding: 46px var(--gut) 40px; background: var(--page-paper); border-top: 4px solid var(--ink); }
.tools-in { max-width: 1240px; margin: 0 auto; }
.tools-head h2 { margin: 10px 0 6px; font-family: var(--f-title); font-weight: 400; font-size: clamp(28px, 3.6vw, 48px); line-height: 1.05; }
.tools-head p { margin: 0 0 22px; color: #3b342c; max-width: 70ch; }
.tools-mount { min-height: 260px; }
.tools .folio { position: static; display: block; text-align: right; margin-top: 18px; }

/* ── navigasi bab (tab bernomor + scrollspy) ── */
.c-tabs { display: flex; gap: 6px; margin: 0 auto; }
.c-tab { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px 0 5px; border: 2.5px solid transparent; border-radius: 8px; font-family: var(--f-hand); font-weight: 800; font-size: 14px; color: var(--ink); white-space: nowrap; }
.c-tab b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 5px; background: var(--ai); color: #f4ead2; font-family: var(--f-title); font-weight: 400; font-size: 11px; }
.c-tab:hover { border-color: var(--ink); background: var(--panel); }
.c-tab.on { background: var(--yellow); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.c-tab.on b { background: var(--ink); color: var(--yellow); }
.c-chapters-btn { display: none; }
.ch-sheet { border: 4px solid var(--ink); border-radius: 6px; padding: 0; background: var(--panel); box-shadow: 8px 8px 0 var(--ink); width: min(92vw, 380px); }
.ch-sheet::backdrop { background: rgba(23,19,15,.5); }
.ch-sheet a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 2px solid rgba(23,19,15,.15); font-family: var(--f-title); font-size: 17px; }
.ch-sheet a b { display: inline-grid; place-items: center; width: 30px; height: 30px; background: var(--ai); color: #f4ead2; border-radius: 6px; font-size: 12px; font-weight: 400; }

/* statistik hidup di sampul (seperti indeks isi edisi) */
.cover-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 18px; border-top: 3px solid var(--ink); }
.cover-stats a { padding: 10px 12px 10px 0; border-bottom: 2px solid rgba(23,19,15,.2); }
.cover-stats a:nth-child(odd) { border-right: 2px solid rgba(23,19,15,.2); }
.cover-stats a:nth-child(even) { padding-left: 12px; }
.cover-stats .v { font-family: var(--f-title); font-size: 26px; line-height: 1; }
.cover-stats .v small { font-family: var(--f-hand); font-size: 12px; margin-left: 4px; }
.cover-stats .l { font-family: var(--f-hand); font-weight: 700; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: #3b342c; margin-top: 4px; }
.cover-stats .go { font-family: var(--f-hand); font-weight: 800; font-size: 11.5px; color: var(--shu); }
.cover-stats a:hover .go { text-decoration: underline; }

/* ── mode strip (HP / reduced-motion) ── */
.story:not(.is-guided) { padding: 18px 14px 6px; background: #1b2a20; }
.story:not(.is-guided) .story-stage { position: relative; height: auto; overflow: visible; background: none; perspective: none; }
.story:not(.is-guided) .story-turn, .story:not(.is-guided) .story-page { position: relative; transform: none !important; inset: auto; width: auto !important; height: auto !important; box-shadow: none; background: none; }
.story:not(.is-guided) .story-under, .story:not(.is-guided) .story-shade, .story:not(.is-guided) .story-spot, .story:not(.is-guided) .pg-ink-page { display: none; }
.story:not(.is-guided) .story-edge { position: static; margin-bottom: 12px; }
.story:not(.is-guided) .pg-panel { position: relative; left: auto !important; top: auto !important; width: auto !important; height: auto !important; min-height: 210px; clip-path: none !important; margin-bottom: 14px; border: 4px solid var(--ink); box-shadow: 5px 5px 0 #0c1510; }
.story:not(.is-guided) .pg-panel[data-tall] { min-height: 340px; }
.story:not(.is-guided) .pg-panel .pg-body { position: relative; inset: auto; min-height: inherit; padding: 16px; }
.story:not(.is-guided) .pg-panel .bubble { position: relative; left: auto !important; right: auto !important; top: auto !important; bottom: auto !important; width: auto !important; margin-top: auto; padding: 12px 16px; border-radius: 22px; }
.story:not(.is-guided) .folio { position: static; display: block; text-align: right; color: #f4ead2; margin: -4px 0 14px; }

@media (max-width: 1100px) { .c-tab span { display: none; } }
@media (max-width: 820px) {
  .c-tabs { display: none; }
  .c-chapters-btn { display: inline-flex; }
  .cover-stats .v { font-size: 22px; }
}

/* ekor balon manga (oval) — arah lewat data-tail */
.pg-panel .bubble::before, .pg-panel .bubble::after { content: none; }
.pg-panel .bubble[data-tail]::before { content: ''; position: absolute; width: 22px; height: 26px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 30% 100%); }
.pg-panel .bubble[data-tail]::after { content: ''; position: absolute; width: 14px; height: 18px; background: #fff; clip-path: polygon(0 0, 100% 0, 30% 100%); }
.pg-panel .bubble[data-tail="left"]::before { left: 12%; bottom: -22px; transform: rotate(28deg); }
.pg-panel .bubble[data-tail="left"]::after { left: calc(12% + 4px); bottom: -14px; transform: rotate(28deg); }
.pg-panel .bubble[data-tail="right"]::before { right: 14%; bottom: -22px; transform: rotate(-28deg) scaleX(-1); }
.pg-panel .bubble[data-tail="right"]::after { right: calc(14% + 4px); bottom: -14px; transform: rotate(-28deg) scaleX(-1); }
.pg-panel .bubble[data-tail="up"]::before { left: 30%; top: -22px; transform: rotate(180deg); }
.pg-panel .bubble[data-tail="up"]::after { left: calc(30% + 4px); top: -14px; transform: rotate(180deg); }
.story:not(.is-guided) .pg-panel .bubble[data-tail]::before, .story:not(.is-guided) .pg-panel .bubble[data-tail]::after { display: none; }

/* landing: kartu bab sudah memuat judul, jadi judul bawaan alat disembunyikan */
.tools-mount .ph .eyebrow, .tools-mount .ph h1 { display: none; }
/* kartu bab: tanda air emblem supaya tidak terasa "masih memuat" */
.story-under::before { content: ""; position: absolute; right: 5%; top: 50%; width: min(46vh, 420px); aspect-ratio: 1; transform: translateY(-50%) rotate(-6deg); background: url(/brand/logo-512.png) center / contain no-repeat; opacity: 0.09; pointer-events: none; }
.story-under .under-card { position: relative; }
.story-under .under-card h2 { font-size: clamp(30px, 4.4vw, 58px); line-height: 1.02; }
