/* =============== */
/*  RESET & BASE   */
/* =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  html {
    height: 100%;
  }

  body {
    font-family: 'Open Sans', sans-serif;
    background-color: #020202;
    color: #fff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Kunci: Body akan selalu setinggi minimal layar */
  }
  
  /* Fade Overlay */
  #fadeOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    opacity: 1;
    visibility: visible;
    z-index: 1000;
    transition: opacity 2s ease-in-out, visibility 0s linear 2s;
  }
  #fadeOverlay.hidden {
    opacity: 0;
    visibility: hidden;
  }

  #toggleAbout {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: white;
    transition: transform 0.1s ease, color 0.1s ease;
    transform-origin: left; /* Fix: Zoom from the left side */
  }
  #toggleAbout:hover {
    transform: scale(1.1);
  }
  #aboutContent {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
    background-color: #000;
    margin-top: 0.5rem;
    padding: 0 1rem;
    opacity: 0;
  }

  #aboutContent.active {
    max-height: 4000px;
    opacity: 1;
    transform: translateY(0);
  }

  
  /* Spider Canvas behind everything */
  #canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;  /* behind other content */
    width: 100vw;
    height: 100vh;
    display: block;
    opacity: 0.6;
    transition: opacity 2s ease-in-out;
  }
  /* Show spider animation */
    #canvas.visible {
      opacity: 1;
    }
      
  /* Landing Section */
  #landing {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7); /* 70% black overlay */
    text-align: center;
    z-index: 999;
    transition: opacity 2s ease; 
  }
  #welcomeText {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: opacity 1.5s ease-in-out;
  }
  #startButton {
    background: none;
    border: none;
    cursor: pointer;
    color: #b30000; 
    font-weight: 600; 
    font-size: 1rem;
    transition: color 0.4s ease; 
    z-index: 1000;
  }
  #startButton:hover {
    color: #fff;
  }
  
  /* Portfolio Section */
  #portfolio {
    /* On the portfolio page, it can be block by default */
    flex-grow: 1; /* Kunci: Membuat elemen ini mengisi ruang yang tersedia */
    max-width: 1500px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: transparent;
    box-sizing: border-box;
    width: 100%;
    opacity: 1;
    background: transparent;
    box-sizing: border-box;
    width: 100%;
    opacity: 1; /* if you want fade, you can control it with JS */
    }
  
  /* Hero / greeting */
  .hero {
    background-color: transparent;
    padding: 3rem 1rem; /* Padding horizontal dikurangi untuk mobile */
    text-align: center;
    margin-bottom: 2rem;
    min-height: 40vh; /* Tinggi minimal 40% dari tinggi layar */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Konten di tengah secara vertikal */
    align-items: center; /* Konten di tengah secara horizontal */
  }
  .intro-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
  }


  .intro-subtitle {
    font-size: 1rem;
    color: #ccc;
    text-align: center;
    justify-content: center; 
    width: fit-content;
    margin: 0 auto;
  }
  .hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  .hero p {
    font-size: 1.1rem;
  }
  
  /* Link styling */
  a {
    color: #fff;
    text-decoration: none;
  }
  a:hover {
    text-decoration: underline;
  }
  
  /* Footer */
  footer {
  position: relative;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #696969;
  font-size: 1rem;
}

#timeDisplay,
#locationDisplay {
  color: #696969;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
}

#timeDisplay {
  flex: 1;
  text-align: left;
}

footer p {
  flex: 1;
  text-align: center;
  margin: 0;
}

#locationDisplay {
  flex: 1;
  text-align: right;
}

