/* ============================================================
   EARNEST — A Novel by M. J. Hines
   styles.css

   Table of contents:
     1.  Design tokens (custom properties)
     2.  Dark mode overrides
     3.  Reset & base
     4.  Typography helpers
     5.  Layout utilities
     6.  Buttons
     7.  Navigation
     8.  Hero
     9.  About the Novel
     10. Thematic framing
     11. Excerpt
     12. Author
     13. Praise & endorsements
     14. Contact
     15. Footer
     16. Scroll animations
     17. Keyframes
     18. Responsive — tablet (≤ 900px)
     19. Responsive — mobile (≤ 580px)
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   To change the colour palette, font stack, or spacing scale,
   edit the values in this block only.
   ============================================================ */

:root {
  /* --- Colour palette: light mode -------------------------
     Primary background:  warm off-white, like aged paper
     Accent:              oxblood — used sparingly
  ---------------------------------------------------------- */
  --bg:            #F7F4EF;
  --bg-alt:        #EFEBE3;
  --bg-card:       #FDFAF5;
  --bg-excerpt:    #F1EDE6;
  --text:          #1A1917;
  --text-muted:    #6A6760;
  --text-faint:    #9B9790;
  --border:        #D8D3CA;
  --border-light:  #E6E2D9;
  /* UPDATE: swap --accent to change the accent colour.
     Good alternatives: #1C3A4A (navy), #2A4A35 (deep green) */
  --accent:        #7C2026;
  --accent-hover:  #9B3039;
  --accent-subtle: rgba(124, 32, 38, 0.06);

  /* --- Typography ----------------------------------------- */
  /* UPDATE: change Google Fonts import in <head> to match any font changes here */
  --font-serif:   'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-sans:    'Inter', 'Helvetica Neue', 'Arial', sans-serif;

  /* Fluid type scale */
  --text-xs:   0.72rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  clamp(1.875rem, 3.5vw, 2.75rem);
  --text-hero: clamp(5rem, 14vw, 9.5rem);

  /* --- Spacing -------------------------------------------- */
  --s1:  0.25rem;
  --s2:  0.5rem;
  --s3:  0.75rem;
  --s4:  1rem;
  --s5:  1.25rem;
  --s6:  1.5rem;
  --s8:  2rem;
  --s10: 2.5rem;
  --s12: 3rem;
  --s16: 4rem;
  --s20: 5rem;
  --s24: 6rem;

  /* --- Layout --------------------------------------------- */
  --max-w:       1100px;
  --content-w:   720px;
  --section-pad: clamp(5rem, 10vw, 8rem);
  --page-pad:    clamp(1.25rem, 5vw, 3rem);
  --nav-h:       64px;

  /* --- Easing & transitions ------------------------------- */
  --ease-fast: 140ms ease;
  --ease-base: 240ms ease;
  --ease-slow: 380ms ease;

  /* --- Elevation ------------------------------------------ */
  --shadow-card: 0 1px 4px rgba(26, 25, 23, 0.07);
  --shadow-md:   0 4px 16px rgba(26, 25, 23, 0.08);
}


/* ============================================================
   2. DARK MODE OVERRIDES
   Applied via data-theme="dark" on <html> (set by script.js).
   System preference is respected as a fallback.
   ============================================================ */

[data-theme="dark"] {
  --bg:            #131210;
  --bg-alt:        #1B1916;
  --bg-card:       #201D1A;
  --bg-excerpt:    #191613;
  --text:          #EDE8E0;
  --text-muted:    #93908A;
  --text-faint:    #5A5750;
  --border:        #2C2925;
  --border-light:  #232119;
  --accent:        #B03840;
  --accent-hover:  #C4484E;
  --accent-subtle: rgba(176, 56, 64, 0.1);
  --shadow-card:   0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow-md:     0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Match system dark preference if user hasn't set a preference via the toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:            #131210;
    --bg-alt:        #1B1916;
    --bg-card:       #201D1A;
    --bg-excerpt:    #191613;
    --text:          #EDE8E0;
    --text-muted:    #93908A;
    --text-faint:    #5A5750;
    --border:        #2C2925;
    --border-light:  #232119;
    --accent:        #B03840;
    --accent-hover:  #C4484E;
    --accent-subtle: rgba(176, 56, 64, 0.1);
  }
}


/* ============================================================
   3. RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  /* Prevent flash of un-themed content */
  color-scheme: light dark;
}

