:root {
  color-scheme: light;
  --bg: #f7fbfa;
  --surface: #ffffff;
  --surface-strong: #eef8f6;
  --ink: #10201d;
  --muted: #58706b;
  --line: #d9e7e4;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #dff5f1;
  --shadow: 0 18px 55px rgba(16, 32, 29, 0.08);
  --measure: 76rem;
  --article: 48rem;
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(217, 231, 228, 0.8);
  background: rgba(247, 251, 250, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.site-nav,
.site-footer nav,
.article-actions,
.tag-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.site-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-footer a:hover {
  color: var(--accent);
}

.site-main {
  min-height: 70vh;
}

.page-shell,
.article-shell {
  width: min(var(--measure), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) 0;
  min-width: 0;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.75fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(2rem, 4vw, 4rem);
  min-width: 0;
}

.home-copy,
.home-media,
.page-prose,
.article-body {
  min-width: 0;
}

.home-copy h1,
.page-prose h1,
.article-header h1 {
  max-width: 13ch;
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.home-copy p {
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
}

.home-copy p:first-of-type {
  color: var(--ink);
  font-weight: 650;
}

.home-copy a[href="/about-me/"],
.article-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.home-copy a[href="/about-me/"]:hover,
.article-actions a:hover {
  background: var(--accent-strong);
}

.home-media {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-media img,
.home-media .td-theme-image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.latest-section {
  margin-top: clamp(2rem, 5vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 3.5rem);
  border-top: 1px solid var(--line);
}

.section-kicker,
.article-kicker,
.post-date {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.latest-section h2 {
  margin: 0 0 1.4rem;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.post-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(16, 32, 29, 0.05);
}

.post-thumb {
  display: block;
  background: var(--surface-strong);
}

.post-thumb img,
.post-thumb .td-theme-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.post-card-body {
  padding: 1rem;
}

.post-card h3 {
  margin: 0.35rem 0 0.55rem;
  font-size: 1.12rem;
  line-height: 1.25;
}

.post-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-card[hidden] {
  display: none;
}

.post-grid.is-collapsed .post-card:nth-child(n+7) {
  display: none;
}

.post-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.post-loader button {
  min-height: 2.7rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.post-loader button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.post-scroll-sentinel {
  height: 1px;
}

.tag-list {
  margin-top: 1rem;
}

.tag-list a {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.tag-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-prose,
.article-body {
  max-width: var(--article);
}

.page-prose {
  margin-top: 2rem;
}

.page-prose h2,
.article-body h2,
.related-posts h2 {
  margin-top: 2.2rem;
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.12;
}

.page-prose h3,
.article-body h3 {
  margin-top: 1.8rem;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.2;
}

.core-topics {
  display: grid;
  grid-template-columns: minmax(17rem, 0.7fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: clamp(1rem, 3vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #eef8f6 100%);
  box-shadow: 0 16px 48px rgba(16, 32, 29, 0.06);
}

.core-topics-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: clamp(1rem, 3vw, 1.35rem);
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
}

.core-topics-copy .section-kicker {
  color: #8ee6da;
}

.core-topics-copy h2 {
  max-width: 11ch;
  margin: 2rem 0 1rem;
  color: #ffffff;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1;
}

.core-topics-copy p {
  margin: 0;
  color: #c9ddda;
  font-size: 1rem;
}

.core-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.core-topic-grid a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  min-height: 5.2rem;
  padding: 0.9rem;
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}

.core-topic-grid a:hover {
  border-color: var(--accent);
  background: #ffffff;
  color: var(--accent);
}

.core-topic-grid span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.about-proof,
.about-split,
.coffee-lab,
.award-band,
.cert-cloud {
  margin-top: clamp(2rem, 5vw, 4rem);
}

.about-proof {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  align-items: stretch;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.about-proof h2,
.about-panel h2,
.coffee-copy h2,
.award-band h2,
.cert-cloud h2 {
  margin: 0.35rem 0 0.85rem;
  color: var(--ink);
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1;
}

.about-proof p,
.coffee-copy p,
.award-band p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.about-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.about-metric-grid div {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.about-metric-grid strong {
  display: block;
  color: var(--accent);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1;
}

.about-metric-grid span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.25;
}

.about-split {
  display: grid;
  grid-template-columns: minmax(16rem, 0.55fr) minmax(0, 1fr);
  gap: 1rem;
}

.about-panel {
  padding: clamp(1rem, 3vw, 1.35rem);
  border-radius: var(--radius);
  background: var(--ink);
}

.about-panel h2 {
  color: #ffffff;
}

.about-panel .section-kicker {
  color: #8ee6da;
}

.about-capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.about-capability-grid div,
.cert-grid a,
.cert-item {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.about-capability-grid span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.about-capability-grid strong,
.cert-grid strong,
.cert-item strong {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.2;
}

.about-capability-grid p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.coffee-lab {
  display: grid;
  grid-template-columns: minmax(16rem, 0.54fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.coffee-copy {
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #eef8f6 100%);
}

.coffee-chart {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.coffee-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.coffee-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--level);
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.18), rgba(15, 118, 110, 0.04));
}

.coffee-row span,
.coffee-row strong {
  position: relative;
  z-index: 1;
}

.coffee-row span {
  color: var(--ink);
  font-weight: 850;
}

.coffee-row strong {
  color: var(--accent);
  white-space: nowrap;
}

.coffee-total {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--ink);
}

.coffee-total strong {
  color: #ffffff;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.coffee-total span {
  color: #c9ddda;
  font-weight: 700;
  line-height: 1.35;
}

.award-band {
  display: grid;
  grid-template-columns: minmax(13rem, 0.45fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 1.4rem);
  align-items: center;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.award-band img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.cert-cloud {
  display: grid;
  grid-template-columns: minmax(16rem, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding-top: clamp(1rem, 3vw, 1.5rem);
  border-top: 1px solid var(--line);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.cert-grid a {
  color: var(--ink);
  text-decoration: none;
}

.cert-grid a:hover {
  border-color: var(--accent);
}

.cert-grid a > span,
.cert-item span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.page-prose p,
.article-body p,
.article-body li,
.page-prose li {
  color: #263b37;
  font-size: 1.03rem;
}

.article-shell {
  width: min(60rem, calc(100% - 2rem));
}

.article-header {
  max-width: var(--article);
  margin: 0 auto 2rem;
}

.article-header h1 {
  max-width: 15ch;
  font-size: clamp(2.2rem, 6vw, 4.7rem);
}

.article-header p {
  color: var(--muted);
  font-size: 1.14rem;
}

.article-media {
  max-width: 58rem;
  margin: 0 auto 2.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.article-media img,
.article-media .td-theme-image img {
  width: 100%;
  max-height: 34rem;
  object-fit: cover;
}

.article-body {
  margin: 0 auto;
}

.article-body blockquote,
.page-prose blockquote {
  margin: 1.5rem 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.article-body table,
.page-prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.article-body th,
.article-body td,
.page-prose th,
.page-prose td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body th,
.page-prose th {
  background: var(--surface-strong);
  color: var(--ink);
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1f1d;
  color: #e6fffb;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.55;
}

code {
  font-family: var(--mono);
}

:not(pre) > code {
  padding: 0.12rem 0.28rem;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.92em;
}

.related-posts {
  max-width: var(--article);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.related-posts ul,
.post-list {
  padding: 0;
  list-style: none;
}

.related-posts li,
.post-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.site-footer strong,
.site-footer span {
  display: block;
}

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

@media (max-width: 56rem) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-hero,
  .post-grid,
  .core-topics,
  .core-topic-grid,
  .about-proof,
  .about-split,
  .about-capability-grid,
  .coffee-lab,
  .award-band,
  .cert-cloud,
  .cert-grid {
    grid-template-columns: 1fr;
  }

  .about-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-copy h1,
  .page-prose h1,
  .article-header h1 {
    max-width: 16ch;
  }
}

@media (max-width: 34rem) {
  .page-shell,
  .article-shell {
    width: min(100% - 1rem, var(--measure));
  }

  .site-header,
  .site-footer {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .home-copy h1,
  .page-prose h1,
  .article-header h1 {
    font-size: clamp(2.15rem, 15vw, 3.4rem);
  }

  .about-metric-grid {
    grid-template-columns: 1fr;
  }

  .coffee-row,
  .coffee-total {
    grid-template-columns: 1fr;
  }

  .coffee-row strong {
    white-space: normal;
  }
}
