* {
    -webkit-tap-highlight-color: transparent;
  }

html, body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(to bottom right, #0f0f0f, #1a1a1a);
    color: #ffffff;
    cursor: url('images/alien.png'), auto;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.logo {
    height: 2.5rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3.75rem 1.25rem;
    text-align: center;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.section-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
}

.subtitle {
    color: #bbbbbb;
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

section {
    margin-bottom: 6.25rem;
}

/* About Section */
.about p {
    color: #cccccc;
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Project Section */
#projects {
    margin-top: -2.1875rem;
}

.minecraft {
    font-family: 'Press Start 2P', monospace;
    margin-bottom: 1.5625rem;
    font-size: 1.5rem;
    text-align: center; /* Center text */
    display: block; /* Ensure it is treated as a block */
    width: 100%; /* Full width of parent */
}

.nick {
    font-family: 'Press Start 2P', monospace;
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.875rem;
    padding: 0 0.625rem;
    box-sizing: border-box;
}

.card {
    overflow: hidden; /* Tambahan ini yang penting */
    background-color: #1f1f1f;
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: left;
}

.card:hover {
    transform: translateY(-0.625rem);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
}

.card img {
    width: 100%;
    height: 40vw; /* 40% dari lebar layar */
    max-height: 250px;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.625rem;
    color: #ffffff;
}

.card p {
    color: #cccccc;
}

.card a {
    color: #c0c0c0;
    text-decoration: none;
    display: block;
    margin-top: 0.625rem;

}

.show-more-text {
    color: #999;
    text-align: center;
    margin-top: 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.show-more-text:hover {
    color: #ccc;
    text-decoration: underline;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding: 1.5rem;
  width: 90vw;
  max-width: 500px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: auto;
  background-color: rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  border-radius: 1rem;
}

.modal-content {
    background-color: #1e1e1e;
    margin: auto;
    padding: 1.875rem;
    border-radius: 1.25rem;
    max-width: 600px;
    color: white;
    text-align: center;
}

.modal-content img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: 0.9375rem;
  margin-bottom: 1.25rem;
  transition: all 0.3s ease;
}


.modal-content img.fullscreen {
    max-height: none;
    width: auto;
}

.close-btn {
    display: inline-block;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 10;
}

.close-btn:hover {
    color: #ccc;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.875rem 1.25rem;
    color: #888;
    font-size: 0.9rem;
    margin-top: 3.75rem;
}

.links-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.625rem;
}

.image-source-link,
.popup-trigger {
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: normal;
    margin-right: 0.625rem;
}

.image-source-link:hover,
.popup-trigger:hover {
    text-decoration: underline;
}

/* Media Queries */
@media (max-width: 1200px) {
    .container {
        padding: 2.5rem 1.25rem;
    }
    .header-content {
        flex-direction: column;
        align-items: center;
    }
    .nav-left {
        margin-top: 1rem;
        justify-content: center;
    }
    .card img {
        width: 100%;
        height: auto;
        max-height: 220px;
        object-fit: contain;
        border-radius: 0.75rem;
      }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 0.625rem;
    }
    .card {
        padding: 0.9375rem;
    }
    h1 {
        font-size: 2.5rem;
    }
    .grid {
        gap: 1rem;
    }
    .card img {
        width: 100%;
        height: auto;
        max-height: 220px;
        object-fit: contain;
        border-radius: 0.75rem; /* balikin radius */
      }
    .popup {
        padding: 1.5rem 1rem;
        width: 90%;
        max-height: 85vh;
    }
    .form-box {
        padding: 1rem;
        font-size: 14px;
    }
    .project {
        flex-direction: column;
        gap: 1rem;
    }
    .lanyard-link {
        position: relative; /* Change position to relative */
        top: auto; /* Reset top */
        left: auto; /* Reset left */
        margin: 0 auto; /* Center horizontally */
        display: block; /* Ensure it displays as block */
        width: 100%; /* Set width to 100% */
        max-width: 290px; /* Set max width */
    }
}

@media (max-width: 480px) {
    .grid {
      grid-template-columns: 1fr !important;
      padding: 0 1rem;
    }
  
    .card {
      padding: 1rem;
      margin: 0 auto;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }
  
    .card img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 0.75rem;
        display: block;
      }
  }

  @media (max-width: 360px) {
    .card img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 0.75rem;
        display: block;
      }
    .card {
      padding: 0.75rem;
    }
  
    .grid {
      padding: 0 0.5rem;
    }
  }

.social-media-container {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.875rem;
}

.social-link {
    display: inline-block;
}

.social-icon {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    transition: transform 0.3s, filter 0.3s;
}

.social-link:hover .social-icon {
    opacity: 1;
    transform: scale(1.2);
    filter: brightness(1.3);
}


/* Top-right Profile */
.top-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.625rem;
    padding-right: 1.25rem;
    position: absolute;
    top: 1.25rem;
    right: 0;
    width: 100%;
    z-index: 1000; /* Ensure z-index is high enough */
}

