/* ========== ULTRA OPTIMIZED - NO LAG VERSION ========== */
/* Browser Compatibility Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

/* Disable ALL animations on load */
.no-animations * {
  animation: none !important;
  -webkit-animation: none !important;
  transition: none !important;
  -webkit-transition: none !important;
}

:root {
  --primary-color: #e63946;
  --secondary-color: #06b6d4;
  --dark-bg: #0f0f1e;
  --light-bg: #1a1a2e;
  --card-bg: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #a8a8a8;
  --accent-gradient: linear-gradient(135deg, #e63946 0%, #06b6d4 100%);

  --section-padding: 80px 0;
  --container-padding: 0 5%;

  /* Fast transitions only */
  --transition: all 0.2s ease;
  --transition-smooth: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-red: rgba(230, 57, 70, 0.45);
  --glow-blue: rgba(6, 182, 212, 0.45);
}

/* Performance optimizations */
.hero-content,
.hero-image,
.floating-card,
.nav-link,
.btn,
.social-icon,
.portfolio-item,
.skill-card,
.contact-card {
  will-change: auto;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Enable hardware acceleration for animations */
@media (prefers-reduced-motion: no-preference) {
  .floating-card,
  .portfolio-item,
  .skill-card,
  .contact-card,
  .btn,
  .nav-link,
  .social-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    to bottom,
    var(--dark-bg) 0%,
    #1a1a2e 50%,
    var(--dark-bg) 100%
  );
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 10% 20%,
      var(--glow-red) 0%,
      transparent 50%
    ),
    radial-gradient(circle at 90% 80%, var(--glow-blue) 0%, transparent 50%);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
  will-change: opacity;
}

body.loaded {
  animation: pageLoad 0.8s ease-out forwards;
}

/* GPU acceleration for smoother animations */
.navbar,
.hero,
.portfolio-item,
.skill-card,
.contact-card {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--container-padding);
}

section {
  padding: var(--section-padding);
  position: relative;
  z-index: 1;
}

/* ========== Navigation ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 15, 30, 0.95);
  z-index: 1000;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
  box-shadow: 0 2px 15px rgba(230, 57, 70, 0.3);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand h2 {
  font-size: 1.8rem;
  color: var(--text-primary);
  font-weight: 700;
}

.nav-brand h2:hover {
  color: var(--primary-color);
}

.nav-brand span {
  color: var(--secondary-color);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* ========== Hero Section ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 30%,
      var(--glow-red) 0%,
      transparent 40%
    ),
    radial-gradient(circle at 80% 70%, var(--glow-blue) 0%, transparent 40%);
  opacity: 0.6;
  z-index: 0;
  animation: pulseGlow 8s ease-in-out infinite;
}

.hero::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(
    circle,
    rgba(230, 57, 70, 0.1),
    rgba(6, 182, 212, 0.1),
    transparent
  );
  border-radius: 50%;
  animation: rotate 20s linear infinite;
  z-index: 0;
  will-change: transform;
}

/* Disable heavy animations on mobile */
@media (max-width: 768px) {
  .hero::after {
    animation: none;
    opacity: 0.5;
  }

  .hero::before {
    animation: none;
  }
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content {
  z-index: 2;
  position: relative;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -1px;
}

.gradient-text {
  color: var(--primary-color);
}

.hero-subtitle {
  font-size: 1.8rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
  min-height: 60px;
  font-weight: 600;
}

.typing-text::after {
  content: "|";
  animation: blink 0.7s infinite;
}

.hero-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.8;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn {
  padding: 0.8rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  border: 2px solid transparent;
  font-size: 1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-primary);
}

.btn-primary:hover {
  background: #d62839;
  transform: translate3d(0, -5px, 0) scale(1.05);
  box-shadow: 0 15px 40px rgba(230, 57, 70, 0.6),
    0 0 60px rgba(230, 57, 70, 0.4);
}

.btn-secondary {
  border: 2px solid var(--secondary-color);
  color: var(--text-primary);
  background: transparent;
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--secondary-color);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

.btn-secondary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-secondary:hover {
  background: transparent;
  border-color: var(--secondary-color);
  color: var(--text-primary);
  transform: translate3d(0, -5px, 0) scale(1.05);
  box-shadow: 0 15px 40px rgba(6, 182, 212, 0.6),
    0 0 60px rgba(6, 182, 212, 0.4);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  color: var(--text-primary);
  text-decoration: none;
  border: 2px solid var(--primary-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.social-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--primary-color);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
}

