/* The Ai & WE Book — white-background book website (distinct from WEPARTYglobal.com). */
:root {
  --ink: #0d1b3d;
  --blue: #1740a8;
  --blue-deep: #0b2a78;
  --sky: #e9f1ff;
  --line: #d7e2f5;
  --heart: #e0263a;
  --muted: #4a5878;
  --display: "Fraunces", Georgia, serif;
  --body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font: 400 1.0625rem/1.6 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .6rem 1rem; background: var(--blue); color: #fff; border-radius: 999px; font-weight: 800; }
.skip:focus { top: 1rem; }
main:focus { outline: none; }

/* Header */
.bar { position: sticky; top: 0; z-index: 20; padding: .6rem clamp(1rem, 4vw, 2.5rem) .5rem; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1120px; margin: 0 auto; }
.brand { font: 800 clamp(1.7rem, 3.6vw, 2.3rem)/1 var(--display); color: var(--blue-deep); text-decoration: none; letter-spacing: -.01em; }
.brand .amp { color: var(--blue); }
.bar-nav { display: flex; align-items: center; justify-content: center; gap: .25rem; flex-wrap: wrap; max-width: 1120px; margin: .45rem auto 0; }
.bar-nav > a, .talk { font: 700 .95rem/1 var(--body); color: var(--ink); text-decoration: none; padding: .6rem .8rem; border-radius: 999px; cursor: pointer; border: 0; background: none; white-space: nowrap; }
.bar-nav > a:hover { background: var(--sky); }
.talk { background: var(--blue); color: #fff; }
.talk:hover { background: var(--blue-deep); }
.bar-nav .global { color: var(--blue); }
.lang { display: flex; align-items: center; gap: .35rem; font-weight: 700; }
.lang select { font: 700 .9rem/1 var(--body); padding: .45rem .6rem; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); max-width: 11rem; }
#translation-status { max-width: 1120px; margin: .2rem auto 0; font-size: .8rem; color: var(--muted); text-align: center; }
#translation-status:empty { display: none; }
section[id] { scroll-margin-top: 9rem; }
.page-chapter main { padding-bottom: 5rem; }


/* Home: the book cover, the reading actions, then one separate Talk to Buddy control */
.kicker { margin: 0 0 .6rem; font-weight: 800; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); }
h1 { margin: 0; font: 800 clamp(2.6rem, 6.5vw, 4.6rem)/1.02 var(--display); color: var(--blue-deep); letter-spacing: -.02em; }
h1 span { color: var(--blue); }
h2 { font: 800 clamp(1.6rem, 3.2vw, 2.2rem)/1.15 var(--display); color: var(--blue-deep); margin: 0; }
h3 { font: 800 1.3rem/1.2 var(--display); color: var(--blue-deep); margin: 0 0 .5rem; }
.purpose { margin: 1.1rem 0 .2rem; font: 600 clamp(1.3rem, 2.6vw, 1.7rem)/1.25 var(--display); }
.reach { margin: 0; font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.free { display: inline-block; margin: 1rem 0 0; padding: .45rem .9rem; border-radius: 999px; background: var(--sky); color: var(--blue-deep); font-weight: 800; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .8rem 1.25rem; border-radius: 999px; font: 800 1rem/1 var(--body); text-decoration: none; cursor: pointer; border: 2px solid var(--blue); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-line { background: #fff; color: var(--blue); }
.btn-line:hover { background: var(--sky); }
.btn-big { padding: 1rem 1.6rem; font-size: 1.1rem; min-height: 3.2rem; }

.hero { max-width: 1120px; margin: 0 auto; padding: clamp(1.8rem, 5vw, 4rem) clamp(1rem, 4vw, 2.5rem) 1rem;
  display: grid; grid-template-columns: 1.1fr 1fr; grid-template-areas: "intro art" "actions art"; column-gap: clamp(1.5rem, 5vw, 4rem); row-gap: 1.6rem; align-items: start; }
.hero-intro { grid-area: intro; align-self: end; }
.hero-art { grid-area: art; margin: 0; justify-self: center; width: min(440px, 100%); }
.hero-art img { width: 100%; border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 30px 60px -28px rgba(11,42,120,.45); background: #fff; }
.hero-actions { grid-area: actions; display: grid; gap: 1rem; justify-items: start; }
.reading-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.hero-links { margin: 0; font-weight: 700; }
.buddy-card { display: flex; align-items: center; gap: .9rem; margin-top: .4rem; padding: .7rem 1.2rem .7rem .8rem; padding-inline: .8rem 1.2rem; border: 2px solid var(--line); border-radius: 20px; background: #fff; color: var(--ink); cursor: pointer; text-align: start; font: inherit; transition: border-color .15s, box-shadow .15s; max-width: 26rem; }
.buddy-card:hover, .buddy-card:focus-visible { border-color: var(--blue); box-shadow: 0 10px 24px -14px rgba(11,42,120,.5); }
.buddy-card img { width: auto; height: 84px; flex: none; filter: drop-shadow(0 8px 10px rgba(13,27,61,.18)); }
.buddy-card-text { display: grid; gap: .5rem; justify-items: start; }
.buddy-say { position: relative; padding: .55rem .8rem; background: var(--sky); border-radius: 14px; border-start-start-radius: 3px; font-weight: 700; font-size: .95rem; line-height: 1.35; }
.buddy-go { display: inline-flex; padding: .55rem 1rem; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 800; font-size: .95rem; }
.buddy-card:hover .buddy-go { background: var(--blue-deep); }

.home-inside { max-width: 1120px; margin: 2.5rem auto 0; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.home-inside h2 { margin-bottom: 1rem; }
.inside-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.inside-cards a { display: grid; gap: .4rem; height: 100%; padding: 1.2rem 1.3rem; border-radius: 18px; background: var(--sky); color: var(--ink); text-decoration: none; border: 2px solid transparent; transition: border-color .15s; }
.inside-cards a:hover, .inside-cards a:focus-visible { border-color: var(--blue); }
.ic-title { font: 800 1.3rem/1.2 var(--display); color: var(--blue-deep); }
.ic-title::after { content: " →"; color: var(--blue); }
[dir="rtl"] .ic-title::after { content: " ←"; }
.ic-text { color: var(--muted); font-weight: 600; }
.home-next { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: stretch; }
.home-next .articles-link { margin-top: 1.6rem; }
.sister-card { display: grid; gap: .2rem; align-content: center; margin-top: 1.6rem; padding: 1.2rem 1.5rem; border-radius: 22px; border: 2px solid var(--blue); color: var(--blue-deep); text-decoration: none; }
.sister-card:hover, .sister-card:focus-visible { background: var(--sky); }
.sister-card .articles-kicker { color: var(--blue); }
.sister-title { font: 800 clamp(1.3rem, 2.8vw, 1.7rem)/1.15 var(--display); }

/* Table of Contents page */
.contents { margin: 0 auto; }
.contents-head { border-bottom: 3px solid var(--blue); padding-bottom: .8rem; }
.contents-head p:last-child { margin: .4rem 0 0; color: var(--muted); font-weight: 600; }
.toc-start { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0 0; }
.toc { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem 1.2rem; }
.toc li { scroll-margin-top: 9rem; }
.toc-chapters li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; padding: .5rem; padding-inline-end: .8rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.toc-chapters li:hover, .toc-chapters li:focus-within, .toc-chapters li:target { border-color: var(--blue); box-shadow: 0 6px 16px rgba(23,64,168,.1); }
.toc-card { display: flex; align-items: center; gap: .8rem; color: var(--ink); text-decoration: none; min-width: 0; }
.toc-card img { width: 52px; height: auto; border-radius: 4px; border: 1px solid var(--line); flex: none; }
.toc-text { display: flex; align-items: center; gap: .65rem; min-width: 0; font-weight: 700; }
.toc-card:hover .ch-title { color: var(--blue); text-decoration: underline; }
.toc-actions { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: .9rem; }
.ch-num { flex: none; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; border-radius: 50%; background: var(--sky); color: var(--blue); font: 800 .95rem/1 var(--display); }
.toc-articles li { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.toc-articles li:hover, .toc-articles li:focus-within { border-color: var(--blue); }
.ch-read { flex: 1; display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; padding-inline-start: .7rem; color: var(--ink); text-decoration: none; font-weight: 700; min-width: 0; }
.ch-read:hover .ch-title { color: var(--blue); text-decoration: underline; }
.ch-dl { flex: none; margin-inline-end: .6rem; padding: .45rem .75rem; border-radius: 999px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 800; font-size: .8rem; white-space: nowrap; }
.toc-actions .ch-dl { margin: 0; }
.ch-dl::before { content: "↓ "; }
.ch-dl:hover { background: var(--blue-deep); }
.toc-extra { margin: 1rem 0 0; font-weight: 600; color: var(--muted); }
.free-pdfs { margin: 2.5rem 0 0; padding: clamp(1.2rem, 3vw, 1.8rem); border-radius: 22px; background: var(--sky); scroll-margin-top: 9rem; }
.free-pdfs > p { margin: .4rem 0 1rem; color: var(--muted); font-weight: 600; }
.free-pdfs h3 { margin-top: 1.4rem; font-size: 1.15rem; }
.pdf-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.pdf-list a { display: grid; gap: .2rem; height: 100%; padding: .9rem 1.1rem; border-radius: 16px; border: 2px solid var(--blue); background: #fff; color: var(--blue-deep); text-decoration: none; }
.pdf-list a:hover, .pdf-list a:focus-visible { background: #f3f7ff; }
.pdf-list .pdf-main { background: var(--blue); color: #fff; }
.pdf-list .pdf-main:hover, .pdf-list .pdf-main:focus-visible { background: var(--blue-deep); }
.pdf-name { font-weight: 800; font-size: 1.05rem; }
.pdf-hint { font-size: .88rem; opacity: .85; font-weight: 600; }
.pdf-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pdf-parts a { display: inline-flex; gap: .4rem; align-items: baseline; padding: .55rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--blue-deep); font-weight: 800; text-decoration: none; }
.pdf-parts a::before { content: "↓"; color: var(--blue); }
.pdf-parts a:hover, .pdf-parts a:focus-visible { border-color: var(--blue); }
.pdf-note { margin: 1rem 0 0; font-size: .92rem; color: var(--muted); font-weight: 600; }

/* About the Book page */
.about { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-areas: "main art" "side art" "motto motto"; gap: 1.6rem 2.6rem; align-items: start; }
.about-main { grid-area: main; }
.about-main .lead { font: 600 clamp(1.2rem, 2.2vw, 1.45rem)/1.4 var(--display); color: var(--blue-deep); }
.about-main p { font-size: 1.12rem; }
.about-art { grid-area: art; margin: 0; }
.about-art img { width: 100%; border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 24px 48px -26px rgba(11,42,120,.45); }
.easy { display: inline-block; padding: .45rem .9rem; border-radius: 999px; background: var(--sky); color: var(--blue-deep); font-weight: 800; }
.about-side { grid-area: side; display: grid; gap: 1rem; }
.about-side article { background: var(--sky); border-radius: 22px; padding: clamp(1.2rem, 3vw, 1.8rem); }
.about-side h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.verbs { font-weight: 800; color: var(--blue); letter-spacing: .02em; }
.decide { font: 700 1.2rem/1.3 var(--display); color: var(--blue-deep); margin-bottom: 0; }
.decide::before { content: "♥ "; color: var(--heart); }
.about .row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 0; }
.about-motto { grid-area: motto; margin: 0; text-align: center; font: 800 1.35rem/1.3 var(--display); color: var(--blue-deep); }

/* The 30 Ai & WE Articles — the prominent link after the book */
.read-all { font-weight: 800; }
.articles-link { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem 1rem; margin: 2rem 0 0; padding: 1.2rem 1.5rem; border-radius: 22px; background: var(--blue); color: #fff; text-decoration: none; box-shadow: 0 18px 36px -18px rgba(11,42,120,.6); transition: background .15s, transform .15s; }
.articles-link:hover, .articles-link:focus-visible { background: var(--blue-deep); transform: translateY(-2px); }
.articles-kicker { grid-column: 1; font-weight: 800; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.articles-title { grid-column: 1; font: 800 clamp(1.45rem, 3.2vw, 2rem)/1.15 var(--display); }
.articles-sub { grid-column: 1; font-weight: 600; font-size: .95rem; opacity: .9; }
.articles-go { grid-column: 2; grid-row: 1 / 4; font: 800 2rem/1 var(--display); }
[dir="rtl"] .articles-go { transform: scaleX(-1); }
.articles-pending { margin: 1.2rem 0 0; padding: 1rem 1.2rem; border-radius: 16px; background: var(--sky); font-weight: 600; }

/* Reading pages for the book and the articles */
.reader { max-width: 820px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 0; }
.page-contents .reader, .page-about .reader { max-width: 1120px; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.reader .contents { padding: 0; margin-top: 0; }
.reader h1 { font-size: clamp(2.1rem, 5.5vw, 3.3rem); }
.reader .contents-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.reader-head { padding-bottom: 1rem; border-bottom: 3px solid var(--blue); }
.reader-lang { margin: .8rem 0; padding: .5rem .9rem; display: inline-block; border-radius: 999px; background: var(--sky); color: var(--blue-deep); font-weight: 700; font-size: .92rem; }
.reader-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font-weight: 700; }
.reader-tools .ch-dl { margin: 0; }
.reader-crumb { margin: 0; font-weight: 700; }
.reader-toc { columns: 2; gap: 1.4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.reader-toc li { break-inside: avoid; margin-bottom: .35rem; }
.reader-toc a { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.reader-toc a:hover .ch-title { color: var(--blue); text-decoration: underline; }
.reader-toc .ch-num { width: 2rem; height: 2rem; font-size: .85rem; }
.reader-part { padding: 2.2rem 0 1rem; border-bottom: 1px solid var(--line); scroll-margin-top: 9rem; }
.page-chapter .reader-part { border-bottom: 0; padding-top: 1.2rem; }
.chapter-head { margin-bottom: 1.4rem; }
.chapter-head .chapter-title { margin-bottom: .8rem; }
.reader-part h2.chapter-title { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.opening-page { margin: 0 auto 2rem; max-width: 520px; }
.opening-page img { width: 100%; border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 20px 40px -26px rgba(11,42,120,.5); }
.opening-page figcaption { margin-top: .6rem; font-size: .9rem; color: var(--muted); text-align: center; }
.transcript { margin-top: .8rem; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; }
.transcript summary { cursor: pointer; font-weight: 800; color: var(--blue); }
.transcript .reader-text { font-size: 1rem; margin-top: .6rem; }
.reader-text { font: 400 1.16rem/1.75 "Literata", Georgia, serif; color: #14213f; }
.reader-text p { margin: 0 0 1.05em; }
.reader-text h2 { margin: 2.2rem 0 .3rem; font-size: clamp(1.4rem, 3vw, 1.75rem); line-height: 1.2; }
.reader-text h3 { margin-top: 1.6rem; }
.reader-text .tagline { margin-top: 0; font: italic 600 1.05rem/1.5 var(--body); color: var(--blue); }
.reader-text .slogan { margin: .4rem 0 .8rem; font-family: var(--body); font-size: 1rem; line-height: 1.45; }
.reader-text .slogan strong { color: var(--blue-deep); }
.reader-text .art-note { padding: .7rem 1rem; border-inline-start: 4px solid var(--blue); background: var(--sky); border-radius: 0 12px 12px 0; border-start-start-radius: 0; font: italic 400 .98rem/1.55 var(--body); color: var(--muted); }
[dir="rtl"] .reader-text .art-note { border-radius: 12px 0 0 12px; }
.art-label { display: inline-block; margin-inline-end: .35rem; font-style: normal; font-weight: 800; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.art-note a { font-style: normal; font-weight: 700; white-space: nowrap; }
.book-page-figure { margin: 2.4rem auto 1.4rem; max-width: 520px; scroll-margin-top: 9rem; }
.book-page-figure img { width: 100%; border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 20px 40px -26px rgba(11,42,120,.5); }
.book-page-figure figcaption { margin-top: .5rem; font: 600 .9rem/1.4 var(--body); color: var(--muted); text-align: center; }
.reader-text .page-labels { font: 700 .9rem/1.5 var(--body); color: var(--blue); }
.opening-pages { margin-bottom: 1rem; }
.original-pages { margin: 2.4rem 0 0; padding-top: 1.6rem; border-top: 3px solid var(--blue); scroll-margin-top: 9rem; }
.original-pages > p { color: var(--muted); font-weight: 600; }
.page-grid { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.page-grid a { display: grid; gap: .35rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem; text-align: center; }
.page-grid img { width: 100%; border-radius: 4px; border: 1px solid var(--line); box-shadow: 0 10px 20px -14px rgba(11,42,120,.45); transition: transform .15s; }
.page-grid a:hover img, .page-grid a:focus-visible img { transform: translateY(-3px); }
.reader-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: .8rem; padding: 2rem 0 0; }
.reader-pager > a { text-decoration: none; }
.pager-prev, .pager-next { display: grid; gap: .2rem; padding: .9rem 1.1rem; border: 2px solid var(--line); border-radius: 16px; color: var(--ink); }
.pager-prev:hover, .pager-next:hover, .pager-prev:focus-visible, .pager-next:focus-visible { border-color: var(--blue); }
.pager-next { text-align: end; }
.pager-dir { font-weight: 800; font-size: .85rem; color: var(--blue); }
.pager-title { font: 700 1rem/1.3 var(--display); color: var(--blue-deep); }
[dir="rtl"] .arr { display: inline-block; transform: scaleX(-1); }
.pager-toc { align-self: center; padding: .7rem 1rem; border-radius: 999px; background: var(--sky); font-weight: 800; white-space: nowrap; }
.reader-pager > a:only-child, .reader-pager > span { display: block; }
.reader-end { text-align: center; margin: 2rem 0 0; }
.buddy-float { position: fixed; inset-inline-end: 12px; bottom: 12px; z-index: 15; display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 92px; padding: 0; border: 0; background: none; cursor: pointer; }
.buddy-float img { width: 52px; filter: drop-shadow(0 10px 14px rgba(13,27,61,.25)); }
.buddy-float span { padding: .3rem .55rem; border-radius: 999px; background: var(--blue); color: #fff; font: 800 .72rem/1 var(--body); white-space: nowrap; }

/* Footer */
.book-foot { margin-top: 4rem; padding: 2.5rem 1rem 2rem; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }
.book-foot .global-banner { margin: 0 auto .6rem; display: table; padding: .4rem 1rem; border: 2px solid var(--blue); border-radius: 999px; color: var(--blue); font-weight: 800; }
.motto { margin: .4rem 0; font: 800 1.35rem/1.3 var(--display); color: var(--blue-deep); }
.book-foot .sister-site { margin: .8rem 0; }
.book-foot .sister-site a { color: var(--blue); font-weight: 800; }
.principles { margin: 1.2rem auto; max-width: 640px; }
.principles p { margin: .3rem 0; }
.principles .actual { font: 800 1.15rem/1.3 var(--display); color: var(--blue-deep); }
.principles .priceless { font-weight: 800; color: var(--blue); letter-spacing: .04em; }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.1rem; max-width: 760px; margin: 1rem auto; }
.foot-nav a { font-weight: 700; }
.have-fun { margin-top: .8rem; font-weight: 700; }
#google_translate_element { height: 0; overflow: hidden; }

/* Buddy conversation */
.buddy { width: min(600px, 96vw); max-height: 92vh; max-height: 92dvh; overflow-y: auto; border: 0; border-radius: 22px; padding: 1.2rem 1.3rem 1rem; color: var(--ink); background: #fff; box-shadow: 0 30px 80px rgba(13,27,61,.35); }
.buddy[open] { display: flex; flex-direction: column; }
.buddy::backdrop { background: rgba(13,27,61,.45); }
.buddy .x { position: absolute; top: .5rem; inset-inline-end: .8rem; font-size: 1.8rem; line-height: 1; border: 0; background: none; cursor: pointer; color: var(--muted); }
.buddy-head { display: flex; gap: .8rem; align-items: center; padding-inline-end: 1.5rem; }
/* Buddy's whole picture, never cropped, kept small so the title, conversation and message box fit on screen. */
.buddy-head img { width: auto; height: 64px; max-width: 42px; object-fit: contain; flex: none; }
.buddy h2 { font-size: 1.45rem; }
.buddy-head p { margin: .25rem 0 0; font-size: .95rem; }
.log { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: .9rem 0 .5rem; display: flex; flex-direction: column; gap: .55rem; max-height: 46vh; min-height: 4.5rem; }
.msg .voice-note { margin: .4rem 0 0; font-size: .8rem; font-style: italic; color: var(--muted); }
.log:empty { display: none; }
.msg { max-width: 88%; padding: .6rem .85rem; border-radius: 16px; font-size: .98rem; line-height: 1.5; }
.msg p { margin: 0 0 .45rem; } .msg p:last-child { margin-bottom: 0; }
.msg ul { margin: .2rem 0 .45rem; padding-inline-start: 1.2rem; }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-end-end-radius: 4px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--sky); border-end-start-radius: 4px; }
.msg.bot a { font-weight: 800; }
.msg.thinking .msg-body { animation: pulse 1.2s ease-in-out infinite; }
.msg.note { border: 1px dashed var(--blue); }
@keyframes pulse { 50% { opacity: .35; } }
.msg .hear { margin-top: .35rem; font: 700 .78rem/1 var(--body); padding: .35rem .6rem; border-radius: 999px; border: 1px solid var(--blue); background: #fff; color: var(--blue); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0; }
.chips button { font: 700 .85rem/1.1 var(--body); padding: .5rem .75rem; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--blue-deep); cursor: pointer; }
.chips button:hover { border-color: var(--blue); background: var(--sky); }
.ask { display: flex; gap: .5rem; align-items: stretch; }
.ask textarea { flex: 1; font: inherit; padding: .6rem .75rem; border: 2px solid var(--line); border-radius: 12px; resize: none; }
.ask textarea:focus { border-color: var(--blue); outline: none; }
.ask-actions { display: flex; flex-direction: column; gap: .35rem; }
.ask .btn { padding: .6rem 1rem; }
.mic { font: 800 .85rem/1 var(--body); padding: .5rem .7rem; border-radius: 999px; border: 2px solid var(--blue); background: #fff; color: var(--blue); cursor: pointer; white-space: nowrap; }
.mic[aria-pressed="true"] { background: var(--heart); border-color: var(--heart); color: #fff; }
.send:disabled { opacity: .6; cursor: wait; }
.settings { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin-top: .7rem; font-size: .85rem; font-weight: 700; }
.settings label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
.link { border: 0; background: none; padding: 0; color: var(--blue); font: 700 .85rem/1 var(--body); text-decoration: underline; cursor: pointer; }
.privacy { margin: .6rem 0 0; font-size: .75rem; color: var(--muted); line-height: 1.4; }
.read-aloud { position: absolute; z-index: 30; font: 800 .85rem/1 var(--body); padding: .55rem .8rem; border-radius: 999px; border: 0; background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(13,27,61,.25); cursor: pointer; }

@media (width > 860px) {
  .page-home .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "art" "actions"; padding-block-start: .875rem; row-gap: .625rem; text-align: center; }
  .page-home .hero-intro .kicker { margin-bottom: .25rem; }
  .page-home .hero-intro h1 { font-size: 2.75rem; }
  .page-home .hero-intro .purpose { margin-top: .4rem; font-size: 1.4rem; }
  .page-home .hero-intro .free { margin-top: .4rem; padding-block: .2rem; }
  .page-home .hero-art { width: clamp(210px, 29vh, 280px); }
  .page-home .hero-actions { gap: .3rem; justify-items: center; }
  .page-home .reading-actions { justify-content: center; }
  .page-home .reading-actions .btn { min-height: 2.75rem; padding-block: .65rem; }
  .page-home .buddy-card { max-width: 30rem; margin-top: 0; padding-block: .35rem; }
  .page-home .buddy-card img { height: 60px; }
  .page-home .buddy-card-text { gap: .2rem; }
  .page-home .buddy-say, .page-home .buddy-go { padding-block: .25rem; line-height: 1.35; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "intro" "art" "actions"; text-align: center; row-gap: 1.3rem; }
  .hero-intro { align-self: auto; }
  .hero-art { width: min(360px, 88%); }
  .hero-actions { justify-items: center; }
  .reading-actions { justify-content: center; width: 100%; }
  .reading-actions .btn { flex: 1 1 12rem; max-width: 20rem; }
  .buddy-card { width: 100%; }
  .inside-cards, .home-next, .pdf-list { grid-template-columns: 1fr; }
  .toc { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; grid-template-areas: "main" "art" "side" "motto"; }
  .about-art { width: min(360px, 88%); justify-self: center; }
  .reader-toc { columns: 1; }
}
/* Short screens (phones, tablets in landscape, small laptops): keep the message box in view. */
@media (max-height: 760px) {
  .buddy { padding: .9rem 1rem .8rem; }
  .buddy-head img { height: 52px; max-width: 34px; }
  .buddy h2 { font-size: 1.25rem; }
  .buddy-head p { font-size: .88rem; line-height: 1.35; }
  .log { margin: .6rem 0 .4rem; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: .5rem 0; padding-bottom: .2rem; scrollbar-width: thin; }
  .chips button { flex: none; }
  .settings { margin-top: .5rem; }
  .privacy { margin-top: .4rem; font-size: .7rem; }
}
@media (max-width: 480px) {
  .brand { font-size: 1.45rem; }
  .buddy { width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); padding: .8rem .85rem .7rem; }
  .buddy-head { gap: .6rem; }
  .buddy-head img { height: 48px; max-width: 32px; }
  .buddy h2 { font-size: 1.2rem; }
  .buddy-head p { font-size: .85rem; line-height: 1.35; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: .5rem 0; padding-bottom: .2rem; }
  .chips button { flex: none; }
  .bar { position: static; }
  .bar-nav { gap: 0 .1rem; }
  .bar-nav > a, .talk { padding: .5rem .55rem; font-size: .86rem; }
  .lang select { max-width: 8.5rem; }
  .msg { max-width: 94%; }
  .reader-text { font-size: 1.08rem; line-height: 1.7; }
  .reader-pager { grid-template-columns: 1fr 1fr; }
  .pager-toc { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .toc-chapters li { grid-template-columns: 1fr; }
  .toc-actions { justify-content: flex-end; }
  .toc-card img { width: 44px; }
  .page-grid { grid-template-columns: repeat(2, 1fr); }
  .buddy-float { width: 72px; }
  .buddy-float img { width: 40px; }
  .buddy-float span { font-size: .66rem; padding: .25rem .45rem; }
  .ch-dl span:first-child { font-size: 0; }
  .ch-dl span:first-child::after { content: "FREE"; font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .page-grid img, .articles-link { transition: none; } .msg.thinking .msg-body { animation: none; } }

/* The 30 Ai & WE Articles */
.pub-masthead { margin: 0 0 1rem; }
.pub-masthead img { display: block; width: 100%; height: auto; border-radius: 14px; }
.articles-home .contents-head .kicker, .reader-head .kicker { margin-bottom: .2rem; }
.free-choices { list-style: none; margin: 1.2rem 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.free-choice { display: grid; gap: .2rem; height: 100%; box-sizing: border-box; padding: .9rem 1.1rem; border: 2px solid var(--blue); border-radius: 16px; background: #fff; color: var(--blue-deep); text-decoration: none; transition: background .15s, transform .15s; }
.free-choice:hover, .free-choice:focus-visible { background: var(--sky); transform: translateY(-1px); }
.free-choice.free-dl { background: var(--blue); color: #fff; }
.free-choice.free-dl:hover, .free-choice.free-dl:focus-visible { background: var(--blue-deep); }
.fc-label { font-weight: 800; font-size: 1.05rem; }
.fc-label::before { content: "FREE · "; font-size: .78rem; letter-spacing: .08em; opacity: .8; }
.fc-hint { font-size: .9rem; opacity: .85; }
.tr-note { margin: .9rem 0; padding: .7rem 1rem; border-radius: 14px; background: var(--sky); color: var(--ink); font-size: .92rem; }
.tr-note p { margin: .2rem 0; }
.tr-badge { display: inline-block; margin-inline-end: .35rem; padding: .1rem .5rem; border-radius: 999px; font-weight: 800; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; vertical-align: .1em; }
.tr-ai { background: #fff3d6; color: #6b4a00; border: 1px solid #e8c56b; }
.tr-human { background: #dff5e6; color: #145a2c; border: 1px solid #8fd0a5; }
.pub-links { font-weight: 700; color: var(--muted); }
.publishers-card { display: grid; gap: .25rem; margin: 1.2rem 0; padding: 1rem 1.3rem; border-radius: 18px; border: 2px solid var(--blue); background: linear-gradient(135deg, #fff, var(--sky)); color: var(--ink); text-decoration: none; }
.publishers-card:hover, .publishers-card:focus-visible { border-color: var(--blue-deep); box-shadow: 0 10px 24px -14px rgba(11,42,120,.5); }
.publishers-card .articles-kicker { color: var(--blue); }
.pc-title { font: 800 clamp(1.3rem, 3vw, 1.7rem)/1.15 var(--display); color: var(--blue-deep); }
.toc-head { margin: 1.8rem 0 .2rem; }
.toc-sub { margin: 0; color: var(--muted); font-weight: 600; }
.toc-group { margin: 1.3rem 0 0; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.toc-articles { grid-template-columns: 1fr; }
.toc-chart { display: inline-block; margin-inline-start: .3rem; padding: 0 .45rem; border-radius: 999px; background: var(--sky); color: var(--blue); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.article-part .kicker { margin-bottom: .1rem; }
.reader-text ul { padding-inline-start: 1.3rem; margin: .3rem 0 1rem; }
.reader-text .art-call { padding: .75rem 1rem; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: 12px; background: #f3f7ff; color: var(--blue-deep); font-weight: 800; }
.reader-text .art-tag { font-style: italic; color: var(--muted); }
.art-figure { margin: 1.4rem 0; }
.art-figure img, .pub-art img { display: block; width: 100%; height: auto; border-radius: 14px; }
.art-foot { margin: 1rem 0 0; font-size: .85rem; color: var(--blue); }
.art-chart { margin: 2rem 0 1rem; padding: 1.2rem clamp(.9rem, 3vw, 1.6rem); border: 2px solid var(--line); border-radius: 18px; background: #fff; scroll-margin-top: 8.5rem; }
.chart-kicker { margin: 0; font: 800 1.25rem/1.2 var(--display); color: var(--blue); }
.art-chart .chart-title { margin: .5rem 0 .2rem; color: var(--ink); }
.chart-sub { margin: 0 0 1rem; color: var(--blue); }
.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.chart-stack { display: grid; gap: .8rem; }
.chart-box { padding: .8rem 1rem; border: 1px solid #7f98c8; border-radius: 6px; }
.chart-box h4 { margin: 0 0 .4rem; color: var(--blue); font: 800 1.02rem/1.3 var(--body); }
.chart-box p { margin: .25rem 0; font-size: 1rem; }
.chart-center { text-align: center; }
.chart-note { padding: .7rem 1rem; border: 1px solid #7f98c8; border-radius: 6px; color: var(--blue-deep); font-weight: 800; }
.chart-flow { text-align: center; font-weight: 800; color: var(--blue-deep); font-size: 1.08rem; }
.chart-small { font-size: .9rem; }
.art-chart figcaption { margin-top: .8rem; font-size: .9rem; font-weight: 700; }
.pub-part h2, .pub-solo h1 { text-align: center; color: var(--blue-deep); }
.pub-page { padding: 1rem 0; font-size: 1.08rem; line-height: 1.65; }
.pub-page + .pub-page { border-top: 1px solid var(--line); margin-top: 1rem; }
.pub-page h3 { margin: 1.4rem 0 .3rem; color: var(--blue-deep); }
.pub-center { text-align: center; }
.pub-big { margin: 0; text-align: center; font: 800 clamp(2.4rem, 8vw, 3.6rem)/1.1 var(--display); color: var(--blue-deep); }
.pub-small { font-size: .9rem; }
.pub-strong { font: 800 1.35rem/1.3 var(--display); color: var(--blue-deep); }
.pub-blue { color: var(--blue-deep); }
.pub-table { width: 100%; max-width: 420px; margin: .6rem auto; border-collapse: collapse; }
.pub-table th { text-align: left; font-weight: 600; padding: .25rem 0; }
.pub-table td { text-align: right; font-weight: 800; padding: .25rem 0; }
.pub-table tr + tr { border-top: 1px solid var(--line); }
.pub-guide { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem 1.4rem; margin: 1rem 0; font-size: 1rem; }
.pub-guide dt { font-weight: 800; color: var(--blue-deep); margin-top: .7rem; }
.pub-guide dd { margin: .2rem 0 0; }
.pub-langs { columns: 3; gap: 1.4rem; margin: 1rem 0; padding-inline-start: 2rem; font-size: 1rem; }
.pub-art { margin: 1.4rem 0; }
@media (max-width: 760px) {
  .free-choices, .chart-grid { grid-template-columns: 1fr; }
  .pub-guide { grid-template-columns: 1fr; }
  .pub-langs { columns: 2; }
  .toc-articles .ch-dl { font-size: .74rem; padding: .4rem .6rem; }
  .reader-pager { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .pub-langs { columns: 1; }
}

/* Table of Contents (compact homepage header and footer): one list of all 22 chapters,
   each title opening the chapter in the online reader, with its FREE PDF on the same row. */
.page-tocx .reader { max-width: 900px; padding-top: clamp(1rem, 3vw, 1.6rem); padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.tocx-head { border-bottom: 3px solid var(--blue); padding-bottom: .9rem; }
.tocx-head h1 { margin: 0; }
.page-home .tocx { max-width: 900px; margin-top: clamp(1.2rem, 4vw, 3rem); padding: 0 0 clamp(1rem, 3vw, 2rem); scroll-margin-top: 1rem; }
.tocx-head > p:not(.kicker):not(.tocx-start) { margin: .4rem 0 0; color: var(--muted); font-weight: 600; }
.tocx-start { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; }
.tocx-anchor { display: block; height: 0; scroll-margin-top: 1rem; }
.tocx-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; scroll-margin-top: 1rem; }
.tocx-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .6rem .5rem .55rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; scroll-margin-top: 1rem; transition: border-color .15s, box-shadow .15s; }
.tocx-list li:hover, .tocx-list li:focus-within, .tocx-list li:target { border-color: var(--blue); box-shadow: 0 6px 16px rgba(23,64,168,.1); }
.tocx-read { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1 1 auto; color: var(--ink); text-decoration: none; font-weight: 700; font-size: clamp(.98rem, 2.4vw, 1.1rem); line-height: 1.3; }
.tocx-read .ch-title { overflow-wrap: break-word; min-width: 0; }
.tocx-read:hover .ch-title, .tocx-read:focus-visible .ch-title { color: var(--blue); text-decoration: underline; }
.tocx-pdf { flex: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 2.5rem; padding: .4rem .85rem; border-radius: 999px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.tocx-pdf:hover, .tocx-pdf:focus-visible { background: var(--blue-deep); }
@media (max-width: 480px) {
  .tocx-list li { gap: .5rem; padding: .45rem .45rem .45rem .4rem; }
  .tocx-read { gap: .5rem; }
  .tocx-read .ch-num { width: 2rem; height: 2rem; font-size: .82rem; }
  .tocx-pdf { padding: .35rem .65rem; font-size: .78rem; }
  .tocx-start .btn { flex: 1 1 auto; }
}
.reader-back { margin-bottom: .8rem; }
/* The continuous reader is very long: links from the Table of Contents jump straight to the
   chapter instead of smooth-scrolling through the whole book. */
html:has(body.page-read) { scroll-behavior: auto; }
@media (max-width: 380px) {
  .page-tocx .reader { padding-inline: .6rem; }
  .tocx-read { font-size: .92rem; gap: .4rem; }
  .tocx-read .ch-num { width: 1.7rem; height: 1.7rem; font-size: .74rem; }
  .tocx-pdf { padding: .3rem .5rem; font-size: .72rem; gap: .2rem; min-height: 2.3rem; }
}
