:root {
  --bg: #ffffff;
  --text: #111;
  --primary: #0070f3;
}
html {
  scroll-behavior: smooth;
}
section {
  scroll-margin-top: 80px;
}
body.dark {
  --bg: #0f172a;
  --text: #e5e7eb;
  --primary: #38bdf8;
}
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}
#preloader {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  background: var(--bg);
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #eee;
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid #eee;
  z-index: 10;
}
.nav {
  max-width: 1100px;
  margin: auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.logo {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary);
}
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--text);
}
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  margin-left: 1rem;
}
#menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}
@media (max-width: 768px) {
  .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 70px;
    right: -100%;
    background: var(--bg);
    width: 70%;
    height: 100vh;
    padding: 2rem;
    gap: 2rem;
    transition: 0.4s ease-in-out;
    box-shadow: -5px 0 15px rgb(0 0 0 / 0.1);
    z-index: 999;
  }
  .nav-links.show {
    right: 0;
  }
  body {
    overflow-x: hidden;
  }
  .hero {
    height: auto;
    padding: 50px 20px;
  }
  .hero_wrapper {
    width: 180px !important;
    height: 180px !important;
    margin: 20px auto !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    border: 4px solid var(--primary);
    position: relative;
  }
  .hero_img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 100%;
  }
  .border_circle {
    display: none;
  }
  h1 {
    font-size: 1.8rem;
    text-align: center;
  }
  .projects {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }
  .cv-button,
  .tab-btn {
    width: 100%;
    justify-content: center;
    padding: 15px;
  }
  #menu-btn {
    display: block;
    position: relative;
  }
  .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .typed-text {
    font-size: 1rem !important;
    display: block;
    width: 90%;
    margin: 10px auto;
    word-wrap: break-word;
    min-height: 3.5rem;
  }
}
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.hero_wrapper {
  width: 250px;
  height: 250px;
  margin: 20px auto;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 4px solid var(--primary);
  position: relative;
  aspect-ratio: 1 / 1;
}
.hero_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.hero_img.show {
  opacity: 1;
}
.hero_img:hover {
  transform: scale(1.1);
}
.border_circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  border: 5px solid #fff0;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-bottom-color: var(--primary);
  animation: spin 4s linear infinite;
  box-shadow: 0 0 0 5px rgb(0 0 0 / 0.2);
  box-sizing: border-box;
}
.hero span {
  color: var(--primary);
}
.typed-text {
  min-height: 1.5em;
  display: inline-block;
  font-weight: 500;
  margin-top: 1rem;
  font-size: 1.2rem;
}
.hero-action {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 75%;
  margin-top: 25px;
}
.cv-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background-color: var(--primary);
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid var(--primary);
  box-shadow: 0 4px 15px rgb(0 112 243 / 0.2);
}
.cv-button:hover {
  background-color: #fff0;
  color: var(--primary) !important;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgb(0 112 243 / 0.3);
}
.section {
  max-width: 900px;
  margin: auto;
  padding: 4rem 1rem;
}
.personal-meta {
  margin-top: 20px;
  border-top: 1px solid rgb(128 128 128 / 0.1);
  padding-top: 15px;
  font-size: 0.95rem;
}
.personal-meta strong {
  color: var(--primary);
}
.skills .skill {
  margin: 1rem 0;
}
.skills .bar {
  background: #eee;
  height: 8px;
  overflow: hidden;
}
.skills .bar div {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 1s ease;
}
.sub-heading {
  font-weight: 700;
  margin: 20px 0 10px;
  font-size: 1rem;
}
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.project-card {
  background: var(--bg);
  border: 1px solid rgb(0 0 0 / 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgb(0 0 0 / 0.05);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
}
body.dark .project-card {
  border-color: rgb(255 255 255 / 0.1);
  box-shadow: 0 4px 6px rgb(0 0 0 / 0.3);
}
.project-card h3 {
  margin-top: 0;
  color: var(--primary);
}
.project-card p,
.project-desc {
  font-size: 0.9rem;
  text-align: justify;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tech-badge {
  background: rgb(0 112 243 / 0.1);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgb(0 112 243 / 0.2);
  text-transform: capitalize;
}
body.dark .tech-badge {
  background: rgb(56 189 248 / 0.1);
  border-color: rgb(56 189 248 / 0.3);
}
.project-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.view-details-btn {
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.7;
}
.demo-link {
  background: var(--primary);
  color: #fff !important;
  padding: 5px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
}
.resume-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 50px auto;
  background: #f1f5f9;
  padding: 8px;
  border-radius: 50px;
  width: fit-content;
}
body.dark .resume-tabs {
  background: #1e293b;
}
.tab-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  background: #fff0;
  color: var(--text);
  font-weight: 600;
  transition: all 0.3s ease;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgb(0 112 243 / 0.3);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.6s ease forwards;
}
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.timeline::after {
  content: "";
  position: absolute;
  width: 2px;
  background: var(--primary);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}
