/* Accessibility layer: structure, focus, contrast, reflow, and motion preferences. */
:root {
  --vault: #221333;
  --vault-deep: #170c24;
  --coin: #f2b705;
  --lilac: #a28dbb;
  --parchment: #c9bcd9;
  --glint: #ffe9a3;
  --focus-ring: #ffe9a3;
}

html {
  color-scheme: dark;
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--glint);
  color: var(--vault-deep);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  border: 2px solid currentColor;
  border-radius: 0.35rem;
  transform: translateY(-180%);
  transition: transform 120ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

main {
  display: block;
  width: 100%;
}

a {
  color: var(--glint);
  text-decoration: underline;
  text-decoration-thickness: 0.11em;
  text-underline-offset: 0.18em;
}

a:visited {
  color: var(--parchment);
}

a:hover {
  text-decoration-thickness: 0.18em;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
}

.masthead-sub {
  font-size: 0.8rem;
}

.masthead-sub .line-two,
.hint {
  opacity: 1;
}

.eyebrow,
.hint {
  font-size: 0.85rem;
}

article,
.document-page {
  overflow-wrap: anywhere;
  word-break: normal;
}

.document-page {
  max-width: 72ch;
  margin-inline: auto;
}

.document-header,
.site-footer {
  width: 100%;
  max-width: 72ch;
  margin-inline: auto;
}

.document-header {
  margin-bottom: 2rem;
}

.document-subtitle {
  color: var(--lilac);
  font-style: italic;
  line-height: 1.55;
  margin: -0.2rem 0 1.5rem;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--lilac);
  font-size: 0.95rem;
  opacity: 1;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

figure {
  max-width: 100%;
  margin-block: 1.5rem;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--lilac);
  border-radius: 0.35rem;
  background: rgba(23, 12, 36, 0.72);
  white-space: pre;
  tab-size: 2;
}

code,
kbd,
samp,
pre {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

:not(pre) > code {
  padding: 0.08em 0.25em;
  border-radius: 0.2em;
  background: rgba(23, 12, 36, 0.72);
}

table {
  width: 100%;
  max-width: 100%;
  margin-block: 1.5rem;
  border-collapse: collapse;
  border-spacing: 0;
}

th,
td {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--lilac);
  text-align: start;
  vertical-align: top;
}

th {
  color: var(--glint);
  background: rgba(23, 12, 36, 0.58);
}

/* The manifest remains visually hidden until a keyboard user enters it. */
.vault-ledger:focus-within {
  position: fixed;
  inset: 1rem;
  z-index: 9999;
  width: auto;
  height: auto;
  margin: 0;
  padding: 1.25rem;
  overflow: auto;
  clip: auto;
  clip-path: none;
  white-space: normal;
  border: 2px solid var(--glint);
  border-radius: 0.5rem;
  background: var(--vault-deep);
  color: var(--parchment);
}

@media (max-width: 40rem) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  .lockup {
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 2rem;
  }

  .masthead-sub {
    white-space: normal;
    letter-spacing: 0.18em;
  }

  h1 {
    overflow-wrap: anywhere;
  }

  th,
  td {
    padding: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .skip-link,
  .vault-ledger:focus-within,
  pre,
  th,
  td {
    border-color: CanvasText;
  }

  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-color: Highlight;
  }
}

@media print {
  body {
    display: block;
    padding: 0;
    background: #fff;
    color: #000;
  }

  .skip-link,
  .vault-ledger,
  .site-footer {
    display: none !important;
  }

  a {
    color: #000;
  }
}
