@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(255, 255, 255, 0.08);
  --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);
}

/* Scrollbar Style */
::-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;
}

body {
  color: var(--white-color);
  background: var(--bg-color);
  overflow: hidden;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
}

p {
  font-size: 1.6rem;
  line-height: 1.6;
}

/* === NAVBAR === */
.nav {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 40rem;
  padding: 1.5rem 0;
  background: var(--nav-bg-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5rem;
  z-index: 100;
}

.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 KUBUS CONTAINER === */
.container {
  width: 100vw;
  height: 100vh;
  perspective: 1500px;
  perspective-origin: 50%;
}

.box {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: 50% 50% -50vw;
  transform: rotateY(0deg);
  transition: transform 2s cubic-bezier(0.65, 0, 0.35, 1);
  animation: animate-cube 3.5s ease-in-out backwards;
}

@keyframes animate-cube {
  0% { transform: scale(0) rotateY(-360deg); }
  100% { transform: scale(1) rotateY(0deg); }
}

.section {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  padding: 0 10%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  overflow: hidden; 
}

.section:nth-child(even) {
  background: var(--second-bg-color);
}

.section.about { transform: translateX(50vw) translateZ(-50vw) rotateY(90deg); }
.section.resume { transform: translateZ(-100vw) rotateY(-180deg); transform-origin: 50%; }
.section.portfolio { transform: translateX(-50vw) translateZ(-50vw) rotateY(-90deg); }

.section.contact { visibility: hidden; transition: visibility 0.5s; }
.section.contact.active { visibility: visible; }

/* === BERANDA & PROFIL === */
.home, .about {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6rem;
  overflow-y: auto;
  padding-top: 2rem;
  padding-bottom: 11rem;
  -webkit-overflow-scrolling: touch;
}

.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; 
}

/* BLOK DESKRIPSI KUTIPAN */
.desc { 
  margin: 2rem 0 3rem; 
  font-style: italic; 
  color: #e0e0e0; 
  text-align: center;   
  width: 100%;           
}

/* AYAT DI BAWAH KUTIPAN */
.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);
}

/* === IMAGE BOX PROFILE === */
.img-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
}

.img-box {
  position: relative;
  width: 30vw;
  height: 30vw;
  max-width: 35rem;
  max-height: 35rem;
  min-width: 25rem;
  min-height: 25rem;
  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 (UNDANGAN & GALERI) === */
.title {
  font-size: 3.8rem;
  text-align: center;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
  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; }

.resume, .portfolio {
  padding-top: 0;
  padding-bottom: 11rem; 
}

.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;
  min-height: 0; 
}

.tab-grid {
  position: absolute;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
  gap: 2rem;
  overflow-y: auto;
  padding-bottom: 4rem; 
  padding-right: 0.5rem;
  -webkit-overflow-scrolling: touch; 
  visibility: hidden;
  opacity: 0;
  transform: scale(0.95);
  transition: 0.4s ease;
  z-index: 1;
}

.tab-grid.active {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  z-index: 5;
}

/* Item Card Di Dalam Tab */
.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%;
}

/* === INTERAKSI FOTO DI TAB NONG ROMARIO (.work) === */
.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);
}

/* Overlay Info Tab Nong Romario */
.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);
}

/* === INTERAKSI FOTO DI TAB ALBUM (.service) === */
.portfolio-box.service .portfolio-item {
  display: flex;
  flex-direction: column;
  background: var(--third-bg-color);
  border-radius: 1.2rem;
  padding: 1.5rem;
  height: max-content;
  overflow: visible;
  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;
  top: auto;
  left: auto;
}

.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;
  inset: auto;
  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;
}

.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;
}

/* === CONTACT / RSVP SECTION === */
.contact {
  padding-top: 0;
  padding-bottom: 11rem;
}

.contact-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  overflow-y: auto;
  padding-top: 2rem;
  -webkit-overflow-scrolling: touch;
}

.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%;
  margin-bottom: 2rem;
}

.contact-form h3 {
  font-size: 2.6rem;
  color: var(--main-color);
  margin-bottom: 1.5rem;
}

/* === POPUP VIEWER MODAL + STRUKTUR FULLSCREEN === */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 22, 0.97);
  display: flex;
  flex-direction: column; 
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 2rem;
}

.popup-img-container {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  max-width: 90%;
  max-height: 70vh;
}

.popup-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 70vh;
  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: max-height 0.3s ease, border-radius 0.3s ease;
}

/* Kelas Khusus Saat Foto Mode Fullscreen Aktif */
.popup.expanded-mode .popup-img-container {
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
}

.popup.expanded-mode .popup-img {
  max-height: 100vh;
  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: 600;
  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: 600;
  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: 550;
}

#album-popup .btn {
  padding: 1rem 3rem;
  box-shadow: 0 0 1.5rem rgba(255, 204, 0, 0.3);
}

/* === MEDIA QUERIES (OPTIMASI TOTAL UNTUK LAYAR MOBILE) === */
@media screen and (max-width: 992px) {
  html { font-size: 55%; }
  .section { padding: 0 5%; }
  .home, .about { gap: 4rem; }
}

@media screen and (max-width: 768px) {
  .nav { 
    width: 90%; 
    bottom: 2rem; 
  }
  
  .title {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-size: 3.2rem;
  }

  /* Rombak total struktur penataan elemen seksi agar vertikal dan memiliki scrolling mandiri yang aman */
  .home, .about { 
    flex-direction: column !important; 
    text-align: center; 
    justify-content: flex-start !important;
    padding-top: 3rem !important; 
    padding-bottom: 13rem !important;
    gap: 2.5rem !important;
    overflow-y: auto !important;
    height: 100% !important;
  }
  
  .home-info, .about-info {
    flex: none !important;
    width: 100% !important;
  }
  
  .about-info .title { 
    text-align: center !important; 
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  
  .btn-sci { 
    justify-content: center; 
    gap: 1.5rem;
  }
  
  .img-wrapper {
    flex: none !important;
    margin-top: 0 !important;
    width: 100% !important;
  }

  /* Mengunci ukuran box foto di HP agar pas dan proporsional */
  .img-box { 
    width: 20rem !important; 
    height: 20rem !important; 
    min-width: 20rem !important;
    min-height: 20rem !important;
  }
  
  .tab-grid {
    grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
    gap: 1.5rem;
  }
}

@media screen and (max-width: 480px) {
  html { font-size: 50%; }
  
  .nav { 
    width: 100%; 
    bottom: 0; 
    border-radius: 0; 
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 1.5rem 0; 
  }
  
  .section {
    padding: 0 5%;
  }

  .resume, .portfolio, .contact, .home, .about {
    padding-bottom: 9.5rem !important;
  }

  .home-info h1 { font-size: 3.2rem; margin: 0.4rem 0; }
  .home-info h3 { font-size: 1.9rem; }
  .desc { margin: 1.5rem 0 2rem; font-size: 1.4rem; padding: 0 1rem; }
  .title { font-size: 2.6rem; margin-top: 2rem; }
  .tab-box { margin-bottom: 2rem; height: 4.5rem; }
  .tab-list h3 { font-size: 1.6rem; }
  
  .contact-form {
    padding: 2.5rem 1.5rem;
    margin-top: 1rem;
  }
  
  .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.9));
    padding: 1.5rem;
  }
  
  .portfolio-box.work .portfolio-item {
    height: 24rem;
  }

  .portfolio-box.service .portfolio-item .work-img {
    height: 18rem;
  }
}