:root {
  --primary: #e63946; 
  --bg-light: #fff;
  --bg-dark: #19191a;
  --text-light: #19191a;
  --text-dark: #f5f5f5;
  --navbar-bg-light: #fff;
  --navbar-bg-dark: #111;
  --pLinks-light: #fff;
  --pLinks-dark: #19191a;
}

[data-theme="light"] {
  --bg: var(--bg-light);
  --text: var(--text-light);
  --navbar-bg: var(--navbar-bg-light);
  --pLinks: var(--pLinks-dark);
}

[data-theme="dark"] {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --navbar-bg: var(--navbar-bg-dark);
  --pLinks: var(--pLinks-light);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.5s, color 0.5s;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 2rem;
  background: var(--navbar-bg);
  border-bottom: 2px solid var(--primary);
  position: fixed;
  width: 100%;
  z-index:99;
}

.logo {
  font-size: 3vw;
  font-weight: bold;
  position: relative;
  color: #e63946;
  text-shadow: 0 0 5px #fff, 0 0 10px #fff;
  animation: logo 1.5s infinite;
  text-decoration: none;
}

@keyframes logo {
    0% { opacity: 1; transform: translate(0, 0); text-shadow: 0 0 5px #fff, 0 0 10px #fff; }
    25% { opacity: 0.8; transform: translate(-2px, 2px); text-shadow: -2px 2px 10px #111, 2px -2px 10px #fff; }
    50% { opacity: 0.6; transform: translate(2px, -2px); text-shadow: 2px -2px 10px #111, -2px 2px 10px #fff; }
    75% { opacity: 0.9; transform: translate(-2px, -2px); text-shadow: -2px -2px 10px #111, 2px 2px 10px #fff; }
    100% { opacity: 1; transform: translate(0, 0); text-shadow: 0 0 5px #fff, 0 0 10px #fff; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover, .dropdown a:hover {
  color: var(--primary);
}

.nav-links .resume {
  color: var(--bg);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  cursor: pointer;
  z-index: 102;
}

.hamburger span {
  display: block;
  width: 27px;
  height: 3px;
  background: var(--text);
  border-radius: 5px;
  transition: background 0.2s;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle .fa-sun { display: inline; }
.theme-toggle .fa-moon { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-moon { display: inline; }

.social-container {
  margin-left: 2.5rem;
}

.socials {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  padding: 0.5rem 1.1rem;
  background: var(--navbar-bg);
}

.socials a {
  color: var(--primary);
  font-size: 1.2rem;
  transition: color 0.2s, transform 0.2s;
}

.socials a:hover {
  color: var(--pLinks);
  transform: scale(1.16);
}

.dropdown {
  display: none;
  text-align: center;
  position: fixed;
  right: 2rem;
  top: 72px; 
  background: var(--navbar-bg);
  border: 1px solid var(--primary);
  border-radius: 11px;
  z-index: 101;
  flex-direction: column;
  min-width: 210px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  padding: 1rem 0.5rem 0.5rem 0.5rem;
}

.dropdown a {
  color: var(--text);
  text-decoration: none;
  margin: 0.6rem 0;
  font-size: 1.15rem;
  display: block;
  padding: 0.3rem 1rem;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
}

.dropdown .social-container {
  margin: 1rem 0 0 0;
  display: flex;
}

.dropdown .socials {
  margin: 0;
}

.dropdown .socials a:hover {
  color: var(--primary);
}

.dropdown.show {
  display: flex;
}

.dropdown .resume {
  background-color: var(--bg);
}

.resume {
  color: var(--bg);
  display: inline-block;
  background: var(--primary);
  padding: 0.9rem 2rem;
  font-size: 1.18rem;
  font-weight: 500;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.5s, transform 0.5s;
  text-align: center;
}

.resume:hover {
  background: #b41e31;
  transform: translateY(-2px) scale(1.04);
}

@media (max-width: 950px) {
  .nav-links {
    gap: 1.5rem;
  }
  .social-container { margin-left: 1rem; }
  .logo { font-size: 1.3rem; }
}

@media (max-width: 770px) {
  .nav-links, .social-container {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

@media (max-width: 490px) {
  .dropdown {
    right: 0.7rem;
    left: 0.7rem;
    min-width: unset;
  }
  .resume { font-size: 1rem; padding: 0.7rem 1.3rem; }
}

section h2 {
    text-align: center;
    font-size: clamp(1.5rem, 2vw, 2.5rem);
    color: #e63946;
    margin-bottom: 2rem;
    margin-top: -1rem;
}

section {
    position: relative;
    min-height: 100vh;
    width: 80%;
    margin: 0 auto;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#home {
    color: var(--text);
    font-family: open-sans;
    text-align: left;
}

.profile-image {
    margin-top: 20px;
    margin-bottom: 20px;
}

.profile-image img {
    border-radius: 50%; 
    width: clamp(150px, 15vw, 300px); 
    aspect-ratio: 1 / 1; 
    object-fit: cover;
    border: 5px solid var(--primary);
  }

.icons {
    width: 5vw;
    height: 5vh;
}

#education {
    position: relative;
    width: 80%;
    margin: 0 auto 4rem auto;
    font-family: open-sans;
}

.education-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.education-timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #e63946;  
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.education-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.education-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.education-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.education-item::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: var(--bg); 
    border: 3px solid #e63946;   
    border-radius: 50%;
    top: 15px;
    right: -10px;
    z-index: 2;
}

.education-item:nth-child(even)::before {
    left: -10px;
    right: auto;
}

.education-content { 
    background-color: var(--bg, #fff);
    color: var(--text, #19191a);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 0px 20px #e6394620; 
    border: 1.5px solid #e63946;
    transition: background 0.2s, color 0.2s;
}

.education-content:hover {
  transform: scale(1.02);
  transition: 0.5s;
  box-shadow: 0px 0px 2rem #e6394620; 
}

.education-item.hovered::before {
  background-color: var(--primary);
  transition: 0.5s;
}

.education-content h3 { 
    margin: 0 0 5px 0;
    color: #e63946;
}

.education-content p {
    margin: 5px 0;
    font-size: 1.01rem;
}

@media (max-width: 700px) {
    .education-timeline::after { left: 20px; margin-left: 0; }
    .education-item { width: 100%; padding-left: 54px; padding-right: 18px; text-align: left; left: 0 !important; }
    .education-item::before { left: 0; right: auto; }
    .education-item:nth-child(even)::before {left: 0; right: 0;}
}


.footer {
    height: 5vh;
    font-size: 1rem;
    font-family: 'Times New Roman', Times, serif;
    color: var(--text);
    background-color: var(--bg);
    text-align: center;
    padding: 20px;
    box-shadow: 0px 0px 15px #e63946;
}

#projects {
  font-family: open-sans;
}

.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.8rem;
  position: relative;
}

.project-info {
  flex: 1 1 350px;
  min-width: 270px;
  z-index: 2;
}

.project-title {
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
  position: relative;
}

.project-links {
  margin-bottom: 1rem;
}

.project-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 1.2rem;
  margin-right: 1.1rem;
  transition: color 0.2s, transform 0.2s;
  vertical-align: middle;
}

.project-links a:hover {
  color: var(--pLinks);
  transform: scale(1.11);
}

.project-desc {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.9rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  padding-left: 0;
}

.project-tags li {
  background: var(--primary);
  color: #fff;
  font-size: 0.94rem;
  border-radius: 3px;
  padding: 0.23rem 0.67rem;
  font-weight: 500;
}

.project-image {
  flex: 1 1 250px;
  min-width: 200px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.project-image iframe {
  box-shadow: 0 7px 24px rgba(230,57,70,0.09);
  max-width: 500px;
  width: 100%;
  height: 100%;
  min-height: 15rem;
  border-color: var(--primary);
  display: block;
  border-radius: 10px;
  
}

.project-image img {
  max-width: 500px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 7px 24px rgba(230,57,70,0.09);
  border: 2.5px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-image img:hover {
  transform: scale(1.045) translateY(-3px);
  box-shadow: 0 14px 40px rgba(230,57,70,0.14);
  border-color: var(--pLinks);
}

.project-image-slideshow {
  max-width: 1000px;
  position: relative;
  margin: auto;
}

.project-image-s {
  display: none;
  min-width: 200px;
}

.project-image-s img {
  width: 100%;
  max-width: 500px;
  border-radius: 10px;
  box-shadow: 0 7px 24px rgba(230,57,70,0.09);
  border: 2.5px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-image-s img:hover {
  transform: scale(1.045) translateY(-3px);
  box-shadow: 0 14px 40px rgba(230,57,70,0.14);
  border-color: var(--pLinks);
}

.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -22px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  opacity: 50%;
}

.next {
  right: 0;
}

.prev {
  left: 0;
}

.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

.fade {
  animation-name: fade;
  animation-duration: 1.5s;
}

@keyframes fade {
  from {opacity: .4}
  to {opacity: 1}
}

@media (max-width: 900px) {
  .projects-section { padding: 2.5rem 1rem; }
}

@media (max-width: 740px) {
  .project {
    gap: 1.2rem;
    align-items: stretch;
  }
  .project-image {
    justify-content: flex-start;
    margin-top: 0.9rem;
    align-items: center;
  }
}

@media (max-width: 500px) {
  .projects-section { padding: 1.4rem 0.2rem; }
  .project-image img { max-width: 96vw }
}

#experience {
    position: relative;
    width: 80%;
    margin: 0 auto 4rem auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: open-sans;
}

#experience h2 {
    text-align: center;
    font-size: clamp(1.5rem, 2vw, 2.5rem);
    color: var(--primary);
    margin-bottom: 3rem;
}

.experience {
    background-color: var(--bg);
    border: 1.5px solid var(--primary);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
    box-shadow: 0px 0px 12px #e6394620;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.experience:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 40px rgba(230,57,70,0.14);
}

.experience h3 {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.experience p {
    color: var(--text);
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
    text-align: left;
    line-height: 1.6;
}

.experience a {
  text-decoration: none;
}

.experience p:nth-child(2),
.experience p:nth-child(3),
.experience p:nth-child(4) {
    padding-left: 1.5rem;
    position: relative;
}

.experience p:nth-child(2)::before,
.experience p:nth-child(3)::before,
.experience p:nth-child(4)::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0.5rem;
}

.experience p strong {
    color: var(--primary);
    font-weight: 600;
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    #experience {
        width: 90%;
    }

    .experience {
        padding: 20px;
    }

    .experience h3 {
        font-size: 1.2rem;
    }

    .experience p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    #experience {
        width: 95%;
    }

    .experience {
        padding: 15px;
    }

    .experience h3 {
        font-size: 1.1rem;
    }

    .experience p {
        font-size: 0.95rem;
    }
}
