:root {
  --bg: #0d0f12;
  --fg: #e6e6e6;
  --muted: #8a8f98;
  --accent: #7dd3fc;
  --border: #23262b;
  --flow-color: #2dd4bf;
  --card-bg: #1b1e24;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--muted) var(--bg);
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 16px;
  line-height: 1.6;
  padding: 3rem 1.5rem 6rem;
  max-width: 720px;
  margin: 0 auto;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  display: inline-block;
  transition: transform 0.15s ease, border-bottom-color 0.15s ease;
}
a:hover {
  border-bottom-color: var(--accent);
  transform: scale(1.04);
}

.media-link {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  border-bottom: none;
  overflow: hidden;
}

.media-link img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.15s ease;
}

.media-link:hover {
  transform: none;
  border-bottom: none;
}

.media-link:hover img {
  transform: scale(1.04);
}

header#top h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

header#top .identity {
  color: var(--muted);
  margin-bottom: 1rem;
}

header#top .links a,
header#top .links .email-link {
  margin-right: 1rem;
}

header#top .section-nav {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

header#top .section-nav a {
  color: var(--muted);
  font-size: 0.85rem;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

header#top .section-nav a:hover {
  color: var(--fg);
  border-bottom-color: var(--muted);
}

@media (min-width: 1100px) {
  header#top .section-nav {
    position: fixed;
    top: 3rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  header#top .section-nav a {
    margin-right: 0;
    margin-bottom: 0;
  }
}

main {
  margin-top: 3rem;
}

section h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

section + section {
  margin-top: 3rem;
}

.entry {
  margin-bottom: 2rem;
}

#projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

#projects > h2 {
  grid-column: 1 / -1;
}

#projects .entry {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 0;
}

.github-link {
  border-bottom-color: transparent;
}

.entry h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.entry .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.entry p {
  margin-bottom: 0.5rem;
}

.entry .badges {
  color: var(--accent);
  font-size: 0.85rem;
}

.facts {
  list-style: none;
}

.facts li {
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

button {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.email-link {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  padding: 0;
  display: inline-block;
  transition: transform 0.15s ease, border-bottom-color 0.15s ease;
}

.email-link:hover {
  border-bottom-color: var(--accent);
  transform: scale(1.04);
}

.email-link.copied {
  color: var(--fg);
}

footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

footer a,
footer .email-link {
  color: var(--accent);
}

#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border: 1px solid var(--muted);
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 640px) {
  #projects {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    padding: 2rem 1rem 5rem;
    font-size: 15px;
  }

  header#top .links a,
  header#top .links .email-link {
    display: inline-block;
    margin-bottom: 0.5rem;
  }

  #back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
}
