@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
  --bg-dark: #1a1a1a;
  --text-logo: #d3d3d3;
  --text-accent: #ffd60a;
  --text-content: #ddd;
  --navbar-logo-color: #555;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==== GLOBAL ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: #000;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.page {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-sizing: border-box;
}

.page.active {
  opacity: 1;
  pointer-events: all;
  z-index: 10;
}

/* ==== PAGE 1 ==== */
#page1 {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#page1 .bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
}

/* ==== TAP ANIMATION ==== */
.tap {
  position: absolute;
  bottom: calc(var(--vh, 1vh) * 5);
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
  color: #fff;
  opacity: 0;
  transition: opacity 1.2s, transform 0.6s;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  pointer-events: none;
}

.tap.show {
  pointer-events: all;
}

#tap2 {
  bottom: calc(var(--vh, 1vh) * 8);
}

.tap.show {
  opacity: 1;
  animation: blink 1.5s infinite alternate;
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ==== PAGE 2 ==== */
#page2 {
  background: #1a1a1a;
  color: var(--text-content);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: calc(var(--vh, 1vh) * 10);
  cursor: pointer;
  position: relative;
  min-height: calc(var(--vh, 1vh) * 100);
  -webkit-tap-highlight-color: transparent;
}

#logoText {
  opacity: 0;
  transition: all 0.8s ease;
}

#logoText.tracking-in {
  animation: logo-fade-in 1s ease both;
}

@keyframes logo-fade-in {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.page2-logo {
  display: block;
  margin: 0 auto calc(var(--vh, 1vh) * 8);
  max-width: 300px;
  width: 80%;
  height: auto;
  object-fit: contain;
}

#desc {
  max-width: 800px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #adadad;
  text-align: center;
  margin: 0 auto;
  padding: 0 2vw;
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
}

#desc p {
  margin-bottom: calc(var(--vh, 1vh) * 2);
  transition: opacity 0.3s ease;
}

#desc p:last-child {
  margin-bottom: 0;
}

.typed-line {
  margin: calc(var(--vh, 1vh) * 2) 0;
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up 0.8s ease-out forwards;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.highlight {
  color: #fff;
  font-size: 1.05em;
  font-weight: 600;
  transition: all 0.1s ease;
}

.italicOnly {
  font-style: italic;
  color: #fff;
  font-size: 1.05em;
  font-weight: 600;
  transition: all 0.1s ease;
}

.no-wrap {
  white-space: nowrap;
}

/* ==== HEADER ==== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(var(--vh, 1vh) * 1.5) 4vw;
  background: #fff;
  color: #000;
  z-index: 20;
  transition: 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
}

header.visible {
  opacity: 1;
  visibility: visible;
}

.navbar-logo {
  height: 55px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
}

.navWrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navMenu {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
}

.navMenu ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.navMenu ul li a {
  text-decoration: none;
  color: #000;
  font-weight: 300;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}

.navMenu ul li a:hover {
  background: #f1c40f;
  color: #000;
}

.navMenu ul li a.active {
  background: var(--text-accent);
  color: #000;
  border-radius: 8px;
}

.navIcons {
  display: flex;
  gap: 1rem;
}

.navIcons a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text-accent);
  color: #000;
  text-decoration: none;
  font-size: 1.2rem;
  transition: 0.3s;
}

.burger-menu {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 30;
}

/* ==== GALLERY PAGES (3, 4, 5, 6) ==== */
#page3,
#page4,
#page5,
#page6 {
  background: #fff;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
  padding-top: 50px;
}

/* Desktop Gallery Styles */
@media (min-width: 769px) {
  #page3 .grid-container,
  #page4 .grid-container,
  #page5 .grid-container,
  #page6 .grid-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 1rem;
    width: 100%;
    padding: 0 2rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }

  #page3 .grid-item,
  #page4 .grid-item,
  #page5 .grid-item,
  #page6 .grid-item {
    min-width: 320px;
    height: 100%;
    max-height: 75vh;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    filter: blur(2px);
    opacity: 0.8;
    transform: scale(0.9);
    scroll-snap-align: center;
  }

  #page3 .grid-item.active,
  #page4 .grid-item.active,
  #page5 .grid-item.active,
  #page6 .grid-item.active {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }

  #page3 .grid-item:first-child,
  #page4 .grid-item:first-child,
  #page5 .grid-item:first-child,
  #page6 .grid-item:first-child {
    scroll-margin-left: calc(50vw - 160px - 2rem);
  }

  #page3 .grid-item:last-child,
  #page4 .grid-item:last-child,
  #page5 .grid-item:last-child,
  #page6 .grid-item:last-child {
    scroll-margin-right: calc(50vw - 160px - 2rem);
  }

  #page3 .grid-item img,
  #page4 .grid-item img,
  #page5 .grid-item img,
  #page6 .grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

