:root {
  --cream: #f6f0dc;
  --paper: #fffdf6;
  --ink: #2f2a24;
  --muted: #6b6257;
  --green: #4d6a2a;       /* from the Roots of Love logo, confirm against source file */
  --green-dark: #3b5320;
  --line: #d9cfb3;
  --radius: 4px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
}

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

a { color: var(--green-dark); }

.topbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.brand { display: block; width: fit-content; margin: 0 auto; }
.brand img { height: 76px; width: auto; }

/* Hero: cover left, copy + buttons right */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
}
.hero__media { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.cover {
  width: 100%;
  max-width: 460px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 18px 40px -12px rgba(47,42,36,.35);
}
.theme-logo {
  width: 180px;
  mix-blend-mode: multiply; filter: brightness(1.06) contrast(1.1); /* logo file has an off-white background; drop this once a transparent PNG arrives */
}

.eyebrow {
  margin: 0 0 4px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
}
h1 {
  margin: 0 0 16px;
  font: 600 clamp(2.6rem, 5vw, 4rem)/1.05 var(--serif);
}
.lede {
  margin: 0 0 32px;
  font: italic 500 clamp(1.25rem, 2vw, 1.5rem)/1.45 var(--serif);
  color: var(--muted);
}

.actions { display: flex; flex-wrap: wrap; gap: 16px; }
.action { flex: 1 1 200px; max-width: 260px; }
.action__note { margin: 8px 0 0; font-size: .9rem; color: var(--muted); text-align: center; }
.action__note strong { color: var(--ink); }

.btn {
  display: inline-block;
  width: 100%;
  padding: 16px 24px;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  font: 700 .95rem var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn--primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(59,83,32,.6);
}
.btn--primary:hover { background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); }
.btn--secondary { background: transparent; color: var(--green-dark); }
.btn--secondary:hover { background: var(--paper); }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.btn--block { width: 100%; }

/* Download form */
.download {
  max-width: 720px;
  margin: 0 auto 72px;
  padding: 40px 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 24px;
}
.download h2 {
  margin: 0 0 4px;
  font: 600 clamp(1.7rem, 3vw, 2.2rem)/1.2 var(--serif);
  text-align: center;
}
.download__intro { margin: 0 0 28px; text-align: center; color: var(--muted); }

.form { display: grid; gap: 20px; }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form legend, .field > span { display: block; margin-bottom: 6px; font-weight: 700; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row legend { grid-column: 1 / -1; }
.row label span { display: block; margin-top: 4px; font-size: .85rem; color: var(--muted); }
.req { color: #a3392b; }

input, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #b9ae93;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.form [aria-invalid="true"] { border-color: #a3392b; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { margin: 0; font-size: .85rem; color: var(--muted); }
.form__error { margin: 0; padding: 12px 14px; background: #fbeae6; color: #8a2e22; border-radius: var(--radius); }

.footer { padding: 24px 16px; text-align: center; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }

/* Reader page */
.reader { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.reader__head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.reader__head h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); }
.reader__head .btn { width: auto; }
.reader__frame { position: relative; width: 100%; aspect-ratio: 3 / 2; max-height: calc(100vh - 220px); min-height: 420px; background: #fff; border: 1px solid var(--line); }
.reader__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 800px) {
  .brand img { height: 60px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 24px 16px 40px; text-align: center; }
  .hero__media { gap: 16px; }
  .cover { max-width: 240px; }
  .theme-logo { width: 130px; }
  .actions { flex-direction: column; align-items: stretch; }
  .action { max-width: none; flex: none; }
  .download { margin: 0 16px 48px; padding: 28px 16px; }
  .reader__frame { aspect-ratio: 3 / 4; }
}
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; gap: 12px; }
}

/* Motion: subtle, and off entirely for reduced-motion users */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .cover { animation: rise 1s cubic-bezier(.2, .7, .2, 1) both; transition: transform .6s cubic-bezier(.2, .7, .2, 1), box-shadow .6s; }
  .cover:hover { transform: translateY(-6px); box-shadow: 0 4px 8px rgba(0,0,0,.08), 0 28px 50px -14px rgba(47,42,36,.42); }
  .theme-logo { animation: fade 1.2s .6s both; }

  .hero__copy > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero__copy > :nth-child(1) { animation-delay: .15s; }
  .hero__copy > :nth-child(2) { animation-delay: .25s; }
  .hero__copy > :nth-child(3) { animation-delay: .35s; }
  .hero__copy > :nth-child(4) { animation-delay: .5s; }

  /* Soft sheen across the Buy button on hover */
  .btn--primary { position: relative; overflow: hidden; }
  .btn--primary::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
    transform: skewX(-20deg);
    transition: left .7s ease;
    pointer-events: none;
  }
  .btn--primary:hover::after { left: 130%; }

  /* Download button: a soft ring every few seconds; stops while hovered/focused */
  .btn--secondary { animation: nudge 4s ease-out 2s infinite; }
  .btn--secondary:hover, .btn--secondary:focus-visible { animation: none; }

  /* Form card fades up when scrolled into view (class added by app.js) */
  .reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
  .reveal.is-visible { opacity: 1; transform: none; }

  /* Brief glow when arriving via "Download free" */
  .download.is-targeted { animation: glow 1.8s ease; }

  .reader__head, .reader__frame { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .reader__frame { animation-delay: .15s; }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes nudge {
  0% { box-shadow: 0 0 0 0 rgba(77,106,42,.45); }
  30%, 100% { box-shadow: 0 0 0 12px rgba(77,106,42,0); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(77,106,42,0); }
  35% { box-shadow: 0 0 0 6px rgba(77,106,42,.18); }
}
