/* Presentasi scrollytelling. Panggung selalu GELAP berwarna brand (bukan hitam), teks terang, titik berwarna.
   GANTI BRAND = ubah blok :root di bawah (+ STAGE_BG/ALM/YEL/ROSE di story.js, + gate.css). Preset bawaan: Tome Ame
   (Lunar Green #1a4932, Blanched Almond #ffecca, Rubik + Big Shoulders Stencil Display hanya untuk angka/judul babak).
   Aturan gaya: tanpa label HURUF BESAR, tanpa bold/italic di judul, tanpa nomor 01–05, jarak skala 8-pt, baris ≤68ch. */
:root {
  --lunar: #1a4932; --deep: #13291d; --mineral: #3a663f; --almond: #ffecca; --yellow: #ffdd6f; --rose: #ffb9ae;
  --ink-2: rgba(255, 236, 202, .78); --ink-3: rgba(255, 236, 202, .55); --line: rgba(255, 236, 202, .16);
  --card: rgba(19, 41, 29, .74);
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 96px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--lunar); color: var(--almond); font: 400 17px/1.6 Rubik, system-ui, sans-serif; overflow-x: hidden; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0 0 var(--s3); }
a { color: var(--yellow); }
b { font-weight: 600; color: var(--almond); }
kbd { font: 600 11px Rubik, sans-serif; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; margin-left: 6px; color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.stencil { font-family: "Big Shoulders Stencil Display", Rubik, sans-serif; font-weight: 800; }

#loading { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; text-align: center; background: var(--lunar); }
#loading .ld-num { font-family: "Big Shoulders Stencil Display", Rubik, sans-serif; font-weight: 800; font-size: 96px; line-height: 1; color: var(--yellow); font-variant-numeric: tabular-nums; }
#loading p { color: var(--ink-3); margin-top: var(--s2); }

/* ── panggung ──────────────────────────────────────── */
#stage { position: fixed; inset: 0; z-index: 0; display: block; }
#vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 62% 50%, transparent 55%, rgba(10, 30, 20, .55) 100%); }
#ov { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
#ov-cam { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; }
#ov-cam svg { position: absolute; left: 0; top: 0; overflow: visible; }
#ov-ui { position: fixed; z-index: 6; pointer-events: none; inset: 0; }
#ov-ui > * { pointer-events: auto; }

.lbl { position: absolute; transform: translate(-50%, 0); text-align: center; font-size: 13px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; text-shadow: 0 1px 8px rgba(10, 30, 20, .9); }
.lbl b { display: block; font-size: 15px; color: var(--almond); }
.lbl.left { transform: translate(0, -50%); text-align: left; }
.lbl.right { transform: translate(-100%, -50%); text-align: right; }
.lbl.mid { transform: translate(-50%, -50%); }
.lbl.up { transform: translate(-50%, -100%); }
.lbl.one b { display: inline; font-size: 13px; margin-right: 5px; }
.lbl.big { font-family: "Big Shoulders Stencil Display", Rubik, sans-serif; font-weight: 800; font-size: clamp(40px, 5vw, 76px); line-height: .9; color: var(--yellow); }
.lbl.big small { display: block; font: 500 14px Rubik, sans-serif; color: var(--ink-2); margin-top: 6px; }
.lbl.hl b { color: var(--yellow); }
.lbl.tick { font-size: 12px; color: var(--ink-3); transform: translate(-50%, -50%); }
.lbl.btn { pointer-events: auto; cursor: pointer; }

#unit { position: fixed; z-index: 6; right: 24px; bottom: 20px; font-size: 13px; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; background: rgba(19, 41, 29, .7); border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; transition: opacity .4s; }
#unit::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--almond); }
#unit:empty { opacity: 0; }

#tip { position: fixed; z-index: 30; pointer-events: none; background: var(--deep); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.45; color: var(--almond); opacity: 0; transform: translate(14px, -50%); transition: opacity .15s; max-width: 240px; }
#tip.on { opacity: 1; }
#tip.flip { transform: translate(calc(-100% - 14px), -50%); }

/* kontrol di atas panggung (filter peta, eksplorasi) */
.seg-ctl { position: absolute; display: flex; gap: 6px; flex-wrap: wrap; }
.seg-ctl span { font-size: 13px; color: var(--ink-3); align-self: center; margin-right: 4px; }
.seg-ctl button { font: 500 13px Rubik, sans-serif; color: var(--ink-2); background: rgba(19, 41, 29, .6); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.seg-ctl button[aria-pressed="true"] { background: var(--almond); color: var(--lunar); border-color: var(--almond); }

/* adegan jelajah: daftar pertanyaan (akordeon). Yang terpilih menyala kuning & terbuka berisi jawabannya. */
.ex-lead { margin-bottom: var(--s3); }
.exq { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s3); }
.exq-i { border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 236, 202, .03); transition: border-color .25s, background .25s; }
.exq-i:hover { border-color: var(--ink-3); }
.exq-i.on { border-color: rgba(255, 221, 111, .7); background: rgba(255, 221, 111, .08); }
.exq-q { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: none;
  text-align: left; cursor: pointer; font: 500 15px/1.4 Rubik, sans-serif; color: var(--almond); }
