@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-extrabold.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  --black: #111111;
  --ink: #202124;
  --gold: #b4853d;
  --gold-light: #d5b06c;
  --red: #bf3b30;
  --paper: #ffffff;
  --ground: #f1f2f3;
  --muted: #666b70;
  --line: #d7d9dc;
  --line-dark: #353535;
  --focus: #0b6fa4;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--ground);
  font-family: "Atkinson Hyperlegible", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hazard-stripe {
  height: 8px;
  background: repeating-linear-gradient(
    135deg,
    var(--gold) 0,
    var(--gold) 16px,
    var(--black) 16px,
    var(--black) 32px
  );
}

.masthead {
  color: var(--paper);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--black);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--line-dark);
}

.masthead-inner {
  width: min(100% - 32px, var(--content));
  min-height: 132px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 126px 1fr auto;
  align-items: center;
  gap: 24px;
}

.school-logo {
  width: 126px;
  height: 90px;
  object-fit: contain;
  background: var(--paper);
  border: 3px solid var(--gold);
}

.brand-copy p,
.brand-copy small,
.sidebar-heading p,
.results-heading p {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-copy p {
  color: var(--gold-light);
}

.brand-copy h1 {
  margin: 2px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 3.2rem;
  line-height: 0.9;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-copy h1 span {
  color: var(--gold-light);
}

.brand-copy small {
  display: block;
  margin-top: 10px;
  color: #d0d0d0;
  letter-spacing: 0.06em;
}

.library-total {
  min-width: 118px;
  padding-left: 22px;
  border-left: 1px solid #414141;
  text-align: right;
}

.library-total strong {
  display: block;
  color: var(--gold-light);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2.6rem;
  line-height: 0.85;
}

.library-total span {
  display: block;
  margin-top: 7px;
  color: #c7c7c7;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.search-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 14px rgba(17, 17, 17, 0.08);
  backdrop-filter: blur(12px);
}

.search-toolbar-inner {
  width: min(100% - 32px, var(--content));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-field {
  position: relative;
  width: min(100%, 760px);
  display: flex;
  align-items: center;
}

.search-field > svg {
  position: absolute;
  left: 17px;
  width: 23px;
  height: 23px;
  color: var(--red);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 52px;
  padding: 0 54px 0 52px;
  color: var(--black);
  background: var(--paper);
  border: 2px solid var(--black);
  border-radius: 4px;
  outline: none;
}

.search-field input::placeholder {
  color: #74787c;
}

.search-field input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(11, 111, 164, 0.18);
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.clear-search {
  position: absolute;
  right: 4px;
  color: var(--ink);
  background: transparent;
}

.clear-search:hover {
  background: #eceeef;
}

.mobile-category-control {
  display: none;
}

.library-shell {
  width: min(100% - 32px, var(--content));
  margin: 32px auto 80px;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.category-sidebar {
  position: sticky;
  top: 116px;
  padding-bottom: 24px;
  border-bottom: 4px solid var(--gold);
}

.sidebar-heading {
  padding: 16px 18px;
  color: var(--paper);
  background: var(--black);
  border-left: 5px solid var(--gold);
}

.sidebar-heading p {
  color: var(--gold-light);
}

.sidebar-heading h2,
.results-heading h2,
.category-section h3,
.empty-results h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-heading h2 {
  margin-top: 2px;
  font-size: 1.7rem;
  text-transform: uppercase;
}

#category-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
}

.category-button {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e6e7e8;
  text-align: left;
  cursor: pointer;
}

.category-button:last-child {
  border-bottom: 0;
}

.category-button span:first-child {
  line-height: 1.15;
}

.category-button span:last-child {
  min-width: 28px;
  padding: 3px 6px;
  color: var(--muted);
  background: #eceeef;
  border-radius: 3px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.category-button:hover {
  background: #f6f2eb;
}

.category-button.is-active {
  color: var(--black);
  background: #ead8b8;
  box-shadow: inset 5px 0 0 var(--gold);
  font-weight: 700;
}

.category-button.is-active span:last-child {
  color: var(--paper);
  background: var(--black);
}

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

.results-heading {
  min-height: 74px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 16px;
  border-bottom: 3px solid var(--black);
}

.results-heading p {
  color: var(--red);
}

.results-heading h2 {
  margin-top: 2px;
  font-size: 2.35rem;
  line-height: 1;
  text-transform: uppercase;
}

.results-heading > span {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

#document-list {
  animation: reveal 360ms ease-out both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-section {
  margin-top: 28px;
}

.category-section h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--black);
  font-size: 1.42rem;
  line-height: 1;
  text-transform: uppercase;
}

.category-section h3::before {
  content: "";
  width: 6px;
  height: 22px;
  background: var(--gold);
}

.category-section h3 span {
  color: var(--muted);
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: 0.73rem;
}

.document-group {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--black);
}

.document-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

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

.document-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  text-decoration: none;
}

.document-main:hover {
  background: #f7f4ee;
}

.pdf-mark {
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--red);
  border-radius: 3px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.12);
}

