:root {
  color-scheme: light;
  --background: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d211d;
  --muted: #687069;
  --line: #dcded8;
  --accent: #285943;
  --accent-hover: #1d4332;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--background);
  color: var(--ink);
}

a {
  color: inherit;
}

.container {
  width: min(70rem, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  padding: clamp(2rem, 4vw, 3.25rem) 0;
  border-bottom: 1px solid var(--line);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 0.7fr) minmax(18rem, 1fr);
  align-items: end;
  gap: clamp(2rem, 7vw, 7rem);
}

.eyebrow,
.document-type,
.viewer-title p {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.intro {
  max-width: 38rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.library {
  padding-block: 3rem;
}

.collection + .collection {
  margin-top: 4rem;
}

.collection h2 {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.document-card {
  display: flex;
  min-height: 13rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.document-card h3 {
  margin-bottom: 0.65rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.15;
}

.document-path {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}

.document-description {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  justify-content: end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-hover);
}

.empty-state {
  padding: 4rem;
  border: 1px dashed var(--line);
  border-radius: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.footer {
  padding-block: 1rem 3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.viewer-header {
  display: grid;
  min-height: 5rem;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.viewer-header > .button {
  justify-self: end;
}

.back-link {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.viewer-title {
  text-align: center;
}

.viewer-title p {
  margin-bottom: 0.2rem;
}

.viewer-title h1 {
  max-width: none;
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.viewer-title span {
  display: block;
  max-width: 42rem;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.pdf-frame {
  height: calc(100vh - 5rem);
  padding: 1rem;
}

.pdf-frame object {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.pdf-fallback {
  display: grid;
  min-height: 20rem;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
}

@media (max-width: 40rem) {
  .hero-layout {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.25rem;
  }

  .hero h1 {
    font-size: 2.35rem;
  }

  .viewer-header {
    grid-template-columns: 1fr auto;
  }

  .viewer-title {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }

  .pdf-frame {
    height: calc(100vh - 7.5rem);
    padding: 0;
  }

  .pdf-frame object {
    border: 0;
    border-radius: 0;
  }
}
