/* ============================================================
   Raising Kids, Raising Mom, Raising Me
   Shared by Michele's page (/), Zach's sales page (/book/) and the buy page (/buy/).
   Palette from the final cover (navy / rust / plum title on ivory)
   and the interior watercolor art (blush / sage / mauve + gold line).
   Mobile-first, no framework.
   ============================================================ */

:root {
  --ivory: #f8f3ea;
  --paper: #fffdf8;
  --linen: #f1e9dc;
  --navy: #162b4a;
  --rust: #b4562c;
  --plum: #4a1c2e;
  --sage: #8a9a74;
  --blush: #d9a491;
  --mauve: #9c7088;
  --gold: #c49a52;
  --ink: #24202a;
  --ink-soft: #5a5260;
  --line: rgba(74, 28, 46, 0.14);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1120px;
  --radius: 14px;
  --shadow: 0 22px 50px rgba(22, 43, 74, 0.18);
  --shadow-soft: 0 8px 26px rgba(22, 43, 74, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;            /* audience skews older: keep body text large */
  line-height: 1.7;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rust); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0 0 .4em; color: var(--navy); }
p { margin: 0 0 1em; }
em { font-style: italic; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
section { padding: 72px 0; position: relative; }
@media (min-width: 760px) { section { padding: 104px 0; } }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Gold dot rule (from the chapter pages) ---------- */
.rule { display: flex; align-items: center; gap: 10px; width: 200px; margin: 0 0 28px; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--gold); }
.rule span { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.center .rule { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 14px 28px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem; letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-primary { background: var(--rust); color: #fff; box-shadow: 0 10px 24px rgba(180, 86, 44, .28); }
.btn-primary:hover { background: #9c4621; }
.btn-ghost { background: transparent; color: var(--navy); border-color: rgba(22, 43, 74, .35); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-light { background: var(--paper); color: var(--navy); }
.btn-lg { min-height: 62px; padding: 18px 40px; font-size: 1.12rem; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.center .cta-row, .cta-row.center { justify-content: center; }
.cta-note { font-size: .92rem; color: var(--ink-soft); margin: 10px 0 0; }
.textlink { font-weight: 800; color: var(--navy); text-decoration: none; padding: 12px 6px; border-bottom: 1.5px solid rgba(22,43,74,.3); }
.textlink:hover { border-color: var(--navy); }

/* ---------- Button motion ----------
   Every button lifts and gets a light sweep on hover and sinks when pressed.
   Buy buttons (rust: .btn-primary / .btn-buy) also glow and flicker warm on hover, and
   do a slow shine every few seconds on their own so they read as buttons, not boxes. */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.38) 48%, transparent 66%);
  transform: translateX(-120%);
}
.textlink { transition: border-color .2s ease, color .2s ease; }
input:focus { box-shadow: 0 0 0 4px rgba(196, 154, 82, .28); }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform .2s cubic-bezier(.2,.8,.3,1.4), background-color .2s ease, color .2s ease, box-shadow .25s ease, border-color .2s ease; }
  .btn:hover { transform: translateY(-3px); }
  .btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
  .btn:hover::after { animation: btn-sweep .7s ease forwards; }
  .btn:hover .arrow { transform: translateX(6px); }
  .btn-primary:hover, .btn-buy:hover { animation: buy-glow 1.6s ease-in-out infinite; }
  /* idle shine: once every 6s, staggered so the page never flashes all at once */
  .btn-primary.btn-lg::after, .btn-buy::after { animation: btn-sweep 6s ease-in-out 2s infinite; }
  .btn-primary.btn-lg:hover::after, .btn-buy:hover::after { animation: btn-sweep .7s ease forwards; }
  .sticky-cta .btn-buy::after, .sticky-top .btn-buy::after, .sticky-cta .btn-primary::after { animation-delay: 4s; }
}
@keyframes btn-sweep {
  0% { transform: translateX(-120%); }
  12%, 100% { transform: translateX(120%); }
}
/* glow with a small candle-like flicker in the middle */
@keyframes buy-glow {
  0%, 100% { box-shadow: 0 12px 28px rgba(180, 86, 44, .38), 0 0 0 0 rgba(244, 182, 120, 0); }
  40% { box-shadow: 0 16px 36px rgba(180, 86, 44, .5), 0 0 22px 4px rgba(244, 170, 100, .55); }
  46% { box-shadow: 0 16px 36px rgba(180, 86, 44, .5), 0 0 12px 2px rgba(244, 170, 100, .3); }
  52% { box-shadow: 0 16px 36px rgba(180, 86, 44, .5), 0 0 26px 6px rgba(244, 170, 100, .6); }
}

/* ---------- Top bar ---------- */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: .95rem; letter-spacing: .2em; text-transform: uppercase; color: var(--plum); text-decoration: none; white-space: nowrap; }
.topbar .btn { display: none; min-height: 44px; padding: 10px 20px; font-size: .92rem; white-space: nowrap; }
/* Phones get the sticky bottom bar instead of the top button */
@media (min-width: 600px) { .brand { font-size: 1.05rem; letter-spacing: .24em; } .topbar .btn { display: inline-flex; } }