/* Honour reduced-motion preferences throughout */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration:       0.01ms !important;
    animation-iteration-count: 1     !important;
    transition-duration:       0.01ms !important;
  }
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--ease-slow), color var(--ease-slow);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
em { font-style: italic; }
strong { font-weight: 500; }

/* Accessible focus — clean, not distracting */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Visually hide without removing from accessibility tree */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
   4. TYPOGRAPHY HELPERS
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text);
}

h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }

p { line-height: 1.75; }
p + p { margin-top: 1.3em; }


/* ============================================================
   5. LAYOUT UTILITIES
   ============================================================ */

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-pad) var(--page-pad);
}

.section-header {
  margin-bottom: var(--s12);
}

/* Small uppercase label above section headings */
.section-label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s3);
}

/* Decorative rule between label and heading — used in hero */
.section-rule {
  display: block;
  width: 32px;
  height: 1px;
  background-color: var(--accent);
  margin: var(--s4) 0;
}


/* ============================================================
   6. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 0.75em 1.75em;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--ease-fast),
              border-color     var(--ease-fast),
              color            var(--ease-fast);
}

.btn-primary {
  background-color: var(--accent);
  color: #FDFAF4;
  border: 1.5px solid var(--accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--accent-hover);
  border-color:     var(--accent-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--text-muted);
}

/* Small icon-only button used in nav */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--text-muted);
  border-radius: 2px;
  transition: color var(--ease-fast), background-color var(--ease-fast);
}

.btn-icon:hover { color: var(--text); background-color: var(--bg-alt); }


/* ============================================================
   7. NAVIGATION
   ============================================================ */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--ease-slow),
              border-color      var(--ease-slow),
              box-shadow        var(--ease-slow);
}

/* Nav becomes opaque once user scrolls past hero */
#nav.scrolled {
  background-color: var(--bg);
  border-bottom-color: var(--border-light);
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.05);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  height: 100%;
  gap: var(--s4);
}

/* Wordmark */
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
  flex-shrink: 0;
  transition: color var(--ease-fast);
  letter-spacing: 0.01em;
}
.nav-logo:hover { color: var(--accent); }

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s6);
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: color var(--ease-fast), border-color var(--ease-fast);
}

.nav-links a:hover {
  color: var(--text);
  border-bottom-color: var(--text-muted);
}

/* Nav right-hand controls */
.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

/* Dark mode icon toggling */
.dark-toggle .icon-sun  { display: none; }
.dark-toggle .icon-moon { display: block; }
[data-theme="dark"] .dark-toggle .icon-sun  { display: block; }
[data-theme="dark"] .dark-toggle .icon-moon { display: none; }

/* Hamburger icon */
.menu-toggle {
  display: none;            /* shown only on mobile via media query */
  flex-direction: column;
  gap: 5px;
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 1.5px;
  background-color: var(--text);
  transform-origin: center;
  transition: transform var(--ease-base), opacity var(--ease-base);
}

/* Animate hamburger → close X */
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav panel */
.mobile-menu {
  display: none;            /* shown only on mobile via media query */
  overflow: hidden;
  max-height: 0;
  background-color: var(--bg);
  border-top: 1px solid transparent;
  transition: max-height     var(--ease-slow),
              border-color   var(--ease-slow),
              padding        var(--ease-slow);
}

.mobile-menu.open {
  max-height: 500px;
  border-top-color: var(--border-light);
  padding: var(--s8) var(--page-pad) var(--s10);
}

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.mobile-menu a {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text);
  transition: color var(--ease-fast);
}
.mobile-menu a:hover { color: var(--accent); }


/* ============================================================
   8. HERO
   ============================================================ */

#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + var(--s20)) var(--page-pad) var(--s24);
}

/* --- Status pill ------------------------------------------ */
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s10);

  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.15s;
}

.status-pip {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent);
  flex-shrink: 0;
}

/* --- Title block ------------------------------------------ */
.hero-title-wrap {
  margin-bottom: var(--s3);
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.35s;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.9;
  color: var(--text);
}

/* Manuscript annotation underline below title — decorative */
.title-rule {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
}

.title-rule-line {
  /* Tapers off, like an editorial underline drawn by hand */
  height: 1.5px;
  width: clamp(160px, 30vw, 320px);
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) 70%, transparent 100%);
}

.title-rule-mark {
  /* Manuscript approval mark — checkmark in the margin */
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--accent);
  opacity: 0.6;
  letter-spacing: 0;
}

