/* Toby's a Mensch — book landing page
   Mobile-first. Palette drawn from the cover: sunny gold, cobalt blue, orange-red, teal. */

:root {
  --parchment: #fdeecb;
  --parchment-deep: #f8e2ac;
  --sun: #f5b730;
  --blue: #2b4a90;
  --blue-deep: #213a72;
  --ink: #243146;
  --ink-soft: #515f78;
  --marigold: #f0ab2a;
  --marigold-bright: #f7c75a;
  --marigold-deep: #8a5a12;
  --pomegranate: #c0461f;
  --pomegranate-text: #a8391a;
  --teal: #2f9e8f;
  --cream: #fffaf0;
  --line: #f1ddae;

  --shadow-sm: 0 2px 8px rgba(36, 49, 70, 0.10);
  --shadow-md: 0 12px 32px rgba(36, 49, 70, 0.16);
  --shadow-lg: 0 28px 60px rgba(36, 49, 70, 0.24);

  --font-script: "ff-providence-web-pro", Georgia, serif;
  --font-display: "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;

  --wrap: 68rem;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.18rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--parchment);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(245, 183, 48, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(47, 158, 143, 0.08), transparent 55%);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--pomegranate-text); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--pad); }

section[id] { scroll-margin-top: 4.5rem; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--parchment) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--wrap); margin: 0 auto; padding: 0.75rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  font-family: var(--font-script);
  font-weight: 400; font-size: 1.45rem; letter-spacing: normal;
  color: var(--blue); text-decoration: none;
}
.nav-links { display: none; list-style: none; gap: 1.6rem; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--pomegranate); }
.nav-cta {
  background: var(--blue); color: var(--cream) !important;
  padding: 0.4rem 0.9rem; border-radius: 999px;
}
.nav-cta:hover { background: var(--blue-deep); }

