/* Bayangin Gimana. Sumber palet dan huruf: docs/identitas-visual.md.
   Arah: bab warna. Amber untuk pilihan A dan aksi utama, teal hanya untuk pilihan B. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/aset/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --navy: #14213d;
  --gelap: #0b1226;
  --amber: #fca311;
  --krem: #f5f1e8;
  --teal: #2a9d8f;

  --ukuran-raksasa: clamp(2.375rem, 5.7vw, 6.25rem);
  --ukuran-judul: clamp(2rem, 4vw, 4rem);
  --ukuran-sub: clamp(1.25rem, 1.8vw, 1.75rem);
  --ukuran-isi: 1.125rem;

  --tepi: clamp(1.125rem, 3vw, 2.5rem);
  --tepi-kiri: max(var(--tepi), env(safe-area-inset-left));
  --tepi-kanan: max(var(--tepi), env(safe-area-inset-right));
  --sela: clamp(0.75rem, 1.5vw, 1.5rem);
  --bab: clamp(4.5rem, 9vw, 8.5rem);
  --keluar: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

/* Dasar */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--navy);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgb(252 163 17 / 0.25);
}
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
  margin: 0;
  background: var(--navy);
  color: var(--krem);
  font: 500 var(--ukuran-isi)/1.55 "Plus Jakarta Sans", system-ui, sans-serif;
  overflow-wrap: break-word;
}
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; }
p, figure, ul, fieldset { margin: 0; padding: 0; }
p, li, figcaption { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a, label { color: inherit; cursor: pointer; touch-action: manipulation; }
a { text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.16em; }
a:active { opacity: 0.85; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
::selection { background: var(--amber); color: var(--navy); }
[id] { scroll-margin-top: 1.5rem; }

.khusus-pembaca {
  position: absolute;
  width: 1px;
  height: 1px; /* taste-skill-ignore: kotak khusus pembaca layar, tidak terlihat */
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lewati {
  position: absolute;
  z-index: 3;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--amber);
  color: var(--navy);
  transform: translateY(-200%);
}
.lewati:focus-visible { transform: none; outline-color: var(--krem); }

/* Kepala */
.kepala {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  min-height: 5rem;
  padding: max(1rem, env(safe-area-inset-top)) var(--tepi-kanan) 1rem var(--tepi-kiri);
  background: var(--navy);
}
.merek {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 44px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}
.merek img { width: 2.5rem; }
.kepala nav { display: flex; gap: clamp(1rem, 3vw, 2.5rem); }
.kepala nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; text-decoration: none; }
.kepala nav a:hover, .merek:hover { text-decoration: underline; }

/* Pembuka: kepala Belang dari logo menjadi bingkai adegan */
.pembuka {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sela);
  min-height: calc(100svh - 5rem);
  padding: 0 var(--tepi-kanan) 0 var(--tepi-kiri);
  overflow: clip;
}
.pembuka-teks { grid-column: 1 / 7; align-self: center; padding-block: 2rem 4rem; }
.pembuka h1 { font-size: var(--ukuran-raksasa); line-height: 0.98; }
.baris, .baris > span { display: block; }
.pengantar { max-width: 32ch; margin-top: 2rem; font-size: var(--ukuran-sub); line-height: 1.35; }
.aksi { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; margin-top: 2rem; }
.tombol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  transition: background-color 200ms ease, transform 200ms var(--keluar);
}
.tombol:hover { background: var(--krem); }
.tombol:active { transform: scale(0.97); opacity: 1; }
.tombol:focus-visible { outline-color: var(--krem); }
.tautan-aksi { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
/* Nama aplikasi tidak putus di spasi; pada teks 200% di layar 320px ia harus boleh patah. */
.tautan-aksi > span { min-width: 0; overflow-wrap: anywhere; }

.gelembung, .gelembung-isi {
  -webkit-mask: url("/aset/kepala.svg") center / 100% 100% no-repeat;
  mask: url("/aset/kepala.svg") center / 100% 100% no-repeat;
}
.gelembung {
  grid-column: 7 / 13;
  justify-self: end;
  align-self: center;
  width: min(100%, 86svh);
  aspect-ratio: 576 / 617;
  display: grid;
  place-items: center;
  background: var(--amber);
}
.gelembung-isi { width: 92%; aspect-ratio: 576 / 617; overflow: hidden; background: var(--gelap); }
.gelembung-isi img { width: 100%; height: 100%; object-fit: cover; }

/* Pilihan A atau B: satu gambar dipisah dua bidang */
.pilihan { position: relative; background: var(--gelap); }
.pilihan h2 {
  padding: 3rem var(--tepi-kanan) 2rem var(--tepi-kiri);
  font-size: var(--ukuran-judul);
}
.pilihan fieldset { display: flex; min-width: 0; border: 0; }
.jalan { position: relative; display: flex; flex: 1 1 0; min-width: 0; }
.pilihan:has(#pilih-a:checked) .jalan-b img,
.pilihan:has(#pilih-b:checked) .jalan-a img { opacity: 0.28; }
.jalan label { display: flex; flex-direction: column; width: 100%; }
.jalan-gambar { display: block; height: min(64svh, 44vw); min-height: 15rem; overflow: hidden; }
.jalan-gambar img { width: 100%; height: 100%; object-fit: cover; transition: opacity 300ms ease; }
.jalan-a img { object-position: right 66%; transform-origin: right center; }
.jalan-b img { object-position: left 66%; transform-origin: left center; }
.jalan-teks {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  flex: 1;
  gap: 0.5rem 1.25rem;
  padding: 1.5rem var(--tepi-kanan) 1.75rem var(--tepi-kiri);
  color: var(--navy);
}
.jalan-a .jalan-teks { background: var(--amber); }
/* Navy di teal hanya 4,8:1, jadi bidang B memakai navy gelap (5,6:1). */
.jalan-b .jalan-teks { background: var(--teal); color: var(--gelap); }
.huruf { font-size: var(--ukuran-judul); font-weight: 800; line-height: 1; }
.nama-jalan { font-size: var(--ukuran-sub); font-weight: 800; line-height: 1.2; text-wrap: balance; }
.terpilih { display: none; grid-column: 2 / 4; }
/* Lingkaran radio: bentuknya sendiri yang memberi tahu bahwa A dan B bisa dipilih. */
.jalan-teks::after {
  content: "";
  grid-column: 3;
  grid-row: 1;
  width: 2rem;
  height: 2rem;
  border: 4px solid currentColor;
  border-radius: 50%;
  padding: 4px;
  background-clip: content-box;
}
.jalan label:hover .jalan-teks::after { background-color: rgb(11 18 38 / 0.3); }
.jalan :checked ~ label .jalan-teks::after { background-color: currentColor; }
.jalan :checked ~ label .terpilih { display: block; }
.jalan label:hover .nama-jalan { text-decoration: underline; text-underline-offset: 0.2em; }
.jalan label:active .huruf { transform: scale(0.94); }
.jalan :checked ~ label .nama-jalan { text-decoration: underline; text-decoration-thickness: 0.14em; text-underline-offset: 0.2em; }
/* Dua cincin: krem di atas gambar gelap, navy gelap di atas bidang amber atau teal. */
.jalan :focus-visible ~ label { outline: 4px solid var(--krem); outline-offset: -4px; }
.jalan :focus-visible ~ label .jalan-teks { outline: 4px solid var(--gelap); outline-offset: -10px; }

/* Alur: tiga adegan turun diagonal */
.alur {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sela);
  padding: var(--bab) var(--tepi-kanan) var(--bab) var(--tepi-kiri);
  background: var(--krem);
  color: var(--navy);
  color-scheme: light;
}
.alur h2 { grid-column: 7 / 13; grid-row: 1; font-size: var(--ukuran-judul); }
.langkah { display: grid; gap: var(--sela); align-items: start; }
.langkah strong { display: block; margin-bottom: 0.375rem; font-size: var(--ukuran-sub); font-weight: 800; line-height: 1.2; text-wrap: balance; }
.langkah figcaption { max-width: 34ch; }
.langkah img { width: 100%; }
.langkah-nonton { grid-column: 1 / 7; grid-row: 1 / 3; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.langkah-nonton img { grid-column: 1 / 5; }
.langkah-nonton figcaption { grid-column: 5 / 7; align-self: end; }
.langkah-pilih { grid-column: 7 / 13; grid-row: 2; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 2.5rem; }
.langkah-pilih img { grid-column: 1 / 4; }
.langkah-pilih figcaption { grid-column: 4 / 7; }
.langkah-lanjut { grid-column: 3 / 13; grid-row: 3; grid-template-columns: repeat(10, minmax(0, 1fr)); margin-top: 4rem; }
.langkah-lanjut img { grid-column: 5 / 11; grid-row: 1; }
.langkah-lanjut figcaption { grid-column: 1 / 5; grid-row: 1; }

/* Pemain */
.pemain { padding: var(--bab) var(--tepi-kanan) var(--bab) var(--tepi-kiri); background: var(--gelap); }
.pemain h2 { font-size: var(--ukuran-judul); }
.pemain ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2.25rem 0.75rem; margin-top: 2.5rem; list-style: none; }
.pemain li img { width: 100%; }
.pemain li p { margin-top: 0.625rem; line-height: 1.4; }
.pemain li strong { display: block; font-size: var(--ukuran-sub); font-weight: 800; }
.catatan { margin-top: 2.5rem; max-width: 64ch; }

/* Aplikasi */
.aplikasi {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sela);
  padding: var(--bab) var(--tepi-kanan) var(--bab) var(--tepi-kiri);
  background: var(--krem);
  color: var(--navy);
  color-scheme: light;
}
.aplikasi > h2 { grid-column: 1 / 7; align-self: start; position: sticky; top: 2rem; font-size: var(--ukuran-raksasa); }
.fungsi { grid-column: 7 / 13; }
.fungsi > p:first-child { font-size: var(--ukuran-sub); line-height: 1.35; }
.fungsi h3 { margin: 2.5rem 0 0.5rem; font-size: var(--ukuran-sub); line-height: 1.2; }
.fungsi p + p { margin-top: 1.5rem; }
.english { margin-top: 3rem; padding: 1.5rem; background: var(--navy); color: var(--krem); }
.english h3 { margin-top: 0; }

/* Penutup: kontak sebagai judul */
.penutup {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  min-height: 70svh;
  padding: 2.5rem var(--tepi-kanan) max(1.5rem, env(safe-area-inset-bottom)) var(--tepi-kiri);
  background: var(--amber);
  color: var(--navy);
}
.penutup ::selection { background: var(--navy); color: var(--amber); }
.penutup-atas { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; }
.penutup h2 { font-size: var(--ukuran-judul); }
.surel {
  align-self: start;
  max-width: 100%;
  font-size: clamp(2rem, 10.2vw, 11rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.surel:hover { text-decoration: underline; text-decoration-thickness: 0.04em; }
.penutup-bawah { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 2rem; }
.penutup-bawah a { display: inline-flex; align-items: center; min-height: 44px; }

/* Kebijakan privasi */
.dokumen-judul {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 6vw, 5rem) var(--tepi-kanan) 4rem var(--tepi-kiri);
}
.dokumen h1 { font-size: var(--ukuran-raksasa); line-height: 0.98; }
.dokumen-tanda { width: clamp(6rem, 19vw, 18rem); }
.pita { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.pita img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.kebijakan {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sela);
  padding: var(--bab) var(--tepi-kanan) var(--bab) var(--tepi-kiri);
  background: var(--krem);
  color: var(--navy);
  color-scheme: light;
}
.pita + .kebijakan { padding-top: 3.5rem; } /* ringkasannya harus terlihat di layar pertama */
.kebijakan-en { background: var(--gelap); color: var(--krem); color-scheme: dark; }
.ringkasan { grid-column: 1 / 6; align-self: start; position: sticky; top: 2rem; }
.ringkasan h2 { font-size: var(--ukuran-judul); }
.ringkasan p { max-width: 30ch; margin-top: 1.25rem; font-size: var(--ukuran-sub); line-height: 1.35; }
.ringkasan nav { display: flex; flex-direction: column; align-items: start; margin-top: 1.5rem; }
.ringkasan nav a { display: inline-flex; align-items: center; min-height: 44px; }
.pasal { grid-column: 7 / 13; max-width: 40rem; }
.pasal h2 { margin: 2.75rem 0 0.75rem; font-size: var(--ukuran-sub); line-height: 1.2; }
.pasal h2:first-child { margin-top: 0; }
.pasal p + p { margin-top: 1rem; }
.pasal ul { padding-left: 1.25rem; }
.pasal li + li { margin-top: 0.75rem; }

.hilang {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  min-height: 100svh;
  padding: var(--tepi);
}
.hilang h1 { margin-top: 2rem; }
.hilang .pengantar { margin-bottom: 2rem; }

/* Tablet */
@media (max-width: 1100px) {
  .langkah-nonton, .langkah-pilih { grid-template-columns: minmax(0, 1fr); }
  .langkah-nonton img, .langkah-nonton figcaption, .langkah-pilih img, .langkah-pilih figcaption { grid-column: 1; }
  .langkah-pilih img { width: 80%; }
  .pemain ul { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pemain li { grid-column: span 2; }
  .pemain li:nth-child(n + 4) { grid-column: span 3; }
  .pemain li:nth-child(n + 4) img { aspect-ratio: 4 / 3; object-fit: cover; object-position: center 25%; }
  .aplikasi > h2 { font-size: var(--ukuran-judul); }
  .penutup { min-height: 0; gap: 4rem; }
}

/* Tablet berdiri: judul di atas, kepala Belang mengisi layar */
@media (min-width: 701px) and (max-width: 1100px) and (orientation: portrait) {
  .pembuka { display: flex; flex-direction: column; min-height: 0; }
  .pembuka-teks { align-self: stretch; padding-block: 2rem 2.5rem; }
  .pembuka h1 { font-size: 8.4vw; }
  .gelembung { width: 88vw; max-width: none; align-self: center; margin-bottom: -7vw; }
}

/* Ponsel: komposisi sendiri */
@media (max-width: 700px) {
  .merek img { width: 2.125rem; }
  .kepala { padding-block: max(0.75rem, env(safe-area-inset-top)) 0.75rem; column-gap: 0.5rem; }
  .merek { gap: 0.375rem; font-size: 1rem; }
  .kepala nav { gap: 0.75rem; }
  .kepala nav a { font-size: 1rem; }
  .pita { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pembuka { display: flex; flex-direction: column; min-height: 0; }
  .pembuka-teks { align-self: stretch; padding-block: 1.75rem 2rem; }
  .pembuka h1 { font-size: min(2.75rem, 11.4vw); }
  .pengantar { margin-top: 1.25rem; }
  .aksi { margin-top: 1.5rem; gap: 0.5rem 1.25rem; }
  .gelembung { width: 112vw; max-width: none; align-self: center; margin-bottom: -9vw; }

  .pilihan fieldset { flex-direction: column; }
  .jalan-gambar { height: 34svh; min-height: 13rem; }
  .jalan-a img { object-position: 30% 62%; }
  .jalan-b img { object-position: 60% 60%; }

  .alur, .aplikasi, .kebijakan { display: block; }
  .langkah { display: block; margin-top: 3rem; }
  .langkah figcaption { margin-top: 0.875rem; }
  .langkah-pilih { padding-left: 14%; }
  .langkah-pilih img { width: 100%; }
  .langkah-lanjut { padding-right: 6%; }

  .pemain ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 0.5rem; }
  .pemain li, .pemain li:nth-child(n + 4) { grid-column: auto; }
  .pemain li:nth-child(n + 4) img { aspect-ratio: 4 / 5; }
  .pemain li:last-child { grid-column: 1 / -1; }
  .pemain li:last-child img { aspect-ratio: 4 / 3; }

  .aplikasi > h2, .ringkasan { position: static; }
  .fungsi { margin-top: 2rem; }
  .english { margin-inline: calc(var(--tepi) * -1); padding-inline: var(--tepi); }
  .pasal { margin-top: 3rem; }

  .dokumen h1 { font-size: min(2.75rem, 11.4vw); }
  .dokumen-judul { flex-direction: column-reverse; align-items: start; padding-bottom: 2.5rem; }
}

/* Gerak: pembuka terbuka sekali, lalu isi tiap bab masuk saat digulir.
   Frame pertama semua gerak harus tetap terbaca, karena tab latar dan hemat daya bisa membekukannya di sana.
   Maka tidak ada gerak yang memulai isi dari opasitas nol atau dari balik topeng. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .baris > span { animation: naik 900ms var(--keluar) both; }
  .baris + .baris > span { animation-delay: 110ms; }
  .pengantar { animation: masuk 700ms var(--keluar) 280ms both; }
  .aksi { animation: masuk 700ms var(--keluar) 380ms both; }
  .gelembung { animation: buka 1100ms var(--keluar) both; }
  .gelembung-isi img { animation: rebah 4500ms var(--keluar) both; }
  .dokumen-tanda { animation: masuk 800ms var(--keluar) both; }

  @supports (animation-timeline: view()) {
    .pilihan h2, .alur h2, .langkah img, .langkah figcaption, .pemain h2, .pemain li, .catatan,
    .fungsi > *, .penutup h2, .surel, .ringkasan > *, .pasal > * {
      animation: geser linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 85%;
    }
    .langkah figcaption, .pemain li p { animation-range: entry 10% entry 100%; }
    .jalan-gambar img {
      animation: dekati linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@keyframes naik { from { transform: translateY(0.28em); } }
@keyframes masuk { from { transform: translateY(24px); } }
@keyframes geser { from { transform: translateY(28px); } }
@keyframes buka { from { clip-path: inset(0 0 0 8%); } to { clip-path: inset(0); } }
@keyframes rebah { from { transform: scale(1.12); } }
@keyframes dekati { to { transform: scale(1.09); } }
