:root {
  --content-width: 1440px;
}

.site-header {
  height: 70px;
  padding: 12px 20px;
}

.brand-symbol { width: 29px; height: 32px; }
.brand-symbol i { width: 19px; height: 25px; }
.state-panel { min-height: calc(100dvh - 70px); }
.access-view { min-height: calc(100dvh - 70px); padding-top: 22px; }
.access-art { min-height: 210px; }
.folder-shape { width: min(58vw, 230px); height: 154px; box-shadow: 8px 9px 0 var(--ink); }
.folder-shape::before { top: -25px; width: 90px; height: 27px; }
.folder-shape span { font-size: 1.4rem; }
.access-copy h1,
.error-panel h1 { font-size: clamp(2rem, 8vw, 3.5rem); }

.hero {
  min-height: auto;
  padding: 52px 20px 30px;
}

.hero h1 {
  max-width: 820px;
  margin: 18px 0 36px;
  font-size: clamp(3.25rem, 12vw, 7rem);
  line-height: .86;
}

.hero-bottom > p { max-width: 510px; font-size: .92rem; line-height: 1.5; }
.hero-meta strong { font-size: 2.15rem; }
.library { max-width: var(--content-width); margin: 0 auto; padding: 40px 20px 64px; }
.library-toolbar { gap: 20px; }
.library-toolbar h2 { font-size: clamp(1.85rem, 6vw, 3rem); }
.result-summary { margin: 26px 0 12px; }
.documents-grid { gap: 12px; }
.document-card { cursor: pointer; box-shadow: 0 1px 0 rgba(23, 32, 29, .03); transition: transform .18s ease, box-shadow .18s ease; }
.document-card:hover { transform: translateY(-2px); box-shadow: 0 7px 22px rgba(23, 32, 29, .08); }
.document-heading { grid-template-columns: 32px 1fr; gap: 8px; padding: 16px; }
.document-heading h3 { font-size: 1.28rem; line-height: 1.12; }
.document-heading p { margin-top: 7px; font-size: .78rem; line-height: 1.45; }
.media-frame { aspect-ratio: 16 / 10; }
figcaption { padding: 10px 12px; font-size: .74rem; }
.no-media { padding: 14px 16px; font-size: .76rem; }

.document-modal { width: min(920px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.document-modal::backdrop { background: rgba(23, 32, 29, .66); backdrop-filter: blur(4px); }
.modal-shell { display: flex; max-height: calc(100dvh - 26px); flex-direction: column; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 5px 0 0; font-family: var(--serif); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 400; line-height: 1; }
.modal-close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); background: transparent; font-size: 1.7rem; line-height: 1; }
.modal-close:hover { background: var(--acid); }
.modal-content { overflow: auto; padding: 20px; }
.modal-data { padding: 0 0 20px; }
.modal-data > p:last-child { margin: 8px 0 0; font-size: 1rem; line-height: 1.55; white-space: pre-wrap; }
.modal-gallery { display: grid; gap: 12px; }
.modal-gallery .media-item { border: 1px solid var(--line); }
.modal-gallery .media-actions { opacity: 1; transform: none; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.modal-footer p { min-height: 1em; margin: 0 auto 0 0; color: var(--accent); font-size: .76rem; font-weight: 700; }
.modal-footer .primary-button { width: auto; min-height: 46px; }

@media (min-width: 680px) { .modal-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (min-width: 760px) {
  .site-header { height: 76px; padding: 14px 5vw; }
  .access-view { min-height: calc(100dvh - 76px); gap: 5vw; padding: 42px 8vw; }
  .access-art { min-height: 400px; }
  .hero { padding: 62px 5vw 34px; }
  .hero h1 { margin: 24px 0 42px; }
  .library { padding: 56px 5vw 82px; }
  .documents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-card:nth-child(3n) { grid-column: auto; }
  .document-card:nth-child(3n) .media-gallery { grid-template-columns: 1fr; }
  .document-card:nth-child(3n) .media-item:only-child { grid-column: auto; }
  footer { padding: 20px 5vw; }
}

@media (min-width: 1100px) {
  .hero { padding-left: 6vw; padding-right: 6vw; }
  .library { padding-left: 6vw; padding-right: 6vw; }
  .documents-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .document-card,
  .document-card:nth-child(3n) { grid-column: auto; }
  .document-heading { min-height: 112px; }
}
