:root {
  --bg: #f8f4ed;
  --panel: rgba(255, 255, 255, 0.72);
  --text: #171717;
  --muted: #5e5a53;
  --line: rgba(23, 23, 23, 0.12);
  --accent: #8a5a2b;
  --heading: #c41e3a;
  --shadow: 0 24px 80px rgba(50, 35, 15, 0.08);
  --post-width: min(94vw, 1240px);
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 42%),
    linear-gradient(180deg, #fbf8f3 0%, #f3ede5 100%);
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

.shell {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0 34px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand,
.topbar nav a {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

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

.topbar nav {
  display: flex;
  gap: 22px;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
}

.hero,
.page-header,
.empty-state {
  width: min(100%, 720px);
  margin: 0 auto;
}

.post {
  width: min(100%, var(--post-width));
  margin: 0 auto;
}

.hero {
  padding: 84px 0 72px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.hero h1,
.page-header h1,
.post h1 {
  font-size: clamp(3rem, 8vw, 5.8rem);
}

.hero h1 {
  white-space: nowrap;
}

.intro,
.empty-state,
.prose {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 100%;
}

.prose > p,
.prose > ul,
.prose > ol,
.prose > h2,
.prose > h3,
.prose > blockquote,
.prose > li {
  max-width: 60ch;
}

.post .prose > p,
.post .prose > ul,
.post .prose > ol,
.post .prose > h2,
.post .prose > h3,
.post .prose > blockquote,
.post .prose > li,
.post .prose > div,
.post .prose > nav,
.post .prose > table,
.post .prose > pre,
.post .prose > .highlighter-rouge {
  max-width: 100%;
}

.prose > h2 {
  margin: 2rem 0 0.75rem;
  color: var(--heading);
  font-size: 2rem;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.prose:has(.mermaid-row),
.prose:has(.mermaid-wide),
.prose:has(.mermaid) {
  max-width: 100%;
}

.mermaid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
  width: 100%;
}

.mermaid-panel h2,
.mermaid-panel h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--text);
}

.mermaid-panel .playcard {
  margin: 0;
}

.mermaid-panel .mermaid {
  max-width: none;
  margin: 0;
  padding-top: 0.5rem;
}

.mermaid-wide {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0 2rem;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.mermaid-wide .mermaid {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.mermaid {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

.post .mermaid,
.post .mermaid-wide {
  max-width: 100%;
}

.mermaid svg {
  display: block;
  height: auto;
  max-width: 100%;
  font-size: 15px !important;
}

.mermaid svg .nodeLabel,
.mermaid svg .label,
.mermaid svg .edgeLabel,
.mermaid svg .label text,
.mermaid svg .cluster-label {
  font-size: 15px !important;
  font-family: Inter, sans-serif !important;
}

.mermaid svg .node rect,
.mermaid svg .node polygon,
.mermaid svg .node circle {
  stroke-width: 1.5px;
}

.intro {
  margin: 22px 0 0;
}

.page-header {
  padding: 56px 0 24px;
}

.post-list {
  width: min(100%, 720px);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.post-card,
.empty-state,
.post {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.post-card {
  padding: 22px 24px;
}

.post-card h2 {
  font-size: 2rem;
  line-height: 1;
  margin-top: 4px;
}

.post-card h2 a {
  text-decoration: none;
}

.post-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.empty-state,
.post {
  padding: 28px;
}

.prose {
  margin-top: 24px;
}

.prose a {
  color: #1a5fb4;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.prose a:hover {
  color: #0d3d7a;
}

.prose table {
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  text-align: left;
  vertical-align: top;
}

.prose th:not(:first-child),
.prose td:not(:first-child) {
  text-align: right;
}

.prose th {
  background: rgba(0, 0, 0, 0.04);
  color: var(--heading);
  font-weight: 600;
}

.prose tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95em;
}

.prose code.file-ref {
  color: #0bbbd6;
  font-weight: 600;
}

.prose a code.file-ref {
  color: #0bbbd6;
}

.prose a:hover code.file-ref {
  color: #0797ad;
}

.prose .playcard,
.prose pre.playcard,
.prose .highlighter-rouge.playcard {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem;
  background: #0a0a0a;
  color: #f2f2f2;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose .highlighter-rouge.playcard {
  padding: 0;
}

.prose .highlighter-rouge.playcard .highlight,
.prose .highlighter-rouge.playcard .highlight pre {
  margin: 0;
  padding: 1rem 1.15rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-x: visible;
}

.prose .playcard code,
.prose pre.playcard code {
  display: block;
  color: #f2f2f2;
  background: transparent;
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
  font-size: 0.82rem;
  line-height: 1.55;
}

.prose .playcard .highlight code,
.prose .playcard .highlight code span {
  color: #f2f2f2;
}

.prose .report-links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prose .report-links li {
  max-width: none;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 18px;
  }

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

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 18px;
  }

  .topbar-links {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 56px;
  }

  .hero h1 {
    white-space: normal;
  }

  .post-card,
  .empty-state,
  .post {
    border-radius: 20px;
    padding: 22px;
  }
}