.exq-i.on .exq-q { cursor: default; }
.exq-r { flex: none; display: grid; place-items: center; width: 17px; height: 17px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: border-color .25s; }
.exq-r::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); transform: scale(0); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.exq-i.on .exq-r { border-color: var(--yellow); }
.exq-i.on .exq-r::after { transform: scale(1); }
.exq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.2, .7, .2, 1); }
.exq-i.on .exq-a { grid-template-rows: 1fr; }
.exq-a > div { overflow: hidden; }
.exq-a p { margin: 0 16px 10px 43px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.exq-a p:last-child { margin-bottom: 14px; }
.exq-a .exq-k { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 2px; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--almond)); margin: 0 5px 1px 1px; vertical-align: middle; }
.sw.dim { background: rgba(255, 236, 202, .3); }
.ex-foot { font-size: 14px; line-height: 1.5; color: var(--ink-3); margin: 0; }
.q-s, .exq-a .q-h { display: none; }   /* label pendek & judul jawaban: hanya untuk HP */

/* kartu samping (detail kelompok/persona: foto produk, angka pendukung). Isinya dari step.card() */
#pcard { position: fixed; z-index: 7; right: 3vw; top: calc(50% + 24px); width: min(340px, 28vw); max-height: calc(100vh - 160px); overflow: auto; transform: translateY(-50%); background: var(--card); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 20px; padding: var(--s4); opacity: 0; pointer-events: none; }
#pcard.on { pointer-events: auto; }
#pcard h3 { font-family: "Big Shoulders Stencil Display", Rubik, sans-serif; font-weight: 800; font-size: 34px; line-height: .95; color: var(--c, var(--yellow)); }
#pcard .who { color: var(--ink-3); font-size: 14px; margin: var(--s2) 0 var(--s3); }
#pcard ul { margin: 0 0 var(--s3); padding-left: 18px; font-size: 15px; color: var(--ink-2); }
#pcard .lbl2 { font-size: 13px; color: var(--ink-3); margin-bottom: var(--s2); }
#pcard .prod { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#pcard figure { margin: 0; }
#pcard figure div { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: rgba(255,236,202,.08); }
#pcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
#pcard figcaption { font-size: 12px; line-height: 1.3; color: var(--ink-2); margin-top: 6px; }
#pcard figcaption .nm { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#pcard .khas { display: flex; gap: 12px; align-items: center; margin-top: var(--s3); padding: 10px; border-radius: 12px; background: rgba(255,236,202,.07); font-size: 13px; color: var(--ink-2); }
#pcard .khas img { width: 46px; height: 62px; border-radius: 6px; flex: none; }

