:root {
  --bg: #121310;
  --surface: #171815;
  --ink: #d5d2ca;
  --ink-strong: #ece9e1;
  --ink-soft: #a29f96;
  --ink-faint: #727069;
  --line: #2b2c27;
  --accent: #938c7e;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --reading: 43rem;
  --shell: 66rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: #48463f var(--bg);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #39372f;
  color: var(--ink-strong);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #3b3934;
  border: 2px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #57534c; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

a:hover { color: var(--ink-strong); }
img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; }

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

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 1px;
  z-index: 1001;
}

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

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.shell-narrow {
  width: min(calc(100% - 48px), var(--reading));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 19, 16, .95);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font: 11px/1 var(--mono);
  letter-spacing: .045em;
  text-decoration: none;
  text-transform: lowercase;
}

.site-mark:hover { color: var(--ink-strong); }

.site-mark-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font: 10px/1 var(--mono);
  letter-spacing: .055em;
  text-transform: lowercase;
}

.site-nav a {
  color: var(--ink-faint);
  text-decoration: none;
}

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

.nav-toggle {
  display: none;
  color: var(--ink-soft);
  background: none;
  border: 0;
  font: 10px/1 var(--mono);
  letter-spacing: .06em;
}

.hero {
  padding: clamp(52px, 7vw, 76px) 0 clamp(30px, 4vw, 42px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 310px);
  gap: clamp(36px, 6vw, 72px);
  align-items: end;
}

.eyebrow {
  margin: 0 0 11px;
  color: var(--ink-faint);
  font: 9px/1.4 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 620px;
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(36px, 4.8vw, 54px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.022em;
}

.hero-note {
  max-width: 290px;
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.58;
}

.section {
  padding: 8px 0 68px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.section-heading span {
  margin: 0;
  font-family: var(--mono);
  font-weight: 400;
  text-transform: uppercase;
}

.section-heading h2 {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: .1em;
}

.section-heading span {
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: .045em;
}

.writing-index-root { min-width: 0; }

.writing-index-fallback-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font: 9px/1.4 var(--mono);
  letter-spacing: .04em;
}

.writing-controls {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.writing-search {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-faint);
  font: 10px/1 var(--mono);
}

.writing-search-mark {
  color: var(--accent);
  user-select: none;
}

.writing-search input {
  width: min(44vw, 340px);
  min-width: 140px;
  padding: 7px 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  outline: 0;
  font: 10px/1.4 var(--mono);
  letter-spacing: .025em;
}

.writing-search input::placeholder { color: #67655f; }

.writing-search:focus-within .writing-search-mark,
.writing-search:focus-within input { color: var(--ink-strong); }

.writing-controls-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-faint);
  font: 9px/1 var(--mono);
  letter-spacing: .035em;
}

.writing-sort {
  padding: 8px 0;
  background: transparent;
  color: var(--ink-faint);
  border: 0;
  cursor: pointer;
  font: inherit;
}

.writing-sort:hover,
.writing-sort:focus-visible { color: var(--ink); }

.writing-count { min-width: 30px; text-align: right; }

.writing-empty {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 15px;
}

.writing-empty p { margin: 0; }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list-item { border-bottom: 1px solid var(--line); }

.post-list-link {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 78px;
  gap: 24px;
  align-items: start;
  padding: 22px 0 23px;
  text-decoration: none;
}

.post-list-date,
.post-list-length {
  padding-top: 4px;
  color: var(--ink-faint);
  font: 9px/1.5 var(--mono);
  letter-spacing: .025em;
  white-space: nowrap;
}

.post-list-length { text-align: right; }
.post-list-copy { min-width: 0; }

.post-list-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.9vw, 31px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.012em;
  transition: color .14s ease;
}

.post-list-link:hover .post-list-title { color: var(--ink-strong); }

.post-list-excerpt {
  max-width: 590px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.archive-intro { padding: 58px 0 22px; }

.archive-intro h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(34px, 4vw, 44px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.018em;
}

.archive-intro p:last-child {
  max-width: 460px;
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.post-shell { padding: 0 0 64px; }

.post-header {
  padding-top: clamp(52px, 7vw, 78px);
  padding-bottom: 28px;
}

.back-link {
  display: inline-block;
  text-decoration: none;
}

.post-header h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(38px, 5.2vw, 52px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.022em;
}

.post-deck {
  max-width: 600px;
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.48;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  color: var(--ink-faint);
  font: 9px/1.5 var(--mono);
  letter-spacing: .035em;
  text-transform: uppercase;
}

.post-note {
  margin: 0 0 32px;
  padding: 10px 0 10px 15px;
  border-left: 1px solid #504a42;
  color: var(--ink-soft);
  font-size: 14px;
}

.post-content {
  color: #d1cec6;
  font-size: clamp(18px, 1.7vw, 19.5px);
  line-height: 1.77;
}

.post-content p { margin: 0 0 1.34em; }

.post-content > p:first-child::first-letter {
  float: none;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.post-content h2,
.post-content h3 {
  color: var(--ink-strong);
  font-weight: 500;
  line-height: 1.2;
}

.post-content h2 { margin: 2em 0 .65em; font-size: 1.5em; }
.post-content h3 { margin: 1.8em 0 .6em; font-size: 1.22em; }

.post-content blockquote {
  margin: 2em 0;
  padding: .1em 0 .1em 1.1em;
  border-left: 1px solid #504a42;
  color: #bbb5ac;
}

.post-content img {
  width: 100%;
  margin: 2.15em 0;
  border: 1px solid #292824;
  filter: saturate(.9) contrast(.99) brightness(.95);
}

.post-content .story-break {
  margin: 2.3em 0;
  color: var(--ink-faint);
  text-align: center;
  letter-spacing: .3em;
}

.post-content .signature { text-align: right; color: var(--ink-soft); }

.post-content .epitaph {
  margin: 2em 0;
  color: var(--ink-soft);
  font: 10px/1.6 var(--mono);
  letter-spacing: .09em;
  text-align: center;
}

.post-content .dialogue { margin-top: -.35em; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 21px;
  margin-top: 50px;
  border-top: 1px solid var(--line);
  font: 9px/1.4 var(--mono);
  letter-spacing: .055em;
  text-transform: uppercase;
}

.post-nav a { color: var(--ink-faint); text-decoration: none; }
.post-nav a:hover { color: var(--ink); }

.site-footer {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 0 32px;
  color: var(--ink-faint);
  font: 9px/1.5 var(--mono);
  letter-spacing: .035em;
}

.footer-inner p { margin: 0; }

.email-embed {
  padding: clamp(18px, 4vw, 34px);
  background: #e9e7e1;
  color: #2a2927;
  border-radius: 2px;
  font: 14px/1.7 Arial, sans-serif;
}

.email-embed .blurred {
  color: transparent;
  text-shadow: 0 0 7px rgba(0, 0, 0, .45);
  user-select: none;
}

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