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

:root {
  --font-title: 'Ribeye Marrow', Georgia, 'Times New Roman', serif;
  --font-hand:  'Caveat', 'Comic Sans MS', cursive;
  --font-body:  'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --parchment:       #fdf6e8;
  --parchment-d:     #f5ead4;
  --ink:             #2c1a0e;
  --ink-soft:        #5a3d28;
  --ink-muted:       #8c6e57;
  --rose:            #e8826a;
  --rose-pale:       #f9ded6;
  --sage:            #7aaa7a;
  --sage-pale:       #dff0d8;
  --dusty-blue:      #7ba7bc;
  --dusty-blue-pale: #d8ecf4;
  --amber:           #d4a03a;
  --amber-pale:      #fdf0c8;
  --white:           #fffef9;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--parchment);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
}

/* ====== SHARED HEADER ====== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--parchment);
  border-bottom: 2px dashed rgba(92,61,40,0.18);
  padding: 0 2rem;
}

.hero {
  margin-top: 16px; /* tweak: 12–24px depending on feel */
}

.site-nav {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-logo-img {
  height: 42px;
  width: auto;
  max-width: 200px;
  display: block;
  object-fit: contain;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.site-nav ul a {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav ul a:hover { color: var(--rose); }

.nav-shop {
  background: var(--rose);
  color: var(--white) !important;
  padding: 0.45rem 1.4rem;
  border-radius: 2rem;
  font-size: 1.1rem !important;
  box-shadow: 3px 3px 0 rgba(92,40,28,0.2);
  transition: transform 0.15s, box-shadow 0.15s !important;
}

.nav-shop:hover {
  transform: translate(-1px,-2px);
  box-shadow: 4px 5px 0 rgba(92,40,28,0.2) !important;
}

/* ====== SHARED FOOTER ====== */
.site-footer {
  background: var(--parchment-d);
  border-top: 2px dashed rgba(92,61,40,0.15);
  padding: 4rem 2rem 0;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 3rem;
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.75;
}

.footer-col-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 1.1rem;
  letter-spacing: 0.01em;
}

.footer-col a {
  display: block;
  min-height: 44px;
  line-height: 44px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 0.6rem;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--rose); }

.footer-bottom {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  border-top: 1px dashed rgba(92,61,40,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* ====== SHARED UI ====== */
.wave-divider { height: 56px; overflow: hidden; margin: -1px 0; }
.wave-divider svg { display: block; width: 100%; }
@media (max-width: 480px) {
  .wave-divider {
    display: none;
  }
}

.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.section-heading h2 {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.section-heading p {
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--ink-muted);
}

.btn-storybook,
.btn-buy,
.nl-form button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-storybook {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary-sb {
  background: var(--rose);
  color: var(--white);
  box-shadow: 4px 4px 0 rgba(100,35,20,0.22);
}

.btn-primary-sb:hover {
  transform: translate(-2px,-3px);
  box-shadow: 6px 7px 0 rgba(100,35,20,0.22);
}

.btn-outline-sb {
  background: transparent;
  color: var(--ink-soft);
  border: 2px solid var(--ink-soft) !important;
  box-shadow: 3px 3px 0 rgba(92,61,40,0.12);
}

.btn-outline-sb:hover {
  transform: translate(-2px,-3px);
  box-shadow: 5px 5px 0 rgba(92,61,40,0.15);
  background: var(--parchment-d);
}

/* Book card rhythm shared by homepage + /books pages */
.book-card {
  background: var(--white);
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid var(--parchment-d);
  box-shadow: 5px 8px 0 rgba(92,61,40,0.1);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s;
}

.book-card:hover {
  transform: translateY(-10px) rotate(-0.5deg);
  box-shadow: 8px 14px 0 rgba(92,61,40,0.12);
}

.book-img {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--parchment-d);
}

.book-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.book-card:hover .book-img img { transform: scale(1.04); }

.book-body {
  padding: 2rem 1.75rem 2.25rem;
}

.book-age {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: var(--ink-muted);
  background: var(--amber-pale);
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 2rem;
  margin-bottom: 0.9rem;
  border: 1px solid rgba(212,160,58,0.3);
}

.book-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.9rem;
}

.book-desc {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

.btn-buy {
  display: inline-flex;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.65rem 1.75rem;
  background: var(--sage);
  color: var(--white);
  border-radius: 0.5rem;
  text-decoration: none;
  box-shadow: 3px 4px 0 rgba(40,80,40,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-buy:hover {
  transform: translate(-2px,-2px);
  box-shadow: 5px 6px 0 rgba(40,80,40,0.2);
}

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

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }

.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;
}

@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 600px) {
  .site-nav ul { display: none; }
  .nav-logo-img { height: 34px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}