/* The Godwhackers — landing page.
   The book's pages are laid out at a fixed "virtual" size (440 × 680) and scaled to fit,
   so the pagination in book.js stays identical at every screen size. */

:root {
  --night: #0b1020;
  --night-deep: #05070f;
  --dusk: #1c2548;
  --cloth: #17223f;
  --cloth-dark: #0e1630;
  --gold: #d9b561;
  --gold-light: #f4dd9a;
  --gold-dark: #a47b33;
  --paper: #f5eedd;
  --paper-shade: #e6dbc0;
  --ink: #2b2219;
  --ink-soft: #6b5d4b;
  --text: #ece4cf;
  --text-soft: #b9b09b;
  --page-w: 440px;
  --page-h: 680px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(224, 178, 92, 0.13), transparent 70%),
    radial-gradient(ellipse at 50% 30%, var(--dusk) 0%, var(--night) 55%, var(--night-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.55;
}

/* A faint field of stars. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8, transparent),
    radial-gradient(1px 1px at 27% 72%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 43% 11%, #fffa, transparent),
    radial-gradient(1px 1px at 61% 84%, #fff5, transparent),
    radial-gradient(1px 1px at 78% 23%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 89% 61%, #fff9, transparent),
    radial-gradient(1px 1px at 6% 52%, #fff5, transparent),
    radial-gradient(1px 1px at 94% 90%, #fff6, transparent),
    radial-gradient(1px 1px at 35% 44%, #fff4, transparent),
    radial-gradient(1px 1px at 70% 48%, #fff4, transparent);
}

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

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

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.25rem, 4vh, 3rem) 1rem 2rem;
}

/* ---------- The book ---------- */

.book-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

html:not(.js) .book-stage { display: none; }

/* Two pages side by side are 880 × 680; keep the open book within ~72% of the screen's height. */
.book-frame {
  width: min(1000px, 100%, calc(72vh * 880 / 680));
  transition: transform 0.9s cubic-bezier(0.22, 0.8, 0.3, 1);
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}

/* Closed, the book is one page wide: slide it to the middle. */
.book-frame.is-closed-front { transform: translateX(-25%); }
.book-frame.is-closed-back { transform: translateX(25%); }
.book-frame.is-portrait { transform: none; }

.book { margin: 0 auto; }

.page {
  background-color: var(--paper);
  overflow: hidden;
}

.page-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--page-w);
  height: var(--page-h);
  transform: scale(var(--page-scale, 1));
  transform-origin: 0 0;
}

/* Paper, darker toward the spine. */
.page.--soft {
  background:
    linear-gradient(90deg, rgba(120, 95, 55, 0.05), transparent 12%, transparent 88%, rgba(120, 95, 55, 0.05)),
    var(--paper);
}
.page.--soft.--left { box-shadow: inset -18px 0 30px -18px rgba(70, 50, 20, 0.45); }
.page.--soft.--right { box-shadow: inset 18px 0 30px -18px rgba(70, 50, 20, 0.45); }

/* Text pages */
.text-page { color: var(--ink); }

.running-head,
.folio {
  position: absolute;
  left: 48px;
  right: 48px;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink-soft);
}

