/* ==========================================================================
   The Mythical Token-Month — landing page
   Design: editorial / book-jacket, not SaaS. Ink navy + khaki + rust,
   pulled from the actual cover art. Serif display, sans body, mono for
   terminology (mirrors the book's own font stack).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Palette — light (default) */
  --ink: #14192b;
  --ink-soft: #2b3350;
  --paper: #faf8f3;
  --paper-raised: #ffffff;
  --paper-sunk: #f1ede2;
  --khaki: #c6be76;
  --khaki-soft: #eee9cf;
  --rust: #a6551f;
  --rust-strong: #8a4517;
  --line: #e4ddc9;
  --text: #201d17;
  --text-soft: #58513f;
  --text-faint: #8a8267;

  /* Text on panels that are always dark (ink background) regardless of
     site theme — must NOT flip with --khaki-soft, which is themed. */
  --on-ink: #f6f2e6;
  --on-ink-soft: #d9d2b8;

  --shadow-sm: 0 1px 2px rgba(20, 25, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 25, 43, 0.10);
  --shadow-lg: 0 20px 48px rgba(20, 25, 43, 0.16);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1180px;
  --radius: 10px;
  --radius-lg: 16px;
}

/* Light is always the default, regardless of OS preference — dark mode
   is opt-in only, via the manual toggle (persisted in localStorage). */
:root[data-theme="dark"] {
  --ink: #0c0f1a;
  --paper: #14182a;
  --paper-raised: #1b2036;
  --paper-sunk: #10131f;
  --khaki-soft: #2a2a1e;
  --line: #2c3149;
  --text: #ece9de;
  --text-soft: #b9b4a2;
  --text-faint: #7c7867;
  --rust: #d38a4f;
  --rust-strong: #e8a568;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

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

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 .5em;
  color: var(--text);
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  margin-bottom: 1em;
}
.kicker::before {
  content: "";
  width: 1.6em;
  height: 1px;
  background: var(--rust);
  display: inline-block;
}

.eyebrow-line { display:flex; align-items:center; gap:.6em; }

.section {
  padding: clamp(56px, 8vw, 108px) 0;
}
.section-alt { background: var(--paper-sunk); }
.section-head {
  max-width: 680px;
  margin: 0 0 clamp(32px, 5vw, 56px);
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.section-head .lede { font-size: 1.08rem; color: var(--text-soft); }

/* -------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
  min-height: 46px;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--rust);
  color: #fff8ee;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--rust-strong); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--rust); color: var(--rust); }

.btn-dark {
  background: var(--ink);
  color: #fbf9f2;
}
.btn-dark:hover { background: var(--ink-soft); }

.btn-block { width: 100%; }
.btn-sm { padding: .6em 1.1em; font-size: .86rem; min-height: 38px; }

.btn-amazon {
  background: #232f3e;
  color: #fff;
}
.btn-amazon:hover { background: #37475a; }

.btn[aria-disabled="true"] {
  background: var(--paper-sunk);
  color: var(--text-faint);
  cursor: default;
  box-shadow: none;
}
.btn[aria-disabled="true"]:hover { background: var(--paper-sunk); }

/* --------------------------------- nav ----------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.brand .brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand .mark {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--ink);
  color: var(--khaki);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
}
:root[data-theme="dark"] .brand .mark { background: var(--khaki); color: var(--ink); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-soft);
}
.nav-links a:hover { color: var(--rust); }

.nav-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-soft);
  flex: 0 0 auto;
}
.theme-toggle:hover { color: var(--rust); border-color: var(--rust); }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* --------------------------------- hero ----------------------------------- */
.hero {
  padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px);
  background:
    radial-gradient(1100px 480px at 82% -10%, color-mix(in srgb, var(--khaki) 30%, transparent), transparent 60%),
    var(--paper);
}
.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  margin-bottom: .34em;
}
.hero-copy .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--text-soft);
  margin-bottom: 1.1em;
}
.hero-pitch {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 54ch;
}
.byline {
  display: flex;
  align-items: center;
  gap: .6em;
  font-size: 0.92rem;
  color: var(--text-faint);
  margin: 1.4em 0 1.8em;
  font-family: var(--font-mono);
}
.byline .dot { color: var(--rust); }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.6em;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 0.86rem;
  color: var(--text-faint);
}
.hero-trust span { display: inline-flex; align-items: center; gap: .5em; }
.hero-trust svg { width: 15px; height: 15px; color: var(--rust); flex: 0 0 auto; }

