/* Blog theme. Colours and fonts come from the client's own site (profile.json brand). */
:root {
  --bg: #07120c;
  --surface: #0b1f15;
  --text: #e6efe8;
  --muted: #8e9a90;
  --primary: #5cbf8d;
  --accent: #7ed6a6;
  --on-primary: #111111;
  --link: #5cbf8d;
  --line: color-mix(in srgb, var(--text) 14%, var(--bg));
  --soft: color-mix(in srgb, var(--primary) 8%, var(--bg));
  --head: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --radius: 10px;
  --wrap: 1180px;
  --narrow: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.65 var(--body);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: calc(var(--narrow) + 40px); }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--on-primary); padding: 10px 14px; z-index: 10; }
.skip:focus { left: 12px; top: 12px; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top__in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand__logo { max-height: 40px; width: auto; }
.brand__icon { width: 28px; height: 28px; margin-right: 10px; }
.brand__name { font: 800 1.15rem/1 var(--head); letter-spacing: -0.01em; }
.top__nav { display: flex; gap: 22px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.top__nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; white-space: nowrap; padding: 6px 0; }
.top__nav a:hover, .top__nav a[aria-current] { color: var(--text); }
.btn {
  display: inline-block; background: var(--primary); color: var(--on-primary); text-decoration: none;
  font: 600 1rem/1 var(--body); padding: 14px 20px; border-radius: var(--radius); white-space: nowrap;
  transition: filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn--sm { padding: 10px 14px; font-size: 0.9rem; }
@media (max-width: 760px) {
  .top { position: static; }
  .top__in { flex-wrap: wrap; gap: 10px 16px; padding-top: 10px; padding-bottom: 10px; }
  .top__nav { order: 3; width: 100%; margin-left: 0; gap: 18px; }
  .top .btn--sm { margin-left: auto; }
}

/* index */
.kicker { font: 600 0.8rem/1.2 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary); margin: 0 0 12px; }
.intro { padding: 56px 0 28px; }
.intro__title { font: 800 clamp(2rem, 4.6vw, 3.4rem)/1.05 var(--head); letter-spacing: -0.02em; margin: 0 0 14px; max-width: 18ch; }
.intro__lead { color: var(--muted); max-width: 56ch; margin: 0; font-size: 1.125rem; }
.meta { color: var(--muted); font-size: 0.875rem; margin: 0 0 8px; }

.feature {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 12px 0 40px;
}
.feature__img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; }
.feature__body { padding: clamp(22px, 3.4vw, 44px); align-self: center; }
.feature__title { font: 800 clamp(1.5rem, 2.6vw, 2.2rem)/1.12 var(--head); letter-spacing: -0.015em; margin: 0 0 12px; }
.feature__excerpt { color: var(--muted); margin: 0 0 18px; }
.more { font-weight: 600; color: var(--link); }
.more::after { content: " \2192"; }
.feature:hover .feature__title, .card:hover .card__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 36px 28px; padding-bottom: 56px; }
.card { text-decoration: none; color: inherit; display: block; }
.card__img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; }
.card__title { font: 800 1.3rem/1.2 var(--head); letter-spacing: -0.01em; margin: 0 0 8px; }
.card__excerpt { color: var(--muted); margin: 0; font-size: 0.98rem; }
.empty { padding: 40px 20px 80px; color: var(--muted); }
.pager { display: flex; gap: 8px; padding-bottom: 64px; }
.pager a { min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.pager a[aria-current] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* post */
.post__head { padding-top: 40px; }
.crumbs { font-size: 0.875rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.post__title { font: 800 clamp(2rem, 4.4vw, 3.1rem)/1.08 var(--head); letter-spacing: -0.02em; margin: 0 0 14px; }
.post__hero { margin: 26px auto 34px; }
.post__hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); }

.prose { font-size: 1.125rem; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose h2 { font: 800 clamp(1.45rem, 2.4vw, 1.8rem)/1.2 var(--head); letter-spacing: -0.012em; margin: 2em 0 0; }
.prose h3 { font: 700 1.25rem/1.3 var(--head); margin: 1.6em 0 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--primary); }
.prose strong { font-weight: 650; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.98rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 650; background: var(--soft); }
.prose img { border-radius: var(--radius); }

.faq { margin-top: 56px; }
.faq h2, .sources h2, .related h2 { font: 800 1.6rem/1.2 var(--head); letter-spacing: -0.012em; margin: 0 0 16px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 32px 18px 0; font-weight: 650; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.4rem; color: var(--primary); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 18px; color: var(--muted); }

.cta { margin-top: 48px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.cta__title { font: 800 1.4rem/1.2 var(--head); margin: 0 0 8px; }
.cta__body { margin: 0 0 18px; color: var(--muted); }

.credit { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
.credit a { color: inherit; }
.takeaways { margin-top: 32px; margin-bottom: 8px; padding: 22px 26px; background: var(--soft);
  border-left: 4px solid var(--primary); border-radius: 6px; }
.takeaways h2 { font: 800 1.1rem/1.2 var(--head); margin: 0 0 10px; }
.takeaways ul { margin: 0; padding-left: 1.2em; }
.takeaways li { margin: 6px 0; }
.toc { margin-top: 24px; font-size: 0.95rem; }
.toc__title { font-weight: 700; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 1.3em; color: var(--muted); }
.toc a { color: var(--text); }
.prose h2 { scroll-margin-top: 24px; }

.sources { margin-top: 48px; font-size: 0.9rem; color: var(--muted); }
.sources h2 { font-size: 1.1rem; }
.sources a { color: var(--muted); word-break: break-word; }
.related { margin-top: 72px; border-top: 1px solid var(--line); padding-top: 48px; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 40px 0 28px; background: var(--surface); }
.foot__in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot__name { font: 800 1.1rem/1.2 var(--head); margin: 0 0 6px; }
.foot__line { color: var(--muted); margin: 0; max-width: 44ch; font-size: 0.95rem; }
.foot__links { list-style: none; padding: 0; margin: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.foot__links a { color: var(--muted); }
.foot__copy { color: var(--muted); font-size: 0.85rem; margin-top: 28px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }