@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("./assets/source-sans-3-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("./assets/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "PT Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/pt-serif-cyrillic.woff2") format("woff2");
  unicode-range: U+0020, U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: light;
  --canvas: #f4f1e6;
  --paper: #fffdf6;
  --ink: #25372c;
  --secondary: #4e5e50;
  --line: #d4cdbb;
  --control-line: #838a76;
  --pine: #1e493c;
  --pine-light: #275447;
  --pine-dark: #1a4035;
  --panel-text: #fff9e7;
  --panel-secondary: #e2ebd7;
  --button: #f6e6b6;
  --button-hover: #fff1c7;
  --gutter: clamp(1rem, 4vw, 4rem);
  --body-font: "Source Sans 3", system-ui, sans-serif;
  --display-font: "PT Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 1rem / 1.5 var(--body-font);
}

h1, h2, h3, p, figure, dl, dd { margin: 0; }

::selection {
  color: var(--ink);
  background: #d9e5ce;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.container {
  width: min(1400px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  gap: 0.875rem;
}

.envelope-mark {
  position: relative;
  width: 1.875rem;
  height: 1.375rem;
  overflow: hidden;
  border: 1.5px solid currentColor;
  border-radius: 0.1875rem;
  color: var(--pine);
}

.envelope-mark::before {
  position: absolute;
  top: -0.5625rem;
  left: 0.3125rem;
  width: 1rem;
  height: 1rem;
  transform: rotate(45deg);
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  content: "";
}

.wordmark {
  font: 400 1.75rem / 1.1 var(--display-font);
  letter-spacing: -0.025em;
}

.archive {
  display: grid;
  grid-template-columns: minmax(18rem, 25.5%) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  padding-block: 3.5rem 4.5rem;
}

.collection {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 26rem;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  overflow: hidden;
  padding: clamp(1.5rem, 2.5vw, 2.5rem);
  border-radius: 1rem;
  color: var(--panel-text);
  background: var(--pine);
}

.collection::before,
.collection::after {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 55%;
  pointer-events: none;
  content: "";
}

.collection::before {
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  background: var(--pine-light);
}

.collection::after {
  clip-path: polygon(100% 5%, 100% 100%, 0 100%);
  background: var(--pine-dark);
}

.collection h1 {
  max-width: 10ch;
  font: 400 3.125rem / 1.05 var(--display-font);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.collection-copy p {
  max-width: 30ch;
  margin-top: 1.125rem;
  color: var(--panel-secondary);
  font-size: 1.1875rem;
}

.collection-action {
  display: grid;
  justify-items: start;
  gap: 0.625rem;
  color: var(--panel-secondary);
}

.bundle-link {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  padding: 0.5rem 1.125rem;
  border-radius: 0.4375rem;
  color: var(--ink);
  background: var(--button);
  font-weight: 650;
  text-decoration: none;
}

.bundle-link:focus-visible { outline-color: var(--panel-text); }

.library-bar, .library-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.library-bar {
  min-height: 2.75rem;
  justify-content: space-between;
  margin-bottom: 1.125rem;
}

.library h2 {
  font-size: 1.625rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.file-count, .file-description, .file-size { color: var(--secondary); }

.search { width: min(15.5rem, 100%); }

.search input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--control-line);
  border-radius: 0.4375rem;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}

.search input::placeholder { color: var(--secondary); opacity: 1; }

.file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-card {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--paper);
}

.file-preview {
  height: 9.125rem;
  overflow: hidden;
  padding: 1.25rem 1.25rem 0;
  border-bottom: 1px solid var(--line);
  background: #eae2cc;
}

.file-preview-schedule { background: #dfe7d5; }
.file-preview-notes { background: #e4e3d9; }
.file-preview-materials { background: #ebdfc9; }

.preview-sheet {
  width: min(100%, 17rem);
  min-height: 8.875rem;
  margin-inline: auto;
  padding: 0.75rem 0.9375rem;
  border: 1px solid var(--line);
  border-radius: 0.3125rem 0.3125rem 0 0;
  background: var(--paper);
  font-size: 0.875rem;
  line-height: 1.35;
}

.preview-title {
  margin-bottom: 0.4375rem;
  font: 400 1.0625rem / 1.2 var(--display-font);
}

.preview-sheet ol, .preview-sheet ul {
  margin: 0;
  padding-inline-start: 1.0625rem;
}

.preview-sheet li + li { margin-top: 0.25rem; }

.preview-times div, .preview-notes div {
  display: flex;
  gap: 0.625rem;
  padding-block: 0.1875rem;
}

.preview-times dt {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.preview-notes dd {
  min-width: 1rem;
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.preview-sheet .preview-checklist {
  padding: 0;
  list-style: none;
}

.preview-checklist li {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
}

.preview-checklist li::before {
  width: 0.625rem;
  height: 0.625rem;
  flex: 0 0 auto;
  border: 1px solid var(--control-line);
  border-radius: 1px;
  content: "";
}

.file-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.875rem 1.125rem 0.75rem;
}

.file-name {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.file-description { margin-top: 0.1875rem; }

.file-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.file-size { font-variant-numeric: tabular-nums; }

.file-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding-inline: 0.625rem;
  border-radius: 0.375rem;
  color: var(--pine);
  font-weight: 650;
  text-underline-offset: 0.1875rem;
}

.empty-results {
  padding: 2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  background: var(--paper);
  color: var(--secondary);
}

.empty-results strong { color: var(--ink); }

@media (hover: hover) {
  .bundle-link:hover { background: var(--button-hover); }
  .file-link:hover { background: #e9efde; }
}

@media (max-width: 56rem) {
  .archive {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 2.5rem 3.5rem;
  }

  .collection {
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: end;
    gap: 1.75rem;
  }

  .collection h1 { max-width: none; }
}

@media (max-width: 38rem) {
  .masthead-inner { min-height: 4rem; }

  .archive {
    gap: 1.875rem;
    padding-top: 1.5rem;
  }

  .collection {
    flex-direction: column;
    align-items: start;
  }

  .collection h1 { font-size: 2.375rem; }
  .collection-copy p { margin-top: 0.75rem; }
  .search { width: 100%; }
  .file-grid { grid-template-columns: minmax(0, 1fr); }
}
