:root {
  --bg: #fbfaf7;
  --text: #161616;
  --muted: #66635d;
  --line: #dfd9cd;
  --soft: #f1ece2;
  --accent: #0f6b5f;
  --accent-strong: #0a4d45;
  --max: 1120px;
  --measure: 760px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-color: rgba(15, 107, 95, 0.45);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

.diagram-field {
  position: fixed;
  top: 112px;
  right: max(-40px, calc((100vw - var(--max)) / 2 - 72px));
  width: min(500px, 42vw);
  height: auto;
  z-index: -1;
  pointer-events: none;
  color: var(--accent);
  opacity: 0.18;
  mask-image: linear-gradient(115deg, transparent, #000 28%, #000 66%, transparent);
}

.diagram-lines path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.3;
}

.diagram-nodes circle {
  fill: var(--bg);
  stroke: currentColor;
  stroke-width: 1.5;
}

.diagram-labels {
  fill: currentColor;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0;
}

.site-header,
.site-footer,
main {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 28px 0;
}

.brand {
  font-weight: 760;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.hero {
  max-width: 1040px;
  padding: clamp(64px, 12vw, 140px) 0 clamp(52px, 8vw, 92px);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-weight: 720;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
}

h1 {
  max-width: 1000px;
  font-size: clamp(2.65rem, 6.4vw, 5.8rem);
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0;
}

.lead {
  max-width: var(--measure);
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.availability {
  max-width: 720px;
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1.08rem;
}

.availability a {
  color: var(--text);
  font-weight: 700;
}

.work-index {
  max-width: 980px;
  border-top: 1px solid var(--line);
}

.work-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 4vw, 2.6rem) 0;
  border-bottom: 1px solid var(--line);
}

.index-number {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.95rem;
  padding-top: 0.25rem;
}

.work-row p {
  max-width: 760px;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.6vw, 1.28rem);
}

.proof,
.latest,
.page-header,
.content,
.post-list,
.article {
  margin-top: clamp(52px, 8vw, 96px);
}

.proof {
  max-width: 920px;
  padding: clamp(1.6rem, 4vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.proof h2 {
  margin-bottom: 1rem;
}

.proof p {
  color: var(--muted);
  font-size: clamp(1.2rem, 2.2vw, 1.75rem);
  line-height: 1.28;
}

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

.section-heading a {
  color: var(--muted);
  font-weight: 700;
}

.page-header {
  max-width: 860px;
}

.page-header p {
  max-width: var(--measure);
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.25rem;
}

.content {
  max-width: var(--measure);
  font-size: 1.08rem;
}

.content > * + * {
  margin-top: 1.15rem;
}

.content h2 {
  margin-top: 2.4rem;
}

.content ul,
.content ol {
  padding-left: 1.25rem;
}

.content li + li {
  margin-top: 0.45rem;
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--soft);
}

.content figure {
  margin: 2rem 0;
}

.content figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.content pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #f6f2ea;
}

.content code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.post-list {
  max-width: 860px;
  border-top: 1px solid var(--line);
}

.post-list.compact {
  margin-top: 0;
}

.post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.post-row a {
  font-size: 1.25rem;
  font-weight: 760;
}

.post-row time {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-row p {
  grid-column: 1 / -1;
  max-width: 640px;
  color: var(--muted);
}

.article {
  max-width: var(--measure);
}

.article-header {
  margin-bottom: 2.5rem;
}

.article-header h1 {
  font-size: clamp(2.3rem, 5vw, 4.5rem);
}

.article-header time,
.article-header p {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(72px, 12vw, 140px);
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer div {
  display: grid;
  gap: 0.2rem;
}

.site-footer strong {
  color: var(--text);
}

@media (max-width: 780px) {
  html {
    font-size: 17px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .diagram-field {
    right: -190px;
    width: 420px;
    opacity: 0.1;
  }
}

@media (max-width: 620px) {
  .work-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .index-number {
    padding-top: 0;
  }
}

@media (max-width: 480px) {
  .site-header,
  .site-footer,
  main {
    width: min(var(--max), calc(100% - 28px));
  }

  h1 {
    font-size: 2.55rem;
  }

  .hero {
    padding-top: 44px;
  }
}
