/* ==========================================================================
   Think Smarter — series site
   Palette sampled from the printed covers: deep navy ground, cyan accent,
   warm yellow highlight, cream paper.
   ========================================================================== */

:root {
  --navy-900: #061a33;
  --navy-800: #0a2340;
  --navy-700: #12365c;
  --navy-600: #1c4d7c;
  --cyan-500: #1b9fc4;
  --cyan-400: #35bcdd;
  --cyan-100: #dcf1f7;
  --yellow-500: #f5c518;
  --yellow-400: #ffd84d;
  --yellow-100: #fdf3d2;
  --coral-500: #e2613f;

  --paper: #fdfaf3;
  --paper-2: #f5f0e4;
  --ink: #14202e;
  --ink-soft: #46586c;
  --line: #ded6c4;

  --bg: var(--paper);
  --bg-alt: var(--paper-2);
  --surface: #ffffff;
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --border: var(--line);
  --accent: var(--cyan-500);
  --accent-ink: #0c5e78;
  --brand: var(--navy-800);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(6, 26, 51, .07), 0 2px 8px rgba(6, 26, 51, .05);
  --shadow-md: 0 4px 12px rgba(6, 26, 51, .09), 0 12px 32px rgba(6, 26, 51, .08);
  --shadow-book: 0 2px 4px rgba(6, 26, 51, .16), 0 18px 40px rgba(6, 26, 51, .26);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 34rem;
  --gutter: 20px;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1622;
    --bg-alt: #101f30;
    --surface: #142434;
    --text: #e8eef5;
    --text-soft: #a3b4c6;
    --border: #25384c;
    --accent: var(--cyan-400);
    --accent-ink: #9fdcef;
    --brand: #0a1725;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1622;
  --bg-alt: #101f30;
  --surface: #142434;
  --text: #e8eef5;
  --text-soft: #a3b4c6;
  --border: #25384c;
  --accent: var(--cyan-400);
  --accent-ink: #9fdcef;
  --brand: #0a1725;
}

/* --------------------------------------------------------------- reset -- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: .18em; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; letter-spacing: -.012em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.9vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.4rem); }
h3 { font-size: clamp(1.18rem, 1.05rem + .55vw, 1.45rem); }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 700; letter-spacing: .005em; }
p { margin: 0 0 1em; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid var(--cyan-400);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--yellow-400); color: #14202e; padding: .7rem 1.1rem;
  font-weight: 700; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------- layout -- */

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 46rem; }
.wrap--mid { max-width: 62rem; }

.section { padding-block: clamp(3rem, 2rem + 4.5vw, 5.5rem); }
.section--tight { padding-block: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); }
.section--alt { background: var(--bg-alt); }
.section--navy {
  background:
    radial-gradient(1100px 460px at 12% -10%, rgba(53,188,221,.20), transparent 62%),
    radial-gradient(900px 420px at 92% 0%, rgba(245,197,24,.13), transparent 58%),
    var(--navy-900);
  color: #eaf2f8;
}
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }
.section--navy a:not(.btn) { color: var(--yellow-400); }
.section--navy .lede, .section--navy .muted { color: #b9cde0; }

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }

.grid { display: grid; gap: clamp(1.1rem, .8rem + 1.2vw, 1.9rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); }

.eyebrow {
  display: inline-block;
  font-family: var(--sans); font-size: .76rem; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: .85rem;
}
.section--navy .eyebrow { color: var(--yellow-400); }

.lede { font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); color: var(--text-soft); max-width: var(--measure); }
.muted { color: var(--text-soft); }
.small { font-size: .9rem; }
.center { text-align: center; }
.center .lede, .center .measure { margin-inline: auto; }
.measure { max-width: var(--measure); }

