:root {
  --bg-color: #050816;
  --bg-alt: #0b1020;
  --text-color: #f9fafb;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --card-bg: rgba(15, 23, 42, 0.9);
  --border-color: rgba(148, 163, 184, 0.4);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
}

body.light {
  --bg-color: #f4f4f5;
  --bg-alt: #ffffff;
  --text-color: #020617;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --card-bg: #ffffff;
  --border-color: rgba(148, 163, 184, 0.4);
  --shadow-soft: 0 14px 35px rgba(15, 23, 42, 0.12);
}

/* Reset + base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

a {
  color: white;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-color);
  background: radial-gradient(circle at top left, #1e293b 0, #020617 45%, #000 100%);
  position: relative;
  overflow-x: hidden;
}

/* Canvas background */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* Header / navbar */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.7),
    transparent
  );
}

.navbar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-img {
  height: 40px;
  width: auto;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  flex: 1;
  justify-content: flex-end;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0.9;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  position: relative;
  transition: all 0.2s ease-out;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.2s ease-out;
}

.nav-links a:hover {
  opacity: 1;
  background: var(--accent-soft);
}

.nav-links a:hover::after {
  width: 80%;
}

/* Mobile menu toggle */
#menu-toggle {
  display: none;
}

.menu-icon {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
}

/* Main layout */
main {
  max-width: 1080px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem 3rem;
}

section {
  margin: 3rem 0;
  padding: 1.75rem 1.5rem;
  background: var(--card-bg);
  border-radius: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* Fade-in animation for sections */
.fade-section {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section headings */
section h1,
section h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

#about h1 {
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  letter-spacing: 0.05em;
}

#about .subtitle {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent);
}

p {
  line-height: 1.6;
}

/* Lists */
ul {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.35rem;
}

/* Experience / Education lists */
.timeline-list {
  list-style: none;
  padding-left: 0;
  border-left: 1px solid var(--border-color);
  margin-left: 0.5rem;
}

.timeline-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.timeline-list li::before {
  content: "";
  position: absolute;
  left: -0.38rem;
  top: 0.35rem;
  height: 0.6rem;
  width: 0.6rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.7);
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding-left: 0;
}

.skills-list li {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  font-size: 0.9rem;
}

/* Projects */
.project {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.9),
    rgba(30, 64, 175, 0.7)
  );
}

body.light .project {
  background: linear-gradient(
    135deg,
    #ffffff,
    #eef2ff,
    #e0f2fe
  );
}

.project-img {
  width: 260px;        
  height: 150px;        
  object-fit: cover;     
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  flex-shrink: 0;
}

.project-text {
  flex: 1 1 220px;
  font-size: 0.95rem;
}

.project-text a {
  color: var(--accent);
  text-decoration: none;
}

.project-text a:hover {
  text-decoration: underline;
}

/* Contact */
#contact .social-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

#contact .social-icons img {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 8px rgba(15, 23, 42, 0.9));
  transition: transform 0.15s ease, filter 0.15s ease;
}

#contact .social-icons a:hover img {
  transform: translateY(-1px) scale(1.05);
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.8));
}

/* Email button */
.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.email-btn span {
  font-size: 1.1rem;
}

.email-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.7);
}

#scrollTopBtn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #38bdf8;
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
  z-index: 999;
}

#scrollTopBtn:hover {
  transform: translateY(-3px);
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem 0 1.75rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    padding-inline: 1rem;
  }

  .menu-icon {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 56px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1.25rem 1.25rem;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.98);
    transform-origin: top;
    transform: scaleY(0.4);
    opacity: 0;
    pointer-events: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(20px);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  }

  body.light .nav-links {
    background: rgba(248, 250, 252, 0.98);
  }

  #menu-toggle:checked ~ .nav-links {
    opacity: 1;
    pointer-events: auto;
    transform: scaleY(1);
  }

  .nav-links a {
    width: 100%;
    padding-inline: 0;
  }

  .project {
    flex-direction: column;
  }

  .project-img {
    width: 100%;
    max-width: 100%;
  }
}
