/* MacGregor Library — soft cottagecore / children's literary */
:root {
  --cream: #F7F3EC;
  --cream-deep: #EFE8DC;
  --linen: #FBF8F3;
  --paper: #F5F0E6;
  --charcoal: #4A4540;
  --taupe: #6B635A;
  --taupe-soft: #8B8074;
  --border: #C9BDB0;
  --border-soft: #DDD3C6;
  --peach: #D4A08A;
  --peach-deep: #C4896F;
  --peach-soft: #E8C4B4;
  --sage: #8FA08A;
  --sage-deep: #6F8470;
  --sage-soft: #B5C2B0;
  --cornflower: #A8B5C4;
  --lavender: #B8A9B8;
  --tan: #D4C4B0;
  --brick: #B8766A;
  --warm-brown: #8B6B4F;
  --fox: #C4784A;
  --max: 1080px;
  --serif: "Libre Baskerville", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --radius-pill: 999px;
  --radius-soft: 18px;
  --shadow-soft: 0 12px 40px rgba(74, 69, 64, 0.07);
  --shadow-card: 0 8px 28px rgba(74, 69, 64, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--charcoal);
  background-color: var(--cream);
  background-image:
    url("../assets/decor/paper-texture.png"),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(232, 196, 180, 0.25), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(181, 194, 176, 0.2), transparent 50%);
  background-blend-mode: multiply, normal, normal;
  background-size: 280px 280px, auto, auto;
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* Soft watercolor corner flourishes */
body::before,
body::after {
  content: "";
  position: fixed;
  width: min(280px, 32vw);
  height: min(360px, 42vh);
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
body::before {
  top: 0; left: 0;
  background-image: url("../assets/decor/floral-tl.png");
  background-position: top left;
}
body::after {
  bottom: 0; right: 0;
  background-image: url("../assets/decor/floral-br.png");
  background-position: bottom right;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--peach-deep); }
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--charcoal); color: var(--cream); padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* ——— Header ——— */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 236, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.brand {
  display: flex; align-items: center; gap: 0.75rem;
  text-decoration: none; color: var(--charcoal);
}
.brand-mark {
  width: auto; height: 84px; object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(74,69,64,0.08));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text .name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-text .tag {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--taupe-soft);
  font-weight: 500;
  margin-top: 0.15rem;
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--charcoal);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
#menu {
  display: flex; align-items: center; gap: 1.5rem;
}
#menu a {
  text-decoration: none;
  color: var(--taupe);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}
#menu a:hover,
#menu a[aria-current="page"] {
  color: var(--charcoal);
}
#menu a[aria-current="page"] {
  box-shadow: inset 0 -1.5px 0 var(--peach);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.45rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-peach {
  background: var(--peach);
  color: #fff;
  border-color: var(--peach);
}
.btn-peach:hover {
  background: var(--peach-deep);
  border-color: var(--peach-deep);
  color: #fff;
}
.btn-sage {
  background: var(--sage);
  color: #fff;
  border-color: var(--sage);
}
.btn-sage:hover {
  background: var(--sage-deep);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--taupe);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--taupe-soft);
  color: var(--charcoal);
  background: rgba(255,255,255,0.4);
}
.btn-disabled,
.btn:disabled {
  background: var(--cream-deep);
  color: var(--taupe-soft);
  border-color: var(--border-soft);
  cursor: not-allowed;
  transform: none;
  opacity: 0.9;
}
.btn.small { padding: 0.45rem 1rem; font-size: 0.8rem; }

/* ——— Typography ——— */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--charcoal);
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2rem, 4.5vw, 2.85rem); margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); margin: 0 0 0.6rem; }
h3 { font-size: 1.25rem; margin: 0 0 0.4rem; }
.lead {
  font-size: 1.12rem;
  color: var(--taupe);
  max-width: 38rem;
  margin: 0 0 1.25rem;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--peach-deep);
  font-weight: 500;
  margin: 0 0 0.65rem;
}
.center { text-align: center; }
.center.lead, p.lead.center { margin-inline: auto; }

/* ——— Hero ——— */
.hero {
  padding: 3.5rem 0 3rem;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  gap: 2.5rem;
  align-items: center;
}
.logo-cameo {
  position: relative;
  margin: 0 auto;
}
.logo-cameo img {
  width: 100%;
  max-width: 230px;
  margin-inline: auto;
  filter: drop-shadow(0 10px 24px rgba(74,69,64,0.1));
}
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

/* ——— Values ——— */
.values {
  padding: 1rem 0 3.5rem;
}
.values h2 { margin-bottom: 1.75rem; }
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.value-card {
  background: rgba(251, 248, 243, 0.75);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-soft);
  padding: 1.35rem 1.2rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.value-card .icon-oval {
  width: 72px; height: 96px;
  margin: 0 auto 0.85rem;
  object-fit: contain;
}
.value-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.value-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--taupe);
}