.running-head {
  top: 28px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.folio {
  bottom: 26px;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.page-body {
  position: absolute;
  top: 60px;
  bottom: 62px;
  left: 48px;
  right: 48px;
  overflow: hidden;
  font-size: 16.5px;
  line-height: 1.5;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

.page-body p {
  margin: 0;
  text-indent: 1.35em;
}

.page-body p.first,
.page-body p.continued,
.page-body p.lines { text-indent: 0; }

.page-body p.first::first-line {
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

/* A paragraph broken across pages keeps a full last line. */
.page-body p.split { text-align-last: justify; }

.page-body .verse-line {
  display: block;
  margin: 0 0 0 1.6em;
  text-align: left;
  text-indent: -1em;
  padding-left: 1em;
  font-style: italic;
}
.page-body .verse-line.verse-first { margin-top: 0.6em; }
.page-body .verse-line.verse-last { margin-bottom: 0.6em; }

.page-body p.lines {
  margin-top: 0.9em;
  text-align: left;
  line-height: 1.45;
}

.opener {
  padding-top: 118px;
  margin-bottom: 30px;
  text-align: center;
}

.opener-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.opener-emblem {
  display: block;
  width: 28px;
  height: 28px;
  margin: 14px auto 0;
  color: var(--gold-dark);
}

/* Covers */
.page.--hard { background-color: var(--cloth); }

.cover {
  position: absolute;
  inset: 0;
  padding: 26px;
  color: var(--gold);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 40% 30%, #22305a, var(--cloth) 55%, var(--cloth-dark));
}

.cover-front { box-shadow: inset 14px 0 18px -10px rgba(0, 0, 0, 0.7), inset 3px 0 0 rgba(0, 0, 0, 0.35); }
.cover-back { box-shadow: inset -14px 0 18px -10px rgba(0, 0, 0, 0.7), inset -3px 0 0 rgba(0, 0, 0, 0.35); }

.cover-rule {
  height: 100%;
  border: 1.5px solid rgba(217, 181, 97, 0.75);
  outline: 1px solid rgba(217, 181, 97, 0.4);
  outline-offset: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 34px;
}

/* Gold foil, stamped. */
.cover-the,
.cover-title,
.cover-subtitle,
.cover-author,
.back-lede,
.back-site {
  background: linear-gradient(160deg, var(--gold-dark) 0%, var(--gold-light) 38%, var(--gold) 55%, #fff1c4 68%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.55));
  margin: 0;
}

.cover-the {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.cover-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  margin-top: -2px;
}

.cover-emblem {
  width: 150px;
  height: 150px;
  margin: 44px 0 40px;
  color: var(--gold);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 14px rgba(244, 221, 154, 0.18));
}

.cover-subtitle {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.cover-author {
  margin-top: 60px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.cover-back .cover-rule { justify-content: flex-start; padding-top: 70px; }

.back-lede {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.2;
  margin-bottom: 26px;
}

.back-copy {
  margin: 0 0 16px;
  color: #e3d6b4;
  font-size: 16px;
  line-height: 1.55;
  text-align: left;
}

.back-emblem {
  width: 54px;
  height: 54px;
  margin: auto 0 14px;
  color: var(--gold);
}

.back-site {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Endpapers */
.endpaper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 25% 25%, rgba(217, 181, 97, 0.35) 0 1.4px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(217, 181, 97, 0.25) 0 1px, transparent 1.6px),
    #1f2b4d;
  background-size: 34px 34px, 34px 34px, auto;
}

.bookplate {
  width: 250px;
  padding: 26px 22px;
  text-align: center;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--gold-dark);
  outline: 3px double rgba(164, 123, 51, 0.7);
  outline-offset: -9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: rotate(-1.2deg);
}

.bookplate-kicker {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 20px;
}

.bookplate-name {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.bookplate-note {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Title pages */
.title-page,
.title-verso,
.end-page {
  position: absolute;
  inset: 0;
  color: var(--ink);
  text-align: center;
}

.title-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 170px;
}

.title-page-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.title-page-subtitle {
  margin: 8px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 25px;
}

.title-page-emblem {
  width: 60px;
  height: 60px;
  margin: 48px 0;
  color: var(--gold-dark);
}

.title-page-author {
  margin: auto 0 110px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.title-page-fine {
  margin: 0 56px 44px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.title-page-fine p { margin: 0 0 4px; }

/* Epigraphs, on the left-hand page facing a section's first page. */
.epigraph-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 62px;
  color: var(--ink);
}

.epigraph-text {
  margin: 0;
  font-style: italic;
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.epigraph-attribution {
  margin: 18px 0 0;
  text-align: right;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.epigraph-attribution::before { content: "\2014\00a0"; }

/* The plates at the end: tipped-in illustrations. */
.plate {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 46px;
}

.plate img {
  display: block;
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  padding: 7px;
  background: #fbf8f0;
  border: 1px solid var(--paper-shade);
  box-shadow: 0 1px 3px rgba(60, 40, 10, 0.25);
}

.plate-tall img { max-height: 540px; }

.plate figcaption {
  margin-top: 18px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.end-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 60px;
}

.end-kicker {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 30px;
}

.end-emblem {
  width: 46px;
  height: 46px;
  margin: 26px 0;
  color: var(--gold-dark);
}

.end-text {
  margin: 0 0 30px;
  font-size: 17px;
}

.end-button { font-size: 16px; }

/* Blank pages carry nothing but paper. */
.blank-page { position: absolute; inset: 0; }

/* ---------- Controls ---------- */

.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1.4rem;
}

.turn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(217, 181, 97, 0.6);
  background: rgba(11, 16, 32, 0.6);
  color: var(--gold-light);
  font-size: 1.7rem;
  line-height: 1;
  padding-bottom: 0.2rem;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.turn:hover:not(:disabled) { background: rgba(217, 181, 97, 0.18); }
.turn:disabled { opacity: 0.3; cursor: default; }
.turn:focus-visible,
.button:focus-visible,
.plain-link a:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

.book-status {
  margin: 0;
  min-width: 12rem;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.plain-link {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
}

.plain-link a { color: var(--text-soft); }

/* ---------- Newsletter ---------- */

.signup {
  width: min(36rem, 100%);
  margin: clamp(3rem, 8vh, 5rem) auto 0;
  text-align: center;
  scroll-margin-top: 2rem;
}

.signup-emblem {
  width: 44px;
  height: 44px;
  color: var(--gold);
}

.signup h2 {
  margin: 0.5rem 0 0.4rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 600;
  color: var(--gold-light);
}

.signup-lede {
  margin: 0 auto 1.4rem;
  color: var(--text-soft);
}

.signup-lede cite { font-style: italic; color: var(--text); }

.signup-form {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.signup-form input[type="email"] {
  flex: 1 1 16rem;
  max-width: 22rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--gold-dark);
  border-radius: 3px;
}

.signup-form input[type="email"]:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }

.button {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--night);
  background: linear-gradient(160deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}

.button:hover { filter: brightness(1.07); }
.button:disabled { opacity: 0.6; cursor: wait; }

.signup-form.is-done { display: none; }

.signup-message {
  min-height: 1.6em;
  margin: 1rem 0 0;
  color: var(--gold-light);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- The plain-text pages ---------- */

.manuscript {
  width: min(38rem, 100%);
  margin: 4rem auto 0;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  line-height: 1.6;
  scroll-margin-top: 1.5rem;
}

.js .manuscript:not(.is-open) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.manuscript h2 {
  margin: 2.5rem 0 1.5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.manuscript .excerpt-section:first-child h2 { margin-top: 0; }

.manuscript .epigraph {
  margin: 2.5rem 2rem 0;
  font-style: italic;
  font-size: 0.95em;
}

.manuscript .epigraph p { text-indent: 0; }
.manuscript .epigraph footer { margin-top: 0.5em; text-align: right; font-style: normal; color: var(--ink-soft); }
.manuscript .excerpt-section:first-child .epigraph { margin-top: 0; }
.manuscript p { margin: 0; text-indent: 1.4em; }
.manuscript h2 + p,
.manuscript .lines { text-indent: 0; }
.manuscript .lines { margin-top: 1em; }
.manuscript .verse { margin: 0.8em 0 0.8em 1.5em; font-style: italic; }
.manuscript .verse-line { display: block; }

.site-footer {
  margin-top: 4rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  text-align: center;
}

.site-footer p { margin: 0; }

/* The measuring room: book.js lays text out here, unseen, before building the book. */
.measure {
  position: fixed;
  left: -10000px;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

.measure .page {
  position: relative;
  width: var(--page-w);
  height: var(--page-h);
}

@media (prefers-reduced-motion: reduce) {
  .book-frame { transition: none; }
}