#login-btn {
    padding: 0.5rem 0.875rem;
    background-color: #1f1f1f;
    color: #cccccc;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 1001; /* Ensure z-index is higher than other elements */
    position: relative; /* Ensure relative positioning */
}

#login-btn:hover {
    background-color: #797979;
}

#profile {
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000; /* Ensure z-index is high enough */
}

#profile img,
#avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    object-fit: cover;
}

#name {
    color: #ccc;
    font-weight: 500;
    font-size: 1rem;
}

/* Login Popup */
.login-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1a1a1a;
    padding: 1.25rem;
    width: 280px;
    max-width: 90vw;
    border-radius: 0.625rem;
    box-shadow: 0 10px 30px rgba(71, 71, 71, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    box-sizing: border-box;
    z-index: 1001;
}

.login-popup input {
    margin-bottom: 0.6875rem;
    padding: 0.625rem;
    border-radius: 0.375rem;
    width: 100%;
    border: none;
    outline: none;
    background-color: #2a2a2a;
    color: #fff;
    box-sizing: border-box;
}

.login-popup button {
    padding: 0.625rem;
    background-color: #1e1e1e;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.login-popup button:hover {
    background-color: #333;
}

/* Carousel and Buttons */
.carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Previous and Next Buttons */
.carousel button {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 1.875rem;
    border: none;
    padding: 0.9375rem;
    cursor: pointer;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    width: 3.125rem;
    height: 3.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel .prev {
    left: 0.625rem;
}

.carousel .next {
    right: 0.625rem;
}

.carousel button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.8);
}

.links-container {
    display: flex;
    gap: 0.625rem;
    margin-top: 0.625rem;
}

.github-link {
    color: #28a745;
    text-decoration: none;
}

.github-link:hover {
    text-decoration: underline;
}

#overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Skills Section */
.skills-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    padding: 20px;
    text-align: center;
}

.skill-item {
    width: 150px;
    text-align: center;
}

.skill-bar {
    background-color: #222;
    border-radius: 6px;
    height: 10px;
    width: 100%;
    margin: 10px 0;
}

.skill-progress {
    background-color: #ffffff;
    height: 100%;
    border-radius: 6px;
}

/* Fix modal size and position for small screens */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding: 1.5rem;
  width: 90vw;
  max-width: 500px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: auto;
  background-color: rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  border-radius: 1rem;
}

@media (max-width: 480px) {
  .modal {
  display: none;
  position: fixed;
  z-index: 2000;
  padding: 1.5rem;
  width: 90vw;
  max-width: 500px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: auto;
  background-color: rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  border-radius: 1rem;
}
}

.contact-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px; /* lebih lega biar gak terlalu dempet */
    flex-wrap: wrap;
    margin-top: 30px;
  }
  
  .lanyard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px; /* tambahin ini supaya sejajar dengan form */
  }
  
  .lanyard-box img {
    width: 300px;
    max-width: 100%;
    border-radius: 10px;
    transition: transform 0.3s;
  }
  
  .contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 350px;
    padding: 25px;
    backdrop-filter: blur(5px);
  }
  
  .contact-form input,
  .contact-form textarea {
    padding: 12px 14px;
    border: none;
    border-radius: 8px;
    background-color: #1e1e1e;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: 0.3s ease;
    font-family: 'Inter', sans-serif;
  }
  
  .contact-form input::placeholder,
  .contact-form textarea::placeholder {
    color: #aaa;
    font-size: 11px;
  }
  
  .contact-form button {
    padding: 12px;
    background-color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px; /* dibesarin dikit biar enak dibaca */
    font-family: 'Press Start 2P', cursive;
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .contact-content {
      flex-direction: column;
      align-items: center;
    }
  
    .lanyard-wrapper {
      margin-top: 0; /* reset margin-top biar di mobile gak kejauhan */
    }
  }
  
  
  
  #preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.6s ease;
  }
  
  .typewriter-container {
    font-family: 'Press Start 2P', monospace;
    color: #fff;
    font-size: 1.4rem;
    text-align: center;
    padding: 1rem 2rem;
  }
  
@media (max-width: 480px) {
    .typewriter-container {
      font-size: 0.9rem;
    }
  }
  
@media (max-width: 768px) {
    .typewriter-container {
      font-size: 1rem;
    }
  }

  .cursor {
    display: inline-block;
    margin-left: 5px;
    color: rgb(255, 255, 255);
    animation: blink 1s infinite;
  }
  
  @keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
  }
  
  #starfall-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0; /* tetap di belakang semua elemen */
  }
  
  #skip-btn {
    margin-top: 24px;
    background: none;
    border: none;
    color: white;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    text-align: center;
    opacity: 0.6;
    transition: 0.3s;
  }
  
  #skip-btn:hover {
    opacity: 1;
    text-decoration: underline;
  }
  