/* =========================================================
   A Spelling Mistake — Basia Clarke
   Palette drawn from the book cover: rust/terracotta title,
   warm outback tones, cream paper, charcoal-navy text.
   ========================================================= */

:root {
  --rust:        #9c3d22;   /* handwritten title / accent */
  --rust-dark:   #7d3019;
  --terracotta:  #c05a34;
  --sand:        #f6efe4;   /* warm cream / paper */
  --sand-2:      #efe4d3;
  --ink:         #2a3640;   /* charcoal navy body text */
  --ink-soft:    #55636d;
  --dusk-1:      #b5623c;   /* sunset gradient */
  --dusk-2:      #d98b5f;
  --dusk-3:      #e9b48a;
  --white:       #ffffff;

  --serif:  "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body:   "EB Garamond", Georgia, serif;
  --script: "Dancing Script", cursive;

  --maxw: 1140px;
  --shadow: 0 18px 45px rgba(42, 54, 64, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--sand);
  font-size: 1.15rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

p { margin: 0 0 1.1em; }

em { font-style: italic; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: 2px solid var(--rust);
}
.btn--primary {
  background: var(--rust);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(156, 61, 34, 0.28);
}
.btn--primary:hover {
  background: var(--rust-dark);
  border-color: var(--rust-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(156, 61, 34, 0.34);
}
.btn--outline {
  background: transparent;
  color: var(--rust);
}
.btn--outline:hover {
  background: var(--rust);
  color: var(--white);
  transform: translateY(-2px);
}
/* buttons sitting on dark sections */
.buy .btn--outline,
.themes .btn--outline {
  color: var(--white);
  border-color: var(--white);
}
.buy .btn--outline:hover,
.themes .btn--outline:hover {
  background: var(--white);
  color: var(--rust);
}

.btn__format {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2px;
}

.buy-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.hero__buttons.buy-buttons { margin: 30px 0 14px; }
.buy__buttons.buy-buttons { justify-content: center; margin-top: 28px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 239, 228, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(42, 54, 64, 0.08);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-family: var(--script);
  font-size: 1.7rem;
  color: var(--rust);
  text-decoration: none;
  line-height: 1;
}
.nav__menu {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav__menu a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.03em;
  transition: color 0.15s ease;
}
.nav__menu a:hover { color: var(--rust); }
.nav__cta {
  background: var(--rust);
  color: var(--white) !important;
  padding: 8px 18px;
  border-radius: 4px;
}
.nav__cta:hover { background: var(--rust-dark); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 26px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 90% at 80% 10%, rgba(233, 180, 138, 0.55), transparent 60%),
    linear-gradient(160deg, var(--sand) 0%, var(--sand-2) 100%);
  padding: 70px 0 90px;
  overflow: hidden;
}
.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.hero__title {
  font-family: var(--script);
  font-weight: 700;
  color: var(--rust);
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.95;
  margin: 0 0 18px;
}
.hero__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  color: var(--terracotta);
  max-width: 30ch;
  margin: 0 0 6px;
}
.hero__note {
  font-size: 0.98rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin: 0;
}
.hero__cover img {
  border-radius: 6px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-height: 620px;
  transform: rotate(-1.5deg);
}

/* ---------- Intro band ---------- */
.band--intro {
  background: var(--white);
  text-align: center;
  padding: 74px 0;
}
.band__lead-script {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.band__lead {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  color: var(--ink);
  margin: 0 0 26px;
}
.band__lead em {
  font-family: var(--script);
  color: var(--rust);
  font-style: normal;
  font-size: 1.15em;
}
.band__big {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--terracotta);
  margin: 0;
}

/* ---------- Section titles ---------- */
.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  color: var(--rust);
  line-height: 1.1;
  margin: 0 0 24px;
}
.section-title--light { color: var(--white); }

/* ---------- The Book ---------- */
.book { padding: 84px 0; }
.book__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.book__cover img {
  border-radius: 6px;
  box-shadow: var(--shadow);
  max-height: 560px;
  margin: 0 auto;
}
.book__closing {
  font-size: 1.25rem;
  color: var(--terracotta);
}
.book__copy .btn { margin-top: 10px; }

/* ---------- Characters ---------- */
.characters {
  background: var(--sand-2);
  padding: 84px 0;
  text-align: center;
}
.script-heading {
  font-family: var(--script);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--rust);
  margin: 0 0 44px;
}
.characters__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}
.character {
  background: var(--white);
  border-radius: 8px;
  padding: 34px 34px 30px;
  box-shadow: 0 10px 30px rgba(42, 54, 64, 0.10);
  border-top: 4px solid var(--terracotta);
}
.character__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--rust);
  margin: 0 0 12px;
}
.characters__footer {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--ink);
  max-width: 40ch;
  margin: 46px auto 0;
}

