/* ==========================================================================
   MEMOAR DIGITAL — STYLE SHEET
   Kertas putih bergaris (notes), font Arial, palet warna abu-abu gelap
   ========================================================================== */

:root {
  --bg-desk: #E5E7EB;
  --paper-bg: #FFFFFF;
  --paper-soft: #F3F4F6;
  --paper-line: rgba(55, 65, 81, 0.1);
  --margin-line: rgba(55, 65, 81, 0.24);
  --ink-primary: #1F2937;
  --ink-secondary: #4B5563;
  --ink-muted: #6B7280;
  --accent-dark: #374151;
  --accent-dark-hover: #1F2937;
  --accent-soft: rgba(55, 65, 81, 0.07);
  --border-subtle: #D1D5DB;
  --shadow-book:
    0 2px 6px rgba(17, 24, 39, 0.06),
    0 20px 50px rgba(17, 24, 39, 0.12),
    inset 12px 0 24px -14px rgba(17, 24, 39, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-desk);
  color: var(--ink-primary);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.locked {
  overflow: hidden;
  height: 100dvh;
}

/* ==========================================================================
   1. PROGRESS BAR & TOP FLOATING NAV
   ========================================================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent-dark);
  z-index: 1200;
  transition: width 0.15s ease-out;
}

.top-nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 24px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

body:not(.locked) .top-nav {
  opacity: 1;
}

.nav-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 8px 15px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-pill:hover {
  transform: translateY(-1px);
  background: #FFFFFF;
}

.nav-pill svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.active-chapter-badge {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
}

/* Drawer Daftar Bab */
.toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.toc-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.toc-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--paper-bg);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 12px 0 36px rgba(17, 24, 39, 0.16);
  z-index: 1100;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.toc-drawer.open {
  transform: translateX(0);
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.toc-header h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
  background: var(--paper-soft);
  color: var(--ink-primary);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.toc-link {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-primary);
  transition: background-color 0.2s ease;
}

.toc-link:hover,
.toc-link.active {
  background: var(--accent-soft);
}

.toc-link-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.toc-link-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

/* ==========================================================================
   2. COVER GATE (AMPLOP SURAT & GERBANG KODE AKSES)
   ========================================================================== */

.cover-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: var(--bg-desk);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 132px;
  overflow-y: auto;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.55s ease;
}

.cover-gate.unlocked {
  opacity: 0;
  transform: translateY(-24px);
  visibility: hidden;
  pointer-events: none;
}

