@import url("https://fonts.googleapis.com/css2?family=Poppins:wght=300;400;500;600;700;800;900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style: none;
  border: none;
  outline: none;
  font-family: "Poppins", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --nav-bg-color: rgba(23, 31, 43, 0.85);
  --bg-color: #171f2b;
  --second-bg-color: #1f2733;
  --third-bg-color: #2d3542;
  --main-color: #ffcc00; 
  --white-color: #fff;
  --tab-list-color: #7c8594;
}

::selection {
  background: var(--main-color);
  color: var(--bg-color);
}

::-webkit-scrollbar {
  width: 0.6rem;
  height: 0.6rem;
}

::-webkit-scrollbar-track {
  background: var(--second-bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--main-color);
  border-radius: 1rem;
}

::placeholder {
  color: var(--white-color);
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
}

body {
  color: var(--white-color);
  background: var(--bg-color);
  overflow: hidden; /* Mengunci bingkai utama agar tidak double scrollbar */
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

p {
  font-size: 1.6rem;
  line-height: 1.6;
}

/* === NAVBAR MENU DI TENGAH === */
.nav {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 42rem;
  padding: 1.5rem 0;
  background: var(--nav-bg-color);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5rem;
  z-index: 2147483600 !important; /* Ditinggikan agar menu navigasi selalu berada di atas efek kubus */
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.nav .nav-list {
  display: flex;
  justify-content: space-evenly;
}

.nav-list li {
  position: relative;
  display: flex;
  font-size: 2.6rem;
  cursor: pointer;
  transition: 0.3s;
  color: var(--tab-list-color);
}

.nav-list li:hover,
.nav-list li.active {
  color: var(--main-color);
  transform: translateY(-2px);
}

/* === TOOLTIP === */
.tooltip {
  position: absolute;
  top: -4.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 1.2rem;
  background: var(--main-color);
  border-radius: 0.4rem;
  font-size: 1.4rem;
  color: var(--bg-color);
  font-weight: 600;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: 0.3s;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.3);
}

.nav-list li:hover .tooltip,
.sci a:hover .tooltip {
  visibility: visible;
  opacity: 1;
  top: -4rem;
}

/* === 3D CONTAINER === */
.container {
  width: 100vw;
  height: 100vh;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  position: relative;
  z-index: 5;
}

.box {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: center center -50vw;
  transform: rotateY(0deg);
  transition: transform 1.5s cubic-bezier(0.65, 0, 0.35, 1);
  animation: animate-cube 2.5s ease-in-out backwards;
}

@keyframes animate-cube {
  0% { transform: scale(0) rotateY(-360deg); }
  100% { transform: scale(1) rotateY(0deg); }
}

/* === PERBAIKAN STRUKTUR SEKSYEN UNTUK ISOLASI KLIK === */
.section {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  padding: 8.5rem 10% 12rem; 
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  overflow-y: auto; 
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  
  /* KUNCI UTAMA: Matikan interaksi sentuh dan sembunyikan visibilitas halaman secara default */
  pointer-events: none !important;
  visibility: hidden !important;
  transition: visibility 0.4s ease, opacity 0.4s ease;
}

/* KETIKA SEKSYEN AKTIF: Berikan ruang kendali agar folder kasta jutaan tetap mendominasi di atasnya */
.section.active {
  pointer-events: auto !important;
  visibility: visible !important;
  z-index: 99 !important;
}

/* Penataan warna background dan koordinat transformasi asli tema Anda */
.section.home { background: var(--bg-color); }
.section.about { background: var(--second-bg-color); transform: translateX(50vw) translateZ(-50vw) rotateY(90deg); }
.section.resume { background: var(--bg-color); transform: translateZ(-100vw) rotateY(-180deg); transform-origin: 50%; }
.section.portfolio { background: var(--second-bg-color); transform: translateX(-50vw) translateZ(-50vw) rotateY(-90deg); }
.section.contact { background: var(--bg-color); }

/* GLOBAL BYPASS UNTUK KASTA LAYAR FOLDER TERKUNCI */
.folder-container {
  display: flex !important;
  z-index: 2147483640 !important;
  pointer-events: auto !important;
}
.folder-card {
  z-index: 2147483641 !important;
  pointer-events: auto !important;
}

/* === BERANDA & PROFIL === */
.home, .about {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6rem;
}

.home-info, .about-info {
  flex: 1;
}

.home-info h1 {
  font-size: 5rem;
  color: var(--main-color);
  line-height: 1.2;
  margin: 0.5rem 0;
}

.home-info h3 { 
  font-size: 2.8rem; 
  font-weight: 500; 
}

.desc { 
  margin: 2rem 0 3rem; 
  font-style: italic; 
  color: #e0e0e0; 
  text-align: center;   
  width: 100%;           
}

.quote-author {
  display: block;        
  text-align: center;    
  margin-top: 1rem;      
  font-size: 1.5rem;     
  color: var(--main-color); 
  font-weight: 600;      
  font-style: normal;    
}

.btn-sci {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 3.5rem;
  background: var(--main-color);
  border-radius: 5rem;
  box-shadow: 0 0 1.5rem rgba(255, 204, 0, 0.4);
  font-size: 1.6rem;
  color: var(--bg-color);
  font-weight: 600;
  transition: 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  box-shadow: 0 0 2.5rem rgba(255, 204, 0, 0.7);
  transform: translateY(-2px);
}

.sci {
  display: flex;
  gap: 1.2rem;
}

.sci a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border: 0.2rem solid var(--main-color);
  border-radius: 50%;
  font-size: 2.2rem;
  color: var(--main-color);
  transition: 0.3s ease;
  background: transparent;
}

