:root {
  --ink: #120e0a;
  --ink-raised: #1c1611;
  --vellum: #e7dcc2;
  --vellum-dim: #b8ac90;
  --gold: #c9a227;
  --gold-bright: #e0bc4a;
  --rubric: #8b1e1e;
  --rubric-bright: #d95a4a;

  --font-display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, serif;

  --measure: 68ch;
  --edge: clamp(16px, 4vw, 56px);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--vellum);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--rubric);
  color: var(--vellum);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

a {
  color: var(--gold-bright);
}

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

/* Grain — the vellum's own texture, not decoration */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.24;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

/* Marginalia vine borders — collapse gracefully on narrow viewports */
.vine {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 44px;
  z-index: 1;
  pointer-events: none;
  background-repeat: repeat-y;
  background-size: 44px 140px;
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='140' viewBox='0 0 44 140'><path d='M22 0 C 6 18, 38 32, 22 50 C 6 68, 38 82, 22 100 C 6 118, 38 128, 22 140' fill='none' stroke='%23c9a227' stroke-width='1.4'/><circle cx='12' cy='24' r='2.6' fill='%238b1e1e'/><circle cx='32' cy='60' r='2.6' fill='%238b1e1e'/><circle cx='12' cy='96' r='2.6' fill='%238b1e1e'/><circle cx='32' cy='128' r='2.6' fill='%238b1e1e'/></svg>");
}

.vine--left {
  left: 0;
}

.vine--right {
  right: 0;
  transform: scaleX(-1);
}

@media (max-width: 900px) {
  .vine {
    width: 20px;
    opacity: 0.35;
  }
}

@media (max-width: 640px) {
  .vine {
    display: none;
  }
}

.page {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 120px) var(--edge) clamp(64px, 10vh, 140px);
}

/* The scratched-out dragon — a ghost of what this world lost */
.dragon-ghost {
  position: absolute;
  top: clamp(-10px, 2vh, 40px);
  right: 0;
  width: min(46vw, 340px);
  height: auto;
  z-index: 0;
  opacity: 0.16;
}

.dragon-ghost__body {
  fill: var(--vellum-dim);
  stroke: none;
}

.dragon-ghost__scratch line {
  stroke: var(--ink);
  stroke-width: 6;
  mix-blend-mode: multiply;
}

@media (max-width: 640px) {
  .dragon-ghost {
    width: 60vw;
    opacity: 0.12;
  }
}

.masthead {
  position: relative;
  text-align: center;
  margin-bottom: clamp(40px, 7vh, 72px);
}

.series-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  letter-spacing: 0.01em;
  color: var(--gold);
  margin: 0;
}

.book-subtitle {
  margin: 0.6em 0 0;
  font-size: 1.15rem;
  color: var(--vellum-dim);
  letter-spacing: 0.03em;
}

.book-subtitle em {
  color: var(--vellum);
  font-style: italic;
}

.blurb {
  position: relative;
  max-width: var(--measure);
  margin: 0 auto;
}

.blurb p {
  margin: 0 0 1.4em;
}

.blurb em {
  font-style: italic;
  color: var(--vellum);
}

.lede {
  font-size: 1.18rem;
}

.closer {
  color: var(--vellum-dim);
}

.drop-cap {
  float: left;
  font-family: var(--font-display);
  font-size: 4.6rem;
  line-height: 0.78;
  padding: 0.06em 0.1em 0 0;
  color: var(--gold);
  animation: ignite 2.4s ease-out both;
}

@keyframes ignite {
  0% {
    color: var(--rubric);
    transform: scale(0.94);
  }
  55% {
    color: var(--gold-bright);
    transform: scale(1.03);
  }
  100% {
    color: var(--gold);
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .drop-cap {
    animation: none;
    color: var(--gold);
  }
}

.signup {
  text-align: center;
  margin-top: clamp(56px, 9vh, 96px);
  padding-top: clamp(40px, 6vh, 64px);
  border-top: 1px solid rgba(201, 162, 39, 0.25);
}

.signup h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  color: var(--rubric-bright);
  margin: 0 0 0.5em;
}

.signup-copy {
  color: var(--vellum-dim);
  max-width: 46ch;
  margin: 0 auto 2.2em;
}

.seal-frame {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
  padding: 30px 18px 18px;
  border-radius: 4px;
  background: linear-gradient(178deg, #ece1c6, #d9cba3);
  box-shadow: 0 22px 55px -18px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(139, 30, 30, 0.25);
  transition: box-shadow 0.4s ease;
}

.seal-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(139, 30, 30, 0.3);
  border-radius: 2px;
  pointer-events: none;
}

.seal-frame:hover,
.seal-frame:focus-within {
  box-shadow: 0 22px 65px -14px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(139, 30, 30, 0.45);
}

.seal-frame__ring {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  opacity: 0.8;
}

.seal-frame__ring circle {
  fill: none;
  stroke: var(--rubric-bright);
  stroke-width: 2;
}

.colophon {
  text-align: center;
  margin-top: clamp(48px, 8vh, 88px);
  color: var(--vellum-dim);
  font-size: 0.85rem;
  opacity: 0.7;
}