.envelope-stage {
  width: min(490px, 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

/* Amplop Surat Realistis Tanpa Inisial */
.envelope-box {
  width: 100%;
  aspect-ratio: 500 / 330;
  min-height: 300px;
  position: relative;
  border-radius: 10px;
  box-shadow: 0 24px 54px rgba(17, 24, 39, 0.2);
  background: #F3F4F6;
  overflow: hidden;
  border: 1px solid #C9CED6;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: #E5E7EB;
  z-index: 1;
}

/* Kertas surat di dalam amplop */
.envelope-letter-preview {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 24px;
  bottom: 16px;
  background-color: #FFFFFF;
  background-image: linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 28px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  z-index: 2;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Lipatan samping kiri & kanan amplop */
.envelope-side-left {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #F3F4F6;
  clip-path: polygon(0 0, 50% 52%, 0 100%);
}

.envelope-side-right {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #ECEEF2;
  clip-path: polygon(100% 0, 50% 52%, 100% 100%);
}

/* Lipatan bawah amplop */
.envelope-bottom-flap {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
  clip-path: polygon(0 100%, 50% 45%, 100% 100%);
  filter: drop-shadow(0 -2px 6px rgba(17, 24, 39, 0.08));
}

/* Tutup segitiga atas amplop */
.envelope-top-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 59%;
  z-index: 5;
  background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F6 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 5px 10px rgba(17, 24, 39, 0.14));
}

.envelope-creases {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* Tombol Buka tepat di ujung segel tutup amplop */
.envelope-flap-action {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.envelope-address {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 6;
  text-align: center;
  transition: opacity 0.25s ease;
}

.cover-title {
  font-size: clamp(1.05rem, 2.5vw, 1.32rem);
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.35;
  margin: 0 auto;
}

.open-envelope-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  background-color: var(--accent-dark);
  color: #FFFFFF;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 10px 24px;
  border: 2px solid #FFFFFF;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.24);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.open-envelope-btn:hover {
  background-color: var(--accent-dark-hover);
  transform: translateY(-2px);
}

/* Animasi saat amplop dibuka */
.envelope-stage.opening .envelope-top-flap {
  transform: rotateX(180deg);
}

.envelope-stage.opening .envelope-letter-preview {
  transform: translateY(-48px);
}

.envelope-stage.opening .envelope-flap-action,
.envelope-stage.opening .envelope-address {
  opacity: 0;
}

.envelope-stage.show-code .envelope-box {
  display: none;
}

/* Kartu Input Kode Akses (tampil setelah amplop terbuka) */
.cover-book-card {
  width: 100%;
  background-color: var(--paper-bg);
  background-image: linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 32px;
  border-radius: 6px 12px 12px 6px;
  box-shadow: var(--shadow-book);
  border: 1px solid var(--border-subtle);
  padding: 48px 40px 44px 60px;
  text-align: center;
  position: relative;
}

.cover-book-card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 36px;
  width: 1px;
  background-color: var(--margin-line);
  pointer-events: none;
}

.code-card {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.envelope-stage.show-code .code-card {
  display: block;
}

.envelope-stage.code-visible .code-card {
  opacity: 1;
  transform: translateY(0);
}

.code-card-title {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.38;
  margin-bottom: 24px;
}

/* Access Code Form */
.unlock-form {
  max-width: 310px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.code-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-secondary);
}

.code-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.code-input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border-radius: 8px;
  border: 1.5px solid #9CA3AF;
  background: #FFFFFF;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  letter-spacing: 3px;
  text-align: center;
  color: var(--ink-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.code-input::placeholder {
  letter-spacing: 0.2px;
  font-size: 13.5px;
  color: #9CA3AF;
}

.code-input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.14);
}

.toggle-code-visibility {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--ink-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.toggle-code-visibility:hover {
  color: var(--ink-primary);
}

.open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background-color: var(--accent-dark);
  color: #FFFFFF;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.open-btn:hover {
  background-color: var(--accent-dark-hover);
  transform: translateY(-1px);
}

.code-feedback {
  min-height: 18px;
  font-size: 12.5px;
  color: #374151;
  font-weight: 700;
}