.sci a:hover {
  background: var(--main-color);
  color: var(--bg-color);
  box-shadow: 0 0 1rem var(--main-color);
}

.img-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
}

.img-box {
  position: relative;
  width: 30vw;
  height: 30vw;
  max-width: 32rem;
  max-height: 32rem;
  min-width: 24rem;
  min-height: 24rem;
  background: linear-gradient(var(--bg-color), var(--main-color));
  border-radius: 50%;
  border: 0.5rem solid var(--main-color);
  box-shadow: 0 0 2rem rgba(255, 204, 0, 0.3);
  display: flex;
  justify-content: center;
  overflow: hidden;
  transition: 0.5s ease;
}

.img-box.home-img:hover {
  box-shadow: 0 0 5rem var(--main-color);
}

.img-box img {
  position: absolute;
  top: 2rem;
  width: 85%;
  height: 100%;
  object-fit: contain;
}

.img-box.about-img {
  background: transparent;
  box-shadow: 0 0 2rem var(--main-color), inset 0 0 1.5rem var(--main-color);
}

/* === SEKSI TAB-TAB & GRIDS === */
.title {
  font-size: 3.8rem;
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  color: var(--white-color);
}

.about-info .title { text-align: left; margin-top: 0; }
.about-info h3 { font-size: 2.4rem; color: var(--main-color); margin-bottom: 1rem; }

.tab-box {
  display: flex;
  width: 100%;
  height: 5rem;
  margin-bottom: 2.5rem;
  flex-shrink: 0;
}

.tab-list {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
  border-bottom: 0.3rem solid var(--tab-list-color);
  color: var(--tab-list-color);
  transition: 0.4s ease;
}

.tab-list.resume-list.active,
.tab-list.portfolio-list.active {
  border-color: var(--main-color);
  color: var(--main-color);
}

.resume-list:nth-child(2) { justify-content: center; }
.resume-list:nth-child(3) { justify-content: flex-end; }
.portfolio-list:nth-child(2) { justify-content: flex-end; }

.tab-list h3 { font-size: 2.2rem; font-weight: 600; }

.tab-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
}

.tab-grid {
  position: relative; 
  width: 100%;
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
  gap: 2.5rem;
  padding-bottom: 4rem; 
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-grid.active {
  display: grid;
  opacity: 1;
  transform: scale(1);
}

.tab-item {
  display: flex;
  flex-direction: column;
  background: var(--third-bg-color);
  border-radius: 1.2rem;
  padding: 2.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.2);
  height: max-content;
}

.tab-item h4 { font-size: 2rem; color: var(--white-color); margin-bottom: 0.5rem; }

