:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1f2328;
  --muted: #5d636b;
  --line: #e3e0d8;
  --accent: #b83232;
  --accent-ink: #ffffff;
  --green: #2e7d3a;
  --head-bg: #1f2328;
  --head-ink: #f4f2ee;
  --bar-bg: #f1ece1;
  --mark: #fff1a8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1c1f23;
    --ink: #e8e6e1;
    --muted: #a3a8ae;
    --line: #2f3338;
    --accent: #ef7b72;
    --accent-ink: #15171a;
    --green: #74c07f;
    --head-bg: #0e1012;
    --head-ink: #f4f2ee;
    --bar-bg: #23262a;
    --mark: #5b4f12;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); overflow-wrap: break-word; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* archive notice + header */
.archive-bar { background: var(--bar-bg); color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line); }
.archive-bar .wrap { padding-top: .45rem; padding-bottom: .45rem; }
.archive-bar strong { color: var(--ink); font-weight: 600; }
.site-header { background: var(--head-bg); color: var(--head-ink); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .8rem; padding-bottom: .8rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; min-width: 0; }
.brand img { flex: none; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 800; letter-spacing: .08em; font-size: 1.15rem; }
.brand-sub { font-size: .78rem; opacity: .8; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; flex-wrap: wrap; gap: .1rem .3rem; align-items: center; }
.main-nav a, .main-nav summary { color: var(--head-ink); text-decoration: none; font-size: .95rem; padding: .35rem .55rem; border-radius: 6px; display: block; cursor: pointer; }
.main-nav a:hover, .main-nav summary:hover, .main-nav details[open] summary { background: rgba(255, 255, 255, .1); }
.main-nav summary { list-style: none; }
.main-nav summary::-webkit-details-marker { display: none; }
.main-nav summary::after { content: " ▾"; font-size: .75em; opacity: .7; }
.has-sub { position: relative; }
.has-sub ul { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 17rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.has-sub ul a { color: var(--ink); font-size: .92rem; }
.has-sub ul a:hover { background: var(--bg); }
@media (max-width: 760px) {
  .brand-sub { display: none; }
  .main-nav { width: 100%; }
  .main-nav > ul { gap: 0; }
  .has-sub { position: static; }
  .has-sub ul { left: 16px; right: 16px; min-width: 0; }
}

main { padding-top: 2rem; padding-bottom: 3rem; }

/* home */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 2.5rem; align-items: start; padding: 1rem 0 2rem; border-bottom: 1px solid var(--line); }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--green); font-weight: 700; margin: 0 0 .5rem; }
.intro h1 { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.1; margin: 0 0 1rem; letter-spacing: -.01em; }
.lead { font-size: 1.12rem; color: var(--ink); max-width: var(--measure); }
.intro-facts dl { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; }
.intro-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: .7rem; }
.intro-facts dt:first-child { margin-top: 0; }
.intro-facts dd { margin: .1rem 0 0; font-weight: 600; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.4rem; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; padding: .6rem 1.1rem; border-radius: 8px; font-weight: 600; border: 2px solid var(--accent); }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); }
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.topics h2, .section-title, .related h2, .archive-side h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 .8rem; }
.topics ul { margin: 0; padding: 0; list-style: none; }
.topics li { border-top: 1px solid var(--line); }
.topics li a { display: block; padding: .55rem 0; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 1.08rem; }
.topics li a:hover { color: var(--accent); }
.latest { padding-top: 2rem; }
.more { text-align: center; margin-top: 2rem; }
@media (max-width: 760px) {
  .intro, .topics { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1.4rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.card-img { display: block; aspect-ratio: 16 / 9; background: var(--bar-bg); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 1rem 1.15rem 1.2rem; }
.card-title { font-family: var(--serif); font-size: 1.28rem; line-height: 1.25; margin: .2rem 0 .5rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); text-decoration: underline; }
.card-excerpt { color: var(--muted); margin: 0; font-size: .95rem; }
.meta { color: var(--muted); font-size: .85rem; margin: 0; }
.meta a { color: var(--muted); }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green); border: 1px solid currentColor; border-radius: 4px; padding: 0 .35rem; vertical-align: 1px; }

/* listings */
.listing-header { margin-bottom: 1.6rem; }
.listing-header h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0; line-height: 1.15; }
.listing-header h1 span { display: block; font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .3rem; }
.count { color: var(--muted); font-size: .9rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2.2rem; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }

