:root {
  --bg: #f6f3ea;
  --surface: #fffdf8;
  --ink: #15120d;
  --text: #3d372d;
  --muted: #746b5d;
  --line: #d8ccb8;
  --line-strong: #ac9b7c;
  --green: #17483b;
  --green-2: #0f3028;
  --green-soft: #e7efe9;
  --gold: #b48942;
  --blue: #2d506c;
  --plum: #69475f;
  --brick: #984d38;
  --shadow: 0 18px 45px rgba(40, 34, 24, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, #fffdf8 0, var(--bg) 420px);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

a { color: inherit; }

.site-header {
  border-bottom: 1px solid rgba(40, 34, 24, .16);
  background: rgba(255, 253, 248, .96);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.utility,
.topline,
.primary-row,
main {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.utility {
  min-height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(216, 204, 184, .7);
  color: var(--muted);
  font-size: 12px;
}

.utility nav {
  display: flex;
  gap: 16px;
}

.utility a { text-decoration: none; }

.topline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 104px;
}

.brand {
  grid-column: 1;
  justify-self: start;
  display: block;
}

.brand img {
  display: block;
  width: min(330px, 46vw);
  height: auto;
}

.language-nav {
  grid-column: 3;
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(3, 39px);
  padding: 3px;
  border: 1px solid var(--line);
  background: #fff;
}

.language-nav a {
  display: grid;
  place-items: center;
  min-height: 32px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
}

.language-nav .active {
  background: var(--green-2);
  color: #fff;
}

.primary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: center;
  padding-bottom: 16px;
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.primary-nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.primary-nav a.active {
  color: var(--green-2);
  border-bottom-color: var(--gold);
}

.search-box,
.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  background: #fff;
}

.search-box input,
.search-box button,
.hero-search input,
.hero-search button {
  border: 0;
  font: inherit;
}

.search-box input {
  min-width: 0;
  min-height: 42px;
  padding: 0 13px;
}

.search-box button,
.hero-search button {
  background: var(--green-2);
  color: #fff;
  font-weight: 900;
}

.search-box button { padding: 0 15px; }

main { padding: 34px 0 86px; }

.kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 42px;
  align-items: end;
  padding: 30px 0 34px;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(46px, 6.3vw, 86px);
  line-height: .95;
}

.hero-copy {
  max-width: 810px;
  margin-top: 22px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.58;
}

.hero-search {
  max-width: 870px;
  margin-top: 28px;
  border: 2px solid var(--green);
}

.hero-search input {
  min-width: 0;
  min-height: 58px;
  padding: 0 18px;
  font-size: 16px;
}

.hero-search button {
  padding: 0 24px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.quick-links a,
.tag-link {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--green-soft);
  color: var(--green-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.start-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.start-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
}

.start-card header strong {
  color: var(--green);
}

.start-card ol {
  margin: 0;
  padding: 8px 0;
  list-style: none;
  counter-reset: steps;
}

.start-card li { counter-increment: steps; }

.start-card a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
}

.start-card a::before {
  content: counter(steps, decimal-leading-zero);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
}

.section-nav a {
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.section-nav span {
  color: var(--gold);
  font-size: 11px;
}

.section-nav a:hover {
  background: var(--green-2);
  color: #fff;
}

.pathways {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 14px;
  margin-top: 44px;
}

.path {
  min-height: 246px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.path.primary {
  background: var(--green-2);
  color: #fff;
}

.path h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.03;
}

.path p {
  color: var(--muted);
  line-height: 1.55;
}

.path.primary p,
.path.primary .kicker {
  color: rgba(255,255,255,.78);
}

.path a {
  display: inline-flex;
  margin-top: 12px;
  color: var(--green);
  text-decoration: none;
  font-weight: 900;
}

.path.primary a { color: #fff; }

.block {
  margin-top: 60px;
}

.block-head,
.library-band,
.article-system,
.page-hero,
.content-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.block-head h2,
.library-band h2,
.article-system h2,
.page-hero h1 {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.05;
}

.atlas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  border: 1px solid var(--line);
  background: var(--line);
}

.atlas a {
  min-height: 160px;
  padding: 20px;
  background: var(--surface);
  text-decoration: none;
}

.atlas strong {
  display: block;
  margin-bottom: 32px;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.05;
}

.atlas span {
  color: var(--muted);
  line-height: 1.45;
}

.library-band {
  margin-top: 60px;
  padding: 34px;
  background: #17382f;
  color: #fff;
}

.library-band .kicker { color: #d7b064; }

.library-band p {
  color: rgba(255,255,255,.74);
  line-height: 1.55;
}

.shelf-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.18);
}

.shelf-list a {
  display: grid;
  align-content: space-between;
  min-height: 132px;
  padding: 18px;
  background: #17382f;
  text-decoration: none;
}

.shelf-list strong {
  color: #d7b064;
  font-size: 26px;
}

.shelf-list span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.12;
}

.article-system {
  margin-top: 60px;
}

.article-card,
.panel,
.toc,
.post-card {
  border: 1px solid var(--line);
  background: var(--surface);
}

.article-card {
  padding: 28px;
}

.meta {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 12px 0 8px;
  font-size: 38px;
}

.article-card p {
  max-width: 680px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
}

.article-card nav,
.related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.page-hero {
  padding: 24px 0 38px;
  border-bottom: 1px solid var(--line);
}

.page-hero p {
  max-width: 760px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.6;
}

.term-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.term-actions a {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}

.term-actions a:first-child {
  border-color: var(--green);
  background: var(--green-2);
  color: #fff;
}

.term-guide {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 22px;
}

.term-stat {
  display: grid;
  align-content: center;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--green-2);
  color: #fff;
}

.term-stat span,
.term-stat em {
  color: #d7b064;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.term-stat strong {
  margin: 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 62px;
  line-height: .9;
}

.term-guide-main {
  display: grid;
  gap: 12px;
}

.term-guide-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.term-guide-head h2,
.archive-head h2 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.02;
}

.term-path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.term-path-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.term-path-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.08;
}

.term-path-card span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.term-path-card em {
  align-self: end;
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.term-path-card:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.term-shelf-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(23, 72, 59, .16);
  background: rgba(23, 72, 59, .16);
}

.term-shelf-row a {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  background: #17382f;
  color: white;
  text-decoration: none;
}

.term-shelf-row strong {
  color: #d7b064;
  font-size: 18px;
}

.term-shelf-row span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.1;
}

.content-layout {
  margin-top: 34px;
}

.archive-head {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.sidebar-stack {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 20px;
}

.panel h2,
.toc h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.panel a,
.toc a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.panel a:last-child,
.toc a:last-child { border-bottom: 0; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.post-card {
  min-height: 190px;
  padding: 20px;
  text-decoration: none;
}

.post-card img {
  display: block;
  width: calc(100% + 40px);
  aspect-ratio: 16 / 9;
  margin: -20px -20px 18px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: var(--green-soft);
}

.post-card h2 {
  margin: 18px 0 10px;
  font-size: 27px;
  line-height: 1.08;
}

.post-card p {
  color: var(--muted);
  line-height: 1.5;
}

.collection-table {
  border-top: 1px solid var(--line);
}

.collection-table a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.collection-table span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.collection-table strong {
  color: var(--green);
  text-align: right;
}

.reader {
  max-width: 760px;
}

.reader h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
}

.reader .lead {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.65;
}

.featured-media {
  margin: 26px 0 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.featured-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.reader article {
  margin-top: 28px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.78;
}

.reader article h2 {
  margin: 34px 0 10px;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.1;
}

.reader article img {
  max-width: 100%;
  height: auto;
}

.search-page {
  max-width: 980px;
}

.search-head {
  padding: 24px 0 30px;
  border-bottom: 1px solid var(--line);
}

.search-head h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1;
}

.search-head p {
  max-width: 720px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.55;
}

.search-count {
  min-height: 24px;
  margin-top: 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.search-empty,
.search-error {
  margin-top: 24px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.search-results {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.search-result {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.search-result img {
  width: 132px;
  height: 100%;
  min-height: 96px;
  object-fit: cover;
  background: var(--green-soft);
}

.search-result span {
  display: grid;
  gap: 7px;
  align-content: center;
  min-width: 0;
}

.search-result small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.search-result strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.08;
}

.search-result em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}

.author-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.author-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.author-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.08;
}

.author-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.author-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 36px;
  align-items: end;
  padding: 28px 0 34px;
  border-bottom: 1px solid var(--line);
}

.library-hero h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(48px, 7vw, 92px);
  line-height: .95;
}

.library-hero p:not(.kicker) {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.55;
}

.library-hero .hero-search {
  width: 100%;
  margin: 0;
}

.library-index {
  padding: 34px 0 10px;
}

.library-section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 16px;
}

.library-section-head h2 {
  margin: 0;
  font-size: clamp(31px, 4vw, 48px);
  line-height: 1;
}

.library-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.library-section-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  min-height: 138px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}

.library-section-card span {
  grid-row: span 2;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.library-section-card strong {
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.05;
}

.library-section-card em {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.library-section-card:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.library-page-band {
  margin-top: 30px;
}

.inline-more {
  align-self: end;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.site-pagination {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, white);
}

.pagination-status {
  display: flex;
  gap: 7px;
  align-items: baseline;
  min-width: max-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.pagination-status strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.pagination-links a,
.pagination-links span {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.pagination-links .step,
.pagination-links .edge {
  min-width: 72px;
}

.pagination-links a:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.pagination-links .current {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.pagination-links .disabled {
  color: color-mix(in srgb, var(--muted) 58%, white);
  cursor: default;
}

.pagination-links .ellipsis {
  min-width: 28px;
  padding: 0 4px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.toc {
  position: sticky;
  top: 190px;
  padding: 18px;
}

@media (max-width: 1040px) {
  .primary-row,
  .hero,
  .block-head,
  .library-band,
  .article-system,
  .page-hero,
  .content-layout,
  .library-hero,
  .term-guide {
    grid-template-columns: 1fr;
  }

  .section-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pathways { grid-template-columns: 1fr; }
  .atlas, .shelf-list, .library-section-grid, .term-path-grid, .term-shelf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc { position: static; }
}

@media (max-width: 680px) {
  .utility,
  .topline,
  .primary-row,
  main {
    width: min(100% - 24px, 1200px);
  }

  .utility { display: none; }
  .topline { grid-template-columns: 1fr auto; min-height: 72px; }
  .brand { grid-column: 1; justify-self: start; }
  .brand img { width: min(228px, 56vw); }
  .language-nav { grid-column: 2; grid-template-columns: repeat(3, 35px); }
  .hero h1 { font-size: 43px; }
  .library-hero h1 { font-size: 46px; }
  .hero-search, .section-nav, .atlas, .shelf-list, .post-grid, .library-section-grid, .term-path-grid, .term-shelf-row { grid-template-columns: 1fr; }
  .library-band, .article-card, .panel { padding: 22px; }
  .term-stat { min-height: 112px; padding: 18px; }
  .term-stat strong { font-size: 44px; }
  .term-path-card { min-height: 0; padding: 16px; }
  .term-path-card strong { font-size: 23px; }
  .term-shelf-row a { min-height: 74px; padding: 14px; }
  .library-section-head { display: block; }
  .site-pagination { grid-template-columns: 1fr; }
  .pagination-links { justify-content: flex-start; }
  .pagination-links .edge { display: none; }
  .pagination-links .step { flex: 1 1 120px; }
}
