/* The Futures Doctor — storefront styles.
   Design system: the books' own. Source Serif 4 for display, Source Sans 3
   for text, JetBrains Mono only where numbers are data (prices) — the same
   three faces the books are set in, self-hosted from the pack (OFL).
   Deep navy ground from the covers, one violet accent, success green
   reserved for savings figures. Tokens run primitive -> semantic. */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;

  /* primitives */
  --navy-950: #070b1d;
  --navy-900: #0a0f24;
  --navy-850: #0d1430;
  --navy-800: #131b3d;
  --ink-100: #eef1fa;
  --ink-200: #bcc5df;
  --ink-300: #98a3c4;
  --violet-300: #c4b0fc;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #6d4bd8;
  --violet-700: #7d5bea;
  --green-400: #4ade80;
  --line: rgba(152, 163, 196, 0.16);
  --line-strong: rgba(152, 163, 196, 0.34);

  /* semantic */
  --bg: var(--navy-950);
  --bg-alt: var(--navy-900);
  --surface: var(--navy-850);
  --surface-input: var(--navy-900);
  --text: var(--ink-100);
  --text-2: var(--ink-200);
  --text-3: var(--ink-300);
  --accent: var(--violet-400);
  --accent-deep: var(--violet-600);
  --accent-deep-hover: var(--violet-700);
  --save: var(--green-400);
  --ring: var(--violet-400);

  /* type + space */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --radius: 16px;
  --max: 1120px;
  --header-h: 65px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--navy-800) var(--navy-950);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 17px;
  caret-color: var(--accent);
}

::selection { background: var(--violet-600); color: #fff; }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--navy-950); }
::-webkit-scrollbar-thumb { background: var(--navy-800); border-radius: 6px; border: 2px solid var(--navy-950); }

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--violet-300); }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; text-wrap: balance; }
p { margin: 0 0 16px; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent-deep); color: #fff; padding: 10px 16px; z-index: 30;
  border-radius: 0 0 8px 0; text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; top: 0; color: #fff; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 29, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap;
}
.site-nav { min-width: 0; }
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 1.3rem;
  color: var(--text); text-decoration: none; white-space: nowrap;
  padding: 6px 0;
}
.wordmark:hover { color: var(--text); }
.wordmark span { color: var(--accent); font-style: italic; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px 20px; flex-wrap: wrap;
}
.site-nav a {
  color: var(--text-2); text-decoration: none; font-size: 0.98rem;
  display: inline-block; padding: 10px 2px;
}
.site-nav a:hover { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  font-size: 1rem; line-height: 1.35; cursor: pointer; font-family: var(--sans);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn-primary { background: var(--accent-deep); color: #fff; }
.btn-primary:hover { background: var(--accent-deep-hover); color: #fff; }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- hero ---------- */
.hero { padding: 76px 0 64px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
}
.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.3rem); line-height: 1.04; margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.hero .promise {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem); color: var(--accent); margin: 0 0 22px;
}
.hero .lede { color: var(--text-2); margin: 0 0 30px; max-width: 36rem; font-size: 1.08rem; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-art {
  margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  align-items: start;
}
.hero-art img {
  width: 100%; border-radius: 5px;
  box-shadow: 0 30px 55px -18px rgba(1, 3, 10, 0.75), 0 10px 22px -10px rgba(1, 3, 10, 0.6);
}
.hero-art .book-a { transform: rotate(-1.6deg); margin-top: 26px; animation: settle 820ms cubic-bezier(0.22, 1, 0.36, 1); }
.hero-art .book-b { transform: rotate(1.3deg); animation: settle 820ms cubic-bezier(0.22, 1, 0.36, 1) 130ms; }
.hero-art figcaption {
  grid-column: 1 / -1; text-align: center;
  font-family: var(--serif); font-style: italic; color: var(--text-2);
  font-size: 1.02rem; margin-top: 6px;
}
@keyframes settle {
  from { translate: 0 16px; }
  to { translate: 0 0; }
}

/* ---------- sections ---------- */
section { padding: 64px 0; }
section, #about, #updates { scroll-margin-top: calc(var(--header-h) + 14px); }
section:nth-of-type(even) { background: var(--bg-alt); }
.section-head { max-width: 46rem; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); margin: 0 0 12px; line-height: 1.15; }
.section-head p { color: var(--text-2); margin: 0 0 10px; }
.section-head p:last-child { margin-bottom: 0; }
.group-h {
  font-size: 1.35rem; margin: 38px 0 4px; line-height: 1.25;
}
.group-h:first-of-type { margin-top: 0; }
.facts { color: var(--text-3); font-size: 0.94rem; }
.positioning {
  font-family: var(--serif); font-style: italic;
  font-size: 1.25rem; color: var(--text); margin-top: 16px;
}

/* ---------- books ---------- */
.book-spread {
  display: grid; grid-template-columns: 300px 1fr; gap: 44px;
  padding: 44px 0; border-top: 1px solid var(--line); align-items: start;
}
.book-spread:first-of-type { border-top: none; padding-top: 8px; }
.book-spread .cover {
  width: 100%; border-radius: 5px;
  box-shadow: 0 26px 48px -16px rgba(1, 3, 10, 0.72), 0 8px 20px -8px rgba(1, 3, 10, 0.55);
}
.book-spread.flip .cover { order: 2; }
.book-body h3 { font-size: 1.85rem; line-height: 1.2; margin: 4px 0 6px; }
.book-body .subtitle {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--accent); font-size: 1.18rem; line-height: 1.35; margin: 0 0 18px;
}
.book-body .tagline { font-size: 1.08rem; margin: 0 0 14px; max-width: 62ch; }
.book-body .desc { color: var(--text-2); margin: 0 0 14px; max-width: 68ch; }
.book-body .facts { margin: 0 0 24px; }
.price-row {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.price {
  font-family: var(--mono); font-size: 1.55rem; font-weight: 400;
  font-variant-numeric: tabular-nums; margin: 0; line-height: 1.2;
}
.price small {
  display: block; font-family: var(--sans); font-size: 0.85rem;
  color: var(--text-3); margin-top: 3px;
}
.price .was { text-decoration: line-through; color: var(--text-3); }
.price .save { color: var(--save); font-weight: 600; }

/* ---------- tools ledger ---------- */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger .row {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 24px;
  align-items: center; padding: 24px 0; border-top: 1px solid var(--line);
}
.ledger .row:last-child { border-bottom: 1px solid var(--line); }
.ledger .row:not(:has(.thumb)) { grid-template-columns: 1fr auto; }
.ledger .thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }
.row-main h4 { font-size: 1.14rem; font-weight: 600; margin: 0 0 5px; line-height: 1.3; }
.row-main .tagline { color: var(--text-2); font-size: 0.99rem; margin: 0 0 6px; max-width: 62ch; }
.row-main .facts { margin: 0; }
.row-buy { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.row-buy .price { font-size: 1.3rem; }

/* ---------- bundles ---------- */
.bundle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: stretch; }
.bundle-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column;
  position: relative;
}
.bundle-panel.featured { border-color: var(--violet-500); }
.bundle-panel .pill {
  position: absolute; top: -13px; right: 24px;
  background: var(--navy-950); color: var(--accent);
  border: 1px solid var(--violet-500); border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; padding: 3px 12px;
}
.bundle-panel img.thumb { width: 168px; border-radius: 8px; margin-bottom: 22px; }
.bundle-panel h3 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 10px; }
.bundle-panel .tagline { color: var(--text-2); margin: 0 0 14px; }
.bundle-panel ul { color: var(--text-2); margin: 0 0 24px; padding-left: 20px; }
.bundle-panel ul li { margin-bottom: 6px; }
.bundle-panel .price-row { margin-top: auto; }

