/* ═══════════════════════════════════════════════════════════════════
   A.A. GLOVER — shared styles for index.html and books.html
   Palette: river at dusk. Indigo ink, rice-paper page, lamplight gold.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --ink: #10233B;
  --ink-deep: #0A1728;
  --ink-soft: #2E4A66;
  --ink-mute: #6B7F93;
  --paper: #F3EEE3;
  --paper-warm: #E7DDC8;
  --paper-line: #D9CDB2;
  --gold: #C6963C;
  --gold-deep: #A97C2C;
  --river: #3E6E8E;
  --river-mist: #CBD6E1;
  --white: #FFFFFF;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 64px;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.6; font-size: 16px; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.serif { font-family: var(--serif); }

.skip-link { position: absolute; left: 16px; top: -60px; background: var(--gold); color: var(--ink); padding: 10px 16px; font-weight: 600; border-radius: 2px; z-index: 100; text-decoration: none; }
.skip-link:focus { top: 16px; }

/* ── Navigation ── */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(16, 35, 59, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(243, 238, 227, .08); }
.nav .wrap { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-brand { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--paper); text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 10px; }
.nav-brand .mark { width: 30px; height: 30px; border-radius: 6px; background: var(--gold); color: var(--ink); font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--river-mist); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s ease; }
.nav-links a:hover { color: var(--gold); }
.nav-links a[aria-current="page"] { color: var(--paper); }
.nav-links .nav-cta { background: var(--gold); color: var(--ink); padding: 9px 16px; border-radius: 2px; font-weight: 600; }
.nav-links .nav-cta:hover { background: #D6A64C; color: var(--ink); }
.nav-toggle { display: none; background: none; border: 1px solid rgba(243, 238, 227, .3); color: var(--paper); padding: 8px 12px; border-radius: 2px; font: inherit; font-size: 14px; cursor: pointer; }

/* ── Hero ── */
.hero { position: relative; background: var(--ink); color: var(--paper); overflow: hidden; }
.hero-grain { position: absolute; inset: 0; opacity: .06; background-image: radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px), radial-gradient(circle at 70% 60%, #fff 1px, transparent 1px); background-size: 40px 40px, 55px 55px; pointer-events: none; }
.hero-glow { position: absolute; right: -10%; top: -20%; width: 60%; height: 140%; background: radial-gradient(ellipse at center, rgba(198, 150, 60, .18), transparent 60%); pointer-events: none; }
.hero .wrap { position: relative; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 72px 0 40px; }
.eyebrow { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 20px; }
.hero h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(38px, 5.6vw, 66px); line-height: 1.02; letter-spacing: -.02em; max-width: 15ch; }
.hero h1 em { font-style: italic; color: var(--gold); font-weight: 600; }
.hero-sub { font-size: clamp(16px, 1.9vw, 19px); max-width: 48ch; margin-top: 24px; color: var(--river-mist); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; font-size: 13px; color: var(--river-mist); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

/* The signature: three covers rising off a shelf */
.shelf { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 0; padding: 30px 0 30px; isolation: isolate; }
.shelf::after { content: ""; position: absolute; left: -4%; right: -4%; bottom: 24px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent); opacity: .7; }
.shelf-book { position: relative; border-radius: 2px; overflow: hidden; background: var(--ink-deep); box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06); transform-origin: bottom center; transition: transform .5s var(--ease); }
.shelf-book img { width: 100%; height: auto; }
.shelf-book:nth-child(1) { transform: translateY(6px) rotate(-3deg) scale(.94); z-index: 1; }
.shelf-book:nth-child(2) { z-index: 3; margin: 0 -10px; transform: translateY(-16px) scale(1.1); }
.shelf-book:nth-child(3) { transform: translateY(6px) rotate(3deg) scale(.94); z-index: 2; }
.shelf:hover .shelf-book:nth-child(1) { transform: translateY(0) rotate(-5deg) scale(.95); }
.shelf:hover .shelf-book:nth-child(2) { transform: translateY(-24px) scale(1.12); }
.shelf:hover .shelf-book:nth-child(3) { transform: translateY(0) rotate(5deg) scale(.95); }

