/* ─── RESET & TOKENS ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --text:     #0f0f14;
  --text-2:   #3c3c50;
  --text-3:   #868699;
  --border:   #e8e8ed;
  --border-md:#d0d0dc;
  --bg:       #ffffff;
  --bg-off:   #f5f5f8;
  --radius:   8px;
  --nav-h:    60px;
  --max-w:    760px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; }

/* ─── READING PROGRESS ─── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--text);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
body.page-post #progress-bar { opacity: 1; }

/* ─── NAVBAR ─── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-sq {
  width: 30px;
  height: 30px;
  background: var(--text);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.nav-logo-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-3);
  padding: 0.35rem 0.65rem;
  border-radius: 5px;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.4rem;
  margin-left: auto;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
/* Animate to X when open */
#nav.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
#nav.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── MOBILE NAV ─── */
@media (max-width: 768px) {
  .nav-inner { padding: 0 1.25rem; gap: 1rem; }
  .nav-logo-name { display: none; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
    gap: 0;
  }
  #nav.nav-open .nav-links { display: flex; }
  .nav-links a {
    padding: 0.7rem 0.5rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: none; }
}

/* ─── MAIN WRAPPER ─── */
#main {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
footer p {
  font-size: 0.8rem;
  color: var(--text-3);
}
footer nav { display: flex; gap: 1.25rem; }
footer nav a {
  font-size: 0.8rem;
  color: var(--text-3);
  transition: color 0.15s;
}
footer nav a:hover { color: var(--text); }

/* ══════════════════════════════════════════
   PAGE 1 — HOME
══════════════════════════════════════════ */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 2.5rem 0;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.dot-green {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}
.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.hero-subtitle {
  font-size: 1rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
  font-weight: 400;
}
.hero-bio {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 2.25rem;
}
.cta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.15s;
  border: 1px solid transparent;
  line-height: 1;
}
.btn:hover { opacity: 0.82; }
.btn-dark {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-md);
}
.btn-ghost:hover { border-color: var(--text-3); }

/* Recent writing */
.recent-writing {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 2.5rem 5rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}
.post-list { list-style: none; }
.post-list-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: none;
}
.post-list-item:first-child { border-top: 1px solid var(--border); }
.post-list-num {
  font-size: 0.78rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.post-list-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s;
  line-height: 1.4;
}
.post-list-item:hover .post-list-title { color: var(--text); }
.post-list-date {
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
}
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-3);
  font-weight: 500;
  transition: color 0.15s;
}
.view-all:hover { color: var(--text); }

/* ══════════════════════════════════════════
   PAGE 2 — BLOG LIST
══════════════════════════════════════════ */
.blog-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2.5rem 2.5rem;
}
.blog-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.blog-header p {
  font-size: 1rem;
  color: var(--text-3);
}
.blog-list {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem 5rem;
}
.blog-card {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  cursor: pointer;
}
.blog-card:last-child { border-bottom: none; margin-bottom: 0; }
.blog-card a { display: block; color: inherit; text-decoration: none; }
.blog-card-img {
  width: 100%;
  aspect-ratio: 2/1;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  display: block;
  background: var(--bg-off);
  overflow: hidden;
}
.blog-card-img-placeholder {
  width: 100%;
  aspect-ratio: 2/1;
  background: var(--bg-off);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.blog-card-body { padding: 1.25rem 0 0; }
.blog-card-meta {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.blog-card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.35;
  transition: color 0.15s;
}
.blog-card:hover h2 { color: var(--text-2); }
.blog-card-desc {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 0.9rem;
}
.tag-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-3);
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.18em 0.55em;
  line-height: 1.5;
}
a.tag { transition: border-color 0.15s; }
a.tag:hover { border-color: var(--border-md); color: var(--text-2); }

/* Pagination */
.pagination {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 2rem 0 1rem;
}

/* ══════════════════════════════════════════
   PAGE 3 — BLOG POST
══════════════════════════════════════════ */
.post-layout {
  max-width: 1020px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  display: grid;
  grid-template-columns: 1fr 216px;
  gap: 4rem;
  align-items: start;
}
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: 1fr; gap: 0; }
}
.post-content-col { min-width: 0; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 2rem;
  font-weight: 500;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }
.post-cat-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.post-title {
  font-size: clamp(1.75rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 1.1rem;
  color: var(--text);
}
.post-lede {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: 1.5rem;
}
.post-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  margin-bottom: 1.75rem;
}
.post-byline-raw {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.18em 0.6em;
  transition: color 0.15s, border-color 0.15s;
}
.post-byline-raw:hover { color: var(--text); border-color: var(--border-md); }
.post-cover {
  width: 100%;
  aspect-ratio: 21/9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  background: var(--bg-off);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Mobile TOC */
.mobile-toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  overflow: hidden;
}
@media (min-width: 1001px) { .mobile-toc { display: none; } }
.mobile-toc summary {
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  background: var(--bg-off);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-toc summary::-webkit-details-marker { display: none; }
.mobile-toc-body { padding: 0.75rem 1rem; }
.mobile-toc-body a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-2);
  padding: 0.3rem 0;
  transition: color 0.15s;
}
.mobile-toc-body a:hover { color: var(--text); }
.mobile-toc-body a.h3-link { padding-left: 1rem; font-size: 0.8rem; color: var(--text-3); }

