/* Luna Lane — cozy coloring-book theme */

@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url('../fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('../fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url('../fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-style: italic; font-display: swap; src: url('../fonts/nunito-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url('../fonts/nunito-latin-700-normal.woff2') format('woff2'); }

:root {
  --cream: #fbf4e6;
  --cream-deep: #f4e7cc;
  --paper: #fffdf8;
  --ink: #3a2c27;
  --ink-soft: #6e5d55;
  --red: #b8323a;
  --red-dark: #962830;
  --green: #2e5e45;
  --green-dark: #234a36;
  --gold: #f2b630;
  --pink: #f4b8b0;
  --line: 2.5px solid var(--ink);
  --radius: 22px;
  --shadow: 5px 6px 0 var(--ink);
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

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

body {
  margin: 0;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(58, 44, 39, .07) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); color: var(--red); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); color: var(--green); }
h3 { font-size: 1.3rem; }
h3 a { color: inherit; text-decoration: none; }
h3 a:hover { color: var(--red); }

p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 14px; border: var(--line); border-radius: 12px; z-index: 10; }
.skip-link:focus { left: 16px; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: .4em;
}
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.center { text-align: center; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.25rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .7em 1.4em;
  border: var(--line);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: #fff; transform: translate(-1px, -2px); box-shadow: 5px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-outline { background: var(--paper); color: var(--ink); }
.btn-outline:hover { color: var(--ink); background: #fff; }
.btn-green { background: var(--green); }
.btn-amazon { background: var(--gold); color: var(--ink); }
.btn-amazon:hover { color: var(--ink); }
.btn-small { padding: .45em 1em; font-size: .95rem; }
.btn-big { padding: .85em 1.8em; font-size: 1.2rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(251, 244, 230, .92);
  backdrop-filter: blur(8px);
  border-bottom: var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; }
.brand:hover { color: var(--red); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.site-nav a {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: .35em .9em;
  border-radius: 999px;
  border: 2px solid transparent;
}
.site-nav a:hover { border-color: var(--ink); background: var(--paper); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--green); color: #fff; border-color: var(--ink); }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero-text .lead { max-width: 34em; }
.hero-cover { position: relative; display: block; justify-self: center; width: min(440px, 100%); transform: rotate(3deg); transition: transform .3s ease; }
.hero-cover:hover { transform: rotate(0deg) scale(1.02); }
.hero-cover img { border: var(--line); border-radius: 14px; box-shadow: 10px 12px 0 var(--ink); width: 100%; }
.hero-badge {
  position: absolute; bottom: -22px; left: -22px;
  background: var(--red); color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  width: 78px; height: 78px; display: grid; place-items: center;
  border: var(--line); border-radius: 50%;
  transform: rotate(-14deg);
}
.sparkle { position: absolute; color: var(--gold); font-size: 2.4rem; -webkit-text-stroke: 1.5px var(--ink); line-height: 1; animation: twinkle 3s ease-in-out infinite; }
.sparkle.s1 { top: -30px; right: 8%; }
.sparkle.s2 { bottom: 18%; left: -40px; font-size: 1.8rem; animation-delay: .8s; }
.sparkle.s3 { bottom: -28px; right: -16px; font-size: 1.6rem; animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.18) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .sparkle { animation: none; } .hero-cover, .btn { transition: none; } }

/* Sections */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section-tight { padding-bottom: clamp(40px, 6vw, 72px); }
.section-tinted { background: var(--cream-deep); border-block: var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin-bottom: .15em; }
.section-head p { margin: 0; }
.link-more { font-family: var(--font-display); font-weight: 500; text-decoration: none; }

.page-head { padding: clamp(36px, 6vw, 64px) 0 28px; }
.page-head .lead { max-width: 42em; }

/* Cards */
.grid { display: grid; gap: 28px; }
.book-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.coloring-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translate(-2px, -3px); box-shadow: 8px 10px 0 var(--ink); }

.book-card-cover { display: block; border-bottom: var(--line); background: var(--cream-deep); }
.book-card-cover img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.book-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.book-card-body h3 { margin-bottom: .2em; }
.book-card-body .eyebrow { font-size: .8rem; }
.book-card-body .muted { margin-bottom: 0; }
.book-card-body .actions { margin-top: auto; padding-top: 16px; }

.coloring-preview { display: block; background: #fff; border-bottom: var(--line); padding: 14px; }
.coloring-preview img { width: 100%; aspect-ratio: 480 / 620; object-fit: contain; }
.no-preview { display: grid; place-items: center; aspect-ratio: 480 / 620; font-size: 3rem; color: var(--ink-soft); }
.coloring-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; flex: 1; }
.coloring-body h3 { font-size: 1.15rem; margin: 0; }
.coloring-body .btn { margin-top: auto; }

.note {
  margin-top: 36px;
  padding: 16px 20px;
  border: 2px dashed var(--ink-soft);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink-soft);
}

/* About */
.about { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; max-width: 860px; }
.about-mark { width: 96px; height: 96px; }

/* Prose */
.prose { max-width: 44em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--red); }
.prose strong { color: var(--ink); }
.prose.center { margin-inline: auto; }

/* Book detail */
.book { padding: 28px 0 clamp(48px, 7vw, 80px); }
.breadcrumb { font-family: var(--font-display); font-weight: 500; margin-bottom: 24px; }
.breadcrumb a { text-decoration: none; }
.book-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.book-visuals { position: sticky; top: 100px; }
.book-cover img { border: var(--line); border-radius: 14px; box-shadow: 8px 10px 0 var(--ink); width: 100%; }
.book-gallery { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.book-gallery a { width: calc(33.333% - 10px); }
.book-gallery img { border: 2px solid var(--ink); border-radius: 10px; }
.book-info h1 { margin-bottom: .2em; }
.details {
  margin: 28px 0 0;
  padding: 18px 22px;
  border: var(--line);
  border-radius: 18px;
  background: var(--paper);
  display: grid;
  gap: 8px;
}
.details div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; }
.details dt { font-weight: 700; color: var(--green); }
.details dd { margin: 0; }

.big-emoji { font-size: 4rem; margin: 0; }

/* Footer */
.site-footer { background: var(--green); color: #f4efe2; border-top: var(--line); padding: 36px 0 28px; margin-top: auto; }
.footer-inner { display: grid; gap: 14px; justify-items: center; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin: 0; flex-wrap: wrap; justify-content: center; }
.footer-brand span { font-weight: 500; opacity: .85; }
.footer-brand img { background: var(--cream); border-radius: 50%; padding: 2px; }
.site-footer nav { display: flex; gap: 6px 20px; flex-wrap: wrap; justify-content: center; }
.site-footer a { color: #fff; font-weight: 700; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .small { opacity: .75; margin: 0; }

/* Responsive */
@media (max-width: 820px) {
  .hero-inner, .book-layout { grid-template-columns: 1fr; }
  .hero-cover { width: min(340px, 86%); margin-top: 12px; }
  .book-visuals { position: static; max-width: 460px; }
  .about { grid-template-columns: 1fr; }
  .about-mark { width: 72px; height: 72px; }
}
@media (max-width: 520px) {
  .header-inner { justify-content: center; }
  .brand { font-size: 1.3rem; }
  .site-nav { justify-content: center; gap: 2px; }
  .site-nav a { padding: .3em .7em; font-size: .95rem; }
  .details div { grid-template-columns: 1fr; gap: 0; }
  .sparkle.s2 { left: -24px; }
}
