/* ── DOCUMENT VIEWER ─────────────────────────────────────── */

.document-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.document-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.document-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(120, 86, 34, 0.12), transparent 35%),
    rgba(3, 3, 6, 0.88);
  backdrop-filter: blur(8px);
}

body.motion-lite .document-backdrop {
  backdrop-filter: blur(5px);
}

body.motion-reduced .document-backdrop {
  backdrop-filter: none;
}

.document-container {
  position: relative;
  z-index: 1;
  width: min(1120px, 94vw);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(205, 175, 118, 0.18);
  background:
    radial-gradient(circle at top right, rgba(174, 133, 59, 0.14) 0%, transparent 32%),
    linear-gradient(180deg, #151517 0%, #0f1012 52%, #0b0c0e 100%);
  box-shadow:
    0 36px 120px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.document-container::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 22px;
  border: 1px solid rgba(205, 175, 118, 0.08);
  pointer-events: none;
}

.document-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  color: #eadcc0;
  background: rgba(234, 220, 192, 0.1);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.document-close:hover {
  transform: translateY(-1px);
  background: rgba(234, 220, 192, 0.18);
}

.document-close:focus-visible {
  outline: 2px solid rgba(234, 220, 192, 0.75);
  outline-offset: 3px;
}

.document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 72px 18px 28px;
  border-bottom: 1px solid rgba(234, 220, 192, 0.08);
}

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

.document-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-case);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(234, 220, 192, 0.62);
}

.document-title {
  margin: 0;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.15;
  color: #f8f1df;
}

.document-issuer {
  margin: 6px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: rgba(248, 241, 223, 0.82);
}

.document-meta {
  margin: 8px 0 0;
  font-family: var(--font-case);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(205, 175, 118, 0.72);
}

.document-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.document-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(205, 175, 118, 0.26);
  background: linear-gradient(180deg, rgba(205, 175, 118, 0.18) 0%, rgba(205, 175, 118, 0.08) 100%);
  font-family: var(--font-case);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f3e6c6;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.document-open-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(205, 175, 118, 0.4);
  background: linear-gradient(180deg, rgba(205, 175, 118, 0.26) 0%, rgba(205, 175, 118, 0.12) 100%);
}

.document-open-link:focus-visible {
  outline: 2px solid rgba(243, 230, 198, 0.75);
  outline-offset: 3px;
}

.document-chamber {
  padding: 20px 24px 24px;
}

.document-frame-shell {
  overflow: hidden;
  height: min(72vh, 820px);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(251, 246, 235, 0.96) 0%, rgba(232, 220, 195, 0.92) 100%);
  border: 1px solid rgba(205, 175, 118, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 24px 50px rgba(0, 0, 0, 0.28);
}

.document-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.document-note {
  margin: 12px 4px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(248, 241, 223, 0.68);
}

@media (max-width: 720px) {
  .document-container {
    width: 96vw;
    max-height: calc(100vh - 20px);
    border-radius: 24px;
  }

  .document-header {
    flex-direction: column;
    padding: 20px 56px 14px 20px;
  }

  .document-actions {
    width: 100%;
    padding-top: 0;
  }

  .document-open-link {
    width: 100%;
  }

  .document-chamber {
    padding: 14px 14px 18px;
  }

  .document-frame-shell {
    height: calc(100vh - 250px);
    min-height: 420px;
    border-radius: 18px;
  }
}
