:root {
  --ink: #17212b;
  --muted: #65717d;
  --line: #dfe4e8;
  --soft-line: #edf0f2;
  --paper: #ffffff;
  --canvas: #f6f7f8;
  --navy: #153b5b;
  --navy-deep: #0b2b45;
  --teal: #168c8c;
  --teal-soft: #e7f5f3;
  --focus: #0b75c9;
  --shadow: 0 10px 30px rgb(20 43 61 / 8%);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #eef3f5 0, var(--canvas) 22rem),
    var(--canvas);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  color: white;
  background: var(--navy-deep);
  transform: translateY(-150%);
}

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

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  width: min(1440px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 2.75rem 0 2rem;
}

.header-copy > p {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border-radius: 0.7rem;
  color: white;
  background: var(--navy-deep);
  font-family: Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.archive-stats {
  display: flex;
  flex: 0 0 auto;
  gap: 0.75rem;
  margin: 0;
}

.archive-stats div {
  min-width: 8rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgb(21 59 91 / 12%);
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 62%);
}

.archive-stats dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.archive-stats dd {
  margin: 0.2rem 0 0;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.search-shell {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem max(1.5rem, calc((100vw - 1440px) / 2));
  border-block: 1px solid rgb(21 59 91 / 12%);
  background: rgb(246 247 248 / 92%);
  backdrop-filter: blur(14px);
}

.search-box {
  display: flex;
  align-items: center;
  width: min(46rem, 100%);
  min-height: 3rem;
  padding: 0 0.8rem;
  border: 1px solid #ccd4da;
  border-radius: 0.7rem;
  background: var(--paper);
  box-shadow: 0 1px 2px rgb(20 43 61 / 4%);
}

.search-box:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(11 117 201 / 14%);
}

.search-box svg {
  width: 1.15rem;
  margin-right: 0.7rem;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder {
  color: #8b959d;
}

kbd {
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  color: var(--muted);
  background: var(--canvas);
  font-size: 0.72rem;
}

.search-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 2.5rem;
  width: min(1440px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 2.2rem 0 4rem;
}

.sidebar {
  align-self: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 74%);
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.45rem 0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-toggle {
  display: none;
}

#service-navigation {
  display: grid;
  gap: 0.2rem;
}

.nav-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.7rem;
  border-radius: 0.55rem;
  color: #44515d;
  font-size: 0.86rem;
  line-height: 1.25;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--navy-deep);
  background: #eef3f5;
}

.nav-link[aria-current="page"] {
  color: var(--navy-deep);
  background: var(--teal-soft);
  font-weight: 700;
}

.nav-count {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

main {
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  min-height: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #a8b0b7;
}

.content-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.view-description {
  max-width: 48rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.result-count {
  flex: 0 0 auto;
  padding-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.9rem;
}

.directory-card {
  display: flex;
  min-height: 8.5rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: inherit;
  background: var(--paper);
  box-shadow: 0 2px 8px rgb(20 43 61 / 3%);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.directory-card:hover {
  border-color: #b9c9d4;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.directory-icon {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border-radius: 0.55rem;
  color: var(--navy);
  background: var(--teal-soft);
  font-size: 1rem;
  font-weight: 800;
}

.directory-card h2 {
  margin: 1rem 0 0.35rem;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.25;
}

.directory-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.document-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--paper);
}

.root-documents {
  margin-top: 1.5rem;
}

.section-title {
  margin: 0 0 0.75rem;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.document-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  min-height: 4.6rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--soft-line);
  color: inherit;
  text-decoration: none;
}

.document-row:last-child {
  border-bottom: 0;
}

.document-row:hover {
  background: #f8fafb;
}

.pdf-icon {
  display: grid;
  width: 2.2rem;
  height: 2.65rem;
  place-items: end center;
  padding-bottom: 0.35rem;
  border: 1px solid #e5c8c8;
  border-radius: 0.3rem;
  color: #9e3030;
  background: #fff5f5;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.document-copy {
  min-width: 0;
}

.document-title {
  display: block;
  color: var(--navy-deep);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.32rem;
  color: var(--muted);
  font-size: 0.73rem;
}

.open-label {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.empty-state {
  padding: 4rem 1.5rem;
  border: 1px dashed #cbd4da;
  border-radius: 0.85rem;
  text-align: center;
  background: rgb(255 255 255 / 55%);
}

.empty-state > span {
  display: block;
  color: var(--teal);
  font-size: 2.4rem;
}

.empty-state h2 {
  margin: 0.75rem 0 0.4rem;
  color: var(--navy-deep);
  font-family: Georgia, "Times New Roman", serif;
}

.empty-state p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.empty-state button,
.sidebar-toggle {
  border: 0;
  border-radius: 0.45rem;
  color: white;
  background: var(--navy);
  cursor: pointer;
}

.empty-state button {
  padding: 0.65rem 0.9rem;
}

footer {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
}

:focus-visible {
  outline: 3px solid rgb(11 117 201 / 35%);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    width: min(100% - 2rem, 1440px);
    padding-top: 1.5rem;
  }

  .archive-stats {
    width: 100%;
  }

  .archive-stats div {
    min-width: 0;
    flex: 1;
  }

  .search-shell {
    padding-inline: 1rem;
  }

  .search-status,
  kbd {
    display: none;
  }

  .app-shell {
    display: block;
    width: min(100% - 2rem, 1440px);
    padding-top: 1rem;
  }

  .sidebar {
    margin-bottom: 1.25rem;
  }

  .sidebar-toggle {
    display: inline-block;
    padding: 0.42rem 0.62rem;
    font-size: 0.75rem;
    text-transform: none;
  }

  #service-navigation {
    display: none;
    padding-top: 0.35rem;
  }

  .sidebar.is-open #service-navigation {
    display: grid;
  }

  .content-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }
}

@media (max-width: 520px) {
  .directory-grid {
    grid-template-columns: 1fr;
  }

  .document-row {
    grid-template-columns: 2.2rem minmax(0, 1fr);
  }

  .open-label {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
