:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --text: #142029;
  --muted: #4f5f69;
  --line: #d5dee4;
  --hero-a: #0f2f35;
  --hero-b: #1d5a4e;
  --cta: #f2b632;
  --accent: #1d7a6a;
  --accent-light: #e8f5f2;
  --tag-bg: #e2ecf0;
  --tag-text: #2a4a57;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(12, 40, 45, 0.08);
  --container: 860px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
}

.container {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  color: #f8fffd;
  background:
    radial-gradient(circle at 10% 20%, rgba(242, 182, 50, 0.22), transparent 36%),
    radial-gradient(circle at 88% 78%, rgba(80, 208, 170, 0.2), transparent 40%),
    linear-gradient(130deg, var(--hero-a), var(--hero-b));
  padding: 72px 0 90px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -60px;
  height: 140px;
  background: var(--bg);
  border-radius: 100% 100% 0 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  animation: rise-in 500ms ease-out;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  text-transform: uppercase;
  color: rgba(248, 255, 253, 0.75);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lead {
  margin: 14px 0 28px;
  font-size: 1.1rem;
  color: rgba(248, 255, 253, 0.88);
  max-width: 58ch;
}

/* ── Search ── */
.search-wrap {
  position: relative;
  max-width: 480px;
}

#search {
  width: 100%;
  padding: 13px 48px 13px 18px;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  outline: none;
  backdrop-filter: blur(8px);
  transition: background 0.2s;
}

#search::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

#search:focus {
  background: rgba(255, 255, 255, 0.22);
}

.search-count {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

/* ── Alpha nav ── */
.alpha-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(12, 40, 45, 0.06);
}

.alpha-nav .container {
  overflow-x: auto;
  scrollbar-width: none;
}

.alpha-nav .container::-webkit-scrollbar {
  display: none;
}

.alpha-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
  padding: 8px 0;
  white-space: nowrap;
}

.alpha-nav li a {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.alpha-nav li a:hover,
.alpha-nav li a.active {
  background: var(--accent-light);
  color: var(--accent);
}

.alpha-nav li a.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Main content ── */
#main {
  padding: 48px 20px 80px;
}

.no-results {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  padding: 40px 0;
}

.hidden {
  display: none !important;
}

/* ── Glossary ── */
.glossary {
  margin: 0;
}

/* Letter divider */
.letter-heading {
  margin: 44px 0 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 6px;
  scroll-margin-top: 56px;
}

.letter-heading:first-child {
  margin-top: 0;
}

dt {
  margin: 28px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  scroll-margin-top: 60px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 4px;
  padding: 2px 6px;
  vertical-align: middle;
}

dd {
  margin: 6px 0 0 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #2e3d46;
  font-size: 0.97rem;
  box-shadow: var(--shadow);
}

dd a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

dd a:hover {
  text-decoration: underline;
}

dd strong {
  color: var(--text);
}

dd em {
  font-style: italic;
}

/* Highlight on search */
mark {
  background: #fff3b0;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--line);
  background: #eef3ee;
  padding: 24px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
}

.footer p {
  margin: 0;
  color: #41525d;
  font-size: 0.92rem;
}

.footer-muted {
  opacity: 0.8;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

.site-network {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.site-network-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.site-network-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.site-network-links a {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
}

.site-network-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Breadcrumb ── */
.breadcrumb {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  padding: 10px 0;
}

.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ── Article body ── */
.article-body {
  padding: 48px 20px 80px;
  max-width: 720px;
  margin: 0 auto;
}

.article-body h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 6px;
  margin: 48px 0 16px;
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--text);
}

.article-body p {
  margin: 0 0 16px;
  color: #2e3d46;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
  margin: 0 0 16px;
  color: #2e3d46;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

/* ── FAQ ── */
.faq-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.faq-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
}

/* ── Related terms ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.related-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s;
  box-shadow: var(--shadow);
}

.related-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.related-card small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

/* ── Guide cards (index page) ── */
.guides-section {
  padding: 48px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.guides-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.guides-section > .container > p {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.97rem;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.guide-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  display: block;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.guide-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(12, 40, 45, 0.13);
}

.guide-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.guide-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Animations ── */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero {
    padding: 56px 0 76px;
  }

  .lead {
    font-size: 1rem;
  }

  dt {
    font-size: 1.05rem;
  }

  dd {
    font-size: 0.94rem;
    padding: 12px 14px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
