:root {
  --ink: #17202a;
  --muted: #5d6a75;
  --line: #d9e1e8;
  --panel: #f7fafc;
  --paper: #ffffff;
  --accent: #0b6b78;
  --accent-strong: #084c56;
  --amber: #b55e00;
  --shadow: 0 10px 30px rgba(23, 32, 42, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #eef3f6;
  line-height: 1.55;
}
a { color: var(--accent); }
a:hover, a:focus { color: var(--accent-strong); }

.site-masthead {
  background: linear-gradient(rgba(248, 251, 252, 0.92), rgba(248, 251, 252, 0.92)), url("cog.png") 0 0 / 25px 25px repeat;
  border-bottom: 1px solid var(--line);
}

.site-masthead-inner {
  align-items: center;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1220px;
  min-height: 112px;
  padding: 22px 32px;
}

.brand-lockup {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.logo { display: inline-flex; line-height: 0; text-decoration: none; }
.logo img { display: block; height: auto; width: clamp(154px, 16vw, 218px); }

.logo-sub {
  color: var(--accent-strong);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: flex-end;
}

.site-nav a,
.site-nav button {
  color: var(--ink);
  font: inherit;
}

.site-nav a { text-decoration: none; }
.site-nav a:hover,
.site-nav a.active { color: var(--accent-strong); }
.site-nav a.active { font-weight: 700; }
.site-nav button { background: transparent; border: 0; cursor: pointer; padding: 0; }

.course-link {
  background: var(--accent);
  border-radius: 999px;
  color: #fff !important;
  font-weight: 700;
  padding: 12px 18px;
}

.site-shell { min-height: 100vh; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 92px;
  padding: 18px clamp(18px, 3vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { display: block; width: 174px; height: auto; }
.site-header nav { display: flex; gap: clamp(14px, 2vw, 30px); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-header a { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-header nav a { color: var(--muted); font-size: 0.95rem; }
.site-header nav a:hover, .site-header nav a:focus { color: var(--accent-strong); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: end;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 4rem) 1.5rem;
  background: linear-gradient(180deg, #f8fbfd 0%, #eef3f6 100%);
}
.hero h1 { margin: 0 0 0.75rem; font-size: clamp(2rem, 5vw, 4.5rem); line-height: 1.02; letter-spacing: 0; }
.hero p { max-width: 48rem; margin: 0; color: var(--muted); font-size: 1.08rem; }
.hero-cover {
  justify-self: end;
  width: min(100%, 150px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow);
  background: #d8e2e8;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding: 1.5rem clamp(1rem, 4vw, 4rem) 3rem;
}
.sidebar {
  align-self: start;
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding-right: 0.25rem;
}
.search-box {
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: var(--paper);
}
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.9rem 0;
}
.alpha-nav a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  text-decoration: none;
  font-weight: 700;
}
.entry-list {
  display: grid;
  gap: 0.28rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.entry-list a {
  display: block;
  padding: 0.38rem 0.45rem;
  border-radius: 5px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
}
.entry-list a:hover,
.entry-list a:focus,
.entry-list a[aria-current="page"] { background: #deedf1; color: var(--accent-strong); }
.content { min-width: 0; }
.group { scroll-margin-top: 5rem; margin-bottom: 2rem; }
.group h2 { margin: 0 0 0.75rem; border-bottom: 1px solid var(--line); padding-bottom: 0.35rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.75rem; }
.entry-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 8rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(23, 32, 42, 0.04);
}
.entry-card a { font-weight: 700; color: var(--ink); text-decoration: none; }
.entry-card a:hover, .entry-card a:focus { color: var(--accent); text-decoration: underline; }
.entry-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.article-shell {
  max-width: 900px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2rem);
}
.breadcrumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.breadcrumbs a { text-decoration: none; }
.entry-title { margin: 0 0 0.65rem; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.1; letter-spacing: 0; }
.entry-meta { display: grid; gap: 0.45rem; margin-bottom: 1.5rem; color: var(--muted); font-size: 0.92rem; }
.entry-body p { margin: 0 0 1rem; }
.entry-body ul { margin: 0 0 1rem 1.25rem; padding: 0; }
.entry-body li { margin: 0.35rem 0; }
.see-also {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.see-also h2, .footnotes h2 { font-size: 1.05rem; margin: 0 0 0.65rem; }
.see-also ul { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }
.see-also a {
  display: inline-flex;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  text-decoration: none;
}
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.prev-next a { max-width: 48%; text-decoration: none; }
.prev-next span { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.footnotes {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.footnotes ol { padding-left: 1.25rem; }
.ad-slot {
  margin: 2rem 0;
  padding: 1.25rem;
  min-height: 120px;
  border: 1px dashed #b8c4cc;
  background: #fafbfc;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}
.ad-slot ins { display: block; }
.footnotes li { margin-bottom: 0.6rem; }
.footnote-ref { text-decoration: none; font-weight: 700; }
.acronym-term {
  border-bottom: 1px dotted var(--amber);
  cursor: help;
  text-decoration: none;
}
.reference-term,
.glossary-term {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}
.reference-term { color: #6b4b00; }
.no-results { display: none; color: var(--muted); margin: 1rem 0; }
body.has-filter .entry-card[hidden],
body.has-filter .entry-list li[hidden],
body.has-filter .group[hidden] { display: none; }
body.no-results .no-results { display: block; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-cover { justify-self: start; width: 140px; }
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; padding-right: 0; }
  .site-header { align-items: flex-start; }
}


@media (max-width: 720px) {
  .site-masthead-inner { align-items: flex-start; flex-direction: column; }
  .site-nav { gap: 12px; justify-content: flex-start; }
}
