/* ── Google Fonts ─────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --purple: #8a2be2;
  --purple-light: #b06aff;
  --purple-glow: rgba(138, 43, 226, 0.6);
  --text-white: #f0f0f0;
  --text-muted: #a0a0b8;
  --border: rgba(138, 43, 226, 0.25);
  --nav-height: 64px;
}

/* ── Reset ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-white);
  line-height: 1.65;
  min-height: 100vh;
}

a {
  color: var(--purple-light);
  text-decoration: none;
}
a:hover {
  color: #fff;
}

/* ── Navigation ───────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: rgba(15, 12, 41, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(90deg, #fff 0%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--purple-light);
  transition: width 0.25s;
}

.nav-links a:hover {
  color: #fff;
}
.nav-links a:hover::after {
  width: 100%;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page-content {
  padding-top: var(--nav-height);
  max-width: 960px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0 3rem;
}

/* Profile photo with glow */
.hero-photo-wrap {
  margin-bottom: 1.8rem;
}

.hero-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--purple);
  box-shadow:
    0 0 0 6px rgba(138, 43, 226, 0.2),
    0 0 30px var(--purple-glow),
    0 0 60px rgba(138, 43, 226, 0.25);
  transition: box-shadow 0.3s;
}

.hero-photo:not(.about-photo):hover {
  box-shadow:
    0 0 0 6px rgba(138, 43, 226, 0.35),
    0 0 50px var(--purple-glow),
    0 0 90px rgba(138, 43, 226, 0.35);
}

/* Intro text */
.hero-intro {
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    var(--purple-light) 60%,
    var(--purple) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 500;
  color: var(--purple-light);
  margin-bottom: 1.4rem;
}

.hero-bio {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}
.hero-bio a {
  color: var(--purple-light);
}
.hero-bio a:hover {
  color: #fff;
}

/* Skill badges */
.skill-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  max-width: 680px;
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--purple);
  color: var(--purple-light);
  background: rgba(138, 43, 226, 0.1);
  letter-spacing: 0.02em;
  transition:
    background 0.2s,
    color 0.2s;
}

.badge:hover {
  background: var(--purple);
  color: #fff;
}

/* Social icons */
.hero-socials {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}

.hero-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition:
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}

.hero-socials a:hover {
  border-color: var(--purple);
  color: var(--purple-light);
  box-shadow: 0 0 12px var(--purple-glow);
}

/* CTA Buttons */
.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-solid {
  background: var(--purple);
  color: #fff;
  border: 2px solid var(--purple);
  box-shadow: 0 0 18px var(--purple-glow);
}
.btn-solid:hover {
  background: var(--purple-light);
  border-color: var(--purple-light);
  box-shadow: 0 0 28px rgba(176, 106, 255, 0.7);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--purple-light);
  border: 2px solid var(--purple);
}
.btn-outline:hover {
  background: rgba(138, 43, 226, 0.15);
  box-shadow: 0 0 18px var(--purple-glow);
  color: #fff;
}

/* ── Section ──────────────────────────────────────────────── */
.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  background: linear-gradient(90deg, #fff 0%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-divider {
  width: 50px;
  height: 3px;
  background: var(--purple);
  border-radius: 2px;
  margin-bottom: 2.4rem;
  box-shadow: 0 0 8px var(--purple-glow);
}

/* ── Projects grid ───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.project-card:hover {
  border-color: var(--purple);
  transform: translateY(-3px);
}

.project-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.project-card:hover .project-img-wrap img {
  transform: scale(1.04);
}

.project-body {
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.6rem;
}

.project-date {
  font-size: 0.75rem;
  color: var(--purple-light);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.project-title a {
  color: inherit;
  text-decoration: none;
}

.project-title a:hover {
  color: var(--purple-light);
}

.project-desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-btn {
  align-self: flex-start;
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.project-hero-img {
  margin-bottom: 2rem;
}

.project-hero-img img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

/* ── Card (experience / education) ───────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--purple);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.card-org a {
  color: var(--purple-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.card-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.card-body {
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.card-body ul {
  padding-left: 1.2rem;
}
.card-body li {
  margin-bottom: 0.25rem;
}

/* ── Post list (home recent posts) ───────────────────────── */
.post-list {
  list-style: none;
}

.post-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
}
.post-row:last-child {
  border-bottom: none;
}

.post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 6rem;
}

/* ── List page ────────────────────────────────────────────── */
.list-page {
  padding-top: calc(var(--nav-height) + 3rem);
}

