/* ===== Theme — change these to restyle the whole site ===== */
:root {
  --bg: #f7f4ee;
  --bg-alt: #eeeae2;
  --ink: #1f1b16;
  --muted: #6b6257;
  --accent: #b0263a;       /* crimson from the cover title */
  --indigo: #3e4087;       /* indigo from the cover title */
  --accent-ink: #ffffff;
  --line: #ddd3c4;
  --cover-a: #14212b;
  --cover-b: #2c5a7a;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130f;
    --bg-alt: #1f1b16;
    --ink: #f1ebe1;
    --muted: #a99f92;
    --accent: #e8808c;
    --accent-ink: #16130f;
    --line: #3a332b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #16130f;
    --bg-alt: #1f1b16;
    --ink: #f1ebe1;
    --muted: #a99f92;
    --accent: #e8808c;
    --accent-ink: #16130f;
    --line: #3a332b;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.small { font-size: .9rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .8em;
}

/* Buttons */
.btn {
  display: inline-block; padding: .8em 1.5em; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent);
  font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s, background .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-ink); }
.btn-small { padding: .5em 1.1em; font-size: .85rem; }

/* Nav */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font: 600 1.15rem var(--serif); color: var(--ink); text-decoration: none; }
.links { display: flex; gap: 28px; align-items: center; }
.links a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .92rem; }
.links a:not(.btn):hover { color: var(--accent); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 6px 12px; font: 500 .9rem var(--sans); }

/* Hero */
.hero { padding: 88px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; }
.subtitle { font: italic 400 1.4rem/1.4 var(--serif); color: var(--muted); }
.lede { max-width: 34em; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-cover { display: flex; justify-content: center; }
.cover {
  width: min(340px, 100%); aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, var(--cover-a) 0%, var(--cover-b) 100%);
  color: #f6efe4; border-radius: 4px 10px 10px 4px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45), inset 6px 0 10px -6px rgba(0,0,0,.5);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 32px; transform: rotate(-2deg);
  transition: transform .4s;
}
.cover:hover { transform: rotate(0) scale(1.02); }
.cover-author { font: 600 .8rem var(--sans); letter-spacing: .25em; text-transform: uppercase; opacity: .85; }
.cover-rule { width: 40px; height: 1px; background: currentColor; margin: 20px 0; opacity: .6; }
.cover-title { font: 600 2rem/1.1 var(--serif); }
.cover-img { width: min(360px, 100%); height: auto; transform: rotate(-1.5deg); transition: transform .4s; border-radius: 4px 10px 10px 4px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.cover-sub { font: italic 1rem var(--serif); margin-top: 12px; opacity: .8; }

/* Sections */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section.alt { background: var(--bg-alt); }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.facts dt { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }

.excerpt { font: 400 1.15rem/1.85 var(--serif); }
.excerpt > p:first-child::first-letter {
  float: left; font-size: 3.6em; line-height: .8; padding: 6px 10px 0 0; color: var(--accent); font-weight: 600;
}

.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; margin-top: 48px; }
.quotes figure { margin: 0; padding: 32px; background: var(--bg-alt); border-radius: 12px; border: 1px solid var(--line); }
.quotes blockquote { margin: 0 0 20px; font: italic 1.15rem/1.55 var(--serif); }
.quotes figcaption { font-weight: 600; font-size: .92rem; }
.quotes figcaption span { font-weight: 400; color: var(--muted); }

.author-grid { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: center; }
.portrait {
  width: 280px; aspect-ratio: 4 / 5; border-radius: 12px; object-fit: cover;
  background: linear-gradient(160deg, var(--line), var(--bg));
  display: flex; align-items: center; justify-content: center;
  font: 600 3rem var(--serif); color: var(--muted);
}
.social a { text-decoration: none; }

