:root {
  --text-color: #000000;
  --accent-color: #F4C542;
  --navbar-bg: rgba(39, 116, 174, 0.2);
  --card-bg: rgba(0, 0, 0, 0.05);
}

body.dark-mode {
  background: #0d1117;
  --text-color: #e6e6e6;
  --accent-color: #F4C542;
  --navbar-bg: rgba(39, 116, 174, 0.3);
  --card-bg: rgba(255, 255, 255, 0.05);
}

body.light-mode {
  background: #fdfdfd;
  --text-color: #222;
  --accent-color: #0077b5;
  --navbar-bg: rgba(255, 255, 255, 0.9);
  --card-bg: #ffffff;
}

body.light-mode .navbar,
body.light-mode .project-card,
body.light-mode #about {
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

body.light-mode .nav-links li a:hover {
  color: var(--accent-color);
}

body.fun-mode {
  background: linear-gradient(270deg, #2774AE, #1A4E7D, #F4C542, #E6B933, #2774AE);
  background-size: 1200% 1200%;
  animation: gradientShift 15s ease infinite;
  --text-color: #000;
  --accent-color: #F4C542;
  --navbar-bg: rgba(39, 116, 174, 0.2);
  --card-bg: rgba(0, 0, 0, 0.05);
}

body.fun-mode .highlight {
  background: linear-gradient(90deg, #F4C542, #E6B933, #1A4E7D, #2774AE, #F4C542);
  background-size: 1200% 1200%;
  animation: gradientShiftReverse 15s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body, 
.navbar, 
.project-card, 
section, 
#theme-toggle, 
.nav-links li a, 
footer, 
.about-current, 
.about-extra, 
.about-intro,
.project-card .btn,
.highlight {
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, width 0.4s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
}

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

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

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 50px;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  width: 90%;
  margin: 20px auto;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  box-shadow: 0 8px 30px rgba(39, 116, 174, 0.2);
}

.navbar.shrink {
  padding: 8px 40px;
  background: var(--navbar-bg);
  box-shadow: 0 6px 20px rgba(39, 116, 174, 0.4);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-color);
}

.logo img {
  height: 40px;
  width: auto;
  border-radius: 50%;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.logo img:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px var(--accent-color));
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

.nav-links li a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 20px;
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

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

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

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--text-color);
  margin-left: 15px;
  transition: transform 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.2);
}

section {
  min-height: 100vh;
  padding: 120px 50px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

section h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: var(--text-color);
}

section p {
  font-size: 1.2rem;
  max-width: 700px;
}

#about {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start; 
  padding: 160px 80px 80px;
  background: var(--card-bg);
  border-radius: 0 0 40px 40px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.about-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.about-left {
  flex: 2;
}

.about-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;   
  justify-content: center;
  text-align: center;
  gap: 20px;
}

.portrait {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.about-intro {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.about-extra {
  font-size: 1.3rem;
  line-height: 1.8;
}

.about-current {
  font-size: 1.4rem;
  font-weight: 500;
  margin-top: 20px;
}

.highlight {
  color: var(--accent-color);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  width: 100%;
}

.project-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.project-card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 15px;
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--accent-color);
}

.project-card p {
  font-size: 1rem;
  margin-bottom: 15px;
}

.project-card .btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 20px;
  background: var(--accent-color);
  color: #000;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.project-card .btn:hover {
  background: #e6b933;
}

.social-icons {
  display: flex;
  gap: 20px;
  justify-content: center; 
}

.social-icons a {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-size: 1.5rem;
  color: #e6e6e6;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
}

.social-icons a.github {
  background: #000;
}

.social-icons a.linkedin {
  background: #0077b5;
}

.social-icons a.email {
  background: #c23a2b;
}

.social-icons a:hover {
  transform: scale(1.1);
}

.top-icons a,
.right-icons a {
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.footer-icons a {
  width: 35px;
  height: 35px;
  font-size: 1rem;
  opacity: 0.8;
}

.footer-icons a:hover {
  opacity: 1;
}

.cursor {
  display: inline-block;
  font-weight: bold;
}

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

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 10px 20px;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
  }
  .nav-links.active {
    display: flex;
  }
  #about {
    padding: 120px 20px 50px;
  }
  .about-content {
    flex-direction: column;
    text-align: center;
  }
  .about-right {
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .about-intro {
    font-size: 1.6rem;
  }
  .about-extra, .about-current {
    font-size: 1rem;
  }
  .portrait {
    width: 120px;
    height: 120px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  section {
    padding: 100px 20px 30px;
  }
}

.project-card img.aws-badge {
  width: 150px !important;
  height: auto;
  display: block;
  margin: 0 auto 15px;
}

.project-card img.project-img {
  height: 150px;
  object-fit: cover;
  width: auto;
  max-width: 100%;
  margin: 0 auto 15px;
  display: block;
}

#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent-color);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: scale(1.1);
  background-color: #e6b933;
}

.nav-links li a.active {
  color: var(--accent-color);
  font-weight: 600;
}

body.fun-mode .highlight,
body.fun-mode .nav-links li a,
body.fun-mode .nav-links li a.active,
body.fun-mode .project-card h3,
body.fun-mode .project-card .btn {
  background: linear-gradient(90deg, #F4C542, #E6B933, #1A4E7D, #2774AE, #F4C542);
  background-size: 1200% 1200%;
  animation: gradientShiftReverse 15s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.fun-mode #back-to-top {
  background: linear-gradient(270deg, #F4C542, #E6B933, #1A4E7D, #2774AE, #F4C542);
  background-size: 1200% 1200%;
  animation: gradientShift 15s ease infinite;
  color: #000;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  border: none;
}

body.fun-mode .project-card .btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-color);
  -webkit-text-fill-color: unset;
  backdrop-filter: blur(10px);
}

body.fun-mode .project-card .btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.1);
}

body.fun-mode .logo h1 {
  background: linear-gradient(90deg, #F4C542, #E6B933, #1A4E7D, #2774AE, #F4C542);
  background-size: 1200% 1200%;
  animation: gradientShiftReverse 15s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.fun-mode .about-extra,
body.fun-mode .about-current,
body.fun-mode .about-intro {
  color: var(--text-color);
}

.experience-card {
  text-align: center;
}

#experience .experience-card {
  max-width: 900px;
  margin: 0 auto;
}

.experience-logo-center {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto 18px;
}

.experience-meta-center {
  margin: -6px 0 14px;
  font-size: 1rem;
  opacity: 0.85;
}

.experience-summary-center {
  font-size: 1.05rem;
  margin: 0 auto 16px;
  max-width: 720px;
  opacity: 0.95;
}

.experience-roles-center p {
  margin: 6px 0;
  font-size: 1rem;
}

.experience-tech-center {
  margin-top: 14px;
  font-size: 1rem;
  opacity: 0.9;
}