/* Mobile/Tablet Gallery Styles - TIDAK DIGUNAKAN LAGI */
@media (max-width: 768px) {
  .grid-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    width: 100%;
    padding-left: 2rem;
    padding-right: 1rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }

  .grid-item {
    min-width: 320px;
    height: 100%;
    max-height: 75vh;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s ease;
    filter: blur(2px);
    opacity: 0.8;
    transform: scale(0.9);
    scroll-snap-align: center;
  }

  .grid-item.active {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }

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

/* Navigation Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s;
  z-index: 15;
}

.nav-arrow:hover {
  background: var(--text-accent);
  color: #000;
}

.left-arrow {
  left: 2vw;
}

.right-arrow {
  right: 2vw;
}

/* For Webkit browsers (Chrome, Safari) */
.grid-container::-webkit-scrollbar {
  display: none;
}

.grid-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.grid-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.grid-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Puff Out Animation */
@keyframes puff-out {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
  }
  100% {
    transform: scale(0.5);
    opacity: 0;
    filter: blur(5px);
  }
}

.puff-out-animation {
  animation: puff-out 0.5s ease-out forwards;
}

/* ==== TABLET RESPONSIVENESS ==== */
@media (min-width: 769px) and (max-width: 1024px) {
  .navMenu ul {
    gap: 1rem;
  }

  .navMenu ul li a {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .logoStyle {
    font-size: 2rem;
  }
}

/* ==== MOBILE RESPONSIVENESS ==== */
@media (max-width: 768px) {
  /* Header Mobile */
  header {
    padding: calc(var(--vh, 1vh) * 1.5) 5vw;
  }

  .burger-menu {
    display: block;
  }

  .navWrapper {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: calc(var(--vh, 1vh) * 10);
    opacity: 0;
    visibility: hidden;
    transition: right 0.3s ease-in-out, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 25;
  }

  .navWrapper.menu-open {
    right: 0;
    opacity: 1;
    visibility: visible;
  }

  .navMenu ul {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .navIcons {
    flex-direction: row;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    justify-content: center;
  }

  /* Page 1 Mobile */
  #page1 .bg-img {
    content: url('/images/HOME_portrait.jpg');
  }

  /* Page 2 Mobile - PERBAIKAN FULL */
  #page2 {
    padding-top: calc(var(--vh, 1vh) * 5) !important;
    padding-bottom: calc(var(--vh, 1vh) * 8) !important;
    justify-content: flex-start !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    min-height: calc(var(--vh, 1vh) * 100) !important;
    overflow: visible !important;
  }

  .page2-logo {
    width: 40% !important;
    max-width: 150px !important;
    margin-bottom: calc(var(--vh, 1vh) * 4) !important;
    margin-top: 0 !important;
    display: block !important;
    flex-shrink: 0 !important;
  }

  #desc {
    font-size: 0.8rem !important;
    line-height: 1.65 !important;
    padding: 0 8vw !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    display: block !important;
    flex-shrink: 1 !important;
  }

  #desc p {
    margin-bottom: calc(var(--vh, 1vh) * 1.8) !important;
    text-align: center !important;
    letter-spacing: 0.01em !important;
    width: 100% !important;
  }
  
  #desc p:last-child {
    margin-bottom: 0 !important;
  }

  /* Tap 2 Position - Lebih tinggi agar tidak bertabrakan */
  #tap2 {
    bottom: calc(var(--vh, 1vh) * 5);
  }

  /* Gallery Pages Mobile - Card background sama dengan page agar tidak terlihat */
  #page3,
  #page4,
  #page5,
  #page6 {
    padding-top: 80px;
    padding-bottom: 20px;
    background: #fff; /* Background page tetap putih */
  }

  .grid-container {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 3vh 5vw 3vh; /* TETAP: Space kanan-kiri 5vw */
    gap: 0.8rem;
    scroll-snap-type: none;
    scrollbar-width: none;
    height: calc(100vh - 100px);
    background: transparent;
  }

  .grid-container::-webkit-scrollbar {
    display: none;
  }

  .grid-item {
    width: 100%; /* TETAP: Lebar sesuai container (dengan space) */
    min-width: unset;
    max-width: 100%;
    height: auto;
    min-height: unset;
    max-height: 65vh;
    scroll-snap-align: none;
    scroll-margin-top: 0;
    scroll-margin-bottom: 0;
    background: #fff; /* PERBAIKAN: Background card putih sama dengan page */
    
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
    transition: transform 0.5s var(--transition-smooth),
                opacity 0.5s var(--transition-smooth),
                filter 0.5s var(--transition-smooth);
  }

  .grid-item img {
    width: 100%;
    height: auto;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 0 !important;
  }

  .grid-item:first-child {
    scroll-margin-top: 0;
  }

  .grid-item:last-child {
    scroll-margin-bottom: 0;
    margin-bottom: 5vh !important;
  }

  /* Navigation Arrows Mobile - PERBAIKAN: Tidak ada hover kuning dan animasi */
  .nav-arrow {
    display: none;
    right: 20px;
    left: auto;
    top: 50%;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    transition: background 0.3s ease, color 0.3s ease;
  }

  /* Icon Atas - Panah ke ATAS */
  .left-arrow {
    transform: translateY(calc(-50% - 35px));
  }

  .left-arrow i::before {
    content: "\f077" !important;
  }

  /* Icon Bawah - Panah ke BAWAH */
  .right-arrow {
    transform: translateY(calc(-50% + 35px));
  }

  .right-arrow i::before {
    content: "\f078" !important;
  }

  /* PERBAIKAN: Hapus background kuning dan animasi saat active/focus */
  .nav-arrow:active,
  .nav-arrow:focus {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
  }

  /* Pastikan icon tetap muncul saat active */
  .left-arrow:active i::before {
    content: "\f077" !important;
  }

  .right-arrow:active i::before {
    content: "\f078" !important;
  }

  /* PERBAIKAN: Posisi tetap tanpa scale atau animasi */
  .left-arrow:active {
    transform: translateY(calc(-50% - 35px)) !important;
  }

  .right-arrow:active {
    transform: translateY(calc(-50% + 35px)) !important;
  }

  /* Disable hover effects on mobile */
  .navMenu ul li a:hover,
  .nav-arrow:hover {
    background: initial;
    color: initial;
    transform: none;
  }
}

