@import url('/language-picker.css');
:root {
  color-scheme: light;
  /* Channel palette (I3): dark = shorts navy, light = T-shirt beige,
     accent = channel light blue. Contrast (WCAG AA) is noted in the PR. */
  --paper: #f2eee7;
  --surface: #fbf9f5;
  --ink: #19232e;
  --muted: #4d5966;
  --line: #d3cbbf;
  --navy: #19232e;
  --channel: #183a48;
  --accent: #4dd9d0;
  --eyebrow: #2d5f6e;
  --beige-deep: #e3dcd2;
  --tint: #ebe5dc;
  --on-dark: #f2eee7;
  --on-dark-muted: #b7c7cc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.6 system-ui, sans-serif; }
h1,h2,h3,p,figure { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
button,select { font: inherit; }
button,a,select,summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 5px; }
.wrap { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 84px; }
.brand { font-weight: 760; text-decoration: none; padding-block: 12px; }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: clamp(30px,6vw,88px); padding-block: 48px 80px; }
.eyebrow { font-size: 12px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 17px; }
h1 { font: 500 clamp(44px,5.2vw,70px)/1.07 Georgia,serif; letter-spacing: -.045em; max-width: 13ch; }
.lead { font-size: clamp(17px,1.8vw,20px); line-height: 1.6; margin: 24px 0 17px; max-width: 39ch; color: #33404c; }
.book-meta { font-size: 13px; color: var(--muted); margin-bottom: 23px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 52px; padding: 13px 25px; color: var(--surface); background: var(--navy); border: 1px solid var(--navy); border-radius: 6px; font-weight: 750; cursor: pointer; text-decoration: none; }
.button:hover { background: #2c3b4b; border-color: #2c3b4b; }
.button:disabled { opacity: .65; cursor: progress; }
.sample-link { display: block; width: fit-content; min-height: 44px; padding: 11px 0; font-size: 14px; }
.payment-note { font-size: 12px; line-height: 1.65; color: var(--muted); max-width: 38ch; margin-top: 7px; }
.book-display { --book3d: 1; padding: 7px 10px 0; }
.book-cover { position: relative; max-width: 400px; margin-inline: auto; border-radius: 2px 6px 6px 2px; overflow: hidden; background: #111; box-shadow: 13px 21px 35px #19232e33; transform: rotate(3deg); }
.book-cover img { display: block; width: 100%; height: auto; }
.book-display figcaption { margin-top: 30px; font-size: 12px; text-align: center; line-height: 1.55; color: var(--muted); }
.chapter-section { padding-block: 61px; border-top: 1px solid var(--line); }
.section-intro { max-width: 640px; margin-bottom: 32px; }
h2 { font: 500 clamp(29px,3.4vw,43px)/1.15 Georgia,serif; letter-spacing: -.025em; }
.section-intro>p:not(.eyebrow) { color: var(--muted); margin-top: 16px; }
.questions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; }
.questions h3 { font-size: 17px; line-height: 1.35; margin-bottom: 12px; }
.questions p { font-size: 15px; color: var(--muted); }
.preview-section { padding-block: 65px; background: var(--beige-deep); }
.previews { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.page-button { display: block; text-align: left; color: var(--ink); padding: 0; border: 0; background: transparent; cursor: zoom-in; min-width: 0; }
.page-image { aspect-ratio: .84; overflow: hidden; background: #d6cec2; padding: 17px 16px 0; border-radius: 6px; }
.page-image img { width: 100%; height: auto; box-shadow: 0 3px 15px #19232e1f; display: block; }
.page-button strong { display: block; margin-top: 15px; font-size: 15px; line-height: 1.45; }
.page-button>span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.page-button:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.contents-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 70px; }
.contents-section .section-intro { margin: 0; }
.contents>div { padding-block: 16px; border-bottom: 1px solid var(--line); }
.contents>div:first-child { padding-top: 2px; }
.contents h3 { font-size: 16px; line-height: 1.35; }
.contents p { margin-top: 5px; font-size: 14px; color: var(--muted); }
.evidence { display: grid; grid-template-columns: .9fr 1.1fr; gap: 70px; padding-block: 50px; border-block: 1px solid var(--line); }
.evidence h2 { font-size: clamp(29px,3vw,37px); }
.evidence>div>p { color: var(--muted); }
.sources { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0; }
.sources a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 650; }
.small { font-size: 13px; line-height: 1.7; }
.faq-section { max-width: 820px; padding-block: 65px; }
.faq-section h2 { margin-bottom: 24px; }
details { border-bottom: 1px solid var(--line); }
summary { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 20px; padding: 17px 0; cursor: pointer; font-weight: 650; line-height: 1.45; list-style: none; }
summary::after { content: '+'; flex-shrink: 0; font-size: 21px; font-weight: 400; }
summary::-webkit-details-marker { display: none; }
details[open] summary::after { content: '−'; }
details p { padding: 0 25px 20px 0; font-size: 15px; color: var(--muted); }
.closing { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 35px; padding: 39px 42px; background: var(--channel); color: var(--on-dark); border-radius: 9px; margin-bottom: 60px; }
.closing h2 { max-width: 24ch; font-size: 32px; }
.closing p { margin-top: 13px; font-size: 14px; color: var(--on-dark-muted); }
.closing .button { background: var(--accent); color: var(--navy); border-color: var(--accent); }
.closing .button:hover { background: #7fe4dd; border-color: #7fe4dd; }
.closing :focus-visible { outline-color: var(--accent); }
.closing .sample-link { color: var(--on-dark-muted); font-size: 12px; }
.footer { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-block: 20px 28px; font-size: 12px; color: var(--muted); }
#payment-feedback { position: fixed; z-index: 4; bottom: 20px; left: 50%; transform: translateX(-50%); width: min(540px, calc(100% - 32px)); padding: 16px 21px; border: 1px solid #bd8f68; border-radius: 8px; background: #fff6e9; box-shadow: 0 8px 40px #0002; }
dialog { width: min(850px,calc(100% - 24px)); max-height: calc(100% - 24px); padding: 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #19232ebd; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.dialog-heading h2 { font: 650 17px/1.3 system-ui,sans-serif; letter-spacing: normal; }
.close { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 26px; cursor: pointer; }
dialog img { display: block; width: 100%; height: auto; }
.preview-purchase { position: sticky; bottom: -16px; margin: 12px -16px -16px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--paper); }
.preview-purchase p { margin: 8px 0 0; }
.confirmation { max-width: 700px; padding-block: 70px; }
.confirmation h1 { max-width: 16ch; }
.confirmation p { margin-block: 20px; color: var(--muted); }
@media(max-width:760px) {
  .wrap { width: calc(100% - 40px); }
  .hero { gap: 25px; padding-block: 30px 55px; }
  h1 { font-size: clamp(39px,6vw,51px); }
  .hero-copy .lead { font-size: 17px; }
  .contents-section,.evidence { gap: 30px; }
  .questions { gap: 20px; }
  .previews { gap: 12px; }
  .page-image { padding: 9px 8px 0; }
  .closing { padding: 30px; }
}
@media(max-width:580px) {
  .topbar { min-height: 70px; }
  .brand { font-size: 13px; max-width: 62%; line-height: 1.3; }
  .language-toggle { min-width: 113px; font-size: 13px; gap: 12px; }
  .hero { grid-template-columns: 1fr; gap: 35px; }
  h1 { max-width: 14ch; font-size: clamp(41px,10vw,53px); }
  /* As wide as the 3D book replaces it with, so nothing below moves when it mounts. */
  .book-display { max-width: 340px; width: 100%; margin-inline: auto; }
  .hero-copy .button { width: 100%; }
  .hero-copy .sample-link { margin-inline: auto; text-align: center; }
  .payment-note { max-width: none; text-align: center; }
  .questions,.contents-section,.evidence,.closing { grid-template-columns: 1fr; }
  .questions { gap: 26px; }
  .chapter-section { padding-block: 40px; }
  .preview-section,.faq-section { padding-block: 40px; }
  .previews { grid-template-columns: 1fr; gap: 25px; }
  .page-button { display: grid; grid-template-columns: 116px 1fr; column-gap: 18px; align-items: center; }
  .page-image { grid-row: span 2; }
  .page-button strong { align-self: end; margin-top: 0; }
  .page-button>span { align-self: start; }
  .closing { gap: 20px; padding: 25px; }
  .closing .button { width: 100%; }
  .footer { flex-direction: column; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
.checkout-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); align-items: start; gap: clamp(24px,5vw,70px); padding-block: 30px 70px; }
.order-summary h1 { font-size: clamp(35px,4vw,51px); max-width: 18ch; }
.checkout-lead { margin: 20px 0 24px; color: var(--muted); max-width: 45ch; }
.checkout-book { display: grid; grid-template-columns: 145px 1fr; align-items: center; gap: 22px; padding-block: 10px 22px; }
.checkout-book img { width: 100%; height: auto; border-radius: 6px; }
.checkout-book h2 { font-size: 25px; }
.checkout-book p { font-size: 13px; color: var(--muted); margin-top: 8px; }
.checkout-book .checkout-price { font: 650 27px/1.25 system-ui,sans-serif; color: var(--ink); }
#checkout-includes { padding-left: 20px; margin: 4px 0 25px; }
#checkout-includes li + li { margin-top: 8px; }
.checkout-delivery { padding: 17px 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--tint); margin-bottom: 20px; font-size: 14px; }
.payment-panel { padding: clamp(16px,3vw,28px); background: white; border: 1px solid var(--line); border-radius: 12px; min-height: 240px; }
.payment-panel h2 { font: 650 18px/1.4 system-ui,sans-serif; margin-bottom: 20px; letter-spacing: normal; }
#checkout-status { color: var(--muted); margin-bottom: 16px; }
#stripe-checkout { min-height: 100px; }
.publisher-note { margin-top: 20px; }
.support-content { max-width: 760px; padding-block: 30px 70px; }
.support-content h1 { max-width: 20ch; font-size: 44px; margin-bottom: 28px; }
.support-content h2 { font-size: 27px; margin: 30px 0 12px; }
.support-content p { margin-bottom: 16px; color: var(--muted); }
.support-content a { display: inline-flex; align-items: center; min-height: 44px; }
@media(max-width:760px) { .checkout-layout { grid-template-columns: 1fr; gap: 25px; } .checkout-book { grid-template-columns: 115px 1fr; gap: 16px; } .order-summary { max-width: 650px; } }

#stripe-checkout:empty { min-height: 0; }

.checkout-book h1 { font-size: clamp(26px,3vw,38px); max-width: none; }
.checkout-book .eyebrow { font-size: 10px; line-height: 1.5; margin: 0 0 10px; }
#checkout-contents { margin-bottom: 20px; }
#checkout-contents summary { font-size: 14px; min-height: 48px; padding-block: 12px; }
#checkout-contents .checkout-lead { font-size: 14px; margin: 12px 0; padding: 0; }
#checkout-includes { font-size: 14px; }
@media(max-width:760px) {
 .checkout-layout { padding-top: 10px; }
 .checkout-book { grid-template-columns: 95px 1fr; padding-block: 0 18px; }
 .checkout-book h1 { font-size: 29px; }
 .checkout-book .eyebrow { font-size: 9px; margin-bottom: 7px; }
 .checkout-book p { font-size: 12px; }
 .checkout-delivery { padding: 12px 14px; font-size: 13px; margin-bottom: 8px; }
 #checkout-contents { margin-bottom: 12px; }
 .order-summary > .small { font-size: 11px; }
 .order-summary > .sample-link { font-size: 12px; padding-block: 7px; }
}

.merchant-note { color: var(--muted); margin: -10px 0 16px; font-size: 12px; }

/* The 3D book (public/book3d.mjs). --fit (set by the module) shrinks the
   spine title or back-cover copy when a language's text would not fit. Sizes are in container units of
   the stage: cover --w × --h (2:3) and thickness --d (0.2 of the width, for a
   visible, readable spine). --u is one pixel of the 1200 × 1800 cover artwork.
   The module mounts only where .book-display carries --book3d: 1 (this file). */
.book3d { container-type: inline-size; position: relative; width: 100%; max-width: 400px; margin-inline: auto; aspect-ratio: 100 / 136; touch-action: pan-y pinch-zoom; cursor: grab; -webkit-user-select: none; user-select: none; }
.book3d.is-dragging { cursor: grabbing; }
.book3d-scene { position: absolute; inset: 0; perspective: 330cqw; perspective-origin: 50% 46%; }
.book3d-shadow { position: absolute; left: 4cqw; top: 125cqw; width: 92cqw; height: 9cqw; background: radial-gradient(closest-side, #19232e59, #19232e00); }
.book3d-body { --w: 84cqw; --h: 126cqw; --d: 16.8cqw; --u: calc(var(--w) / 1200); position: absolute; left: 8cqw; top: 4cqw; width: var(--w); height: var(--h); transform-style: preserve-3d; transform: rotateX(-3deg) rotateY(26deg); will-change: transform; }
.book3d-face { position: absolute; left: 0; top: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.book3d-front,.book3d-back { width: var(--w); height: var(--h); overflow: hidden; background: #111; }
.book3d-front { transform: translateZ(calc(var(--d) / 2)); border-radius: 0 .5cqw .5cqw 0; }
.book3d-front img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.book3d-back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); border-radius: .5cqw 0 0 .5cqw; color: #fff; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
.book3d-spine { left: calc((var(--w) - var(--d)) / 2); width: var(--d); height: var(--h); transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); background: #111; color: #fff; overflow: hidden; }
.book3d-spine::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #00000038, #0000000d 45%, #00000026); }
.book3d-edge { background-color: #ebe5d9; }
.book3d-fore { left: calc((var(--w) - var(--d)) / 2 + .3cqw); top: .6cqw; width: calc(var(--d) - .6cqw); height: calc(var(--h) - 1.2cqw); transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - .4cqw)); background-image: repeating-linear-gradient(90deg, #0000000f 0 1px, #0000 1px 3px), linear-gradient(90deg, #d9d1c3, #f3eee5 50%, #d9d1c3); }
.book3d-top,.book3d-bottom { left: .1cqw; top: calc((var(--h) - var(--d)) / 2 + .3cqw); width: calc(var(--w) - .5cqw); height: calc(var(--d) - .6cqw); background-image: repeating-linear-gradient(0deg, #0000000f 0 1px, #0000 1px 3px), linear-gradient(0deg, #d9d1c3, #f3eee5 50%, #d9d1c3); }
.book3d-top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - .4cqw)); }
.book3d-bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2 - .4cqw)); }
.book3d-accent { color: #4dd9d0; }
.book3d-spine-title { position: absolute; left: 50%; top: calc(var(--u) * 100); transform: translateX(-50%); writing-mode: vertical-rl; font: 900 calc(var(--u) * 96 * var(--fit, 1))/1 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.01em; white-space: nowrap; }
/* The small TM sits on the white band, in the cover black. */
.book3d-spine-tm { position: absolute; z-index: 1; left: calc(50% - var(--u) * 70); top: calc(var(--u) * 1620); width: calc(var(--u) * 140); height: calc(var(--u) * 70); color: #111; }
.book3d-band { position: absolute; left: 0; right: 0; top: calc(var(--u) * 1602); height: calc(var(--u) * 106); background: #fff; }
.book3d-back-band { left: auto; width: calc(var(--u) * 560); clip-path: polygon(calc(var(--u) * 108) 0, 100% 0, 100% 100%, 0 100%); }
.book3d-back-copy { position: absolute; left: calc(var(--u) * 84); right: calc(var(--u) * 84); top: calc(var(--u) * 130); }
.book3d-headline { font: 900 calc(var(--u) * 90 * var(--fit, 1))/1.08 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.02em; margin-bottom: calc(var(--u) * 44); }
.book3d-blurb { font-size: calc(var(--u) * 54 * var(--fit, 1)); line-height: 1.38; color: #d5d8da; }
.book3d-blurb + .book3d-blurb { margin-top: calc(var(--u) * 22); }
.book3d-inside-title { margin-top: calc(var(--u) * 70); font-size: calc(var(--u) * 34 * var(--fit, 1)); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #4dd9d0; }
.book3d-inside { list-style: none; margin: calc(var(--u) * 22) 0 0; padding: 0; }
.book3d-inside li { position: relative; padding-left: calc(var(--u) * 46); font-size: calc(var(--u) * 52 * var(--fit, 1)); line-height: 1.32; font-weight: 600; }
.book3d-inside li + li { margin-top: calc(var(--u) * 16); }
.book3d-inside li::before { content: ''; position: absolute; left: 0; top: .42em; width: calc(var(--u) * 20); height: calc(var(--u) * 20); background: #4dd9d0; transform: skewX(-20deg); }
.book3d-quote { margin: calc(var(--u) * 50) 0 0; font-size: calc(var(--u) * 44 * var(--fit, 1)); font-style: italic; color: #d5d8da; }
.book3d-back-foot { position: absolute; left: calc(var(--u) * 87); top: calc(var(--u) * 1588); height: calc(var(--u) * 120); display: flex; align-items: baseline; gap: calc(var(--u) * 34); }
/* The TM's bottom (1588 + 120) is the band's bottom (1602 + 106); align-items: baseline puts the site's baseline there too (the SVG has no baseline, so its bottom is used). */
.book3d-back-tm { width: calc(var(--u) * 239); height: calc(var(--u) * 120); color: #fff; }
.book3d-site { line-height: 1; font-size: calc(var(--u) * 36); font-weight: 700; letter-spacing: .02em; color: #c9cdd0; }
.book3d-flip { display: flex; align-items: center; gap: 8px; margin: 10px auto 0; min-height: 44px; padding: 9px 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 650; cursor: pointer; }
.book3d-flip:hover { border-color: var(--ink); }
.book3d-flip svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s ease; }
.book3d-flip.is-back svg { transform: scaleX(-1); }
.has-book3d { padding-top: 0; }
.has-book3d figcaption { margin-top: 16px; }
@media(prefers-reduced-motion:reduce) { .book3d-flip svg { transition: none; } }
