/* Pontar Online: the public website (Lane B, step B4).
   Plain pages, no script, no cookies, nothing loaded from anywhere but this
   site (the Content-Security-Policy in deploy/Caddyfile allows nothing else).
   The look: a parchment notice on a dark table, with a scribe's habits:
   illuminated initials, red rubrics, knotwork, a manicule for a note, a seal. */

@font-face { font-family: "Fell"; src: url("fonts/im-fell-english-roman.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Fell"; src: url("fonts/im-fell-english-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Fell SC"; src: url("fonts/im-fell-english-sc.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Fraktur"; src: url("fonts/unifrakturmaguntia.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel-variable.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  --wood: #1c120b;
  --wood-2: #2c1d12;
  --parchment: #efe1c0;
  --parchment-dark: #d9c39a;
  --ink: #2a1b10;
  --ink-soft: #4a3320;
  --rubric: #8b1a1a;
  --gold: #c99a2e;
  --gold-light: #f2d37a;
  --river: #3d5266;
  --wax: #7d1a1f;
  --wax-dark: #520d12;
  --on-wood: #e9d6b0;
  --measure: 46rem;
}

* { box-sizing: border-box; }

html { background: var(--wood); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Fell", "Iowan Old Style", Georgia, serif;
  font-size: 1.18rem;
  line-height: 1.6;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 80, 40, 0.35), transparent 60%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--wood-2), var(--wood));
  background-attachment: fixed;
}

a { color: var(--rubric); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: #5e0f0f; }
a:focus-visible, .seal-btn:focus-visible, .ink-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--parchment); color: var(--ink); padding: 0.5em 1em; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---- the bar above the parchment ---- */

.topbar {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem 1rem 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--on-wood);
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
}
.brand img { width: 2.4rem; height: 2.4rem; }
.brand:hover { color: var(--gold-light); }

.nav { display: flex; flex-wrap: wrap; gap: 0.2rem 0; margin: 0; padding: 0; list-style: none; }
.nav li + li::before { content: "\00b7"; content: "\00b7" / ""; color: var(--gold); padding: 0 0.6rem; }
.nav a {
  color: var(--on-wood);
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-light); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 0.4em; }

/* ---- the parchment ---- */

.sheet-wrap {
  max-width: 64rem;
  margin: 0.4rem auto 2.5rem;
  padding: 0 0.75rem;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.sheet {
  position: relative;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 6vw, 5rem) clamp(2.5rem, 6vw, 4rem);
  background:
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(120, 78, 30, 0.28) 100%),
    radial-gradient(circle at 12% 18%, rgba(140, 95, 40, 0.12), transparent 22%),
    radial-gradient(circle at 85% 72%, rgba(140, 95, 40, 0.14), transparent 26%),
    url("img/parchment.svg"),
    var(--parchment);
  background-size: auto, auto, auto, 400px 400px, auto;
  /* a deckled edge: the parchment's own ragged border */
  clip-path: polygon(
    0% 10px, 3% 3px, 6% 9px, 9% 2px, 13% 8px, 17% 4px, 21% 10px, 25% 3px, 29% 7px, 33% 2px, 37% 9px, 41% 4px, 45% 8px, 49% 2px,
    53% 7px, 57% 3px, 61% 10px, 65% 4px, 69% 8px, 73% 2px, 77% 9px, 81% 5px, 85% 8px, 89% 2px, 93% 9px, 97% 4px, 100% 9px,
    calc(100% - 4px) 25%, 100% 50%, calc(100% - 5px) 75%,
    100% calc(100% - 8px), 97% calc(100% - 2px), 93% calc(100% - 9px), 89% calc(100% - 3px), 85% calc(100% - 8px), 81% calc(100% - 2px),
    77% calc(100% - 10px), 73% calc(100% - 4px), 69% calc(100% - 8px), 65% calc(100% - 2px), 61% calc(100% - 9px), 57% calc(100% - 3px),
    53% calc(100% - 7px), 49% calc(100% - 2px), 45% calc(100% - 9px), 41% calc(100% - 4px), 37% calc(100% - 8px), 33% calc(100% - 2px),
    29% calc(100% - 10px), 25% calc(100% - 3px), 21% calc(100% - 8px), 17% calc(100% - 2px), 13% calc(100% - 9px), 9% calc(100% - 4px),
    6% calc(100% - 8px), 3% calc(100% - 2px), 0% calc(100% - 9px),
    5px 75%, 0% 50%, 4px 25%
  );
}

