/* ===== CSS Variables ===== */
:root {
  --bg: #000000;         /* pure black */
  --card: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.08);
  --fg: #e5e7eb;         /* gray-200 */
  --muted: #9ca3af;      /* gray-400 */
  --brand1: #60a5fa;     /* blue-400 */
  --brand2: #ec4899;     /* pink-500 */
  --radius: 14px;
  --header-h: 64px;
}

/* ===== Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Improve touch scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: "Fahkwang", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Improve touch interactions */
  touch-action: manipulation;
}

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

/* Touch-friendly focus styles */
*:focus-visible {
  outline: 2px solid var(--brand1);
  outline-offset: 2px;
}

/* Remove tap highlight on touch devices */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ===== Enhanced Background Blobs ===== */
.background-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  will-change: transform;
}

.blob1 {
  background: radial-gradient(circle,
    rgba(96, 165, 250, 0.9) 0%,
    rgba(96, 165, 250, 0.6) 35%,
    rgba(96, 165, 250, 0.25) 65%,
    transparent 90%);
  top: -160px;
  left: -160px;
  animation: blobMove1 28s ease-in-out infinite alternate;
}

.blob2 {
  background: radial-gradient(circle,
    rgba(96, 165, 250, 0.9) 0%,
    rgba(96, 165, 250, 0.6) 35%,
    rgba(96, 165, 250, 0.25) 65%,
    transparent 90%);
  bottom: -180px;
  right: -180px;
  animation: blobMove2 32s 5s ease-in-out infinite alternate;
}

.blob3 {
  background: radial-gradient(circle,
    rgba(236, 72, 153, 0.85) 0%,
    rgba(236, 72, 153, 0.55) 35%,
    rgba(236, 72, 153, 0.25) 65%,
    transparent 90%);
  top: 40%;
  left: -250px;
  animation: blobMove3 36s 10s ease-in-out infinite alternate;
}

.blob4 {
  background: radial-gradient(circle,
    rgba(236, 72, 153, 0.85) 0%,
    rgba(236, 72, 153, 0.55) 35%,
    rgba(236, 72, 153, 0.25) 65%,
    transparent 90%);
  bottom: 30%;
  right: -250px;
  animation: blobMove4 40s 15s ease-in-out infinite alternate;
}


@keyframes blobMove1 {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate3d(120px, -60px, 0) scale(1.2) rotate(180deg);
  }
  100% {
    transform: translate3d(-60px, 40px, 0) scale(0.9) rotate(360deg);
  }
}

@keyframes blobMove2 {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate3d(-100px, 80px, 0) scale(1.15) rotate(-120deg);
  }
  100% {
    transform: translate3d(80px, -50px, 0) scale(0.95) rotate(-240deg);
  }
}

@keyframes blobMove3 {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate3d(90px, 70px, 0) scale(1.1) rotate(90deg);
  }
  100% {
    transform: translate3d(-70px, -60px, 0) scale(1.05) rotate(180deg);
  }
}

@keyframes blobMove4 {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate3d(-110px, -40px, 0) scale(1.25) rotate(-90deg);
  }
  100% {
    transform: translate3d(60px, 90px, 0) scale(0.85) rotate(-180deg);
  }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  z-index: 20;

  /* Transparent + blur */
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.name {
  color: transparent;
  font-weight: 600;
  font-size: 16px;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.2px;
}

.favicon-logo {
  inline-size: 25px;
  block-size: 25px;
}

.icon {
  inline-size: 20px;
  block-size: 20px;
  transition: transform 0.2s ease;
}

.icon:hover {
  transform: scale(1.1);
}

.icon-link {
  display: inline-flex;
}

/* ===== Navigation ===== */
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  background: transparent;
}

.nav-link {
  position: relative;
  color: #d1d5db;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: white;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  transition: width 0.25s ease;
}

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

/* ===== Hamburger (mobile) ===== */
.hamburger {
  display: none;
  font-size: 24px;
  background: none;
  color: var(--brand1);
  border: none;
  cursor: pointer;
}

