:root {
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --text: #1c1e21;
  --muted: #5f6672;
  --border: #e3e5e8;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --particle: 95, 102, 114; /* RGB of the constellation dots/lines */
  --radius: 12px;
  --max: 860px;
}

:root[data-theme="dark"] {
  --bg: #121417;
  --bg-alt: #1b1e23;
  --text: #e6e8eb;
  --muted: #9aa1ac;
  --border: #2a2e35;
  --accent: #6b9bff;
  --accent-soft: #1d2a45;
  --particle: 170, 176, 186;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417;
    --bg-alt: #1b1e23;
    --text: #e6e8eb;
    --muted: #9aa1ac;
    --border: #2a2e35;
    --accent: #6b9bff;
    --accent-soft: #1d2a45;
  --particle: 170, 176, 186;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
}
.brand { white-space: nowrap; font-weight: 700; color: var(--text); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* Hero */
.hero-wrap {
  position: relative;
  min-height: calc(100vh - 60px);
  min-height: calc(100svh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero {
  position: relative; /* sits above the canvas */
  text-align: center;
  padding-top: 32px;
  padding-bottom: 32px;
  animation: hero-in 0.9s ease-out both;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.scroll-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  animation: bob 2s ease-in-out infinite;
}
.scroll-hint:hover { color: var(--text); }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero, .scroll-hint { animation: none; }
}
.avatar {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  border: 3px solid var(--border);
}
.avatar-placeholder {
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}
.hero h1 { margin: 0; font-size: 2.4rem; letter-spacing: -0.02em; }
.tagline { margin: 4px 0 16px; color: var(--muted); font-size: 1.15rem; }

.socials { display: flex; justify-content: center; gap: 14px; margin-bottom: 28px; }
.socials a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.intro { max-width: 640px; margin: 0 auto; text-align: left; }

/* Sections */
.section { padding-top: 48px; padding-bottom: 16px; }
.section h2 {
  font-size: 1.6rem;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

/* Project cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.card-thumb {
  height: 120px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  background: var(--accent-soft);
}
img.card-thumb {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.card-thumb-top { object-position: top; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 0.93rem; }
.card-link { margin-top: auto; font-weight: 600; font-size: 0.93rem; }

.tags { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  border-left: 2px solid var(--border);
}
.timeline li { position: relative; padding-bottom: 28px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-date { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.timeline h3 { margin: 2px 0 0; font-size: 1.05rem; }
.tl-sub { margin: 0 0 4px; color: var(--muted); font-size: 0.9rem; font-style: italic; }
.timeline p:not(.tl-sub) { margin: 4px 0 0; font-size: 0.95rem; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.contact-list span { width: 70px; color: var(--muted); font-weight: 500; }

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.site-footer p { margin: 0; }

@media (max-width: 560px) {
  .nav { gap: 10px; }
  .nav a { font-size: 0.82rem; }
  .brand { font-size: 1rem; }
    .hero h1 { font-size: 2rem; }
}