.sheet > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.sheet > .wide { max-width: none; }

/* ---- type ---- */

.wordmark {
  font-family: "Fraktur", "Fell", serif;
  font-weight: 400;
  font-size: clamp(3.2rem, 11vw, 6.2rem);
  line-height: 1;
  text-align: center;
  color: var(--ink);
  margin: 0.2rem auto 0.4rem;
  letter-spacing: 0.01em;
}
.wordmark .cap { color: var(--rubric); }

.tagline {
  text-align: center;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-soft);
  margin-top: 0;
}

h1.title {
  font-family: "Fraktur", "Fell", serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  line-height: 1.05;
  text-align: center;
  margin: 0 auto 0.3rem;
}
h1.title .cap { color: var(--rubric); }

h2 {
  font-family: "Fell SC", "Fell", serif;
  font-weight: 400;
  color: var(--rubric);
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  text-align: center;
  margin: 2.6rem auto 0.3rem;
}

h3 {
  font-family: "Fell SC", "Fell", serif;
  font-weight: 400;
  color: var(--ink);
  font-size: 1.3rem;
  margin: 1.6rem auto 0.3rem;
}

.divider {
  display: block;
  width: min(20rem, 80%);
  height: 1.3rem;
  margin: 0.2rem auto 1.4rem;
  background: url("img/divider.svg") center / contain no-repeat;
}

p { margin: 0 auto 1rem; }

/* the illuminated initial, and the first line set in small capitals, as a scribe began a chapter */
.illuminated::first-letter {
  float: left;
  font-family: "Fraktur", serif;
  font-size: 4.3em;
  line-height: 0.82;
  padding: 0.14em 0.13em 0.06em;
  margin: 0.06em 0.14em 0 0;
  color: var(--gold-light);
  text-shadow: 0 1px 0 #5c3d0c, 0 0 1px #5c3d0c;
  background: url("img/illum.svg") center / 100% 100% no-repeat;
}
.illuminated::first-line { font-family: "Fell SC", "Fell", serif; letter-spacing: 0.03em; }

/* a manicule: the pointing hand in the margin that says "mark this" */
.nota { position: relative; padding-left: 2.1rem; font-style: italic; }
.nota::before {
  content: "\261E"; content: "\261E" / "";
  position: absolute;
  left: 0;
  top: -0.12em;
  font-size: 1.55rem;
  font-style: normal;
  color: var(--rubric);
}

ul.fleurons { list-style: none; padding: 0; }
ul.fleurons li { position: relative; padding-left: 1.9rem; margin-bottom: 0.9rem; }
ul.fleurons li::before { content: "\2767"; content: "\2767" / ""; position: absolute; left: 0; top: -0.05em; color: var(--rubric); font-size: 1.15em; }
ul.fleurons strong { font-family: "Fell SC", "Fell", serif; font-weight: 400; font-size: 1.08em; }

ol.roman { list-style: upper-roman; padding-left: 2.6rem; }
ol.roman li { margin-bottom: 0.9rem; padding-left: 0.3rem; }
ol.roman li::marker { color: var(--rubric); font-family: "Fell SC", "Fell", serif; }
ol.roman strong { font-family: "Fell SC", "Fell", serif; font-weight: 400; font-size: 1.08em; }

/* ---- a proclamation ---- */

.proclamation {
  border: 4px double var(--ink-soft);
  padding: 1.1rem 1.4rem 0.5rem;
  margin: 1.8rem auto;
  background: rgba(139, 26, 26, 0.05);
  text-align: center;
}
.proclamation .hear {
  display: block;
  font-family: "Fraktur", serif;
  font-size: 2rem;
  color: var(--rubric);
  line-height: 1;
  margin-bottom: 0.4rem;
}

/* ---- buttons: a wax seal, and a plain one in ink ---- */

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.4rem; margin: 1.6rem auto; }

.seal-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.55rem 1.4rem 0.55rem 3.6rem;
  color: #f7e6c4;
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #8e2228, var(--wax) 55%, var(--wax-dark));
  border-radius: 999px 0.4rem 0.4rem 999px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, 0.2), 0 3px 6px rgba(40, 10, 5, 0.45);
}
.seal-btn::before {
  content: "";
  position: absolute;
  left: -0.4rem;
  top: 50%;
  width: 3.6rem;
  height: 3.6rem;
  transform: translateY(-50%) rotate(-8deg);
  background: url("img/seal.svg") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(40, 10, 5, 0.5));
}
.seal-btn:hover { color: #fff3dc; background: linear-gradient(180deg, #a1282f, #8a1d23 55%, var(--wax-dark)); }

.ink-btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.55rem 1.4rem;
  color: var(--ink);
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--ink-soft);
  border-radius: 0.3rem;
  background: rgba(255, 248, 230, 0.35);
}
.ink-btn:hover { background: rgba(255, 248, 230, 0.7); color: var(--ink); }

