:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --surface: #ffffff;
  --surface-soft: #fbfaf6;
  --ink: #0c2434;
  --ink-soft: #384956;
  --muted: #65717a;
  --border: #d8d5cb;
  --border-strong: #bfc8c4;
  --navy: #082236;
  --navy-2: #102f44;
  --accent: #08766e;
  --accent-strong: #005f5a;
  --accent-soft: #dcefeb;
  --gold: #b4812f;
  --disabled: #ebecef;
  --disabled-text: #9a9fa8;
  --focus: #d99b21;
  --shadow: 0 18px 45px rgba(8, 34, 54, 0.12);
  --shadow-soft: 0 10px 28px rgba(8, 34, 54, 0.08);
  --radius: 8px;
  --max: 1180px;
  --readable: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body.modal-open {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--navy);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 2000;
  transform: translateY(-150%);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--navy);
  padding: 0.7rem 1rem;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background: var(--navy);
  color: var(--surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-header__inner {
  width: min(100% - 32px, var(--max));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--surface);
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: var(--surface);
}

.brand__mark {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--accent-soft);
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-weight: 800;
  font-size: 0.9rem;
}

.brand__text {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.brand__name {
  color: var(--surface);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
}

.brand__name span {
  margin-left: 0.1rem;
  font-size: 0.74em;
  font-weight: 700;
  color: #cce6e2;
}

.brand__tag {
  color: #c7d4da;
  font-size: 0.82rem;
}

.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.primary-nav a {
  color: #e9f1f2;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.55rem 0.72rem;
  font-weight: 700;
  font-size: 0.94rem;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.11);
  color: var(--surface);
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.66rem 1rem;
  background: var(--surface);
  color: var(--navy);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  color: var(--navy);
}

.button--search {
  background: var(--accent);
  color: var(--surface);
  border-color: rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.button--search:hover,
.button--accent {
  background: var(--accent-strong);
  color: var(--surface);
}

.button--outline {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--navy);
}

.page-hero {
  background: var(--navy);
  color: var(--surface);
  border-bottom: 5px solid var(--accent);
}

.page-hero__inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 4rem 0 4.4rem;
}

.page-hero__inner--with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: 2rem;
  align-items: end;
}

.page-hero h1 {
  max-width: 880px;
  margin: 0.25rem 0 1rem;
  font-size: 2.8rem;
  line-height: 1.08;
  font-weight: 800;
}

.page-hero p {
  max-width: 720px;
  margin: 0;
  color: #d6e1e4;
  font-size: 1.18rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.band {
  padding: 3.2rem 0;
}

.band--white {
  background: var(--surface);
}

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

.readable {
  max-width: var(--readable);
}

.readable p,
.readable li {
  color: var(--ink-soft);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.5rem;
}

.section-heading h2,
.readable h2,
.term-article h2 {
  margin: 0 0 0.55rem;
  color: var(--navy);
  font-size: 1.7rem;
  line-height: 1.2;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.search-widget {
  max-width: 860px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.4rem;
  box-shadow: var(--shadow-soft);
}

.search-widget--compact {
  max-width: 100%;
  margin-top: 1.4rem;
  box-shadow: none;
}

.page-hero .search-widget {
  max-width: 880px;
  margin-top: 0;
  color: var(--ink);
}

.page-hero .search-widget h2,
.page-hero .search-widget label {
  color: var(--ink);
}

.page-hero .search-widget p,
.page-hero .search-widget .search-status {
  color: var(--muted);
  font-size: 0.94rem;
}

.search-widget h2 {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

.search-widget label,
.search-modal label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 800;
}

.search-field {
  display: flex;
  gap: 0.7rem;
  align-items: stretch;
}

.search-field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  color: var(--ink);
}

.search-field input:focus {
  border-color: var(--accent);
}

.search-hint,
.search-status,
.small {
  color: var(--muted);
  font-size: 0.94rem;
}

.search-hint {
  margin: 0.6rem 0 0;
}

.search-status {
  min-height: 1.5rem;
  margin-top: 0.7rem;
}

.search-results {
  margin-top: 0.4rem;
}

.results-kicker {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.result-list a,
.result-card {
  display: grid;
  gap: 0.15rem;
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
  color: var(--ink);
  text-decoration: none;
}

.result-list a:hover,
.result-card:hover,
.result-card.is-active {
  color: var(--accent-strong);
  background: var(--surface-soft);
}

.result-card strong {
  color: var(--navy);
}

.result-card span,
.result-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(8, 20, 28, 0.72);
}

.search-modal {
  position: fixed;
  top: 7vh;
  left: 50%;
  z-index: 1000;
  width: min(920px, calc(100% - 32px));
  max-height: 86vh;
  overflow: auto;
  transform: translateX(-50%);
  border-radius: var(--radius);
  background: var(--navy-2);
  color: var(--surface);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.search-modal__inner {
  max-width: 720px;
  margin: 0 auto;
}

.search-modal h2 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
}

.search-modal p {
  color: #d9e5e7;
}

.search-modal__close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: transparent;
  color: var(--surface);
  padding: 0.5rem 0.85rem;
  font-weight: 800;
}

