:root {
  --bg: #f7f4ed;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #657068;
  --line: #ded8cb;
  --accent: #19735b;
  --accent-dark: #10513f;
  --gold: #d79b35;
  --rose: #b94a60;
  --shadow: 0 18px 55px rgba(23, 33, 27, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.site-header,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 178px;
  max-width: 48vw;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  text-decoration: none;
}

.top-nav .header-cta {
  border-radius: 999px;
  background: #f74a28;
  color: #ffffff;
  font-weight: 750;
  padding: 10px 16px;
  transition: background 160ms ease, color 160ms ease;
}

.top-nav .header-cta:hover {
  background: #000000;
  color: #ffffff;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 28px;
  align-items: stretch;
  padding: 58px 0 36px;
}

.hero-copy {
  padding: 4px 0;
}

.eyebrow,
.term-category {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-size: 62px;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 16px;
  font-size: 34px;
  line-height: 1;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 19px;
}

.search-panel {
  display: flex;
  min-height: 245px;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 26px;
}

.search-panel label {
  font-weight: 750;
}

.search-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  outline: none;
  padding: 15px 16px;
}

.search-panel input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(25, 115, 91, 0.15);
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.text-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition: 160ms ease;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
}

.chip:hover,
.text-button:hover,
.chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.text-button {
  padding: 8px 14px;
}

.dictionary {
  padding: 40px 0 64px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
}

.letter-group {
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
}

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

.term-card {
  display: flex;
  min-height: 175px;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
  text-decoration: none;
  transition: 160ms ease;
}

.term-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.term-card strong {
  font-size: 21px;
  line-height: 1.2;
}

.term-card span:last-child {
  color: var(--muted);
  font-size: 15px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  padding: 28px;
  color: var(--muted);
}

.term-page {
  max-width: 900px;
}

.term-article {
  padding: 54px 0 76px;
}

.term-article h1 {
  margin-top: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  margin-bottom: 28px;
  color: var(--ink);
  font-weight: 750;
  padding: 10px 16px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.back-link:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.term-category--article {
  display: inline-flex;
  margin: 0 0 16px;
}

.article-body {
  display: grid;
  gap: 12px;
  margin: 28px 0;
  color: #2c372f;
  font-size: 18px;
}

.article-section {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 28px;
}

.article-section ul {
  margin: 0;
  padding-left: 22px;
  color: #2c372f;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .site-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
  }

  .top-nav {
    display: contents;
  }

  .top-nav .header-cta {
    order: 2;
  }

  .top-nav a:not(.header-cta) {
    order: 3;
  }

  .top-nav a:not(.header-cta):first-child {
    margin-left: auto;
  }

  .top-nav a:not(.header-cta):nth-last-child(2) {
    margin-right: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .search-panel {
    min-height: auto;
  }

  .term-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  main,
  .site-header,
  .site-footer {
    width: min(100% - 22px, 1180px);
  }

  h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 17px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .term-grid {
    grid-template-columns: 1fr;
  }

  .chip,
  .text-button {
    min-height: 36px;
    font-size: 13px;
  }
}
