:root {
  color-scheme: light;
  --paper: #fcfaf7;
  --paper-raised: #fffdfb;
  --ink: #29252b;
  --muted: #777078;
  --line: #e7dfe2;
  --accent: #a45f79;
  --accent-soft: #f2dde6;
  --blush: #edcbd9;
  --mist: #e0eaf0;
  --plane: #bd7892;
  --serif: Didot, Bodoni MT, Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  --sans: Avenir Next, Avenir, Helvetica Neue, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shell: 72rem;
  --reading: 43rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17171b;
  --paper-raised: #211f24;
  --ink: #f4eef1;
  --muted: #ada5ad;
  --line: #3b363e;
  --accent: #e3a8bd;
  --accent-soft: #422f38;
  --blush: #5a3745;
  --mist: #30414b;
  --plane: #d69bb0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #17171b;
    --paper-raised: #211f24;
    --ink: #f4eef1;
    --muted: #ada5ad;
    --line: #3b363e;
    --accent: #e3a8bd;
    --accent-soft: #422f38;
    --blush: #5a3745;
    --mist: #30414b;
    --plane: #d69bb0;
  }
}

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

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 7% 18%, color-mix(in srgb, var(--blush) 26%, transparent), transparent 25rem),
    radial-gradient(circle at 93% 64%, color-mix(in srgb, var(--mist) 28%, transparent), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 300ms ease, color 300ms ease;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  border-radius: 0.15rem;
  outline: 0.18rem solid var(--accent);
  outline-offset: 0.22rem;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--accent-soft);
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

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

.site-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 3rem), var(--shell));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark-mark {
  flex: 0 0 auto;
  width: 2.45rem;
}

.wordmark-mark img {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 50%;
  box-shadow: 0 0.35rem 1rem color-mix(in srgb, var(--ink) 9%, transparent);
  transition: transform 220ms ease;
}

.wordmark:hover .wordmark-mark img {
  transform: rotate(-5deg) scale(1.05);
}

.header-actions {
  display: flex;
  gap: clamp(1.1rem, 3vw, 2.3rem);
  align-items: center;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.2rem);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

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

.theme-toggle {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper-raised) 75%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(8deg);
}

.theme-toggle:focus-visible {
  outline: 0.18rem solid var(--accent);
  outline-offset: 0.2rem;
}

.theme-icon {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.home-intro {
  position: relative;
  display: block;
  overflow: hidden;
  margin: clamp(1rem, 2vw, 1.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  padding: clamp(2.25rem, 4vw, 3.5rem) clamp(1.75rem, 5vw, 4rem);
  border: 1px solid color-mix(in srgb, var(--blush) 62%, var(--line));
  border-radius: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 82% 22%, color-mix(in srgb, var(--mist) 62%, transparent), transparent 19rem),
    linear-gradient(135deg, color-mix(in srgb, var(--blush) 68%, var(--paper-raised)), var(--paper-raised) 68%);
  isolation: isolate;
}

.home-intro::after {
  position: absolute;
  right: -8rem;
  bottom: -15rem;
  z-index: -1;
  width: 31rem;
  height: 31rem;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 50%;
  content: "";
}

.home-intro-copy {
  position: relative;
  z-index: 2;
  max-width: 48rem;
}

.hero-airspace {
  position: absolute;
  top: 50%;
  right: -2.5rem;
  width: 26.25rem;
  height: 18.75rem;
  opacity: 0.72;
  transform: translateY(-50%) scale(0.46);
  transform-origin: right center;
}

.hero-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 58%, transparent);
  stroke-dasharray: 3 9;
  stroke-linecap: round;
  stroke-width: 1;
  animation: route-drift 18s linear infinite;
}

.flight-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  offset-path: path("M 18 250 C 92 167 139 212 187 142 C 235 73 281 50 395 37");
  offset-distance: 0%;
  offset-rotate: auto;
  animation: hero-flight 9s cubic-bezier(0.42, 0, 0.28, 1) -1.8s infinite;
}

.hero-plane {
  position: absolute;
  top: -2.5rem;
  left: -3.4rem;
  width: 7.5rem;
  max-width: none;
  fill: color-mix(in srgb, var(--paper-raised) 22%, transparent);
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
  filter: drop-shadow(0 0.45rem 0.55rem color-mix(in srgb, var(--accent) 16%, transparent));
}

