/*==================== VARIABLES CSS ====================*/
:root {
  /* HSL Colors: Tema Gelap - Ungu / Biru (Modern Gradient) */
  --hue-color: 250; /* Base hue for purple */
  --hue-color-alt: 210; /* Blue accent */

  --first-color: hsl(var(--hue-color), 85%, 65%);
  --first-color-alt: hsl(var(--hue-color-alt), 85%, 60%);
  --first-color-lighter: hsl(var(--hue-color), 92%, 85%);
  
  /* Gradient Aksen */
  --gradient-accent: linear-gradient(135deg, var(--first-color) 0%, var(--first-color-alt) 100%);

  /* UI Colors for Dark Mode */
  --title-color: hsl(var(--hue-color), 15%, 95%);
  --text-color: hsl(var(--hue-color), 15%, 80%);
  --text-color-light: hsl(var(--hue-color), 15%, 65%);
  --input-color: hsl(var(--hue-color), 30%, 20%);
  --body-color: hsl(var(--hue-color), 35%, 12%); /* Dark Background */
  --container-color: hsl(var(--hue-color), 35%, 16%); /* Slightly lighter for cards */
  --container-color-rgb: 36, 28, 59; /* For rgba() usage */
  --scroll-bar-color: hsl(var(--hue-color), 20%, 25%);
  --scroll-thumb-color: hsl(var(--hue-color), 20%, 35%);

  /* Typography */
  --body-font: 'Inter', sans-serif;
  --biggest-font-size: 2.5rem;
  --h1-font-size: 1.75rem;
  --h2-font-size: 1.5rem;
  --h3-font-size: 1.25rem;
  --normal-font-size: 1rem;
  --small-font-size: 0.875rem;
  --smaller-font-size: 0.813rem;

  /* Font Weight */
  --font-light: 300;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /* Margins / Paddings */
  --mb-0-25: 0.25rem;
  --mb-0-5: 0.5rem;
  --mb-0-75: 0.75rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  /* Z-Index */
  --z-tooltip: 10;
  --z-fixed: 100;
  --z-modal: 1000;

  /* Shadows - Centralized for consistency */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-accent: 0 4px 20px rgba(119, 85, 255, 0.25);
  --shadow-accent-hover: 0 8px 30px rgba(119, 85, 255, 0.4);
}

/* Typography for larger screens */
@media screen and (min-width: 968px) {
  :root {
    --biggest-font-size: 4rem;
    --h1-font-size: 2.5rem;
    --h2-font-size: 2rem;
    --h3-font-size: 1.5rem;
    --normal-font-size: 1.125rem;
    --small-font-size: 0.938rem;
    --smaller-font-size: 0.875rem;
  }
}

