/* CSS Reset & Basic Styles */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* Set base font size and box-sizing for browser consistency. */
html {
  font-size: 100%;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

/* Global color variables for the theme. */
:root {
  --primary-900: hsl(256, 43%, 7%);
  --primary-800: hsl(240, 24%, 13%);
  --primary-700: hsl(243, 26%, 15%);
  --primary-600: hsl(252, 9%, 22%);
  --primary-500: hsl(259, 13%, 28%);
  --primary-400: hsl(254, 22%, 32%);
  --primary-300: hsl(251, 13%, 68%);
  --primary-200: hsl(240, 15%, 76%);
  --primary-100: hsl(240, 21%, 88%);
  --neutral-100: hsl(0, 0%, 100%);
  --accent-400: hsl(93, 60%, 69%);
  --text-1: var(--neutral-100);
  --text-2: var(--primary-100);
  --text-3: var(--primary-200);
  --surface-1: var(--primary-900);
  --surface-2: var(--primary-800);
  --surface-3: var(--primary-700);
  --border-1: var(--primary-500);
  --border-2: var(--primary-600);
}

/* Basic styles for the body, including font and background. */
body {
  font-family: "Space Mono", monospace;
  background: #161616f1;
  color: #ffffff;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

/* Custom cursor for a more engaging experience. */
#custom-cursor {
  position: fixed;
  width: 1.25rem;
  height: 1.25rem;
  background: rgba(138, 43, 226, 0.7);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s ease,
    height 0.3s ease,
    background 0.3s ease;
  mix-blend-mode: normal;
}

#custom-cursor.hover {
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(138, 43, 226, 0.3);
  border: 0.125rem solid rgba(138, 43, 226, 0.8);
}

/* Hide the default cursor if the custom one is active. */
@media (pointer: fine) {
  html,
  * {
    cursor: none !important;
  }
}

/* Navbar fixed at the top of the page. */
.navbar {
  position: fixed;
  top: 1rem;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 5rem;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 87.5rem;
  margin: 0 auto;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  color: #8a2be2;
  text-decoration: none;
}

/* Hamburger menu button for mobile navigation. */
.hamburger-menu {
    position: fixed;
    top: 1.875rem;
    right: 1.875rem;
    width: 3.125rem;
    height: 3.125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Spacing between bars */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(.39,0,.52,1);
    z-index: 1001;
    background: transparent;
    border: none;
}

.hamburger-bar {
    width: 28px;
    height: 3px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.hamburger-menu:hover {
    transform: scale(1.1);
}

/* Animate bars to a cross when active */
.hamburger-menu.active .hamburger-bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-menu.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Container for the pop-out side menu. */
.menu-container {
  position: fixed;
  backdrop-filter: blur(0.1875rem);
  top: 1.875rem;
  right: 1.875rem;
  width: 18.75rem;
  transform-origin: top center; /* Changed for vertical slide */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px); /* Initial position for slide */
  z-index: 999;
}

/* Animations and styles for the menu when it's shown. */
.menu-container.show {
  visibility: visible;
}

.menu-container.show .menu {
  --border-width: 0.0625rem;
  background: hsl(from var(--surface-3) h s l / 0.25);
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
  border-radius: 1rem;
  position: relative;
  border: none;
  background-clip: padding-box;
}

.menu-container.show .menu::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  border: var(--border-width) solid transparent;
  background: linear-gradient(var(--border-1), var(--border-2)) border-box;
  mask: linear-gradient(black, black) padding-box,
    linear-gradient(black, black);
  mask-composite: subtract;
  -webkit-mask-composite: source-out;
}

.menu-container.show .menu::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  filter: blur(2.5rem);
  opacity: 0.4;
  pointer-events: none;
  z-index: -2;
}

.menu-container.animate-in {
  animation: slideDown 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.menu-container.animate-out {
  animation: slideUp 0.4s cubic-bezier(0.755, 0.05, 0.855, 0.06) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Main style for the menu box. */
.menu {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1.5rem;
  border: 0.0625rem solid rgba(138, 43, 226, 0.2);
  box-shadow:
    0 0.5rem 2rem rgba(36, 5, 65, 0.1),
    inset 0 0.0625rem 0 rgba(138, 43, 226, 2),
    inset 0 -0.0625rem 0 rgba(81, 5, 151, 1);
  padding: 1.875rem 1.25rem 1.25rem;
  overflow: hidden;
  position: relative;
  margin-top: 3rem;
  z-index: 991;
}

.menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  margin: 0.25rem 0;
  border-radius: 1rem;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease-out;
  position: relative;
  overflow: hidden;
  z-index: 999;
}

.menu-item:hover {
  transform: translateY(-0.125rem) scale(1.02);
  background: rgba(138, 43, 226, 0.3);
  box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.1);
}