/* ── rail atas: tiga babak ─────────────────────────── */
#rail { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: var(--s4); padding: 14px 24px; background: linear-gradient(rgba(19, 41, 29, .88), rgba(19, 41, 29, 0)); }
.rail-logo svg { width: 64px; height: auto; color: var(--almond); display: block; }
.acts { display: flex; gap: var(--s4); flex: 1; justify-content: center; }
.acts button { background: none; border: 0; cursor: pointer; color: var(--ink-3); font: 500 14px Rubik, sans-serif; padding: 4px 0; min-width: 120px; text-align: left; }
.acts button i { display: block; height: 2px; margin-top: 6px; background: var(--line); position: relative; overflow: hidden; border-radius: 2px; }
.acts button i::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: var(--yellow); transition: width .5s; }
.acts button.on { color: var(--almond); }
.rail-tools { display: flex; gap: var(--s3); align-items: center; }
.rail-tools button, .rail-tools a { font: 500 14px Rubik, sans-serif; color: var(--ink-2); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; text-decoration: none; }
.rail-tools button:hover, .rail-tools a:hover { color: var(--almond); border-color: var(--ink-3); }

/* ── langkah cerita (mode scroll) ──────────────────── */
#steps { position: relative; z-index: 3; }
.step { min-height: 100vh; display: flex; align-items: center; padding: 0 0 0 6vw; }
.step .card { width: min(430px, 34vw); background: var(--card); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 20px; padding: 28px 30px; }
.kicker { font-size: 14px; color: var(--yellow); font-weight: 500; margin-bottom: var(--s2); }
.step h2, #caption h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.12; margin-bottom: var(--s3); }
.step .body, #caption .body { color: var(--ink-2); }
.body ul { padding-left: 20px; margin: 0; }
.body li { margin-bottom: var(--s2); }
.hl { color: var(--yellow); font-weight: 600; font-variant-numeric: tabular-nums; }
.hint { font-size: 14px; color: var(--ink-3); margin-top: var(--s4); display: flex; align-items: center; gap: 10px; }
.hint .arrow { width: 18px; height: 28px; border: 1.5px solid var(--ink-3); border-radius: 10px; position: relative; }
.hint .arrow::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--ink-2); animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(9px); opacity: 0; } 100% { opacity: 0; } }

