:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #101010;
  --text: #ededed;
  --muted: #8c8c8c;
  --quiet: #626262;
  --line: #242424;
  --accent: #b8d4c2;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::selection {
  background: var(--accent);
  color: #0a0a0a;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(700px circle at 28% 0%, rgba(184, 212, 194, 0.045), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: auto, 100% 5px;
  opacity: 0.8;
}

main {
  width: min(100% - 48px, 640px);
  margin: 0 auto;
  padding: 96px 0 72px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 26px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.012em;
}

h3 span {
  color: var(--muted);
}

p {
  margin-bottom: 24px;
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration-color: rgba(255, 255, 255, 0.26);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

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

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}

.site-nav {
  display: flex;
  gap: 24px;
  margin-bottom: 42px;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.site-nav a {
  color: var(--quiet);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 212, 194, 0.07);
}

.lede {
  color: #b4b4b4;
}

.intro:not(.reading-intro) .lede {
  margin-bottom: 12px;
}

.intro:not(.reading-intro) > p:last-of-type {
  margin-bottom: 0;
}

.intro:not(.reading-intro) + .rule {
  margin-top: 28px;
}

.reading-intro h1 {
  margin-top: 30px;
}

.back-link {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-decoration: none;
}

.lede a,
.notes a {
  color: var(--text);
}

.rule {
  height: 1px;
  margin: 52px 0;
  background: var(--line);
}

section + section {
  margin-top: 66px;
}

.timeline {
  display: grid;
  gap: 30px;
}

.entry-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.entry time {
  padding-top: 3px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.entry p {
  margin: 9px 0 0;
  font-size: 0.9rem;
  line-height: 1.65;
}

.entry.compact {
  margin-top: -7px;
}

.small-link {
  display: inline-block;
  margin-top: 30px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.projects {
  border-top: 1px solid var(--line);
}

.project {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.project-index {
  padding-top: 2px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.project-copy {
  display: grid;
  gap: 6px;
}

.project-copy strong {
  font-size: 0.96rem;
  font-weight: 400;
}

.project-copy > span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.arrow {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.74rem;
  transition: color 160ms ease, transform 160ms ease;
}

.project:hover .arrow {
  color: var(--text);
  transform: translate(2px, -2px);
}

.paper-list .project {
  align-items: center;
  min-height: 74px;
}

.notes ul {
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.notes li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
}

.notes li + li {
  margin-top: 10px;
}

.notes li::before {
  position: absolute;
  left: 0;
  color: var(--quiet);
  font-family: var(--mono);
  content: "—";
}

footer p {
  max-width: 480px;
  margin-bottom: 22px;
  font-size: 0.9rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

footer nav a {
  color: var(--muted);
  font-size: 0.84rem;
  text-decoration: none;
}

footer nav span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.colophon {
  display: block;
  margin-top: 50px;
  color: #484848;
  font-family: var(--mono);
  font-size: 0.65rem;
}

.command-trigger {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 5;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 9px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(16, 16, 16, 0.9);
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.66rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 160ms ease, color 160ms ease;
}

.command-trigger:hover {
  border-color: #3a3a3a;
  color: var(--text);
}

kbd {
  border: 1px solid #303030;
  border-radius: 3px;
  background: #171717;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1;
}

.command-trigger kbd {
  padding: 4px 5px;
}

.command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: min(18vh, 150px) 20px 20px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
}

.command-backdrop[hidden] {
  display: none;
}

.command-palette {
  width: min(100%, 520px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #2b2b2b;
  border-radius: 8px;
  background: #0e0e0e;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.command-input-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--quiet);
  font-family: var(--mono);
}

.command-input-wrap kbd {
  padding: 4px 6px;
}

.command-input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.command-input::placeholder {
  color: #555;
}

.command-results {
  display: grid;
  gap: 2px;
  max-height: 360px;
  padding: 7px;
  overflow-y: auto;
}

.command-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.command-item > span:first-child {
  display: grid;
  gap: 2px;
}

.command-item strong {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 400;
}

.command-item small {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.63rem;
}

.command-item.active,
.command-item:hover {
  background: #181818;
}

.command-arrow {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.command-empty {
  margin: 0;
  padding: 28px 12px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-align: center;
}

.command-footer {
  display: flex;
  gap: 18px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.6rem;
}

.command-footer span {
  display: flex;
  gap: 4px;
  align-items: center;
}

.command-footer kbd {
  padding: 3px 4px;
}

.command-open {
  overflow: hidden;
}

.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 600px) {
  main {
    width: min(100% - 36px, 640px);
    padding-top: 62px;
  }

  .rule {
    margin: 44px 0;
  }

  section + section {
    margin-top: 56px;
  }

  .entry-line {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .entry time {
    grid-row: 1;
    padding: 0;
  }

  .project {
    grid-template-columns: 24px 1fr auto;
    gap: 11px;
  }

  .command-trigger {
    right: 14px;
    bottom: 14px;
  }

  .command-trigger > span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
