:root {
  --bg-light: #f2f4fc;
  --bg-dark: #181a27;
  --header-dark: #202344;
  --card-light: #fff;
  --card-dark: #22243a;
  --text-light: #232344;
  --text-dark: #e8ecf7;
  --accent: #674fff;
  --accent-gradient: linear-gradient(90deg,#674fff 0%, #4ecbfa 100%);
  --accent-light: #b0c4ff;
  --accent-hover: #4ecbfa;
  --input-light: #f8faff;
  --input-dark: #23243a;
  --border-light: #e3dff8;
  --border-dark: #2d3047;
}

body {
    margin: 0;
    font-family: 'Poppins', Arial, sans-serif;
    background: #e5e8e9;
    color: var(--text-light);
    transition: background .3s, color .3s;
}


.theme-toggle {
  display: none;
}

.theme-label {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 48px;
  height: 26px;
  background: #eee;
  border: 2px solid #674fff33;
  border-radius: 13px;
  box-shadow: 0 2px 8px #8882;
  cursor: pointer;
  z-index: 999;
}

.theme-label:after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  left: 4px;
  top: 3px;
  transition: left .3s, background .3s;
}

.theme-toggle:checked+.theme-label {
  background: var(--header-dark);
}

.theme-toggle:checked+.theme-label:after {
  left: 24px;
  background: #fff;
}

header {
  background: var(--header-dark);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem 1rem;
  box-shadow: 0 2px 18px #674fff12;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s, box-shadow .2s;
  padding: .3rem .8rem;
  border-radius: 6px;
}

nav a:hover, nav a:focus {
  color: white;
  background: rgb(111, 140, 172);
  box-shadow: 0 2px 12px #674fff22;
}

.social-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-links a img {
  width: 28px;
  vertical-align: middle;
  transition: transform 0.22s cubic-bezier(.4,2,.3,1.2), box-shadow 0.22s;
}

.social-links a:hover img {
  transform: scale(1.18) rotate(-7deg);
  box-shadow: 0 4px 14px #674fff33;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

section {
  margin-bottom: 3rem;
   padding: 1rem 1rem;
  border-radius: 18px;
  background: var(--card-light);
  transition: box-shadow 0.3s, background 0.3s, color 0.3s;
}

section:hover {
  box-shadow: 0 6px 36px #674fff16, 0 2px 18px #4ecbfa0d;
}

#hero {
  background: var(--accent-gradient);
  color: #141420;
  text-align: center;
  padding: 3rem 1rem 2rem 1rem;
  border-radius: 24px;
  box-shadow: 0 8px 32px #674fff1a;
  transition: box-shadow 0.22s;
}

#hero:hover {
  box-shadow: 0 12px 40px #674fff33, 0 2px 24px #4ecbfa22;
}

.profile-img img {
  width: 250px;
  height: 250px;
  border-radius: 20%;
  object-fit: cover;
  border: 4px solid #674fff;
  box-shadow: 0 4px 32px #674fff22;
  transition: transform .22s;
}

/* .profile-img img:hover {
  transform: scale(1.05) rotate(-4deg);
  box-shadow: 0 8px 32px #4ecbfa22;
} */

.resume-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .7rem 2rem;
  background: rgba(12, 12, 31, 0.74);
  color: #ffffff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 12px #674fff22;
  transition: background .2s, color .2s, box-shadow .2s;
  border: none;
}

.resume-btn:hover, .resume-btn:focus {
  background: rgba(68, 93, 129, 0.726);
  color: #ffffff;
  box-shadow: 0 6px 24px #674fff33;
}

#about .about-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2rem;
  justify-content: space-between;
}

.about-content {
  flex: 1;
  min-width: 300px;
}

.about-info {
  display: block;
  margin-top: 0;
  padding: 1.5rem;
  background: var(--input-light);
  color: var(--text-light);
  border-radius: 15px;
  box-shadow: 0 2px 14px #674fff11;
  font-weight: 400;
  transition: background .2s, color .2s, box-shadow .2s;
  border: 1.5px solid var(--border-light);
}

.about-info:hover {
  background: #e6eaec;
  box-shadow: 0 6px 24px #674fff15;
}

.about-img {
  width: 230px;
  border-radius: 16px;
  box-shadow: 0 4px 20px #674fff18;
  border: 2px solid #4ecbfa;
  transition: transform .22s, box-shadow .22s;
}

.about-img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 8px 32px #674fff33;
}