/* Mobile responsive footer */
@media (max-width: 768px) {
  footer {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
  }

  #timeDisplay,
  footer p,
  #locationDisplay {
    flex: none;
    text-align: center;
    width: 100%;
  }
}
  
  /* Collapsible toggles */
  #workContent {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
    margin-top: 0.5rem;
    padding: 0 1rem;
  }
  
  #workContent.active {
    max-height: 99999999999999999999px; /* tambah buat anu */
    opacity: 1;
    transform: translateY(0);
  }
  #toggleWork {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: white;
    transition: transform 0.1s ease, color 0.1s ease;
    transform-origin: left; /* Fix: Zoom from the left side */
  }
  #toggleWork:hover {
    transform: scale(1.1);
  }
  
  /* Project1 collapsible */
  #project1Content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
    background-color: #000;
    margin-top: 0.5rem;
    padding: 0 1rem;
  }
  #project1Content.active {
    max-height: 4000px; /* large enough for content */
    opacity: 1;
  }
  #project1Toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff; 
    font-size: 1rem;
    transition: color 0.1s ease; 
    z-index: 1000;
  }
  #project1Toggle:hover {
    color: #830000;
  }

  #kuliahkuContent {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
  background-color: #000;
  margin-top: 0.5rem;
  padding: 0 1rem;
  }
  #kuliahkuContent.active {
    max-height: 4000px;
    opacity: 1;
  }
  #kuliahkuToggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff; 
    font-size: 1rem;
    transition: color 0.1s ease; 
    z-index: 1000;
  }
  #kuliahkuToggle:hover {
    color: #830000;
  }

  /* MyLovetime collapsible */
  #mylovetimeContent {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
    background-color: #000;
    margin-top: 0.5rem;
    padding: 0 1rem;
  }
  #mylovetimeContent.active {
    max-height: 4000px;
    opacity: 1;
  }
  #mylovetimeToggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    font-size: 1rem;
    transition: color 0.1s ease;
    text-align: left;
    width: 100%;
  }
  #mylovetimeToggle:hover {
    color: #830000;
  }
  
  /* Research collapsible */
  #researchContent {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
    background-color: #000;
    margin-top: 0.5rem;
    padding: 0 1rem;
  }
  #researchContent.active {
    max-height: 4000px; /* large enough for content */
    opacity: 1;
  }
  #researchToggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff; 
    font-size: 1rem;
    transition: color 0.1s ease; 
  }
  #researchToggle:hover {
    color: #830000;
  }

  /* PKL collapsible */
  #pklContent {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
    background-color: #000;
    margin-top: 0.5rem;
    padding: 0 1rem;
  }
  #pklContent.active {
    max-height: 4000px; /* large enough for content */
    opacity: 1;
  }
  #pklToggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff; 
    font-size: 1rem;
    transition: color 0.1s ease; 
  }
  #pklToggle:hover {
    color: #830000;
  }

  
  /* Anomali */
  #tebakanomaliContent {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
  background-color: #000;
  margin-top: 0.5rem;
  padding: 0 1rem;
  }
  #tebakanomaliContent.active {
    max-height: 4000px;
    opacity: 1;
  }
  #tebakanomaliToggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff; 
    font-size: 1rem;
    transition: color 0.1s ease; 
  }
  #tebakanomaliToggle:hover {
    color: #830000;
  }

  /* Roblox collapsible */
  #robloxContent {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s cubic-bezier(.4,0,.2,1);
    background-color: #000;
    margin-top: 0.5rem;
    padding: 0 1rem;
  }
  #robloxContent.active {
    max-height: 4000px; /* large enough for content */
    opacity: 1;  }
  #roblox {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff; 
    font-size: 1rem;
    transition: color 0.1s ease; 
  }
  #roblox:hover {
    color: #830000;
  }
  
  /* Socials */
  #socials {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  #socialToggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: white;
    padding: 5px;
    transition: transform 0.3s ease;
  }
  #socialToggle:hover {
    transform: scale(1.2);
  }
  #socialIcons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  #socialIcons a {
    opacity: 0;
    /* slide slightly UP when hidden so it "gets back up" on closing */
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }
  #socialIcons.active a {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  /* Stagger on open (top to bottom) */
  #socialIcons.active a:nth-child(1) { transition-delay: 0.1s; }
  #socialIcons.active a:nth-child(2) { transition-delay: 0.2s; }
  #socialIcons.active a:nth-child(3) { transition-delay: 0.3s; }
  #socialIcons.active a:nth-child(4) { transition-delay: 0.4s; }

  /* Reverse stagger on close (bottom to top) */
  #socialIcons:not(.active) a:nth-child(1) { transition-delay: 0.3s; }
  #socialIcons:not(.active) a:nth-child(2) { transition-delay: 0.2s; }
  #socialIcons:not(.active) a:nth-child(3) { transition-delay: 0.1s; }
  #socialIcons:not(.active) a:nth-child(4) { transition-delay: 0s; }
  #socials img {
    width: 32px;
    height: auto;
    cursor: pointer;
    transition: opacity 0.3s ease;
  }
  #socials img:hover {
    opacity: 0.2;
  }
  
  /* Image galleries */