.hero-art { position: relative; display: flex; justify-content: center; padding: 0 20px; }
.book-stack {
  position: relative;
  width: min(100%, 360px);
}
.book-stack img {
  width: 100%;
  aspect-ratio: 900 / 1436;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  transform: rotate(2.5deg);
  border: 1px solid rgba(0,0,0,.06);
}
.book-stack .format-pill {
  position: absolute;
  bottom: -18px;
  left: -18px;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  transform: rotate(-3deg);
}

/* ------------------------------ credibility -------------------------------- */
.credibility {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  background: var(--paper-raised);
}
.credibility .container {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 40px;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-faint);
  text-align: center;
}
.credibility strong { color: var(--text-soft); font-weight: 600; }

/* -------------------------------- quotes ----------------------------------- */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.quote-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
}
.quote-card blockquote {
  margin: 0 0 .9em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.14rem;
  line-height: 1.45;
  color: var(--text);
}
.quote-card cite {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* -------------------------------- why grid ---------------------------------- */
.why-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.why-layout .lede { font-size: 1.12rem; }

.stance-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.stance-list li {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-soft);
}
.stance-list svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--rust); margin-top: 2px; }

/* -------------------------------- personas ---------------------------------- */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.persona-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
}
.persona-card .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--rust);
  font-weight: 600;
  margin-bottom: 0.8em;
  display: block;
}
.persona-card h3 { font-size: 1.12rem; margin-bottom: .5em; }
.persona-card p { font-size: 0.92rem; color: var(--text-soft); margin: 0; }

/* --------------------------------- toc --------------------------------- */
.toc-meta {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-faint);
  margin-bottom: 28px;
}
.toc-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.toc-item { background: var(--paper-raised); }
.toc-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 600;
  font-size: 1rem;
}
.toc-item summary::-webkit-details-marker { display: none; }
.toc-item summary .chno {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--rust);
  flex: 0 0 auto;
  width: 3.4em;
}
.toc-item summary .chtitle { flex: 1; }
.toc-item summary .chev {
  width: 18px; height: 18px;
  color: var(--text-faint);
  transition: transform .2s ease;
  flex: 0 0 auto;
}
.toc-item[open] summary .chev { transform: rotate(180deg); }
.toc-item .chbody {
  padding: 0 22px 22px 22px;
  margin-left: 3.4em;
  color: var(--text-soft);
  font-size: 0.96rem;
  max-width: 68ch;
}
.toc-item .chbody blockquote {
  margin: .8em 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--rust);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text);
}

/* -------------------------------- excerpt teaser ---------------------------------- */
.excerpt-panel {
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 52px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.excerpt-panel h2 { color: #fbf9f2; }
.excerpt-panel .lede { color: var(--on-ink-soft); }
.excerpt-body p {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--on-ink);
}
.excerpt-body p:first-of-type::first-letter {
  font-size: 3.4em;
  float: left;
  line-height: .9;
  padding: .05em .08em 0 0;
  font-family: var(--font-display);
  color: var(--rust);
}
.excerpt-fade {
  position: relative;
  max-height: 240px;
  overflow: hidden;
}
.excerpt-fade::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 90px;
  background: linear-gradient(to bottom, transparent, var(--ink));
}

/* --------------------------------- author --------------------------------- */
.author-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 44px;
  align-items: start;
}
.author-photo img {
  width: 100%;
  aspect-ratio: 400 / 394;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}
.author-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.4em; }

