:root {
  --bg: #1c1a25; /* Darker, slightly desaturated purple-blue from the background */
  --panel: #282531; /* Dark panel color, complementing the new background */
  --muted: #a6a3ae; /* Slightly warmer muted tone */
  --white: #ffffff;
  --accent: #8f722f; /* Muted purple from the background, a primary accent */
  --accent-2: #8a6fb7; /* Lighter, more vibrant purple from the background/lighting, a secondary accent */
  --container-width: 1200px;
  --radius: 18px;
  --gap: 28px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-image: url("./assets/matt-gross-9aCkSl6YcXg-unsplash.webp");
  background-size: cover;
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: center;
  color: var(--white);
  font-family: "Poppins", sans-serif;
  background-color: var(
    --bg
  ); /* Fallback for browsers that don't support image */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ================= HEADER AND NAVIGATION ================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 0;
  background: rgba(15, 15, 16, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  color: var(--white);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  transition: color 0.3s ease;
}

.brand:hover {
  transform: scale(1.03);
  /* color: var(--accent); */
}

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  transition: color 0.3s ease, transform 0.3s ease;
}

.nav a:hover {
  /* color: var(--white); */
  transform: translateY(-2px);
}

.nav .download {
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--white);
  color: #111;
  margin-left: 24px;
  box-shadow: 0 6px 0 rgba(87, 63, 255, 0.15); /* Keep a subtle purple shadow, but consider adjusting if it clashes */
  font-weight: 600;
}
.nav .download:hover {
  transform: scale(1.08);
  box-shadow: 5px 5px 1px var(--accent); /* Use new accent color */
}

/* ================= MOBILE MENU ================= */
.menu-toggle {
  display: none;
  cursor: pointer;
  position: relative;
  width: 32px;
  height: 32px;
  color: var(--white);
  transition: transform 0.3s ease;
}

.menu-toggle:active {
  transform: scale(0.9);
}

.menu-toggle .icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.menu-toggle .close-icon {
  opacity: 0;
  transform: scale(0.8) rotate(-45deg);
}
.menu-toggle.active .menu-icon {
  opacity: 0;
  transform: scale(0.8) rotate(45deg);
}
.menu-toggle.active .close-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ================= BUTTONS (Centralized) ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--white);
  box-shadow: 5px 5px 1px var(--bg);
}

.btn-primary:hover {
  transform: scale(1.08);
}

.btn-outline {
  background: var(--white);
  color: #111;
  padding: 12px 22px;
  box-shadow: 5px 5px 1px var(--accent-2);
  border-radius: 12px;
  border: 3px solid rgba(87, 63, 255, 0.14);
}
.btn-outline:hover {
  transform: scale(1.08);
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
    url("./assets/cat-han-W_5Eakb1598-unsplash.webp") center center / cover
      no-repeat;
  z-index: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--gap);
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 64px 0;
}