.parallax {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}
.parallax::before {
  display: flex;
  white-space: nowrap;
  text-align: center;
  font-family: sans-serif;
  font-size: 2.25rem;
  font-weight: bold;
  letter-spacing: -0.02em;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
  animation: marquee 10s linear infinite;
}
.scroller span {
  flex-shrink: 0;
  margin-right: 32px;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (min-width: 768px) {
  .scroller {
    font-size: 1rem;
    line-height: 1rem;
  }
}

  .blur-word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(-30px);
  transition: 
    opacity 0.6s cubic-bezier(.4,0,.2,1),
    filter 0.6s cubic-bezier(.4,0,.2,1),
    transform 0.6s cubic-bezier(.4,0,.2,1);
}
.blur-word.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

  .image-gallery {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
  }
  .image-container {
    text-align: center;
    width: 30%;
    min-width: 200px;
  }
  .image-container img {
    width: 100%;
    display: block;
    border-radius: 10px;
  }
  .image-description {
    font-size: 14px;
    color: #ccc;
    margin-top: 5px;
    text-align: center;
  }
  
  /* image */
  #carousel-wrapper {
    height: 300px;
    width: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main container for the carousel */
.carousel-container {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border: 1px solid #222;
    border-radius: 14px;
    box-sizing: border-box;
    /* This creates the 3D space for the rotation effect */
    perspective: 1000px;
}

/* The track that holds all the items and moves */
.carousel-track {
    display: flex;
    gap: 16px;
    /* Will be updated by JS */
    width: 268px; 
    cursor: grab;
    user-select: none; /* Prevents text selection while dragging */
}

.carousel-track.grabbing {
    cursor: grabbing;
}

/* Individual carousel item */
.carousel-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #222;
    border-radius: 12px;
    overflow: hidden;
    color: white;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    /* This makes the 3D effect look right */
    transform-style: preserve-3d;
}

.item-header {
    padding: 20px;
    padding-bottom: 16px;
}

.icon-container {
    display: flex;
    height: 28px;
    width: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #060010;
}

.icon-container svg {
    height: 16px;
    width: 16px;
    stroke: white;
}

.item-content {
    padding: 20px;
}

.item-title {
    margin-bottom: 4px;
    font-size: 1.125rem;
    font-weight: 900;
}

.item-description {
    font-size: 0.875rem;
    color: #ccc;
}

/* Indicators at the bottom */
.indicators-container {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 16px;
}

.indicators {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 0 32px;
}

.indicator {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    cursor: pointer;
    background-color: rgba(51, 51, 51, 0.4);
    transition: all 0.15s ease-in-out;
}

.indicator.active {
    background-color: #333333;
    transform: scale(1.2);
}

.carousel-item {
    /* Change justify-content to start */
    justify-content: flex-start;
    background-color: #222;
}

.item-image-container {
    width: 100%;
    /* Creates a square aspect ratio for the image area */
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.item-image {
    width: 100%;
    height: 100%;
    /* Ensures the image covers the area without being distorted */
    object-fit: cover;
    object-position: center top;
    pointer-events: none;;
}

.item-content {
    padding: 20px;
    /* Allows content to grow if needed */
    flex-grow: 1;
}

/* You might not need the old icon styles anymore */
.item-header, .icon-container {
    display: none;
}

#contactHint {
  position: absolute;
  top: 5px;
  right: 55px;
  background: rgba(8, 8, 8, 0.5); /* transparan 70% */
  color: #fff;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .4s cubic-bezier(.4,0,.2,1), transform .4s cubic-bezier(.4,0,.2,1);
  z-index: 10000;
  white-space: nowrap;       /* keep on one line */
  min-width: auto;  
  text-align: center;
}
#contactHint.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#contactHint::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: rgba(8, 8, 8, 0.5);
}

#contactHint:hover {
  background: #140000;
}

#socialToggle.pulse {
  position: relative;
}
#socialToggle.pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid #fff;
  border-radius: 8px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { opacity: 0; transform: scale(.7); }
  50% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}

/* Rata kiri untuk semua toggle */
#toggleAbout,
#toggleWork,
#project1Toggle,
#kuliahkuToggle,
#mylovetimeToggle,
#researchToggle,
#pklToggle,
#tebakanomaliToggle,
#roblox {
  text-align: left;
  width: 100%;
}

/* Rata kiri untuk semua content collapse */
#aboutContent,
#workContent,
#project1Content,
#kuliahkuContent,
#mylovetimeContent,
#researchContent,
#pklContent,
#tebakanomaliContent,
#robloxContent {
  text-align: left;
  margin-left: 0;
  padding-left: 1rem; /* jika ingin sedikit indent; hapus bila tidak perlu */
}

/* --- Scroll reveal for About / My Work toggles --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .6s cubic-bezier(.4,0,.2,1), transform .6s cubic-bezier(.4,0,.2,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}