.social-icon:hover::before {
  width: 100px;
  height: 100px;
}

.social-icon:hover {
  background: transparent;
  border-color: var(--primary-color);
  transform: translate3d(0, -8px, 0) scale(1.2) rotate(360deg);
  box-shadow: 0 15px 35px rgba(230, 57, 70, 0.6),
    0 0 50px rgba(230, 57, 70, 0.4);
}

.social-icon i {
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
}

.social-icon:hover i {
  transform: scale(1.2);
}

/* Hero Image */
.hero-image {
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
  perspective: 2500px;
}

.image-wrapper {
  position: relative;
  width: 100%;
  height: 620px; /* lebih besar agar kartu tidak terpotong */
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  perspective: 2500px;
  overflow: visible;
  padding: 40px; /* kurangi padding agar kartu menjadi lebih dominan */
}

.floating-card {
  position: absolute;
  background: var(--card-bg);
  border-radius: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  will-change: transform;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
}

/* ========== Stacked Cards Effect with Real Elements ========== */
.card-stack {
  position: relative;
  width: 300px; /* diperbesar */
  height: 440px; /* diperbesar */
  transform-style: preserve-3d;
}

.stack-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 25px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.stack-card-2 {
  background: linear-gradient(
    135deg,
    rgba(230, 57, 70, 0.9),
    rgba(6, 182, 212, 0.75)
  );
  box-shadow: 0 25px 70px rgba(230, 57, 70, 0.6),
    0 0 90px rgba(6, 182, 212, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.2);
  transform: translate3d(-16px, 16px, -14px) scale(0.985) rotateZ(-3deg);
  z-index: 1;
}

.stack-card-3 {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.9),
    rgba(230, 57, 70, 0.75)
  );
  box-shadow: 0 20px 60px rgba(6, 182, 212, 0.6),
    0 0 80px rgba(230, 57, 70, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.2);
  transform: translate3d(-28px, 28px, -24px) scale(0.96) rotateZ(-6deg);
  z-index: 0;
}

.card-stack:hover .stack-card-2 {
  transform: translate3d(-64px, 18px, -18px) scale(0.99) rotateZ(-12deg);
}

.card-stack:hover .stack-card-3 {
  transform: translate3d(-140px, 36px, -32px) scale(0.97) rotateZ(-20deg);
}

.card-1 {
  position: relative;
  width: 300px; /* diselaraskan dengan card-stack */
  height: 440px; /* diselaraskan dengan card-stack */
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 25px;
  box-shadow: 0 20px 60px rgba(230, 57, 70, 0.4),
    0 0 80px rgba(6, 182, 212, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.card-stack:hover .card-1 {
  transform: translate3d(30px, -22px, 40px) scale(1.16) rotateZ(4deg);
  box-shadow: 0 80px 220px rgba(230, 57, 70, 1),
    0 0 260px rgba(6, 182, 212, 0.95), 0 0 320px rgba(230, 57, 70, 0.9),
    inset 0 0 90px rgba(255, 255, 255, 0.75);
  filter: brightness(1.4) saturate(1.5)
    drop-shadow(0 0 60px rgba(230, 57, 70, 1));
}

/* Glow / 'mekar' effect behind stack */
.card-stack::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 420px;
  height: 420px;
  background: radial-gradient(
    circle,
    rgba(230, 57, 70, 0.18),
    rgba(6, 182, 212, 0.12) 40%,
    transparent 60%
  );
  filter: blur(30px);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
  z-index: 0;
  pointer-events: none;
}

.card-stack:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08) rotate(4deg);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 25px;
  -webkit-transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-1:hover .profile-img {
  -webkit-transform: scale(1.08);
  transform: scale(1.08);
  -webkit-filter: brightness(1.15) contrast(1.1) saturate(1.25);
  filter: brightness(1.15) contrast(1.1) saturate(1.25);
}

/* CARD 2 & 3 DIHAPUS - TIDAK DIPERLUKAN */