/* --- Byline ---------------------------------------------- */
.hero-byline {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: var(--s5);
  margin-bottom: var(--s8);

  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.55s;
}

.hero-byline em {
  font-style: normal;
  color: var(--text);
}

/* --- Hook ----------------------------------------------- */
/* UPDATE: font size for hook — adjust clamp if needed */
.hero-hook {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text);
  max-width: 540px;
  margin-bottom: var(--s5);

  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.7s;
}

/* --- Revision motif ------------------------------------- */
/* A single line beneath the hook that animates once on load,
   striking through the original phrase and inserting a replacement.
   This echoes the novel's formal strikethrough device. */
.hero-revision {
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--text-faint);
  letter-spacing: 0.01em;
  min-height: 1.5em;     /* prevent layout shift during animation */
  margin-bottom: var(--s12);

  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.85s;
}

/* The phrase being replaced */
.revise-word {
  transition: color var(--ease-base), text-decoration-color var(--ease-base);
}

.revise-word.striking {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  color: var(--text-muted);
}

/* The replacement phrase, injected by script.js */
.revision-replacement {
  display: inline;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.revision-replacement.visible { opacity: 1; }

/* --- CTA buttons ---------------------------------------- */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);

  opacity: 0;
  animation: fadeUp 0.7s ease forwards 1s;
}

/* --- Decorative marginalia ------------------------------ */
/* Abstract manuscript marks — purely visual */
.hero-marginalia {
  position: absolute;
  right: max(var(--page-pad), calc((100vw - var(--max-w)) / 2 - 16px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s2);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  animation: fadeIn 1.2s ease forwards 1.4s;
}

.marginalia-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s2);
}

.m-line {
  display: block;
  height: 1px;
  background-color: var(--text-muted);
}

.m-line--long  { width: 52px; }
.m-line--short { width: 26px; }

.marginalia-label {
  font-family: var(--font-serif);
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: var(--s1);
}

/* --- Scroll nudge --------------------------------------- */
.scroll-nudge {
  position: absolute;
  bottom: var(--s10);
  left: 50%;
  transform: translateX(-50%);

  opacity: 0;
  animation: fadeIn 0.8s ease forwards 1.8s;
}

.scroll-nudge-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, var(--border) 0%, transparent 100%);
  animation: scrollPulse 2.4s ease-in-out infinite 2.2s;
}


/* ============================================================
   9. ABOUT THE NOVEL
   ============================================================ */

.about-section {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-light);
}

/* Metadata table */
.novel-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s6) var(--s8);
  padding: var(--s8) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s12);
}

.meta-row {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.meta-row dt {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.meta-row dd {
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.65;
}

.meta-sep {
  margin: 0 0.4em;
  color: var(--text-faint);
}

/* Short pitch — large italic serif */
.about-pitch {
  max-width: var(--content-w);
  margin-bottom: var(--s12);
}

.about-pitch p {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-style: italic;
  line-height: 1.65;
  color: var(--text);
}

/* Synopsis */
.about-synopsis {
  max-width: var(--content-w);
}

.about-synopsis h3 {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s6);
}

.about-synopsis p {
  font-size: var(--text-md);
  line-height: 1.85;
  color: var(--text);
}


/* ============================================================
   10. THEMATIC FRAMING
   ============================================================ */

.themes-section {
  background-color: var(--bg);
  border-top: 1px solid var(--border-light);
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s6);
  margin-bottom: var(--s16);
}

.theme-card {
  padding: var(--s8);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 2px solid var(--border);
  transition: border-top-color var(--ease-base), box-shadow var(--ease-base);
}

.theme-card:hover {
  border-top-color: var(--accent);
  box-shadow: var(--shadow-card);
}

.theme-card h3 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.01em;
  color: var(--text);
  margin-bottom: var(--s4);
}

.theme-card p {
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--text-muted);
}

/* Questions block — styled as a torn-out manuscript page / notebook card */
.questions-block {
  position: relative;
  max-width: 640px;
  margin: var(--s12) auto;
  padding: var(--s8) var(--s10);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-card);
}

/* Dog-ear top-right corner */
.questions-block::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background:
    linear-gradient(
      225deg,
      var(--bg-alt) 0%,
      var(--bg-alt) 50%,
      transparent 50%
    );
  pointer-events: none;
}