/* single */
.entry { max-width: var(--measure); margin: 0 auto; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .8rem; }
.crumbs a { color: var(--muted); }
.entry-header h1 { font-family: var(--serif); font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.15; margin: 0 0 .6rem; letter-spacing: -.01em; }
.entry-header { margin-bottom: 1.6rem; }
.hero { margin: 0 0 1.8rem; }
.hero img { border-radius: 10px; display: block; margin: 0 auto; max-height: 30rem; width: auto; }
.prose { font-family: var(--serif); font-size: 1.14rem; line-height: 1.72; }
.prose h2, .prose h3, .prose h4 { font-family: var(--sans); line-height: 1.3; margin: 2em 0 .6em; }
.prose h2 { font-size: 1.35rem; }
.prose h3 { font-size: 1.15rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--accent); color: var(--muted); }
.prose img { border-radius: 6px; display: block; margin: 1em auto; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); text-align: center; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .92rem; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: .45rem .6rem; vertical-align: top; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose .has-text-align-center, .prose .aligncenter { text-align: center; }
.prose .has-drop-cap::first-letter { float: left; font-size: 3.4em; line-height: .9; padding: .06em .08em 0 0; color: var(--accent); }
.prose code { font-size: .88em; background: var(--bar-bg); padding: .1em .3em; border-radius: 4px; }
.embed { position: relative; margin: 1.5em 0; aspect-ratio: 16 / 9; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; background: var(--bar-bg); }
.embed-chart { aspect-ratio: auto; height: 540px; }
.embed-quote { font-family: var(--sans); font-size: .95rem; }
.tags { font-size: .9rem; margin: 2rem 0 0; }
.tags span { color: var(--muted); }
.tags a { margin-right: .5rem; }
.provenance { margin-top: 2rem; padding: .9rem 1.1rem; background: var(--bar-bg); border-radius: 10px; font-size: .88rem; color: var(--muted); }
.provenance p { margin: 0; }
.post-nav { max-width: var(--measure); margin: 2.5rem auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.post-nav a { display: block; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--surface); font-family: var(--serif); }
.post-nav a:hover { border-color: var(--accent); }
.post-nav a span { display: block; font-family: var(--sans); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.post-nav a[rel=next] { text-align: right; }
.related { max-width: var(--measure); margin: 2.5rem auto 0; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { border-top: 1px solid var(--line); padding: .6rem 0; }
.related a { font-family: var(--serif); font-size: 1.05rem; }
.related time { color: var(--muted); font-size: .82rem; margin-left: .3rem; white-space: nowrap; }
@media (max-width: 560px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a[rel=next] { text-align: left; }
  .prose { font-size: 1.08rem; }
}

/* archive */
.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 3rem; }
.year h2 { font-family: var(--serif); font-size: 1.6rem; margin: 1.8rem 0 .6rem; }
.year h2 span { font-family: var(--sans); font-size: .85rem; color: var(--muted); font-weight: 400; }
.year:first-child h2 { margin-top: 0; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.archive-list time { color: var(--muted); font-size: .85rem; padding-top: .15rem; }
.archive-list a { color: var(--ink); text-decoration: none; }
.archive-list a:hover { color: var(--accent); text-decoration: underline; }
.archive-side section { margin-bottom: 2rem; }
.count-list { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.count-list li { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding: .3rem 0; }
.count-list span { color: var(--muted); }
.tag-cloud { line-height: 1.9; font-size: .88rem; }
.tag-cloud a { font-size: calc(.8rem + var(--w) * .08rem); margin-right: .15rem; }
@media (max-width: 860px) { .archive-layout { grid-template-columns: 1fr; } }

/* search */
.search-form { display: flex; gap: .5rem; max-width: var(--measure); }
.search-form input { flex: 1; min-width: 0; font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.search-form button { font: inherit; font-weight: 600; padding: .6rem 1.1rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.search-results { padding: 0; list-style: none; max-width: var(--measure); }
.search-results li { border-top: 1px solid var(--line); padding: .9rem 0; }
.search-results a { font-family: var(--serif); font-size: 1.15rem; }
.search-results time { color: var(--muted); font-size: .82rem; margin-left: .4rem; }
.search-results p { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; }
mark { background: var(--mark); color: inherit; }

/* footer */
.site-footer { background: var(--head-bg); color: #c9cdd2; font-size: .9rem; padding: 2.5rem 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 2rem; }
.footer-title { color: #fff; font-weight: 700; margin: 0 0 .5rem; }
.site-footer p { margin: 0 0 .5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .3rem; }
