:root {
  color-scheme: light;
  --paper: #f7f7f4;
  --ink: #20242d;
  --muted: #5e646c;
  --line: #dfe0dc;
  --accent: #2f5bd3;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: -999px;
  z-index: 10;
  padding: 7px 11px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  left: 12px;
  transform: translateY(0);
}

.site {
  display: flex;
  width: min(100% - 48px, 900px);
  min-height: 100dvh;
  margin: 0 auto;
  flex-direction: column;
}

.site-header,
.page-grid,
.site-footer {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 60px;
}

.site-header {
  align-items: center;
  padding: 72px 0 66px;
}

.identity-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.identity-mark:active {
  transform: scale(0.95);
}

.identity {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.identity-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.identity-note {
  color: var(--muted);
  font-size: 11px;
}

.page-grid {
  flex: 1;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 48px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  font-size: 13px;
}

.side-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  transition: color 160ms ease, transform 160ms var(--ease-out);
}

.side-nav a > span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms ease, transform 160ms var(--ease-out);
}

.side-nav a.is-active {
  color: var(--ink);
}

.side-nav a.is-active > span {
  opacity: 1;
  transform: scale(1);
}

main {
  max-width: 640px;
}

.content-section {
  scroll-margin-top: 64px;
  margin-bottom: 82px;
}

.profile {
  margin-bottom: 86px;
}

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

h2 {
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile h1 {
  max-width: 620px;
  margin-bottom: 35px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 43px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.22;
  text-wrap: balance;
}

.prose {
  max-width: 620px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.72;
}

.prose p {
  margin-bottom: 23px;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose-small {
  font-size: 17px;
}

.section-intro {
  max-width: 520px;
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 14px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 13px 28px;
  margin-top: 25px;
}

.contact-links a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 160ms ease;
}

.contact-links a:hover {
  text-decoration-color: currentColor;
}

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

.writing-link,
.work-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: color 160ms ease;
}

.writing-link {
  border-top: 0;
}

.writing-link strong,
.writing-link small,
.work-link strong,
.work-link small {
  display: block;
}

.writing-link strong,
.work-link strong {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
}

.writing-link small,
.writing-link time,
.work-link small,
.work-link-meta {
  color: var(--muted);
  font-size: 12px;
}

.writing-link time {
  flex: 0 0 auto;
  padding-top: 2px;
  white-space: nowrap;
  transition: transform 180ms var(--ease-out), color 160ms ease;
}

.work-link-meta {
  flex: 0 0 auto;
  padding-top: 2px;
  transition: transform 180ms var(--ease-out), color 160ms ease;
}

.empty-note {
  margin-bottom: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.not-found {
  flex: 1;
  max-width: 640px;
  margin-left: 200px;
}

.not-found h1 {
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.not-found a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: none;
  height: 2px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.page-writing .reading-progress {
  display: block;
}

.article-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 60px;
  flex: 1;
  align-items: start;
}

.article-sidebar {
  position: sticky;
  top: 48px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}

.back-link span {
  transition: transform 160ms var(--ease-out);
}

.article {
  max-width: 640px;
}

.article-header {
  margin-bottom: 58px;
}

.article-label {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-header h1 {
  max-width: 600px;
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.article-description {
  max-width: 540px;
  margin-bottom: 17px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
}

.article-header time {
  color: var(--muted);
  font-size: 11px;
}

.article-body {
  color: #292d35;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.78;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body table,
.article-body figure {
  margin-top: 0;
  margin-bottom: 27px;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin-top: 54px;
  margin-bottom: 18px;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  text-transform: none;
}

.article-body h2 {
  font-size: 22px;
}

.article-body h3 {
  font-size: 17px;
}

.article-body h4 {
  font-size: 14px;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-body ul,
.article-body ol {
  padding-left: 1.35em;
}

.article-body li {
  margin-bottom: 7px;
  padding-left: 0.25em;
}

.article-body blockquote {
  margin-left: 0;
  padding-left: 22px;
  border-left: 1px solid var(--accent);
  color: #555a63;
  font-style: italic;
}

.article-body blockquote > :last-child {
  margin-bottom: 0;
}

.article-body code {
  padding: 0.14em 0.35em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f0f0ec;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82em;
}

.article-body pre {
  padding: 19px 21px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f0f0ec;
  line-height: 1.6;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 38px auto;
}

.article-body hr {
  width: 48px;
  margin: 58px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
}

.article-body th,
.article-body td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.article-body figcaption,
.article-body .footnotes {
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 11px;
}

.article-end {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 68px;
  margin-bottom: 90px;
  color: var(--muted);
  font-size: 12px;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}

.site-footer {
  align-items: end;
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 11px;
}

.site-footer > span {
  grid-column: 2;
}

.site-footer a {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  transition: color 160ms ease;
}

.reveal {
  opacity: 0;
  transform: translateY(5px);
  animation: reveal 360ms var(--ease-out) forwards;
}

.sidebar.reveal {
  animation-delay: 50ms;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 360ms var(--ease-out), transform 360ms var(--ease-out);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .identity-mark:hover {
    background: var(--accent);
    transform: rotate(-5deg);
  }

  .side-nav a:hover {
    color: var(--ink);
    transform: translateX(2px);
  }

  .writing-link:hover,
  .work-link:hover {
    color: var(--accent);
  }

  .writing-link:hover time,
  .work-link:hover .work-link-meta {
    color: var(--accent);
    transform: translate(2px, -2px);
  }

  .back-link:hover,
  .article-end:hover {
    color: var(--ink);
  }

  .back-link:hover span,
  .article-end:hover span {
    transform: translateX(-2px);
  }

  .site-footer a:hover {
    color: var(--ink);
  }
}

@media (max-width: 700px) {
  .site {
    width: min(100% - 36px, 900px);
  }

  .site-header {
    display: flex;
    gap: 13px;
    padding: 48px 0 48px;
  }

  .identity {
    display: block;
  }

  .identity-name,
  .identity-note {
    display: block;
  }

  .identity-note {
    margin-top: -1px;
    font-size: 10px;
  }

  .page-grid {
    display: block;
  }

  .article-grid {
    display: block;
  }

  .sidebar {
    position: static;
    margin-bottom: 48px;
  }

  .article-sidebar {
    position: static;
    margin-bottom: 48px;
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 9px 11px;
    font-size: 12px;
  }

  .side-nav a {
    gap: 4px;
  }

  .content-section {
    margin-bottom: 68px;
  }

  .profile {
    margin-bottom: 72px;
  }

  .profile h1 {
    margin-bottom: 29px;
    font-size: clamp(30px, 8vw, 38px);
  }

  .prose {
    font-size: 17px;
    line-height: 1.68;
  }

  .work-link {
    gap: 18px;
  }

  .writing-link {
    gap: 18px;
  }

  .article-header {
    margin-bottom: 44px;
  }

  .article-header h1 {
    font-size: 37px;
  }

  .article-body {
    font-size: 17px;
    line-height: 1.72;
  }

  .article-body h2 {
    font-size: 20px;
  }

  .site-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 12px;
  }

  .not-found {
    margin-left: 0;
  }
}

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

  .reveal,
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    animation: none;
    transition: opacity 120ms ease;
  }
}
