:root {
  --bg: #050816;
  --surface: rgba(255, 255, 255, 0.08);
  --text: #f7f8ff;
  --muted: #c7cbdb;
  --accent: #3478ff;
}

/* ===========================
   Global
=========================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Poppins, Arial, sans-serif;
  line-height: 1.6;
}

body.page-bg {
  background: linear-gradient(135deg, #112b5b 0%, #1f4e9c 100%);
}

#particles {
  position: fixed;
  inset: 0;
  z-index: -2;
}

/* ===========================
   Navigation
=========================== */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 7%;
  background: rgba(5, 8, 22, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  margin: 0;
  font-size: 1.5rem;
}

.logo span,
h1 span {
  color: var(--accent);
}

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

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab-btn:hover,
.tab-btn.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

nav a:hover {
  color: var(--accent);
}

.right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#theme {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

/* ===========================
   Sections
=========================== */

section {
  padding: 6rem 7%;
}

section > h2 {
  margin: 0 0 2rem;
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

/* ===========================
   Hero
=========================== */

.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5rem;
}

.hero-left {
  max-width: 620px;
}

.hero-left h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1.12;
  color: #fff;
}

.hero-left h2 {
  min-height: 2.4rem;
  color: #8cb2ff;
}

.hero-left p {
  max-width: 58ch;
  color: #fff;
}

.hero-right img {
  width: min(320px, 75vw);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid rgba(52, 120, 255, 0.5);
  background: var(--surface);
}

/* ===========================
   Buttons
=========================== */

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.25rem;
  border-radius: 0.7rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--accent);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(52, 120, 255, 0.3);
}

/* ===========================
   Cards & Skills
=========================== */

.card,
.project {
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.card {
  max-width: 850px;
  margin: auto;
}

.skill {
  max-width: 850px;
  margin: 1.25rem auto;
}

.bar {
  height: 1.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.fill {
  height: 100%;
  padding-right: 0.5rem;
  text-align: right;
  color: white;
  background: linear-gradient(90deg, #00c6ff, var(--accent));
}

.html {
  width: 95%;
}

.css {
  width: 90%;
}

.js {
  width: 85%;
}

.py {
  width: 92%;
}

/* ===========================
   Projects
=========================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.project {
  overflow: hidden;
}

.project img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #243b69, #3478ff);
}

.project a {
  color: #9cc0ff;
  font-weight: 600;
}

.stats {
  display: block;
  width: 100%;
  max-width: 900px;
  min-height: 195px;
  margin: auto;
  border-radius: 1rem;
  background: var(--surface);
}

/* ===========================
   Contact Form
=========================== */

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 700px;
  margin: auto;
}

form input,
form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.7rem;
  background: var(--surface);
  color: inherit;
  font: inherit;
}

form textarea {
  min-height: 180px;
  resize: vertical;
}

form button {
  padding: 1rem;
  border: 0;
  border-radius: 0.7rem;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ===========================
   Social Links
=========================== */

.social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.social a {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}

.social a:hover {
  transform: translateY(-4px);
  background: var(--accent);
}

/* ===========================
   Footer
=========================== */

footer {
  padding: 2rem 7%;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===========================
   Utilities
=========================== */

#topBtn {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 101;
  display: none;
  width: 3.25rem;
  height: 3.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 102;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, #00c6ff, #8f00ff);
}

/* ===========================
   Light Mode
=========================== */

.light-mode {
  --bg: #f5f7ff;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
}

.light-mode nav {
  background: rgba(255, 255, 255, 0.88);
}

/* ===========================
   Responsive
=========================== */

@media (max-width: 900px) {
  .hero {
    flex-direction: column-reverse;
    gap: 2rem;
    text-align: center;
  }

  .buttons {
    justify-content: center;
  }

  .project-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: auto;
  }
}

@media (max-width: 640px) {
  nav {
    position: relative;
    flex-direction: column;
  }

  nav ul {
    gap: 0.75rem;
  }

  section {
    padding: 4rem 6%;
  }
}