/* ——— Featured book ——— */
.featured {
  padding: 2.5rem 0 3.5rem;
  background: linear-gradient(180deg, transparent, rgba(239, 232, 220, 0.55) 20%, rgba(239, 232, 220, 0.55) 80%, transparent);
}
.book {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 2rem;
  align-items: start;
  background: var(--linen);
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
  margin: 1.5rem 0;
}
/* Book cover frame: full cover, natural aspect ratio. Swap covers by replacing files in assets/covers/ */
.cover-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #C9BDB0;
  box-shadow: 0 8px 22px rgba(74,69,64,0.10);
  background: var(--cream-deep);
  align-self: start;
}
.cover-frame img {
  display: block;
  width: 100%; height: auto;
  object-fit: contain;
}
.cover-frame.soon { position: relative; }
.cover-frame .ribbon {
  position: absolute;
  left: 50%; bottom: 12%;
  transform: translateX(-50%);
  background: rgba(247, 243, 236, 0.95);
  border: 1px solid var(--border);
  color: var(--taupe);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.book-body .tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0 0 0.4rem;
}
.book-body .by {
  font-style: italic;
  font-family: var(--serif);
  color: var(--taupe-soft);
  margin: 0 0 0.85rem;
  font-size: 0.98rem;
}
.book-body p { color: var(--taupe); }
.buy {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-top: 1.25rem;
}
.link {
  font-size: 0.95rem;
  color: var(--sage-deep);
}

/* ——— Page head ——— */
.page-head {
  padding: 3rem 0 1.5rem;
  text-align: center;
}
.page-head .lead { margin-inline: auto; }

/* ——— Books list ——— */
.book-list { padding-bottom: 2rem; }
.more {
  text-align: center;
  padding: 2rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-soft);
  background: rgba(251,248,243,0.5);
  margin: 1rem 0 2rem;
}
.more p { color: var(--taupe); margin: 0.4rem 0 0; }

/* ——— About / prose ——— */
.prose {
  max-width: 40rem;
  padding-bottom: 2rem;
}
.prose h2 { margin-top: 2rem; }
.prose p { color: var(--taupe); }
.prose ul {
  color: var(--taupe);
  padding-left: 1.2rem;
}
.prose li { margin-bottom: 0.4rem; }
.author {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--linen);
  border: 1px solid var(--border-soft);
  border-radius: 24px;
}
.author .sig {
  font-family: var(--serif);
  font-style: italic;
  color: var(--charcoal);
  margin-top: 0.75rem;
}
.author-mark {
  width: 100px;
  filter: drop-shadow(0 4px 12px rgba(74,69,64,0.08));
}

/* ——— Signup ——— */
.signup {
  padding: 2.5rem 0 4rem;
}
.signup-inner {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.75rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(232,196,180,0.28), rgba(181,194,176,0.22));
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-card);
}
.signup-inner h2 { margin-bottom: 0.35rem; }
.signup-inner > div > p { color: var(--taupe); margin-top: 0; }
.signup-mark {
  width: 110px;
  margin-inline: auto;
  filter: drop-shadow(0 4px 12px rgba(74,69,64,0.08));
}
.signup-form .fields {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1rem;
}
.signup-form label {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--taupe-soft);
}
.signup-form label em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}
.signup-form input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1rem;
  font-family: var(--sans);
  font-size: 1rem;
  background: var(--linen);
  color: var(--charcoal);
  text-transform: none;
  letter-spacing: 0;
}
.signup-form input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 160, 138, 0.25);
}
.form-msg {
  min-height: 1.4em;
  margin: 0.75rem 0 0;
  color: var(--sage-deep);
  font-size: 0.95rem;
}
.form-msg.error { color: #a05a4a; }

/* ——— Footer ——— */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 2rem 0 2.5rem;
  background: rgba(239, 232, 220, 0.45);
  position: relative;
  z-index: 1;
}
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}
.foot-brand {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.foot-brand img { width: 64px; height: auto; opacity: 0.9; }
.foot-brand .name {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--charcoal);
}
.foot-brand .tag {
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--taupe-soft);
}
.foot nav { display: flex; gap: 1.25rem; }
.foot nav a {
  text-decoration: none;
  color: var(--taupe);
  font-size: 0.88rem;
}
.foot nav a:hover { color: var(--charcoal); }
.foot p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--taupe-soft);
}

/* ——— Animal strip (home) ——— */
.animal-strip {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 2rem;
  opacity: 0.92;
}
.animal-strip img {
  width: 72px;
  height: auto;
  filter: drop-shadow(0 3px 8px rgba(74,69,64,0.08));
  transition: transform .2s;
}
.animal-strip img:hover { transform: translateY(-3px); }

/* ——— Divider flourish ——— */
.flourish {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1.25rem;
  color: var(--peach);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
}
.flourish::before,
.flourish::after {
  content: "";
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ——— Responsive ——— */
@media (max-width: 860px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-inner .lead { margin-inline: auto; }
  .cta { justify-content: center; }
  .logo-cameo img { max-width: 180px; }
  .book { grid-template-columns: 1fr; }
  .cover-frame { max-width: 220px; margin-inline: auto; }
  .signup-inner { grid-template-columns: 1fr; text-align: center; }
  .signup-form .fields { grid-template-columns: 1fr; }
  .author { grid-template-columns: 1fr; text-align: center; }
  .author-mark { margin-inline: auto; }
  body::before, body::after { opacity: 0.35; width: min(180px, 40vw); }
}
@media (max-width: 640px) {
  .menu-btn { display: inline-flex; }
  #menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(247, 243, 236, 0.97);
    border-bottom: 1px solid var(--border-soft);
    padding: 0.5rem 1.25rem 1rem;
  }
  #menu.open { display: flex; }
  #menu a { padding: 0.65rem 0; width: 100%; }
  .nav { position: relative; }
  .grid4 { grid-template-columns: 1fr; }
  .brand-text .name { font-size: 1rem; }
}

/* Badges: full oval, never cropped */
.animal-strip img, .value-card .icon-oval, .author-mark, .signup-mark {
  aspect-ratio: 3 / 4; height: auto; object-fit: contain; object-position: center;
  border-radius: 0; overflow: visible;
}