.search-results--modal {
  margin-top: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 1rem 1.2rem;
}

.search-modal .search-status {
  color: #d9e5e7;
}

.az-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.az-nav--side ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
}

.az-letter {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.az-letter:hover,
.az-letter.is-active {
  background: var(--accent);
  color: var(--surface);
}

.az-letter--disabled {
  border-color: transparent;
  background: var(--disabled);
  color: var(--disabled-text);
}

.az-nav--mobile {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px 1.5rem;
  padding: 0.8rem 16px;
  background: rgba(247, 243, 234, 0.96);
  overflow-x: auto;
  scrollbar-width: none;
}

.az-nav--mobile::-webkit-scrollbar,
.primary-nav::-webkit-scrollbar {
  display: none;
}

.az-nav--mobile ol {
  width: max-content;
  flex-wrap: nowrap;
}

.az-nav--inline {
  padding: 1rem 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.category-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.2rem;
}

.category-card h2,
.category-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

.category-card p {
  margin: 0;
  color: var(--muted);
}

.popular-list,
.level-list,
.inline-link-list,
.related-list,
.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.popular-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.popular-list a,
.inline-link-list a,
.related-list a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.popular-list a:hover,
.inline-link-list a:hover,
.related-list a:hover {
  color: var(--accent-strong);
}

.popular-list span {
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.level-list {
  display: grid;
  gap: 0.9rem;
}

.level-list article {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
}

.level-list h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.level-list p {
  margin: 0;
  color: var(--muted);
}

.breadcrumbs {
  margin-bottom: 1.2rem;
  font-size: 0.94rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.breadcrumbs li::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--muted);
}

.breadcrumbs li:last-child::after {
  content: "";
  margin: 0;
}

.glossary-meta {
  margin-top: 1.4rem;
}

.filters {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.filter-chip {
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0.55rem 0.8rem;
  font-weight: 800;
}

.filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.glossary-shell {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 3rem 0 4rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 3rem;
  align-items: start;
}

.glossary-shell__main {
  min-width: 0;
}

.sticky-panel {
  position: sticky;
  top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.3rem;
  box-shadow: var(--shadow-soft);
}

.sticky-panel__label {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.letter-section {
  scroll-margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2.8rem;
}

.letter-section[hidden] {
  display: none !important;
}

.letter-section h2 {
  margin: 0 0 0.9rem;
  color: var(--accent);
  font-size: 4.7rem;
  line-height: 0.95;
}

.term-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.term-row {
  border-bottom: 1px solid var(--border);
}

.term-row[hidden] {
  display: none !important;
}

.term-row__link {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  padding: 1.05rem 2rem 1.05rem 0;
  color: var(--ink);
  text-decoration: none;
}

.term-row__link:hover {
  background: linear-gradient(90deg, rgba(8, 118, 110, 0.07), transparent 72%);
  color: var(--ink);
}

.term-row__main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}

.term-row__title {
  color: var(--navy);
  font-size: 1.18rem;
  font-weight: 800;
}

.term-row__acronym,
.term-row__category {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.term-row__category {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  white-space: nowrap;
}

.term-row__definition {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  max-width: 760px;
}

.term-row__arrow {
  position: absolute;
  right: 0.3rem;
  top: 1.12rem;
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

.term-article {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 3rem 0 4rem;
  display: grid;
  grid-template-columns: minmax(0, var(--readable)) minmax(250px, 1fr);
  gap: 3rem;
  align-items: start;
}

.term-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.7rem;
  margin-bottom: 1.8rem;
}

.term-header h1 {
  margin: 0 0 0.75rem;
  color: var(--navy);
  font-size: 2.55rem;
  line-height: 1.12;
}

.term-alias {
  margin: 0 0 1rem;
  color: var(--muted);
}

.quick-definition {
  margin: 0;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 1rem 1.1rem;
  color: var(--ink-soft);
}

.term-article__main > section {
  border-top: 1px solid var(--border);
  padding: 1.8rem 0;
}

.term-article__main > section:first-of-type {
  border-top: 0;
}

.at-a-glance ul {
  margin: 0;
  padding-left: 1.2rem;
}

.at-a-glance li + li {
  margin-top: 0.45rem;
}

.source-list {
  display: grid;
  gap: 0.45rem;
}

.source-list a {
  color: var(--accent-strong);
}

.term-footer-note {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.8rem;
}

.prev-next div {
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem;
}

.prev-next div:last-child {
  text-align: right;
}

.prev-next span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.prev-next a {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.contents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.contents-list a {
  display: block;
  border-radius: var(--radius);
  padding: 0.4rem 0.45rem;
  color: var(--ink);
  text-decoration: none;
}

.contents-list a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.4rem 0 2rem;
}

.site-footer {
  background: var(--navy);
  color: #dce7e9;
  padding: 2.4rem 0;
}

.site-footer__inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 2fr;
  gap: 2rem;
}

.footer-brand {
  color: var(--surface);
  font-weight: 900;
  text-decoration: none;
}

.site-footer p {
  margin: 0.35rem 0 0;
  color: #c6d6db;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.footer-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  color: #eef7f8;
  text-decoration: none;
}

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

@media (min-width: 900px) {
  .az-nav--mobile {
    display: none;
  }
}

@media (max-width: 899px) {
  body {
    font-size: 16px;
  }

  .site-header__inner {
    min-height: 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .button--search {
    margin-left: auto;
  }

  .page-hero__inner {
    padding: 3rem 0;
  }

  .page-hero__inner--with-action {
    display: block;
  }

  .page-hero__action {
    margin-top: 1.6rem;
  }

  .page-hero h1 {
    font-size: 2.25rem;
  }

  .two-column,
  .category-grid,
  .glossary-shell,
  .term-article,
  .site-footer__inner,
  .footer-nav {
    grid-template-columns: 1fr;
  }

  .glossary-shell {
    gap: 0;
    padding-top: 1.4rem;
  }

  .glossary-shell__side,
  .term-article__side {
    display: none;
  }

  .term-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 620px) {
  .site-header__inner,
  .container,
  .glossary-shell,
  .term-article,
  .site-footer__inner,
  .page-hero__inner {
    width: min(100% - 24px, var(--max));
  }

  .brand__tag {
    display: none;
  }

  .brand {
    gap: 0.5rem;
    max-width: 205px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
    font-size: 0.82rem;
  }

  .brand__name {
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .site-header__inner {
    gap: 0.4rem;
  }

  .button--search {
    padding: 0.5rem 0.45rem;
    font-size: 0.94rem;
  }

  .primary-nav {
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }

  .primary-nav a {
    flex: 0 0 auto;
    padding: 0.5rem 0.55rem;
  }

  .search-field {
    flex-direction: column;
  }

  .search-modal {
    top: 2vh;
    width: calc(100% - 20px);
    max-height: 96vh;
    padding: 1.2rem;
  }

  .search-modal h2 {
    font-size: 1.55rem;
  }

  .popular-list,
  .prev-next {
    grid-template-columns: 1fr;
  }

  .prev-next div:last-child {
    text-align: left;
  }

  .letter-section h2 {
    font-size: 4rem;
  }

  .term-row__link {
    grid-template-columns: 1fr;
    padding-right: 1.6rem;
  }

  .term-row__category {
    grid-column: 1;
    grid-row: auto;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