/* ===== Sections ===== */
.section {
  padding: 96px 20px;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.section h2 {
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 36px;
  background: linear-gradient(90deg, var(--brand1) 0%, var(--brand2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  background-size: 100% 100%;
}

.h2-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ===== Home Section ===== */
.home {
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

.web-name {
  position: relative;
  font-family: "Fahkwang", ui-sans-serif, system-ui;
  font-weight: 300;
  font-size: clamp(42px, 6vw, 72px);
  padding: 40px 60px;
  color: transparent;
  background-image: linear-gradient(90deg, var(--brand1) 0%, var(--brand2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  z-index: 2;
}

.cloud-background {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  filter: blur(0.5px);
}

.visitor {
  color: var(--muted);
  font-size: 14px;
}

.cta {
  position: relative;
  margin-top: 8px;
  display: inline-block;
  text-decoration: none;
  color: #0b1020;
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.2);
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent
  );
  transition: left 0.5s ease;
  z-index: 1;
}

.cta:hover::before {
  left: 100%;
}

.cta:hover {
  box-shadow: 0 8px 25px rgba(96, 165, 250, 0.4);
  background: linear-gradient(90deg, var(--brand2), var(--brand1));
}

.cta span {
  position: relative;
  z-index: 2;
}

/* ===== About Section with Enhanced Mouse Effects ===== */
.about-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  
  /* Scroll animation - initial hidden state */
  opacity: 0;
  transform: translateY(50px) scale(0.95);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

/* Mouse following blob for about section */
.about-grid::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, 
    rgba(96, 165, 250, 0.16) 0%,
    rgba(236, 72, 153, 0.12) 40%,
    transparent 70%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: 
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
}

/* Border glow effect that follows cursor for about section */
.about-grid .cursor-border-glow {
  position: absolute;
  inset: 0;
  padding: 2px;
  background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0.4) 40%,
    rgba(255, 255, 255, 0.2) 70%,
    transparent 90%
  );
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.4s ease, padding 0.3s ease;
  pointer-events: none;
  visibility: hidden;
  z-index: 5;
  mix-blend-mode: overlay;
}

.about-grid:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.about-grid:hover .cursor-border-glow {
  opacity: 1;
  visibility: visible;
}

/* About section animation when it comes into view */
.about-grid.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* About text staggered animation */
.about-text {
  font-size: 18px;
  position: relative;
  z-index: 2;
  
  /* Initial hidden state */
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.about-text.animate-in {
  opacity: 1;
  transform: translateX(0);
}

/* About photo staggered animation */
.about-photo {
  max-width: 320px;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  
  /* Initial hidden state */
  opacity: 0;
  transform: translateX(30px) rotateY(15deg);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s,
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s,
              box-shadow 0.6s ease;
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

.about-photo.animate-in {
  opacity: 1;
  transform: translateX(0) rotateY(0deg);
}

.about-grid:hover .about-photo {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ===== Resume Section ===== */
.resume-figure {
  display: grid;
  place-items: center;
  gap: 16px;
  
  /* Scroll animation - initial hidden state */
  opacity: 0;
  transform: translateY(60px) scale(0.9);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.resume-figure.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.resume-image {
  width: min(900px, 85vw);
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.35);
  
  /* Initial hidden state with 3D effect */
  opacity: 0;
  transform: rotateX(20deg) translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.6s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.resume-image.animate-in {
  opacity: 1;
  transform: rotateX(0deg) translateY(0);
}

/* ===== Updated Resume Button Styles ===== */
.button {
  position: relative;
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  
  /* Scroll animation - initial hidden state */
  opacity: 0;
  transform: translateY(40px) scale(0.8);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.button.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Additional button styles */
.button {
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
/* Gradient border - animated on hover */
.button::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.15) 25%, 
    var(--brand1) 40%, 
    var(--brand2) 60%, 
    rgba(255, 255, 255, 0.15) 75%
  );
  background-size: 300% 100%;
  background-position: 0% 50%;
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Animate gradient border on hover */
.button:hover::before {
  opacity: 1;
  animation: borderGradientSweep 0.6s ease forwards;
}

/* Sweep animation */
.button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(96, 165, 250, 0.4), 
    rgba(236, 72, 153, 0.4), 
    transparent
  );
  transition: left 0.6s ease;
  z-index: 1;
}

.button:hover::after {
  left: 100%;
}

.button:hover {
  box-shadow: 
    0 0 20px rgba(96, 165, 250, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
}

.button span {
  position: relative;
  z-index: 2;
  color: var(--fg);
  transition: color 0.1s ease;
}

/* Animated gradient text */
.button:hover span {
  background: linear-gradient(90deg, var(--brand1) 40%, var(--brand2) 60%);
  background-size: 300% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textGradientSweep 0.6s ease forwards;
}

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

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

/* ===== Project Cards ===== */
.projects .project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
}

.project-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.project-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              border-color 0.4s ease,
              background 0.3s ease;
  transform: translate3d(0, 0, 0) scale(1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform-origin: center;
  
  /* Scroll animation - initial hidden state */
  opacity: 0;
  transform: translateY(60px) rotateX(15deg) scale(0.8);
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              border-color 0.4s ease,
              background 0.3s ease,
              opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-style: preserve-3d;
  perspective: 1000px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Animation when card comes into view */
.project-card.animate-in {
  opacity: 1;
  transform: translateY(0) rotateX(0deg) scale(1);
  animation: slideInCool 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* After animation completes, remove animation and enable smooth transitions */
.project-card.animation-complete {
  animation: none;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1), 
              border-color 0.4s ease,
              background 0.3s ease;
}

/* Cool keyframe animation */
@keyframes slideInCool {
  0% {
    opacity: 0;
    transform: translateY(60px) rotateX(15deg) scale(0.8);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-10px) rotateX(-5deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
  }
}

@property --deg{
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

/* Blue to pink gradient border - only on hover */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  background: conic-gradient(
    from var(--deg) at center, 
    var(--brand1),
    var(--brand2),
    var(--brand1),
    var(--brand2),
    var(--brand1)
  );
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Bright border effect that follows cursor */
.project-card .cursor-border-glow {
  position: absolute;
  inset: 0;
  padding: 2px;
  background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0.4) 40%,
    rgba(255, 255, 255, 0.2) 70%,
    transparent 90%
  );
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.4s ease, padding 0.3s ease;
  pointer-events: none;
  visibility: hidden;
  z-index: 5;
  mix-blend-mode: overlay; /* This will brighten/make more vivid without changing colors */
}

/* Updated cursor-following blob effect */
.project-card::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, 
    rgba(96, 165, 250, 0.16) 0%,
    rgba(236, 72, 153, 0.12) 40%,
    transparent 70%
  );
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: 
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
}

/* Activate border effects on hover */
.project-card:hover::before {
  opacity: 1;
  animation: gradientShift 3s linear infinite;
}

/* Entire card scales up on hover */
.project-card:hover,
.project-card.animation-complete:hover {
  transform: translate3d(0, -16px, 0) scale(1.05);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.7),
    0 0 50px rgba(96, 165, 250, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Expand mouse-following blob on hover */
.project-card:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Show bright border glow on hover */
.project-card:hover .cursor-border-glow {
  opacity: 1;
  visibility: visible;
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  transition: box-shadow 0.4s ease;
  transform: translate3d(0, 0, 0);
  z-index: 2;
  position: relative;
}

.project-card:hover img {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.project-title-row h3 {
  font-size: 20px;
  transition: color 0.3s ease;
  color: var(--fg);
}

.project-card:hover .project-title-row h3 {
  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  background-size: 100% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-year {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
}

.project-card:hover .project-year {
  background: linear-gradient(45deg, rgba(96, 165, 250, 0.3), rgba(236, 72, 153, 0.3));
  border-color: rgba(96, 165, 250, 0.5);
  color: white;
}

.project-card p {
  margin-bottom: 6px;
  transition: color 0.3s ease;
  position: relative;
  z-index: 2;
}

.project-card:hover p {
  color: rgba(229, 231, 235, 0.95);
}

.project-card p em {
  background: linear-gradient(45deg, rgba(96, 165, 250, 0.1), rgba(236, 72, 153, 0.1));
  padding: 3px 8px;
  border-radius: 6px;
  font-style: normal;
  font-weight: 600;
  font-size: 0.9em;
  border: 1px solid rgba(96, 165, 250, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover p em {
  background: linear-gradient(45deg, rgba(96, 165, 250, 0.25), rgba(236, 72, 153, 0.25));
  border-color: rgba(96, 165, 250, 0.5);
  color: white;
}

/* Gradient shift animation for border */
@keyframes gradientShift {
  to{
    --deg: 360deg;
  }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  color: white;
  text-align: center;
  padding: 16px;
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.footer-content p {
  margin: 0;
  white-space: nowrap;

  background: linear-gradient(90deg, var(--brand1), var(--brand2));
  background-size: 100% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
  
  /* Animation styles - slide from left edge with bounce */
  opacity: 0;
  transform: translateX(-100vw);
}

.footer-content p.animate-in {
  opacity: 1;
  animation: slideInBounceLeft 2s ease-out forwards;
}

/* Slide in from left with super fluid bounce effect */
@keyframes slideInBounceLeft {
  0% {
    transform: translateX(-100vw);
    opacity: 0;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  35% {
    transform: translateX(-8px);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.68, -0.8, 0.32, 1.8);
  }
  50% {
    transform: translateX(-20px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  55% {
    transform: translateX(-18px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  60% {
    transform: translateX(-15px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  65% {
    transform: translateX(-12px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  68% {
    transform: translateX(-8px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  70% {
    transform: translateX(-5px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  72% {
    transform: translateX(-3px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.2);
  }
  75% {
    transform: translateX(-7px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  83% {
    transform: translateX(-6px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.1);
  }
  88% {
    transform: translateX(-1px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.05);
  }
  94% {
    transform: translateX(-2px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.2);
  }
  97% {
    transform: translateX(-0.5px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.1);
  }
  100% {
    transform: translateX(0);
  }
}

/* Gentle pulse animation for connect message */
@keyframes connectPulse {
  0% {
    transform: translateX(0) scale(1);
  }
  50% {
    transform: translateX(0) scale(1.03);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

.footer-content p.animate-in {
  animation: slideInBounceLeft 2s ease-out forwards,
             connectPulse 3s ease-in-out infinite 2.5s;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  
  /* Animation styles - slide from right edge with bounce */
  opacity: 0;
  transform: translateX(100vw);
}

.footer-links.animate-in {
  opacity: 1;
  animation: slideInBounceRight 2s ease-out forwards;
}

/* Slide in from right with super fluid bounce effect */
@keyframes slideInBounceRight {
  0% {
    transform: translateX(100vw);
    opacity: 0;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  35% {
    transform: translateX(8px);
    opacity: 1;
    animation-timing-function: cubic-bezier(0.68, -0.8, 0.32, 1.8);
  }
  50% {
    transform: translateX(20px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  55% {
    transform: translateX(18px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  60% {
    transform: translateX(15px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  65% {
    transform: translateX(12px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  68% {
    transform: translateX(8px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  70% {
    transform: translateX(5px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  72% {
    transform: translateX(3px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.2);
  }
  75% {
    transform: translateX(7px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  83% {
    transform: translateX(6px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.1);
  }
  88% {
    transform: translateX(1px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.05);
  }
  94% {
    transform: translateX(2px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.2);
  }
  97% {
    transform: translateX(0.5px);
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 1.1);
  }
  100% {
    transform: translateX(0);
  }
}

.icon-footer {
  inline-size: 18px;
  block-size: 18px;
  transition: transform 0.2s ease;
}

.icon-footer:hover {
  transform: scale(1.1);
}

/* Compensate for GitHub logo having more internal padding */
img[src*="githublogo"] {
  transform: scale(1.2);
}

img[src*="githublogo"].icon-footer {
  transform: scale(1.2);
}

img[src*="githublogo"]:hover {
  transform: scale(1.265); /* 1.15 * 1.1 */
}

img[src*="githublogo"].icon-footer:hover {
  transform: scale(1.32); /* 1.2 * 1.1 */
}

/* Desktop hover effects */
@media (min-width: 769px) {
  .project-card:hover {
    transform: translate3d(0, -16px, 0) scale(1.05);
    box-shadow: 
      0 32px 64px rgba(0, 0, 0, 0.7),
      0 0 50px rgba(96, 165, 250, 0.4);
    border-color: rgba(255, 255, 255, 0.25);
  }
  
  .project-card:hover::before {
    opacity: 1;
    animation: gradientShift 3s linear infinite;
  }
  
  .project-card:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  
  .project-card:hover .cursor-border-glow {
    opacity: 1;
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  /* Adjust GitHub logo scaling for larger mobile icons */
  img[src*="githublogo"] {
    transform: scale(1.15);
  }
  
  img[src*="githublogo"].icon-footer {
    transform: scale(1.15);
  }
  
  /* Remove underline from name on mobile */
  .name {
    text-decoration: none;
  }

  .hamburger {
    display: block;
  }

  #navbar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-h));
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
    z-index: 19;
  }

  #navbar.active {
    transform: scaleY(1);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 0 0 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
  }

  .nav-links {
    flex-direction: column;
    gap: 16px;
  }

  .nav-links.active {
    display: flex;
  }

  .section {
    padding: 72px 18px;
  }

  .section h2 {
    font-size: 32px;
  }

  .web-name {
    font-size: 42px;
    padding: 20px;
    border-radius: 22px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .projects .project-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Reduce blob effects on mobile for performance */
  .blob {
    filter: blur(60px);
    opacity: 0.3;
    width: 400px;
    height: 400px;
  }
  
  /* Touch-friendly interactions */
  .project-card {
    /* Remove hover effects and add touch-friendly ones */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Increase touch target size */
    min-height: 44px;
  }
  
  .project-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
  
  /* Touch-friendly buttons */
  .cta, .button {
    /* Ensure minimum touch target size of 44px */
    min-height: 44px;
    min-width: 44px;
    padding: 12px 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .cta:active, .button:active {
    transform: scale(0.95);
  }
  
  /* Touch-friendly navigation links */
  .nav-link {
    padding: 12px 16px;
    border-radius: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
  }
  
  .nav-link:active {
    background-color: rgba(96, 165, 250, 0.1);
  }
  
  /* Touch-friendly icons */
  .icon, .icon-footer {
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
  }
  
  .icon:active, .icon-footer:active {
    background-color: rgba(96, 165, 250, 0.1);
    transform: scale(0.9);
  }
  
  /* Touch-friendly hamburger menu */
  .hamburger {
    min-height: 44px;
    min-width: 44px;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
  }
  
  .hamburger:active {
    background-color: rgba(96, 165, 250, 0.1);
  }
  
  /* Simplify card effects on mobile */
  .project-card::after {
    display: none;
  }
  
  /* Disable about section effects on mobile */
  .about-grid::after,
  .about-grid .cursor-border-glow {
    display: none;
  }
  
  /* Touch-friendly about grid */
  .about-grid:active {
    transform: scale(0.99);
  }
}

/* Performance mode for slower devices */
@media (max-width: 480px) {
  .blob {
    opacity: 0.2;
    width: 300px;
    height: 300px;
    filter: blur(40px);
  }
  
  .project-card {
    transition: transform 0.2s ease;
  }
  
  .project-card::before {
    display: none;
  }
  
  .about-grid::after,
  .about-grid .cursor-border-glow {
    display: none;
  }
  
  /* Extra touch-friendly adjustments for small screens */
  .cta, .button {
    padding: 16px 24px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .nav-link {
    padding: 16px 20px;
    font-size: 18px;
  }
}

/* Touch device specific styles */
@media (hover: none) and (pointer: coarse) {
  /* Remove all hover effects on touch devices */
  .project-card:hover,
  .about-grid:hover,
  .button:hover,
  .cta:hover,
  .icon:hover,
  .icon-footer:hover {
    transform: none;
    box-shadow: inherit;
    background: inherit;
    border-color: inherit;
  }
  
  /* Add touch feedback instead */
  .project-card:active,
  .about-grid:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .button:active,
  .cta:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .blob {
    animation: none !important;
  }
  
  .about-grid::after,
  .about-grid .cursor-border-glow,
  .project-card::after,
  .project-card .cursor-border-glow {
    display: none !important;
  }
}