:root {
  --ink: #f2efe7;
  --ink-soft: #b9b5aa;
  --ink-faint: #74736d;
  --ground: #05070a;
  --ground-deep: #020305;
  --line: rgba(242, 239, 231, 0.16);
  --signal: #73d7d0;
  --estimand: #e4b36a;
  --page-pad: clamp(1.4rem, 4vw, 4.5rem);
  --header-height: 5.5rem;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 18rem;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, transparent calc(var(--page-pad) - 1px), rgba(255, 255, 255, 0.035) var(--page-pad), transparent calc(var(--page-pad) + 1px)),
    linear-gradient(180deg, var(--ground) 0%, #080b11 66%, var(--ground-deep) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--ink);
  outline-offset: 0.4rem;
}

::selection { background: var(--signal); color: var(--ground); }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--ground);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 180ms ease;
}

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

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.wordmark span { color: var(--estimand); }

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 3rem);
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav a {
  position: relative;
  padding: 0.25rem 0;
  transition: color 180ms ease;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: -0.15rem;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: right;
  background: currentColor;
  content: "";
  transition: transform 220ms ease;
}

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

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.editorial-atmosphere {
  position: absolute;
  z-index: 0;
  top: 7rem;
  right: 0;
  width: min(48vw, 42rem);
  aspect-ratio: 1;
  opacity: 0.38;
  pointer-events: none;
}

.editorial-atmosphere span {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(115, 215, 208, 0.22);
  border-radius: 50%;
  transform: rotate(26deg) scaleY(0.42);
}

.editorial-atmosphere span:nth-child(2) {
  inset: 18%;
  transform: rotate(72deg) scaleY(0.55);
}

.editorial-atmosphere span:nth-child(3) {
  inset: 25%;
  transform: rotate(-35deg) scaleY(0.7);
  border-color: rgba(228, 179, 106, 0.23);
}

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

.editorial-hero {
  width: min(100%, 84rem);
  min-height: clamp(25rem, 62vh, 43rem);
  margin: 0 auto;
  padding: clamp(8rem, 18vh, 13rem) var(--page-pad) 5rem;
}

.editorial-kicker {
  margin: 0 0 1.6rem;
  color: var(--signal);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.editorial-hero h1 {
  max-width: 11ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4rem, 9vw, 8.8rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-wrap: balance;
}

.editorial-post .editorial-hero h1 {
  max-width: 13ch;
  font-size: clamp(3.5rem, 7.6vw, 7.6rem);
  line-height: 0.94;
}

.editorial-subtitle {
  max-width: 42rem;
  margin: 2rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.7;
}

.editorial-body {
  width: min(calc(100% - (var(--page-pad) * 2)), 72rem);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(7rem, 13vw, 11rem);
  border-top: 1px solid var(--line);
}

.editorial-body--post { max-width: 48rem; }
.editorial-body > :first-child { margin-top: 0; }

.editorial-body h2,
.editorial-body h3,
.editorial-body h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

.editorial-body h2 { margin: 4.8rem 0 1.5rem; font-size: clamp(2.2rem, 5vw, 4rem); }
.editorial-body h3 { margin: 3.8rem 0 1.2rem; font-size: clamp(1.65rem, 3.2vw, 2.5rem); }
.editorial-body h4 { margin: 2.8rem 0 1rem; font-size: 1.35rem; }

.editorial-body p,
.editorial-body li {
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.82;
}

.editorial-body p { margin: 0 0 1.55rem; }
.editorial-body ul,
.editorial-body ol { margin: 0 0 2rem; padding-left: 1.4rem; }
.editorial-body li { margin-bottom: 0.55rem; padding-left: 0.4rem; }
.editorial-body strong { color: var(--ink); font-weight: 650; }
.editorial-body em { color: var(--ink-soft); }

.editorial-body a {
  color: var(--signal);
  text-decoration: underline;
  text-decoration-color: rgba(115, 215, 208, 0.42);
  text-underline-offset: 0.18em;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

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

.editorial-body blockquote {
  margin: 3rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 1px solid var(--estimand);
}

.editorial-body blockquote p { color: var(--ink); font-family: var(--serif); font-size: 1.3rem; }

.editorial-body pre {
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: #0b0f15;
  color: #dfe7e5;
  font-size: 0.86rem;
  line-height: 1.65;
}

.editorial-body :not(pre) > code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--line);
  border-radius: 0.2rem;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-size: 0.88em;
}

