:root {
  --ground: #F4F5EF;
  --surface: #FFFFFF;
  --ink: #17251A;
  --muted: #4A5A4D;
  --line: #D9DED3;
  --green: #2E6A3A;
  --forest: #1F3D26;
  --wheat: #E2B24A;
  --ochre: #8A5A12;
  --on-dark: #DCE7DD;
  --c-crops: #2E6A3A;
  --c-diseases: #8A3B2E;
  --c-pests: #6B4F9A;
  --c-fertilizers: #8A5A12;
  --c-terms: #2D5D7B;
  --font-body: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Unbounded", "Golos Text", "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.6; }
a { color: var(--green); }
a:hover { color: var(--forest); }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--surface); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.h-display { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3vw, 28px); line-height: 1.2; margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.btn-accent { background: var(--wheat); color: var(--ink); }
.btn-accent:hover { background: #D19E33; color: var(--ink); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo svg { color: var(--green); }
.logo span { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.logo:hover { color: var(--ink); }
.main-nav { display: flex; gap: 0 22px; overflow-x: auto; font-size: 15px; font-weight: 500; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { color: var(--ink); text-decoration: none; padding: 8px 0 10px; border-bottom: 3px solid transparent; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--green); }

/* Search */
.search-wrap { position: relative; width: 100%; max-width: 420px; }
.q-input { width: 100%; min-height: 44px; padding: 0 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--ground); font-size: 16px; color: var(--ink); }
.q-input:focus { border-color: var(--green); background: var(--surface); outline: none; }
.q-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(23, 37, 26, 0.16); max-height: 60vh; overflow-y: auto; z-index: 30; padding: 6px; }
.q-item { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.q-item:hover, .q-item.active { background: var(--ground); color: var(--ink); }
.q-item .q-sec { font-size: 12px; font-weight: 700; color: var(--ochre); }
.q-item .q-title { font-weight: 600; }
.q-none { padding: 12px; color: var(--muted); }
.search-wrap--big { max-width: 640px; margin-top: 26px; }
.search-wrap--big .q-input { min-height: 58px; font-size: 17px; border: 0; background: var(--surface); padding: 0 18px; }
.search-wrap--big .q-input:focus { outline: 3px solid var(--wheat); }

/* Hero */
.hero { background: var(--forest); color: #FFFFFF; }
.hero-inner { padding-top: 56px; padding-bottom: 52px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 5vw, 50px); line-height: 1.1; }
.hero-lead { margin-top: 14px; font-size: 19px; color: var(--on-dark); max-width: 40em; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips--hero { margin-top: 18px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; line-height: 1.3; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.chip:hover { border-color: var(--green); color: var(--green); }
.chips--hero .chip { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: #FFFFFF; }
.chips--hero .chip:hover { background: rgba(255, 255, 255, 0.2); color: #FFFFFF; }

.section { padding-top: 44px; padding-bottom: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tile { --c: var(--green); display: flex; flex-direction: column; gap: 6px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 14px; text-decoration: none; color: var(--ink); }
.tile svg { color: var(--c); }
.tile:hover { border-color: var(--c); color: var(--ink); box-shadow: 0 6px 18px rgba(23, 37, 26, 0.08); }
.tile-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-top: 6px; }
.tile-count { font-size: 14px; font-weight: 700; color: var(--c); }
.tile-lead { font-size: 15px; color: var(--muted); }
.tile--crops { --c: var(--c-crops); } .tile--diseases { --c: var(--c-diseases); } .tile--pests { --c: var(--c-pests); }
.tile--fertilizers { --c: var(--c-fertilizers); } .tile--terms { --c: var(--c-terms); }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.how h3 { font-size: 18px; margin-bottom: 4px; }
.how p { font-size: 15px; color: var(--muted); }
.random-box { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; background: var(--wheat); border-radius: 16px; padding: 26px 28px; margin-bottom: 8px; }
.random-box .h-display { margin-bottom: 4px; }
.random-box .btn-accent { background: var(--forest); color: #FFFFFF; }
.random-box .btn-accent:hover { background: #142a19; color: #FFFFFF; }

/* Page head */
.page-head { --c: var(--forest); background: var(--c); color: #FFFFFF; }
.page-head .wrap { padding-top: 26px; padding-bottom: 32px; }
.page-head--crops { --c: var(--c-crops); } .page-head--diseases { --c: var(--c-diseases); } .page-head--pests { --c: var(--c-pests); }
.page-head--fertilizers { --c: var(--c-fertilizers); } .page-head--terms { --c: var(--c-terms); }
.crumbs { font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.crumbs a { color: #FFFFFF; }
.head-title { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.page-head h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 40px); line-height: 1.15; }
.head-kicker { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.page-head .lead { margin-top: 10px; font-size: 18px; color: rgba(255, 255, 255, 0.9); max-width: 44em; }
.latin { font-style: italic; color: var(--muted); font-size: 15px; }
.latin--head { color: rgba(255, 255, 255, 0.85); font-size: 17px; margin-top: 4px; }

/* Lists */
.list-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip, .letter { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; }
.letter { min-width: 44px; padding: 0 10px; }
.fchip:hover, .letter:hover { border-color: var(--green); }
.fchip[aria-pressed="true"], .letter[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.cnt { font-weight: 400; opacity: 0.75; }
.local-search input { min-height: 44px; width: 260px; max-width: 100%; padding: 0 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; }
.local-search input:focus { border-color: var(--green); outline: none; }
.cards { list-style: none; padding: 0; margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.card a:hover { border-color: var(--green); box-shadow: 0 6px 18px rgba(23, 37, 26, 0.08); color: var(--ink); }
.card-tag { font-size: 13px; font-weight: 700; color: var(--ochre); }
.card h2 { font-size: 19px; line-height: 1.3; }
.card-text { font-size: 15px; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 20px; margin-top: 14px; background: var(--surface); border-radius: 14px; border: 1px dashed var(--line); }

/* Entry */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; padding-top: 36px; padding-bottom: 20px; align-items: start; }
.entry-main { max-width: 70ch; }
.block { margin-bottom: 26px; }
.block h2 { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-bottom: 8px; }
.entry-side .block h2 { font-family: var(--font-body); font-size: 17px; }
.entry-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 130px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.side-card h2 { font-size: 17px; margin-bottom: 10px; }
.facts div { padding: 8px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.facts dd { font-size: 15px; }
.entry-side .block { margin-bottom: 0; }
.fact-box { background: var(--surface); border-left: 5px solid var(--wheat); border-radius: 12px; padding: 16px 20px; }
.fact-title { font-weight: 700; color: var(--ochre); margin-bottom: 4px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 0 8px; border-top: 1px solid var(--line); margin-top: 10px; }
.pager a { display: flex; flex-direction: column; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--green); color: var(--ink); }
.pager-next { text-align: right; }

/* Terms */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 14px; }
.term { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; scroll-margin-top: 140px; }
.term:target { border-color: var(--c-terms); box-shadow: 0 0 0 3px rgba(45, 93, 123, 0.25); }
.term dt { font-weight: 700; font-size: 18px; color: var(--forest); }
.term dd { font-size: 15px; margin-top: 4px; }
.term-link { display: inline-block; margin-top: 6px; font-weight: 600; font-size: 14px; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 52px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 28px; font-size: 15px; }
.footer-row > div { max-width: 560px; display: flex; flex-direction: column; gap: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-content: flex-start; }
.footer-links a[aria-current] { font-weight: 700; }

@media (max-width: 900px) {
  .entry { grid-template-columns: 1fr; gap: 24px; }
  .entry-side { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  body { font-size: 16px; }
  .header-row { flex-wrap: wrap; }
  .site-header .search-wrap { max-width: none; }
  .local-search, .local-search input { width: 100%; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
}
