/* ---------------------------------------------------------------
   August Marsh — augustmarsh site
   Self-hosted fonts, zero JavaScript, no third-party requests.
   Palette sampled from the Markless cover. All text/background
   pairs verified at WCAG AAA (>= 7:1).
   --------------------------------------------------------------- */

@font-face {
  font-family: "Cinzel";
  src: url("/fonts/cinzel-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/ebgaramond-italic-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg:    #15110e;   /* warm near-black          */
  --paper: #ece5d8;   /* warm off-white body text */
  --gold:  #e8cd94;   /* accent, from the cover   */
  --muted: #b3a897;   /* secondary text           */
  --rule:  #3a3128;   /* hairlines                */

  --display: "Cinzel", "EB Garamond", Georgia, "Times New Roman", serif;
  --text:    "EB Garamond", Georgia, "Times New Roman", serif;

  --measure: 42rem;
}

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

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--text);
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.12rem);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--gold); color: var(--bg); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--bg);
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
}

.shell {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(3.25rem, 9vw, 6.5rem) clamp(1.35rem, 5vw, 2rem) clamp(3rem, 8vw, 5rem);
}

/* ---------------- masthead ---------------- */

.masthead {
  text-align: center;
  padding-bottom: clamp(2.25rem, 6vw, 3.25rem);
  border-bottom: 1px solid var(--rule);
}

.masthead h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 1.1rem + 3.1vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-indent: 0.18em;            /* optical: offset the trailing tracking */
  color: var(--paper);
  text-wrap: balance;
}

.tagline {
  margin: 1.15rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------------- the book ---------------- */

main > section { padding-block: clamp(2.75rem, 8vw, 4.25rem); }
main > section + section { border-top: 1px solid var(--rule); }

.book { text-align: center; }

.book picture { display: block; }

.cover {
  display: block;
  width: min(17rem, 64%);
  height: auto;
  margin: 0 auto clamp(1.75rem, 5vw, 2.5rem);
  border: 1px solid rgba(232, 205, 148, 0.16);
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.55);
}

.book-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.45rem, 1rem + 2.3vw, 2rem);
  line-height: 1.25;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  color: var(--paper);
}

.series {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.buy { margin: clamp(1.75rem, 5vw, 2.25rem) 0 0; }

.buy a {
  display: inline-block;
  padding: 0.72rem 1.5rem;
  border: 1px solid rgba(232, 205, 148, 0.38);
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.buy a:hover { border-color: var(--gold); background: rgba(232, 205, 148, 0.07); }

/* ---------------- blurb ---------------- */

.blurb {
  margin-top: clamp(2.75rem, 8vw, 3.75rem);
  text-align: left;
}

.blurb p { margin: 0 0 1.4rem; }
.blurb p:last-child { margin-bottom: 0; }

.blurb .lead {
  font-size: clamp(1.15rem, 1rem + 0.75vw, 1.32rem);
  line-height: 1.6;
  margin-bottom: 1.9rem;
  text-wrap: pretty;
}

/* ---------------- about / contact ---------------- */

.marker {
  margin: 0 0 1.9rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

cite { font-style: italic; }

.about p { margin: 0 0 1.4rem; }
.about p:last-child { margin-bottom: 0; }

.email {
  margin: 0;
  font-size: clamp(1.05rem, 0.9rem + 0.8vw, 1.3rem);
  letter-spacing: 0.01em;
}

.email a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(232, 205, 148, 0.45);
  transition: text-decoration-color 140ms ease;
}
.email a:hover { text-decoration-color: var(--gold); }

.aside {
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------------- colophon ---------------- */

.colophon {
  padding-top: clamp(1.75rem, 5vw, 2.5rem);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.colophon p {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------------- preferences ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- inline prose links ---------------- */

.about a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(232, 205, 148, 0.45);
  transition: text-decoration-color 140ms ease;
}
.about a:hover { text-decoration-color: var(--gold); }