.editorial-body img { display: block; max-width: 100%; height: auto; margin: 3rem auto; }
.editorial-body hr { margin: 3.5rem 0; border: 0; border-top: 1px solid var(--line); }

.post-preview {
  display: grid;
  grid-template-columns: minmax(7rem, 0.22fr) 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 2.7rem 0;
  border-bottom: 1px solid var(--line);
}

.post-preview:first-child { border-top: 1px solid var(--line); }
.post-preview .post-title { grid-column: 2; margin: 0; font-size: clamp(1.8rem, 3.6vw, 3.15rem); }
.post-preview .post-title a { color: var(--ink); text-decoration: none; }
.post-preview .post-title a:hover { color: var(--signal); }
.post-preview .post-meta { grid-column: 1; grid-row: 1; margin: 0; color: var(--estimand); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.post-preview .post-excerpt { grid-column: 2; max-width: 36rem; margin: 0; }
.post-preview > p:last-of-type { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
.post-preview > p:last-of-type a { font-size: 0; text-decoration: none; }
.post-preview > p:last-of-type a::after { content: "↗"; color: var(--estimand); font-size: 1rem; }
.post-preview hr { display: none; }

.article-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: min(calc(100% - (var(--page-pad) * 2)), 72rem);
  margin: 0 auto;
  padding: 3rem 0 6rem;
  border-top: 1px solid var(--line);
}

.article-pagination a { display: flex; flex-direction: column; gap: 0.5rem; }
.article-pagination__next { align-items: flex-end; text-align: right; }
.article-pagination span { color: var(--estimand); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; }
.article-pagination strong { max-width: 25rem; color: var(--ink-soft); font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 400; line-height: 1.25; transition: color 180ms ease; }
.article-pagination a:hover strong { color: var(--ink); }

.editorial-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  margin: 0 var(--page-pad);
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
}

.editorial-footer p { margin: 0; color: var(--ink-faint); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.editorial-footer p:last-child { text-align: right; }

@media (max-width: 700px) {
  :root { --page-pad: 1.25rem; --header-height: 4.75rem; }
  .site-nav { gap: 1rem; font-size: 0.61rem; }
  .editorial-atmosphere { top: 8rem; width: min(100%, 29rem); opacity: 0.25; }
  .editorial-hero { min-height: 30rem; padding-top: 8rem; padding-bottom: 4rem; }
  .editorial-hero h1,
  .editorial-post .editorial-hero h1 { font-size: clamp(3.35rem, 15vw, 5rem); }
  .editorial-body { padding-top: 4.5rem; }
  .editorial-body h2 { margin-top: 3.8rem; }
  .editorial-body h3 { margin-top: 3rem; }
  .post-preview { grid-template-columns: 1fr auto; gap: 0.85rem 1rem; padding: 2.2rem 0; }
  .post-preview .post-meta { grid-column: 1; grid-row: auto; }
  .post-preview .post-title { grid-column: 1 / -1; }
  .post-preview .post-excerpt { grid-column: 1 / -1; }
  .post-preview > p:last-of-type { grid-column: 2; grid-row: 1; }
  .article-pagination { grid-template-columns: 1fr; }
  .article-pagination__next { align-items: flex-start; text-align: left; }
  .editorial-footer { grid-template-columns: 1fr auto; }
  .editorial-footer p:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition-duration: 0.001ms !important; }
}
