/* --- 1. RESET & BODY --- */
link[rel="icon"] { border-radius: 10px; }
body {
  margin: 0; padding: 0; height: 100vh; width: 100vw;
  display: flex; justify-content: center; align-items: center;
  overflow: hidden; background-color: #000; font-family: "Arial Black", sans-serif;
}
#bg-video {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100vw; height: 100vh; z-index: -1; object-fit: cover; filter: brightness(0.6);
}

/* --- 2. MENU UTAMA --- */
.p3r-menu { z-index: 10; transition: opacity 0.3s ease; }
.p3r-menu ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; transform: rotate(-10deg); }
.p3r-menu li {
  background: rgba(255, 255, 255, 0.95); margin: 8px 0; padding: 12px 0; width: 320px;
  text-align: center; transform: skew(-25deg); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer; border-left: 8px solid #00aaff; box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.3);
}
.p3r-menu li span { display: block; font-size: 1.4rem; color: #000; text-transform: uppercase; letter-spacing: 2px; transform: skew(25deg); }
.p3r-menu li:hover { background: #00aaff; width: 360px; transform: skew(-25deg) scale(1.05); }
.p3r-menu li:hover span { color: #fff; }

/* --- 3. OVERLAY & DYNAMIC PANELS --- */
.p3r-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: transparent; 
  z-index: 100; overflow: hidden;
}

.p3r-card {
  position: absolute; background: #fff;
  box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.5s ease;
  opacity: 0; display: flex; flex-direction: column; pointer-events: auto;
}
.p3r-card.show { opacity: 1; }

.card-content {
  transform: skew(15deg); color: #000; box-sizing: border-box;
  display: flex; flex-direction: column; height: 100%;
}
.card-content p { color: #000; font-weight: bold; }
.title { 
  background: #000; color: #fff; padding: 5px 15px; display: inline-block; 
  font-size: 1.3rem; margin-bottom: 20px; font-weight: bold; text-transform: uppercase; 
  border-left: 5px solid #00aaff; align-self: flex-start;
}

.panel-top {
  top: 0; left: -10vw; width: 120vw; height: 25vh;
  border-bottom: 10px solid #00aaff;
  transform: skew(-15deg) translateY(-150%);
}
.panel-top.show { transform: skew(-15deg) translateY(0); }
.panel-top .card-content { padding: 3vh 15vw; justify-content: center; }

.panel-left {
  top: 0; left: -15vw; width: 45vw; height: 100vh;
  border-right: 10px solid #00aaff;
  transform: skew(-15deg) translateX(-150%);
}
.panel-left.show { transform: skew(-15deg) translateX(0); }
.panel-left .card-content { padding: 40px 40px 40px 18vw; }

.panel-bottom-stats {
  bottom: 0; left: -10vw; width: 120vw; min-height: 40vh;
  border-top: 10px solid #00aaff;
  transform: skew(-15deg) translateY(150%);
}
.panel-bottom-stats.show { transform: skew(-15deg) translateY(0); }
.panel-bottom-stats .card-content { padding: 40px 15vw; justify-content: center; }

.panel-bottom {
  bottom: 0; left: -10vw; width: 120vw; min-height: 20vh;
  border-top: 10px solid #00aaff;
  transform: skew(-15deg) translateY(150%);
}
.panel-bottom.show { transform: skew(-15deg) translateY(0); }
.panel-bottom .card-content { 
  padding: 20px 15vw; align-items: center; justify-content: center; 
  flex-direction: row; gap: 40px; 
}
.panel-bottom .title { margin-bottom: 0; align-self: center; }
.panel-bottom .contact-list { display: flex; flex-direction: row-reverse; gap: 15px; flex-wrap: wrap; justify-content: center; }

button.back-btn { 
  background: transparent; color: #00aaff; border: none; 
  cursor: pointer; transition: 0.3s; 
  display: flex; justify-content: center; align-items: center; 
  font-size: 3rem; 
  align-self: flex-start; padding: 0; margin: 0;
}
button.back-btn:hover { color: #fff; transform: scale(1.15); text-shadow: 0 0 10px #00aaff; }

/* --- 4. HEADPHONE & GALLERY BUTTON --- */
.headphone-toggle {
  position: fixed; bottom: 25px; right: 25px;
  z-index: 200; background: #fff; color: #000; width: 55px; height: 55px; border-radius: 50%;
  display: flex; justify-content: center; align-items: center; cursor: pointer;
  box-shadow: 4px 4px 0px #00aaff; transition: 0.5s; font-size: 1.8rem;
}
.headphone-toggle.rotating { transform: rotate(360deg); background: #00aaff; color: #fff; }

.gallery-toggle {
  position: fixed; bottom: 95px; right: 25px; /* Posisinya pas di atas headphone */
  z-index: 200; background: #fff; color: #000; width: 55px; height: 55px; border-radius: 50%;
  display: flex; justify-content: center; align-items: center; cursor: pointer;
  box-shadow: 4px 4px 0px #8d6e63; transition: 0.5s; font-size: 1.5rem;
}
.gallery-toggle:hover {
  background: #8d6e63; color: #fff; transform: scale(1.1); box-shadow: 4px 4px 0px #fff;
}

/* --- MUSIC PANEL --- */
.music-panel {
  position: fixed; top: 0; right: -15vw; z-index: 300; background: #fff; 
  width: 40vw; height: 100vh; transform-origin: top right;
  transform: skew(-15deg) translateX(150%); border-left: 10px solid #00aaff;
  box-shadow: -10px 0px 30px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.35, 1); pointer-events: none;
}
.music-panel.active { transform: skew(-15deg) translateX(0%); pointer-events: auto; }

.music-panel-content {
  transform-origin: top right; transform: skew(15deg); 
  display: flex; flex-direction: column; height: 100%; padding: 40px 18vw 40px 40px; 
}

#song-title { font-size: 1.3rem; font-weight: bold; color: #000; text-align: center; margin-bottom: 25px; text-transform: uppercase; }

.song-list { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 15px; }
.song-list::-webkit-scrollbar { width: 5px; }
.song-list::-webkit-scrollbar-thumb { background: #00aaff; border-radius: 10px; }

.song-item {
  background: #000; color: #fff; padding: 15px; font-size: 0.85rem; cursor: pointer;
  border-left: 5px solid transparent; transition: all 0.3s ease; font-weight: bold; text-transform: uppercase;
}
.song-item:hover { background: #00aaff; color: #fff; transform: translateX(8px); border-left-color: #fff; }
.song-item.playing { background: #333; color: #fff; border-left: 5px solid #00aaff; box-shadow: 4px 4px 0 #00aaff; transform: scale(1.02); }

.player-bottom-area { margin-top: auto; padding-top: 20px; border-top: 2px solid #ddd; margin-bottom: 30px; }
.player-controls { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 15px; }
.player-controls button {
  background: #000; color: #fff; border: 2px solid #000; width: 45px; height: 45px; border-radius: 50%;
  display: flex; justify-content: center; align-items: center; font-size: 1.1rem; cursor: pointer; transition: 0.3s;
}
.player-controls button:hover { background: #00aaff; color: #fff; border-color: #00aaff; transform: scale(1.15); box-shadow: 0 5px 15px rgba(0, 170, 255, 0.4); }

.seek-bar { width: 100%; height: 6px; cursor: pointer; background: #ddd; appearance: none; outline: none; margin: 10px 0 5px 0; border-radius: 5px; }
.seek-bar::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; background: #00aaff; border-radius: 50%; cursor: pointer; }
.time-info { font-size: 0.8rem; color: #000; font-weight: bold; text-align: right; }

/* --- 5. STATS & PROJECTS --- */
.stat-bar { margin-bottom: 12px; width: 100%; }
.stat-label { display: flex; justify-content: space-between; font-weight: bold; font-size: 0.8rem; color: #000; }
.stat-bar .bar { background: #eee; height: 14px; width: 100%; border: 1px solid #000; position: relative; }
.stat-bar .fill { background: #00aaff; height: 100%; width: 0; transition: width 1s; }
.stat-bar .fill.blue { background: #0055ff; }

.project-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 10px; width: 100%; }
.project-list::-webkit-scrollbar { width: 4px; }
.project-list::-webkit-scrollbar-thumb { background: #00aaff; }
.project-item { background: #000; border: 2px solid #00aaff; padding: 10px; transition: 0.3s; cursor: pointer; width: 100%; box-sizing: border-box; }
.project-item:hover { background: #00aaff; color: #fff; transform: translateX(10px); }
.project-item h3 { margin: 0; font-size: 1rem; color: #fff; transition: 0.3s; }
.project-item p { margin: 5px 0 0 0; font-size: 0.75rem; color: #ddd; }

/* --- 6. CONTACT DESIGN --- */
.contact-item {
  background: #000; border: 2px solid #00aaff; padding: 12px 15px; display: flex; align-items: center; gap: 15px;
  transition: 0.3s; text-decoration: none; color: #fff; transform: skew(-5deg);
}
.contact-item:hover { background: #00aaff; color: #fff; transform: translateX(-15px) skew(-5deg); }
.contact-icon { font-size: 1.1rem; font-weight: bold; background: #fff; padding: 3px 10px; color: #000; min-width: 30px; text-align: center; transition: 0.3s;}
.contact-item:hover .contact-icon { background: #000; color: #fff; }

/* --- 7. READER ONLINE --- */
.p3r-overlay-center {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.85); z-index: 1000; justify-content: center; align-items: center;
}
.reader-container {
  width: 90vw; height: 90vh; background: #000; border: 4px solid #fff; display: flex; flex-direction: column; box-shadow: 0 0 50px rgba(0, 170, 255, 0.5);
}
.reader-header {
  background: #00aaff; color: #fff; padding: 15px 25px; display: flex; justify-content: space-between; align-items: center; font-family: 'Arial Black', sans-serif; border-bottom: 4px solid #fff;
}
.reader-close { background: #000; color: #fff; border: 2px solid #fff; padding: 5px 15px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.reader-close:hover { background: #fff; color: #000; }
.iframe-wrapper { flex-grow: 1; background: #fff; position: relative; }
#novel-iframe { width: 100%; height: 100%; border: none; }

/* --- 9. ART GALLERY & 3D BOOK (UPDATED) --- */
/* My Art */
.book-scene {
  width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center;
  perspective: 2000px;
}
.book {
  /* Diubah jadi lebih gede dan proporsional ala buku beneran */
  width: 75vw; max-width: 950px; height: 85vh;
  position: relative; transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.25, 1, 0.35, 1);
  cursor: pointer;
}
.book.is-open { transform: translateX(15vw); cursor: default; }

.book-cover {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  transform-style: preserve-3d; transform-origin: left center;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.35, 1);
  z-index: 3;
}
.book.is-open .book-cover { transform: rotateY(-160deg); pointer-events: none; }

.cover-front, .cover-back {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  backface-visibility: hidden;
  border-radius: 5px 20px 20px 5px;
}
.cover-front {
  background: #4e342e; border: 8px solid #271410;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  color: #d7ccc8;
  box-shadow: inset 10px 0 30px rgba(0,0,0,0.5), 15px 15px 40px rgba(0,0,0,0.8);
}
.cover-back {
  background: #3e2723; border: 8px solid #271410;
  transform: rotateY(180deg);
  box-shadow: inset -10px 0 30px rgba(0,0,0,0.5);
}

.book-page {
  position: absolute; top: 2%; left: 0; width: 98%; height: 96%;
  background: #f4ecd8; border-radius: 2px 15px 15px 2px;
  box-shadow: inset -5px 0 20px rgba(0,0,0,0.1), 10px 10px 20px rgba(0,0,0,0.4);
  z-index: 1; padding: 30px; box-sizing: border-box; overflow-y: auto; overflow-x: hidden;
}
.book-page::-webkit-scrollbar { width: 8px; }
.book-page::-webkit-scrollbar-thumb { background: #3e2723; border-radius: 10px; }

/* Bookmark Close Button */
.bookmark-close {
  position: absolute; top: -5px; left: 20px;
  width: 40px; height: 60px; background: #c62828; color: #fff;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer; z-index: 10;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  box-shadow: 2px 2px 10px rgba(0,0,0,0.4);
  transition: transform 0.3s ease; padding-bottom: 10px; font-size: 1.2rem;
}
.bookmark-close:hover {
  transform: translateY(-5px); background: #e53935;
}

.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px; padding-top: 15px;
}
.gallery-grid img {
  width: 100%; height: 200px; object-fit: cover;
  border: 4px solid #fff; box-shadow: 4px 4px 12px rgba(0,0,0,0.3);
  transition: 0.3s ease; cursor: pointer;
}
.gallery-grid img:hover { transform: scale(1.05); border-color: #00aaff; }

/* --- 8. MOBILE RESPONSIVE --- */
@media (max-width: 600px) {
  .music-panel { width: 90vw; right: -20vw; }
  .music-panel-content { padding: 40px 25vw 40px 20px; }
  
  .panel-left { width: 95vw; left: -20vw; }
  .panel-left .card-content { padding: 40px 20px 40px 25vw; }
  
  .panel-bottom-stats { height: auto; min-height: 45vh; }
  .panel-bottom-stats .card-content { padding: 30px 15vw; }
  
  .panel-top { height: auto; min-height: 35vh; }
  .panel-bottom { height: auto; min-height: 30vh; }
  .panel-bottom .card-content { flex-direction: column; gap: 15px; }
  .panel-bottom .contact-list { flex-direction: column; }
  
  /* Gallery Mobile adjustments */
  .book { width: 90vw; height: 80vh; }
  .book.is-open { transform: translateX(0); }
  /* Biar cover gak ngehalangin di layar hp yang sempit pas dibuka */
  .book.is-open .book-cover { transform: rotateY(-180deg); opacity: 0; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}