/* ============================================================
   The Super Easy Renal Diet Cookbook After 50 — Bonus landing
   Palette LOCKED: "Petrol & Sage Clinic"
   Fonts: Bitter (headers) + Source Sans 3 (body) — coherent with the book
   WCAG: clinical numbers (Na/K/P) always petrol #2A5663; body near-black
         warm #2B2B28 on cream #FBFAF6; sage/terracotta = decoration only.
   ============================================================ */

:root {
  --bg:        #FBFAF6; /* base cream */
  --sage:      #7C9885; /* accent — decoration only */
  --sage-dk:   #4f6b59; /* darker sage for text-on-cream (>=4.5:1 WCAG AA) */
  --petrol:    #2A5663; /* clinical numbers + strong ink */
  --petrol-dk: #21454f;
  --terra:     #C8745A; /* divider / accent — decoration only */
  --terra-dk:  #97462f; /* darker terracotta for text (>=4.5:1 WCAG AA) */
  --ink:       #2B2B28; /* warm near-black body */
  --ink-soft:  #4a4a45;
  --line:      #e3e0d7;
  --card:      #ffffff;
  --max:       1080px;
  --radius:    14px;
  --shadow-sm: 0 2px 8px rgba(43,43,40,.06);
  --shadow-md: 0 8px 28px rgba(43,43,40,.10);
  --shadow-lg: 0 18px 48px rgba(42,86,99,.16);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 19px;            /* large by default — over-50 legibility */
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--petrol); }

h1, h2, h3, .display {
  font-family: "Bitter", Georgia, "Times New Roman", serif;
  font-weight: 800;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5.2vw, 3.15rem); }
