:root {
  --paper: #efe6cf;
  --paper-2: #e6dabd;
  --sheet: #f8f2e2;
  --ink: #26331f;
  --soil: #5b4331;
  --beet: #8e2c4a;
  --sprout: #6b8f3a;
  --pencil: #6f6857;
  --rule: #cdbf9e;
  --margin-line: #c98a8a;
  --measure: 68ch;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --hand: "Kalam", "Segoe Print", "Bradley Hand", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--serif);
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--beet); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--sprout); outline-offset: 2px; border-radius: 2px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--sheet); padding: 8px 12px; z-index: 9; }
.skip:focus { left: 8px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); font-weight: 750; letter-spacing: -0.015em; margin: 0.2em 0 0.35em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.85rem); font-weight: 600; margin: 2em 0 0.6em; }
h3 { font-size: 1.2rem; font-weight: 600; margin: 1.6em 0 0.4em; }
p { margin: 0 0 1.05em; }

/* Masthead */
.masthead { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.mast-row { display: flex; align-items: center; gap: 20px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand i { font-family: var(--hand); font-style: normal; color: var(--beet); font-weight: 700; }
.search { margin-left: auto; }
.search input {
  font: inherit; font-size: 0.95rem; width: 240px; padding: 7px 12px;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink);
}
.search.big input { width: 100%; font-size: 1.1rem; padding: 12px 14px; }
.menu-btn { display: none; font: inherit; font-size: 0.95rem; background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; color: var(--ink); }
.topics ul { list-style: none; margin: 0; padding: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.95rem; }
.topics a { color: var(--soil); text-decoration: none; }
.topics a:hover { color: var(--beet); text-decoration: underline; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding: 56px 0 24px; }
.hero h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4rem); line-height: 1.05; max-width: 14ch; }
.lede { font-size: 1.15rem; max-width: 56ch; color: var(--soil); }
.hero-fig { margin: 0; }
.hand { font-family: var(--hand); color: var(--pencil); font-size: 1.15rem; line-height: 1.35; margin-top: 6px; transform: rotate(-1.2deg); }
.btn { display: inline-block; background: var(--ink); color: var(--sheet); text-decoration: none; padding: 10px 18px; border-radius: 6px; font-weight: 600; font-size: 0.98rem; margin: 4px 8px 4px 0; }
.btn:hover { background: var(--beet); color: var(--sheet); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--sheet); }

