@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: #121212;
  color: #ffffff;
  scroll-behavior: smooth;
}

header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #1f1f1f;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
  z-index: 1500;
}

.container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 1.7vw;
}

.left-icons {
  position: absolute;
  right: 1.7vw;
  display: flex;
  gap: 1vw;
  justify-content: center;
}

.left-icons img {
  width: clamp(1.5rem, 4vw, 2rem);
  height: clamp(1.5rem, 4vw, 2rem);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border: none;
  object-fit: contain;
  transition: transform 0.2s;
  transition: scale 0.2s ease;
}

.left-icons img:hover {
  scale: 1.2;
}

.left-icons a img {
  animation: slideInLeftBounce 0.8s ease forwards;
  animation-fill-mode: forwards;
  opacity: 0;
}

/* Left side icons */
.left-icons a:nth-of-type(1) img {
  animation: slideInLeftBounce 0.8s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.left-icons a:nth-of-type(2) img {
  animation: slideInLeftBounce 0.8s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

/* Middle toggle */
.left-icons .emoji-toggle {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: scale 0.2s ease;
  opacity: 0;
  animation: slideInTopBounce 0.8s ease forwards;
  animation-delay: 0.9s;
}

/* Right side icons */
.left-icons a:nth-of-type(4) img {
  animation: slideInRightBounce 0.8s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

.left-icons a:nth-of-type(5) img {
  animation: slideInRightBounce 0.8s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

body:not(.fun-mode) .emoji-toggle {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.home-button {
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.2rem);
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 1;
  background-color: #333333;
  padding: 0.5em 1.2em;
  border-radius: 1em;
}

.home-button:hover {
  background-color: #404040;
}

.center-home {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.center-home .home-button {
  display: inline-block;
}

.button {
  list-style: none;
  display: flex;
  gap: 1.5vw;
  margin: 0;
}

.button a {
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: #333333;
  padding: 0.5em 1.2em;
  border-radius: 1em;
  display: inline-block;
}

.button a:hover {
  background-color: #404040;
}

.button li a {
  animation: slideInRightBounce 0.8s ease forwards;
  animation-fill-mode: forwards;
  opacity: 0;
  display: inline-block;
}

.button li:nth-child(2) a {
  animation: slideInRightBounce 0.8s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
  display: inline-block;
}

.button li:nth-child(1) a {
  animation: slideInRightBounce 0.8s ease forwards;
  animation-delay: 1.2s;
  opacity: 0;
  display: inline-block;
}

main {
  padding: 4rem 2vw 2rem 2vw;
  max-width: 70vw;
  margin: 0 auto;
}

section {
  margin-bottom: clamp(3rem, 6vh, 5rem);
}

h1 {
  font-size: clamp(2.5rem, 6vw, 3rem);
  margin-bottom: clamp(1rem, 2vh, 2rem);
  color: #ffffff;
  text-align: center;
}

h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
  margin-bottom: clamp(1rem, 2vh, 2rem);
  color: #f5f5f5;
}

h3 {
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  margin-bottom: clamp(1rem, 2vh, 2rem);
  color: #ebebeb;
}

h4 {
  font-size: clamp(1.325rem, 4vw, 1.7rem);
  margin-bottom: clamp(1rem, 2vh, 2rem);
  margin-top: clamp(0.5rem, 1.5vh, 2rem);
  color: #ebebeb;
}

p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.6;
  color: #e1e1e1;
}

.github img{
  margin-left: 0.3rem;
  height: clamp(1.7rem, 4vw, 2.2rem); 
  vertical-align: top;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border: none;
  object-fit: contain;
  transition: transform 0.2s;
}

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

.profile-pic {
  width: clamp(10rem, 30vw, 15rem);
  height: clamp(10rem, 30vw, 15rem);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 2rem auto;
  border: 0.2rem solid #e0e0e0;
  box-shadow: 0 0 1rem #8e8e8e;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

footer {
  text-align: center;
  margin-top: 4vh;
}

section.card {
  background-color: #1c1c1c;
  border: 0.0625rem solid #333; 
  border-radius: 0.75rem; 
  padding: 1rem 2rem; 
  margin-top: 2.5rem; 
  box-shadow: 0 0.25rem 0.5rem rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section.card:hover {
  transform: translateY(-0.3125rem); 
  box-shadow: 0 0.5rem 1rem rgba(255, 255, 255, 0.1); 
}

.project-title {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.title-row h2 {
  margin: 0;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  background-color: #1c1c1c;
  color: #fff;
  padding: 0.25rem 0.6rem;
  font-size: 0.65rem;
  border-radius: 0.4rem;
  border: 1px solid #444;
  font-weight: 500;
  white-space: nowrap;
  cursor: default;
  line-height: 1.5;
}

@keyframes slideInLeftBounce {
  0% {
    transform: translateX(-200%) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: translateX(30%) scale(1.05);
    opacity: 1;
  }
  80% {
    transform: translateX(-10%) scale(0.98);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideInTopBounce {
  0% {
    transform: translateY(-200%) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: translateY(30%) scale(1.05);
    opacity: 1;
  }
  80% {
    transform: translateY(-10%) scale(0.98);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

#modeToggle {
  position: fixed;
  top: 10svh;
  right: 1rem;
  z-index: 9999;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: bold;
  background-color: #1c1c1c;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 0.2rem 0.4rem rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  opacity: 1;
  pointer-events: auto;
}

body.fun-mode #modeToggle {
  opacity: 0;
  animation: bounceInTop 0.6s ease 4s forwards;
  pointer-events: auto;
}

@keyframes slideInRightBounce {
  0% {
    transform: translateX(200%) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: translateX(-30%) scale(1.05);
    opacity: 1;
  }
  80% {
    transform: translateX(10%) scale(0.98);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes bounceSmall {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
  60% { transform: translateY(2px); }
}

body:not(.fun-mode) .left-icons a img,
body:not(.fun-mode) .button li a,
body:not(.fun-mode) .center-home .home-button {
  animation: none !important;
  opacity: 1 !important;
}

body:not(.fun-mode) .left-icons img,
body:not(.fun-mode) .emoji-toggle,
body:not(.fun-mode) .button a {
  animation: none !important;
  opacity: 1 !important;
  transition: scale 0.2s ease !important;
}

body:not(.fun-mode) .left-icons img:hover,
body:not(.fun-mode) .emoji-toggle:hover,
body:not(.fun-mode) .button a:hover {
  scale: 1.2;
}

body:not(.fun-mode) .home-button,
body.fun-mode .home-button {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.emoji-toggle:hover {
  scale: 1.2;
}

body.fun-mode .left-icons img:hover,
body.fun-mode .emoji-toggle:hover,
body.fun-mode .button a:hover {
  scale: 1.2;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.contact-form label {
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border-radius: 0.4rem;
  border: 1px solid #333;
  background-color: #1f1f1f;
  color: #fff;
  font-size: 1rem;
  box-sizing: border-box;
  font-family: inherit;
}

.contact-form button {
  background-color: #e0e0e0;
  color: #121212;
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.contact-form button:hover {
  background-color: #121212;
  color: #e0e0e0;
}

#message {
  resize: none; 
  overflow-y: auto; 
}

#form-status {
  opacity: 0;
  transition: opacity 0.8s ease;
  text-align: center;
  margin-top: 1rem;
  font-weight: bold;
}

button.slide-out {
  animation: slideOutRight 0.4s ease forwards;
}

button.slide-in {
  animation: slideInLeft 0.4s ease forwards;
}

@keyframes slideOutRight {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(150%); opacity: 0; }
}

@keyframes slideInLeft {
  0% { transform: translateX(-150%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.carousel {
  overflow: hidden;
  position: relative;
  height: 6rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.carousel-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  animation: scrollRightToLeft 25s linear infinite;
}

.carousel.right-to-left .carousel-track {
  animation: scrollRightToLeft 25s linear infinite;
}

.carousel.left-to-right .carousel-track {
  animation: scrollLeftToRight 25s linear infinite;
}

@keyframes scrollRightToLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scrollLeftToRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 0.3rem;
}

.skill-item img {
  height: 4rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.skill-item img:hover {
  transform: scale(1.15);
}

.skill-label {
  font-size: 0.9rem;
  color: #e0e0e0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.skill-item:hover .skill-label {
  opacity: 1;
  transform: translateY(0);
}

.timeline {
  position: relative;
  width: 100%;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background-color: #333;
  transform: translateX(-50%);
  z-index: 0;
}

.timeline-item {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin: 3rem 0;
}

.timeline-item.right {
  justify-content: flex-start;
}

.timeline-dot {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 1.25rem;
  background-color: #ffffff;
  border: 0.25rem solid #121212;
  border-radius: 50%;
  z-index: 0;
}

.timeline-card {
  background-color: #1c1c1c;
  color: #e0e0e0;
  padding: 1.5rem 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.5rem rgba(255, 255, 255, 0.05);
  border: 1px solid #333333;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-0.3rem);
  box-shadow: 0 0.75rem 1.5rem rgba(255, 255, 255, 0.07);
}

.timeline-item.left .timeline-card {
  margin-right: calc(50% + 2rem);
}

.timeline-item.right .timeline-card {
  margin-left: calc(50% + 2rem);
}

.timeline-card h2,
.timeline-card h3,
.timeline-card h4,
.timeline-card p,
.timeline-card li {
  margin: 0.5rem 0;
  color: #e0e0e0;
}

.timeline-card ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0 0 0;
  list-style: disc;
}

@media screen and (max-width: 768px) {
  .timeline::before {
    left: -2rem;
    transform: none;
  }

  .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 2.5rem;
  }

  .timeline-item.left .timeline-card,
  .timeline-item.right .timeline-card {
    margin: 0;
    max-width: 100%;
  }

  .timeline-dot {
    left: -1.875rem;
  }
}

@keyframes swingInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-150%) rotate(-15deg);
  }
  60% {
    transform: translateX(20%) rotate(5deg);
    opacity: 1;
  }
  80% {
    transform: translateX(-10%) rotate(-2deg);
  }
  100% {
    transform: translateX(0) rotate(0);
  }
}

@keyframes swingInFromRight {
  0% {
    opacity: 0;
    transform: translateX(150%) rotate(15deg);
  }
  60% {
    transform: translateX(-20%) rotate(-5deg);
    opacity: 1;
  }
  80% {
    transform: translateX(10%) rotate(2deg);
  }
  100% {
    transform: translateX(0) rotate(0);
  }
}

body.fun-mode .timeline-item.left .timeline-card {
  animation: swingInFromLeft 1.25s ease forwards;
}

body.fun-mode .timeline-item.right .timeline-card {
  animation: swingInFromRight 1.25s ease forwards;
}

.project-card {
  position: relative;
  width: 100%;
  margin-bottom: clamp(3rem, 6vh, 5rem);
  cursor: pointer;
}

.card-hover-effect {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover .card-hover-effect {
  transform: translateY(-0.3rem);
  box-shadow: 0 0 0.5rem rgba(255, 255, 255, 0.15);
}

.project-card .card {
  position: relative;
  width: 100%;
  height: 400px;
  padding: 1rem 2rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-color: #0a0a0a;
  border: 0.0625rem solid #333;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.5rem rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.project-card .card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}

.project-card .card > * {
  position: relative;
  z-index: 1;
}

.project-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.project-title-row h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 600;
  color: #ffffff;
}

.project-title-row .github {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.project-title-row .github:hover {
  transform: scale(1.1);
}

.project-title-row .github img {
  width: 2.5rem;
  height: 2.5rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #2d2d2d;
  color: #ffffff;
  border: 1px solid #444;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.badge:hover {
  background-color: #3d3d3d;
  border-color: #555;
}

.project-description {
  line-height: 1.6;
}

.project-description p {
  margin-bottom: 1rem;
  color: #e0e0e0;
  font-size: 1rem;
}

.project-description p:last-child {
  margin-bottom: 0;
}

.profile-wrapper {
  position: relative;
  width: clamp(10rem, 30vw, 15rem);
  height: clamp(10rem, 30vw, 15rem);
  margin: 2rem auto;
}

.explosion-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 2;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 10%;
  height: 10%;
  background-image: url('../images/jayrao.png');
  background-size: 1000% 1000%;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* Hamburger Menu Button */
.hamburger {
  position: absolute;
  left: 1.7vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 1.5em;
  height: 1.2em;
  cursor: pointer;
  z-index: 1600;
  padding: 0.4em;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.hamburger:hover {
  opacity: 1;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 0.15em;
  background-color: #ffffff;
  border-radius: 0.1em;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(0.4em) rotate(45deg);
  transform-origin: center;
  transition-delay: 0.1s;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-1em);
  transition-delay: 0s;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-0.4em) rotate(-45deg);
  transform-origin: center;
  transition-delay: 0.1s;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 35%;
  max-width: 10em;
  height: 100vh;
  background-color: rgba(31, 31, 31, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4em 1em 2em;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1550;
  box-shadow: -0.125rem 0 0.25rem rgba(0, 0, 0, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav li {
  margin: 0.8em 0;
  opacity: 0;
  transform: translateX(-1em);
  transition: all 0.3s ease;
}

.mobile-nav.active li {
  opacity: 1;
  transform: translateX(0);
}

.mobile-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 600;
  display: block;
  padding: 0.4em 0;
  transition: all 0.3s ease;
  position: relative;
}

.mobile-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #404040;
  transition: width 0.3s ease;
}

.mobile-nav a:hover {
  color: #e0e0e0;
  transform: translateX(-0.2em);
}

.mobile-nav a:hover::after {
  width: 100%;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1540;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media screen and (max-width: 768px) {
  .hamburger {
    position: static;
    margin-right: 0.5em;
  }

  .container {
    justify-content: space-between;
  }

  .left-icons {
    position: absolute;
    left: 35%;
    transform: translateX(-50%);
    gap: 0.5em;
  }

  .home-button {
    margin-left: auto;
  }

  .left-icons img {
    width: 1.5em;
    height: 1.5em;
  }

  .container {
    padding: 1rem;
  }

  main {
    padding-top: 5rem;
  }
}

@keyframes slideInFromBottom {
  0% {
    opacity: 0;
    transform: translateY(100px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

body.fun-mode .project-card {
  opacity: 0;
  animation: slideInFromBottom 0.8s ease forwards;
}

body.fun-mode .project-card:nth-child(1) {
  animation-delay: 0.2s;  
}

body.fun-mode .project-card:nth-child(2) {
  animation-delay: 0.6s;  
}

body.fun-mode .project-card:nth-child(3) {
  animation-delay: 1s;    
}

body:not(.fun-mode) .project-card {
  opacity: 1;
  animation: none !important;
}