.events { list-style: none; padding: 0; margin: 32px 0 0; }
.events li { display: grid; grid-template-columns: 90px 1fr auto; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.events time { font: 600 1.05rem var(--serif); color: var(--accent); }
.events strong { display: block; }
.events span { color: var(--muted); font-size: .92rem; }

.buy { background: var(--ink); color: var(--bg); border-top: none; }
.buy h2 { color: var(--bg); }
.buy .eyebrow { color: var(--accent); }
.retailers { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.buy .btn-ghost { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.buy .btn-ghost:hover { background: var(--bg); color: var(--ink); }

.signup { display: flex; gap: 10px; max-width: 460px; margin: 28px auto 20px; }
.signup input {
  flex: 1; min-width: 0; padding: .8em 1.2em; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 1rem var(--sans);
}
.signup input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.footer { padding: 32px 0; font-size: .85rem; color: var(--muted); text-align: center; }

/* Key numbers */
.stats-band { background: var(--ink); color: var(--bg); padding: 48px 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.stats strong { display: block; font: 600 2.4rem/1 var(--serif); color: var(--accent); margin-bottom: 8px; }
.stats span { font-size: .9rem; line-height: 1.45; opacity: .85; }

/* Foreword quote */
.feature-quote { margin: 0 0 24px; font: italic 400 clamp(1.4rem, 2.6vw, 1.85rem)/1.4 var(--serif); }
.feature-cite { color: var(--muted); font-size: .95rem; }
.feature-cite strong { color: var(--ink); }

/* Contents */
.toc { list-style: none; counter-reset: ch -1; padding: 0; margin: 24px 0; }
.toc li { counter-increment: ch; display: grid; grid-template-columns: 48px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); font: 400 1.1rem/1.4 var(--serif); }
.toc li::before { content: counter(ch, decimal-leading-zero); font: 600 .85rem/1.9 var(--sans); color: var(--accent); }
.toc li:first-child::before { content: "—"; }

.crisis { max-width: 640px; margin: 0 auto 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }

/* Mobile */
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
  }
  .links.open { display: flex; }
  .links a:not(.btn) { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .links .btn { margin-top: 16px; }
  .hero { padding: 48px 0 64px; }
  .hero-grid, .author-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-cover { order: -1; }
  .cover { width: 220px; }
  .cover-title { font-size: 1.6rem; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .quotes { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .stats strong { font-size: 1.9rem; }
  .portrait { width: 200px; }
  .section { padding: 64px 0; }
  .wrap { padding: 0 16px; }
  .events li { grid-template-columns: 70px 1fr; }
  .events li .btn { grid-column: 2; justify-self: start; }
  .signup { flex-direction: column; }
}

/* Dark bands: fixed colors so they read well in light and dark mode */
.stats-band, .buy { background: #26285a; color: #f4f1ea; }
.buy h2 { color: #f1ebe1; }
.stats strong, .buy .eyebrow { color: #f2a7af; }
.stats span { line-height: 1.45; display: block; }
.buy .btn { background: #f2a7af; border-color: #f2a7af; color: #26285a; }
.buy .btn-ghost { background: transparent; color: #f1ebe1; border-color: rgba(241,235,225,.4); }
.buy .btn-ghost:hover { background: #f4f1ea; color: #26285a; }

.cover-img:hover { transform: rotate(0) scale(1.02); }
h2 em { color: var(--indigo); }
@media (max-width: 860px) { .cover-img { width: 230px; } }

/* Reviews */
.lead-review { max-width: 820px; margin: 48px auto 0; text-align: center; }
.lead-review blockquote { margin: 0 0 20px; font: italic 400 clamp(1.3rem, 2.4vw, 1.7rem)/1.45 var(--serif); }
.lead-review figcaption, .quotes figcaption { font-weight: 600; font-size: .92rem; }
.lead-review figcaption span, .quotes figcaption span { font-weight: 400; color: var(--muted); }
.lead-review a, .quotes a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
.praise-sub { font: 600 .78rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 72px 0 0; }
.center { text-align: center; }

/* DDSI → SIM */
.idea h3 { font: 600 1.3rem/1.25 var(--serif); margin: 6px 0 10px; }
.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.steps li { position: relative; padding: 28px 24px 24px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 12px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: -16px; left: 24px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font: 600 .9rem/32px var(--sans); text-align: center; }
.steps p { font-size: .95rem; margin: 0; }
.step-tag { font: 600 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.equation { display: flex; align-items: stretch; justify-content: center; gap: 14px; margin: 48px auto 40px; flex-wrap: wrap; }
.eq-box { flex: 1 1 180px; max-width: 240px; padding: 18px 16px; border: 1.5px solid var(--line); border-radius: 12px; text-align: center; background: var(--bg); }
.eq-box strong { display: block; font: 600 1.1rem var(--serif); }
.eq-box span { font-size: .82rem; color: var(--muted); }
.eq-result { background: var(--indigo, #3e4087); border-color: transparent; color: #fff; }
.eq-result span { color: rgba(255,255,255,.8); }
.eq-op { align-self: center; font: 600 1.8rem var(--serif); color: var(--accent); }
.why { border-left: 3px solid var(--accent); padding-left: 18px; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .equation { flex-direction: column; align-items: center; }
  .eq-box { width: 100%; max-width: 320px; flex: none; }
}
.steps p.method { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.steps p.method strong { color: var(--ink); }
.digital-note { margin-top: 18px; font-size: .92rem; color: var(--muted); }

/* Media */
.media-card { margin-top: 32px; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-alt); }
.media-meta { font: 600 .78rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.media-card h3 { font: 600 1.6rem/1.2 var(--serif); margin: 0 0 8px; }
.media-card h3 a { color: var(--ink); text-decoration: none; }
.media-card h3 a:hover { color: var(--accent); }
.media-sub { font: italic 1.1rem/1.5 var(--serif); color: var(--muted); }
.media-points { padding-left: 1.2em; margin: 0 0 20px; }
.media-points li { margin-bottom: 6px; }
.media-points li::marker { color: var(--accent); }

/* More sellers (on dark buy band) */
.more-sellers { margin-top: 28px; font-size: .92rem; line-height: 1.9; opacity: .9; }
.more-sellers a { color: #f4f1ea; text-decoration-color: rgba(244,241,234,.4); text-underline-offset: 3px; white-space: nowrap; }
.more-sellers a:hover { color: #f2a7af; }
.email-line { margin-top: 14px; font-size: 1rem; } .email-line a { color: var(--ink); text-underline-offset: 3px; }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }

/* Polish: tidy equation captions; collapse nav earlier so 8 links never crowd */
.eq-box span { display: block; line-height: 1.45; margin-top: 4px; }
.eq-box { display: flex; flex-direction: column; justify-content: center; }
.links { gap: 22px; }
.links a:not(.btn) { white-space: nowrap; }
@media (max-width: 1180px) {
  .menu-btn { display: block; }
  .links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
  }
  .links.open { display: flex; }
  .links a:not(.btn) { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .links .btn { margin-top: 16px; }
}

/* Polish: centered quote rows so odd counts never leave an empty slot */
.nowrap { white-space: nowrap; }
.quotes { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.quotes figure { flex: 1 1 300px; max-width: 344px; min-width: 0; }
@media (max-width: 860px) { .quotes figure { max-width: none; } }