.river-svg { display: block; width: 100%; height: 70px; }
.river-svg path { fill: var(--paper); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; font-size: 15px; padding: 14px 24px; border-radius: 2px; cursor: pointer; border: 1px solid transparent; text-decoration: none; line-height: 1.2; transition: transform .18s var(--ease), box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease; font-family: inherit; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(198, 150, 60, .35); background: #D6A64C; }
.btn-ghost { background: transparent; color: var(--paper); border-color: rgba(243, 238, 227, .35); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--river); transform: translateY(-2px); }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--paper-line); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ── Sections ── */
.section { padding: 80px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.section-label { font-family: var(--serif); font-weight: 600; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--river); margin-bottom: 10px; }
.section h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(28px, 3.8vw, 42px); letter-spacing: -.015em; line-height: 1.08; }
.section-head p { color: var(--ink-soft); max-width: 44ch; font-size: 15px; }

/* ── Cover frame (never crops the artwork) ── */
.cover { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: var(--ink-deep); }
.cover::before { content: ""; position: absolute; inset: -20px; background-image: var(--img); background-size: cover; background-position: center; filter: blur(22px) saturate(1.1); opacity: .75; transform: scale(1.1); }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 23, 40, .25), rgba(10, 23, 40, .45)); }
.cover img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; padding: 12px; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .45)); transition: transform .6s var(--ease); }
.cover-wide { aspect-ratio: 5 / 4; }

/* ── Featured book (start here) ── */
.featured { background: var(--white); border: 1px solid var(--paper-warm); border-radius: 4px; display: grid; grid-template-columns: 340px 1fr; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(16, 35, 59, .25); }
.featured .cover { aspect-ratio: auto; height: 100%; min-height: 480px; }
.featured-body { padding: 44px 48px; display: flex; flex-direction: column; justify-content: center; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 14px; }
.badge::before { content: ""; width: 22px; height: 1px; background: var(--gold); }
.featured h3 { font-family: var(--serif); font-weight: 900; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.06; letter-spacing: -.015em; }
.featured .lede { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 19px; color: var(--ink-soft); margin-top: 14px; line-height: 1.45; }
.featured p.desc { margin-top: 16px; color: var(--ink-soft); max-width: 58ch; }
.formats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-size: 13px; color: var(--ink-soft); }
.formats span b { color: var(--ink); font-weight: 600; }
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* ── Book cards ── */
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.book { background: var(--white); border: 1px solid var(--paper-warm); border-radius: 3px; overflow: hidden; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s ease; }
.book:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(16, 35, 59, .16); }
.book:hover .cover img { transform: scale(1.04); }
.book-num { position: absolute; z-index: 2; top: 12px; left: 12px; background: rgba(243, 238, 227, .92); color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 5px 10px; border-radius: 2px; }
.book-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.book-body h3 { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.2; }
.book-body .byline { font-size: 13px; color: var(--ink-mute); margin-top: 4px; }
.book-body .desc { font-size: 14.5px; color: var(--ink-soft); margin-top: 12px; flex: 1; }
.fmt-list { margin-top: 16px; border-top: 1px solid var(--paper-warm); }
.fmt { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--paper-warm); color: var(--ink-soft); }
.fmt .price { font-weight: 600; color: var(--ink); }
.book-buy { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.book-buy .btn { width: 100%; padding: 12px 16px; font-size: 14px; }
.badge-soon:hover { border-color: var(--gold); color: var(--gold-deep); }
.badge-soon { display: block; text-align: center; text-decoration: none; background: var(--paper); border: 1px dashed var(--paper-line); color: var(--ink-soft); padding: 12px 16px; border-radius: 2px; font-weight: 600; font-size: 13.5px; }

/* ── Formats strip ── */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.way { background: var(--white); border: 1px solid var(--paper-warm); padding: 26px 26px 24px; border-radius: 3px; }
.way .icon { width: 42px; height: 42px; border-radius: 50%; background: var(--paper); color: var(--gold-deep); display: grid; place-items: center; margin-bottom: 14px; }
.way .icon svg { width: 20px; height: 20px; }
.way h3 { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.way p { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }

/* ── Signup ── */
.signup { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.signup::before { content: ""; position: absolute; left: -10%; bottom: -40%; width: 50%; height: 120%; background: radial-gradient(ellipse at center, rgba(62, 110, 142, .35), transparent 60%); pointer-events: none; }
.signup-inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 80px 0; }
.signup h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -.015em; }
.signup h2 em { color: var(--gold); font-style: italic; font-weight: 600; }
.signup p { color: var(--river-mist); margin-top: 16px; font-size: 17px; max-width: 42ch; }
.signup ul { list-style: none; margin-top: 20px; display: grid; gap: 10px; color: var(--river-mist); font-size: 15px; }
.signup ul li { display: flex; gap: 10px; align-items: flex-start; }
.signup ul li::before { content: "✦"; color: var(--gold); font-size: 12px; margin-top: 4px; }
.form-card { background: var(--paper); color: var(--ink); border-radius: 4px; padding: 32px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.form-card label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }
.form-card input { width: 100%; padding: 13px 14px; border: 1px solid var(--paper-line); border-radius: 2px; font-size: 15px; font-family: inherit; background: var(--white); margin-bottom: 16px; color: var(--ink); }
.form-card input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.form-card button { width: 100%; }
.form-note { font-size: 12px; color: var(--ink-mute); margin-top: 12px; text-align: center; }
.form-success { display: none; text-align: center; padding: 20px 0; }
.form-success.show { display: block; }
.form-success .check { width: 56px; height: 56px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; margin: 0 auto 14px; }
.form-success .check svg { width: 26px; height: 26px; }
.form-error { display: none; font-size: 13px; color: #8A2E25; margin-top: -6px; margin-bottom: 12px; }
.form-error.show { display: block; }

/* ── About ── */
.about-inner { display: grid; grid-template-columns: 360px 1fr; gap: 56px; align-items: center; }
.about-portrait { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--ink); }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-portrait::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(198, 150, 60, .55); pointer-events: none; }
.about h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 3.5vw, 38px); margin-bottom: 18px; letter-spacing: -.015em; }
.about p { margin-bottom: 14px; color: var(--ink-soft); font-size: 16.5px; max-width: 60ch; }
.about p:last-of-type { margin-bottom: 0; }
.about .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ── Page header (books page) ── */
.page-hero .hero-grid { grid-template-columns: 1fr; padding: 64px 0 36px; }
.page-hero h1 { max-width: 20ch; }

