@font-face {
  font-family: "Essay Serif";
  src: url("/assets/essay-serif.woff2?v=1") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #101310;
  --ink-soft: #151916;
  --ink-deep: #0b0e0c;
  --paper: #eee9df;
  --text: #d8d5cd;
  --muted: #a6aaa2;
  --faint: #747b74;
  --green: #81998a;
  --green-bright: #a8b9ad;
  --amber: #b89b68;
  --line: rgba(238, 233, 223, 0.14);
  --line-strong: rgba(238, 233, 223, 0.24);
  --serif: "Essay Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

html {
  min-width: 320px;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

::selection {
  background: rgba(184, 155, 104, 0.42);
  color: #fff;
}

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

.skip-link {
  position: fixed;
  z-index: 200;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-160%);
}

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

.site-nav {
  position: relative;
  z-index: 20;
  width: min(1180px, calc(100% - 3rem));
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
}

.wordmark strong {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 650;
}

.wordmark span {
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.site-nav nav,
.site-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem 1.4rem;
}

.site-nav nav a,
.site-footer nav a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  transition: color 150ms ease;
}

.site-nav nav a:hover,
.site-footer nav a:hover {
  color: var(--paper);
}

.archive-page {
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--ink);
  background-size: 100% 8rem;
}

.archive-shell {
  width: min(1120px, calc(100% - 3rem));
  min-height: calc(100vh - 16rem);
  margin: 0 auto;
  padding: 6rem 0 8rem;
}

.archive-heading {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line-strong);
}

.archive-heading p,
.archive-heading span {
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.archive-heading h1 {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1.25;
  font-weight: 620;
}

.essay-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(19rem, 0.8fr);
  gap: 4.5rem;
  align-items: center;
  padding: 4rem 0;
  border-bottom: 1px solid var(--line-strong);
}

.entry-visual {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #090b09;
}

.entry-visual::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.entry-visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 500ms ease, filter 500ms ease;
}

.entry-visual:hover img {
  filter: brightness(1.05);
  transform: scale(1.012);
}

.entry-copy {
  min-width: 0;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
}

.entry-copy h2 {
  margin-top: 1rem;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1.35;
  font-weight: 640;
}

.entry-copy > p {
  margin-top: 1.25rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 420;
  line-height: 1.9;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line-strong);
  color: var(--green-bright);
  font-size: 0.8rem;
  font-weight: 700;
}

.read-link span {
  font-size: 1.05rem;
  transition: transform 150ms ease;
}

.read-link:hover span {
  transform: translateX(3px);
}

.article-nav {
  position: absolute;
  right: 0;
  left: 0;
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.article-nav .wordmark span,
.article-nav nav a {
  color: rgba(238, 233, 223, 0.64);
}

.reading-progress {
  position: fixed;
  z-index: 150;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--amber);
}

.article-hero {
  position: relative;
  min-height: min(64svh, 42rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink-deep);
}

.article-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 12, 10, 0.94) 0%, rgba(9, 12, 10, 0.72) 38%, rgba(9, 12, 10, 0.14) 76%, rgba(9, 12, 10, 0.18) 100%);
  content: "";
}

.article-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 9rem 0 4.5rem;
}

.eyebrow {
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin-top: 0.8rem;
  color: #f2eee6;
  font-family: var(--serif);
  font-size: 4.75rem;
  line-height: 1.18;
  font-weight: 650;
  text-shadow: 0 3px 28px rgba(0, 0, 0, 0.42);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.25rem;
  margin-top: 1.6rem;
  color: rgba(238, 233, 223, 0.74);
  font-size: 0.76rem;
  font-weight: 600;
}

.article-layout {
  width: min(1000px, calc(100% - 3rem));
  display: grid;
  grid-template-columns: 9rem minmax(0, 42rem);
  gap: 5.5rem;
  align-items: start;
  justify-content: center;
  margin: 0 auto;
  padding: 6rem 0 8rem;
}

.article-note {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line-strong);
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
}

.article-note span:first-child {
  color: var(--green);
}