/* ------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-weight: 700; font-size: 1rem; line-height: 1.2;
  padding: .85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--yellow-500); color: #16233a; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--yellow-400); color: #16233a; box-shadow: var(--shadow-md); }
.btn--accent { background: var(--cyan-500); color: #fff; box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: var(--cyan-400); color: #06212c; box-shadow: var(--shadow-md); }
.btn--ghost { border-color: currentColor; color: var(--text); background: transparent; }
.btn--ghost:hover { background: var(--surface); color: var(--text); }
.section--navy .btn--ghost { color: #eaf2f8; }
.section--navy .btn--ghost:hover { background: rgba(255,255,255,.10); color: #fff; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.center .btn-row { justify-content: center; }

/* ---------------------------------------------------------------- nav --- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }

.brand { display: inline-flex; align-items: baseline; gap: .45rem; text-decoration: none; margin-right: auto; }
.brand__mark {
  font-family: var(--serif); font-weight: 700; font-size: 1.22rem;
  color: var(--text); letter-spacing: -.015em;
}
.brand__mark em { font-style: normal; color: var(--accent); }
.brand__tag { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); font-weight: 700; }

.nav-toggle {
  display: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 10px; padding: .5rem .7rem; font: inherit;
  font-size: .9rem; font-weight: 700; cursor: pointer;
}

.nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--text); font-weight: 600; font-size: .95rem;
  padding: .45rem .7rem; border-radius: 9px;
}
.nav a:hover { background: var(--bg-alt); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--bg-alt); }
.nav .btn { margin-left: .35rem; padding: .6rem 1.1rem; font-size: .92rem; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: .75rem var(--gutter) 1.1rem; box-shadow: var(--shadow-md);
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .7rem .6rem; }
  .nav .btn { margin: .4rem 0 0; justify-content: center; }
}

/* ---------------------------------------------------------------- hero -- */

.hero { position: relative; overflow: hidden; }
.hero__grid {
  display: grid; gap: clamp(1.8rem, 1rem + 4vw, 3.4rem); align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.05fr .95fr; } }
.hero h1 { max-width: 19ch; }
.hero .lede { max-width: 38ch; }

.hero__covers {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(.6rem, .3rem + 1.4vw, 1.3rem); align-items: end;
}
.hero__covers .cover-img { box-shadow: var(--shadow-book); }

/* --------------------------------------------------------------- cards -- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(1.2rem, 1rem + .8vw, 1.9rem);
  box-shadow: var(--shadow-sm);
}
.card--link { text-decoration: none; color: inherit; display: block; transition: transform .14s ease, box-shadow .14s ease; }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: inherit; }
.card h3 { margin-bottom: .4rem; }
.card__meta { font-size: .82rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-soft); }

.card__cta { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: var(--accent-ink); margin-top: .9rem; }
.card--link:hover .card__cta { color: var(--accent); }
.card__cta::after { content: "\2192"; transition: transform .14s ease; }
.card--link:hover .card__cta::after { transform: translateX(3px); }

/* ---------------------------------------------------------------- book -- */

.cover-img {
  border-radius: 4px 9px 9px 4px;
  box-shadow: var(--shadow-book);
  background: var(--navy-800);
  aspect-ratio: 7 / 10;
  object-fit: cover;
  width: 100%;
}

.book-hero { display: grid; gap: clamp(1.6rem, 1rem + 3vw, 3rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .book-hero { grid-template-columns: minmax(0, 20rem) 1fr; } }

.book-row { display: grid; gap: clamp(1.4rem, 1rem + 2.5vw, 2.8rem); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 820px) {
  .book-row { grid-template-columns: minmax(0, 15rem) 1fr; }
  .book-row--flip { grid-template-columns: 1fr minmax(0, 15rem); }
  .book-row--flip .book-row__media { order: 2; }
}

.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: .35rem .7rem; border-radius: 999px; border: 1px solid transparent;
}
.badge--live { background: var(--cyan-100); color: #0b5a72; border-color: #a9dcea; }
.badge--soon { background: var(--yellow-100); color: #7a5a00; border-color: #eccf72; }
.badge--age  { background: var(--bg-alt); color: var(--text-soft); border-color: var(--border); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge--live { background: rgba(53,188,221,.16); color: #9fdcef; border-color: rgba(53,188,221,.35); }
  :root:not([data-theme="light"]) .badge--soon { background: rgba(245,197,24,.14); color: #f3d474; border-color: rgba(245,197,24,.32); }
}
.badge-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }

/* --------------------------------------------------------------- lists -- */

.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 1.85rem; margin-bottom: .6rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .52em;
  width: 1.05rem; height: .55rem;
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg); border-radius: 1px;
}
.section--navy .ticks li::before { border-color: var(--yellow-400); }

.chapter-list { columns: 2; column-gap: 2.5rem; padding-left: 1.2rem; margin: 0; }
.chapter-list li { break-inside: avoid; margin-bottom: .4rem; }
@media (max-width: 640px) { .chapter-list { columns: 1; } }

.part-head {
  font-family: var(--sans); font-size: .78rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink);
  margin: 1.6rem 0 .6rem;
}
.part-head:first-child { margin-top: 0; }