.eyebrow,
.section-label {
  margin: 0 0 1.25rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-intro h1,
.article-header h1,
.listing-header h1,
.not-found h1 {
  max-width: 58rem;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 6.4rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.home-intro h1 {
  max-width: min(42rem, calc(100% - 7rem));
  font-size: clamp(2.25rem, 4.7vw, 4.35rem);
  line-height: 1.02;
}

.featured-essay {
  display: grid;
  grid-template-columns: minmax(6rem, 0.25fr) minmax(0, 1fr);
  gap: 2rem;
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.featured-essay article {
  max-width: 49rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.featured-essay h2 {
  margin: 1rem 0 1.25rem;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.featured-essay h2 a {
  text-decoration: none;
}

.featured-essay article > p {
  max-width: 42rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.text-link {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.text-link span {
  transition: transform 160ms ease;
}

.text-link:hover span {
  transform: translateX(0.2rem);
}

.essay-list {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.section-heading > a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

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

.essay-row:last-child {
  border-bottom: 1px solid var(--line);
}

.essay-row-link {
  display: grid;
  grid-template-columns: minmax(8rem, 0.28fr) minmax(0, 1fr) 2rem;
  gap: 2rem;
  align-items: start;
  padding: 2rem 0;
  text-decoration: none;
}

.essay-row-meta {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.essay-row h3,
.archive-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.16;
}

.essay-row p {
  max-width: 43rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.03rem;
}

.essay-row-arrow {
  padding-top: 0.2rem;
  color: var(--muted);
  font-size: 1.15rem;
  transition: color 160ms ease, transform 160ms ease;
}

.essay-row-link:hover .essay-row-arrow {
  transform: translate(0.15rem, -0.15rem);
  color: var(--accent);
}

.article {
  max-width: var(--reading);
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 8rem) 0;
}

.article-header {
  margin-bottom: clamp(3rem, 7vw, 5.5rem);
}

.back-link {
  display: inline-flex;
  gap: 0.4rem;
  margin-bottom: 3.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
}

.article-header h1 {
  margin-top: 1.4rem;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
}

.article-description {
  margin: 1.7rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.7rem;
}

.tag-list span {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 99rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.article-body {
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.5vw, 1.2rem);
  line-height: 1.78;
}

.article-body > p:first-child {
  font-size: 1.18em;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 2.4em 0 0.75em;
  font-family: var(--sans);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.article-body h2 {
  font-size: 1.65em;
}

.article-body h3 {
  font-size: 1.3em;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body pre,
.article-body blockquote {
  margin: 0 0 1.5em;
}

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

.article-body img {
  width: auto;
  max-height: 42rem;
  margin: 2.4rem auto;
  border-radius: 0.25rem;
}

.article-body img.width-80 {
  max-width: 80%;
}

.article-body blockquote {
  margin-inline: -1.25rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 0.2rem solid var(--accent);
  color: var(--muted);
  font-size: 1.12em;
  font-style: italic;
}

.article-body code {
  padding: 0.12em 0.32em;
  border-radius: 0.2rem;
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 0.82em;
}

.article-body pre {
  overflow-x: auto;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--paper-raised);
  font-family: var(--mono);
  font-size: 0.82em;
  line-height: 1.65;
}

.article-body pre code {
  padding: 0;
  background: transparent;
}

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

.article-body table {
  display: block;
  overflow-x: auto;
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.article-body th,
.article-body td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--accent);
}

.article-footer p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
}

.page-article .article-header {
  margin-bottom: 3rem;
}

.listing-page,
.archive-page,
.not-found {
  padding: clamp(4rem, 10vw, 8rem) 0;
}

.listing-header {
  max-width: 47rem;
  margin-bottom: clamp(4rem, 8vw, 7rem);
}

.listing-header h1 {
  font-size: clamp(3.2rem, 8vw, 6.5rem);
}

.listing-description {
  margin-top: 1.6rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.25rem;
}

.archive-year {
  display: grid;
  grid-template-columns: minmax(6rem, 0.2fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

.archive-year:last-child {
  border-bottom: 1px solid var(--line);
}

.archive-year > h2 {
  margin: 0;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-style: italic;
  font-weight: 500;
}

.archive-item {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) 3.5rem;
  gap: 1rem;
  align-items: baseline;
  padding: 0 0 1.4rem;
}

.archive-item:last-child {
  padding-bottom: 0;
}

.archive-item time,
.archive-item > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.archive-item h3 {
  font-size: 1.25rem;
}

.archive-item h3 a {
  text-decoration: none;
}

.not-found {
  min-height: 62vh;
}

.not-found h1 {
  max-width: 48rem;
}

.not-found > p:not(.eyebrow) {
  max-width: 36rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.2rem;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: 3rem 0 2.25rem;
  border-top: 1px solid var(--accent);
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

.footer-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  justify-content: flex-end;
}

.footer-links a {
  font-weight: 650;
  text-decoration: none;
}

.copyright {
  grid-column: 1 / -1;
  padding-top: 1rem;
}

.paper-sky {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

body.home .paper-sky {
  z-index: 2;
}

.paper-plane {
  position: absolute;
  width: 7rem;
  opacity: 0;
  fill: color-mix(in srgb, var(--paper-raised) 24%, transparent);
  stroke: var(--plane);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1;
  filter: drop-shadow(0 0.25rem 0.35rem color-mix(in srgb, var(--plane) 16%, transparent));
}

.paper-plane-one {
  top: 9vh;
  left: -10rem;
  animation: plane-flight-one 24s linear -5s infinite;
}

.paper-plane-two {
  top: 71vh;
  left: calc(100vw + 5rem);
  width: 5.5rem;
  animation: plane-flight-two 31s linear -14s infinite;
}

.paper-plane-three {
  top: 43vh;
  left: -10rem;
  width: 4.5rem;
  animation: plane-flight-three 38s linear -22s infinite;
}

@keyframes hero-flight {
  0% {
    opacity: 0;
    offset-distance: 0%;
  }

  8%,
  84% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    offset-distance: 100%;
  }
}

@keyframes route-drift {
  to {
    stroke-dashoffset: -48;
  }
}

@keyframes plane-flight-one {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(4deg);
  }

  12%,
  86% {
    opacity: 0.3;
  }

  48% {
    transform: translate3d(55vw, 13vh, 0) rotate(-5deg);
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(100vw + 20rem), 2vh, 0) rotate(5deg);
  }
}

@keyframes plane-flight-two {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scaleX(-1) rotate(5deg);
  }

  12%,
  86% {
    opacity: 0.25;
  }

  52% {
    transform: translate3d(-55vw, -11vh, 0) scaleX(-1) rotate(-5deg);
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(-100vw - 20rem), -2vh, 0) scaleX(-1) rotate(4deg);
  }
}

@keyframes plane-flight-three {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-8deg);
  }

  14%,
  84% {
    opacity: 0.2;
  }

  54% {
    transform: translate3d(58vw, -8vh, 0) rotate(2deg);
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(100vw + 20rem), 10vh, 0) rotate(-3deg);
  }
}