/* ==== SMALL MOBILE DEVICES ==== */
@media (max-width: 480px) {
  /* Page 2 - Small Mobile */
  .page2-logo {
    width: 35%;
    max-width: 130px;
    margin-bottom: calc(var(--vh, 1vh) * 3);
  }

  #desc {
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 0 5vw;
  }

  #desc p {
    margin-bottom: calc(var(--vh, 1vh) * 1.2);
  }

  /* Gallery - Small Mobile */
  .grid-item {
    max-height: 65vh;
  }

  .grid-item img {
    max-height: 65vh;
  }

  .nav-arrow {
    width: 40px;
    height: 40px;
    right: 15px;
  }

  .left-arrow {
    transform: translateY(calc(-50% - 30px));
  }

  .right-arrow {
    transform: translateY(calc(-50% + 30px));
  }
}

/* ==== LANDSCAPE MOBILE ==== */
@media (max-width: 768px) and (orientation: landscape) {
  /* Page 2 - Landscape */
  #page2 {
    padding-top: calc(var(--vh, 1vh) * 5);
  }

  .page2-logo {
    width: 25%;
    max-width: 120px;
    margin-bottom: calc(var(--vh, 1vh) * 2);
  }

  #desc {
    font-size: 0.75rem;
    line-height: 1.4;
    max-height: calc(var(--vh, 1vh) * 50);
  }

  #desc p {
    margin-bottom: calc(var(--vh, 1vh) * 1);
  }

  #tap2 {
    bottom: calc(var(--vh, 1vh) * 3);
  }

  /* Gallery - Landscape */
  .grid-item {
    max-height: 80vh;
  }

  .grid-item img {
    max-height: 80vh;
  }

  #page3,
  #page4,
  #page5,
  #page6 {
    padding-top: 70px;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .navMenu ul li a:hover,
  .nav-arrow:hover {
    background: transparent;
    color: inherit;
  }

  .nav-arrow:active,
  .nav-arrow:focus {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
  }
}

/* Lazy Loading Styles */
img.lazy {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  min-height: 200px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

img.lazy-loaded {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Text */
.mobile-text {
  display: none;
}

@media (max-width: 768px) {
  .desktop-text {
    display: none;
  }
  .mobile-text {
    display: block;
  }
}