.step.hook { align-items: flex-end; padding-bottom: 9vh; }
.step.hook .card { width: min(620px, 52vw); background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
.step.hook h2 { font-size: clamp(30px, 3.4vw, 48px); }

.step.act { justify-content: center; padding: 0; text-align: center; }
.step.act .card { width: auto; max-width: 900px; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.act-num { font-family: "Big Shoulders Stencil Display", Rubik, sans-serif; font-weight: 800; font-size: clamp(20px, 2vw, 26px); letter-spacing: .02em; color: var(--yellow); }
.act-title { font-family: "Big Shoulders Stencil Display", Rubik, sans-serif; font-weight: 800; font-size: clamp(72px, 12vw, 180px); line-height: .88; margin: 8px 0 calc(.24em + 8px); }   /* jarak bawah ikut ukuran huruf: ekor y/g (±.22em) tidak menimpa kalimat di bawahnya */
/* masker SplitText (overflow: clip) + line-height rapat memotong ekor huruf (y, g, j) → beri ruang di bawah tiap kata */
.act-title > *, .step h2 > *, #caption h2 > * { padding-bottom: .16em; margin-bottom: -.16em; }
/* caption presentasi: aturan di atas (ID) menimpa margin .act-title → ekor y/g menembus kalimat di bawah. Kembalikan jaraknya. */
#caption h2 > .act-title { margin-bottom: calc(.1em + 8px); }
.act-sub { font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-2); }

.step.tall { min-height: 340vh; align-items: flex-start; }
.step.tall .card { position: sticky; top: 30vh; }
/* overflow-anchor: jawaban jelajah mengubah tinggi kartu; tanpa ini Chrome menggeser gulir supaya teks tetap di tempat,
   akibatnya bawah kartu (HP) terdorong keluar layar */
.step.end { min-height: 120vh; overflow-anchor: none; }
.step.end h2 { font-size: clamp(24px, 2.2vw, 32px); }
/* jelajah (desktop): kartu menempel di bawah rail selama langkah terakhir digulir → daftar pertanyaan selalu utuh terlihat */
@media (min-width: 821px) {
  .step.end { align-items: flex-start; padding-top: 88px; }
  .step.end .card { position: sticky; top: 88px; }
}

/* ── mode presentasi ───────────────────────────────── */
#caption { display: none; }
body.present #steps { display: none; }
body.present { overflow: hidden; }
/* caption mengisi ruang di bawah rail; "safe center" = rata atas kalau isinya lebih tinggi dari layar */
body.present #caption { display: flex; flex-direction: column; justify-content: safe center; position: fixed; z-index: 8; left: 4vw; top: 84px; bottom: 24px; width: min(460px, 31vw); overflow-y: auto; scrollbar-width: none; }
#caption .cap-nav { display: flex; gap: 10px; align-items: center; margin-top: var(--s5); flex-wrap: wrap; }
#caption .cap-nav button { font: 500 14px Rubik, sans-serif; color: var(--ink-2); background: rgba(19, 41, 29, .6); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
#caption .cap-nav span { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; min-width: 54px; text-align: center; }
body.present #caption.act-slide { left: 0; right: 0; width: auto; text-align: center; align-items: center; }
body.present #caption.act-slide .cap-nav { justify-content: center; }
@media (min-width: 821px) { body.present #caption.hook-slide { top: auto; bottom: 5vh; width: min(640px, 52vw); } }
#caption .hint { display: none; }   /* "gulir untuk mulai" tidak berlaku di mode presentasi */

/* teks bergerak (SplitText) */
.w-line { overflow: hidden; display: block; }

.checking #gate-form { visibility: hidden; }  /* sambil mengecek sesi login: form baru muncul kalau belum login */
#nogl { position: fixed; inset: 0; z-index: 45; display: grid; place-content: center; text-align: center; padding: 24px; background: var(--lunar); }

/* ── layar kecil: panggung di atas, kartu teks di bawah ── */
@media (max-width: 820px) {
  body { font-size: 16px; }
  #rail { padding: 10px 14px; gap: 10px; }
  .acts { gap: 10px; } .acts button { min-width: 0; font-size: 12px; }
  .rail-tools a { display: none; } .rail-tools button { padding: 6px 10px; font-size: 12px; } .rail-tools kbd { display: none; }
  .rail-logo { display: none; }
  .step { padding: 0 14px; align-items: flex-end; padding-bottom: 6vh; }
  .step .card { width: 100%; padding: 20px; }
  .step.hook .card { width: 100%; }
  .step.tall .card { top: 54vh; }
  /* HP: kartu persona di area panggung (atas), kartu teks tetap di bawah */
  #pcard { right: 12px; left: 12px; width: auto; top: 92px; bottom: auto; transform: none; padding: 14px; max-height: calc(48vh - 40px); }
  #pcard h3 { font-size: 24px; }
  #pcard .who, #pcard .lbl2 { margin: 4px 0 8px; font-size: 13px; }
  #pcard figure div { aspect-ratio: 1; }
  #pcard figcaption { font-size: 11px; }
  #pcard .khas { margin-top: 10px; padding: 6px 8px; }
  #pcard .khas img { width: 34px; height: 44px; }
  body.present #caption { left: 14px; right: 14px; width: auto; top: auto; bottom: 14px; max-height: 46vh; justify-content: flex-start; }
  #unit { right: 12px; bottom: auto; top: 54px; }
  .lbl { font-size: 12px; } .lbl b { font-size: 13px; }   /* HP: label lebih ringkas, mengurangi tabrakan */
  .lbl.big { font-size: 32px; }
  .lbl.big small { font-size: 12px; margin-top: 2px; }
  /* jelajah di HP: pertanyaan jadi 4 chip (2×2, label pendek), jawaban pertanyaan terpilih di bawahnya dengan
     pertanyaan lengkap sebagai judul. Akordeon 4 baris terlalu tinggi dan menutupi titik di atas. */
  .ex-lead { font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
  .exq { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
  .exq-i { display: contents; }
  .exq-q { justify-content: center; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 13px; line-height: 1.25; text-align: center; background: rgba(255, 236, 202, .04); }
  .exq-i.on .exq-q { background: var(--almond); border-color: var(--almond); color: var(--lunar); }
  .exq-r, .q-l { display: none; }
  .q-s { display: inline; }
  .exq-a { grid-column: 1 / -1; order: 1; display: none; }
  .exq-i.on .exq-a { display: block; }
  .exq-a .q-h { display: block; margin: 6px 0 4px; font-weight: 600; color: var(--almond); }
  .exq-a p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
  .exq-a p:last-child { margin-bottom: 0; }
  .exq-a .exq-k { font-size: 12px; column-gap: 12px; }
  .ex-foot { font-size: 12px; }
}
/* layar laptop pendek (≤720px): judul & kartu sedikit dirapatkan supaya kartu penutup & kartu persona muat tanpa scrollbar */
@media (max-height: 720px) and (min-width: 821px) {
  .step .card h2, #caption h2 { font-size: clamp(22px, 2.1vw, 30px); }
  .step .card { padding: 22px 26px; }
  .body li { margin-bottom: 6px; }
  #pcard { padding: 18px 20px; }
  #pcard h3 { font-size: 28px; }
  #pcard .who { margin: 6px 0 12px; }
  #pcard figure div { aspect-ratio: 1; }
  #pcard .khas { margin-top: 12px; padding: 8px 10px; }
  #pcard .khas img { width: 38px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) { .hint .arrow::after { animation: none; } }

/* foto produk di bawah wadah (adegan "hampir habis" / celana vs rok) */
.lbl img.ph { display: block; width: 44px; height: 58px; object-fit: cover; border-radius: 6px; margin: 0 auto 6px; }

/* tombol & pop-up "Lihat detail angka": bagian laporan dimuat di iframe (/?embed=<section>) */
.detail-btn { margin-top: var(--s3); display: flex; width: fit-content; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(255, 236, 202, .45); background: transparent; color: var(--almond); font: 500 14px/1 Rubik, sans-serif; cursor: pointer; pointer-events: auto; }
.detail-btn::after { content: "↗"; color: var(--yellow); }
.detail-btn:hover { background: rgba(255, 236, 202, .1); border-color: var(--almond); }
#detail { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(8, 22, 15, .72); backdrop-filter: blur(4px); }
#detail[hidden] { display: none; }
.dt-panel { width: min(1120px, 100%); height: min(86vh, 900px); display: flex; flex-direction: column; background: #fffaf0; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.dt-head { display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 24px; border-bottom: 1px solid #eadfc6; color: #17271e; }
.dt-head h3 { flex: 1; font: 700 18px/1.2 Rubik, sans-serif; color: #1a4932; }
.dt-head a { color: #1a4932; font-size: 14px; }
.dt-head button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #d6cdb6; background: #ffecca; color: #17271e; font: 500 14px Rubik, sans-serif; cursor: pointer; }
.dt-head kbd { color: #4a5a4f; border-color: #d6cdb6; }
#dt-frame { flex: 1; width: 100%; border: 0; background: #fffaf0; }
@media (max-width: 820px) {
  #detail { padding: 0; }
  .dt-panel { height: 100%; border-radius: 0; }
  .dt-head { padding: 10px 12px 10px 16px; gap: 10px; }
  .dt-head a { display: none; }
  .dt-head kbd { display: none; }
}

/* tombol suara: nyala = aksen kuning */
#btn-sound[aria-pressed="true"] { color: var(--yellow); border-color: rgba(255, 221, 111, .55); }
