@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  --ink: #142019;
  --muted: #5a6b60;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #d7 rec0d0;
  --line: #d5ddd6;
  --brand: #1f6b45;
  --brand-dark: #0e3f28;
  --brand-soft: #e5f0e9;
  --accent: #b5541e;
  --accent-soft: #f6e6db;
  --warn: #8a3b12;
  --tip: #1f6b45;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(20, 32, 25, 0.07);
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% 0%, #dceadf 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #f0e0d2 0%, transparent 50%),
    linear-gradient(180deg, #f7f3ea 0%, var(--paper) 40%, #efe9de 100%);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }
.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--brand); color: #fff; padding: .55rem 1rem; z-index: 40;
}
.skip:focus { left: 1rem; top: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(243, 239, 230, 0.88);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--brand-dark);
}
.brand-logo {
  width: 42px; height: 42px; object-fit: contain;
  border-radius: 10px; background: #fff;
  box-shadow: 0 1px 0 rgba(20,32,25,.06);
}
.brand-text { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.top-nav { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.top-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.top-nav a:hover { color: var(--brand); }
.btn-support {
  background: var(--brand) !important; color: #fff !important;
  padding: .45rem .85rem; border-radius: 999px; text-decoration: none !important;
}
.btn-support:hover { background: var(--brand-dark) !important; }

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 0 3rem;
  align-items: start;
}
.sidebar { position: sticky; top: 5rem; display: grid; gap: 1rem; }
.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.side-card.soft { background: var(--brand-soft); border-color: #c7dbcff; border-color: #c7dbcf; }
.side-card h2 { margin: 0 0 .7rem; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-dark); }
.side-nav { display: grid; gap: .35rem; }
.side-nav a {
  color: var(--ink); text-decoration: none; font-size: .92rem;
  padding: .35rem .45rem; border-radius: 8px;
}
.side-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.back { display: inline-block; margin-bottom: .75rem; font-weight: 600; text-decoration: none; }
.side-cat { margin: 0 0 .8rem; color: var(--muted); font-size: .92rem; }

.hero {
  padding: 1.7rem 1.5rem 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  color: #f4faf6;
  background:
    linear-gradient(135deg, rgba(14,63,40,.2), transparent 40%),
    linear-gradient(145deg, #0f3f28 0%, #1f6b45 48%, #3b6d4f 100%);
  box-shadow: var(--shadow);
  margin-bottom: 1.4rem;
}
.eyebrow {
  margin: 0 0 .35rem; text-transform: uppercase; letter-spacing: .12em;
  font-size: .75rem; font-weight: 600; opacity: .85;
}
.hero h1 {
  margin: 0 0 .55rem;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.lede { margin: 0 0 1.1rem; max-width: 40rem; opacity: .95; }
.search input {
  width: 100%; border: 0; border-radius: 999px;
  padding: .95rem 1.2rem; font: inherit;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
}
.search input:focus { outline: 3px solid #efc7a8; }

.section-label {
  font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem;
}
.popular { margin-bottom: 1.8rem; }
.popular-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.popular-card {
  display: grid; gap: .35rem; align-content: start;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .95rem 1rem;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  min-height: 8.5rem; transition: transform .15s ease, border-color .15s ease;
}
.popular-card:hover { transform: translateY(-2px); border-color: #b9cbbf; }
.popular-card strong { font-size: 1rem; line-height: 1.3; color: var(--ink); }
.popular-card .sum { color: var(--muted); font-size: .88rem; }

.cat { margin: 1.6rem 0 0; }
.cat-head { margin-bottom: .8rem; }
.cat-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--brand-dark);
}
.cat-blurb { margin: .25rem 0 0; color: var(--muted); }
.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.article-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
}
.article-list a {
  display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap;
  text-decoration: none; color: var(--ink); font-weight: 650;
}
.article-list .title { font-size: 1.02rem; }
.article-list a:hover .title { color: var(--brand); }
.kid {
  flex: 0 0 auto;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: .18rem .55rem;
}
.sum { margin: .4rem 0 0; color: var(--muted); font-size: .93rem; }

.crumbs { font-size: .9rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

.article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.article-header {
  padding: 1.45rem 1.45rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #fbf8f1 0%, var(--card) 100%);
}
.pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.pill {
  font-size: .75rem; font-weight: 700; letter-spacing: .03em;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: .2rem .6rem;
}
.muted-pill { background: var(--brand-soft); color: var(--brand-dark); }
.article-header h1 {
  margin: 0 0 .55rem;
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
}
.deck { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 42rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .85rem; }
.tag {
  font-size: .75rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: .15rem .55rem;
}

.article-body { padding: 1.2rem 1.45rem 1.8rem; }
.article-body h2 {
  margin: 1.8rem 0 .7rem;
  font-family: var(--display);
  font-size: 1.28rem;
  color: var(--brand-dark);
  scroll-margin-top: 5.5rem;
}
.article-body h2:first-child { margin-top: .4rem; }
.article-body h3 { margin: 1.2rem 0 .45rem; font-size: 1.05rem; }
.article-body p { margin: 0 0 .85rem; }
.article-body ul, .article-body ol { margin: 0 0 1rem; padding-left: 1.2rem; }
.article-body li { margin: .28rem 0; }
.article-body li.check {
  list-style: none; margin-left: -1.2rem; padding-left: 1.7rem; position: relative;
}
.article-body .box {
  position: absolute; left: 0; top: .25rem;
  width: 1rem; height: 1rem; border-radius: 4px;
  border: 1.5px solid #8aa392; background: #fff;
}
.article-body .box.checked {
  background: var(--brand); border-color: var(--brand);
}
.article-body code {
  font-size: .9em; background: #eef3ef; padding: .1rem .35rem; border-radius: 4px;
}
.table-wrap { overflow-x: auto; margin: 1rem 0 1.2rem; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--line); padding: .7rem .75rem; text-align: left; vertical-align: top; }
th { background: #eef3ef; font-weight: 650; }
tr:last-child td { border-bottom: 0; }

.callout {
  border-radius: 12px; padding: .9rem 1rem; margin: 1rem 0 1.2rem;
  border: 1px solid var(--line);
}
.callout-label {
  font-size: .72rem; font-weight: 750; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: .25rem;
}
.callout p { margin: 0; }
.callout-tip { background: #eaf4ee; border-color: #b9d5c3; }
.callout-tip .callout-label { color: var(--tip); }
.callout-important { background: var(--accent-soft); border-color: #e3bfa4; }
.callout-important .callout-label { color: var(--warn); }
.callout-note { background: #eef2f6; border-color: #c9d3de; }
.callout-note .callout-label { color: #35506b; }

.toc { margin-top: .4rem; }
.toc-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .35rem;
}
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc a { text-decoration: none; color: var(--ink); font-size: .9rem; }
.toc a:hover { color: var(--brand); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.2rem;
  color: var(--muted);
  font-size: .92rem;
  background: rgba(255,253,248,.55);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem;
}
.footer-grid strong { color: var(--brand-dark); }
.muted { opacity: .9; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .popular-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .hero, .article-header, .article-body { padding-left: 1.05rem; padding-right: 1.05rem; }
}
