:root {
  --bg: #060a14;
  --text: #e6ebf5;
  --muted: #8a97b0;
  --line: rgba(150, 170, 210, 0.14);
  --accent: #7fb2ff;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 48px);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: opacity 0.4s;
}


/* top bar */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
  background: linear-gradient(var(--bg) 40%, rgba(6, 10, 20, 0));
}

.mark {
  font-weight: 500;
  text-decoration: none;
}

.tabs {
  display: flex;
  gap: 24px;
}

.tabs a {
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.tabs a:hover,
.tabs a[aria-current="page"] {
  color: var(--text);
}

/* panels */

main {
  position: relative;
  z-index: 1;
}

/* home */

#home {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hero {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(32px, 8vh, 72px);
  max-width: 440px;
  pointer-events: auto;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-links {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.hero-links a {
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.hero-links a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* pages */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px var(--gutter) 80px;
}

.page-title {
  margin: 0 0 32px;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.page h2 {
  margin: 48px 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

a.inline,
.lead a {
  color: var(--accent);
}

.lead {
  color: var(--muted);
  margin: 0 0 8px;
}

/* projects */

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

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

.projects summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}

.projects summary::-webkit-details-marker {
  display: none;
}

.projects .t {
  font-weight: 500;
  font-size: 17px;
}

.projects .k {
  font-size: 14px;
  color: var(--muted);
}

.projects .s {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 15px;
}

.projects summary:hover .t {
  color: var(--accent);
}

.projects .body {
  padding: 0 0 24px;
}

.projects .body p {
  margin: 0 0 12px;
  color: #c3cbdb;
}

.meta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.body .links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.body .links-inline a,
.rows a {
  color: var(--accent);
  text-decoration: none;
}

.body .links-inline a:hover,
.rows a:hover {
  text-decoration: underline;
}

/* rows: research, papers, links */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.rows li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.row-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.row-head b {
  font-weight: 500;
}

.row-head span {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.rows p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.links li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.links li span {
  color: var(--muted);
  font-size: 14px;
}

/* about */

.prose p {
  margin: 0 0 16px;
  color: #c3cbdb;
}

.plain {
  margin: 0;
  padding-left: 18px;
  color: #c3cbdb;
}

.plain li {
  margin: 4px 0;
}

.tools {
  margin: 0;
}

.tools div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 8px 0;
}

.tools dt {
  color: var(--muted);
}

.tools dd {
  margin: 0;
  color: #c3cbdb;
}

/* contact */

.email {
  font-size: 22px;
  font-weight: 500;
  text-decoration: none;
}

.email:hover {
  color: var(--accent);
}

.links {
  margin-top: 32px;
}

/* small screens */

@media (max-width: 640px) {
  .bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 16px;
  }

  .tabs {
    gap: 18px;
  }

  .page {
    padding-top: 112px;
  }

  .tools div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
