/* Self-hosted and preloaded (see index.html). font-display: block, because swapping from
   a fallback face visibly reflowed the headings and the opening veil on first load. */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: block; src: url(/static/fonts/BarlowCondensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: block; src: url(/static/fonts/BarlowCondensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: block; src: url(/static/fonts/BarlowCondensed-800.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: block; src: url(/static/fonts/Barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: block; src: url(/static/fonts/Barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: block; src: url(/static/fonts/Barlow-600.woff2) format("woff2"); }

:root {
  --bone: #f2ead2;
  --charcoal: #15171b;
  --red: #e5503f;
  --red-hover: #d4432f;
  /* Brand red darkened just enough for white text to pass WCAG AA (4.87:1). */
  --red-btn: #cc3f2c;
  --muted: #9aa0ad;
  --soft: #d9d3c0;
  --line: rgba(242, 234, 210, .16);
  --glass: rgba(21, 23, 27, .52);
  --display: "Barlow Condensed", Bahnschrift, "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: Barlow, ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4.5vw, 72px);
  --top-h: clamp(68px, 11vh, 110px);
  --bot-h: clamp(72px, 11vh, 104px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(.95rem, .3vw + .85rem, 1.08rem);
  line-height: 1.55;
  color: var(--bone);
  background: var(--charcoal);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; margin: 0 0 .35em; }
h1 { font-size: clamp(3rem, 7.4vw, 6.75rem); font-weight: 800; max-width: 12ch; }
h2 { font-size: clamp(2rem, 4.2vw, 3.9rem); font-weight: 800; max-width: 20ch; }
h3 { font-size: clamp(1.15rem, 1.3vw, 1.45rem); font-weight: 700; margin-bottom: .3em; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* Stage */
.bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; opacity: 0; transition: opacity .9s ease; }
/* The incoming layer sits on top and fades in over the outgoing one. */
.bg.is-on { opacity: 1; z-index: -2; }
.shade {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(21, 23, 27, .93) 0%, rgba(21, 23, 27, .80) 38%, rgba(21, 23, 27, .42) 68%, rgba(21, 23, 27, .2) 100%),
    linear-gradient(0deg, rgba(21, 23, 27, .8) 0%, rgba(21, 23, 27, 0) 28%),
    linear-gradient(180deg, rgba(21, 23, 27, .7) 0%, rgba(21, 23, 27, 0) 20%);
}

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(16px, 3vh, 32px) var(--gutter);
}
/* The lockup's slogan needs ~60px of logo height to stay legible; phones swap to the plain wordmark (see <picture>). */
.brand img { height: clamp(48px, 7.4vh, 60px); width: auto; }
@media (max-width: 640px) { .brand img { height: clamp(34px, 4.4vh, 46px); } }
.brand-wrap { position: relative; }
/* padding-top bridges the gap under the logo so the pointer can reach the menu without it closing. */
.brand-menu {
  position: absolute; top: 100%; left: 0; padding-top: 10px;
  display: flex; flex-direction: column; min-width: 13rem;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s, transform .2s, visibility 0s .2s;
}
.brand-wrap:hover .brand-menu, .brand-wrap:focus-within .brand-menu {
  opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s;
}
.brand-menu a {
  display: block; padding: 10px 14px; text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--soft); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); transition: color .2s, background .2s;
}
.brand-menu a + a { border-top: 0; color: var(--muted); font-size: .85rem; }
.brand-menu a:hover, .brand-menu a:focus-visible { color: var(--bone); background: rgba(21, 23, 27, .8); }
.brand-menu a span { color: var(--red); }
/* Touch screens have no hover; they get the link in the footer instead. */
@media (hover: none) { .brand-menu { display: none; } }
.toc { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.toc a {
  font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .25s, border-color .25s;
}
.toc a span { color: var(--red); margin-right: 8px; font-weight: 700; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--bone); }
.toc a[aria-current="true"] { border-bottom-color: var(--red); }
.toc-toggle { display: none; }

.pages { position: relative; }
.page { padding: 120px var(--gutter) 120px; min-height: 100svh; display: flex; align-items: flex-start; }
.page-inner { margin: auto 0; }
.page-inner { width: 100%; max-width: 780px; }
.page-wide { max-width: 1080px; }

.eyebrow {
  font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--red); margin-bottom: 1rem;
}
.lead { font-size: clamp(1.02rem, .55vw + .85rem, 1.3rem); color: var(--soft); max-width: 58ch; margin-bottom: 1.6rem; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85em 1.5em; border-radius: 4px; border: 2px solid transparent;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-red { background: var(--red-btn); color: #fff; }
.btn-red:hover { background: var(--red-hover); }
.btn-ghost { border-color: rgba(242, 234, 210, .45); color: var(--bone); }
.btn-ghost:hover { border-color: var(--bone); }
.btn-lg { font-size: clamp(1.05rem, 2.4vw, 1.5rem); text-transform: none; letter-spacing: .01em; word-break: break-all; }

/* Chapter content */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare-col { border-radius: 6px; padding: 20px 24px 18px; }
.compare-col h3 { text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; margin-bottom: .8em; }
.compare-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.compare-col li { position: relative; padding-left: 22px; line-height: 1.4; }
.compare-before { border: 1px dashed rgba(154, 160, 173, .45); color: var(--muted); }
.compare-before h3 { color: var(--muted); }
.compare-before li::before { content: "×"; position: absolute; left: 1px; top: -.05em; font-weight: 700; }
.compare-after { background: var(--glass); border: 1px solid var(--red); backdrop-filter: blur(8px); }
.compare-after li::before { content: ""; position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.item { border-top: 2px solid var(--red); padding-top: 14px; }
.item p { color: var(--soft); font-size: .95em; line-height: 1.45; margin: 0; }
.num { display: block; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: .08em; color: var(--red); margin-bottom: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; display: flex; align-items: baseline; gap: 10px; backdrop-filter: blur(8px); }
.stat b { font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; }
.stat b small { font-size: .5em; color: var(--muted); margin-left: 2px; }
.stat span { color: var(--muted); font-size: .85rem; line-height: 1.25; }

.steps { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.steps li { padding: 16px 22px 0 0; border-top: 2px solid var(--line); }
.steps li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.steps li:first-child { border-top-color: var(--red); }
.steps p { color: var(--soft); margin: 0; font-size: .95em; line-height: 1.45; }

.legal { margin-top: 2.2rem; font-size: .8rem; color: var(--muted); max-width: 60ch; }

/* Bottom bar */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(14px, 2.6vh, 28px) var(--gutter);
  padding-bottom: max(clamp(14px, 2.6vh, 28px), env(safe-area-inset-bottom));
}
.pager { display: none; align-items: center; gap: 14px; }
.pager-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(242, 234, 210, .35); background: var(--glass); color: var(--bone);
  font-size: 1.2rem; cursor: pointer; backdrop-filter: blur(6px); transition: border-color .2s, background .2s, opacity .2s;
}
.pager-btn:hover { border-color: var(--bone); }
.pager-next { background: var(--red-btn); border-color: var(--red-btn); }
.pager-next:hover { background: var(--red-hover); border-color: var(--red-hover); }
.pager-btn:disabled { opacity: .3; cursor: default; }
.pager-count { font-family: var(--display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-size: .95rem; }
.pager-count b { color: var(--bone); font-size: 1.15rem; }
.pager-count span { margin-left: 8px; color: var(--soft); }
.slogan { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: .04em; color: var(--muted); }

.sound-toggle {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  background: var(--glass); border: 1px solid rgba(242, 234, 210, .3); color: var(--bone);
  font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; backdrop-filter: blur(6px); transition: border-color .2s;
}
.sound-toggle:hover { border-color: var(--bone); }
.sound-toggle[hidden] { display: none; }
.sound-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.sound-bars i { display: block; width: 3px; height: 4px; background: var(--muted); border-radius: 1px; }
.sound-toggle[aria-pressed="true"] .sound-bars i { background: var(--red); animation: bar 1s ease-in-out infinite; }
.sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: .2s; }
.sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: .4s; }
@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ---- Book mode: one screen, chapters replace each other (JS on) ---- */
.js, .js body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.js .pages { position: fixed; inset: 0; }
.js .page {
  /* The chapter lives strictly between the header and the pager, so nothing ever slides under the logo. */
  position: absolute; top: var(--top-h); bottom: var(--bot-h); left: 0; right: 0; min-height: 0;
  padding-top: 12px; padding-bottom: 12px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  visibility: hidden; opacity: 0; transition: opacity .35s ease, visibility 0s linear .35s;
}
.js .page::-webkit-scrollbar { display: none; }
.js .page.is-active { visibility: visible; opacity: 1; transition: opacity .35s ease; }
.js .pager { display: flex; }

/* Words reveal one after another, like ink settling onto the page. */
.js .w { opacity: 0; }
.js span.w { display: inline-block; }
.js .page.is-active .w { animation: ink .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0ms); }
.js .box { opacity: 0; }
.js .page.is-active .box { animation: fade .6s ease both; animation-delay: var(--d, 0ms); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ink {
  from { opacity: 0; transform: translateY(.38em); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 1100px) {
  .grid4 { grid-template-columns: 1fr 1fr; gap: 18px 22px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 900px) {
  .toc-toggle {
    display: inline-flex; padding: 9px 14px; border-radius: 999px; cursor: pointer;
    background: var(--glass); border: 1px solid rgba(242, 234, 210, .35); color: var(--bone); backdrop-filter: blur(6px);
    font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .1em; text-transform: uppercase;
  }
  .toc {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px;
    padding: 0 var(--gutter); background: rgba(21, 23, 27, .94); backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s linear .3s;
  }
  .toc a { font-size: 1.9rem; font-weight: 700; color: var(--bone); }
  .top.toc-open .toc { opacity: 1; visibility: visible; transition: opacity .3s; }
  .slogan { display: none; }
  .compare { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: .9rem; }
  .page { padding-top: 84px; padding-bottom: 84px; }
  h1 { font-size: clamp(2.6rem, 12vw, 3.4rem); }
  h2 { font-size: clamp(1.6rem, 7.4vw, 2.1rem); }
  .eyebrow { font-size: .78rem; margin-bottom: .6rem; }
  .lead { font-size: .95rem; margin-bottom: 1rem; line-height: 1.45; }
  .page-wide .lead { display: none; }
  .grid4, .stats, .steps { grid-template-columns: 1fr; gap: 10px; }
  .item { padding-top: 8px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; }
  .item .num { grid-row: span 2; margin: 2px 0 0; }
  .item h3 { font-size: 1.05rem; margin-bottom: .15em; }
  .item p { font-size: .85rem; line-height: 1.35; }
  .compare { gap: 10px; }
  .compare-col { padding: 12px 14px; }
  .compare-col h3 { font-size: .9rem; margin-bottom: .5em; }
  .compare-col ul { gap: 5px; }
  .compare-col li { font-size: .85rem; line-height: 1.3; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .stat { padding: 8px 10px; gap: 6px; }
  .stat b { font-size: 1.5rem; }
  .stat span { font-size: .72rem; }
  .steps li, .steps li + li { padding: 8px 0 0; border-left: 0; }
  .steps h3 { font-size: 1.05rem; }
  .steps p { font-size: .85rem; line-height: 1.35; }
  .btn { font-size: 1rem; padding: .75em 1.2em; }
  .legal { margin-top: 1.4rem; }
  .pager-count span { display: none; }
  .shade { background: linear-gradient(0deg, rgba(21, 23, 27, .92) 0%, rgba(21, 23, 27, .78) 55%, rgba(21, 23, 27, .6) 100%); }
}
@media (max-height: 760px) and (min-width: 641px) {
  h2 { font-size: clamp(1.8rem, 3.4vw, 3rem); }
  .lead { margin-bottom: 1.1rem; }
  .page { padding-top: 96px; padding-bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .bg { display: none; }
  body { background: var(--charcoal) url("/static/video/hero-poster.jpg") center / cover no-repeat fixed; }
  .js .w, .js .page.is-active .w { animation: none; opacity: 1; }
  .js .page { transition: none; }
  .sound-toggle[aria-pressed="true"] .sound-bars i { animation: none; height: 10px; }
}

/* Short screens (small phones, landscape laptops): tighten so each chapter still fits. */
@media (max-height: 760px) and (min-width: 641px) {
  .stats { margin-top: 14px; }
  .stat { padding: 8px 14px; }
  .grid4 { gap: 12px; }
}
@media (max-width: 640px) and (max-height: 720px) {
  .page { padding-top: 72px; padding-bottom: 76px; }
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.45rem; }
  .eyebrow { margin-bottom: .4rem; }
  .item p, .steps p, .compare-col li { font-size: .78rem; }
  .compare-col li:nth-child(n+5) { display: none; }
  .grid4, .steps { gap: 6px; }
  .steps li, .steps li + li { padding-top: 6px; }
  .stat span { font-size: .68rem; }
}
@media (max-width: 640px) { .item:not(:has(.num)) { display: block; } }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 16px; border-radius: 4px;
  background: var(--red-btn); color: #fff; font-weight: 600; text-decoration: none;
  transform: translateY(-200%); transition: transform .2s;
}
.skip:focus { transform: none; }
.pages:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sound-toggle.is-waiting { border-color: var(--red); animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 80, 63, .0); } 50% { box-shadow: 0 0 0 6px rgba(229, 80, 63, .22); } }
@media (prefers-reduced-motion: reduce) { .sound-toggle.is-waiting { animation: none; } }

/* First visit: browsers block sound until a click or key press, so the book opens on one. */
.veil {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 0 16px; text-align: center;
  background: radial-gradient(ellipse at center, rgba(21, 23, 27, .45), rgba(21, 23, 27, .82) 70%);
  transition: opacity .7s ease;
}
.veil[hidden] { display: none; }
.veil.is-lifting { opacity: 0; pointer-events: none; }
.veiled .pages { opacity: 0; pointer-events: none; }
.veil-open {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 44px; border-radius: 6px; cursor: pointer;
  background: var(--glass); border: 1px solid rgba(242, 234, 210, .45); color: var(--bone);
  backdrop-filter: blur(6px); animation: nudge 2.4s ease-in-out infinite; transition: border-color .2s, transform .2s;
}
.veil-open:hover { border-color: var(--bone); transform: translateY(-1px); }
.veil-open .sound-bars i { background: var(--red); animation: bar 1s ease-in-out infinite; }
.veil-open .sound-bars i:nth-child(2) { animation-delay: .2s; }
.veil-open .sound-bars i:nth-child(3) { animation-delay: .4s; }
.veil-title { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1; letter-spacing: .01em; }
.veil-sub { font-family: var(--display); font-weight: 600; font-size: .95rem; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.veil-quiet {
  background: none; border: 0; padding: 8px 12px; cursor: pointer; color: var(--muted);
  font: inherit; font-size: .95rem; text-decoration: underline; text-underline-offset: 4px;
}
.veil-quiet:hover { color: var(--bone); }
@media (prefers-reduced-motion: reduce) {
  .veil-open, .veil-open .sound-bars i { animation: none; }
  .veil-open .sound-bars i { height: 10px; }
}

/* ---- Write your next chapter ---- */
.chapter-open {
  display: none; align-items: center; gap: 10px; padding: 11px 20px; border-radius: 999px; cursor: pointer;
  background: var(--red-btn); border: 1px solid var(--red-btn); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: .98rem; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 6px 24px rgba(229, 80, 63, .28); transition: background .2s, transform .2s;
}
.js .chapter-open { display: inline-flex; }
.chapter-open:hover { background: var(--red-hover); transform: translateY(-1px); }
.chapter-quill { font-size: 1.1rem; line-height: 1; }
.co-short { display: none; }

.chapter {
  width: min(720px, calc(100vw - 32px)); max-height: min(86vh, 860px); padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line); border-radius: 14px; color: var(--bone);
  background: rgba(21, 23, 27, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); overflow: auto;
}
.chapter::backdrop { background: rgba(10, 11, 13, .62); backdrop-filter: blur(3px); }
.chapter[open] { animation: chapter-in .35s ease; }
@keyframes chapter-in { from { opacity: 0; transform: translateY(12px); } }
.chapter-close {
  position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--soft); font-size: 1.5rem; line-height: 1;
}
.chapter-close:hover { color: var(--bone); border-color: var(--bone); }
.chapter h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .3em; }
.chapter-intro { color: var(--soft); margin-bottom: 1.2rem; }
.chapter-form label { display: block; margin-bottom: 14px; font-family: var(--display); font-weight: 600; letter-spacing: .03em; font-size: 1.05rem; }
.chapter-form .opt { color: var(--muted); font-weight: 500; }
.chapter-form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; resize: vertical; min-height: 56px;
  font: inherit; font-family: var(--body); font-size: 1rem; line-height: 1.45; color: var(--bone);
  background: rgba(242, 234, 210, .06); border: 1px solid rgba(242, 234, 210, .22); border-radius: 8px;
}
.chapter-form textarea::placeholder { color: rgba(154, 160, 173, .75); }
.chapter-form textarea:focus { outline: none; border-color: var(--red); background: rgba(242, 234, 210, .09); }
.chapter-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.chapter-actions .btn { cursor: pointer; font: inherit; font-family: var(--display); }
.chapter-actions button.btn-ghost { background: transparent; }
.chapter-actions .btn .sound-bars { margin-right: 6px; vertical-align: -1px; }
.chapter-note { margin: 14px 0 0; font-size: .8rem; color: var(--muted); }