.menu-item:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.menu-icon {
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 1rem;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.menu-item:hover .menu-icon {
  opacity: 1;
  transform: scale(1.1);
}

/* The old close button is no longer needed */
.close-btn {
  display: none;
}

/* Hero (main) section at the top of the page. */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  z-index: 10;
  max-width: 50rem;
  padding: 0 2rem;
}

.hero-title {
  font-size: 4em;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #8a2be2, #da70d6, #9370db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
  letter-spacing: -0.125rem;
}

.description {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #d1c4e9;
  margin-bottom: 2rem;
  padding: 0 3rem;
}

.description .pyxel {
  color: #8a2be2;
  text-decoration: none;
  font-weight: bold;
  position: relative;
}

.description .pyxel::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background-color: #8a2be2;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.description .pyxel:hover::after {
  transform: scaleX(1);
}

/* Puzzle decoration in the hero background. */
.puzzle-container {
  position: absolute;
  width: 20rem;
  height: 20rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.puzzle-piece {
  position: absolute;
  width: 5rem;
  height: 5rem;
  background: linear-gradient(145deg, rgba(138, 43, 226, 0.55), rgba(163, 102, 255, 0.35));
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 1.25rem rgba(138, 43, 226, 0.35);
  transition: transform 0.5s ease-out, opacity 0.5s ease;
  will-change: transform, opacity;
}

/* Fixed elements within the hero section. */
.fixed-hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.fixed-hero .social-media,
.fixed-hero .school-info {
  position: absolute;
  pointer-events: auto;
}

.social-media {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
}

.school-info {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 100;
  font-size: 0.9rem;
  color: #b19cd9;
  text-align: left;
  line-height: 1.4;
}

.school-info .status {
  color: #8a2be2;
  font-weight: bold;
}

/* General styles for each section. */
.section {
  padding: 5rem 2rem; /* Diubah: Menambah padding vertikal */
  position: relative;
  /* overflow: hidden; <-- Dihapus untuk memperbaiki efek glow yang terpotong */
}

.portfolio-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-content {
  text-align: center;
  position: relative;
  z-index: 10;
  overflow-x: hidden;
  width: 100%;
}

.section h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #8a2be2, #da70d6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section p {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #d1c4e9;
  margin-bottom: 2rem;
}

/* Floating puzzle decorations. */
.decor-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.puzzle-decor {
  position: absolute;
  background: linear-gradient(145deg, rgba(138, 43, 226, 0.55), rgba(163, 102, 255, 0.35));
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 1.25rem rgba(138, 43, 226, 0.35);
  transition: all 0.4s ease;
  animation: floatDecor 6s ease-in-out infinite;
  z-index: 0;
  pointer-events: auto;
}

.puzzle-decor:hover {
  transform: scale(1.1) rotate(10deg);
  background: linear-gradient(145deg, rgba(138, 43, 226, 0.7), rgba(163, 102, 255, 0.5));
  box-shadow: 0 0.5rem 1.875rem rgba(138, 43, 226, 0.4);
}

@keyframes floatDecor {
  0% { transform: translateY(0); }
  50% { transform: translateY(-0.3125rem); }
  100% { transform: translateY(0); }
}

/* Specific positions for each puzzle decor. */
.decor-1 { top: 10%; left: 5%; width: 1.25rem; height: 1.25rem; }
.decor-2 { top: 11%; right: -1%; width: 3.125rem; height: 3.125rem; }
.decor-3 { top: 60%; left: 7%; rotate: -10deg; width: 2.1875rem; height: 2.1875rem; }
.decor-4 { top: 30%; right: 8%; width: 1.75rem; height: 1.75rem; }
.decor-5 { top: 75%; left: 35%; rotate: 5deg; width: 2.25rem; height: 2.25rem; }
.decor-6 { top: 19%; left: 39%; rotate: -27deg; width: 2.25rem; height: 2.25rem; }
.decor-7 { top: 40%; right: 30%; rotate: 30deg; width: 2.8125rem; height: 2.8125rem; }
.decor-8 { top: 45%; left: 30%; width: 1.375rem; height: 1.375rem; }