.beats { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.beats li { display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: baseline; }
.beats b {
  font-family: var(--sans); font-size: .76rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent-ink); white-space: nowrap;
}

.method { display: grid; gap: .9rem; }
.method__item { display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; align-items: start; }
.method__letter {
  font-family: var(--serif); font-size: 2.1rem; line-height: 1; font-weight: 700;
  color: var(--yellow-500); text-align: center;
}
.section--navy .method__letter { color: var(--yellow-400); }

/* -------------------------------------------------------------- inside -- */

.spreads { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.spreads figure { margin: 0; }
.spreads img { border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); }
.spreads figcaption { font-size: .85rem; color: var(--text-soft); margin-top: .5rem; }

/* ---------------------------------------------------------------- form -- */

.optin {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(1.3rem, 1rem + 1.2vw, 2.1rem);
  box-shadow: var(--shadow-sm);
}
.section--navy .optin { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.18); color: #eaf2f8; }
.section--navy .optin label { color: #d6e5f1; }

.field { display: grid; gap: .35rem; margin-bottom: .9rem; text-align: left; }
.field label { font-size: .85rem; font-weight: 700; }
.field input, .field select {
  font: inherit; font-size: 1rem; padding: .75rem .9rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); width: 100%;
}
.field input::placeholder { color: var(--text-soft); opacity: .8; }
.field--hp { position: absolute; left: -9999px; }

.form-note { font-size: .84rem; color: var(--text-soft); margin-top: .8rem; }
.section--navy .form-note { color: #a9c1d6; }

.form-status { margin-top: .9rem; font-weight: 600; font-size: .95rem; }
.form-status[data-state="error"] { color: var(--coral-500); }
.form-status:empty { display: none; }

/* Sign-up form vs. plain download. The class is set in <head> from config.js,
   so only the right one ever paints. With JS off neither class is present and
   the form shows, falling back to a GET that still delivers the download. */
.optin__direct { display: none; }
.capture-off .optin__form { display: none; }
.capture-off .optin__direct { display: block; }
.capture-on .optin__direct { display: none; }

.only-capture-off { display: none; }
.capture-off .only-capture-on { display: none; }
.capture-off .only-capture-off { display: inline; }
.capture-on .only-capture-off { display: none; }

/* ------------------------------------------------------------ magnets --- */

.magnet-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); }
.magnet-grid--3 { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }

.magnet-card { display: flex; flex-direction: column; }
.magnet-card .card__cta { margin-top: auto; padding-top: .9rem; }
.magnet-card__kind {
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: .6rem; display: block;
}

/* ----------------------------------------------------------------- faq -- */

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; padding: 1.05rem 2rem 1.05rem 0; position: relative;
  font-weight: 700; font-size: 1.04rem; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--accent); line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding-bottom: 1.1rem; max-width: var(--measure); color: var(--text-soft); }

/* -------------------------------------------------------------- footer -- */

.site-footer { background: var(--navy-900); color: #b9cde0; padding-block: 3rem 2rem; }
.site-footer a { color: #eaf2f8; text-decoration: none; }
.site-footer a:hover { color: var(--yellow-400); text-decoration: underline; }
.site-footer .footer-head {
  color: #fff; font-family: var(--sans); font-size: .78rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .8rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.footer-bottom {
  margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; justify-content: space-between;
  font-size: .85rem;
}

/* --------------------------------------------------------------- misc --- */

.callout h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.callout {
  border-left: 4px solid var(--yellow-500);
  background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.3rem;
}
.callout--safety { border-left-color: var(--coral-500); }

.pull {
  font-family: var(--serif); font-size: clamp(1.35rem, 1.1rem + 1.4vw, 2rem);
  line-height: 1.3; letter-spacing: -.01em; max-width: 26ch;
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; align-items: start; }
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--cyan-500); color: #fff; font-weight: 800; font-size: 1rem;
}

.crumbs { font-size: .88rem; color: var(--text-soft); margin-bottom: 1.2rem; }
.crumbs a { color: var(--text-soft); }
.crumbs a:hover { color: var(--accent); }

hr.rule { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