/* ---- AVATAR ---- */
.avatar-card {
  display: flex;
  justify-content: flex-start;
}
.avatar-frame {
  width: 320px;
  height: 460px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.02)
  );
  padding: 18px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6), 0 6px 0 rgba(106, 77, 158, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.3s ease;
}
.avatar-frame:hover {
  transform: translate(8px, -8px);
  box-shadow: 0 35px 60px rgba(0, 0, 0, 0.7),
    0 12px 20px rgba(106, 77, 158, 0.15);
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  background: #fff;
  display: block;
  box-shadow: inset 0 -6px 18px rgba(0, 0, 0, 0.25);
  animation: subtleBounce 3.5s ease-in-out infinite;
}
@keyframes subtleBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ---- HERO TEXT ---- */
.hero-title {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.hero-title span {
  display: inline-block;
  transition: transform 0.3s ease, text-shadow 0.3s ease, color 0.3s ease;
}
.hero-title span:hover {
  transform: scale(1.3);
  transition: 0.3 ease;
  color: var(--accent-2);
}
.hero-sub {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-sub:hover {
  color: var(--accent);
  transform: scale(1.1);
  transition: 0.3s ease;
  text-shadow: 0 4px 15px var(--accent-2);
}

.hero-desc {
  color: var(--muted);
  max-width: 600px;
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 24px;
  text-align: justify;
}

/* ---- HERO CTA ---- */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ================= TECH STACK SECTION ================= */
.tech-stack-section {
  padding: 120px 0;
  text-align: center;
  backdrop-filter: blur(3px);
}

.tech-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 8px;
  display: inline-block;
  color: #fff;
}

.tech-title span {
  display: inline-block;
  transition: transform 0.3s ease, text-shadow 0.3s ease, color 0.3s ease;
}

.tech-title span:hover {
  transform: scale(1.3);
  text-shadow: 0 0 20px #7f00ff, 0 0 30px var(--accent-2);
  color: var(--accent-2);
}

.tech-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  margin-bottom: 50px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

/* ---- TECH CARD ---- */
.tech-card {
  position: relative;
  border-radius: 20px;
  padding: 40px 20px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
  overflow: hidden;
}

/* Dot hidden until hover */
.tech-card .dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
  opacity: 0;
}

.tech-card:hover {
  transform: scale(1.07);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.tech-card:hover .dot {
  opacity: 1;
  animation: blink 1.2s infinite ease-in-out;
}

/* ---- Image ---- */
.tech-card img {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  transition: transform 0.35s ease, filter 0.35s ease;
}

/* ---- Text ---- */
.tech-card h3 {
  font-size: 18px;
  font-weight: 700;
  transition: transform 0.35s ease, text-shadow 0.35s ease;
}

/* Hover hierarchy */
.tech-card:hover img,
.tech-card:hover h3 {
  transform: scale(1.1);
}

.tech-card img:hover,
.tech-card h3:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.6));
  text-shadow: 0 0 18px #e100ff;
}