.questions-intro {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: var(--s6);
  margin-top: 0;
  line-height: 1.6;
}

.questions-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.questions-list li {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text);
}


/* ============================================================
   11. EXCERPT
   The typography here is critical. Optimised for literary
   reading: Playfair Display serif, ~65ch line length,
   generous leading, correct optical sizing.
   ============================================================ */

.excerpt-section {
  background-color: var(--bg-excerpt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Narrow the section container for excerpt — reading column width */
.excerpt-section .section-inner {
  max-width: var(--content-w);
}

/* Ghost chapter numeral above excerpt */
.excerpt-chapter-numeral {
  display: block;
  font-family: var(--font-serif);
  font-size: 4.5rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: var(--border);
  user-select: none;
  margin-bottom: var(--s8);
  transition: color var(--ease-slow);
}

/* Main excerpt body */
.excerpt-text {
  margin-bottom: var(--s12);
}

.excerpt-text p {
  font-family: var(--font-serif);
  font-size: 1.0625rem;        /* 17px — refined literary reading size */
  line-height: 1.95;
  color: var(--text);
  max-width: 64ch;             /* optimal reading line length */
  margin-top: 0;
}

.excerpt-text p + p {
  margin-top: 1.6em;
}

/* Manuscript strikethrough — the novel's key formal device.
   UPDATE: if you want a different style for del tags, change here. */
.excerpt-text del {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-decoration-skip-ink: none;
  color: var(--text-muted);
}

/* Indented pullquote within excerpt */
.excerpt-pullquote {
  border-left: 2px solid var(--accent);
  margin: var(--s8) 0;
  padding: var(--s4) var(--s8);
  background-color: var(--accent-subtle);
}

.excerpt-pullquote p {
  font-family: var(--font-serif);
  font-size: 0.975rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: none;
}

/* CTA beneath excerpt */
.excerpt-cta {
  padding-top: var(--s8);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s5);
}

.excerpt-cta-note {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
  font-family: var(--font-serif);
}

.excerpt-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}


/* ============================================================
   12. AUTHOR
   ============================================================ */

.author-section {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-light);
}

.author-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s12);
  align-items: start;
}

/* Photo slot */
.author-photo-wrap img {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  filter: grayscale(15%);    /* subtle desaturation for literary feel */
}

/* Placeholder shown when no photo yet */
.author-photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: var(--border-light);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-photo-placeholder span {
  font-size: var(--text-xs);
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Bio text */
.author-bio {
  margin-bottom: var(--s8);
}

.author-bio p {
  font-size: var(--text-md);
  line-height: 1.85;
  color: var(--text);
}

/* Author link pills */
.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.author-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: var(--s2) var(--s4);
  border: 1px solid var(--border);
  border-radius: 1px;
  transition: color var(--ease-fast), border-color var(--ease-fast);
}

.author-link:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.author-link svg { flex-shrink: 0; }


/* ============================================================
   13. PRAISE & ENDORSEMENTS
   ============================================================ */

.praise-section {
  background-color: var(--bg);
  border-top: 1px solid var(--border-light);
}

.praise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s6);
  margin-bottom: var(--s12);
}

.praise-card {
  position: relative;
  padding: var(--s8);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--ease-base);
}

.praise-card:hover { box-shadow: var(--shadow-md); }

/* Large opening quote mark — decorative */
.praise-card::before {
  content: '\201C';
  position: absolute;
  top: var(--s3);
  left: var(--s5);
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 1;
  color: var(--border);
  pointer-events: none;
  user-select: none;
}

.praise-card blockquote {
  margin-top: var(--s8);
}

.praise-card blockquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text);
  max-width: none;
}

.praise-card figcaption {
  margin-top: var(--s5);
  padding-top: var(--s4);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.praise-card figcaption strong {
  display: block;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--s1);
}

/* Placeholder state — slightly muted until replaced with real quotes */
.placeholder-card {
  opacity: 0.65;
}

.placeholder-card blockquote p {
  color: var(--text-muted);
  font-style: normal;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

/* Accolades strip */
.accolades {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s6);
  padding: var(--s6) var(--s8);
  margin-top: var(--s10);
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
}

.accolade {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.accolade-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

a.accolade-name:hover {
  color: var(--accent);
}

.accolade-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.accolade-sep {
  font-size: 1.2rem;
  color: var(--border);
  line-height: 1;
}


/* ============================================================
   14. CONTACT
   ============================================================ */

.contact-section {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-light);
}

