:root {
  --bg: #0f172a;
  --surface: rgba(15, 23, 42, 0.85);
  --surface-strong: rgba(15, 23, 42, 0.95);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #5b78f6;
  --accent-soft: rgba(91, 120, 246, 0.16);
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
  --radius: 28px;
  --radius-sm: 18px;
  --gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 65%, #0e1631 100%);
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --text: #0f172a;
  --muted: #475569;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.14);
  --border: rgba(148, 163, 184, 0.22);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  --gradient: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
  color-scheme: light;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(circle at top, rgba(91, 120, 246, 0.14), transparent 28%),
              radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.12), transparent 30%),
              var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
  position: relative;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ─── HEADER ─────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--border);
}

[data-theme='light'] header {
  background: rgba(255, 255, 255, 0.92);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5b78f6, #22d3ee);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

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

/* ─── BUTTONS ─────────────────────────────────────────── */

.btn,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #5b78f6, #22d3ee);
  color: #fff;
  box-shadow: 0 18px 35px rgba(91, 120, 246, 0.22);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.btn:hover,
.pill:hover {
  transform: translateY(-2px);
}

/* ─── HERO ─────────────────────────────────────────────── */

.hero {
  min-height: calc(100vh - 100px);
  display: grid;
  align-items: center;
  padding: 90px 0 80px;
}

.hero-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(91, 120, 246, 0.1);
  color: #c7d2fe;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.hero-title {
  margin: 0;
  font-size: clamp(3rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.hero-title span {
  display: block;
  font-weight: 800;
}

.hero-text {
  margin: 24px 0 0;
  max-width: 640px;
  line-height: 1.8;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-card {
  padding: 28px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
  color: var(--text);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.hero-card-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(91, 120, 246, 0.24), transparent 32%),
              radial-gradient(circle at bottom right, rgba(34, 211, 238, 0.18), transparent 28%);
  pointer-events: none;
}

.hero-card-content {
  position: relative;
  z-index: 1;
}

.hero-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.hero-card p {
  margin: 0;
  line-height: 1.8;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-visual {
  display: grid;
  gap: 18px;
  justify-items: end;
}

/* ─── DEVICE MOCKUP ───────────────────────────────────── */

.hero-screen {
  width: min(480px, 100%);
  height: 380px;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), inset 0 35px 100px rgba(0,0,0,0.12);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.hero-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(91, 120, 246, 0.15), transparent 45%),
              radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 19%);
}

.device-mockup {
  position: absolute;
  inset: 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 14px;
}

.device-bar {
  width: 35%;
  height: 6px;
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  margin: 0 auto 4px;
}

.app-label-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.app-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.72rem;
  color: rgba(226,232,240,0.75);
  text-align: center;
}

.app-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

/* ─── SECTIONS ─────────────────────────────────────────── */

.section {
  padding: 80px 0;
  position: relative;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(2rem, 2.5vw, 2.8rem);
  letter-spacing: -0.04em;
}

.section-title span {
  color: var(--accent);
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.9rem;
}

.section-intro {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 1rem;
}

.grid {
  display: grid;
  gap: 24px;
}

/* ─── ABOUT ─────────────────────────────────────────────── */

.about-grid {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(18px);
}

.glass-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.glass-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.stat-card h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.9rem;
}

/* ─── SKILLS ─────────────────────────────────────────────── */

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

.skill-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 120, 246, 0.28);
}

.skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(91, 120, 246, 0.12);
  color: #7dd3fc;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.skill-content h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.skill-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.93rem;
}

/* ─── PROJECTS ───────────────────────────────────────────── */

.projects-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

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

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(91, 120, 246, 0.35);
}

/* Project banner with image */
.project-banner {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-radius: 32px 32px 0 0;
  flex-shrink: 0;
}

.project-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
}

.project-card:hover .project-banner img {
  transform: scale(1.05);
}

.project-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.12) 0%,
    rgba(15, 23, 42, 0.55) 100%
  );
  pointer-events: none;
}

.project-banner-badge {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.project-card-body {
  padding: 24px 26px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.project-tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.project-description {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.95rem;
}

.project-details {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.project-details p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.project-details span {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: 6px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  font-size: 0.82rem;
}

/* ─── HIGHLIGHTS ─────────────────────────────────────────── */

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

.highlight-card {
  padding: 26px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.highlight-card:hover {
  transform: translateY(-4px);
}

.highlight-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.highlight-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.highlight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ─── EDUCATION ──────────────────────────────────────────── */

.education-card {
  padding: 28px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.edu-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.edu-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.edu-header h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.edu-meta {
  margin: 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.education-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.96rem;
}

.edu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── CONTACT ────────────────────────────────────────────── */

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

.contact-card {
  padding: 28px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.contact-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(91, 120, 246, 0.14);
  display: grid;
  place-items: center;
  color: #7dd3fc;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-details h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.contact-details p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.resume-panel {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 20px;
  background: rgba(91, 120, 246, 0.10);
  border: 1px dashed rgba(91, 120, 246, 0.32);
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.resume-panel:hover {
  background: rgba(91, 120, 246, 0.15);
  border-color: rgba(91, 120, 246, 0.5);
  transform: translateY(-1px);
}

.resume-panel svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

/* ─── FOOTER ──────────────────────────────────────────────── */

.footer {
  text-align: center;
  color: var(--muted);
  margin-top: 40px;
  font-size: 0.9rem;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.footer p {
  margin: 0;
}

/* ─── GLOW EFFECTS ───────────────────────────────────────── */

.circle-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.55;
  pointer-events: none;
}

.glow-1 {
  width: 260px;
  height: 260px;
  top: -60px;
  left: -50px;
  background: rgba(91, 120, 246, 0.26);
}

.glow-2 {
  width: 200px;
  height: 200px;
  bottom: 120px;
  right: -40px;
  background: rgba(34, 211, 238, 0.2);
}

.glow-3 {
  width: 180px;
  height: 180px;
  top: 260px;
  right: 12%;
  background: rgba(59, 130, 246, 0.16);
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

@media (max-width: 980px) {
  .hero-grid,
  .about-grid,
  .projects-grid,
  .highlight-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 60px;
  }

  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-visual {
    justify-items: stretch;
  }

  .hero-screen {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0 18px 60px;
  }

  .hero-title {
    font-size: clamp(2.6rem, 9vw, 3.6rem);
  }

  .hero-screen {
    height: 320px;
  }

  .section {
    padding: 60px 0;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

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

@media (max-width: 520px) {
  .nav-inner,
  .projects-top,
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .pill,
  .filter-pill {
    width: 100%;
    justify-content: center;
  }

  .project-banner {
    height: 180px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