/* ---- Blink animation ---- */
@keyframes blink {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ---- Optional Gradient Backgrounds ---- */
.react {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
}
.js {
  background: linear-gradient(135deg, #ffb347, #ffcc33);
}
.ts {
  background: linear-gradient(135deg, #007cf0, #00dfd8);
}
.tailwind {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
}
.framer {
  background: linear-gradient(135deg, #7f00ff, #e100ff);
}
.python {
  background: linear-gradient(135deg, #2b5876, #4e4376);
}
.wordpress {
  background: linear-gradient(135deg, #21759b, #0073aa);
}
.nodejs {
  background: linear-gradient(135deg, #3c873a, #68a063);
}

/* ================= PROJECTS SECTION ================= */
.projects-section {
  padding: 120px 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.projects-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url("./assets/cat-han-W_5Eakb1598-unsplash.webp") center center / cover
      no-repeat;
  background-attachment: fixed;
  z-index: -1;
}

/* ---- PROJECTS HEADER ---- */
.projects-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  display: inline-block;
  transition: all 0.4s ease;
}

.projects-title:hover {
  color: var(--accent-2);
  transform: scale(1.05);
}

.projects-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 16px;
  margin-bottom: 45px;
  max-width: 700px;
  line-height: 1.6;
}

/* ---- PROJECTS GRID ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  animation: bounceTogether 3s ease-in-out infinite;
}

@keyframes bounceTogether {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* ---- PROJECT CARD ---- */
.project-card {
  position: relative;
  border-radius: 20px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.project-card:hover {
  animation-play-state: paused;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}

/* When card is hovered, both sections grow together */
.project-card:hover .project-preview,
.project-card:hover .project-info {
  transform: scale(1.03);
  transition: transform 0.4s ease;
}

/* Preview image hover */
.project-card:hover .project-preview img {
  transform: scale(1.08);
}

.project-preview {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
}

.project-preview img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  transition: transform 0.4s ease;
}

.project-info {
  padding: 20px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Stack icons (purple tint) */
.stack-icons {
  display: flex;
  gap: 8px;
}

.stack-icons img {
  filter: invert(79%) sepia(10%) saturate(1337%) hue-rotate(240deg)
    brightness(91%) contrast(88%);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.stack-icons:hover img {
  filter: invert(85%) sepia(20%) saturate(1400%) hue-rotate(260deg)
    brightness(105%) contrast(95%);
}

.stack-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.stack-icon:hover {
  transform: scale(1.3) rotate(5deg);
}

.live-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
}

.live-link:hover {
  transform: scale(1.05);
  color: var(--accent-2);
}

.project-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  transition: transform 0.4s ease, color 0.4s ease;
}

.project-title:hover {
  transform: scale(0.98);
  color: var(--accent-2);
}

/* Description */
.project-desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  transition: color 0.4s ease;
}

.project-desc:hover {
  color: var(--white);
}

/* ================= CONTACT SECTION (Work Together) ================= */
.work-together {
  text-align: center;
  padding: 100px 0 60px;
  position: relative;
  animation: sectionBounce 4s ease-in-out infinite;
}

@keyframes sectionBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.work-together-title {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  transition: all 0.4s ease;
}

.work-together-title:hover {
  color: var(--accent-2);
  transform: scale(1.05);
}

.work-together p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  max-width: 700px;
  margin: 0 auto 32px;
  line-height: 1.6;
  transition: all 0.4s ease;
}

.work-together p:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.03);
  font-weight: 500;
}

.work-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ================= RANDOM REEL SECTION (Carousel) ================= */
.random-reel {
  padding: 60px 0;
}

.reel-title {
  color: #fff;
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 20px;
  text-align: left;
}

.reel-wrapper {
  position: relative;
  overflow: hidden;
  /* FIX: Removed gradient fade for simplicity, but can be added back if needed */
  padding: 20px 0;
}

.reel-container {
  display: flex;
  gap: 20px;
  /* FIX: Set a large width to contain all duplicated items for the infinite scroll effect */
  width: max-content;
  animation: scroll 30s linear infinite;
  will-change: transform;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  /* FIX: Changed to -50% to scroll exactly one set of images, enabling seamless loop */
  100% {
    transform: translateX(-50%);
  }
}

.reel-item {
  flex: 0 0 auto;
  width: 200px;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

.reel-item:hover {
  transform: scale(1.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 10;
}

.reel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================= FOOTER ================= */

.site-footer {
  padding: 48px 0 24px;
  text-align: left;
  color: rgba(255, 255, 255, 0.5);
  position: relative; /* IMPORTANT: Set positioning context for the pseudo-element */
  z-index: 1; /* Ensure content is above the background */
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
    url("./assets/cat-han-W_5Eakb1598-unsplash.webp") center center / cover
      no-repeat;
  z-index: -1; /* Place the background behind the content */
  background-attachment: fixed;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* --- Header Section (Avatar, Name, Pitch) --- */
.footer-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator line */
}

.footer-brand-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--white);
  color: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 18px;
}

.footer-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.footer-pitch p {
  margin-bottom: 16px;
  line-height: 1.6;
  max-width: 700px;
  color: rgba(255, 255, 255, 0.75);
}

/* --- Links Section (Nav and Socials) --- */
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.social-icon {
  width: 24px;
  height: 24px;
  color: var(--white);
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon:hover {
  color: var(--accent);
  transform: scale(1.1);
}

/* --- Bottom Section (Copyright/Credit) --- */
.footer-bottom {
  padding-top: 16px;
}

.footer-credit {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.footer-copyright {
  text-align: center; /* Center the text */
  margin-top: 16px; /* Add space above it */
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

/* ================= HOVER EFFECTS ================= */

/* 1. Keyframe for the spinning avatar */
@keyframes spin-anticlockwise {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-360deg);
  }
}

/* 1. Avatar Spin (DY in the circle) */
.footer-avatar {
  transition: transform 0.8s ease-in-out;
}

.footer-avatar:hover {
  animation: spin-anticlockwise 0.8s ease-in-out forwards;
}

/* 2. Name Grow and Color Change (David Yusuf) */
.footer-name {
  transition: color 0.3s ease, transform 0.3s ease;
  transform-origin: left;
}

.footer-name:hover {
  transform: scale(1.05);
  color: var(--accent-2, var(--accent));
}

/* 3. Navigation Links Grow and Color Change (Home, Projects, Contact) */
.footer-nav a {
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.footer-nav a:hover {
  /* Grow slightly (e.g., 10%) */
  transform: scale(1.1);
  color: var(--accent-2, var(--accent));
}

/* 4. Social Icons Grow and Tilt Anti-clockwise */
.footer-socials a .social-icon {
  transition: color 0.3s ease, transform 0.3s ease;
}

.footer-socials a:hover .social-icon {
  transform: scale(1.2) rotate(-10deg);
}

/* 5. Credit Text Grow and Bolder (ui/ux designer: jose ridwan) */
.footer-credit {
  color: var(--white);
  transition: font-weight 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.footer-credit:hover {
  /* Grow slightly (e.g., 5%) */
  transform: scale(1.05);
  /* Become bolder (e.g., 700 or 800) */
  font-weight: 700;
}

/* ================= RESPONSIVE ================= */

/* TABLET (1024px) */
@media (max-width: 1024px) {
  .brand {
    font-size: 16px; /* Reduced font size to fit on one line */
  }

  .nav .download {
    padding: 8px 12px;
    font-size: 14px;
  }

  .hero-inner {
    grid-template-columns: 300px 1fr;
    gap: 24px;
  }
  .hero-title {
    font-size: 42px;
  }
  .hero-sub {
    font-size: 22px;
  }
  .hero-desc {
    font-size: 16px;
  }
  .avatar-frame {
    width: 280px;
    height: 400px;
  }

  .hero-desc {
    max-width: 90%;
    text-align: justify;
    font-size: 16px;
  }
}

/* MOBILE (780px) */
@media (max-width: 780px) {
  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 74px;
    right: 0;
    background: rgba(15, 15, 16, 0.96);
    width: 220px;
    border-radius: 0 0 0 16px;
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
  }
  .nav.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
  }

  .hero {
    padding-top: 90px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }
  .avatar-frame {
    max-width: 280px;
    height: 340px;
    margin: 0 auto;
  }
  .hero-title {
    font-size: 28px;
    font-weight: 700;
  }
  .hero-sub {
    font-size: 18px;
    font-weight: 600;
    color: #ddd;
  }
  .hero-desc {
    font-size: 15px;
    max-width: 90%;
    margin: 0 auto 24px;
    text-align: left;
  }
  .hero-cta {
    justify-content: center;
  }

  .tech-title {
    font-size: 32px;
  }
  .tech-sub {
    font-size: 16px;
  }
  .tech-card {
    padding: 28px 14px;
  }

  .reel-item {
    width: 150px;
    height: 225px;
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .reel-item {
    width: 120px;
    height: 180px;
  }
}

/* =======SCROLL ANIMATIONS===== */
/* ====== HEADER ANIMATION ====== */
.site-header {
  transform: translateY(-50px);
  opacity: 0;
  animation: headerSlide 0.8s ease-out forwards;
}

@keyframes headerSlide {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ====== AVATAR SPIN-IN ====== */
.avatar-img {
  width: 200px;
  transform: rotateY(90deg) translateY(0);
  opacity: 0;
  transform-style: preserve-3d;
  animation: spinIn 1.2s ease-out 0.6s forwards,
    floatY 3.5s ease-in-out 2s infinite; /* subtle infinite bounce after spin */
}

/* ===== Spin-in Animation ===== */
@keyframes spinIn {
  0% {
    transform: rotateY(90deg) translateY(0);
    opacity: 0;
  }
  100% {
    transform: rotateY(0) translateY(0);
    opacity: 1;
  }
}

.avatar-card {
  overflow: visible !important; /* allow full spin + bounce */
}

.avatar-card img {
  object-fit: cover;
  width: 100%;
  display: block;
  transform-origin: center;
}

/* ===== Subtle Infinite Bounce ===== */
@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(
      -10px
    ); /* adjust height for gentler or stronger bounce */
  }
}

/* ====== HERO FADE-UP ELEMENTS ====== */
.hero-sub,
.hero-desc,
.hero-cta {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease-out forwards;
}

.hero-sub {
  animation-delay: 1s;
}

.hero-desc {
  animation-delay: 1.3s;
}

.hero-cta {
  animation-delay: 1.6s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== HERO TITLE LETTERS ====== */
.hero-title {
  display: inline-block;
  opacity: 0;
  animation: showTitle 0s 1.8s forwards; /* triggers visibility before letters animate */
}

@keyframes showTitle {
  to {
    opacity: 1;
  }
}

.hero-title span {
  display: inline-block;
  transform: scale(0);
  animation: growLetter 0.45s ease-out forwards;
}

@keyframes growLetter {
  to {
    transform: scale(1);
  }
}

/* ====== BUTTON STYLING (Optional) ====== */
.btn {
  transition: transform 0.3s ease;
}

.btn:hover {
  transform: scale(1.05);
}

/* ===== Fade In From Below ===== */
.fade-in-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* === PROJECTS SCROLL ANIMATION === */
.projects-section {
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

/* Active state when in view */
.projects-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==== Scroll Animation  ==== */
.work-together {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.work-together.visible {
  opacity: 1;
  transform: translateY(0);
  animation: sectionBounce 4s ease-in-out infinite; /* restore bounce */
}

/* Title: scroll fade + keep hover transition smooth */
.work-together-title {
  opacity: 0;
  transition: opacity 1s ease, color 0.4s ease, transform 0.4s ease;
}

.work-together.visible .work-together-title {
  opacity: 1;
}

/* Paragraph: scroll + hover fix */
.work-together p {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease, color 0.4s ease,
    font-weight 0.4s ease;
}

.work-together.visible p {
  opacity: 1;
  transform: translateY(0);
}

/* Buttons container */
.work-buttons {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.work-together.visible .work-buttons {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered ascending animation for reel items (temporary) */
.reel-item.ascend {
  animation-name: reelAscend;
  animation-duration: 0.48s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  /* each item will get its own inline animation-delay from JS */
  z-index: 20; /* make animated item appear above others while moving */
  pointer-events: none; /* avoid accidental hover while animating */
}

/* keyframes: start slightly below and transparent, then flow up into place */
@keyframes reelAscend {
  0% {
    transform: translateY(40px) scale(0.98);
    opacity: 0;
    filter: blur(0.6px);
  }
  60% {
    transform: translateY(-6px) scale(1.02);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
    filter: none;
  }
}

/* small safety: ensure rerun doesn't leave permanent inline styles */
.reel-item {
  will-change: transform, opacity;
}

/* ================= FOOTER: Fade-up on scroll (non-destructive) ================= */
/* Base (hidden) state */
.site-footer {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease-out, transform 0.75s ease-out;
  /* keep existing overflow/z-index/etc. - do not change them here */
}

/* Visible state after scrolling into view */
.site-footer.footer-visible {
  opacity: 1;
  transform: translateY(0);
  /* do NOT set 'transition' for color/transform beyond this; preserve existing hover transitions */
}

/* Optional: slight staggers for sub-sections (subtle, non-destructive) */
.site-footer.footer-visible .footer-header,
.site-footer.footer-visible .footer-links,
.site-footer.footer-visible .footer-bottom {
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  opacity: 0;
  transform: translateY(10px);
}

/* when footer-visible is present, fade them in with a tiny stagger using transition-delay */
.site-footer.footer-visible .footer-header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

.site-footer.footer-visible .footer-links {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.12s;
}

.site-footer.footer-visible .footer-bottom {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.18s;
}