h2 { font-size: clamp(1.65rem, 4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
p  { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 22px; }
.section { padding: clamp(48px, 8vw, 88px) 0; }
.center { text-align: center; }
.num { color: var(--petrol); font-weight: 700; } /* Na/K/P — always petrol */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: "Source Sans 3", sans-serif;
  font-weight: 700; font-size: 1.05rem;
  text-decoration: none; cursor: pointer;
  padding: 16px 30px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  line-height: 1.1;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--petrol); color: #fff; box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--petrol-dk); box-shadow: var(--shadow-lg); }
.btn-secondary {
  background: transparent; color: var(--petrol); border-color: var(--petrol);
}
.btn-secondary:hover { background: rgba(42,86,99,.06); }
.btn-terra { background: var(--terra-dk); color: #fff; box-shadow: var(--shadow-md); }
.btn-terra:hover { background: #8f4a35; }
.btn .ic { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-lg { font-size: 1.15rem; padding: 18px 34px; }
.btn-block { display: flex; width: 100%; justify-content: center; }

.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sage-dk);
  margin-bottom: 14px;
}

/* ---------- HERO ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 78% -8%, rgba(124,152,133,.16), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: clamp(34px, 6vw, 60px);
  padding-bottom: clamp(40px, 7vw, 72px);
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(28px, 5vw, 56px); align-items: center;
}
.hero h1 { margin-bottom: .35em; }
.hero .lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 34ch; }
.hero-promise {
  border-left: 4px solid var(--terra);
  padding: 4px 0 4px 18px; margin: 22px 0 26px;
  font-size: 1.12rem; color: var(--ink);
}
.hero-visual { position: relative; }
.hero-visual .mock { border-radius: 8px; width: 100%; aspect-ratio: 734 / 894; }
.book-badge {
  position: absolute; left: -6px; bottom: -10px;
  width: 34%; box-shadow: var(--shadow-md); border-radius: 6px;
  border: 3px solid #fff; transform: rotate(-4deg);
}

/* download cluster (ungated) */
.dl-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.hero .dl-row { min-height: 60px; align-items: center; } /* reserve button box to prevent font-swap CLS */
.dl-note {
  margin-top: 14px; font-size: .95rem; color: var(--sage-dk);
  display: flex; align-items: center; gap: 8px;
}
.dl-note .ic { width: 18px; height: 18px; color: var(--sage-dk); }
/* hero inline optional email touchpoint (A) — invite, never a gate */
.hero-optin {
  margin-top: 10px; font-size: .95rem; color: var(--ink-soft);
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.hero-optin a { color: var(--sage-dk); font-weight: 700; }

/* ---------- Trust bar ---------- */
.trustbar { background: var(--petrol); color: #fff; }
.trustbar .wrap { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 40px; padding-top: 20px; padding-bottom: 20px; }
.trustbar .ti { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; }
.trustbar .ti .ic { width: 22px; height: 22px; color: #cfe0d6; flex: 0 0 auto; }

/* ---------- Bonus breakdown ---------- */
.bonus-card {
  display: grid; grid-template-columns: 300px 1fr; gap: clamp(20px, 4vw, 44px);
  align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: clamp(22px, 3vw, 34px); margin-bottom: 26px;
}
.bonus-card.flip { grid-template-columns: 1fr 300px; }
.bonus-card.flip .bc-media { order: 2; }
.bonus-tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
  background: rgba(124,152,133,.16); color: var(--sage-dk); margin-bottom: 12px;
}
.bonus-tag.secondary { background: rgba(200,116,90,.16); color: var(--terra-dk); }
.bc-media img { border-radius: 8px; }
.bc-meta { font-size: .95rem; color: var(--ink-soft); margin-top: 4px; }
.bc-meta .dot { color: var(--sage); padding: 0 8px; }

/* ---------- Author trust ---------- */
.author { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.author-grid {
  display: grid; grid-template-columns: 300px 1fr; gap: clamp(26px, 5vw, 52px);
  align-items: center;
}
.author-photo {
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  border: 6px solid #fff; outline: 1px solid var(--line);
}
.author h2 { margin-bottom: .3em; }
.author .role { color: var(--terra-dk); font-weight: 700; margin-bottom: 1em; }

/* ---------- Optional opt-in ---------- */
.optin {
  background:
    radial-gradient(900px 400px at 20% 120%, rgba(200,116,90,.12), transparent 60%),
    linear-gradient(180deg, #f4f1e8, var(--bg));
  border-top: 1px solid var(--line);
}
.optin-box {
  max-width: 640px; margin: 0 auto; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: clamp(28px, 4vw, 44px);
}
.optin .sub { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 22px; }
.optin-form { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.optin-form input[type=email] {
  flex: 1 1 260px; min-width: 0;
  font: inherit; font-size: 1.05rem;
  padding: 15px 18px; border: 2px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink);
}
.optin-form input[type=email]:focus {
  outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(124,152,133,.25);
}
.optin .fineprint { font-size: .85rem; color: var(--ink-soft); margin-top: 16px; }
.optin-msg { margin-top: 16px; font-weight: 600; min-height: 1.2em; }
.optin-msg.ok { color: var(--sage-dk); }
.optin-msg.err { color: var(--terra-dk); }
.optin-badge {
  display:inline-block; font-size:.78rem; font-weight:700; letter-spacing:.1em;
  text-transform:uppercase; color: #fff; background: var(--sage-dk);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
}
/* C leggero — a touch more prominence for the (still position-5) opt-in box */
.optin-box.optin-accent { border-top: 4px solid var(--sage); }
.optin-box.optin-accent h2 { color: var(--petrol); }

/* ---------- Get the book ---------- */
.getbook { background: var(--bg); }
.getbook-grid {
  display: grid; grid-template-columns: 240px 1fr; gap: clamp(24px, 5vw, 48px);
  align-items: center;
}
.getbook img.cov { border-radius: 6px; box-shadow: var(--shadow-lg); }
.store-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Final CTA ---------- */
.finalcta { background: var(--petrol); color: #fff; text-align: center; }
.finalcta h2 { color: #fff; }
.finalcta p { color: #d9e6de; max-width: 46ch; margin-left:auto; margin-right:auto; }
.finalcta .btn-primary { background: #fff; color: var(--petrol); }
.finalcta .btn-primary:hover { background: #eef4f0; }

/* ---------- Footer ---------- */
footer { background: #23423c; color: #d7ddd6; font-size: .92rem; }
footer .wrap { padding-top: 44px; padding-bottom: 40px; }
footer .foot-h { font-family:"Bitter",serif; color:#fff; font-size:1rem; margin:0 0 10px; }
.disclaimer {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 18px 20px; margin-bottom: 26px;
  font-size: .86rem; line-height: 1.55; color: #cdd4cc;
}
.disclaimer strong { color: #fff; }
.foot-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
footer a { color: #bcd3c8; }
.foot-legal {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between;
  font-size: .82rem; color: #9fb0a6;
}
.foot-legal a { color: #9fb0a6; }

/* ---------- Exit-intent popup ---------- */
.pop-overlay {
  position: fixed; inset: 0; background: rgba(35,66,60,.55);
  display: none; align-items: center; justify-content: center; z-index: 999;
  padding: 20px; backdrop-filter: blur(2px);
}
.pop-overlay.show { display: flex; }
.pop {
  background: var(--card); border-radius: var(--radius); max-width: 460px; width: 100%;
  padding: 34px 30px 30px; box-shadow: var(--shadow-lg); position: relative; text-align: center;
}
.pop h3 { font-size: 1.5rem; }
.pop p { color: var(--ink-soft); }
.pop .btn { margin-top: 6px; }
/* exit-popup secondary goal (D) — email invite under the primary download */
.pop-optin { margin-top: 14px; font-size: .9rem; color: var(--ink-soft); }
.pop-optin a { color: var(--sage-dk); font-weight: 700; }
.pop-close {
  position: absolute; top: 12px; right: 14px; background: none; border: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-soft);
}

/* ---------- Skip link / a11y ---------- */
.skip { position:absolute; left:-999px; top:0; background:#fff; padding:10px 16px; z-index:1000; border-radius:0 0 8px 0; }
.skip:focus { left:0; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 18px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; margin: 8px auto 0; }
  .hero .lede, .hero-promise { max-width: none; }
  .bonus-card, .bonus-card.flip { grid-template-columns: 1fr; text-align: left; }
  .bonus-card.flip .bc-media { order: 0; }
  .bc-media { max-width: 320px; margin: 0 auto 6px; }
  .author-grid { grid-template-columns: 1fr; text-align: center; }
  .author-photo { max-width: 280px; margin: 0 auto; }
  .getbook-grid { grid-template-columns: 1fr; text-align: center; }
  .getbook img.cov { max-width: 220px; margin: 0 auto; }
  .store-row, .dl-row { justify-content: center; }
  .foot-cols { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 400px) {
  .wrap { padding: 0 16px; }
  .btn { padding: 15px 22px; font-size: 1rem; width: 100%; justify-content: center; }
  .dl-row .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