/* Wrapper for the About Me layout to control centering. */
.about-layout-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 75rem;
  margin: 0 auto;
}

#about-title {
  font-size: 3rem;
  margin-bottom: 2rem;
  text-align: center;
  width: 100%;
}

.about-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Main card in the 'About Me' section. */
.about-card {
  position: relative;
  z-index: 2;
  border-radius: 1.5rem;
  padding: 2.5rem;
  background: hsl(from var(--surface-3) h s l / 0.25);
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
  background-clip: padding-box;
  overflow: visible;
  box-shadow:
    0 0.5rem 2rem rgba(36, 5, 65, 0.1),
    inset 0 0.0625rem 0 rgba(138, 43, 226, 1),
    inset 0 -0.0625rem 0 rgba(81, 5, 151, 1),
    inset -0.625rem 0 1.25rem -0.625rem rgba(138, 43, 226, 0.6);
  width: 100%;
  max-width: 40.625rem; /* Default max-width for mobile */
  flex-grow: 1;
}

.about-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to left, rgba(138, 43, 226, 0.15), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.about-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top left,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(138, 43, 226, 0.2) 40%,
      transparent 70%);
  filter: blur(2.5rem);
  transform: scale(1.5);
  opacity: 0.4;
  pointer-events: none;
  z-index: -2;
}

.about-content h3 {
  font-size: 1.8rem;
  color: #8a2be2;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.about-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #d1c4e9;
  margin-bottom: 1rem;
  text-align: left;
}

.about-content .about-text-wrapper {
  transition: max-height 0.5s ease-in-out;
}

/* Project previews inside the 'About' card. */
.projects-preview {
  margin-top: 2rem;
}

.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.project-item {
  padding: 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
  position: relative;
  overflow: visible;
}

.bot-project {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 0.0625rem solid rgba(138, 43, 226, 0.2);
}

.other-projects {
  background: rgba(138, 43, 226, 0.3);
  color: #ffffff;
  border: 0.0625rem solid rgba(138, 43, 226, 0.4);
}

.project-item:hover {
  transform: translateY(-0.3125rem) scale(1.02);
  box-shadow: 0 0.9375rem 1.875rem rgba(138, 43, 226, 0.3);
}

.bot-project:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0.9375rem 1.875rem rgba(138, 43, 226, 0.2);
}

.other-projects:hover {
  background: rgba(138, 43, 226, 0.5);
}

.project-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.project-item span {
  font-weight: 600;
  font-size: 1rem;
}

.view-more-btn {
  background: rgba(138, 43, 226, 0.3);
  border: 0.0625rem solid rgba(138, 43, 226, 0.5);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.3s ease;
  display: none;
}

.view-more-btn:hover {
  background: rgba(138, 43, 226, 0.5);
}

/* Social media icons with glassmorphism and glow effect. */
.social-icon {
  background: hsl(from var(--surface-3) h s l / 0.25);
  backdrop-filter: blur(0.625rem);
  -webkit-backdrop-filter: blur(0.625rem);
  border: 0.0625rem solid rgba(138, 43, 226, 0.2);
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  z-index: 1;
  width: 2.8125rem;
  height: 2.8125rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a2be2;
  text-decoration: none;
  font-size: 1.2rem;
}

.social-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  filter: blur(0.9375rem);
  transform: scale(1.5);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
}

/* Different glow effects for each social icon. */
.glow-top {
  box-shadow: inset -0.1875rem -0.1rem 0.5rem -0.125rem rgba(138, 43, 226, 0.6);
}

.glow-right {
  box-shadow: inset -0.1875rem 0 0.5rem -0.125rem rgba(138, 43, 226, 0.6);
}

.glow-bottom {
  box-shadow: inset -0.1875rem 0.1rem 0.5rem -0.125rem rgba(138, 43, 226, 0.6);
}

.social-icon:hover {
  transform: translateY(-0.25rem) scale(1.05);
  border-color: rgba(138, 43, 226, 0.5);
  color: #ffffff;
}

.social-icon:hover::before {
  opacity: 1;
}

.glow-top:hover {
  box-shadow: inset -0.1875rem -0.1rem 0.625rem -0.125rem rgba(160, 82, 240, 0.8), 0 0.3125rem 0.9375rem rgba(138, 43, 226, 0.2);
}