/* PROSE */
.prose {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #1c1c2e;
  letter-spacing: 0.01em;
}
.prose > p,
.prose > ul,
.prose > ol,
.prose > blockquote,
.prose > h2,
.prose > h3 {
  max-width: 660px;
}
.prose > p:has(> img:only-child) { max-width: 100%; }
.prose p { margin-bottom: 1.5rem; }
.prose img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0.5rem 0;
}
.prose h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  letter-spacing: 0;
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: 0;
}
.prose a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--border-md);
  transition: text-decoration-color 0.15s;
}
.prose a:hover { text-decoration-color: var(--text-3); }
.prose strong { font-weight: 600; }
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.prose li { margin-bottom: 0.35rem; }
.prose blockquote {
  border-left: 2px solid #aaa;
  padding-left: 1.25rem;
  color: var(--text-2);
  font-style: italic;
  margin: 1.75rem 0;
}
.prose :not(pre) > code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  background: var(--bg-off);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: var(--text);
}
.prose pre {
  background: #0f0f18;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  overflow-x: auto;
  position: relative;
}
.prose pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: #c8d3f5;
  line-height: 1.75;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}
.code-wrap { position: relative; }
.code-wrap:hover .copy-btn { opacity: 1; }
.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #c8d3f5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(255,255,255,0.18); }

/* TABLE */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 2rem 0;
}
.prose table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.prose th {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.65rem 1rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg-off);
  white-space: nowrap;
  text-align: left;
}
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.prose tr:last-child td { border-bottom: none; }
.prose tr:hover td { background: var(--bg-off); }

/* MERMAID */
.mermaid-wrap {
  height: 260px;
  overflow: hidden;
  cursor: pointer;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.15s;
}
.mermaid-wrap:hover { border-color: var(--border-md); }
.mermaid-wrap svg {
  max-height: 240px;
  width: auto;
  height: auto;
}
.mermaid-toolbar {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.mermaid-wrap:hover .mermaid-toolbar { opacity: 1; }
.mermaid-tool-btn {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.7rem;
  padding: 0.22rem 0.55rem;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.mermaid-tool-btn:hover { background: var(--text); color: #fff; border-color: var(--text); }

/* Hidden mermaid source element */
.mermaid-src { display: none; }

/* POST FOOTER */
.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.post-footer-tags-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}
.post-nav-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s;
  display: block;
}
.post-nav-item:hover { border-color: var(--border-md); }
.post-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.post-nav-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.4;
}
.post-nav-item.next { text-align: right; }

/* TOC SIDEBAR */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}
@media (max-width: 1000px) { .toc-sidebar { display: none; } }
.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.toc-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toc-toggle {
  background: none;
  border: none;
  font-size: 0.7rem;
  color: var(--text-3);
  padding: 0;
  cursor: pointer;
  line-height: 1;
}
.toc-nav {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}
.toc-nav a {
  display: block;
  font-size: 0.8rem;
  color: var(--text-3);
  padding: 0.28rem 0;
  line-height: 1.35;
  transition: color 0.15s;
}
.toc-nav a:hover { color: var(--text); }
.toc-nav a.active {
  color: var(--text);
  font-weight: 600;
}
.toc-nav a.h3-toc { padding-left: 0.85rem; font-size: 0.75rem; }
.toc-nav.collapsed { display: none; }

/* ══════════════════════════════════════════
   PAGE 4 — LINKS
══════════════════════════════════════════ */
.links-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2.5rem 2.5rem;
}
.links-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.links-header p { font-size: 1rem; color: var(--text-3); }
.links-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem 5rem;
}
.links-group { margin-bottom: 2.5rem; }
.links-group-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}
.link-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: border-color 0.15s;
  text-decoration: none;
  color: inherit;
}
.link-row:hover { border-color: var(--border-md); }
.link-icon {
  width: 30px;
  height: 30px;
  background: var(--bg-off);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.link-info { flex: 1; min-width: 0; }
.link-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  display: block;
}
.link-handle {
  font-size: 0.78rem;
  color: var(--text-3);
  display: block;
  margin-top: 0.1rem;
}
.link-arrow {
  color: var(--text-3);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   PAGE 5 — APPOINTMENT
══════════════════════════════════════════ */
.appt-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2.5rem 2.5rem;
}
.appt-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.appt-header p {
  font-size: 1rem;
  color: var(--text-3);
  max-width: 520px;
  line-height: 1.6;
}
.appt-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.appt-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.appt-card:hover {
  border-color: var(--border-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.appt-card-top { flex: 1; }
.appt-duration {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2em 0.6em;
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
}
.appt-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}
.appt-desc {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
}
.appt-btn {
  display: block;
  text-align: center;
  background: var(--text);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  transition: opacity 0.15s;
}
.appt-btn:hover { opacity: 0.82; }

/* ══════════════════════════════════════════
   DIAGRAM ZOOM MODAL
══════════════════════════════════════════ */
#zoom-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
#zoom-modal.open { display: flex; }
.zoom-panel {
  width: 88vw;
  height: 82vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.zoom-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 28px;
  height: 28px;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 10;
  color: var(--text-2);
  transition: background 0.1s;
}
.zoom-close:hover { background: var(--border); }
.zoom-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: grab;
  background: #fafafa;
}
.zoom-viewport:active { cursor: grabbing; }
.zoom-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zoom-toolbar {
  height: 48px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 1rem;
  flex-shrink: 0;
}
.zoom-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  min-width: 2.2rem;
  text-align: center;
  transition: background 0.1s, color 0.1s;
}
.zoom-btn:hover { background: var(--bg-off); }
.zoom-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.25rem;
}
#zoom-scale-label {
  font-size: 0.78rem;
  color: var(--text-3);
  min-width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* ══════════════════════════════════════════
   PROSE IMAGE CAPTION
══════════════════════════════════════════ */
.prose-img-wrap {
  max-width: 100%;
  margin-bottom: 1.5rem;
}
.img-caption {
  display: block;
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* ══════════════════════════════════════════
   Hugo syntax highlighting — dracula inline styles override
══════════════════════════════════════════ */
.prose pre { position: relative; }
.prose .chroma { background: #0f0f18; }