/*==================== LIGHT THEME VARIABLES ====================*/
body.light-theme {
  --title-color: hsl(var(--hue-color), 15%, 15%);
  --text-color: hsl(var(--hue-color), 15%, 35%);
  --text-color-light: hsl(var(--hue-color), 15%, 55%);
  --input-color: hsl(var(--hue-color), 30%, 96%);
  --body-color: hsl(var(--hue-color), 0%, 98%);
  --container-color: #fff;
  --container-color-rgb: 255, 255, 255;
  --scroll-bar-color: hsl(var(--hue-color), 20%, 85%);
  --scroll-thumb-color: hsl(var(--hue-color), 20%, 75%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
  line-height: 1.7;
  /* Only transition colors, not layout properties - key performance fix */
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  transition: color 0.4s ease;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease, transform 0.3s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*==================== REUSABLE CSS CLASSES ====================*/
.section {
  padding: 5rem 0 3rem;
}

.section-title {
  font-size: var(--h2-font-size);
  text-align: center;
  margin-bottom: var(--mb-0-5);
}

.section-subtitle {
  display: block;
  font-size: var(--small-font-size);
  text-align: center;
  margin-bottom: var(--mb-3);
  color: var(--text-color-light);
}

.container {
  max-width: 1024px;
  margin-left: var(--mb-1-5);
  margin-right: var(--mb-1-5);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.75rem;
  border-radius: 0.75rem;
  font-weight: var(--font-medium);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  border: none;
  outline: none;
  will-change: transform;
}

.button-gradient {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.button-gradient:hover {
  box-shadow: var(--shadow-accent-hover);
  transform: translateY(-3px);
}

.button-gradient:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

.button-outline {
  background-color: transparent;
  color: var(--first-color);
  border: 1.5px solid var(--first-color);
}

.button-outline:hover {
  background: var(--first-color);
  color: #fff;
  border-color: var(--first-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
}

.button-outline:active {
  transform: translateY(-1px);
}

.button-small {
  padding: 0.75rem 1.25rem;
  font-size: var(--small-font-size);
  border-radius: 0.5rem;
}

.button-icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.button:hover .button-icon {
  transform: translateX(4px);
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.title-gradient {
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt), #FFB400);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-flex;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 80%;
  margin: 0;
  line-height: 1;
  animation: gradientShift 6s ease infinite;
}

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

/* Typewriter Cursor */
.typewriter-cursor {
  display: inline-block;
  color: var(--first-color);
  animation: blink 0.75s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  from, to { color: transparent }
  50% { color: var(--first-color) }
}

/*==================== HEADER & NAV ====================*/
.header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: hsla(var(--hue-color), 35%, 12%, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

body.light-theme .header {
  background-color: hsla(var(--hue-color), 0%, 98%, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav {
  height: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  color: var(--title-color);
  font-weight: var(--font-bold);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  z-index: calc(var(--z-fixed) + 2);
}

.nav-logo span {
  color: var(--first-color);
}

.nav-btns {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: calc(var(--z-fixed) + 2);
}

.change-theme {
  font-size: 1.25rem;
  color: var(--title-color);
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
}

.change-theme:hover {
  color: var(--first-color);
  transform: rotate(15deg);
}

.nav-toggle {
  color: var(--title-color);
  font-weight: var(--font-medium);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.nav-toggle:hover {
  color: var(--first-color);
}

/* Mobile Navigation Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-fixed);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.nav-overlay.show-overlay {
  opacity: 1;
  visibility: visible;
}

@media screen and (max-width: 767px) {
  .nav-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--container-color);
    padding: 2rem 1.5rem 4rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 1.75rem 1.75rem 0 0;
    z-index: calc(var(--z-fixed) + 1);
    /* Use transform for GPU-accelerated smooth animation */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-menu.show-menu {
    transform: translateY(0);
  }
}

.nav-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--small-font-size);
  color: var(--text-color);
  font-weight: var(--font-medium);
  transition: color 0.3s ease, transform 0.2s ease;
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.nav-link:hover {
  color: var(--first-color);
  transform: translateY(-2px);
}

/* Active Nav Menu */
.active-link {
  color: var(--first-color);
  font-weight: var(--font-bold);
}

.nav-close {
  position: absolute;
  right: 1.5rem;
  bottom: 0.75rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--first-color);
  transition: transform 0.3s ease;
}

.nav-close:hover {
  color: var(--first-color-alt);
  transform: rotate(90deg);
}

/* Sticky Header Customization */
.scroll-header {
  box-shadow: var(--shadow-md);
}

/*==================== HOME / HERO ====================*/
.home-container {
  gap: 2rem;
  padding-top: 2rem;
}

.home-content {
  order: 2;
}

.home-subtitle {
  font-size: var(--normal-font-size);
  color: var(--first-color);
  font-weight: var(--font-medium);
  margin-bottom: var(--mb-0-5);
  display: inline-block;
  opacity: 0.9;
}

.home-title {
  font-size: var(--biggest-font-size);
  margin-bottom: 0;
}

.home-education {
  font-size: var(--h3-font-size);
  color: var(--text-color);
  font-weight: var(--font-medium);
  margin-bottom: var(--mb-1);
  min-height: 1.8em; /* Prevent layout shift from typewriter */
}

.home-description {
  margin-bottom: var(--mb-2);
  color: var(--text-color-light);
  max-width: 480px;
}

.home-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Home Social Buttons */
.home-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.home-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background-color: rgba(var(--container-color-rgb), 0.8);
  color: var(--text-color);
  font-size: 1.35rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  will-change: transform;
}

.home-social-btn:hover {
  background: var(--gradient-accent);
  color: #fff;
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-accent);
  border-color: transparent;
}

.home-social-btn:active {
  transform: translateY(-2px) scale(1.02);
}

body.light-theme .home-social-btn {
  background-color: var(--container-color);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-sm);
  color: var(--text-color);
}

body.light-theme .home-social-btn:hover {
  background: var(--gradient-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}

.home-image {
  order: 1;
  display: flex;
  justify-content: center;
}

.home-blob {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
  box-shadow: 0 0 40px rgba(119, 85, 255, 0.3), 0 0 80px rgba(119, 85, 255, 0.1);
  animation: blobPulse 4s ease-in-out infinite;
  will-change: box-shadow;
}

@keyframes blobPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(119, 85, 255, 0.3), 0 0 80px rgba(119, 85, 255, 0.1); }
  50% { box-shadow: 0 0 50px rgba(119, 85, 255, 0.4), 0 0 100px rgba(119, 85, 255, 0.15); }
}

.home-img {
  width: auto;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--body-color);
}