/* Reduce floating animation complexity on mobile */
@media (max-width: 768px) {
  .card-1 {
    animation-duration: 4s;
    width: 260px;
    height: 380px;
  }

  .image-wrapper {
    padding: 30px;
    height: 520px; /* ukuran tablet agar kartu lebih besar */
  }

  /* Smaller stacked effect on mobile */
  .card-1:hover::before {
    -webkit-transform: translate3d(-20px, 8px, -8px) scale(0.97) rotateZ(-6deg);
    transform: translate3d(-20px, 8px, -8px) scale(0.97) rotateZ(-6deg);
  }

  .card-1:hover::after {
    -webkit-transform: translate3d(-40px, 16px, -16px) scale(0.94)
      rotateZ(-10deg);
    transform: translate3d(-40px, 16px, -16px) scale(0.94) rotateZ(-10deg);
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}

.mouse {
  width: 25px;
  height: 40px;
  border: 2px solid var(--text-secondary);
  border-radius: 20px;
  position: relative;
}

.mouse::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--secondary-color);
  border-radius: 2px;
  animation: scroll 1.5s infinite;
}

/* ========== Section Headers ========== */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ========== About Section ========== */
.about {
  background: var(--light-bg);
  position: relative;
  overflow: hidden;
}

.about::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--glow-blue), transparent);
  opacity: 0.2;
  transform: translateY(-50%);
  animation: pulseGlow 6s ease-in-out infinite;
  will-change: transform, opacity;
}

@media (max-width: 768px) {
  .about::before {
    animation: none;
  }
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-img-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  perspective: 2000px;
  padding: 80px;
  overflow: visible;
}

.profile-photo {
  width: 360px;
  height: 360px;
  object-fit: cover;
  border-radius: 20px;
  position: relative;
  z-index: 10;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  /* Remove transition for instant 3D response */
  -webkit-transition: box-shadow 0.3s ease;
  transition: box-shadow 0.3s ease;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  cursor: pointer;
  /* Instant transform with will-change */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  isolation: isolate;
}

/* Extend hover area beyond photo */
.profile-photo::before {
  content: "";
  position: absolute;
  top: -80px;
  left: -80px;
  right: -80px;
  bottom: -80px;
  z-index: -1;
  pointer-events: auto;
}

.profile-photo:hover {
  box-shadow: 0 25px 80px rgba(230, 57, 70, 0.7),
    0 0 100px rgba(6, 182, 212, 0.5);
}

.about-shape {
  position: absolute;
  width: 380px;
  height: 380px;
  background: var(--primary-color);
  opacity: 0.15;
  border-radius: 20px;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(-30px);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  pointer-events: none;
  will-change: transform;
}

/* Simplify morphing on mobile */
@media (max-width: 768px) {
  .about-shape {
    animation: none;
    border-radius: 20px;
  }
}

.about-text h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.about-text p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.about-info {
  margin-bottom: 2rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.info-item i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

/* ========== Portfolio Section ========== */
.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.5rem;
  background: var(--light-bg);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
  width: 200px;
  height: 200px;
}

.filter-btn:hover,
.filter-btn.active {
  background: transparent;
  border-color: transparent;
  color: white;
  transform: translate3d(0, -4px, 0) scale(1.08);
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.5),
    0 0 50px rgba(6, 182, 212, 0.3);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.portfolio-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
}

.portfolio-item::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.3), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
  pointer-events: none;
}

.portfolio-item:hover::before {
  opacity: 1;
}

.portfolio-item:hover {
  transform: translate3d(0, -15px, 0) scale(1.05);
  box-shadow: 0 25px 60px rgba(230, 57, 70, 0.5),
    0 0 80px rgba(6, 182, 212, 0.3), 0 0 120px rgba(230, 57, 70, 0.2);
}

.portfolio-image {
  position: relative;
  overflow: hidden;
  height: 300px;
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-secondary);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover .placeholder-image {
  transform: scale(1.15) rotate(5deg);
  filter: brightness(1.3);
}

.placeholder-image i {
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover .placeholder-image i {
  transform: scale(1.3) rotate(-5deg);
  text-shadow: 0 0 30px rgba(230, 57, 70, 0.8);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(230, 57, 70, 0.95),
    rgba(6, 182, 212, 0.95)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.portfolio-overlay p {
  margin-bottom: 1.2rem;
}

.portfolio-links {
  display: flex;
  gap: 1rem;
}

.portfolio-link {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.portfolio-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: white;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  z-index: -1;
}

.portfolio-link:hover::before {
  width: 100%;
  height: 100%;
}

.portfolio-link:hover {
  background: transparent;
  border-color: white;
  color: var(--primary-color);
  transform: scale(1.3) rotate(360deg);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
}

.portfolio-link i {
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
}

.portfolio-link:hover i {
  transform: scale(1.2);
}

/* ========== Skills Section ========== */
.skills {
  background: var(--light-bg);
  position: relative;
  overflow: hidden;
}

.skills::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--glow-red), transparent);
  opacity: 0.15;
  animation: pulseGlow 8s ease-in-out infinite;
  will-change: transform, opacity;
}