/* ---------- Scroll reveal (only when JS runs and motion is welcome) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .reveal.d1 { transition-delay: .12s; } .js .reveal.d2 { transition-delay: .24s; } .js .reveal.d3 { transition-delay: .36s; }
}

/* ---------- Watercolor bloom ornament ---------- */
.bloom { display: block; pointer-events: none; }

/* ---------- Thread: ONE string that shifts orange to purple to blue, tangles, then makes three loops (as on the cover) ---------- */
.thread { display: block; width: 100%; height: auto; overflow: visible; }
.thread path { fill: none; stroke: url(#threadGrad); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .js .thread path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 3s cubic-bezier(.45,.05,.3,1); }
  .js .thread.in path { stroke-dashoffset: 0; }
}

/* ---------- Book cover ---------- */
.cover-wrap { position: relative; display: flex; justify-content: center; }
.cover { width: min(300px, 70vw); height: auto; aspect-ratio: 2 / 3; border-radius: 3px 8px 8px 3px; box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,.04); position: relative; z-index: 1; }
.cover-wrap .bloom { position: absolute; width: 150%; max-width: 560px; left: 50%; top: 50%; transform: translate(-50%, -46%); opacity: .55; }
@media (min-width: 900px) { .cover { width: 330px; } }

/* ---------- Author chip: small photo so visitors recognize Michele right away ---------- */
.author-chip { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 24px; text-decoration: none; }
.author-chip img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 3px solid var(--paper); box-shadow: var(--shadow-soft); flex-shrink: 0; }
.author-chip span { font-family: var(--font-display); font-weight: 600; font-size: clamp(.82rem, 3.4vw, 1rem); letter-spacing: .16em; text-transform: uppercase; color: var(--plum); line-height: 1.35; }
.author-chip strong { display: block; font-weight: 700; letter-spacing: .12em; color: var(--navy); }
@media (min-width: 900px) { .author-chip img { width: 72px; height: 72px; } .author-chip span { letter-spacing: .22em; } }

/* ---------- Who it's for ---------- */
.who-list { list-style: none; padding: 0; margin: 0; display: grid; }
.who-list li { padding: 18px 0 18px 34px; border-top: 1px solid var(--line); position: relative; font-size: 1.08rem; }
.who-list li::before { content: ""; position: absolute; left: 0; top: 24px; width: 16px; height: 16px; border-radius: 50%; background: var(--dot, var(--blush)); opacity: .9; }
.who-list li:nth-child(3n+2) { --dot: var(--sage); }
.who-list li:nth-child(3n) { --dot: var(--mauve); }
@media (min-width: 760px) { .who-list { grid-template-columns: 1fr 1fr; column-gap: 56px; } }

/* ---------- Three generations ---------- */
.gen-grid { display: grid; gap: 22px; max-width: 420px; margin: 0 auto; }
.gen-card { margin: 0; }
.gen-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-soft); }
.gen-card img.natural { aspect-ratio: auto; }  /* small, nearly square snapshot: show it whole */
.gen-card figcaption { padding: 14px 4px 0; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; line-height: 1.35; color: var(--plum); text-align: center; }
@media (min-width: 760px) {
  .gen-grid { max-width: none; grid-template-columns: repeat(auto-fit, minmax(230px, 320px)); justify-content: center; gap: 30px; align-items: start; }
  .gen-card:nth-child(2) { margin-top: 48px; }
}

/* ---------- Michele's self-care plan (the free email gift, from Chapter 12) ---------- */

/* ---------- Meet Michele ---------- */
.author .grid { display: grid; gap: 40px; align-items: center; }
.portrait { width: min(340px, 82vw); margin: 0 auto; border-radius: 200px 200px 10px 10px; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: var(--shadow); }
.author h2 { font-size: clamp(2.2rem, 7vw, 3.1rem); color: var(--rust); }
.author .small { font-family: var(--font-display); font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--plum); font-size: .95rem; margin-bottom: 8px; }
@media (min-width: 900px) {
  .author .grid { grid-template-columns: 380px 1fr; gap: 72px; }
  .portrait { width: 100%; margin: 0; }
}

