/* ============================================
   Astrophysics-Inspired Academic Theme
   ============================================ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #151d2e;
  --bg-card-hover: #1a2436;
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3b4;
  --text-muted: #6b7280;
  --accent: #60a5fa;
  --accent-soft: #3b82f6;
  --accent-glow: rgba(96, 165, 250, 0.15);
  --accent-warm: #c4b5fd;
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(96, 165, 250, 0.2);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --container: 960px;
  --radius: 8px;
}

/* ---------- Reset & Base ---------- */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Star Field ---------- */

.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stars--layer2 {
  opacity: 0.5;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 3s ease-in-out infinite;
}

.star--bright {
  background: var(--accent);
  box-shadow: 0 0 4px var(--accent);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.7; }
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

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

.nav-links a {
  display: block;
  padding: 6px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--accent-glow);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Hero ---------- */

.hero {
  padding: 160px 0 80px;
  position: relative;
}

.hero-inner {
  text-align: left;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-role {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 300;
}

.hero-affiliation {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
}

.hero-line {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 40px auto 0 24px;
  max-width: var(--container);
}

@media (min-width: 768px) {
  .hero-line {
    margin-left: calc((100% - var(--container)) / 2 + 24px);
  }
}

/* ---------- Sections ---------- */

.about-section {
  padding: 60px 0 100px;
}

.page-section {
  padding: 120px 0 100px;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ---------- About Grid ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1.6fr 1fr;
    gap: 64px;
  }
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ---------- Cards ---------- */

.contact-card,
.links-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}

.contact-card:hover,
.links-card:hover {
  border-color: var(--border-accent);
}

.contact-card h3,
.links-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 6px;
  line-height: 1.6;
}

.links-card ul {
  list-style: none;
}

.links-card li {
  margin-bottom: 8px;
}

.links-card li a {
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.links-card li a::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

/* ---------- Page Content (Research, Talks) ---------- */

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 16px;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  border-radius: 1px;
}

.page-content {
  max-width: 700px;
}

.page-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.page-content h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.page-content em {
  color: var(--text-muted);
  font-style: italic;
}

.page-content strong {
  color: var(--text-primary);
  font-weight: 500;
}

.page-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.page-content ul,
.page-content ol {
  color: var(--text-secondary);
  padding-left: 20px;
  margin-bottom: 16px;
}

.page-content li {
  margin-bottom: 8px;
}

.page-content li a {
  word-break: break-word;
}

/* ---------- Recent Projects ---------- */

.projects-section {
  padding: 40px 0 80px;
}

.projects-section .section-heading {
  margin-bottom: 32px;
}

.project-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, background 0.3s, transform 0.2s;
}

.project-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  color: inherit;
}

.project-image {
  border-radius: 6px;
  overflow: hidden;
  background: #0d1220;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.project-text h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 8px;
}

.project-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.project-abstract {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.project-card:hover .project-link {
  opacity: 1;
}

@media (max-width: 768px) {
  .project-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-image {
    max-width: 100%;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 400;
}

.footer-affiliation {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.nav-open {
    display: flex;
  }

  .hero {
    padding: 120px 0 60px;
  }

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

/* ---------- Selection ---------- */

::selection {
  background: rgba(96, 165, 250, 0.3);
  color: var(--text-primary);
}

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
/* ---------- Profile Photo (About Sidebar) ---------- */

.profile-photo {
  margin: -20px 0 24px 0;
  text-align: center;
}

.profile-photo img {
  width: 100%;
  max-width: 240px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
