:root {
  --bg: #15122b;
  --surface: #201b3d;
  --text: #eee8ff;
  --muted: #a79fcb;
  --accent: #f472d0;
  --line: #342d5c;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e9e0ff;
    --surface: #d9cbfb;
    --text: #1c1633;
    --muted: #4b4176;
    --accent: #9c1585;
    --line: #c3b2f0;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
}

a { color: var(--text); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 2; }
.skip:focus { left: 16px; }

.wrap { width: min(720px, 100% - 32px); margin-inline: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Theme controls */
.controls { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(32px, 7vw, 64px); }

.controls button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 500 0.875rem/1 var(--body);
  cursor: pointer;
}

.controls button:hover { border-color: var(--accent); }
.controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.home-pfp {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: auto;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  font: 800 1.125rem/1 var(--display);
  text-decoration: none;
}

.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--muted); }

body, .controls button, .projects li, .hero { transition: background-color 0.3s, color 0.3s, border-color 0.3s; }

/* Hero */
.hero { padding: 20px 0 56px; border-bottom: 1px solid var(--line); overflow-x: clip; }

.nameplate { position: relative; display: flex; align-items: flex-end; gap: 12px; }

h1 {
  margin: 0;
  font: 800 clamp(3rem, 14vw, 6.5rem)/0.9 var(--display);
  letter-spacing: -0.04em;
}

.cat {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  margin-bottom: 0.15em;
  flex: none;
}

.cat.running { animation: run-in 2.2s steps(22) both; }

@keyframes run-in {
  from { transform: translateX(min(80vw, 640px)) scaleX(-1); }
  to { transform: translateX(0) scaleX(-1); }
}

.intro { max-width: 34em; margin: 28px 0 0; font-size: 1.1875rem; color: var(--text); }

.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 28px; font-weight: 500; }

/* Sections */
section { padding: 64px 0 8px; }

h2 {
  margin: 0 0 8px;
  font: 500 1.75rem/1.2 var(--display);
  letter-spacing: -0.02em;
}

.group { margin-top: 36px; }

h3 { margin: 0 0 4px; font: 700 1rem/1.4 var(--body); color: var(--muted); }

.projects { list-style: none; margin: 0; padding: 0; }

.projects li {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.projects .name { font-weight: 700; font-size: 1.125rem; grid-column: 1; }
.projects p { grid-column: 1; margin: 2px 0 0; color: var(--muted); max-width: 38em; }
.projects .meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: 0.875rem; }
.projects .tag { padding: 1px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.empty { color: var(--muted); }

.projects .tech { grid-column: 2; grid-row: 1; align-self: baseline; font-size: 0.875rem; color: var(--muted); white-space: nowrap; }

/* About */
.facts { display: grid; grid-template-columns: 7.5rem 1fr; gap: 14px 20px; margin: 28px 0 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }

.covers { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 36px 0 0; padding: 0; }
.covers a { display: block; border-radius: 6px; }
.covers img { display: block; width: 100%; height: auto; aspect-ratio: 100 / 142; object-fit: cover; border-radius: 6px; background: var(--surface); }

.more { margin: 12px 0 0; font-size: 0.9375rem; }

footer { padding: 72px 0 48px; }
footer p { margin: 0 0 6px; }
footer .small { font-size: 0.875rem; color: var(--muted); }

.versions { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.versions p { margin: 0 0 10px; color: var(--muted); font-size: 0.9375rem; }
.versions div { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.9375rem; }
.versions a[aria-current] { color: var(--accent); text-decoration: none; }

@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 14px; }
  .covers { grid-template-columns: repeat(3, 1fr); }
  .projects li { grid-template-columns: 1fr; }
  .projects .tech { grid-column: 1; grid-row: auto; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .cat.running { animation: none; }
  body, .controls button, .projects li, .hero { transition: none; }
}
