/* Agentic AI System Design — site styles
   Same background as Book 1 (#343334); the hero animation is transparent. Box colors come from the book (aisd.sty),
   lifted for a dark background. */

:root {
  --complete-fill: #3f3c52; --tier-core: #8a8ab0;
  /* glows: one size, one opacity range, matched saturation */
  --glow-blue: #3F7FC4; --glow-green: #2FAE85; --glow-red: #D64F4F; --glow-yellow: #C9A230;
  --glow-w: 700px; --glow-h: 200px; --glow-min: .2; --glow-max: .5;
  --bg: #343334;          /* same as Book 1 */
  --surface: #3d3c3d;
  --surface-2: #454445;
  --line: #4b4a4b;
  --ink: #ecebe8;
  --ink-2: #b9b7b2;
  --ink-3: #a19f9b;
  --accent: #a588ff;          /* Book 2's purple, same as the Book 2 card on the Book 1 page */
  --accent-strong: #bfa9ff;
  --accent-ink: #17142e;
  --link: #ffe065; --link-hover: #fff0a6;      /* text links: the same yellow as the Book 1 page */

  --pause: #55aef0;
  --napkin: #45b4c9;
  --tradeoff: #e2724a;
  --notenough: #ff8a3d;
  --senior: #7bc25c;
  --flag: #ff6b6b;
  --lens: #e56aaa;
  --bonus: #f0cb1c;

  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;   /* same as Book 1 */
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 70ch;
  --radius-s: 4px;
  --radius-m: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); position: relative; overflow-x: hidden;
  font: 400 1.0625rem/1.65 var(--sans);
  font-feature-settings: "kern", "liga";
}
body.reading { font-size: 1.15rem; }   /* reading pages: a notch larger for long text */
img, video, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article p a:hover, .article li a:hover, .section p a:hover { color: var(--link-hover); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 3px; }
code { font-family: var(--mono); font-size: .9em; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 12px; }

/* ---------- top bar: the glass pill from Book 1 ---------- */
.topbar {
  position: fixed; top: 15px; left: 50%; transform: translateX(-50%); z-index: 1000;
  width: max-content; max-width: 95%; border-radius: 50px;
  background: rgba(30, 30, 30, .7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .4);
}
.topbar-inner { padding: .65rem 2rem; display: flex; align-items: center; gap: 2rem; }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; white-space: nowrap; }
.brand small { color: var(--ink-3); font-weight: 400; margin-left: 8px; }
.topnav { display: flex; gap: 22px; align-items: center; }
.topnav a { color: #e6e6e6; text-decoration: none; font-size: .9rem; white-space: nowrap; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); }
.topnav .btn { color: var(--accent-ink); border-radius: 50px; }
@media (max-width: 900px) {
  .topbar { top: 0; left: 0; transform: none; width: 100%; max-width: none; border-radius: 0; background: rgba(30, 30, 30, .95); }
  .topbar-inner { justify-content: space-between; padding: 8px 16px; }
  .topbar-inner { overflow-x: auto; gap: 1.2rem; justify-content: flex-start; }
}
.page-top { height: 84px; }   /* space under the fixed nav on pages without a full hero */

/* ---------- Book 1 background: glows + engineering grid ---------- */
.background-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.engineering-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 100%); mask-image: linear-gradient(to bottom, #000 20%, transparent 100%);
}
/* Glows are light sources, not decoration inside the content: four corner glows fixed to the screen
   (blue top left, green top right, red bottom right, yellow bottom left), so they never sit behind text.
   Reading pages get a much fainter version (body.reading below). */
.agent-glow { position: fixed; border-radius: 50%; width: var(--glow-w); height: var(--glow-h); filter: blur(110px); opacity: var(--glow-min); animation: pulse-glow 3s infinite alternate ease-in-out; z-index: -1; pointer-events: none; }
.glow-blue   { background: var(--glow-blue);   top: -150px;    left: -230px; }
.glow-green  { background: var(--glow-green);  top: -150px;    right: -230px; }
.glow-red    { background: var(--glow-red);    bottom: -150px; right: -230px; }
.glow-yellow { background: var(--glow-yellow); bottom: -150px; left: -230px; }
.reading { --glow-min: .1; --glow-max: .25; }
@keyframes pulse-glow { 0% { transform: scale(1) translate(0,0); opacity: var(--glow-min); } 100% { transform: scale(1.1) translate(20px,20px); opacity: var(--glow-max); } }
@media (prefers-reduced-motion: reduce) { .agent-glow { animation: none; } }
main, .reader, .footer { position: relative; z-index: 2; }