/* Seed packets */
.packets { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 22px; }
.packet {
  --c: var(--sprout);
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--sheet); color: var(--ink); text-decoration: none;
  padding: 26px 16px 16px; border: 1px solid var(--rule);
  clip-path: polygon(0 10px, 5% 0, 10% 10px, 15% 0, 20% 10px, 25% 0, 30% 10px, 35% 0, 40% 10px, 45% 0, 50% 10px, 55% 0, 60% 10px, 65% 0, 70% 10px, 75% 0, 80% 10px, 85% 0, 90% 10px, 95% 0, 100% 10px, 100% 100%, 0 100%);
}
.packet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--c); opacity: 0.85; }
.packet img { width: 100%; max-width: 132px; margin: 6px auto 10px; }
.packet-name { display: block; background: var(--c); color: #fbf6e8; font-weight: 750; font-size: 1.05rem; padding: 6px 10px; margin: 0 -16px 10px; }
.packet-desc { font-size: 0.93rem; line-height: 1.5; color: var(--soil); flex: 1; }
.packet-count { font-family: var(--hand); color: var(--pencil); margin-top: 10px; font-size: 1.05rem; }
a.packet:hover .packet-name { text-decoration: underline; }
.packet.big { width: 170px; flex: none; padding: 22px 6px 6px; }
.packets-sec { padding: 24px 0 8px; }

/* Entries list */
.entries { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 26px; }
.entry h3 { margin: 6px 0 6px; font-size: 1.15rem; line-height: 1.3; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry h3 a:hover { color: var(--beet); text-decoration: underline; }
.entry p { font-size: 0.96rem; line-height: 1.55; margin: 0 0 6px; color: var(--soil); }
.entry-thumb { display: block; background: var(--sheet); padding: 8px 8px 22px; border: 1px solid var(--rule); box-shadow: 0 1px 0 var(--rule); margin-bottom: 12px; }
.meta { font-size: 0.88rem; color: var(--pencil); }
.stamp {
  --c: var(--sprout);
  display: inline-block; font-size: 0.82rem; font-weight: 600; text-decoration: none;
  color: var(--c); border: 1.5px solid var(--c); border-radius: 4px; padding: 1px 8px;
  transform: rotate(-1.5deg);
}
.stamp:hover { background: var(--c); color: #fbf6e8; }

/* Category head */
.cat-head { display: flex; gap: 32px; align-items: center; padding: 40px 0 30px; }
.cat-head .dek { max-width: 56ch; }

/* Article */
.article { padding: 28px 0 40px; }
.crumbs { font-size: 0.9rem; color: var(--pencil); }
.crumbs a { color: var(--pencil); }
.art-head, .prose, .toc, .hero-plate { max-width: var(--measure); }
.dek { font-size: 1.2rem; color: var(--soil); line-height: 1.5; }
@media (min-width: 721px) {
  .is-article .article, .plain { border-left: 1.5px solid var(--margin-line); padding-left: 32px; }
}
.toc { background: var(--sheet); border: 1px solid var(--rule); padding: 10px 18px; margin: 22px 0 8px; font-size: 0.97rem; }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ol { margin: 8px 0 4px; padding-left: 1.3em; }
.prose { position: relative; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.35em; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--sprout); color: var(--soil); font-style: italic; }
.plate { margin: 26px 0; background: var(--sheet); padding: 10px 10px 8px; border: 1px solid var(--rule); }
.plate figcaption { font-family: var(--hand); color: var(--pencil); font-size: 1.08rem; line-height: 1.35; padding: 8px 4px 2px; }
.plate figcaption:empty { display: none; }
.margin-note {
  font-family: var(--hand); color: var(--beet); font-size: 1.1rem; line-height: 1.35;
  border-left: 2px dashed var(--beet); padding: 2px 0 2px 12px; margin: 1em 0 1.3em; transform: rotate(-0.6deg);
}
.table-wrap { overflow-x: auto; margin: 1.3em 0 1.6em; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--sheet); }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; background: var(--paper-2); }
.keep-reading { margin-top: 56px; border-top: 2px solid var(--ink); padding-top: 4px; }
.more-in { font-weight: 600; }

@media (min-width: 1100px) {
  .is-article .prose .margin-note {
    position: absolute; right: -250px; width: 220px; margin-top: -3.2em; border-left: 0; padding-left: 0;
    transform: rotate(-1.5deg);
  }
}

/* Footer */
.foot { background: var(--ink); color: #d9d2bd; margin-top: 40px; padding: 44px 0 20px; font-size: 0.95rem; }
.foot a { color: #efe6cf; }
.foot ul { list-style: none; padding: 0; margin: 0; line-height: 1.9; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-brand { font-weight: 750; font-size: 1.2rem; color: #fbf6e8; margin-bottom: 6px; }
.foot-h { font-weight: 600; color: #fbf6e8; margin-bottom: 6px; }
.copy { border-top: 1px solid #44513b; padding-top: 16px; margin-top: 28px; font-size: 0.85rem; }

@media (max-width: 960px) {
  .packets { grid-template-columns: repeat(2, 1fr); }
  .entries { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 36px; }
  .hero-fig { max-width: 460px; }
}
@media (max-width: 720px) {
  .search { display: none; }
  .menu-btn { display: inline-block; margin-left: auto; }
  .topics { display: none; }
  .topics.open { display: block; }
  .topics ul { flex-direction: column; gap: 6px; padding-bottom: 14px; }
  .entries { grid-template-columns: 1fr; }
  .packets { grid-template-columns: 1fr 1fr; gap: 20px 14px; }
  .packet { padding: 22px 12px 12px; }
  .packet-name { margin: 0 -12px 8px; font-size: 0.98rem; }
  .cat-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .packet.big { width: 120px; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 340px) {
  .packets { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