.resume-item h4:nth-child(1) { color: var(--main-color); font-weight: 500; }
.resume-item h4:nth-child(3) {
  position: relative;
  margin-left: 2rem;
  font-size: 1.6rem;
  font-weight: 400;
}

.resume-item h4:nth-child(3)::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.8rem;
  height: 0.8rem;
  background: var(--main-color);
  border-radius: 50%;
}

/* === GALERI: NONG ROMARIO === */
.portfolio-box.work .portfolio-item {
  position: relative;
  height: 28rem; 
  overflow: hidden;
  border-radius: 1.2rem;
  padding: 0;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.2);
}

.portfolio-box.work .portfolio-item .work-img {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.portfolio-box.work .portfolio-item .work-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s ease;
}

.portfolio-box.work .portfolio-item:hover .work-img img {
  transform: scale(1.1) rotate(1deg);
}

.portfolio-box.work .portfolio-item .work-info {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, rgba(23, 31, 43, 0.95));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  z-index: 2;
  opacity: 0;
  transition: 0.3s ease;
}

.portfolio-box.work .portfolio-item:hover .work-info {
  opacity: 1;
}

.portfolio-box.work .portfolio-item .work-info h4 {
  font-size: 2rem;
  color: var(--white-color);
  margin-bottom: 0.5rem;
}

.portfolio-box.work .portfolio-item .work-info .tech-used p {
  color: var(--main-color);
  font-size: 1.4rem;
  font-weight: 500;
}

.portfolio-icon {
  margin-top: 1rem;
}

.portfolio-icon a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background: var(--main-color);
  color: var(--bg-color) !important;
  border-radius: 50%;
  font-size: 2rem;
  transition: 0.3s;
}

.portfolio-icon a:hover {
  background: var(--white-color);
  transform: scale(1.1);
}

/* === GALERI: ALBUM === */
.portfolio-box.service .portfolio-item {
  display: flex !important;
  flex-direction: column;
  background: var(--third-bg-color);
  border-radius: 1.2rem;
  padding: 1.5rem;
  width: 100%;
  min-height: 34rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.2);
}

.portfolio-box.service .portfolio-item .work-img {
  position: relative;
  width: 100%;
  height: 22rem;
  border-radius: 0.8rem;
  overflow: hidden;
}

.portfolio-box.service .portfolio-item .work-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s ease;
}

.portfolio-box.service .portfolio-item:hover .work-img img {
  transform: scale(1.05);
}

.portfolio-box.service .portfolio-item .work-info {
  position: relative;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0 0 0;
  opacity: 1;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.portfolio-box.service .portfolio-item .work-info h4 {
  font-size: 2rem;
  color: var(--white-color);
  margin-bottom: 0.5rem;
}

.portfolio-box.service .portfolio-item .work-info .tech-used p {
  color: var(--main-color);
  font-size: 1.4rem;
  font-weight: 500;
}

/* === HUBUNGI / RSVP === */
.contact-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1.5rem;
}

.contact-form {
  background: var(--second-bg-color);
  padding: 4rem 3rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 1rem 3rem rgba(0,0,0,0.3);
  text-align: center;
  max-width: 55rem;
  width: 100%;
}

.contact-form h3 {
  font-size: 2.6rem;
  color: var(--main-color);
  margin-bottom: 1.5rem;
}

/* === POPUP VIEWER MODAL === */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 22, 0.98);
  display: flex;
  flex-direction: column; 
  align-items: center;
  justify-content: center;
  z-index: 100000 !important;
  padding: 2rem;
  transition: opacity 0.3s ease;
}

.popup-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  max-width: 95%;
  max-height: 75vh;
}

.popup-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 0.8rem;
  border: 2px solid var(--main-color);
  box-shadow: 0 0 3rem rgba(255, 204, 0, 0.5);
  transition: all 0.3s ease;
}

.popup.expanded-mode .popup-img-container {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
}