/* --------------------------------- buy ------------------------------------ */
.buy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.buy-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.buy-card.featured {
  border-color: var(--rust);
  box-shadow: var(--shadow-md);
}
.buy-card .ribbon {
  position: absolute;
  top: -12px; left: 24px;
  background: var(--rust);
  color: #fff8ee;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 999px;
}
.buy-card .ribbon.ribbon-muted {
  background: var(--paper-sunk);
  color: var(--text-faint);
  border: 1px solid var(--line);
}
.buy-card .format {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--rust);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  margin-bottom: .6em;
}
.buy-card h3 { font-size: 1.28rem; margin-bottom: .3em; }
.buy-card .price { font-family: var(--font-mono); font-size: 1rem; color: var(--text-faint); margin-bottom: 1em; }
.buy-card .price strong { font-size: 1.5rem; color: var(--text); font-family: var(--font-body); font-weight: 700; }
.buy-card ul { list-style: none; margin: 0 0 1.6em; padding: 0; display: grid; gap: 9px; flex: 1; }
.buy-card ul li { display: flex; gap: 10px; font-size: 0.92rem; color: var(--text-soft); }
.buy-card ul svg { width: 16px; height: 16px; color: var(--rust); flex: 0 0 auto; margin-top: 3px; }
.buy-note {
  margin-top: 28px;
  font-size: 0.86rem;
  color: var(--text-faint);
  text-align: center;
}

/* --------------------------------- faq ------------------------------------ */
.faq-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; max-width: 820px; }
.faq-item { background: var(--paper-raised); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 22px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { width: 18px; height: 18px; color: var(--text-faint); transition: transform .2s ease; flex: 0 0 auto; }
.faq-item[open] summary .chev { transform: rotate(45deg); }
.faq-item .a { padding: 0 22px 22px; color: var(--text-soft); max-width: 70ch; }

/* -------------------------------- footer cta -------------------------------- */
.footer-cta {
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
  padding: clamp(56px, 8vw, 96px) 0;
}
.footer-cta h2 { color: #fbf9f2; font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.footer-cta .lede { color: var(--on-ink-soft); max-width: 56ch; margin: 0 auto 2em; }
.footer-cta .hero-ctas { justify-content: center; }

/* --------------------------------- footer ---------------------------------- */
footer.site-footer {
  background: var(--paper-sunk);
  border-top: 1px solid var(--line);
  padding: 40px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint);
  margin-bottom: 1em;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: var(--text-soft); font-size: 0.92rem; }
.footer-links a:hover { color: var(--rust); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-faint);
}
.noai-badge {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-mono);
}

/* --------------------------------- excerpt page ----------------------------- */
.excerpt-page-body {
  max-width: 72ch;
  margin: 0 auto;
  font-size: 1.08rem;
  line-height: 1.75;
}
.excerpt-page-body h2 {
  font-size: 1.5rem;
  margin-top: 1.8em;
}
.excerpt-page-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--rust);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.16rem;
  color: var(--text-soft);
}
.excerpt-page-header {
  max-width: 72ch;
  margin: 0 auto clamp(28px, 5vw, 44px);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-faint);
  margin-bottom: 1.6em;
}
.back-link:hover { color: var(--rust); }
.excerpt-cta {
  max-width: 72ch;
  margin: 3em auto 0;
  padding: 30px;
  background: var(--paper-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

/* ----------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; }
  .book-stack { width: min(280px, 60vw); }
  .why-layout { grid-template-columns: 1fr; }
  .quote-grid { grid-template-columns: 1fr; }
  .persona-grid { grid-template-columns: 1fr 1fr; }
  .buy-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .excerpt-panel { grid-template-columns: 1fr; }
  .author-layout { grid-template-columns: 1fr; }
  .author-photo { width: 160px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-buy { display: none; }
  .nav-actions { gap: 8px; }
  .persona-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .toc-item .chbody { margin-left: 0; }
  body.nav-open .mobile-menu { display: flex; }
}

@media (max-width: 460px) {
  .brand-text { display: none; }
}

@media (max-width: 480px) {
  .hero-art { padding: 0 32px; }
  .book-stack { width: min(78vw, 300px); }
  .book-stack img { transform: rotate(1deg); }
  .book-stack .format-pill { left: 0; bottom: -14px; font-size: 0.72rem; padding: 8px 12px; }
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0 18px;
  border-top: 1px solid var(--line);
}
.mobile-menu a {
  padding: 12px 4px;
  font-weight: 500;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { margin-top: 12px; }

@media (min-width: 721px) {
  .mobile-menu { display: none !important; }
}