@media (max-width: 46rem) {
  .site-shell {
    width: min(calc(100% - 2rem), var(--shell));
  }

  .site-header {
    gap: 1rem;
    padding: 1.2rem 0;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .header-actions {
    gap: 1rem;
  }

  .site-nav {
    gap: clamp(0.8rem, 4vw, 1.25rem);
    font-size: 0.76rem;
  }

  .home-intro {
    display: block;
    min-height: 0;
    padding: 2rem 1.5rem;
  }

  .home-intro h1 {
    max-width: calc(100% - 3rem);
    font-size: 2rem;
    line-height: 1.08;
  }

  .hero-airspace {
    top: 50%;
    right: -5rem;
    bottom: auto;
    width: 26.25rem;
    height: 18.75rem;
    margin: 0;
    opacity: 0.62;
    transform: translateY(-50%) scale(0.32);
    transform-origin: right center;
  }

  .hero-route {
    display: block;
  }

  .hero-plane {
    width: 7.5rem;
  }

  .home-intro h1,
  .article-header h1,
  .listing-header h1,
  .not-found h1 {
    letter-spacing: -0.04em;
  }

  .featured-essay,
  .archive-year {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .essay-row-link {
    grid-template-columns: 1fr 1.5rem;
    gap: 0.75rem 1rem;
  }

  .essay-row-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 0.7rem;
  }

  .essay-row-arrow {
    grid-column: 2;
    grid-row: 2;
  }

  .archive-item {
    grid-template-columns: 4.3rem minmax(0, 1fr);
  }

  .archive-item > span {
    display: none;
  }

  .article-body blockquote {
    margin-left: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .copyright {
    grid-column: 1;
  }

  .paper-plane-three {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .paper-sky {
    display: none;
  }

  .hero-route {
    animation: none;
  }

  .flight-track {
    animation: none !important;
    opacity: 0.75;
    offset-distance: 72%;
  }

}

@media print {
  :root {
    --paper: #fff;
    --ink: #000;
    --muted: #444;
    --line: #aaa;
  }

  .site-header,
  .site-footer,
  .paper-sky,
  .hero-airspace,
  .theme-toggle,
  .back-link,
  .article-footer {
    display: none;
  }

  .article {
    max-width: none;
    padding: 0;
  }
}