.about-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.about-list li {
  margin-bottom: .5rem;
  padding: .2rem 0;
  transition: background .2s, color .2s;
  border-radius: 4px;
}

.about-list li:hover {
  background: #f8edf6;
  color: black;
}

#education {
  padding: 1rem 1rem;
}

.education-cards {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
}

.education-card {
  flex: 1;
  min-width: 250px;
  max-width: 300px;
  background: var(--input-light);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px #674fff10;
  border: 1.5px solid var(--border-light);
  transition: box-shadow .22s, transform .22s, background .22s;
  cursor:inherit;
  color: var(--text-light);
}

.education-card:hover {
  box-shadow: 0 8px 32px #674fff2a;
  background: #e3f4fd;
  transform: translateY(-6px) scale(1.04);
}

.education-card h3 {
  color: var(--accent-hover);
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
}

.education-card p {
  margin: 0.5rem 0;
  line-height: 1.5;
}
/* Light theme: force black for headings and skill names */
.education-card h3 {
  color: #000;
}

.skill {
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 1rem;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: var(--input-light);
  box-shadow: 0 2px 10px #674fff10;
  transition: box-shadow .22s, background .22s, transform .22s;
  cursor: pointer;
  color: var(--text-light);
}

.skill span.skill-percent {
  font-weight: 600;
  color: rgba(11, 12, 22, 0.664);
  margin-left: 16px;
  min-width: 45px;
  text-align: right;
  font-size: 1em;
}

.skill .bar {
  flex:auto;
  margin-left: 16px;
  margin-right: 0;
}
.skill span {
  color: #000;
}

/* Dark theme: keep accent color for headings and skill names */
.theme-toggle:checked ~ main .education-card h3,
.theme-toggle:checked ~ main .skill span {
  color: var(--accent-hover);
}
.skills-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.skill {
  margin-bottom: 1rem;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: var(--input-light);
  box-shadow: 0 2px 10px #674fff10;
  transition: box-shadow .22s, background .22s, transform .22s;
  cursor: inherit;
  position: relative;
  color: var(--text-light);
}

.skill:hover {
  background: #e3f4fd;
  box-shadow: 0 6px 24px #674fff25;
  transform: translateY(-4px) scale(1.03);
}

/* .skill span {
  font-weight: 500;
  color: var(--accent-hover);
  font-size: 1.08em;
} */

.bar {
  background: #eee;
  border-radius: 8px;
  height: 10px;
  margin-top: 7px;
  overflow: hidden;
}

.bar-fill {
  background: var(--accent-gradient);
  height: 100%;
  border-radius: 8px;
  width: 0;
  animation: fillBar 2s forwards;
  box-shadow: 0 4px 16px #674fff33;
}

.skill:nth-child(2) .bar-fill { animation-delay: .4s; }
.skill:nth-child(3) .bar-fill { animation-delay: .6s; }
.skill:nth-child(4) .bar-fill { animation-delay: .8s; }
.skill:nth-child(5) .bar-fill { animation-delay: 1s; }
.skill:nth-child(6) .bar-fill { animation-delay: 1.2s; }

@keyframes fillBar {
  to { width: var(--bar-width); }
}

#hobbies-list li, #achievements-list li {
  padding: 0.6rem 1rem;
  margin-bottom: .5rem;
  border-radius: 7px;
  background: var(--input-light);
  color: var(--text-light);
  box-shadow: 0 2px 8px #674fff11;
  transition: background .22s, color .22s, box-shadow .22s;
  cursor: inherit;
}

#hobbies-list li:hover,
#achievements-list li:hover {
  background: #e3f4fd;
  /* color: var(--accent-hover); */
  box-shadow: 0 8px 24px #674fff20;
}

.portfolio-items {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.portfolio-item {
  background: var(--input-light);
  border-radius: 14px;
  box-shadow: 0 2px 10px #674fff13;
  padding: 1.2rem;
  width: 220px;
  text-align: center;
  transition: transform .22s, box-shadow .22s, background .22s;
  cursor: pointer;
  color: var(--text-light);
}

.portfolio-item:hover {
  background: #e3f4fd;
  transform: translateY(-9px) scale(1.04);
  box-shadow: 0 10px 34px #674fff33;
}

.portfolio-item img {
  max-width: 100%;
  border-radius: 8px;
  height: 120px;
  object-fit: cover;
  box-shadow: 0 2px 10px #674fff11;
  transition: box-shadow .22s, transform .22s;
}

.portfolio-item:hover img {
  box-shadow: 0 8px 32px #4ecbfa33;
  transform: scale(1.04) rotate(-2deg);
}

.portfolio-item h4 {
  color: black;
  margin-top: 1rem;
  font-size: 1.1em;
  transition: color .2s;
}

.portfolio-item:hover h4 {
  color: black;
}

.contact-info {
  margin-bottom: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  max-width: 400px;
}

.contact-form input,
.contact-form textarea {
  padding: .6rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-light);
  font-size: 1rem;
  background: var(--input-light);
  transition: border-color .2s, background .2s, color .2s;
  color: var(--text-light);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  background: #eef0ff;
}