.glow-right:hover {
  box-shadow: inset -0.1875rem 0 0.625rem -0.125rem rgba(160, 82, 240, 0.8), 0 0.3125rem 0.9375rem rgba(138, 43, 226, 0.2);
}

.glow-bottom:hover {
  box-shadow: inset -0.1875rem 0.1rem 0.625rem -0.125rem rgba(160, 82, 240, 0.8), 0 0.3125rem 0.9375rem rgba(138, 43, 226, 0.2);
}

/* Portfolio Section */
.portfolio-section .main-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 62.5rem;
  width: 100%;
  margin: 0 auto;
}


/* COLOR CODE SCRIPT.JS */
.code-purple {
  color: #a855f7 !important;
}

.code-green {
  color: #10b981;
}
.code-yellow {
  color: #f59e0b;
}
.code-comment {
  color: #8b5cf6;
  font-style: italic;
}
.code-blue {
  color: #3b82f6; /* Warna baru untuk angka */
}

.portfolio-section .header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.portfolio-section .header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.625rem;
  background: linear-gradient(45deg, #8b5cf6, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.portfolio-section .header p {
  font-size: 1.2rem;
  color: #ccc;
  margin-bottom: 0;
}

/* Abstract shape decorations in the portfolio background. */
.portfolio-section .decorative-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.portfolio-section .shape {
  position: absolute;
  background: linear-gradient(145deg, rgba(138, 43, 226, 0.55), rgba(163, 102, 255, 0.35));
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 1.25rem rgba(138, 43, 226, 0.35);
  opacity: 0.2;
  animation: float 8s ease-in-out infinite;
}

.portfolio-section .shape:nth-child(1) { width: 5rem; height: 5rem; top: 10%; left: 5%; animation-delay: 0s; }
.portfolio-section .shape:nth-child(2) { width: 3.75rem; height: 3.75rem; top: 20%; right: 10%; animation-delay: 2s; }
.portfolio-section .shape:nth-child(3) { width: 4.375rem; height: 4.375rem; top: 60%; left: 8%; animation-delay: 4s; }
.portfolio-section .shape:nth-child(4) { width: 3.125rem; height: 3.125rem; bottom: 20%; right: 15%; animation-delay: 1s; }
.portfolio-section .shape:nth-child(5) { width: 5.625rem; height: 5.625rem; bottom: 10%; left: 15%; animation-delay: 3s; }
.portfolio-section .shape:nth-child(6) { width: 4.0625rem; height: 4.0625rem; top: 40%; right: 5%; animation-delay: 5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-1.25rem) rotate(180deg); }
}

/* Decorative brand text in the background. */
.portfolio-section .brand-text {
  position: absolute;
  font-size: 4rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.05);
  z-index: 99;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.portfolio-section .brand-left {
  top: 20%;
  left: 4%;
  writing-mode: vertical-lr;
  letter-spacing: 2rem;
}

.portfolio-section .brand-right {
  top: 20%;
  right: 4%;
  writing-mode: vertical-lr;
  letter-spacing: 2rem;
}

/* Toggle switch to flip between preview and code. */
.toggle-switch-container {
  display: flex;
  position: relative;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 3.125rem;
  padding: 0.3125rem;
  margin-bottom: 1.25rem;
  width: 13.75rem;
}

.toggle-switch-container .tab-button {
  flex: 1;
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 3.125rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.3s ease;
  z-index: 2;
}

.toggle-switch-container .tab-button.active {
  color: #fff;
}

.toggle-switch-container .glider {
  position: absolute;
  top: 0.3125rem;
  left: 0.3125rem;
  height: calc(100% - 0.625rem);
  width: calc(50% - 0.3125rem);
  background: linear-gradient(45deg, #8a2be2, #a855f7);
  border-radius: 3.125rem;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 1;
}

.toggle-switch-container.code-active .glider {
  transform: translateX(100%);
}

.portfolio-section .section-content {
  overflow: visible;
}

/* Main container for the project slider. */
.project-slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 1rem;
  position: relative;
}

/* Slider navigation buttons (previous and next). */
.slider-nav-btn {
  background: hsl(from var(--surface-3) h s l / 0.25);
  backdrop-filter: blur(0.625rem);
  -webkit-backdrop-filter: blur(0.625rem);
  border: 0.0625rem solid rgba(138, 43, 226, 0.2);
  color: #fff;
  width: 2.8125rem;
  height: 2.8125rem;
  border-radius: 50%;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  overflow: visible;
  box-shadow: inset -0.1875rem 0 0.5rem -0.125rem rgba(138, 43, 226, 0.6);
}