.chapter-text h3 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 800; margin: 0 0 .6em; padding-right: 40px; }
.chapter-text p { color: var(--soft); font-size: 1.08rem; line-height: 1.6; }
.chapter-text h4 {
  font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--red); margin: 1.6em 0 .8em; padding-top: 1.2em; border-top: 1px solid var(--line);
}
.chapter-text ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.chapter-text li { padding-left: 18px; position: relative; color: var(--soft); line-height: 1.5; }
.chapter-text li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--red); border-radius: 2px; }
.chapter-text li b { color: var(--bone); }
.chapter-text .nw { animation: word-in .5s ease both; }
@keyframes word-in { from { opacity: 0; filter: blur(3px); } }
.chapter-status { color: var(--muted); font-family: var(--display); letter-spacing: .06em; margin: 1em 0 0; }
.chapter-status:empty { display: none; }
.chapter-status.is-writing::after { content: "▍"; color: var(--red); margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chapter [hidden] { display: none !important; }
.chapter-text h5 {
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; color: var(--bone);
  margin: 1.4em 0 .5em;
}
.chapter-text h4 + h5 { margin-top: 0; }
.estimate { margin-top: 1.6em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.estimate table { width: 100%; border-collapse: collapse; font-size: .95rem; color: var(--soft); }
.estimate th, .estimate td { text-align: left; padding: 8px 6px; border-bottom: 1px solid rgba(242, 234, 210, .12); vertical-align: top; }
.estimate thead th { font-family: var(--display); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.estimate tfoot th { color: var(--bone); border-bottom: 0; border-top: 1px solid rgba(242, 234, 210, .4); }
.estimate .est-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.estimate td b { display: block; color: var(--bone); font-weight: 600; }
.estimate td small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; margin-top: 2px; }
.estimate ol { color: var(--soft); padding-left: 1.2em; margin: 0; display: grid; gap: 6px; }
.estimate ol li { padding-left: 4px; }
.estimate ol li::before { content: none; }
.chapter-form input:not([type="checkbox"]), .chapter-form textarea { box-sizing: border-box; max-width: 100%; }
.chapter { overflow-x: hidden; }
.est-note { font-size: .88rem !important; color: var(--muted) !important; margin: .6em 0 0; }
.enquiry { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.enquiry h4 { font-family: var(--display); font-size: 1.4rem; margin: 0 0 .3em; }
.enquiry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.chapter-hint { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 14px; }
.attach-btn { display: inline-flex !important; margin: 0 !important; cursor: pointer; border: 1px dashed var(--line); border-radius: 6px; padding: 8px 14px; font-size: .95rem; color: var(--bone); }
.attach-btn:hover, .attach-btn:focus-within { border-color: var(--red); }
.attach-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attach-list { list-style: none; padding: 0; margin: 0; width: 100%; display: grid; gap: 4px; }
.attach-list:empty { display: none; }
.attach-list li { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; color: var(--soft); background: rgba(242, 234, 210, .05); border-radius: 6px; padding: 6px 10px; }
.attach-list button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.attach-list button:hover { color: var(--red); }
.attach-list .bad { color: var(--red); }
fieldset.enquiry-grid { border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
fieldset.enquiry-grid legend { font-family: var(--display); font-weight: 700; font-size: .85rem; letter-spacing: .16em; text-transform: uppercase; color: var(--red); padding: 0; margin-bottom: 10px; }
.enquiry-grid .wide { grid-column: 1 / -1; }
.chapter-form label.check + label.check { margin-top: -4px; }
#chapter-done .enquiry { margin-top: 20px; padding-top: 16px; }
.chapter-form input:not([type="checkbox"]) {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-family: var(--body); font-weight: 400; letter-spacing: 0; color: var(--bone);
  background: rgba(242, 234, 210, .06); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
}
.chapter-form input:focus { outline: none; border-color: var(--red); background: rgba(242, 234, 210, .09); }
.chapter-form label.check { display: flex; gap: 10px; align-items: flex-start; font-family: var(--body); font-weight: 400; font-size: .9rem; letter-spacing: 0; color: var(--soft); }
.chapter-form label.check input { margin-top: 4px; accent-color: var(--red); }
.chapter-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.enquiry-done { color: var(--bone); font-size: 1.05rem; }
@media (max-width: 640px) { .enquiry-grid { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  .chapter-open { padding: 10px 14px; font-size: .85rem; letter-spacing: .06em; }
  .co-long { display: none; }
  .co-short { display: inline; }
  .chapter { max-height: 92vh; }
}
@media (prefers-reduced-motion: reduce) {
  .chapter-text .nw, .chapter[open] { animation: none; }
}

/* Loader: an open book whose lines write themselves while a page turns. */
.quill { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 0 10px; }
.quill svg { width: min(220px, 60vw); height: auto; overflow: visible; }
.q-page { fill: rgba(242, 234, 210, .07); stroke: rgba(242, 234, 210, .55); stroke-width: 1.2; stroke-linejoin: round; }
.q-spine { stroke: rgba(242, 234, 210, .55); stroke-width: 1.2; }
.q-lines path { stroke: var(--bone); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: q-write 4s ease-in-out infinite; }
.q-lines path:nth-child(2) { animation-delay: .5s; }
.q-lines path:nth-child(3) { animation-delay: 1s; }
.q-lines path:nth-child(4) { animation-delay: 1.5s; }
.q-lines path:nth-child(5) { animation-delay: 2s; }
@keyframes q-write { 0% { stroke-dashoffset: 40; opacity: 1; } 12%, 78% { stroke-dashoffset: 0; opacity: 1; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
/* The nib travels along each line as it is written. */
.q-nib { fill: var(--red); animation: q-nib 4s ease-in-out infinite; }
@keyframes q-nib {
  0% { transform: translate(0, 0); } 12% { transform: translate(35px, 0); }
  12.5% { transform: translate(0, 8px); } 24.5% { transform: translate(33px, 8px); }
  25% { transform: translate(0, 16px); } 37% { transform: translate(36px, 16px); }
  37.5% { transform: translate(0, 24px); } 49.5% { transform: translate(31px, 24px); }
  50% { transform: translate(0, 32px); } 62% { transform: translate(23px, 32px); }
  78% { transform: translate(23px, 32px); opacity: 1; } 90%, 100% { transform: translate(23px, 32px); opacity: 0; }
}
/* When the page is full it turns over to a fresh one. */
.q-turn { fill: #1d2025; stroke: rgba(242, 234, 210, .55); stroke-width: 1.2; transform-box: view-box; transform-origin: 60px 0; transform: scaleX(1); opacity: 0; animation: q-turn 4s ease-in-out infinite; }
@keyframes q-turn { 0%, 80% { transform: scaleX(1); opacity: 0; } 81% { opacity: 1; } 96% { transform: scaleX(-1); opacity: 1; } 100% { transform: scaleX(-1); opacity: 0; } }
.quill-step { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .95rem; color: var(--soft); text-align: center; transition: opacity .3s; }
.quill-step.is-swap { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .q-lines path { animation: none; stroke-dashoffset: 0; }
  .q-nib, .q-turn { animation: none; opacity: 0; }
}