.popup.expanded-mode .popup-img {
  max-height: 100vh;
  max-width: 100vw;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.popup-close {
  position: absolute;
  top: 2rem;
  right: 3rem;
  font-size: 4.5rem;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
  z-index: 100010;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.popup-fullscreen {
  position: absolute;
  top: 2.5rem;
  right: 8rem;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
  z-index: 100010;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.popup-close:hover,
.popup-fullscreen:hover { 
  color: var(--main-color); 
  transform: scale(1.1);
}

.hidden { display: none !important; }

#album-popup .album-nav {
  margin-top: 2.5rem;
  display: flex;
  gap: 3rem;
  z-index: 100005;
}

#album-popup .btn {
  padding: 1rem 3rem;
  box-shadow: 0 0 1.5rem rgba(255, 204, 0, 0.3);
}

/* =========================================
   === MEDIA QUERIES (OPTIMASI SEMUA DEVICE) ===
   ========================================= */

@media screen and (max-width: 992px) {
  html { font-size: 55%; }
  .section { padding: 8.5rem 5% 12rem; }
  .home, .about { gap: 4rem; }
}

/* Tablet & HP Landscape */
@media screen and (max-width: 768px) {
  /* KUNCI PERBAIKAN RESPONSIVE KUBUS */
  .box {
    transform-origin: center center -50vh;
  }
  
  /* Proteksi klik & visibilitas khusus perangkat HP agar sumbu Z tidak tumpang tindih */
  .section {
    pointer-events: none !important;
    visibility: hidden !important;
  }
  .section.active {
    pointer-events: auto !important;
    visibility: visible !important;
    z-index: 99 !important; /* Disesuaikan dengan kasta layar dasar */
  }

  .section.about { transform: translateX(50vw) translateZ(-50vh) rotateY(90deg); }
  .section.resume { transform: translateZ(-100vh) rotateY(-180deg); }
  .section.portfolio { transform: translateX(-50vw) translateZ(-50vh) rotateY(-90deg); }

  .nav { 
    width: 85%; 
    bottom: 2rem; 
  }
  
  .section {
    padding: 6rem 4% 14rem;
  }

  .title {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 3.2rem;
  }

  .home, .about { 
    flex-direction: column !important; 
    text-align: center; 
    justify-content: flex-start !important;
    gap: 4rem !important;
  }
  
  .home-info, .about-info {
    width: 100% !important;
    flex: none;
  }
  
  .about-info .title { 
    text-align: center !important; 
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  
  .btn-sci { 
    justify-content: center; 
    gap: 1.5rem;
  }
  
  .img-wrapper {
    margin-top: 1rem !important;
    width: 100% !important;
    flex: none;
  }

  .img-box { 
    width: 22rem !important; 
    height: 22rem !important; 
    min-width: 22rem !important;
    min-height: 22rem !important;
  }
  
  .tab-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    padding-bottom: 8rem;
  }
}

/* HP Portrait / Mobile Kecil */
@media screen and (max-width: 480px) {
  html { font-size: 50%; }
  
  .nav { 
    width: 100% !important; 
    bottom: 0 !important; 
    left: 0 !important;
    transform: none !important; 
    border-radius: 0 !important; 
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    padding: 1.8rem 0 !important; 
  }

  .section {
    padding: 6rem 5% 12rem;
  }

  .home-info h1 { font-size: 3.4rem; margin: 0.5rem 0; }
  .home-info h3 { font-size: 2rem; }
  .desc { margin: 1.5rem 0 2rem; font-size: 1.4rem; padding: 0 0.5rem; }
  .title { font-size: 2.8rem; }
  
  .tab-box { margin-bottom: 2rem; height: 4.5rem; }
  .tab-list h3 { font-size: 1.7rem; }
  
  .contact-form {
    padding: 3rem 1.5rem;
    margin-bottom: 4rem;
  }
  
  .popup-close { 
    right: 2rem; 
    top: 1.5rem; 
    font-size: 3.8rem;
  }

  .popup-fullscreen {
    right: 6.5rem;
    top: 1.8rem;
    font-size: 2.6rem;
  }
  
  .portfolio-box.work .portfolio-item .work-info {
    opacity: 1; 
    background: linear-gradient(transparent, rgba(23, 31, 43, 0.95));
    padding: 1.5rem;
  }
  
  .portfolio-box.work .portfolio-item {
    height: 25rem;
  }

  .portfolio-box.service .portfolio-item .work-img {
    height: 19rem;
  }
}