.pdf-mark svg {
  width: 23px;
  height: 23px;
}

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

.document-copy strong {
  display: block;
  color: var(--black);
  font-size: 1rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.document-meta span {
  position: relative;
}

.document-meta span + span::before {
  content: "•";
  position: absolute;
  left: -8px;
  color: #a4a7aa;
}

.download-link {
  display: grid;
  place-items: center;
  color: var(--black);
  border-left: 1px solid var(--line);
}

.download-link:hover {
  color: var(--paper);
  background: var(--black);
}

.download-link:focus-visible,
.document-main:focus-visible,
.category-button:focus-visible,
.icon-button:focus-visible,
.reset-button:focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.download-link svg {
  width: 21px;
  height: 21px;
}

.empty-results {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
  background: var(--paper);
  border-bottom: 5px solid var(--gold);
}

.empty-results > svg {
  width: 42px;
  height: 42px;
  color: var(--red);
}

.empty-results h2 {
  font-size: 2rem;
  text-transform: uppercase;
}

.empty-results p {
  margin: 0;
  color: var(--muted);
}

.reset-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 16px;
  color: var(--paper);
  background: var(--black);
  border: 0;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.reset-button:hover {
  background: var(--red);
}

.reset-button svg {
  width: 18px;
  height: 18px;
}

footer {
  min-height: 112px;
  display: grid;
  grid-template-columns: 64px auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 24px max(24px, calc((100vw - var(--content)) / 2));
  color: #d1d1d1;
  background: var(--black);
  border-top: 7px solid var(--gold);
}

footer img {
  width: 64px;
  height: 48px;
  object-fit: contain;
  background: var(--paper);
}

footer strong,
footer span {
  display: block;
}

footer span,
footer p {
  font-size: 0.78rem;
}

footer p {
  justify-self: end;
  margin: 0;
  color: #aeb0b2;
  text-align: right;
}

.back-to-top {
  position: fixed;
  right: max(18px, calc((100vw - var(--content)) / 2));
  bottom: 18px;
  z-index: 20;
  color: var(--paper);
  background: var(--red);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.24);
}

.back-to-top:hover {
  background: var(--black);
}

@media (max-width: 820px) {
  .masthead-inner {
    min-height: 112px;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
  }

  .school-logo {
    width: 92px;
    height: 67px;
    border-width: 2px;
  }

  .brand-copy h1 {
    font-size: 2.55rem;
  }

  .brand-copy p {
    font-size: 0.66rem;
  }

  .brand-copy small {
    margin-top: 7px;
    font-size: 0.65rem;
  }

  .library-total {
    display: none;
  }

  .search-toolbar-inner {
    min-height: 132px;
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    padding: 12px 0;
  }

  .search-field {
    width: 100%;
  }

  .search-field input {
    height: 50px;
    font-size: 0.94rem;
  }

  .mobile-category-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .mobile-category-control span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .mobile-category-control select {
    min-width: 0;
    height: 40px;
    padding: 0 34px 0 11px;
    color: var(--black);
    background: var(--paper);
    border: 1px solid #8f9397;
    border-radius: 4px;
    font-size: 0.84rem;
    font-weight: 700;
  }

  .library-shell {
    width: min(100% - 24px, var(--content));
    margin-top: 24px;
    grid-template-columns: minmax(0, 1fr);
  }

  .category-sidebar {
    display: none;
  }

  .results-heading {
    min-height: 64px;
  }

  .results-heading h2 {
    font-size: 1.85rem;
  }

  .results-heading > span {
    font-size: 0.73rem;
  }

  .category-section {
    margin-top: 23px;
  }

  .document-main {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    padding: 12px;
  }

  .pdf-mark {
    width: 37px;
    height: 44px;
  }

  .document-copy strong {
    font-size: 0.96rem;
  }

  .document-meta {
    font-size: 0.7rem;
  }

  footer {
    grid-template-columns: 52px 1fr;
    padding: 22px 20px;
  }

  footer img {
    width: 52px;
    height: 40px;
  }

  footer p {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 430px) {
  .masthead-inner {
    width: calc(100% - 24px);
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 13px;
  }

  .school-logo {
    width: 74px;
    height: 56px;
  }

  .brand-copy h1 {
    font-size: 2.15rem;
  }

  .brand-copy p {
    white-space: nowrap;
    font-size: 0.6rem;
  }

  .search-toolbar-inner {
    width: calc(100% - 24px);
  }

  .search-field input {
    padding-left: 46px;
    font-size: 0.88rem;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .results-heading > span {
    padding-bottom: 0;
  }

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

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

  #document-list {
    animation: none;
  }
}