.slider-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  filter: blur(0.9375rem);
  transform: scale(1.5);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.slider-nav-btn:hover {
  background: rgba(138, 43, 226, 0.5);
  transform: translateY(-50%) scale(1.2);
  box-shadow: inset 0.1875rem 0 0.625rem -0.125rem rgba(160, 82, 240, 0.8), 0 0.3125rem 0.9375rem rgba(138, 43, 226, 0.2);
}

.slider-nav-btn:hover::before {
  opacity: 1;
}

.slider-nav-btn.prev {
  left: -1.25rem;
}

.slider-nav-btn.next {
  right: -1.25rem;
}

/* The slider box containing the project cards. */
.project-slider {
  width: 100%;
  /* DIUBAH: Memperkecil lebar maksimum kotak */
  max-width: 50rem; 
  position: relative;
  background: hsl(from var(--surface-3) h s l / 0.25);
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
  border-radius: 1.5rem;
  padding: 1.5rem; 
  box-shadow: 0 0.5rem 2rem rgba(36, 5, 65, 0.1), inset 0 0.0625rem 0 rgba(138, 43, 226, 1), inset 0 -0.0625rem 0 rgba(81, 5, 151, 1), inset -0.625rem 0 1.25rem -0.625rem rgba(138, 43, 226, 0.6);
  overflow: visible;
}

.project-slider::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.1) 0%, rgba(138, 43, 226, 0.2) 40%, transparent 70%);
  filter: blur(2.5rem);
  transform: scale(1.5);
  opacity: 0.4;
  pointer-events: none;
  z-index: -2;
}