/* ---- the map ---- */

figure.map { margin: 1.4rem auto 2rem; max-width: 44rem; }
.map-scroll { overflow-x: auto; }
figure.map figcaption { text-align: center; font-style: italic; color: var(--ink-soft); font-size: 1rem; margin-top: 0.4rem; }
.realm-map { width: 100%; height: auto; display: block; }
.realm-map .sea { fill: #d6c294; }
.realm-map .land { fill: #ebdbb5; }
.realm-map .coast { fill: none; stroke: #5b3a1c; stroke-width: 1.8; }
.realm-map .waves path, .realm-map .serpent path { fill: none; stroke: #6d4d2e; stroke-width: 1.2; stroke-linecap: round; }
.realm-map .serpent .ink { fill: #3b2412; }
.realm-map .ship path, .realm-map .ship line { fill: #ebdbb5; stroke: #3b2412; stroke-width: 1.2; }
.realm-map .river { fill: none; stroke: #9db0bf; stroke-width: 10; stroke-linecap: round; opacity: 0.85; }
.realm-map .river-line { fill: none; stroke: var(--river); stroke-width: 1.3; stroke-linecap: round; }
.realm-map .relief path { fill: none; stroke: #5b3a1c; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.realm-map .town rect, .realm-map .town path { fill: #ebdbb5; stroke: #3b2412; stroke-width: 1.3; stroke-linejoin: round; }
.realm-map .town line { stroke: #3b2412; stroke-width: 1.2; }
.realm-map .town .pen { fill: var(--rubric); stroke: none; }
.realm-map .pennant line { stroke: #3b2412; stroke-width: 1.3; }
.realm-map .redania path { fill: #b3202a; stroke: #5a0d12; stroke-width: 0.8; }
.realm-map .nilfgaard path { fill: #1d1a17; stroke: #c9a227; stroke-width: 1; }
.realm-map text { font-family: "Fell", Georgia, serif; fill: var(--ink); }
.realm-map .region { font-family: "Fell SC", "Fell", serif; font-size: 30px; letter-spacing: 0.22em; fill: #6b3a17; }
.realm-map .place { font-style: italic; font-size: 16px; }
.realm-map .note { font-style: italic; font-size: 13px; fill: var(--rubric); }
.realm-map .river-name { font-style: italic; font-size: 16px; fill: var(--river); }
.realm-map .sea-name { font-style: italic; font-size: 15px; fill: #5b3a1c; letter-spacing: 0.1em; }
.realm-map .compass circle { fill: none; stroke: #3b2412; stroke-width: 1.1; }
.realm-map .compass path { fill: #ebdbb5; stroke: #3b2412; stroke-width: 1; }
.realm-map .compass .fill-ink { fill: #3b2412; }
.realm-map .compass .fill-red { fill: var(--rubric); }
.realm-map .compass-n { font-family: "Fell SC", serif; font-size: 15px; fill: var(--rubric); }
.realm-map .frame { fill: none; stroke: #5b3a1c; stroke-width: 2.5; }

/* ---- the colophon at the foot ---- */

.colophon {
  max-width: 50rem;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
  text-align: center;
  color: var(--on-wood);
  font-size: 0.98rem;
  line-height: 1.55;
}
.colophon a { color: var(--gold-light); }
.colophon .fanwork { font-style: italic; color: #cdb88f; }
.colophon .anno { font-family: "Fell SC", "Fell", serif; letter-spacing: 0.08em; color: var(--gold-light); }

@media (max-width: 40rem) {
  body { font-size: 1.08rem; }
  /* on a phone the map keeps a readable size and scrolls sideways within its frame */
  .realm-map { min-width: 34rem; }
  .topbar { justify-content: center; }
  .nav { justify-content: center; }
  h2 { font-size: 1.55rem; }
  .illuminated::first-letter { font-size: 3.6em; }
}

@media print {
  html, body { background: #fff; }
  .topbar .nav, .skip { display: none; }
  .sheet-wrap { filter: none; }
  .sheet { clip-path: none; background: #fff; }
}
.center { text-align: center; }
