:root {
  --paper: #fbfaf6;
  --surface: #fffefa;
  --surface-2: #f1ede3;
  --ink: #24231f;
  --body: #403d36;
  --muted: #756f64;
  --line: #d8d0c2;
  --line-strong: #aaa092;
  --accent: #247458;
  --accent-soft: #e5eee8;
  --danger: #b53b2d;
  --max-width: 1120px;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.22em;
}

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

:where(a, button, input, select):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

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

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

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header__inner {
  width: min(100% - 40px, var(--max-width));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 54px) 0 clamp(22px, 4vw, 34px);
}

.site-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 760;
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: lowercase;
}

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

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.subscribe-link {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.site-shell {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 42px);
  width: min(100% - 40px, var(--max-width));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) 0 56px;
}

.identity-card {
  position: sticky;
  top: 20px;
  align-self: start;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--body);
}

.identity-avatar {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.identity-card .p-name {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 760;
  text-decoration: none;
}

.identity-subtitle {
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 650;
}

.identity-card .p-note {
  margin-top: 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.social-links a {
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.ledger-main {
  min-width: 0;
}

.site-shell--single-article {
  display: block;
  width: min(100% - 40px, 820px);
}

.ledger-main--article {
  width: 100%;
}

.ledger-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.ledger-heading :where(h1, h2) {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  line-height: 1.12;
}

.ledger-heading p,
.meta {
  max-width: 54ch;
  margin: 8px 0 0;
  color: var(--muted);
}

.feed {
  display: grid;
}

.empty-state {
  border-bottom: 1px dashed var(--line);
  padding: 28px 0;
  color: var(--muted);
}

.ledger-entry {
  display: grid;
  grid-template-columns: minmax(110px, 142px) 32px minmax(0, 1fr);
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.ledger-time {
  padding: 24px 18px 20px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.post-time-link {
  color: inherit;
  text-decoration: none;
}

.ledger-time:hover .ledger-date,
.ledger-time:hover .ledger-clock {
  color: var(--ink);
}

.ledger-date,
.ledger-clock,
.entry-state {
  display: block;
}

.entry-state {
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ledger-marker {
  position: relative;
  display: flex;
  justify-content: center;
}

.ledger-marker::before {
  content: "";
  width: 1px;
  min-height: 100%;
  background: var(--line);
}

.marker-dot {
  position: absolute;
  top: 30px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
}

.ledger-entry--reply .marker-dot {
  border-color: var(--accent);
}

.entry-body {
  min-width: 0;
  padding: 24px 0 22px 20px;
}

.entry-author {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.entry-author .p-name {
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
}

.entry-author .p-nickname {
  color: var(--muted);
}

.post-permalink,
.post-title {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
}

.post-title {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.7rem);
  line-height: 1.12;
}

.reply-target,
.tag-link {
  display: inline-flex;
  margin: 6px 8px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.content {
  color: var(--body);
  font-size: clamp(1rem, 1.45vw, 1.08rem);
  line-height: 1.66;
  overflow-wrap: anywhere;
}

.content p {
  margin: 0 0 0.85em;
}

.content p:last-child {
  margin-bottom: 0;
}

.ledger-entry--single.ledger-entry--article {
  display: block;
  border-bottom: 0;
}

.ledger-entry--single.ledger-entry--article .ledger-time {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  padding: 28px 0 12px;
  border-bottom: 1px solid var(--line);
}

.ledger-entry--single.ledger-entry--article .ledger-date,
.ledger-entry--single.ledger-entry--article .ledger-clock,
.ledger-entry--single.ledger-entry--article .entry-state {
  display: inline;
  margin: 0;
}

.ledger-entry--single.ledger-entry--article .ledger-marker {
  display: none;
}

.ledger-entry--single.ledger-entry--article .entry-body {
  padding: clamp(26px, 5vw, 48px) 0 40px;
}

.ledger-entry--single.ledger-entry--article .entry-author {
  margin-bottom: 18px;
}

.ledger-entry--single.ledger-entry--article .post-title {
  max-width: 18ch;
  margin-bottom: clamp(24px, 5vw, 42px);
  font-size: clamp(2.35rem, 7vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.ledger-entry--single.ledger-entry--article .content {
  max-width: 72ch;
  color: var(--body);
  font-size: clamp(1.05rem, 1.7vw, 1.16rem);
  line-height: 1.72;
}

.ledger-entry--single.ledger-entry--article .content p,
.ledger-entry--single.ledger-entry--article .content ul,
.ledger-entry--single.ledger-entry--article .content ol,
.ledger-entry--single.ledger-entry--article .content blockquote,
.ledger-entry--single.ledger-entry--article .content pre {
  margin: 0 0 1.35em;
}

.ledger-entry--single.ledger-entry--article .content h2,
.ledger-entry--single.ledger-entry--article .content h3,
.ledger-entry--single.ledger-entry--article .content h4,
.ledger-entry--single.ledger-entry--article .content h5,
.ledger-entry--single.ledger-entry--article .content h6 {
  max-width: 28ch;
  margin: 2.4em 0 0.65em;
  color: var(--ink);
  line-height: 1.16;
  text-wrap: balance;
}

.ledger-entry--single.ledger-entry--article .content h2 {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.ledger-entry--single.ledger-entry--article .content h3 {
  font-size: clamp(1.3rem, 3vw, 1.65rem);
}

.ledger-entry--single.ledger-entry--article .content :where(ul, ol) {
  padding-left: 1.35em;
}

.ledger-entry--single.ledger-entry--article .content li + li {
  margin-top: 0.45em;
}

.content :not(pre) > code {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  padding: 0.08em 0.3em;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.content pre {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  padding: clamp(14px, 3vw, 20px);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  tab-size: 2;
}

.content pre code {
  font: inherit;
}

.content blockquote {
  border-left: 3px solid var(--accent);
  margin-left: 0;
  padding: 0.15em 0 0.15em 1.2em;
  color: var(--muted);
}

.content hr {
  width: min(100%, 16rem);
  border: 0;
  border-top: 1px solid var(--line-strong);
  margin: 2.5rem 0;
}

.event-details {
  display: grid;
  gap: 8px;
  border-block: 1px solid var(--line);
  margin: 8px 0 24px;
  padding: 16px 0;
}

.event-details div {
  display: grid;
  grid-template-columns: minmax(74px, 0.25fr) 1fr;
  gap: 12px;
}

.event-details :where(dt, dd) {
  margin: 0;
}

.event-details dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ledger-entry--single.has-photo .media-grid img:first-child {
  grid-column: 1 / -1;
}

.ledger-entry--single :where(.u-audio, .u-video) {
  width: 100%;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px;
  margin-top: 16px;
}

.media-grid img,
.media-grid video {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #191915;
}

.media-grid img {
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

.media-grid video {
  max-height: 340px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-grid audio,
.media-grid .embed-frame,
.media-grid .link-citation {
  grid-column: 1 / -1;
}

.embed-frame,
.link-citation {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}

.embed-frame iframe {
  display: block;
  width: 100%;
  height: 220px;
  border: 0;
}

.link-citation {
  display: grid;
  color: inherit;
  text-decoration: none;
}

.link-citation__body {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.link-citation__body strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.link-citation__action {
  color: var(--accent);
  font-size: 0.84rem;
}

.button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--body);
  padding: 8px 13px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.2;
  text-decoration: none;
}

.button--wide {
  min-width: min(100%, 220px);
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: center;
  padding: 24px 0 42px;
}

.archive-taxonomies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.term-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px 0;
}

.term-link {
  display: inline-flex;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: 7px 10px;
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
}

.term-link span {
  color: var(--muted);
}

.archive-list {
  display: grid;
  padding-top: 16px;
}

.archive-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 180px) auto;
  gap: 8px;
  align-items: end;
  padding: 22px 0 8px;
}

.archive-controls label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.archive-controls input,
.archive-controls select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.archive-results {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.archive-year h3 {
  margin: 20px 0 0;
  font-size: 1.25rem;
}

.archive-year ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(94px, 120px) minmax(120px, 1fr) minmax(0, 2fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 12px 0;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 18px 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.post-navigation--back {
  justify-content: flex-start;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.archive-row time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.archive-row .p-name {
  color: var(--ink);
  font-weight: 700;
}

.archive-row .p-summary {
  color: var(--muted);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 12px;
  padding-top: 24px;
}

.photo-tile {
  display: block;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}

.photo-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

@media (max-width: 760px) {
  .site-header__inner,
  .site-shell {
    display: block;
    width: min(100% - 32px, var(--max-width));
  }

  .site-shell--single-article {
    width: min(100% - 32px, 820px);
  }

  .site-header__inner {
    padding: 30px 0 24px;
  }

  .site-title {
    font-size: clamp(2.65rem, 13vw, 4.4rem);
  }

  .identity-card {
    position: static;
    margin-bottom: 24px;
  }

  .ledger-entry {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .ledger-time {
    grid-column: 2;
    grid-row: 1;
    padding: 20px 0 0 14px;
    font-size: 0.78rem;
  }

  .ledger-marker {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .marker-dot {
    top: 25px;
  }

  .entry-body {
    grid-column: 2;
    grid-row: 2;
    padding: 12px 0 20px 14px;
  }

  .archive-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .archive-controls {
    grid-template-columns: 1fr;
  }

  .button {
    min-height: 44px;
  }

  .ledger-entry--single.ledger-entry--article .entry-body {
    padding: 24px 0 32px;
  }

  .ledger-entry--single.ledger-entry--article .post-title {
    max-width: 22ch;
  }
}

@media (max-width: 360px) {
  .site-header__inner,
  .site-shell {
    width: min(100% - 24px, var(--max-width));
  }

  .site-title {
    font-size: 2.55rem;
  }
}

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