.list-header {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.list-divider {
  width: 50px;
  height: 3px;
  background: var(--purple);
  border-radius: 2px;
  margin-bottom: 2.5rem;
  box-shadow: 0 0 8px var(--purple-glow);
}

.list-items {
  list-style: none;
}

.list-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.list-item:last-child {
  border-bottom: none;
}

.list-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.list-item-title a:hover {
  color: var(--purple-light);
}

.list-item-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.list-item-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.6;
}

/* ── Single post ──────────────────────────────────────────── */
.single-page {
  padding-top: calc(var(--nav-height) + 3rem);
}

.single-header {
  margin-bottom: 2.5rem;
}

.single-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.single-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.single-meta a {
  color: var(--purple-light);
}

.single-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.single-content h2,
.single-content h3 {
  color: #fff;
  font-weight: 700;
  margin: 2rem 0 0.7rem;
}
.single-content p {
  margin-bottom: 1rem;
  color: #c8c8dc;
}
.single-content a {
  color: var(--purple-light);
}
.single-content a:hover {
  color: #fff;
}
.single-content ul,
.single-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}
.single-content li {
  margin-bottom: 0.3rem;
}
.single-content pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  padding: 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.single-content code {
  background: rgba(138, 43, 226, 0.15);
  color: var(--purple-light);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}
.single-content pre code {
  background: none;
  padding: 0;
  color: #c8c8dc;
}
.single-content blockquote {
  border-left: 3px solid var(--purple);
  padding-left: 1.2rem;
  color: var(--text-muted);
  margin: 1.2rem 0;
  font-style: italic;
}
.single-content img {
  max-width: 100%;
  border-radius: 8px;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  color: var(--text-muted);
  font-size: 1rem;
  transition: color 0.2s;
}
.footer-socials a:hover {
  color: var(--purple-light);
}

/* ── Publications ─────────────────────────────────────────── */
.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child {
  border-bottom: none;
}

.pub-type {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple-light);
  margin-bottom: 0.35rem;
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.pub-title a {
  color: #fff;
}
.pub-title a:hover {
  color: var(--purple-light);
}

.pub-venue {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.pub-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.pub-authors strong {
  color: #fff;
}

.pub-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.pub-meta a {
  color: var(--purple-light);
}

.pub-abstract {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 0.5rem;
}

/* ── Minimal hero (landing page) ─────────────────────────── */
.hero-minimal {
  gap: 0.6rem;
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.4rem;
}

.hero-tagline a {
  color: var(--purple-light);
}

/* ── About profile header ─────────────────────────────────── */
.about-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.about-photo {
  width: 320px !important;
  height: 320px !important;
  flex-shrink: 0;
}

.about-profile-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-profile-text .hero-socials {
  justify-content: center;
}

/* ── Responsive ───────────────────────────────────────────── */

/* Tablet (≤ 768px) */
@media (max-width: 768px) {
  .page-content {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .about-photo {
    width: 220px !important;
    height: 220px !important;
  }
}

/* Mobile (≤ 640px) */
@media (max-width: 640px) {
  /* Nav: hide link labels, show as scrollable row */
  .site-nav {
    padding: 0 1rem;
  }
  .nav-links {
    gap: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav-links a {
    white-space: nowrap;
  }

  /* Hero */
  .hero {
    padding: 2.5rem 0 2rem;
  }
  .hero-photo {
    width: 90px;
    height: 90px;
  }
  .hero-name {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .hero-bio {
    font-size: 0.93rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  .btn {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }

  /* About photo */
  .about-photo {
    width: 160px !important;
    height: 160px !important;
  }

  /* Cards */
  .card-header {
    flex-direction: column;
    gap: 0.4rem;
  }
  .card-date {
    align-self: flex-start;
  }

  /* Section titles */
  .section-title {
    font-size: 1.3rem;
  }

  /* Single post */
  .single-header h1 {
    font-size: 1.5rem;
  }

  /* Projects grid → single column */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Publications */
  .pub-title {
    font-size: 0.97rem;
  }

  /* Footer */
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
  }
}

/* Very small screens (≤ 380px) */
@media (max-width: 380px) {
  html {
    font-size: 15px;
  }

  .nav-brand {
    font-size: 1rem;
  }

  .hero-name {
    font-size: 1.7rem;
  }

  .about-photo {
    width: 130px !important;
    height: 130px !important;
  }
}