.hint-wrap {
  display: none;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.hint-wrap.enabled {
  display: flex;
}

.hint-btn {
  background: none;
  border: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.hint-btn:hover {
  color: var(--ink-secondary);
}

.hint-text {
  font-size: 12px;
  color: var(--ink-secondary);
  background: var(--paper-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 12px;
  display: none;
}

.hint-text.visible {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.36s ease;
}

/* ==========================================================================
   3. HALAMAN TERPISAH SEPERTI PDF (MARGIN LUAS & RATA KANAN-KIRI)
   ========================================================================== */

.notebook-wrapper {
  max-width: 840px;
  margin: 72px auto 145px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 0 16px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

body:not(.locked) .notebook-wrapper {
  opacity: 1;
  transform: translateY(0);
}

/* Tiap Halaman Terpisah dengan Margin Setara PDF */
.paper-sheet {
  background-color: var(--paper-bg);
  background-image: linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 32px;
  box-shadow: var(--shadow-book);
  border: 1px solid var(--border-subtle);
  border-radius: 6px 12px 12px 6px;
  position: relative;
  overflow: hidden;
  padding: 72px 86px 72px 96px;
}

/* Garis Margin Vertikal Abu-Abu Gelap Khas Notes Buku */
.paper-sheet::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 62px;
  width: 1px;
  background-color: var(--margin-line);
  pointer-events: none;
}

.book-opening-header {
  padding: 0 0 34px;
  margin-bottom: 34px;
  text-align: center;
  border-bottom: 1px dashed var(--border-subtle);
}

.book-opening-label {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-secondary);
  margin-bottom: 4px;
  display: block;
}

.book-opening-meta {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.book-opening-title {
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1.32;
  color: var(--ink-primary);
  margin-bottom: 10px;
}

.book-opening-subtitle {
  font-style: italic;
  color: var(--ink-secondary);
  font-size: 14.5px;
  max-width: 520px;
  margin: 0 auto;
}

.chapter-section {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.chapter-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.chapter-header {
  text-align: center;
  margin-bottom: 28px;
}

.chapter-number {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 4px;
}

.chapter-title {
  font-size: clamp(1.25rem, 2.8vw, 1.55rem);
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.3;
}

.chapter-epigraph {
  margin: 0 0 26px;
  padding: 16px 20px;
  background: var(--paper-soft);
  border-left: 3px solid var(--accent-dark);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-secondary);
  text-align: justify;
}

/* Highlight Quote Note */
.quote-note {
  margin: 28px 0;
  padding: 16px 22px;
  border-left: 3px solid var(--accent-dark);
  background-color: rgba(55, 65, 81, 0.05);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--ink-secondary);
  font-size: 15.5px;
  text-align: justify;
}

.story-text {
  font-size: 16px;
  color: var(--ink-primary);
  margin-bottom: 20px;
  text-align: justify;
}

.story-text:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   4. GALERI HYBRID (FOTO PER BAB + GALERI GLOBAL)
   ========================================================================== */

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin: 34px 0 8px;
  align-items: start;
}

.photo-gallery.has-single {
  display: flex;
  justify-content: center;
}

.photo-gallery:empty {
  display: none;
}

.polaroid {
  background: #FFFFFF;
  padding: 10px 10px 16px;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.09);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  width: 100%;
  position: relative;
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.polaroid.single-wide {
  width: 100%;
  max-width: 460px;
}

.polaroid:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.14);
}

.polaroid-media {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--paper-soft);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.polaroid.single-wide .polaroid-media {
  height: 270px;
}

.polaroid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.polaroid-placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  color: var(--ink-muted);
  gap: 8px;
}

.polaroid.is-placeholder {
  cursor: default;
}

.polaroid.is-placeholder img {
  display: none;
}

.polaroid.is-placeholder .polaroid-placeholder {
  display: flex;
}

.polaroid-placeholder svg {
  width: 26px;
  height: 26px;
  opacity: 0.6;
}

.polaroid-placeholder .placeholder-path {
  font-size: 11px;
  background: #E5E7EB;
  color: var(--accent-dark);
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-all;
}

.polaroid-caption {
  font-size: 13.5px;
  color: var(--ink-secondary);
  text-align: center;
  margin-top: 10px;
  line-height: 1.45;
}

.polaroid-caption:empty {
  display: none;
}

/* Galeri Global Grid */
.closing-gallery-section.is-empty {
  display: none;
}

.closing-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  align-items: start;
}

.closing-gallery-grid .polaroid {
  width: 100%;
  content-visibility: auto;
  contain-intrinsic-size: 260px;
}

/* Tanda Tangan Penutup */
.signature-block {
  margin-top: 40px;
  text-align: right;
  font-size: 15.5px;
  color: var(--ink-primary);
}

.signature-block p {
  margin-bottom: 4px;
}

.signature-name {
  margin-top: 18px;
  font-weight: 700;
}

/* ==========================================================================
   5. PEMUTAR MUSIK ALA SPOTIFY DI KANAN BAWAH + VOLUME + PLAYLIST
   ========================================================================== */

.music-dock {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(356px, calc(100vw - 28px));
}

.playlist-panel {
  width: 100%;
  background: #1F2937;
  color: #F9FAFB;
  border: 1px solid #374151;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  padding: 14px;
  display: none;
  max-height: 52vh;
  overflow-y: auto;
}

.playlist-panel.open {
  display: block;
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #374151;
}

.playlist-header-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #D1D5DB;
}

.icon-btn-dark {
  color: #9CA3AF;
}

.icon-btn-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.playlist-fallback-badge {
  display: none;
  font-size: 11.5px;
  color: #E5E7EB;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid #4B5563;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.playlist-fallback-badge.visible {
  display: block;
}