.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}
.timeline-item::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border: 3px solid var(--primary);
  top: 15px;
  border-radius: 50%;
  z-index: 2;
}
.left {
  left: 0;
  text-align: left;
}
.right {
  left: 50%;
  text-align: left;
}
.left::after {
  right: -11px;
}
.right::after {
  left: -11px;
}
.content h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.2rem;
}
.company {
  font-weight: 500;
  margin: 5px 0;
  color: var(--text);
}
.company span {
  color: var(--primary);
  font-size: 0.9rem;
  opacity: 0.9;
}
.content .date {
  font-size: 0.85rem;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 5px;
}
.testimonial-slider {
  position: relative;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
}
.testimonial-card {
  position: absolute;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  text-align: justify;
  max-width: 700px;
  padding: 20px;
}
.testimonial-card.active {
  opacity: 1;
}
.quote {
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--text);
  text-align: justify !important;
  text-justify: inter-word;
  line-height: 1.7;
}
.testimonial-author {
  text-align: center;
  margin-top: 15px;
  display: block;
  width: 100%;
}
.testimonial-author strong {
  display: block;
  color: var(--primary);
  font-size: 1rem;
}
.testimonial-author span {
  font-size: 0.85rem;
  opacity: 0.7;
}
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-content {
  background: var(--bg);
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  position: relative;
  border-radius: 5px;
}
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}
.info-item a {
  color: var(--text);
  text-decoration: none;
  transition: 0.3s;
}
.info-item a:hover {
  color: var(--primary);
}
#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 0.7rem;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#contact-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}
.footer {
  text-align: center;
  padding: 2rem;
}
.fade {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}
.fade.show {
  opacity: 1;
  transform: translateY(0);
}
.item-description,
.resume-list li {
  text-align: justify !important;
  text-justify: inter-word;
  hyphens: auto;
  line-height: 1.7;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 600px) {
  .timeline::after {
    left: 31px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 20px;
    text-align: left !important;
  }
  .timeline-item::after {
    left: 20px !important;
  }
  .right,
  .left {
    left: 0;
  }
  .resume-list {
    padding-left: 15px;
  }
  .cv-button {
    padding: 10px 22px;
    font-size: 0.9rem;
  }
  .testimonial-slider {
    height: 400px;
  }
  .typed-text {
    font-size: 0.9rem;
    word-wrap: break-word;
    padding: 0 20px;
  }
}
#projects-container {
  min-height: 400px;
}
#testimonial-container {
  min-height: 250px;
}
.modal-footer {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}
.modal-btn {
  padding: 5px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: 0.3s;
  border: 2px solid var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-btn.primary {
  background: var(--primary);
  color: white !important;
}
.modal-btn.outline {
  background: #fff0;
  color: var(--primary) !important;
}
.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgb(0 112 243 / 0.3);
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.dot {
  width: 10px;
  height: 10px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}