.prose {
  min-width: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 430;
  line-height: 2.08;
}

.prose p {
  margin-bottom: 1.45em;
  text-align: justify;
  text-justify: inter-ideograph;
}

.movement {
  scroll-margin-top: 2rem;
}

.movement + .movement {
  margin-top: 6.5rem;
}

.movement-marker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3.2rem;
  color: var(--amber);
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
}

.movement-marker::after {
  width: 4rem;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.movement:first-child > p:first-of-type {
  color: var(--paper);
  font-size: 1.2rem;
  line-height: 2;
}

.prose .refrain {
  margin: 2.8rem 0;
  color: var(--paper);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
}

.prose .anchor-line {
  margin: 3rem 0 1.7rem;
  color: var(--paper);
  font-size: 1.18rem;
  font-weight: 580;
}

.prose .final-line {
  margin-top: 3.8rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-strong);
  color: var(--paper);
  font-size: 1.22rem;
  font-weight: 560;
}

.site-footer {
  width: min(1180px, calc(100% - 3rem));
  min-height: 11rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin: 0 auto;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}

.site-footer > div {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.site-footer span {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.site-footer strong {
  max-width: 34rem;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 520;
  line-height: 1.7;
}

.back-to-top {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(16, 19, 16, 0.9);
  color: var(--paper);
  cursor: pointer;
}

.back-to-top[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .essay-entry {
    grid-template-columns: minmax(0, 1.2fr) minmax(17rem, 0.8fr);
    gap: 2.5rem;
  }

  .hero-copy h1 {
    font-size: 4rem;
  }

  .article-layout {
    grid-template-columns: 7rem minmax(0, 40rem);
    gap: 3rem;
  }
}

@media (max-width: 680px) {
  .site-nav {
    width: calc(100% - 2rem);
    min-height: 4.25rem;
  }

  .wordmark span {
    display: none;
  }

  .site-nav nav {
    gap: 0.85rem;
  }

  .site-nav nav a {
    font-size: 0.73rem;
  }

  .archive-shell {
    width: calc(100% - 2rem);
    padding: 3.5rem 0 5rem;
  }

  .archive-heading {
    grid-template-columns: 1fr auto;
    gap: 0.7rem 1rem;
  }

  .archive-heading p {
    grid-column: 1 / -1;
  }

  .archive-heading h1 {
    font-size: 2.1rem;
  }

  .essay-entry {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 0;
  }

  .entry-copy h2 {
    font-size: 2rem;
  }

  .article-hero {
    min-height: 56svh;
  }

  .article-hero::after {
    background: linear-gradient(90deg, rgba(9, 12, 10, 0.88) 0%, rgba(9, 12, 10, 0.58) 58%, rgba(9, 12, 10, 0.18) 100%);
  }

  .article-hero img {
    object-position: 57% center;
  }

  .hero-copy {
    width: calc(100% - 2rem);
    padding: 7rem 0 2.8rem;
  }

  .hero-copy h1 {
    font-size: 3rem;
  }

  .hero-meta {
    margin-top: 1.2rem;
  }

  .article-layout {
    width: calc(100% - 2rem);
    display: block;
    padding: 4rem 0 5rem;
  }

  .article-note {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 3.5rem;
  }

  .prose {
    font-size: 1.04rem;
    line-height: 2.02;
  }

  .prose p {
    text-align: left;
  }

  .movement + .movement {
    margin-top: 5rem;
  }

  .movement-marker {
    margin-bottom: 2.4rem;
  }

  .movement:first-child > p:first-of-type {
    font-size: 1.1rem;
  }

  .site-footer {
    width: calc(100% - 2rem);
    min-height: 10rem;
    display: block;
    padding: 2.5rem 0;
  }

  .site-footer nav {
    justify-content: flex-start;
    margin-top: 2rem;
  }
}

@media (max-width: 380px) {
  .hero-copy h1 {
    font-size: 2.6rem;
  }

  .hero-meta {
    gap: 0.45rem 0.8rem;
  }
}

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

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