/* ===== Theme Variables ===== */
/* Default is the bright / light theme. Dark mode is opt-in via the toggle. */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f6fc;
  --card: #ffffff;
  --text: #141a2e;
  --text-muted: #55607a;
  --accent: #5b52f0;
  --accent-2: #0091ea;
  --border: #e4e8f2;
  --shadow: rgba(90, 100, 140, 0.16);
}

[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-alt: #111827;
  --card: #161d2e;
  --text: #e6e9ef;
  --text-muted: #9aa4b8;
  --accent: #6c63ff;
  --accent-2: #00d4ff;
  --border: #26304a;
  --shadow: rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, .logo {
  font-family: "Poppins", sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== SVG line icons ===== */
.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 24px;
}

/* ===== Navbar ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
}
.logo span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-links a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle, .menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  padding: 4px;
}
.theme-toggle .icon, .menu-btn .icon {
  width: 22px;
  height: 22px;
}
.theme-toggle:hover {
  transform: scale(1.2) rotate(-15deg);
}
.menu-btn {
  display: none;
}

/* ===== Hero ===== */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  top: 10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: 0.15;
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
}

.hero-greeting {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}
.hero-name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-muted);
  margin: 8px 0 20px;
}
.wave {
  display: inline-block;
  animation: wave 2s infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
}
.hero-desc {
  max-width: 560px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  padding: 13px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
  border: 2px solid transparent;
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-outline {
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title.center {
  justify-content: center;
  text-align: center;
}
.section-title .num {
  color: var(--accent);
  font-size: 1.3rem;
  font-family: "Inter", monospace;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p {
  margin-bottom: 16px;
  color: var(--text-muted);
}
.about-info {
  list-style: none;
  margin-top: 20px;
}
.about-info li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.about-info strong {
  color: var(--accent);
}
.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 10px 30px var(--shadow);
}
.avatar {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-card p {
  color: var(--text-muted);
}

/* ===== Education ===== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.edu-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  gap: 18px;
  transition: transform 0.25s, border-color 0.25s;
}
.edu-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.edu-icon {
  flex-shrink: 0;
  color: var(--accent);
}
.edu-icon .icon {
  width: 30px;
  height: 30px;
}
.edu-body h3 {
  margin-bottom: 4px;
}
.edu-org {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.edu-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: monospace;
  margin-bottom: 10px;
}
.edu-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  transition: transform 0.25s, border-color 0.25s;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.skill-icon {
  height: 52px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}
.skill-icon img {
  height: 52px;
  width: 52px;
  object-fit: contain;
  transition: transform 0.25s;
}
.skill-card:hover .skill-icon img {
  transform: scale(1.1);
}
.skill-card h3 {
  margin-bottom: 8px;
}
.skill-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.soft-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  justify-content: center;
}
.soft-skills span {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  transition: transform 0.25s;
  position: relative;
}
.project-card.featured {
  border-color: var(--accent);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 20%, transparent);
}
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.featured-badge .icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.project-links {
  display: flex;
  gap: 14px;
}
.project-card:hover {
  transform: translateY(-6px);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.folder {
  color: var(--accent);
}
.folder .icon {
  width: 30px;
  height: 30px;
}
.project-link {
  color: var(--text-muted);
  display: inline-flex;
  transition: transform 0.2s, color 0.2s;
}
.project-link .icon {
  width: 22px;
  height: 22px;
}
.project-link:hover {
  transform: scale(1.2);
  color: var(--accent);
}
.project-card h3 {
  margin-bottom: 10px;
}
.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tags li {
  font-size: 0.8rem;
  color: var(--accent-2);
  font-family: monospace;
}
.projects-note {
  text-align: center;
  color: var(--text-muted);
  margin-top: 32px;
}

/* ===== Certifications ===== */
.cert-timeline {
  position: relative;
  padding-left: 30px;
}
.cert-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.cert-item {
  position: relative;
  padding-bottom: 28px;
}
.cert-dot {
  position: absolute;
  left: -30px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}
.cert-content h3 {
  font-size: 1.1rem;
}
.cert-org {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Contact ===== */
.contact-intro {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--text-muted);
}
.contact-form {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row {
  display: flex;
  gap: 16px;
}
.form-row input {
  flex: 1;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form .btn {
  align-self: center;
  border: none;
}
.form-status {
  text-align: center;
  font-weight: 500;
  min-height: 1.2em;
}
.form-status.success { color: #2ecc71; }
.form-status.error { color: #e74c3c; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-top: 40px;
}
.contact-links a {
  color: var(--text-muted);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.contact-links .icon {
  width: 18px;
  height: 18px;
}
.contact-links a:hover {
  color: var(--accent);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.2s;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top .icon {
  width: 22px;
  height: 22px;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  transform: translateY(-4px);
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .menu-btn {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: 65px;
    right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    width: 220px;
    padding: 24px;
    gap: 20px;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    height: auto;
  }
  .nav-links.open {
    transform: translateX(0);
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
  }
  section {
    padding: 70px 20px;
  }
  .hero {
    min-height: auto;
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .hero::before {
    width: 300px;
    height: 300px;
    right: -20%;
  }
  .edu-card {
    flex-direction: column;
    gap: 12px;
  }
}

/* ===== Small phones ===== */
@media (max-width: 480px) {
  section {
    padding: 56px 16px;
  }
  .navbar {
    padding: 14px 16px;
  }
  .hero {
    padding: 0 16px 40px;
  }
  .hero-buttons {
    width: 100%;
  }
  .hero-buttons .btn {
    flex: 1;
    text-align: center;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .skills-grid,
  .projects-grid,
  .edu-grid {
    grid-template-columns: 1fr;
  }
  .contact-links {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .contact-form .btn {
    width: 100%;
  }
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
}