/* ---------- Themes ---------- */
.themes {
  background:
    linear-gradient(150deg, rgba(125, 48, 25, 0.94), rgba(181, 98, 60, 0.94)),
    linear-gradient(var(--terracotta), var(--terracotta));
  color: var(--white);
  padding: 84px 0;
  text-align: center;
}
.themes__sub {
  font-family: var(--serif);
  font-size: 1.35rem;
  max-width: 46ch;
  margin: 0 auto 34px;
  color: rgba(255, 255, 255, 0.95);
}
.themes__list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 620px;
  display: grid;
  gap: 14px;
}
.themes__list li {
  font-family: var(--serif);
  font-size: 1.35rem;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
}

/* ---------- Quote band ---------- */
.quote-band {
  background: var(--white);
  text-align: center;
  padding: 84px 0;
}
.quote-band blockquote {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4.4vw, 3rem);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 auto 20px;
  max-width: 20ch;
}
.quote-band__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 auto 30px;
}

/* ---------- Author ---------- */
.author { padding: 84px 0; }
.author__grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 52px;
  align-items: start;
}
.author__photo-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 65%;
  border-radius: 8px;
  border: 4px solid var(--rust);
  box-shadow: var(--shadow);
}
.author__photo-placeholder {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, var(--sand-2), var(--sand-2) 12px, var(--sand) 12px, var(--sand) 24px);
  border: 1px dashed rgba(42, 54, 64, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-style: italic;
  box-shadow: var(--shadow);
}
.author__name {
  font-family: var(--script);
  font-size: 2.2rem;
  color: var(--rust);
  margin: 0 0 14px;
}
.author__bio {
  max-width: 66ch;
}
.author__bio p {
  margin: 0 0 18px;
}
.author__bio-lead {
  font-size: 1.14rem;
  color: var(--ink);
  border-left: 3px solid var(--terracotta);
  padding-left: 20px;
}

/* Collapsed state is applied by JS, so the full bio still shows without it */
.author__bio-more { overflow: hidden; }
.author__bio.is-collapsible .author__bio-more {
  max-height: 0;
  opacity: 0;
  transition: max-height 0.55s ease, opacity 0.35s ease;
}
.author__bio.is-collapsible.is-open .author__bio-more {
  max-height: 320em;
  opacity: 1;
}
.author__bio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--body);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--rust);
  border-bottom: 1px solid rgba(156, 61, 34, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.author__bio-toggle:hover {
  color: var(--rust-dark);
  border-bottom-color: var(--rust-dark);
}
.author__bio-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s ease;
}
.author__bio.is-open .author__bio-toggle::after {
  transform: translateY(1px) rotate(-135deg);
}
.author__signoff {
  font-family: var(--script);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--rust);
  margin: 28px 0 0;
}
.author__signoff-year {
  display: block;
  font-family: var(--body);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* ---------- Buy ---------- */
.buy {
  background:
    linear-gradient(150deg, rgba(42, 54, 64, 0.92), rgba(42, 54, 64, 0.86)),
    linear-gradient(120deg, var(--dusk-1), var(--dusk-3));
  color: var(--white);
  text-align: center;
  padding: 90px 0;
}
.buy__sub {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}
.buy .btn--primary {
  border-color: var(--white);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  padding: 46px 0;
}
.site-footer__title {
  font-family: var(--script);
  font-size: 1.9rem;
  color: var(--dusk-3);
  margin: 0 0 4px;
}
.site-footer__by {
  font-family: var(--serif);
  font-style: italic;
  margin: 0 0 18px;
}
.site-footer__copy {
  font-size: 0.9rem;
  opacity: 0.7;
  margin: 0;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--sand);
    border-bottom: 1px solid rgba(42, 54, 64, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav__menu.is-open { max-height: 420px; }
  .nav__menu li { width: 100%; text-align: center; }
  .nav__menu li a {
    display: block;
    padding: 15px 0;
    border-top: 1px solid rgba(42, 54, 64, 0.08);
  }
  .nav__cta { border-radius: 0; }

  .hero__inner,
  .book__grid,
  .author__grid,
  .characters__grid {
    grid-template-columns: 1fr;
  }
  .hero { padding: 44px 0 60px; }
  .hero__text { text-align: center; order: 2; }
  .hero__cover { order: 1; }
  .hero__cover img { max-height: 420px; }
  .hero__tagline { margin-left: auto; margin-right: auto; }
  .hero__buttons.buy-buttons { justify-content: center; }

  .book__cover { max-width: 300px; margin: 0 auto; }
  .book__cover img { max-height: 440px; }
  .author__photo { max-width: 280px; margin: 0 auto; }
}

@media (max-width: 480px) {
  body { font-size: 1.08rem; }
  .buy-buttons { flex-direction: column; }
  .btn { width: 100%; text-align: center; }
  .container { padding: 0 18px; }
}
