:root {
  color-scheme: dark;
  --ink: #f2e8d1;
  --muted: #bba98a;
  --walnut: #2d2017;
  --walnut-dark: #17100b;
  --brass: #c9a86a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--walnut-dark);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(201, 168, 106, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 106, 0.045) 1px, transparent 1px),
    radial-gradient(100% 65% at 50% 0%, #302116 0%, var(--walnut-dark) 72%);
  background-size: 32px 32px, 32px 32px, auto;
  font-family: "Source Serif 4", "Noto Serif SC", Georgia, serif;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid rgba(201, 168, 106, 0.55);
  background: rgba(23, 16, 11, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.identity {
  display: grid;
  gap: 3px;
}

.identity strong {
  font-size: 17px;
  font-weight: 600;
}

.eyebrow,
.toolbar nav,
.status,
.page-number {
  font-family: "IBM Plex Mono", Menlo, monospace;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.toolbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.toolbar a {
  padding: 9px 12px;
  border: 1px solid rgba(201, 168, 106, 0.58);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.toolbar a:hover,
.toolbar a:focus-visible {
  border-color: var(--brass);
  background: rgba(201, 168, 106, 0.12);
  outline: none;
}

.toolbar a.primary {
  color: #20150e;
  background: var(--ink);
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 32px 16px 72px;
}

.status {
  margin: 0;
  padding: 48px 16px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.status.error {
  color: #ffbd9c;
}

.document {
  display: grid;
  justify-items: center;
  gap: 34px;
}

.pdf-page {
  position: relative;
  width: 100%;
  border: 1px solid rgba(201, 168, 106, 0.35);
  background: white;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.44);
}

.pdf-page canvas {
  display: block;
  width: 100%;
  height: auto;
}

.link-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pdf-link {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 3px;
  pointer-events: auto;
}

.pdf-link:hover,
.pdf-link:focus-visible {
  background: rgba(168, 0, 55, 0.11);
  box-shadow: 0 0 0 2px rgba(168, 0, 55, 0.35);
  outline: none;
}

.page-number {
  position: absolute;
  right: 10px;
  bottom: -24px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

@media (max-width: 760px) {
  .toolbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar nav {
    justify-content: flex-start;
  }

  main {
    padding-top: 20px;
  }
}