/* ---------- Waitlist form (UI only until an email service is connected; see site.js) ---------- */
.waitlist { max-width: 520px; }
.center .waitlist, .waitlist.center { margin-left: auto; margin-right: auto; }
.waitlist .fields { display: grid; gap: 10px; }
.waitlist input {
  width: 100%; min-height: 54px; padding: 14px 18px; border-radius: 12px;
  border: 1.5px solid rgba(22, 43, 74, .22); background: var(--paper);
  font: inherit; font-size: 1rem; color: var(--ink);
}
.waitlist input:focus { outline: 3px solid rgba(196, 154, 82, .55); outline-offset: 1px; border-color: var(--gold); }
.waitlist .btn { width: 100%; }
.waitlist .fine { font-size: .88rem; color: var(--ink-soft); margin: 10px 0 0; }
.waitlist .done { display: none; padding: 18px 20px; border-radius: 12px; background: rgba(138, 154, 116, .18); color: var(--navy); font-weight: 700; }
.waitlist.sent .fields, .waitlist.sent .fine { display: none; }
.waitlist.sent .done { display: block; }
@media (min-width: 600px) { .waitlist .fields.inline { grid-template-columns: 1fr auto; } .waitlist .fields.inline .btn { width: auto; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.82); padding: 46px 0 110px; text-align: center; font-size: .95rem; }
.site-footer .publisher { display: inline-block; background: #fff; border-radius: 10px; padding: 14px 20px; margin: 8px 0 16px; }
.site-footer .publisher img { width: 210px; height: auto; }
.site-footer .title { font-family: var(--font-display); font-size: 1.4rem; color: #fff; margin-bottom: 14px; }
@media (min-width: 900px) { .site-footer { padding-bottom: 46px; } }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 253, 248, .97); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 22px rgba(22, 43, 74, .1);
  transform: translateY(110%); transition: transform .25s ease;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sticky-cta p { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--plum); line-height: 1.2; }
.sticky-cta .btn { min-height: 46px; padding: 10px 20px; flex-shrink: 0; }
@media (min-width: 900px) { .sticky-cta { display: none; } }

/* ---------- Sticky desktop header (sales page): buy button always one click away ---------- */
.sticky-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: none;
  background: rgba(255, 253, 248, .97); border-bottom: 1px solid var(--line); box-shadow: 0 6px 22px rgba(22, 43, 74, .08);
  transform: translateY(-110%); transition: transform .25s ease;
}
.sticky-top:not(.show) { box-shadow: none; border-bottom-color: transparent; }
.sticky-top.show { transform: translateY(0); }
.sticky-top .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.sticky-top .mini { display: flex; align-items: center; gap: 12px; }
.sticky-top .mini img { width: 34px; height: auto; border-radius: 2px; box-shadow: var(--shadow-soft); }
.sticky-top .mini strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--navy); }
.sticky-top .links { display: flex; align-items: center; gap: 18px; }
.sticky-top .links a.textlink { padding: 6px 2px; font-size: .95rem; }
.sticky-top .btn { min-height: 46px; padding: 10px 24px; }
@media (min-width: 900px) { .sticky-top { display: block; } }

/* ---------- Review switcher (only shown after visiting with ?review=1; see site.js) ---------- */
.review-bar {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; gap: 4px; padding: 5px; border-radius: 999px;
  background: rgba(22, 43, 74, .94); box-shadow: 0 10px 30px rgba(0,0,0,.25);
  font-family: var(--font-body); font-size: .82rem; font-weight: 800;
}
.review-bar a { color: rgba(255,255,255,.75); text-decoration: none; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.review-bar a[aria-current="page"] { background: #fff; color: var(--navy); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .sticky-cta { transition: none; }
}


/* "Already read it?" Amazon review request, under the last buy button.
   Outline button on purpose: rust stays reserved for Buy buttons. */
.review-ask { max-width: 560px; margin: 36px auto 0; padding: 26px 24px; text-align: center; border: 1px dashed rgba(22, 43, 74, .28); border-radius: var(--radius); }
.review-ask .ra-kick { font-weight: 800; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sage); margin: 0 0 6px; }
.review-ask .ra-text { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.35; color: var(--navy); margin: 0 0 16px; }

/* Book covers link to Amazon (new tab). Lift + soft glow on hover so the cover reads as clickable. */
.cover-link { display: block; border-radius: 4px; cursor: pointer; }
.cover-link .cover { transition: transform .25s cubic-bezier(.2,.8,.3,1.2), box-shadow .25s ease; }
.cover-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .cover-link:hover .cover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 30px 60px rgba(22, 43, 74, .28), 0 0 0 6px rgba(196, 154, 82, .18); }
}
