:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #526159;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --accent: #075f4a;
  --accent-dark: #034638;
  --line: #cbd5ce;
  --focus: #c44308;
  --code: #101b17;
  --soft-accent: #eef5f1;
  --shadow: 0 .7rem 1.8rem rgb(23 33 27 / 8%);
  --measure: 72rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: var(--accent-dark); text-underline-offset: .2em; text-decoration-thickness: .1em; }
a:hover { text-decoration-thickness: .16em; }
:focus-visible { outline: .2rem solid var(--focus); outline-offset: .2rem; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; top: .5rem; left: .5rem; z-index: 10; padding: .65rem 1rem;
  color: #fff; background: var(--ink); transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header, main, .site-footer { width: min(100% - 2rem, var(--measure)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.site-header__intro { display: flex; align-items: baseline; gap: 1rem; }
.site-header p { margin: 0; color: var(--muted); }
.brand { color: var(--ink); font-size: 1.65rem; font-weight: 850; letter-spacing: -.04em; text-decoration: none; }
.brand span, .eyebrow { color: var(--accent); }
.site-nav, .footer-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1rem; }
.site-nav a, .footer-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 700; }

.hero { max-width: 54rem; padding-block: clamp(2.75rem, 7vw, 5.5rem); }
.eyebrow { margin: 0 0 .65rem; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { line-height: 1.12; letter-spacing: -.035em; }
h1 { max-width: 14ch; margin: 0; font-size: clamp(2.35rem, 6.5vw, 5rem); }
h2 { margin-block: 0 1rem; font-size: clamp(1.6rem, 4vw, 2.35rem); }
.lede { max-width: 44rem; margin-block: 1.25rem 1.75rem; color: var(--muted); font-size: clamp(1.08rem, 2.2vw, 1.3rem); }

.search { max-width: 44rem; }
.search label { display: block; margin-bottom: .4rem; font-weight: 750; }
.search__controls { display: flex; gap: .65rem; }
input, button, .button-link { min-height: 2.75rem; border: 2px solid var(--ink); border-radius: .25rem; font: inherit; }
input { min-width: 0; flex: 1; padding: .55rem .75rem; color: var(--ink); background: var(--surface); }
input::placeholder { color: #68776f; opacity: 1; }
button, .button-link { padding: .55rem 1rem; color: #fff; background: var(--accent); font-weight: 750; cursor: pointer; }
button:hover, .button-link:hover { background: var(--accent-dark); }
.button-link { display: inline-flex; align-items: center; text-decoration: none; }
.hint, .status { color: var(--muted); }
.hint { margin: .35rem 0 0; font-size: .9rem; }
.text-button { min-height: auto; padding: .3rem; border: 0; color: var(--accent-dark); background: transparent; text-decoration: underline; }

.content-section { padding-block: 2.5rem 4rem; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading .eyebrow { margin-bottom: .35rem; }
.section-heading p { color: var(--muted); }
.topic-list, .tag-list { display: flex; flex-wrap: wrap; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.topic-list a, .tag-list a {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: .45rem .8rem;
  border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface); font-weight: 700; text-decoration: none;
}
.topic-list a:hover, .tag-list a:hover { border-color: var(--accent); background: var(--soft-accent); }
.topic-count { min-width: 1.55rem; padding-inline: .35rem; border-radius: 999px; color: var(--muted); background: var(--soft-accent); font-size: .8rem; text-align: center; }
.tag-list { gap: .45rem; margin-top: 1.2rem; }
.tag-list a { min-height: 2.25rem; padding: .25rem .65rem; color: var(--accent-dark); font-size: .85rem; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; padding: 0; list-style: none; }
.post-card { display: flex; flex-direction: column; padding: 1.3rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.post-card:hover { border-color: #9aaba1; box-shadow: var(--shadow); transform: translateY(-.15rem); }
.post-card > a { display: flex; flex: 1; flex-direction: column; color: var(--ink); text-decoration: none; }
.post-card > a:hover .post-card__title { text-decoration: underline; text-decoration-thickness: .12em; }
.post-card__title { font-size: 1.2rem; font-weight: 800; line-height: 1.25; }
.post-card__description { margin-top: .55rem; color: var(--muted); }
.post-card__cta { margin-top: auto; padding-top: 1rem; color: var(--accent-dark); font-weight: 800; }
.post-card__cta span { display: inline-block; margin-left: .2rem; }
.post-meta { margin-block: .85rem 0; color: var(--muted); font-size: .9rem; }
.post-meta__category { font-weight: 700; }
.empty-state { padding: 2rem; border: 1px dashed var(--line); background: var(--surface); }

.article-shell { max-width: 54rem; }
.breadcrumb { display: flex; gap: .5rem; padding-block: 1.5rem; color: var(--muted); }
.article-header { padding-block: clamp(1.75rem, 6vw, 4rem); border-bottom: 1px solid var(--line); }
.article-header h1 { max-width: 17ch; font-size: clamp(2.25rem, 6vw, 4.15rem); }
.article-content { max-width: 43rem; padding-block: 1.5rem; }
.article-content section { padding-block: 1.1rem; }
.article-content p, .takeaways li { font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif; font-size: 1.1rem; line-height: 1.75; }
.code-example { margin: 1.5rem 0; }
.code-example figcaption { margin-bottom: .5rem; font-weight: 700; }
pre { max-width: 100%; overflow-x: auto; margin: 0; padding: 1rem; border-radius: .3rem; color: #f4faf6; background: var(--code); line-height: 1.5; tab-size: 2; }
.takeaways { margin-block: 1rem 4rem; padding: clamp(1.25rem, 4vw, 2rem); border-left: .35rem solid var(--accent); background: var(--soft-accent); }
.related { padding-block: 3rem 5rem; border-top: 1px solid var(--line); }
.message-page { min-height: 60vh; padding-block: 8rem; }

.site-footer { padding-block: 2rem 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.author-card { display: grid; grid-template-columns: 12rem minmax(0, 1fr); align-items: center; gap: 1.5rem; width: min(100%, 44rem); margin: 0 0 1.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.author-card img { display: block; width: 100%; height: auto; border-radius: .55rem; }
.author-card figcaption { color: var(--ink); }
.author-card strong, .author-card span { display: block; }
.author-card strong { font-size: 1.15rem; line-height: 1.35; }
.author-card span { margin-top: .55rem; color: var(--muted); }
.footer-nav { padding-top: 1rem; border-top: 1px solid var(--line); }

@media (max-width: 52rem) {
  .site-header { align-items: flex-start; flex-direction: column; gap: .5rem; }
  .site-nav { width: 100%; }
}

@media (max-width: 38rem) {
  .site-header__intro { align-items: flex-start; flex-direction: column; gap: 0; }
  .site-nav { width: 100%; justify-content: space-between; }
  .hero { padding-block: 2.75rem 3.5rem; }
  h1 { font-size: clamp(2.35rem, 12vw, 3.25rem); }
  .article-header h1 { font-size: clamp(2.15rem, 10.5vw, 3rem); }
  .search__controls { align-items: stretch; flex-direction: column; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .section-heading > p { margin-top: 0; }
  .author-card { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; }
  .footer-nav { gap-inline: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .post-card, .takeaways { border: 1px solid CanvasText; }
}
