:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --border: #2a2e37;
  --text: #e8eaed;
  --muted: #9aa0aa;
  --accent: #4f8cff;
  --max-width: 880px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  position: relative;
}

/* Slow-drifting aurora glow behind the starfield */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      38% 32% at 22% 28%,
      rgba(79, 140, 255, 0.2),
      transparent 70%
    ),
    radial-gradient(
      34% 30% at 78% 68%,
      rgba(146, 92, 255, 0.16),
      transparent 70%
    );
  animation: aurora 75s ease-in-out infinite alternate;
}

@keyframes aurora {
  from {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
  to {
    transform: translate3d(3%, 2%, 0) scale(1.18);
  }
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.hero,
main,
footer {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
}

.tagline {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
}

.about {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 560px;
  margin: 0 auto 1.75rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.btn {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--muted);
}

/* Resume download menu — opens on hover, focus, or tap */
.resume-menu {
  position: relative;
  display: inline-flex;
}

.resume-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.5;
  font-family: inherit;
  cursor: pointer;
}

.resume-trigger .chevron {
  font-size: 0.7em;
  transition: transform 0.2s ease;
}

.resume-menu:hover .chevron,
.resume-menu:focus-within .chevron,
.resume-menu.open .chevron {
  transform: rotate(180deg);
}

.resume-options {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 50%;
  z-index: 5;
  min-width: 210px;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0.18s;
}

/* transparent bridge so the menu survives the gap under the button */
.resume-options::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.45rem;
  height: 0.45rem;
}

.resume-menu:hover .resume-options,
.resume-menu:focus-within .resume-options,
.resume-menu.open .resume-options {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s;
}

.resume-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background-color 0.15s ease;
}

.resume-option:hover,
.resume-option:focus-visible {
  background-color: rgba(79, 140, 255, 0.14);
}

.resume-option .fmt {
  font-weight: 600;
}

.resume-option .meta {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.skill {
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.projects-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
  font-family: inherit;
  cursor: pointer;
}

.projects-toggle:hover {
  color: var(--text);
}

.projects-toggle .chevron {
  display: inline-block;
  transition: transform 0.25s ease;
}

.projects-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.projects-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
}

.projects-panel.open {
  max-height: 1200px;
  opacity: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

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

.card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  /* Repo names are single unbroken tokens; let them wrap instead of
     overflowing into the neighbouring card. */
  overflow-wrap: anywhere;
}

.card p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.card .lang {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--muted);
}

/* Must come last: these override equal-specificity rules defined above. */
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  .resume-options,
  .resume-menu:hover .resume-options,
  .resume-menu:focus-within .resume-options,
  .resume-menu.open .resume-options {
    transform: translateX(-50%);
  }

  .resume-trigger .chevron {
    transition: none;
  }
}