@media (min-width: 48rem) {
  .nav-links { display: flex; align-items: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-display);
  font-weight: 600; font-size: 1rem; text-decoration: none;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
.btn-primary { background: var(--blue); color: var(--cream); box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: var(--blue-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(3rem, 9vw, 6rem); }
.hero-glow {
  position: absolute; inset: -20% -10% auto -10%; height: 70%;
  background: radial-gradient(60% 80% at 70% 20%, rgba(245, 183, 48, 0.30), transparent 70%);
  filter: blur(8px); z-index: 0; pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: var(--wrap); margin: 0 auto; padding-inline: var(--pad);
  display: grid; gap: clamp(2rem, 6vw, 3.5rem); align-items: center;
}
.eyebrow {
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--marigold-deep); margin: 0 0 0.75rem;
}
.hero-title {
  font-family: var(--font-script); font-weight: 700;
  font-size: clamp(3.3rem, 10vw, 3.9rem); line-height: 1.08; letter-spacing: normal;
  margin: 0 0 1.1rem; color: var(--blue);
}
.hero-tagline { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); color: var(--ink-soft); margin: 0 0 1.5rem; max-width: 34ch; }
.hero-meta { display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 1.75rem; }
.pubdate { font-family: var(--font-display); color: var(--pomegranate-text); font-weight: 600; font-size: 1.1rem; }
.byline { color: var(--ink-soft); font-style: italic; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.hero-art { display: flex; justify-content: center; }
.book-cover {
  width: min(88%, 26rem); aspect-ratio: 500 / 498;
  filter: drop-shadow(var(--shadow-lg));
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

@media (min-width: 64rem) {
  .hero-inner { grid-template-columns: 1.3fr 0.75fr; }
  .hero-art { order: 2; }
}

/* ---------- Bands / sections ---------- */
.band { padding: clamp(3rem, 8vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.band-alt { background: var(--parchment-deep); }
.section-kicker {
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--marigold-deep); margin: 0 0 0.6rem;
}
.section-title {
  font-family: var(--font-script); font-weight: 700;
  font-size: clamp(2.1rem, 1.5rem + 3vw, 3.4rem); line-height: 1.15; letter-spacing: normal;
  margin: 0 0 1.5rem; color: var(--blue);
}
.section-title em { font-style: italic; color: var(--pomegranate); }

/* About */
.about-grid { display: grid; gap: 2rem; }
.about-lead p { margin: 0 0 1.1rem; }
.about-lead em { color: var(--pomegranate); font-style: italic; }
.about-lead strong { color: var(--pomegranate-text); font-weight: 600; }
.glossary {
  background: var(--cream); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.6rem 1.5rem; box-shadow: var(--shadow-sm); align-self: start;
}
.glossary-label { font-family: var(--font-display); color: var(--marigold-deep); letter-spacing: 0.06em; margin: 0 0 0.4rem; font-size: 0.9rem; }
.glossary-word { font-family: var(--font-script); font-weight: 400; font-size: 2.9rem; line-height: 1.05; margin: 0 0 0.3rem; color: var(--blue); }
.glossary-pron { color: var(--ink-soft); font-style: italic; margin: 0 0 0.9rem; font-size: 0.95rem; }
.glossary-def { margin: 0; color: var(--ink); }

@media (min-width: 52rem) {
  .about-grid { grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: start; }
}

/* Peek / spreads */
.peek { padding: clamp(3rem, 8vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.spreads { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); }
@media (min-width: 48rem) { .spreads { grid-template-columns: repeat(3, 1fr); } }
.spread { margin: 0; }
.spread-trigger {
  display: block; width: 100%; padding: 0; border: none; background: none;
  cursor: zoom-in; border-radius: 12px; transition: transform 0.15s ease;
}
.spread-trigger:hover { transform: translateY(-3px); }
.spread-trigger:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.spread img {
  width: 100%; height: auto; display: block;
  border-radius: 12px; border: 1px solid var(--line);
  box-shadow: var(--shadow-md); background: var(--cream);
}
.spread figcaption { margin-top: 0.9rem; text-align: center; color: var(--ink-soft); font-style: italic; }
.spread figcaption strong { color: var(--pomegranate-text); font-style: normal; }

/* For parents */
.value-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.value-list li { display: grid; gap: 0.3rem; padding-left: 1.25rem; border-left: 3px solid var(--marigold); }
.value-h { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.value-b { color: var(--ink-soft); }
@media (min-width: 48rem) { .value-list { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

/* Pre-order */
.preorder { padding: clamp(3rem, 8vw, 5.5rem) 0; border-top: 1px solid var(--line); background: var(--parchment); }
.preorder-lead { color: var(--ink-soft); max-width: 44ch; margin: 0 0 0.5rem; }
.buylinks { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }
.preorder-fineprint { margin: 1.5rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }

/* Author */
.author { padding: clamp(3rem, 8vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.author-wrap { display: grid; gap: 2rem; align-items: center; }
.author-portrait { width: 9rem; height: 9rem; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-md); flex: none; }
.author-portrait img { width: 100%; height: 100%; display: block; object-fit: cover; }
.author-copy p { margin: 0 0 1rem; }
.text-link { font-family: var(--font-display); font-weight: 600; }
@media (min-width: 48rem) { .author-wrap { grid-template-columns: auto 1fr; gap: 3rem; } }

/* Stay in touch */
.stay { padding: clamp(3.5rem, 9vw, 6rem) 0; background: var(--ink); color: var(--parchment); border-top: 1px solid var(--line); }
.stay .section-kicker { color: var(--marigold-bright); }
.stay .btn-primary { background: var(--sun); color: var(--ink); }
.stay .btn-primary:hover { background: var(--marigold); }
.stay .section-title { color: var(--cream); }
.stay-lead { color: color-mix(in srgb, var(--parchment) 85%, transparent); max-width: 46ch; margin: 0 0 1.75rem; }
.signup { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 30rem; }
.signup input {
  flex: 1 1 14rem; font-family: var(--font-body); font-size: 1.05rem;
  padding: 0.85rem 1.1rem; border-radius: 999px; border: 2px solid transparent;
  background: var(--cream); color: var(--ink);
}
.signup input:focus { outline: none; border-color: var(--marigold); }
.stay-status { margin: 1rem 0 0; min-height: 1.4em; font-size: 1.02rem; color: var(--marigold-bright); }
.stay-status.is-success { font-weight: 600; color: var(--marigold-bright); }
.stay-status.is-error { color: color-mix(in srgb, var(--pomegranate) 45%, var(--cream)); }
.stay-status:empty { display: none; }
.stay-fineprint { margin: 1rem 0 0; font-size: 0.9rem; font-style: italic; color: color-mix(in srgb, var(--parchment) 82%, transparent); }

/* Footer */
.site-footer { padding: 2.5rem 0; background: var(--parchment-deep); border-top: 1px solid var(--line); }
.footer-wrap { text-align: center; display: grid; gap: 0.3rem; }
.footer-title { font-family: var(--font-script); font-weight: 400; font-size: 1.7rem; color: var(--blue); margin: 0; }
.footer-by { color: var(--ink-soft); margin: 0; }
.footer-copy { color: var(--ink-soft); font-size: 0.9rem; margin: 0.5rem 0 0; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: rgba(33, 45, 64, 0.92); padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.open { display: flex; }
.lb-figure {
  margin: 0; max-width: min(94vw, 54rem);
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
}
.lb-img {
  max-width: 100%; max-height: 78vh; width: auto; height: auto;
  border-radius: 12px; box-shadow: var(--shadow-lg); background: var(--cream);
}
.lb-caption { margin: 0; color: var(--parchment); font-style: italic; text-align: center; }
.lb-btn {
  position: absolute; width: 3rem; height: 3rem; border-radius: 999px; border: none;
  background: rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer;
  font-size: 1.8rem; line-height: 1; display: grid; place-items: center;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.32); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { top: clamp(0.75rem, 3vw, 1.5rem); right: clamp(0.75rem, 3vw, 1.5rem); }
.lb-prev { left: clamp(0.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(0.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