/* ---------- two-col / forms ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.two-col p { color: var(--text-2); }
.two-col p strong, .two-col li strong { color: var(--text); }
.plain-list { color: var(--text-2); margin: 0 0 16px; padding-left: 20px; }
.plain-list li { margin-bottom: 8px; }
.col-h { font-size: 1.3rem; margin: 0 0 12px; }

.signup {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px; align-self: start;
}
.signup h2 { font-size: 1.6rem; margin: 0 0 10px; line-height: 1.2; }
.signup form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.signup label { font-weight: 600; font-size: 0.95rem; }
.signup input[type="email"] {
  width: 100%; padding: 13px 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface-input);
  color: var(--text); font-size: 1rem; font-family: var(--sans);
  caret-color: var(--accent);
}
.signup input[type="email"]::placeholder { color: var(--text-3); }
.signup input[type="email"]:focus-visible { outline-offset: 0; }
.signup .btn { align-self: flex-start; }
.fineprint { font-size: 0.87rem; color: var(--text-3); margin-top: 14px; }

.about p { max-width: 68ch; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 44px 0 52px;
  background: var(--navy-900);
}
.site-footer .disclosure { color: var(--text-3); font-size: 0.9rem; max-width: 64rem; }
.site-footer .disclosure p { margin: 0 0 12px; }
.site-footer .disclosure strong { color: var(--text-2); }
.footer-meta {
  display: flex; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap;
  color: var(--text-3); font-size: 0.9rem; margin-top: 26px;
}
.footer-meta a { color: var(--text-2); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 52px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { max-width: 430px; }
  .book-spread { grid-template-columns: 220px 1fr; gap: 30px; padding: 36px 0; }
  .bundle-grid, .two-col { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
}
@media (max-width: 620px) {
  :root { --header-h: 118px; }
  .book-spread { grid-template-columns: 1fr; }
  .book-spread .cover { width: 190px; }
  .book-spread.flip .cover { order: 0; }
  .ledger .row { grid-template-columns: 64px 1fr; gap: 16px; padding: 20px 0; }
  .ledger .row:not(:has(.thumb)) { grid-template-columns: 1fr; }
  .ledger .thumb { width: 64px; height: 64px; }
  .row-buy {
    grid-column: 1 / -1; flex-direction: row; align-items: center;
    justify-content: space-between; text-align: left;
  }
  .signup { padding: 24px; }
  .signup .btn { align-self: stretch; text-align: center; }
  .site-nav ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .site-nav ul::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art .book-a, .hero-art .book-b { animation: none; }
  .btn { transition: none; }
}