.playlist-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.playlist-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background-color 0.18s ease;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.playlist-item.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.playlist-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.playlist-item.active .playlist-item-title::before {
  content: '▶ ';
  font-size: 11px;
  color: #D1D5DB;
}

.playlist-item-artist {
  font-size: 12px;
  color: #9CA3AF;
}

.playlist-item-note {
  font-size: 12px;
  font-style: italic;
  color: #D1D5DB;
  line-height: 1.4;
  margin-top: 2px;
}

/* Compact Floating Spotify Card (Kanan Bawah) */
.spotify-mini-card {
  width: 100%;
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 12px;
  color: #F9FAFB;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.sp-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spotify-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.spotify-cover {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #27272A;
  border: 1px solid #3F3F46;
  color: #D4D4D8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spotify-mini-card.playing .spotify-cover {
  background: #374151;
  color: #FFFFFF;
}

.spotify-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
}

.spotify-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.spotify-artist {
  font-size: 11px;
  color: #A1A1AA;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.spotify-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sp-btn {
  background: transparent;
  border: none;
  color: #A1A1AA;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
}

.sp-btn:hover {
  color: #FFFFFF;
  transform: scale(1.06);
}

.sp-btn.active {
  color: #FFFFFF;
}

.sp-btn svg {
  width: 15px;
  height: 15px;
}

.sp-btn-sm {
  width: 24px;
  height: 24px;
}

.sp-btn-sm svg {
  width: 14px;
  height: 14px;
}

.sp-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #FFFFFF;
  color: #18181B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.sp-play-btn:hover {
  transform: scale(1.07);
  background: #F4F4F5;
}

.sp-play-btn svg {
  width: 15px;
  height: 15px;
}

.sp-play-btn .icon-pause {
  display: none;
}

.spotify-mini-card.playing .sp-play-btn .icon-play {
  display: none;
}

.spotify-mini-card.playing .sp-play-btn .icon-pause {
  display: block;
}

.sp-mini-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spotify-progress-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.sp-time {
  font-size: 10.5px;
  color: #A1A1AA;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: center;
}

.sp-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #FFFFFF 0%,
    #FFFFFF var(--slider-progress, 0%),
    #4B5563 var(--slider-progress, 0%),
    #4B5563 100%
  );
  outline: none;
  cursor: pointer;
}

.sp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.sp-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.sp-seek {
  flex: 1;
  min-width: 60px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sp-volume {
  width: 58px;
}

.volume-control .icon-vol-muted {
  display: none;
}

.volume-control.muted .icon-vol-on {
  display: none;
}

.volume-control.muted .icon-vol-muted {
  display: block;
}

/* ==========================================================================
   6. LIGHTBOX MODAL GALERI
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: min(680px, 100%);
  width: 100%;
  background: #FFFFFF;
  padding: 14px 14px 18px;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.lightbox-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: var(--paper-soft);
  border-radius: 4px;
  display: block;
}

.lightbox-caption {
  font-size: 14.5px;
  color: var(--ink-secondary);
  margin-top: 12px;
  line-height: 1.45;
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-nav.prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* ==========================================================================
   7. RESPONSIF LAYAR KECIL (HP)
   ========================================================================== */

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .cover-gate {
    padding: 16px 16px 136px;
  }

  .cover-book-card {
    padding: 36px 24px 32px 42px;
  }

  .cover-book-card::before {
    left: 22px;
  }

  .notebook-wrapper {
    margin: 66px auto 150px;
    padding: 0 10px;
    gap: 22px;
  }

  .paper-sheet {
    padding: 44px 26px 44px 44px;
  }

  .paper-sheet::before {
    left: 24px;
  }

  .book-opening-header {
    padding: 0 0 28px;
    margin-bottom: 28px;
  }

  .story-text {
    font-size: 15px;
  }

  .polaroid {
    width: 100%;
    max-width: 320px;
  }

  .active-chapter-badge {
    display: none;
  }

  .music-dock {
    bottom: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .sp-volume {
    width: 50px;
  }

  .lightbox-nav.prev {
    left: 10px;
  }

  .lightbox-nav.next {
    right: 10px;
  }
}