:root {
  --paper: #ffffff;
  --ink: #141414;
  --muted: #595959;
  --faint: #9b9b9b;
  --hairline: #e2e2e2;
  --chip-bg: #f3f3f3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141414;
    --ink: #f2f2f2;
    --muted: #a8a8a8;
    --faint: #6e6e6e;
    --hairline: #2e2e2e;
    --chip-bg: #1f1f1f;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, "Segoe UI", Arial,
    sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  border-top: 10px solid var(--ink);
}

.mono {
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
}

.skip:focus {
  left: 0;
  z-index: 10;
}

/* ---------- Layout ---------- */

.top,
main,
footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.top nav {
  display: flex;
  gap: 20px;
  align-items: baseline;
}

.top nav a {
  text-decoration: none;
}

.top nav a:hover:not(.btn) {
  text-decoration: underline;
}

.mark {
  color: var(--muted);
}

.btn {
  background: var(--ink);
  color: var(--paper);
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.82;
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 24px;
}

.eyebrow {
  letter-spacing: 0.18em;
  color: var(--muted);
}

h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-top: 16px;
  max-width: 16ch;
  text-wrap: balance;
}

.sub {
  margin-top: 24px;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 52ch;
}

.sub strong {
  color: var(--ink);
}

.sub a {
  color: var(--ink);
}

.contact {
  margin-top: 28px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.sep {
  color: var(--faint);
}

/* ---------- Sections ---------- */

section {
  padding-top: 72px;
}

h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 10px;
  margin-bottom: 28px;
}

/* ---------- Projects ---------- */

.project {
  margin-bottom: 44px;
}

.project:last-child {
  margin-bottom: 0;
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.plink {
  text-decoration: none;
  border: 1px solid var(--hairline);
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

.plink:hover {
  border-color: var(--ink);
}

.project > p:not(.chips) {
  margin-top: 12px;
  max-width: 68ch;
  color: var(--muted);
}

.chips {
  margin-top: 14px;
}

.chip {
  display: inline-block;
  font-family: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 2px 9px;
  margin: 0 6px 6px 0;
  white-space: nowrap;
}

.more {
  margin-top: 40px;
}

.hero-small {
  padding-top: 64px;
}

.mark a {
  text-decoration: none;
}

.mark a:hover {
  text-decoration: underline;
}

/* ---------- Experience ---------- */

.entry {
  margin-bottom: 36px;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.entry-head h3 {
  font-size: 1.05rem;
}

.at {
  font-weight: 500;
  color: var(--muted);
}

.dates {
  color: var(--muted);
  white-space: nowrap;
}

.entry-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.entry ul {
  list-style: none;
  margin-top: 12px;
}

.entry li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  max-width: 68ch;
  color: var(--muted);
}

.entry li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(0.8em - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}

/* ---------- Skills ---------- */

.skills-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
}

.skills-row dt {
  flex: 0 0 170px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.skills-row dd {
  flex: 1;
}

/* ---------- About & footer ---------- */

.about-text {
  max-width: 62ch;
  font-size: 1.05rem;
}

footer {
  margin-top: 88px;
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
  padding-bottom: 48px;
  color: var(--muted);
}

footer .fine {
  margin-top: 10px;
  color: var(--faint);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: rise 0.6s ease-out both;
  }

  .hero > *:nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero > *:nth-child(3) {
    animation-delay: 0.16s;
  }

  .hero > *:nth-child(4) {
    animation-delay: 0.24s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 560px) {
  .hero {
    padding-top: 64px;
  }

  section {
    padding-top: 56px;
  }

  .skills-row {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
  }

  .skills-row dt {
    flex: none;
  }
}