.contact-form button {
  background: rgb(98, 96, 189);
  color: #fff;
  border: none;
  padding: .8rem;
  border-radius: 7px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  transition: background .2s, box-shadow .2s, transform .2s;
  box-shadow: 0 2px 12px #674fff22;
}

.contact-form button:hover, .contact-form button:focus {
  background: rgba(171, 166, 243, 0.726);
  color: #0c0c0c;
  box-shadow: 0 6px 24px #674fff33;
  transform: scale(1.06);
}

.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--accent-gradient);
  color: #fff;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 6px 18px #674fff33;
  opacity: 1;
  pointer-events: auto;
  transition: background .22s, color .22s, box-shadow .22s, transform .22s;
  z-index: 99;
}

.scroll-top:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 12px 36px #674fff33;
  transform: scale(1.13);
}

footer {
  background: var(--header-dark);
  color: #fff;
  text-align: center;
  padding: 1.2rem 0;
  font-size: 1rem;
  margin-top: 2rem;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px #674fff12;
}

/* --- DARK MODE OVERRIDES --- */
.theme-toggle:checked ~ header,
.theme-toggle:checked ~ main,
.theme-toggle:checked ~ footer {
  background: var(--header-dark);
  color: var(--text-dark);
}

.theme-toggle:checked ~ main {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.theme-toggle:checked ~ main section,
.theme-toggle:checked ~ main .about-info,
.theme-toggle:checked ~ main .education-card,
.theme-toggle:checked ~ main .skill,
.theme-toggle:checked ~ main #hobbies-list li,
.theme-toggle:checked ~ main #achievements-list li,
.theme-toggle:checked ~ main .portfolio-item {
  background: var(--card-dark);
  color: var(--text-dark);
  border-color: var(--border-dark);
}

.theme-toggle:checked ~ main .contact-form input,
.theme-toggle:checked ~ main .contact-form textarea{
  background: rgb(217, 219, 219);
  color: rgb(0, 0, 0);
}

.theme-toggle:checked ~ main .skill span,
.theme-toggle:checked ~ main .education-card h3,
.theme-toggle:checked ~ main .portfolio-item h4 {
  color: var(--accent-hover);
}
.theme-toggle:checked ~ main .about-list li:hover{
  background-color: #363647;
  color: #fdfdff;
}

.theme-toggle:checked ~ main .education-card:hover,
.theme-toggle:checked ~ main .skill:hover,
.theme-toggle:checked ~ main .portfolio-item:hover,
.theme-toggle:checked ~ main #hobbies-list li:hover,
.theme-toggle:checked ~ main #achievements-list li:hover {
  background: #23243a;
  color: var(--accent-hover);
}

.theme-toggle:checked ~ main .bar {
  background: #22243a;
}

.theme-toggle:checked ~ main .bar-fill {
  background: var(--accent-gradient);
}

.theme-toggle:checked ~ main .contact-form input:focus,
.theme-toggle:checked ~ main .contact-form textarea:focus {
  background: #181a27;
  border-color: var(--accent-hover);
  color: var(--text-dark);
}

.theme-toggle:checked ~ .scroll-top {
  background: #4ecbfa;
  color: #22243a;
}

@media (max-width:700px) {
  main {
    padding: 1rem .5rem;
  }
  .skills-list {
    grid-template-columns: 1fr;
  }
  .portfolio-items {
    flex-direction: column;
    align-items: center;
  }
  .theme-label {
    top: 8px;
    right: 8px;
  }
  #about .about-container {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .about-img {
    width: 100%;
    max-width: 200px;
  }
}

.contact-flex {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.contact-info,
.contact-form {
  flex: 1 1 0;
  max-width: 100%;
}

@media (max-width: 700px) {
  .contact-flex {
    flex-direction: column;
    gap: 1rem;
  }
}