/* Narrower layout for the contact section — it's a focused CTA */
.contact-inner {
  max-width: 680px;
}

.contact-content {
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}

.contact-intro p {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.2vw, 1.375rem);
  font-style: italic;
  line-height: 1.65;
  color: var(--text);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* Email address styled as plain text in the button */
.contact-email-btn {
  font-family: var(--font-sans) !important;
  font-size: var(--text-sm) !important;
  letter-spacing: 0.01em !important;
}

/* Agent info block */
.contact-agent {
  padding: var(--s5) var(--s6);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card);
  display: inline-block;
}

.contact-agent-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--s2) !important;
}

.contact-note {
  padding-top: var(--s5);
  border-top: 1px solid var(--border-light);
}

.contact-note p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 0;
}


/* ============================================================
   15. FOOTER
   ============================================================ */

#footer {
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--s8) var(--page-pad);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  gap: var(--s4);
  flex-wrap: wrap;
}

#footer p {
  font-size: var(--text-sm);
  color: var(--text-faint);
  line-height: 1;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--s5);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-faint);
  transition: color var(--ease-fast);
}

.footer-links a:hover { color: var(--text-muted); }


/* ============================================================
   16. SCROLL ENTRANCE ANIMATIONS
   Elements fade and rise into view as they enter the viewport.
   Managed by IntersectionObserver in script.js.
   Reduced-motion users get everything visible immediately.
   ============================================================ */

.animate-section,
.animate-child {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-section.in-view,
.animate-child.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger child elements within sections */
.animate-section .animate-child:nth-child(1) { transition-delay: 0.05s; }
.animate-section .animate-child:nth-child(2) { transition-delay: 0.1s; }
.animate-section .animate-child:nth-child(3) { transition-delay: 0.15s; }
.animate-section .animate-child:nth-child(4) { transition-delay: 0.2s; }
.animate-section .animate-child:nth-child(5) { transition-delay: 0.25s; }
.animate-section .animate-child:nth-child(6) { transition-delay: 0.3s; }


/* ============================================================
   17. KEYFRAMES
   ============================================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 0.12; }
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1);   opacity: 0.4; }
  50%       { transform: scaleY(0.5); opacity: 0.15; }
}


/* ============================================================
   18. RESPONSIVE — TABLET (≤ 900px)
   ============================================================ */

@media (max-width: 900px) {

  /* Hide desktop nav links, show hamburger */
  .nav-links  { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu { display: block; }

  /* Slightly tighter hero */
  .hero-inner {
    padding-bottom: var(--s20);
  }

  /* Hide decorative marginalia on smaller screens */
  .hero-marginalia { display: none; }

  /* Two-column meta on tablet */
  .novel-meta {
    grid-template-columns: 1fr 1fr;
  }

  /* Author: tighter grid */
  .author-inner {
    grid-template-columns: 180px 1fr;
    gap: var(--s8);
  }

  /* Praise: 2 cols max */
  .praise-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}


/* ============================================================
   19. RESPONSIVE — MOBILE (≤ 580px)
   ============================================================ */

@media (max-width: 580px) {

  /* Smaller hero title on phones */
  :root {
    --text-hero: clamp(4rem, 20vw, 5.5rem);
  }

  /* Stack hero buttons */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    text-align: center;
    justify-content: center;
  }

  /* Full-width metadata grid */
  .novel-meta {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }

  /* Stack meta rows */
  .meta-sep { display: none; }
  .meta-row dd br + .meta-sep { display: none; }

  /* Theme cards single column */
  .themes-grid {
    grid-template-columns: 1fr;
  }

  /* Questions block — reduce horizontal padding */
  .questions-block {
    padding: var(--s6) var(--s6);
  }

  /* Excerpt: slightly smaller type on very small screens */
  .excerpt-text p {
    font-size: 1rem;
    line-height: 1.9;
  }

  /* Author: stack photo above bio */
  .author-inner {
    grid-template-columns: 1fr;
  }

  .author-photo-wrap {
    max-width: 160px;
  }

  /* Praise: single column */
  .praise-grid {
    grid-template-columns: 1fr;
  }

  /* Accolades: stack vertically */
  .accolades {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s4);
  }

  .accolade-sep { display: none; }

  /* Contact CTA: full-width button */
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-actions .btn {
    text-align: center;
    justify-content: center;
  }

  /* Footer: stack */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s3);
  }
}
