/* The site's reading pages, the font page (font.html) and each map's About page
   (about.html): leaves of vellum on the dark of the room, in the map's palette (style.css:
   iron-gall ink, rubric, indigo, vermilion, the paper grain). What they share is here: the
   colours, the room, the leaf and its neatlines, the bar along the top and the foot. Each
   page's own sheet (font.css, about.css) adds the rest. */

:root {
  --room: #0b0908;
  --paper: #efe4c8;
  --vellum: 237, 226, 196;
  --ink: #2a1d14;
  --ink-soft: #4a3828;
  --sepia: #6e5841;
  --rubric: #9a2414;
  --indigo: #24406f;
  --vermilion: #8c1d12;
  --rule: rgba(42, 29, 20, 0.32);
  /* The book serif that is on every system: the viewer's --ui-serif, which a map's
     fonts.css names as its hands' fallback. */
  --ui-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --serif: var(--ui-serif);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .34  0 0 0 0 .26  0 0 0 0 .17  0 0 0 .11 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background: var(--room);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, #2a2119 0%, var(--room) 72%) no-repeat, var(--room);
  color: var(--paper);
  font: 18px/1.55 var(--serif);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  overflow-x: hidden;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}

a { color: var(--indigo); text-decoration: none; border-bottom: 0.5px solid rgba(36, 64, 111, 0.5); }
a:hover { color: var(--rubric); border-bottom-color: var(--rubric); }
:focus-visible { outline: 1px dotted var(--rubric); outline-offset: 3px; }
code { font-family: var(--mono); font-size: 0.84em; }
button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── the room: a bar of links along the top ── */
.topbar {
  max-width: 1160px;
  margin: 0 auto;
  padding: max(6px, env(safe-area-inset-top, 0)) 16px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar a {
  display: inline-block;
  padding: 12px 0;
  line-height: 20px;
  color: rgba(239, 228, 200, 0.82);
  border: 0;
  font-style: italic;
  font-size: 16px;
}
.topbar a:hover { color: var(--paper); }
.topbar .home span[aria-hidden] { margin-right: 0.4em; font-style: normal; }

/* ── a leaf of vellum, with a double neatline inside its edge ── */
.leaf {
  position: relative;
  margin: 0 auto 28px;
  padding: clamp(30px, 4.4vw, 60px) clamp(22px, 5.2vw, 68px);
  background-color: rgb(var(--vellum));
  background-image: var(--paper-grain);
  color: var(--ink);
  border-radius: 1px 2px 1px 3px / 2px 1px 3px 1px;
  box-shadow: 0 0 0 0.5px rgba(60, 40, 20, 0.5), 0.4em 0.8em 2.4em -0.4em rgba(0, 0, 0, 0.7);
}
.leaf::before, .leaf::after { content: ""; position: absolute; pointer-events: none; }
.leaf::before { inset: 7px; border: 1px solid rgba(42, 29, 20, 0.45); }
.leaf::after { inset: 11px; border: 0.5px solid rgba(42, 29, 20, 0.28); }
.leaf[hidden] { display: none; }

/* ── the foot: back to the map, and the public copy's notice ── */
.foot { text-align: center; padding: 0.6em 0 2em; color: rgba(239, 228, 200, 0.7); }
.foot a { color: #e7c98a; border-bottom-color: rgba(231, 201, 138, 0.45); display: inline-flex; align-items: center; min-height: 44px; }
.foot a:hover { color: var(--paper); }
.foot .small { font-size: 15px; }
.foot #notice { max-width: 40em; margin: 1em auto 0; padding: 0 16px; font-size: 13px; line-height: 1.45; color: rgba(239, 228, 200, 0.5); }

/* ── narrow screens ── */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .leaf { margin-bottom: 14px; padding: 34px 20px 30px; }
  .leaf::before { inset: 5px; }
  .leaf::after { inset: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