.project-slider::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(to left, rgba(138, 43, 226, 0.15), transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.project-content-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
  touch-action: pan-y;
  transition: height 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.project-content-slider {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.project-card-container {
  width: 100%;
  flex-shrink: 0;
  /* DITAMBAHKAN: Memastikan padding internal dihitung dengan benar */
  box-sizing: border-box;
  padding: 0.5rem;
}

.project-card {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.project-card.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.project-preview {
  text-align: center;
}

/* Image slider inside each project card. */
.image-slider-container {
  width: 100%;
  max-width: 37.5rem;
  margin: 0 auto 1.25rem;
  position: relative;
  overflow: hidden;
  border-radius: 0.9375rem;
  /* DITAMBAHKAN: Aspek rasio 16:9 untuk gambar */
  aspect-ratio: 16 / 9;
}

.image-slider {
  display: flex;
  transition: transform 0.4s ease-in-out;
  height: 100%;
}

.image-slider img {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  object-fit: cover;
  background-color: #2d3748;
}

.image-slider-dots {
  position: absolute;
  bottom: 0.9375rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.image-slider-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.image-slider-dot.active {
  background: #fff;
  transform: scale(1.2);
}

/* Text info below the image slider. */
.project-info {
  padding-top: 1rem;
  /* DITAMBAHKAN: Memberi ruang di bagian bawah agar tombol tidak terpotong */
  padding-bottom: 1rem;
}

.project-info h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  margin-top: 0; 
  color: #8b5cf6;
}

.project-sub {
  color: #ddd;
  line-height: 1.5; 
  text-align: center;
  padding: 0 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem; 
}

.project-code {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0.625rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-x: auto;
  text-align: left;
  max-height: 28rem; /* DITAMBAHKAN: Batas tinggi maksimum untuk kotak kode */
  overflow-y: auto; /* DITAMBAHKAN: Scrollbar jika kode lebih panjang */
}

.github-link {
  display: inline-block;
  background: linear-gradient(45deg, #8b5cf6, #a855f7);
  color: white;
  padding: 0.75rem 1.875rem;
  text-decoration: none;
  border-radius: 1.5625rem;
  font-weight: bold;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  box-shadow: 0 0.25rem 0.9375rem rgba(139, 92, 246, 0.3);
}

.github-link:hover {
  transform: translateY(-0.1875rem);
  box-shadow: 0 0.5rem 1.5625rem rgba(139, 92, 246, 0.5);
}

/* Dot navigation below the main slider. */
.navigation {
  display: flex;
  justify-content: center;
  gap: 0.9375rem;
  margin-top: 1.25rem;
}

.nav-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot.active {
  background: #8b5cf6;
  transform: scale(1.2);
}

/* Adjustments for Tablet (max-width: 1024px) */
@media (max-width: 64rem) {
  .slider-nav-btn,
  .portfolio-section .brand-text {
    display: none;
  }
}

/* Adjustments for Mobile (max-width: 768px) */
@media (max-width: 48rem) {
  .navbar {
    padding: 1.5rem 1rem;
  }

  .hamburger-menu {
    top: 1.25rem;
    right: 1.25rem;
  }

  .menu-container {
    top: 1.25rem;
    right: 1.25rem;
    width: calc(100% - 2.5rem);
  }

  .logo {
    font-size: 1.8rem;
  }

  .section {
    padding: 4rem 1rem;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .hero-title {
    font-size: 2.5em;
  }

  .description {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .puzzle-container {
    transform: translate(-50%, -50%) scale(0.8);
  }

  .social-media {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .school-info {
    bottom: 1.5rem;
    left: 1.5rem;
    font-size: 0.8rem;
  }

  .social-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  #about-title {
    text-align: center !important;
    align-self: center !important;
    margin: 0 auto 2rem;
    width: 100%;
  }

  .puzzle-decor {
    width: 1.5625rem;
    height: 1.5625rem;
  }

  .decor-1 { top: 8%; left: 10%; width: 2.8125rem; height: 2.8125rem; }
  .decor-2 { top: 4%; right: 0; transform: translateX(50%); width: 1.875rem; height: 1.875rem; }
  .decor-3 { top: 15%; left: 73%; rotate: 30deg; width: 2.5rem; height: 2.5rem; }
  .decor-4 { top: 90%; left: 28%; width: 2.5rem; height: 2.5rem; }
  .decor-5 { top: 44%; left: 88%; width: 3rem; height: 3rem; }
  .decor-6 { top: 40%; left: 35%; width: 3rem; height: 3rem; }
  .decor-7 { top: 95%; left: 73%; }
  .decor-8 { display: none; }

  .about-container {
    padding: 0;
  }

  .about-card {
    padding: 1.5rem;
  }

  .about-content .about-text-wrapper {
    max-height: 6.25rem;
    overflow: hidden;
  }

  .about-content .about-text-wrapper.expanded {
    max-height: 31.25rem;
  }

  .view-more-btn {
    display: inline-block;
  }

  .project-nav {
    grid-template-columns: 1fr;
  }

  .project-item {
    padding: 1rem;
  }

  .section-content {
    padding: 0;
  }

  .portfolio-section .header h2 {
    font-size: 2rem;
  }

  .project-slider-container {
    width: 100%;
  }

  .project-slider {
    padding: 1rem;
    width: 100%;
  }

  .image-slider-container {
    margin-bottom: 1rem;
  }
  
  .project-info h3 {
    font-size: 1.5rem;
  }

  .project-info p {
    font-size: 0.9rem;
  }

  .github-link {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Desktop Layout Adjustments for About Section (min-width: 1024px) */
@media (min-width: 64rem) {
  .about-layout-wrapper {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
  }

  #about-title {
    flex: 0 0 12.5rem;
    width: auto;
    margin-bottom: 0;
    text-align: right;
    padding-right: 2rem;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .about-container {
    flex: 0 1 40rem; /* Don't grow, can shrink, with a basis of 40rem */
    padding-left: 2rem;
    border-left: 0.0625rem solid rgba(138, 43, 226, 0.3);
    margin: 0;
    justify-content: flex-start;
  }
  .project-sub {
    padding: 0 2rem;
  }
}

/* LOADER STYLES - FIXED VERSION */
:root {
  --primary-color: #9B25E3;
  --secondary-color: #5e5ce6;
  --dark-color: #f5f5f7;
  --light-color: #1a1a1a;
  --panel-color: var(--light-color);
}

/* Prevent scrolling during loading */
html.loading,
body.loading {
  overflow: hidden;
  height: 100%;
  position: fixed;
  width: 100%;
}

#loader {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
}

.loader-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
}

.loader-logo img {
  /* FIXED: Ukuran yang lebih tepat untuk mobile */
  width: 25vw; /* Dikurangi dari 35vw ke 25vw */
  max-width: 6rem; /* Dikurangi dari 8rem ke 6rem */
  min-width: 4rem; /* Tambahkan batas minimum */
  height: auto; /* Pastikan proporsi tetap */
  opacity: 0;
  animation: logoFade 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1s forwards;
}

/* Responsive adjustments untuk logo */
@media (max-width: 48rem) {
  .loader-logo img {
    width: 28vw; /* DIPERBESAR: dari 20vw ke 28vw untuk mobile */
    max-width: 7rem; /* DIPERBESAR: dari 5rem ke 7rem */
    min-width: 4rem; /* DIPERBESAR: dari 3rem ke 4rem */
  }
}

@media (max-width: 30rem) {
  .loader-logo img {
    width: 25vw; /* DIPERBESAR: dari 18vw ke 25vw untuk layar kecil */
    max-width: 6rem; /* DIPERBESAR: dari 4rem ke 6rem */
    min-width: 3.5rem; /* DIPERBESAR: dari 2.5rem ke 3.5rem */
  }
}

@keyframes logoFade {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(2rem);
  }

  20% {
    opacity: 1;
    transform: scale(1.2) translateY(0); /* Dikurangi dari 1.4 ke 1.2 */
  }

  80% {
    opacity: 1;
    transform: scale(1.2) translateY(0);
  }

  100% {
    opacity: 0;
    transform: scale(0.6) translateY(1rem);
  }
}

.loader-panels {
  position: fixed; /* FIXED: Ubah dari absolute ke fixed */
  inset: 0;
  display: flex;
  z-index: 99;
  gap: 0;
  width: 100vw;
  height: 100vh;
}

.loader-panels .panel {
  flex: 1 0 33.3333%;
  min-width: calc(33.3333% + 0.5px);
  background: var(--panel-color);
  position: relative;
  transform: translateY(0);
  animation: panelUp 2s cubic-bezier(0.77, 0, 0.18, 1) forwards;
  overflow: hidden;
  margin-right: -1px;
  height: 100vh; /* FIXED: Pastikan tinggi 100% viewport */
}

.panel .sub-panel {
  position: absolute; /* FIXED: Ubah dari relative ke absolute */
  bottom: 0; /* FIXED: Ubah dari -100% ke 0 */
  left: 0;
  right: 0;
  height: 40%;
  background: var(--primary-color);
  animation: subPanelSlide 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform: translateY(100%); /* FIXED: Mulai dari bawah */
}

.loader-panels .panel:nth-child(1) { 
  animation-delay: 4.5s; 
}
.loader-panels .panel:nth-child(1) .sub-panel {
  animation-delay: 4.4s;
}

.loader-panels .panel:nth-child(2) { 
  animation-delay: 4.6s; 
}
.loader-panels .panel:nth-child(2) .sub-panel {
  animation-delay: 4.5s;
}

.loader-panels .panel:nth-child(3) { 
  animation-delay: 4.7s; 
}
.loader-panels .panel:nth-child(3) .sub-panel {
  animation-delay: 4.6s;
}

@keyframes panelUp {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}

@keyframes subPanelSlide {
  0% {
    transform: translateY(100%) scaleY(0);
  }
  50% {
    transform: translateY(50%) scaleY(1);
  }
  100% {
    transform: translateY(0%) scaleY(3);
  }
}

/* FOOTER STYLES - FIXED */
footer {
  background-color: #252525;
  color: white;
  padding: 2.5rem 0; /* Ubah dari 40px ke rem */
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9375rem; /* Ubah dari 15px ke rem */
  max-width: 100%;
  padding: 0 1rem; /* Tambahkan padding untuk mobile */
}

.footer-divider {
  width: 80%;
  max-width: 62.5rem; /* Ubah dari 1000px ke rem */
  height: 0.0625rem; /* Ubah dari 1px ke rem */
  background-color: #333;
  margin: 0.3125rem 0; /* Ubah dari 5px ke rem */
}

.foot-top {
  margin-bottom: 2rem;
}

.foot-bottom {
  margin-top: 2rem;
}

.footer-contact {
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-contact p {
  margin: 0.3125rem 0; /* Ubah dari 5px ke rem */
  color: rgba(255, 255, 255, 0.8);
}

.copyright {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Mobile adjustments for footer */
@media (max-width: 48rem) {
  footer {
    padding: 2rem 0;
  }
  
  .footer-contact {
    font-size: 0.8rem;
  }
  
  .copyright {
    font-size: 0.8rem;
  }
}