/*==================== ABOUT ====================*/
.about-container {
  row-gap: 2.5rem;
}

.about-img-wrapper {
  display: flex;
  justify-content: center;
}

.about-img {
  width: 250px;
  border-radius: 1rem;
  border: 4px solid var(--container-color);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.about-img:hover {
  transform: scale(1.03) rotate(1deg);
}

.about-data {
  text-align: center;
}

.about-description {
  margin-bottom: var(--mb-1);
}

.about-description b {
  color: var(--first-color-lighter);
}

.about-info {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: var(--mb-2);
}

.about-box {
  background-color: var(--container-color);
  border-radius: 0.75rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  will-change: transform;
}

body.light-theme .about-box {
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.about-box:hover {
  transform: translateY(-5px);
  border-color: var(--first-color);
  box-shadow: var(--shadow-accent);
}

.about-icon {
  font-size: 1.5rem;
  color: var(--first-color);
  margin-bottom: var(--mb-0-5);
}

.about-title {
  font-size: var(--small-font-size);
}

.about-subtitle {
  font-size: var(--smaller-font-size);
  color: var(--text-color-light);
}

/*==================== SKILLS ====================*/
/* Filter Buttons */
.skills-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.skills-filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 2rem;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background-color: transparent;
  color: var(--text-color);
  font-family: var(--body-font);
  font-size: var(--small-font-size);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

body.light-theme .skills-filter-btn {
  border-color: rgba(0, 0, 0, 0.1);
}

.skills-filter-btn:hover {
  border-color: var(--first-color);
  color: var(--first-color);
  transform: translateY(-2px);
}

.skills-filter-btn.active {
  background: var(--gradient-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Individual Skill Card */
.skill-card {
  background-color: var(--container-color);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
  /* Smooth filter transitions instead of display:none */
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), 
              opacity 0.3s ease, 
              border-color 0.3s ease, 
              box-shadow 0.3s ease;
}

body.light-theme .skill-card {
  border-color: rgba(0, 0, 0, 0.06);
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(119, 85, 255, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.skill-card:hover {
  border-color: rgba(119, 85, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(119, 85, 255, 0.12);
}

.skill-card:hover::before {
  opacity: 1;
}

/* Card Header: Icon + Description */
.skill-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.skill-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 0.75rem;
  background: rgba(119, 85, 255, 0.12);
  color: var(--first-color);
  font-size: 1.35rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.skill-card:hover .skill-card-icon {
  background: var(--gradient-accent);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(119, 85, 255, 0.3);
}

/* SVG Icons inside skill cards */
.skill-svg-icon {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
  flex-shrink: 0;
}

/* Image Icons inside skill cards */
.skill-img-icon {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 0.2rem;
}

.skill-card-desc {
  font-size: var(--smaller-font-size);
  color: var(--text-color-light);
  line-height: 1.4;
}

/* Skill Name */
.skill-card-name {
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--title-color);
  margin-bottom: 0.25rem;
  position: relative;
  z-index: 1;
}

/* Category Label */
.skill-card-category {
  font-size: 0.7rem;
  font-weight: var(--font-semi-bold);
  color: var(--first-color);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* Card hide/show animation for filter — smooth version */
.skill-card.hide {
  opacity: 0;
  transform: scale(0.85) translateY(10px);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

.skill-card.show {
  animation: skillFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes skillFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/*==================== PROJECTS ====================*/
.projects-container {
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

.projects-card {
  background-color: var(--container-color);
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

body.light-theme .projects-card {
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-sm);
}

.projects-card:hover {
  transform: translateY(-6px);
  border-color: rgba(119, 85, 255, 0.3);
  box-shadow: 0 12px 30px rgba(119, 85, 255, 0.12);
}

.projects-img-wrapper {
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: var(--mb-1);
}

.projects-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.projects-card:hover .projects-img {
  transform: scale(1.06);
}

.projects-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.projects-title {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-0-5);
}

.projects-description {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
  margin-bottom: var(--mb-1);
  flex-grow: 1;
}

.projects-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--mb-1-5);
}

.tech-tag {
  font-size: var(--smaller-font-size);
  color: var(--first-color-lighter);
  background-color: rgba(119, 85, 255, 0.1);
  padding: 0.3rem 0.65rem;
  border-radius: 0.35rem;
  font-weight: var(--font-medium);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.tech-tag:hover {
  background-color: rgba(119, 85, 255, 0.2);
  transform: translateY(-1px);
}

.projects-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

/*==================== LEARNING JOURNEY ====================*/
.journey-container {
  max-width: 600px;
  margin: 0 auto;
}

.journey-timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(119, 85, 255, 0.2);
}

.journey-item {
  position: relative;
  margin-bottom: 2rem;
}

.journey-item:last-child {
  margin-bottom: 0;
}

.journey-point {
  position: absolute;
  left: -1.82rem;
  top: 0.3rem;
  width: 0.65rem;
  height: 0.65rem;
  background: var(--gradient-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0.35rem var(--body-color), 0 0 0 0.45rem rgba(119, 85, 255, 0.3);
  transition: box-shadow 0.3s ease;
}

.journey-item:hover .journey-point {
  box-shadow: 0 0 0 0.35rem var(--body-color), 0 0 0 0.55rem rgba(119, 85, 255, 0.5);
}

.journey-content {
  background-color: var(--container-color);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

body.light-theme .journey-content {
  border-color: rgba(0, 0, 0, 0.06);
}

.journey-content:hover {
  transform: translateX(6px);
  border-color: rgba(119, 85, 255, 0.2);
  box-shadow: var(--shadow-accent);
}

.journey-title {
  font-size: var(--normal-font-size);
  color: var(--title-color);
  margin-bottom: var(--mb-0-75);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

.journey-title i {
  color: var(--first-color);
  font-size: 1.2rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.journey-description {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
  line-height: 1.7;
}

/*==================== CONTACT ====================*/
.contact-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

/* Left Column - Info */
.contact-info-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-heading {
  font-size: var(--h1-font-size);
  font-weight: var(--font-bold);
  color: var(--title-color);
  line-height: 1.2;
}

.contact-description {
  color: var(--text-color-light);
  font-size: var(--normal-font-size);
  line-height: 1.8;
  max-width: 440px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 0.75rem;
  background-color: rgba(119, 85, 255, 0.12);
  color: var(--first-color);
  font-size: 1.35rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-info-item:hover .contact-info-icon {
  background: var(--gradient-accent);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(119, 85, 255, 0.3);
}

body.light-theme .contact-info-icon {
  background-color: hsl(var(--hue-color), 80%, 93%);
}

.contact-info-title {
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--title-color);
  margin-bottom: 0.1rem;
}

.contact-info-subtitle {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
  word-break: break-all; /* Prevent overflow on small screens */
}

/* Right Column - Form */
.contact-form-col {
  background-color: var(--container-color);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 0.3s ease;
}

body.light-theme .contact-form-col {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-sm);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form-label {
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--title-color);
}

.contact-form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  background-color: var(--input-color);
  color: var(--text-color); 
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

body.light-theme .contact-form-input {
  border: 1.5px solid rgba(0, 0, 0, 0.1);
}

.contact-form-input::placeholder {
  color: var(--text-color-light);
  opacity: 0.6;
}

.contact-form-input:focus {
  border-color: var(--first-color);
  box-shadow: 0 0 0 4px rgba(119, 85, 255, 0.15);
}

.contact-form-textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--gradient-accent);
  color: #fff;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi-bold);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-accent);
  width: 100%;
  will-change: transform;
}

.contact-form-btn:hover {
  box-shadow: var(--shadow-accent-hover);
  transform: translateY(-3px);
}

.contact-form-btn:active {
  transform: translateY(-1px);
}

.contact-form-btn i {
  font-size: 1.25rem;
}

.contact-form-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.contact-form-btn:disabled:hover {
  transform: none !important;
  box-shadow: var(--shadow-accent);
}

/* Form feedback message */
.contact-form-message {
  font-size: var(--small-font-size);
  font-weight: var(--font-medium);
  padding: 0;
  margin: 0;
  text-align: center;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.contact-form-message.success {
  color: hsl(145, 80%, 60%);
  background-color: hsla(145, 80%, 60%, 0.1);
  padding: 0.75rem 1rem;
  border: 1px solid hsla(145, 80%, 60%, 0.2);
}

.contact-form-message.error {
  color: hsl(0, 80%, 65%);
  background-color: hsla(0, 80%, 65%, 0.1);
  padding: 0.75rem 1rem;
  border: 1px solid hsla(0, 80%, 65%, 0.2);
}

/*==================== FOOTER ====================*/
.footer {
  background-color: var(--container-color);
  padding-top: 3rem;
  padding-bottom: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.4s ease;
}

body.light-theme .footer {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-title {
  font-size: var(--h2-font-size);
  margin-bottom: var(--mb-1-5);
  color: var(--title-color);
}

.footer-list {
  display: flex;
  gap: 1.5rem;
  margin-bottom: var(--mb-1-5);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--text-color);
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.footer-link:hover {
  color: var(--first-color);
  transform: translateY(-2px);
}

.footer-copy {
  font-size: var(--smaller-font-size);
  color: var(--text-color-light);
  margin-top: var(--mb-3);
}

/*==================== SCROLL UP ====================*/
.scrollup {
  position: fixed;
  right: 1.5rem;
  bottom: -20%;
  background: var(--gradient-accent);
  opacity: 0.9;
  padding: 0.5rem;
  border-radius: 0.5rem;
  z-index: var(--z-tooltip);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, bottom 0.4s ease;
  will-change: transform, bottom;
}

.scrollup:hover {
  opacity: 1;
  transform: translateY(-4px);
}

.scrollup-icon {
  font-size: 1.5rem;
  color: #fff;
}

.show-scroll {
  bottom: 3rem;
}

/*==================== SCROLL BAR ====================*/
::-webkit-scrollbar {
  width: 0.45rem;
  background-color: var(--scroll-bar-color);
  border-radius: 0.5rem;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb-color);
  border-radius: 0.5rem;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-color-light);
}

/*==================== ANIMATIONS (Fade In / Scroll) ====================*/
.fade-in {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for children in view */
.fade-in.appear .about-box:nth-child(1) { transition-delay: 0.1s; }
.fade-in.appear .about-box:nth-child(2) { transition-delay: 0.2s; }
.fade-in.appear .about-box:nth-child(3) { transition-delay: 0.3s; }

.fade-in.appear .journey-item:nth-child(1) { transition-delay: 0.1s; }
.fade-in.appear .journey-item:nth-child(2) { transition-delay: 0.2s; }
.fade-in.appear .journey-item:nth-child(3) { transition-delay: 0.3s; }

/*==================== RESPONSIVE / MEDIA QUERIES ====================*/
/* Extra small devices */
@media screen and (max-width: 350px) {
  .container {
    margin-left: var(--mb-1);
    margin-right: var(--mb-1);
  }
  .nav-menu {
    padding: 2rem 0.5rem 4rem;
  }
  .nav-list {
    gap: 1rem;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .home-buttons {
    flex-direction: column;
  }
  .about-info {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .about-box {
    padding: 1rem 0.25rem;
  }
}

/* For medium devices */
@media screen and (min-width: 576px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .projects-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-info {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (min-width: 768px) {
  body {
    margin: 0;
  }
  .section {
    padding: 6rem 0 4rem;
  }
  .nav {
    height: calc(4rem + 1rem);
  }
  .nav-menu {
    margin-left: auto;
    margin-right: 2.5rem;
  }
  .nav-list {
    display: flex;
    column-gap: 2rem;
  }
  .nav-link {
    text-transform: capitalize;
  }
  .nav-toggle, .nav-close {
    display: none;
  }
  .nav-overlay {
    display: none;
  }
  
  .home-container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }
  .home-content {
    order: 1;
  }
  .home-image {
    order: 2;
  }
  .home-blob {
    width: 320px;
    height: 320px;
  }
  
  .about-container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }
  .about-img {
    width: 320px;
  }
  .about-data {
    text-align: left;
  }
  .about-description {
    margin-bottom: var(--mb-1-5);
  }
  .about-info {
    justify-content: flex-start;
  }
  
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .projects-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .projects-img {
    height: 180px;
  }
  
  .contact-container {
    grid-template-columns: repeat(2, 1fr);
    align-items: flex-start;
  }
}

/* For large devices */
@media screen and (min-width: 1024px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }
  .home-blob {
    width: 380px;
    height: 380px;
  }
  .about-img {
    width: 380px;
  }
}

@media screen and (min-width: 1200px) {
  .home-title {
    font-size: var(--biggest-font-size);
  }
  .container {
    max-width: 1100px;
  }
}

/* Ultra-wide / 4K support */
@media screen and (min-width: 1920px) {
  .container {
    max-width: 1200px;
  }
  :root {
    --biggest-font-size: 4.5rem;
    --h1-font-size: 3rem;
  }
}

/* Touch device optimizations */
@media (hover: none) {
  .button:active {
    transform: scale(0.97);
  }
  .projects-card:active {
    transform: scale(0.98);
  }
  .skill-card:active {
    transform: scale(0.97);
  }
  .home-social-btn:active {
    transform: scale(0.95);
  }
}

/* Reduced motion for accessibility */
@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: auto;
  }
  .fade-in {
    opacity: 1;
    transform: none;
  }
}