/* ── Footer ── */
footer { background: var(--ink-deep); color: #8FA2B4; padding: 44px 24px 36px; font-size: 13px; }
.foot { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.foot .brand { font-family: var(--serif); color: var(--paper); font-size: 20px; font-weight: 600; }
.foot .tag { margin-top: 6px; max-width: 46ch; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot nav a { color: var(--river-mist); text-decoration: none; }
.foot nav a:hover { color: var(--gold); }
.foot .copy { grid-column: 1 / -1; border-top: 1px solid rgba(243, 238, 227, .1); padding-top: 18px; margin-top: 10px; opacity: .65; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ── Motion ── */
@keyframes riseIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes floatGrain { from { background-position: 0 0, 0 0; } to { background-position: 40px 55px, -55px 40px; } }
.hero .eyebrow { animation: riseIn .8s var(--ease) both; }
.hero h1 { animation: riseIn .9s var(--ease) .1s both; }
.hero-sub { animation: riseIn .9s var(--ease) .22s both; }
.hero-cta, .hero-meta { animation: riseIn .9s var(--ease) .34s both; }
.shelf { animation: riseIn 1.1s var(--ease) .3s both; }
.hero-grain { animation: floatGrain 32s linear infinite alternate; }
.js-ready .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.books > .reveal:nth-child(2), .ways > .reveal:nth-child(2) { transition-delay: .1s; }
.books > .reveal:nth-child(3), .ways > .reveal:nth-child(3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .shelf { max-width: 520px; margin: 0 auto; }
  .featured { grid-template-columns: 1fr; }
  .featured .cover { min-height: 0; aspect-ratio: 4 / 3; }
  .featured-body { padding: 32px 28px; }
  .about-inner { grid-template-columns: 1fr; gap: 32px; }
  .about-portrait { max-width: 360px; }
}
@media (max-width: 820px) {
  .books, .ways { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  .signup-inner { grid-template-columns: 1fr; gap: 36px; padding: 64px 0; }
  .section { padding: 64px 0; }
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--ink); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 12px; border-bottom: 1px solid rgba(243, 238, 227, .1); }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 24px; }
  .nav-links .nav-cta { margin: 8px 24px 0; text-align: center; }
  .nav-toggle { display: inline-block; }
  .foot { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero-cta .btn { width: 100%; }
  .buy-row .btn { width: 100%; }
  .featured-body { padding: 26px 22px; }
}
