:root {
  --bg: radial-gradient(circle at 0% 0%, #0ea5e9 0, #020617 35%, #020617 100%);
  --highlight: #38bdf8;
  --text: #e5e7eb;
  --nav-bg: rgba(15, 23, 42, 0.96);
  --card-bg: rgba(15, 23, 42, 0.92);
  --card-border: rgba(148, 163, 184, 0.35);
  --muted: #94a3b8;
}

body.light-mode {
  --bg: linear-gradient(135deg, #f8fafc, #dbeafe);
  --highlight: #0ea5e9;
  --text: #0f172a;
  --nav-bg: rgba(248, 250, 252, 0.97);
  --card-bg: rgba(255, 255, 255, 0.98);
  --card-border: rgba(148, 163, 184, 0.4);
  --muted: #64748b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

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

/* Subtle colorful background patterns */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.2), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(129, 140, 248, 0.2), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

/* Navbar */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  padding: 0.55rem 1.5rem;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.7);
  transition: top 0.3s, background 0.3s;
}

nav.hide {
  top: -80px;
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.nav-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--highlight);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.nav-name {
  font-weight: 600;
  font-size: 1rem;
}

.nav-role {
  font-size: 0.75rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  font-size: 0.9rem;
  padding-bottom: 2px;
}

nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -3px;
  left: 0;
  background: linear-gradient(to right, #38bdf8, #a855f7);
  transition: width 0.25s;
}

nav a:hover::after {
  width: 100%;
}

/* Toggles */
.theme-toggle,
.menu-toggle {
  position: fixed;
  top: 0.8rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--highlight);
  cursor: pointer;
  z-index: 1001;
}

.theme-toggle {
  right: 0.8rem;
}

.menu-toggle {
  left: 0.8rem;
  display: none;
}

.spacer {
  height: 70px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 1.3rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.65);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s,
    background 0.2s ease;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.85);
  border-color: var(--highlight);
}

/* Header / Hero */
header {
  padding: 4.5rem 1rem 2.5rem;
}

.hero-layout {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.3rem;
  animation: fadeInZoom 1.1s ease-out forwards;
  opacity: 0;
}

.hero-main {
  display: flex;
  gap: 1.3rem;
  align-items: center;
}

.hero-avatar-wrap {
  flex-shrink: 0;
  animation: float 6s ease-in-out infinite;
}

.hero-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--highlight);
  object-fit: cover;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.75);
  animation:
    glow 2.5s ease-in-out infinite alternate,
    bounceIn 1.2s ease forwards;
}

.hero-text h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hero-badge {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.role-line {
  font-size: 1.02rem;
  margin-top: 0.2rem;
}

.hero-subtitle {
  font-size: 0.95rem;
  margin-top: 0.6rem;
  color: var(--muted);
}

.hero-links {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Hero side card */
.hero-side h3 {
  font-size: 1rem;
  margin-bottom: 0.7rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.stat {
  padding: 0.6rem 0.5rem;
  border-radius: 0.9rem;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.45);
}

body.light-mode .stat {
  background: radial-gradient(circle at top, rgba(14, 165, 233, 0.18), rgba(248, 250, 252, 0.98));
}

.stat-number {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.mini-note {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Animations */
@keyframes fadeInZoom {
  0% {
    opacity: 0;
    transform: scale(0.97) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes glow {
  from {
    box-shadow: 0 0 12px #38bdf8;
  }
  to {
    box-shadow: 0 0 28px #38bdf8;
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

.cursor {
  font-weight: bold;
  color: var(--highlight);
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}

.primary-btn {
  background: linear-gradient(to right, #38bdf8, #a855f7);
  color: #020617;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
}

.primary-btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 15px 35px rgba(56, 189, 248, 0.55);
}

.ghost-btn {
  background: transparent;
  border-color: var(--highlight);
  color: var(--highlight);
}

.ghost-btn:hover {
  background: rgba(148, 163, 184, 0.15);
  transform: translateY(-1px);
}

/* Main & Sections */
main {
  max-width: 1000px;
  margin: auto;
  padding: 2rem 1rem 3rem;
}

section {
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.reveal {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  margin-bottom: 1.1rem;
}

.section-header h2 {
  font-size: 1.7rem;
  color: var(--highlight);
}

.section-tagline {
  font-size: 0.9rem;
  color: var(--muted);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
}

/* About */
.about-highlight h3 {
  font-size: 1rem;
  margin-bottom: 0.7rem;
}

.pill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.pill-list li {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

body.light-mode .pill-list li {
  background: rgba(248, 250, 252, 0.98);
}

/* Lists & Cards */
ul {
  list-style: none;
  padding-left: 0;
}

.card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Skills */
.skills-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.subheading {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.3rem;
}

.tag {
  background: var(--highlight);
  color: #020617;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tag:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.7);
}

.tag i {
  margin-right: 6px;
  font-size: 1rem;
}

/* Education */
.edu-card {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.education-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.edu-bullet {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at top, #38bdf8, #1d4ed8);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.8);
}

/* Projects */
.project-list .card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

.tech-stack {
  font-size: 0.82rem;
  margin-top: 0.5rem;
  color: var(--muted);
}

/* Activities */
.image-card img {
  width: 100%;
  border-radius: 1rem;
  display: block;
  margin-bottom: 0.6rem;
}

.image-caption {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Certifications */
#certifications a {
  margin-left: 8px;
  font-size: 1rem;
  text-decoration: none;
  color: var(--highlight);
}

#certifications a:hover {
  text-decoration: underline;
}

/* Contact */
.contact-card p {
  margin-bottom: 0.45rem;
}

#contact i {
  margin-right: 8px;
  color: var(--highlight);
}

/* Footer */
footer {
  text-align: center;
  background: rgba(15, 23, 42, 0.96);
  padding: 1rem;
  color: #cbd5e1;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-main {
    flex-direction: column;
    text-align: center;
  }

  .hero-text {
    text-align: center;
  }

  .hero-links {
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-grid,
  .skills-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  nav {
    padding-inline: 1rem;
  }

  .nav-inner {
    justify-content: center;
  }

  .nav-links {
    display: none;
  }

  nav.show .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 0.5rem;
  }

  .menu-toggle {
    display: block;
  }

  header {
    padding-top: 4rem;
  }

  .card {
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.6);
  }
}

@media (min-width: 640px) {
  .card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #projects .card-list {
    grid-template-columns: 1fr;
  }
}