/* ---------- Book 1 hero: author, gradient title, proof pill, animation centered ---------- */
.landing-wrapper { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; z-index: 2; padding-top: 52px; }
.title-section { text-align: center; padding: 1rem 1rem .5rem; display: flex; flex-direction: column; align-items: center; }
.title-wrapper { width: 100%; max-width: 900px; display: flex; flex-direction: column; align-items: flex-start; }
.author-name { font-size: 2.5rem; color: #fff; font-weight: 900; margin-bottom: .5rem; line-height: 1.1; }
.book-title-main {
  font-size: 4rem; font-weight: 900; line-height: 1.1; margin: .2rem 0; text-align: left; white-space: nowrap; width: fit-content;
  background: linear-gradient(90deg, #cb8df1, #42d3ff, #59f7b8, #fff261, #ff7272); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.book-subtitle { width: 100%; text-align: center; font-size: 1.5rem; color: #e0e0e0; font-weight: 500; margin: 4px 0 0; }
.hero-social-proof {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin: 1rem auto 0; padding: .4rem 1rem;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 50px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); width: fit-content;
}
.proof-item { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.7); font-size: 1.2rem; font-weight: 500; text-decoration: none; }
.proof-item:hover { color: #fff; }
.proof-star { color: #FFE066; font-size: 1.3rem; }
.proof-divider { width: 1px; height: 18px; background: rgba(255,255,255,.2); }
.proof-logo { height: 25px; width: auto; opacity: .9; border-radius: 4px; }
.landing-anim { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; padding: 1rem 0; min-height: 0; }
.shapes-gif { max-height: 55vh; width: auto; height: auto; max-width: 90%; aspect-ratio: 1322 / 962; display: block; margin: 0 auto; }
.scroll-arrow { position: relative; width: 40px; height: 40px; margin: .5rem auto 1.5rem; display: block; }
.scroll-arrow::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 25px; height: 25px;
  border-left: 4px solid #d9d9d9; border-bottom: 4px solid #d9d9d9;
  transform: translate(-50%,-50%) rotate(-45deg); animation: bounce 2s infinite;
}
@keyframes bounce { 0%,100% { transform: translate(-50%,-50%) rotate(-45deg) translate(0,0); } 50% { transform: translate(-50%,-50%) rotate(-45deg) translate(-10px,10px); } }
@media (prefers-reduced-motion: reduce) { .scroll-arrow::before { animation: none; } }
@media (max-width: 960px) { .book-title-main { font-size: 3.2rem; } }
@media (max-width: 768px) {
  .landing-wrapper { padding-top: 80px; }
  .title-wrapper { align-items: center; }
  .author-name { color: #fff; font-size: 2rem; text-align: center; }
  .book-title-main { font-size: 2.5rem; text-align: center; white-space: normal; }
  .shapes-gif { max-height: 40vh; }
  .hero-social-proof { flex-direction: column; gap: .8rem; padding: 1rem 1.5rem; border-radius: 12px; }
  .proof-divider { width: 50px; height: 1px; }
  .agent-glow { filter: blur(80px); }
  :root { --glow-w: 300px; --glow-h: 300px; }
}

/* intro block under the hero */
.intro { max-width: 1040px; margin: 0 auto; padding: 40px 24px 56px; text-align: center; }
.intro-row { display: flex; align-items: center; justify-content: center; gap: 56px; text-align: left; }
.intro .book-3d { width: auto; height: auto; max-width: 350px; flex: none; }   /* 3D cover, same size as Book 1's */
.intro-text { flex: 1; min-width: 0; }
.intro .pitch { font-size: 1.2rem; color: var(--ink-2); max-width: 62ch; margin: 0; }
.intro .pitch strong { color: var(--ink); }
.intro .hero-ctas { justify-content: flex-start; }
.intro .hero-ctas .btn { padding-left: 16px; padding-right: 16px; }
.intro .hero-meta { color: var(--ink-3); }
.intro .quote { font-size: clamp(1.2rem, 2.2vw, 1.5rem); font-weight: 300; color: var(--ink); margin: 36px auto 0; max-width: 40ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: var(--radius-m);
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { border-color: #555; color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-2); color: #fff; }
.btn-small { padding: 8px 14px; font-size: .9rem; }

/* ---------- home: hero ---------- */
.hero { max-width: 1240px; margin: 0 auto; padding: 56px 24px 40px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.02; }
.hero h1 span { display: block; }
.hero .subtitle { font-size: clamp(1.25rem, 2vw, 1.6rem); color: var(--ink-2); margin: 14px 0 26px; font-weight: 400; }
.hero .pitch { font-size: 1.12rem; color: var(--ink-2); max-width: 54ch; }
.hero .pitch strong { color: var(--ink); font-weight: 600; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-meta { margin-top: 22px; color: var(--ink-3); font-size: .95rem; }
.hero-art { position: relative; display: flex; justify-content: center; }
.hero-art video, .hero-art img { width: 100%; max-width: 520px; height: auto; display: block; }
.byline { color: var(--ink-3); margin-bottom: 18px; font-size: 1rem; }
.byline a { color: var(--ink-2); text-decoration: none; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; gap: 28px; }
  .hero-art { order: -1; } .hero-art video, .hero-art img { max-width: 340px; }
}

.quote-band { max-width: 1240px; margin: 0 auto; padding: 8px 24px 48px; }
.quote-band p { font-size: clamp(1.2rem, 2.2vw, 1.55rem); color: var(--ink); margin: 0; max-width: 46ch; font-weight: 300; border-left: 3px solid var(--accent); padding-left: 20px; }

/* ---------- home: sections ---------- */
.section { max-width: 1240px; margin: 0 auto; padding: 56px 24px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.015em; }
.section-head p { color: var(--ink-2); margin: 8px 0 0; max-width: 62ch; }
.divider { border: 0; border-top: 1px solid var(--line); max-width: 1192px; margin: 0 auto; }

/* filters (idea from lawsofsoftwareengineering.com) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filters .lbl { color: var(--ink-3); font-size: 1.08rem; margin-right: 4px; }
.chip {
  font: 500 1.05rem/1 var(--sans); padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-2); border: 1px solid var(--line);
}
.chip:hover { color: var(--ink); border-color: #555; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* edition markers: outline square (Web) < filled square (Core) < filled star (Complete), used in the legend and on the cards */
.mk { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.mk-web { border: 2px solid var(--accent); }
.mk-core { background: var(--accent); }
.mk-complete { width: auto; height: auto; border-radius: 0; margin-right: 6px; color: var(--accent); font-style: normal; font-size: 1.05em; line-height: 1; vertical-align: -1px; }
.mk-complete::before { content: "\2605"; }
/* legend: nested boxes show what is included in what */
.legend { margin: 14px 0 26px; }
.nest { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px; padding: 2.5px 8px; line-height: 1.25; border: 2px solid #5e5e66; border-radius: 10px; color: var(--ink-2); font-size: 1.05rem; }
/* the guide and the cards use the same outlines: Complete = lavender solid (the special ones), Core = grey solid, Web = no outline, lavender fill (live) */
/* Complete = lavender-tinted tile, no outline; Core = grey outline; Web = Core's grey outline plus a lavender bar on the left (live) */
.nest-complete { border-color: transparent; background: var(--complete-fill); }
.nest-core { border-color: var(--tier-core); }
.nest-web { border-color: var(--accent); border-left: 5px solid var(--accent); padding-left: 10px; }   /* one edge: the bar is the left border itself */
.nest-lbl { white-space: nowrap; }
.legend-note { margin: 8px 2px 0; color: var(--ink-3); font-size: .9rem; }
@media (max-width: 560px) { .nest { flex-direction: column; align-items: flex-start; } }

/* scenario map: one row per chapter */
.part-title { font-size: 1.2rem; color: var(--ink-3); font-weight: 500; margin: 34px 0 6px; }
.part-title b { color: var(--ink-2); font-weight: 600; }
.chapter-row { display: grid; grid-template-columns: 270px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.chapter-label .cnum { color: var(--ink-3); font-size: 1.02rem; display: block; }
.chapter-label h3 { font-size: 1.25rem; font-weight: 600; margin-top: 2px; }
.chapter-label p { color: var(--ink-3); font-size: 1.08rem; margin: 4px 0 0; font-style: italic; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .chapter-row { grid-template-columns: 1fr; gap: 10px; } }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 16px 16px 14px; border-radius: var(--radius-m); text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: transparent; min-height: 210px;
}
.card .row1 { display: flex; justify-content: space-between; align-items: center; }
.card .num { font: 500 1.02rem/1 var(--mono); color: var(--ink-3); }
.card h4 { font-size: 1.32rem; font-weight: 600; line-height: 1.25; }
.card .hook { font-size: 1.1rem; color: var(--ink-2); margin: 0; line-height: 1.45; }
.card .foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 6px; }
.card .status { font-size: 1rem; font-weight: 600; }
.card .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tagdot { font-size: .88rem; color: var(--ink-3); border: 1px solid #5a595a; border-radius: 999px; padding: 2px 7px; }

/* tiers: Complete = lavender-tinted tile (no outline), Core = grey outline, Web = lavender outline + lavender bar on the left (live, readable on this site) */
.card.live { background: var(--surface); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.card.live { transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.card.live:hover { background: #443e60; transform: translateY(-2px); box-shadow: inset 3px 0 0 var(--accent), 0 6px 14px rgba(0,0,0,.28); }
/* "Read now →": only the Web cards can be opened here, so say so and let the arrow move on hover */
.card.live .status { display: flex; align-items: center; width: 100%; }
.card.live .go { margin-left: auto; color: var(--accent-strong); font-weight: 600; }
.card.live .go i { display: inline-block; font-style: normal; transition: transform .15s ease; }
.card.live:hover .go i { transform: translateX(5px); }
.card.live .status { color: var(--ink-2); }
.card.core { background: #393839; border-color: var(--tier-core); }
.card.core h4 { color: var(--ink-2); }
.card.core .hook { color: var(--ink-3); }
.card.core .status { color: var(--ink-2); }
.card.core:hover { border-color: #b0b0d0; background: #4a494b; }
.card.complete { background: var(--complete-fill); border-color: transparent; }
.card.complete h4 { color: var(--ink-3); font-weight: 500; }
.card.complete .hook { color: #8a8885; }
.card.complete .status { color: var(--ink-3); font-weight: 500; }
.card.complete:hover { background: #47436a; }
.card.pending h4 { font-style: italic; }
.card.pending { min-height: 0; }
.card[hidden] { display: none; }
.chapter-row[hidden], .part-title[hidden] { display: none; }

.meter { display: inline-flex; gap: 2px; }
.meter i { width: 14px; height: 6px; border-radius: 2px; background: #5a595a; display: block; }
.meter i.on { background: var(--ink-2); }
.card.live .meter i.on { background: var(--accent); }

/* stages strip */
.stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: st; }
.stages li { padding: 0 18px 0 0; }
.stages .n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .95rem; margin-bottom: 12px; }
.stages h3 { font-size: 1.05rem; margin-bottom: 6px; }
.stages p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.stages li + li { border-left: 1px solid var(--line); padding-left: 18px; }
@media (max-width: 900px) { .stages { grid-template-columns: 1fr; gap: 22px; } .stages li + li { border-left: 0; padding-left: 0; } }

/* editions */
.editions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.edition { padding: 28px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.edition.featured { border-color: var(--accent); background: linear-gradient(180deg, #46435f 0%, var(--surface) 55%); box-shadow: 0 0 0 1px var(--accent), 0 14px 44px rgba(165,136,255,.18); }
.edition .badge { display: inline-block; vertical-align: middle; margin-left: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 3px 10px; }
.edition h3 { font-size: 1.5rem; }
/* small line icon at the top of the "Two readers" cards */
.reader-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.reader-ico { flex: none; width: 64px; height: 64px; border-radius: 16px; background: rgba(165,136,255,.12); border: 1px solid rgba(165,136,255,.3); display: grid; place-items: center; }
.reader-ico svg { width: 48px; height: 48px; fill: none; stroke: var(--accent-strong); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.reader-ico .hl { stroke: #ffe065; }
.edition .price { font-size: 1.05rem; color: var(--ink-2); margin: 6px 0 18px; }
.edition .price strong { color: var(--ink); font-size: 1.6rem; font-weight: 700; margin-right: 6px; }
.edition ul { margin: 0 0 22px; padding-left: 1.2em; color: var(--ink-2); }
.edition li { margin-bottom: 6px; }
.edition li strong { color: var(--ink); font-weight: 600; }
.edition .when { color: var(--ink-3); font-size: .92rem; margin-top: 12px; }
.edition .actions { margin-top: auto; }
@media (max-width: 820px) { .editions { grid-template-columns: 1fr; } }

/* signup */
.signup { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input[type=email] {
  flex: 1 1 220px; min-width: 0; padding: 11px 14px; border-radius: var(--radius-m);
  border: 1px solid #555; background: #1b1b1b; color: var(--ink); font: 400 1rem var(--sans);
}
.signup input::placeholder { color: var(--ink-3); }
.signup-note { color: var(--ink-3); font-size: .88rem; margin: 10px 0 0; }

/* author: the same frosted card as the About the Author section on the Book 1 page */
.author-card {
  position: relative; max-width: 900px; margin: 0 auto; padding: 3rem; border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,.03) 100%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.15); border-left: 1px solid rgba(255,255,255,.15); box-shadow: 0 8px 32px 0 rgba(0,0,0,.3);
}
.author-card::before { content: ""; display: block; width: 99.8%; height: 6px; background: linear-gradient(90deg, #5B9FE3, #FFE066, #FF6B6B); position: absolute; top: 0; left: 0; border-radius: 20px 20px 0 0; opacity: .8; }
.author-card h2 { text-align: left; margin-bottom: 2rem; font-size: 2rem; color: #fff; }
.author { display: flex; gap: 3rem; align-items: flex-start; }
.author img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid rgba(255,255,255,.1); box-shadow: 0 0 20px rgba(91,159,227,.2); }
.author-text { flex: 1; }
.author-text p { margin-bottom: 1.2rem; color: #e0e0e0; font-size: 1.05rem; }
.author-text .social-pills { margin-top: 0; margin-bottom: 0; }
@media (max-width: 768px) {
  .author-card { padding: 2rem 1.5rem; }
  .author-card h2 { text-align: center; }
  .author { flex-direction: column; align-items: center; gap: 1.5rem; }
  .author-text .social-pills { justify-content: center; }
}

.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; gap: 14px 28px; color: var(--ink-3); font-size: .92rem; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer .spacer { margin-left: auto; }

/* ============ reading pages (scenario + how to think) ============ */
.reader { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px; }
@media (max-width: 1000px) { .reader { grid-template-columns: minmax(0, 1fr); gap: 0; } .sidebar { display: none; } }

.sidebar { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 76px); overflow-y: auto; padding: 28px 0 40px; font-size: .9rem; scrollbar-width: thin; }
.sidebar h2 { font-size: .85rem; color: var(--ink-3); font-weight: 500; margin: 0 0 10px; }
.sidebar .side-home { display: block; color: var(--ink-2); text-decoration: none; margin-bottom: 18px; }
.sidebar .side-home:hover { color: var(--ink); }
.side-ch { margin: 0 0 12px; }
.side-ch .ct { color: var(--ink-3); font-size: .9rem; display: block; margin-bottom: 3px; }
.side-ch ul { list-style: none; padding: 0; margin: 0; }
.side-ch li { padding: 3px 0 3px 10px; border-left: 2px solid transparent; line-height: 1.35; }
.side-ch li a { color: var(--ink); text-decoration: none; }
.side-ch li a:hover { color: var(--accent-strong); }
.side-ch li.current { border-left-color: var(--accent); }
.side-ch li.current a { color: var(--accent-strong); font-weight: 600; }
.side-ch li.off { color: #8a8885; }
.side-ch li.off a { color: #8f8d89; }
.side-ch li .n { font-family: var(--mono); font-size: .9rem; color: var(--ink-3); margin-right: 6px; }
.side-stages { list-style: none; padding: 0; margin: 4px 0 4px 10px; }
.side-stages li { border: 0; padding: 2px 0; }
.side-stages a { color: var(--ink-2) !important; font-weight: 400 !important; font-size: .95rem; }

.article { padding: 36px 0 40px; max-width: var(--measure); }
.crumbs { color: var(--ink-3); font-size: 1rem; margin-bottom: 18px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.scen-num { color: var(--accent-strong); font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; }
.article h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 16px; }
.scen-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; color: var(--ink-3); font-size: 1rem; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.scen-meta .meter i.on { background: var(--accent); }
.ptag { display: inline-block; font-size: .9rem; color: var(--accent-strong); border: 1px solid #4a4570; border-radius: 999px; padding: 1px 9px; margin-right: 4px; }

.stage { padding-top: 26px; }
.stage-head { display: flex; align-items: center; gap: 12px; font-size: 1.55rem; color: var(--ink); padding-bottom: 10px; border-bottom: 1px solid #3c3a52; margin-bottom: 20px; }
.stage-num { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 1.05rem; }
/* Section band inside Digest & Disarm: tinted full-width strip, small caps */
.digesthead { font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--accent-strong); background: rgba(165,136,255,.1); border-radius: 4px; padding: 7px 12px; margin: 30px 0 12px; }
.parhead { font-size: 1.2rem; color: var(--accent-strong); margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }
.parhead::before { content: ""; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); flex: none; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin-bottom: .5em; }
.article strong { font-weight: 600; color: #fff; }

.ico { display: inline-flex; width: 1.1em; height: 1.1em; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* exhibit: the artifact you reason from */
.exhibit { --c: #aeb1bd; margin: 26px 0; background: color-mix(in srgb, var(--c) 10%, transparent); border: 2.5px solid var(--c); border-radius: var(--radius-m); overflow: hidden; }   /* same recipe as the boxes, in neutral grey */
.exhibit-tab { display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--c) 24%, transparent); color: #e4e6ec; font: 600 1.3rem/1.3 var(--sans); padding: 9px 16px; }
.exhibit-table { width: 100%; border-collapse: collapse; font-size: 1.03rem; }
.exhibit-table td, .exhibit-table th { padding: 7px 14px; vertical-align: top; text-align: left; }
.exhibit-table td:not(:first-child) { text-align: right; font-family: var(--mono); font-size: .95rem; white-space: nowrap; color: var(--ink); }
.exhibit-table td:first-child { color: var(--ink-2); }
.exhibit-table th.group { padding-top: 12px; color: var(--ink); font-weight: 600; }
.exhibit-table tr.rule td, .exhibit-table tr.rule th { border-top: 2px solid color-mix(in srgb, var(--c) 40%, transparent); }
.exhibit-table tr:first-child td { padding-top: 12px; }
.exhibit-table tr:last-child td { padding-bottom: 12px; }
@media (max-width: 640px) { .exhibit-table td:not(:first-child) { white-space: normal; } .exhibit { overflow-x: auto; } }

.tipping { display: flex; gap: 10px; color: var(--ink); border-left: 3px solid var(--flag); padding: 2px 0 2px 14px; }
.tipping .ico { color: var(--flag); margin-top: 4px; }

/* the boxes: one color each, same as the book */
.box { margin: 26px 0; border-radius: var(--radius-m); border: 1.5px solid; overflow: hidden; background: color-mix(in srgb, var(--c) 10%, transparent); }
.box-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.3rem; line-height: 1.3; padding: 9px 16px; }   /* one size for every box title, larger than any text inside */
.box-body { padding: 14px 16px 6px; }
.box-title .ico { width: 1.21em; height: 1.21em; }
.box-body p { margin-bottom: .8em; }
.box-pause    { border-color: var(--c);         --c: var(--pause); }
.box-napkin   { border-color: var(--c);         --c: var(--napkin); }
.box-tradeoff { border-color: var(--c);         --c: var(--tradeoff); }
.box-senior   { border-color: var(--c);         --c: var(--senior); }
.box-lens     { border-color: var(--c);         --c: var(--lens); }
.box-bonus    { border-color: var(--c);         --c: var(--bonus); }
.box-flags    { border-color: var(--c);         --c: var(--flag); }
.box-note     { border-color: var(--c);         --c: var(--accent-strong); }
.box .box-title { color: var(--c); background: color-mix(in srgb, var(--c) 24%, transparent); }   /* one band tint for every box */
.box-senior .box-body p { font-size: 1.2rem; font-weight: 500; color: var(--ink); }

.pause-cta { color: var(--ink-2); border-top: 1px solid #2f5d75; padding-top: 10px; }
.pause-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0 12px; }
.pause-actions button { font: 600 .95rem var(--sans); border-radius: var(--radius-m); padding: 9px 15px; cursor: pointer; }
.btn-timer { background: transparent; color: var(--pause); border: 1px solid var(--pause); }
.btn-timer { font-variant-numeric: tabular-nums; }
/* while running, the button is a progress bar that drains; the last minute turns red */
.btn-timer[aria-pressed="true"] { background: linear-gradient(90deg, rgba(85,174,240,.32) var(--p, 100%), rgba(85,174,240,.06) var(--p, 100%)); }
.btn-timer.low { color: var(--flag); border-color: var(--flag); }
.btn-timer.low[aria-pressed="true"] { background: linear-gradient(90deg, rgba(255,107,107,.30) var(--p, 100%), rgba(255,107,107,.06) var(--p, 100%)); }
.pause-actions { align-items: center; }
.timer-set { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 1rem; margin-right: 4px; }
.timer-len { width: 130px; accent-color: var(--pause); cursor: pointer; }
.timer-len:disabled { opacity: .5; cursor: default; }
.timer-out { min-width: 3.4em; color: var(--pause); font-weight: 700; font-variant-numeric: tabular-nums; }
.btn-timer { min-width: 14em; flex: 1 1 auto; }   /* stretches to fill the gap before "Show the answer" */
.btn-reveal { margin-left: auto; }
@media (max-width: 560px) { .timer-set { flex: 1 1 100%; } .timer-len { flex: 1; width: auto; } .btn-timer { min-width: 0; flex: 1; } .btn-reveal { margin-left: 0; flex: 1; } }
.btn-reveal { background: var(--pause); color: #0e1c24; border: 1px solid var(--pause); }
.after-pause.gated { position: relative; max-height: 220px; overflow: hidden; }
.after-pause.gated::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(52,51,52,.3), var(--bg) 85%); }
.after-pause.gated > * { filter: blur(3px); user-select: none; }
@media (prefers-reduced-motion: no-preference) { .after-pause > * { transition: filter .35s ease; } }

.qa { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.qa:first-of-type { border-top: 0; }
.qa-q, .qa-a { display: grid; grid-template-columns: 112px 1fr; gap: 12px; }
.qa p { margin: 0; }
.qa-q p { font-weight: 600; color: var(--ink); }
.qa-a p { color: var(--ink-2); }
.who { font-size: 1.1rem; font-weight: 700; padding-top: 1px; color: var(--ink-3); }
.qa-q .who { color: var(--accent-strong); }
@media (max-width: 560px) { .qa-q, .qa-a { grid-template-columns: 1fr; gap: 0; } }

.itis, .itisnot { display: flex; gap: 10px; }
.itis .ico { color: var(--senior); margin-top: 4px; } .itisnot .ico { color: var(--flag); margin-top: 4px; }

.trap { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.trap p { margin: 0; }
.trap-label { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 1.1rem; font-weight: 700; padding-top: 1px; }
.trap-notenough .trap-label { color: var(--notenough); }
.trap-gap .trap-label { color: var(--senior); }
.trap-wrongturn .trap-label { color: var(--flag); }
@media (max-width: 560px) { .trap { grid-template-columns: 1fr; gap: 2px; } }

.rc-wrap { overflow-x: auto; margin: 10px 0 24px; }
.rcg { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(0,1.15fr) 44px auto; column-gap: 0; row-gap: 12px; align-items: stretch; min-width: 620px; font-size: 1.02rem; }
.rcg .rc-edges { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rcg .rc-edges path { fill: none; stroke: #6f68a8; stroke-width: 2; }
.rc-h { font-size: .9rem; font-weight: 600; color: var(--accent-strong); padding: 0 4px 2px; }
.rc-sym, .rc-cause { position: relative; z-index: 1; padding: 10px 14px; border-radius: 8px; display: flex; align-items: center; }
.rc-sym { background: #3d3c3d; border: 1px solid #4f4e4f; color: var(--ink-2); }
.rc-cause { background: #3b3850; border: 1px solid #504b74; color: var(--ink); align-self: center; }
.rc-dec { position: relative; z-index: 1; display: flex; align-items: center; }
.dpill { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .9rem; border-radius: 6px; padding: 3px 9px; margin: 2px 0 2px 4px; }

.decision { font-size: 1.3rem; margin: 30px 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.decision .dpill { margin: 0; font-size: .92rem; }
.fixes { color: var(--ink-3); font-style: italic; font-size: 1.05rem; margin-bottom: 10px; }

.arch { margin: 26px 0; }
@media (min-width: 1100px) { .arch { margin: 26px -5%; } }   /* diagrams break out of the text column a little so they read about 10% larger */
.arch-scroll { background: none; padding: 0; overflow-x: auto; }
.arch-scroll img { filter: invert(.92) hue-rotate(180deg); display: block; width: 100%; min-width: 620px; height: auto; }
.arch figcaption { color: var(--ink-3); font-size: 1rem; margin-top: 8px; }

.nm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 6px 0; border-bottom: 1px dotted #2f6470; font-size: 1.03rem; }
.nm-label { color: var(--ink); grid-column: 1 / -1; }
.nm-expr { color: var(--napkin); font-size: .95rem; }
.nm-dots { display: none; }
.nm-res { font-weight: 600; color: var(--ink); font-size: .95rem; text-align: right; }
.nm-total { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 0 8px; }
.nm-total code { color: var(--napkin); font-weight: 600; }

.to-line { display: flex; gap: 10px; }
.to-line .ico { color: var(--tradeoff); margin-top: 4px; opacity: .8; }
.lens-row { display: grid; grid-template-columns: 74px 1fr; gap: 12px; margin-bottom: 12px; }
.lens-row p { margin: 0; }
.lens-lvl { font-size: .88rem; font-weight: 700; color: #fff; border-radius: 4px; padding: 3px 0; text-align: center; height: fit-content; }
.lens-mid .lens-lvl { background: #8a3a66; } .lens-senior .lens-lvl { background: #b0467f; } .lens-staff .lens-lvl { background: #d3589d; }
.lens-senior { margin-left: 14px; } .lens-staff { margin-left: 28px; }
@media (max-width: 560px) { .lens-senior, .lens-staff { margin-left: 0; } }
.curve { padding: 4px 0 6px; }
.curve-q { display: flex; gap: 8px; flex-wrap: wrap; }
.curve-q .ico, .breaks .ico { color: var(--bonus); margin-top: 4px; }
.curve-q strong { color: var(--bonus) !important; }
.breaks { border-top: 1px solid #5e5020; padding-top: 10px; }
.breaks p { display: flex; gap: 8px; }
.box-flags ul { padding-left: 1.1em; }
pre.prompt { background: #2a2b2e; border: 1px solid #44464c; border-radius: var(--radius-m); padding: 12px 14px; overflow-x: auto; font-size: .95rem; line-height: 1.55; }
.pull { font-size: 1.3rem; font-weight: 300; color: var(--ink); border-left: 3px solid var(--accent); padding-left: 18px; margin: 26px 0; }

/* end-of-scenario: what next */
.next { margin-top: 44px; padding: 26px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid #4a4570; }
.next h2 { font-size: 1.45rem; margin-bottom: 8px; }
.next p { color: var(--ink-2); }
.next .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; flex-wrap: wrap; }
.pager a { text-decoration: none; color: var(--ink-2); font-size: 1.05rem; max-width: 48%; }
.pager a span { display: block; color: var(--ink-3); font-size: .92rem; }
.pager a:hover { color: var(--ink); }

/* how-to-think tables */
.def-table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; font-size: 1.05rem; }
.def-table td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.def-table td:first-child { width: 150px; }
.def-table .ico { margin-right: 6px; vertical-align: -2px; }
.article h2.h { font-size: 1.5rem; margin: 36px 0 12px; }
.stage-list { list-style: none; padding: 0 !important; }
.stage-list li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; margin-bottom: 14px; }
.stage-list .stage-num { width: 28px; height: 28px; font-size: 1rem; }


.is-soon { opacity: .6; cursor: default; }
.form-msg { color: var(--ink-2); font-size: 1.02rem; margin: 10px 0 0; }

.pause-hidden { display: none; }

/* larger text in the scenario map */
#scenarios .section-head p { font-size: 1.3rem; }
html, main { overflow-x: clip; }
@media (min-width: 1100px) { main.article { overflow-x: visible; } }   /* lets the wider diagrams sit just outside the text column */

/* Hero animation: shown whole at its own proportions, centered, never wider than the window. */
.hero-video { display: block; margin: 0 auto; width: auto; height: auto; max-height: 65vh; max-width: 94vw; }
@media (max-width: 768px) { .hero-video { max-height: 48vh; } }
@media (max-width: 768px) {
  .intro-row { flex-direction: column; gap: 28px; }
  .intro .book-3d { max-width: 250px; }
  .intro .hero-ctas { justify-content: center; }
  .intro-text { text-align: center; }
}
/* author social links: pill buttons, same look as the Book 1 page */
.social-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.social-pills a { display: inline-block; color: #fff; text-decoration: none; background: rgba(255,255,255,.1); padding: 4px 12px; border-radius: 20px; font-size: 1rem; font-weight: 500; border: 1px solid rgba(255,255,255,.1); transition: all .2s ease; }
.social-pills a:hover { background: #5B9FE3; border-color: #5B9FE3; transform: translateY(-2px); color: #fff; }

/* Once the answer is showing, only the Show/Hide toggle remains (the timer is done). */
.pause-actions.revealed .timer-set, .pause-actions.revealed .btn-timer { display: none; }
.pause-actions.revealed .btn-reveal { margin-left: 0; }


/* ---------- Two books, one series (same look as the panel on the Book 1 page, mirrored) ---------- */
.series-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.series-book { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 28px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease; }
.series-book img { width: 140px; height: auto; display: block; transition: transform .3s ease; }
.series-role { font-weight: 600; margin: 0 0 6px; }
.series-book.s1 .series-role { color: #86d8ae; }
.series-book.s2 .series-role { color: #bfa9ff; }
.series-book h3 { font-size: 1.6rem; letter-spacing: -.01em; margin: 0; color: var(--ink); }
.series-sub { color: var(--ink-2); margin: 6px 0 14px; }
.series-book ul { color: var(--ink-2); padding-left: 1.1em; margin: 0 0 20px; font-size: 1rem; }
.series-book li { margin-bottom: 4px; }
.series-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.series-btn { display: inline-block; padding: 11px 20px; border-radius: var(--radius-m); font: 600 1rem/1.2 var(--sans); text-decoration: none; border: 1px solid transparent; transition: background .2s ease; }
.series-book.s1 .series-btn { background: #14c876; color: #052916; }
.series-book.s1 .series-btn:hover { background: #27e385; color: #052916; }
.series-book.s2 .series-btn { background: var(--accent); color: var(--accent-ink); }
.series-book.s2 .series-btn:hover { background: var(--accent-strong); color: var(--accent-ink); }
.series-book.here { border-color: rgba(165,136,255,.76); box-shadow: 0 0 0 1px rgba(165,136,255,.33), 0 0 32px rgba(165,136,255,.25); }
.series-here { display: inline-block; margin-left: 10px; vertical-align: 1px; font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #bfa9ff; background: rgba(165,136,255,.14); border: 1px solid rgba(165,136,255,.4); border-radius: 999px; padding: 3px 10px; }
.series-book.s1:hover { border-color: rgba(114,255,180,.55); box-shadow: 0 0 0 1px rgba(114,255,180,.2), 0 0 30px rgba(114,255,180,.14); transform: translateY(-2px); }
.series-book.s1:hover img { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .series-book, .series-book img { transition: none; } .series-book.s1:hover, .series-book.s1:hover img { transform: none; } }
@media (max-width: 1000px) { .series-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .series-book { grid-template-columns: 1fr; } }

/* ---------- new in the scenario template: system line, tinted tags, story strip, markers, agents, tools ---------- */
.scen-sys { margin-left: .7em; padding-left: .8em; border-left: 1px solid rgba(255,255,255,.28); color: var(--ink-3); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; font-size: .86em; }
.ptag.r0 { background: rgba(165,136,255,.22); }       /* the pressure that drives the scenario most */
.ptag.r1 { background: rgba(165,136,255,.1); }        /* the second one, a little tinted; the rest stay plain */
.story-strip { margin: 18px 0 30px; overflow: hidden; }   /* hides the 1px edge the filter draws on the picture's outer edges */
.story-strip img { display: block; width: calc(100% + 4px); max-width: none; margin: -2px; height: auto; filter: url(#sketch); }   /* white paper becomes transparent, ink becomes chalk (filter defined in the figure) */
.smark { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; background: #ff90d0; color: #3a1030; font: 700 .72em var(--sans); margin-right: .55em; vertical-align: .1em; }
.agent { display: inline-block; border: 1px solid rgba(165,136,255,.6); color: var(--accent-strong); border-radius: 4px; padding: 0 .38em; font-size: .78em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.55; vertical-align: .08em; white-space: nowrap; }
code.tool { background: rgba(255,255,255,.1); color: var(--ink); padding: .08em .42em; border-radius: 4px; font-size: .85em; }
code.tool-w { border: 1px dashed rgba(255,255,255,.4); }
.ed-tag { color: var(--ink-3); font-size: .85em; }
.arch-today { margin-top: 8px; }

/* data tables inside a Setup (for example the agents and the tools each one can call) */
.table-wrap { overflow-x: auto; margin: 16px 0 20px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.data-table th { text-align: left; font-weight: 700; color: var(--ink); font-size: .95rem; padding: 6px 14px 8px 0; border-bottom: 2px solid var(--line); }
.data-table td { padding: 10px 14px 10px 0; vertical-align: top; color: var(--ink-2); border-bottom: 2px solid color-mix(in srgb, var(--line) 70%, transparent); line-height: 2; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child, .data-table th:first-child { white-space: nowrap; }
.data-table code.tool { margin: 0 4px 4px 0; display: inline-block; line-height: 1.5; }

/* Kit form: hide the "Built with Kit" badge (dark logo on the dark card). */
.formkit-powered-by-convertkit-container { display: none !important; }
