:root {
  --paper: #F3EFE6;
  --paper-deep: #ECE5D7;
  --paper-card: #F8F5EE;
  --ink: #1C1714;
  --ink-muted: #847B6E;
  --ink-muted-strong: #5E554A;
  --hairline: rgba(28, 23, 20, 0.16);
  --accent: #8B2E1F;
  --accent-soft: rgba(139, 46, 31, 0.08);

  /* Backwards-compatible aliases used in existing page styles. */
  --bg: var(--paper);
  --panel: var(--paper-card);
  --muted: var(--ink-muted-strong);
  --line: var(--hairline);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  font: 500 11px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

@media print {
  :root {
    --paper: #ffffff;
    --paper-deep: #ffffff;
    --paper-card: #ffffff;
    --ink: #000000;
    --ink-muted: #2f2f2f;
    --ink-muted-strong: #1f1f1f;
    --hairline: rgba(0, 0, 0, 0.22);
    --accent: #000000;
    --accent-soft: rgba(0, 0, 0, 0.05);
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.45;
  }

  .skip-link,
  .lang-switch,
  .download-row {
    display: none !important;
  }

  .page {
    max-width: none !important;
    margin: 0 !important;
    padding: 18mm 14mm !important;
  }

  .meta,
  footer,
  .biblio {
    break-inside: avoid;
  }

  h1,
  h2,
  h3,
  .chapter h2 {
    break-after: avoid-page;
  }

  p,
  li,
  blockquote,
  .chapter,
  .abstract,
  .toc {
    orphans: 3;
    widows: 3;
  }

  a,
  a:visited {
    color: #000000 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }

  @page {
    margin: 14mm;
  }
}