@media (max-width: 768px) {
  .skills::after {
    animation: none;
    width: 300px;
    height: 300px;
  }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-card {
  background: var(--dark-bg);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  transform: translate3d(0, 0, 0);
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    var(--primary-color),
    var(--secondary-color),
    var(--primary-color)
  );
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  z-index: 0;
}

.skill-card:hover::before {
  opacity: 0.1;
  transform: rotate(180deg);
}

.skill-card:hover {
  transform: translate3d(0, -15px, 0) scale(1.08);
  border-color: var(--primary-color);
  box-shadow: 0 25px 60px rgba(230, 57, 70, 0.5),
    0 0 80px rgba(6, 182, 212, 0.3), 0 0 100px rgba(230, 57, 70, 0.2),
    inset 0 0 30px rgba(230, 57, 70, 0.1);
}

.skill-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  background: var(--accent-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: var(--transition);
  position: relative;
  z-index: 1;
  animation: gradientShift 4s ease infinite;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 5px 15px rgba(230, 57, 70, 0.3));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card:hover .skill-icon {
  transform: scale(1.3) rotateY(360deg);
  filter: drop-shadow(0 0 30px rgba(230, 57, 70, 0.8));
}

.skill-card:hover .skill-logo {
  filter: drop-shadow(0 15px 40px rgba(230, 57, 70, 0.8));
  transform: scale(1.2) translateY(-5px);
}

.skill-card h3 {
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  position: relative;
  z-index: 1;
  font-weight: 700;
}

.skill-progress {
  width: 100%;
  height: 8px;
  background: var(--light-bg);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
  box-shadow: 0 0 15px rgba(230, 57, 70, 0.5);
}

.skill-percentage {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* ========== Contact Section ========== */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  transform: translate3d(0, 0, 0);
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2), transparent);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: 0;
}

.contact-card:hover::before {
  width: 400px;
  height: 400px;
}

.contact-card:hover {
  transform: translate3d(0, -12px, 0) scale(1.05);
  box-shadow: 0 25px 60px rgba(6, 182, 212, 0.5),
    0 0 80px rgba(6, 182, 212, 0.4), 0 0 100px rgba(230, 57, 70, 0.2);
  border-color: var(--secondary-color);
}

.contact-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.2rem;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 5px 20px rgba(230, 57, 70, 0.3);
}

.contact-card:hover .contact-icon {
  transform: scale(1.2) rotate(360deg) translateY(-5px);
  box-shadow: 0 15px 50px rgba(230, 57, 70, 0.7),
    0 0 60px rgba(6, 182, 212, 0.5);
}

.contact-card h3 {
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
  position: relative;
  z-index: 1;
  font-weight: 700;
}

.contact-card p {
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
}

.contact-form {
  background: var(--card-bg);
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1.2rem;
  background: var(--dark-bg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3),
    inset 0 0 10px rgba(6, 182, 212, 0.1);
  background: rgba(6, 182, 212, 0.05);
  transform: translate3d(0, -2px, 0);
}

.form-group textarea {
  resize: vertical;
}

/* ========== Parallax Elements Between Sections ========== */
.parallax-container {
  position: relative;
  height: 200px;
  overflow: hidden;
  pointer-events: none;
}

.parallax-element {
  position: absolute;
  font-size: 3rem;
  opacity: 0.15;
  color: var(--primary-color);
  will-change: transform;
  -webkit-transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-animation: float 6s ease-in-out infinite;
  animation: float 6s ease-in-out infinite;
}

.parallax-element i {
  display: block;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.parallax-element span {
  font-weight: 700;
  font-family: "Courier New", monospace;
}

/* Section 1: Code Elements (Hero -> About) */
.parallax-section-1 .code-snippet {
  top: 20%;
  left: 10%;
  color: #06b6d4;
  animation-delay: 0s;
}

.parallax-section-1 .bracket {
  top: 60%;
  left: 75%;
  font-size: 4rem;
  color: #e63946;
  animation-delay: 0.5s;
}

.parallax-section-1 .tag {
  top: 30%;
  right: 15%;
  font-size: 3.5rem;
  color: #06b6d4;
  animation-delay: 1s;
}

.parallax-section-1 .semicolon {
  top: 70%;
  left: 40%;
  font-size: 5rem;
  color: #e63946;
  animation-delay: 1.5s;
}

.parallax-section-1 .terminal {
  top: 15%;
  right: 35%;
  color: #06b6d4;
  animation-delay: 2s;
}

/* Section 2: Design Elements (About -> Portfolio) */
.parallax-section-2 .design-icon {
  top: 25%;
  left: 15%;
  color: #e63946;
  animation-delay: 0.2s;
}

.parallax-section-2 .pen-tool {
  top: 55%;
  left: 65%;
  color: #06b6d4;
  animation-delay: 0.7s;
}

.parallax-section-2 .cursor-icon {
  top: 35%;
  right: 20%;
  color: #e63946;
  animation-delay: 1.2s;
}

.parallax-section-2 .shapes {
  top: 65%;
  left: 35%;
  font-size: 3.5rem;
  color: #06b6d4;
  animation-delay: 1.7s;
}

.parallax-section-2 .vector {
  top: 10%;
  right: 40%;
  color: #e63946;
  animation-delay: 2.2s;
}

/* Section 3: Tech Icons (Portfolio -> Skills) */
.parallax-section-3 .tech-react {
  top: 20%;
  left: 12%;
  color: #61dafb;
  animation-delay: 0.3s;
}

.parallax-section-3 .tech-node {
  top: 50%;
  left: 70%;
  color: #68a063;
  animation-delay: 0.8s;
}

.parallax-section-3 .tech-js {
  top: 40%;
  right: 18%;
  color: #f7df1e;
  animation-delay: 1.3s;
}

.parallax-section-3 .tech-python {
  top: 75%;
  left: 38%;
  color: #3776ab;
  animation-delay: 1.8s;
}

.parallax-section-3 .tech-git {
  top: 12%;
  right: 42%;
  color: #f05032;
  animation-delay: 2.3s;
}

/* Section 4: Communication Icons (Skills -> Contact) */
.parallax-section-4 .comm-mail {
  top: 22%;
  left: 18%;
  color: #e63946;
  animation-delay: 0.4s;
}

.parallax-section-4 .comm-chat {
  top: 58%;
  left: 68%;
  color: #06b6d4;
  animation-delay: 0.9s;
}

.parallax-section-4 .comm-phone {
  top: 32%;
  right: 22%;
  color: #e63946;
  animation-delay: 1.4s;
}

.parallax-section-4 .comm-message {
  top: 68%;
  left: 42%;
  color: #06b6d4;
  animation-delay: 1.9s;
}

.parallax-section-4 .comm-handshake {
  top: 18%;
  right: 38%;
  font-size: 3.5rem;
  color: #e63946;
  animation-delay: 2.4s;
}

/* ========== Footer ========== */
.footer {
  background: var(--light-bg);
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h2 {
  margin-bottom: 1rem;
}

.footer-brand span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand p {
  color: var(--text-secondary);
}

.footer-links h3,
.footer-social h3 {
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

/* ========== ONLY ESSENTIAL ANIMATIONS ========== */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes pageLoad {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  60% {
    opacity: 1;
    transform: translateY(-6px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: translate3d(0, -20px, 0) scale(1.02);
    filter: brightness(1.1);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    filter: brightness(1);
  }
}

@keyframes pulseGlow {
  0% {
    opacity: 0.4;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.4;
    transform: scale(0.95);
  }
}

@keyframes rotate {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes scroll {
  0% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  50% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
  /* Reduce padding for mobile */
  :root {
    --section-padding: 80px 0;
  }

  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: rgba(26, 26, 46, 0.98);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    padding: 2rem 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-image {
    order: -1;
  }

  .image-wrapper {
    height: 520px; /* tablet breakpoint: pertahankan ruang untuk kartu yang diperbesar */
  }

  .hero-buttons {
    justify-content: center;
    flex-direction: column;
  }

  .social-links {
    justify-content: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.3rem;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .contact-content {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-social .social-links {
    justify-content: center;
  }

  .section-title {
    font-size: 2rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Disable backdrop-filter on mobile for better performance */
  .navbar,
  .floating-card,
  .contact-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Simplify shadows on mobile */
  .portfolio-item:hover,
  .skill-card:hover,
  .contact-card:hover {
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.3);
  }

  /* Reduce parallax elements on mobile */
  .parallax-container {
    height: 100px;
  }

  .parallax-element {
    font-size: 2rem;
    opacity: 0.1;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  /* kecilkan kembali gambar/kartu pada layar sangat kecil */
  .image-wrapper {
    height: 350px;
    padding: 20px;
  }

  .btn {
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
  }
}
