/* ==========================================================================
   Hearthtold — the app's own look on the shared kit (/apps/kit/kit.css).

   Best China: the china blue of the best china on the dresser is where her
   voice is; her words sit on a white page like the china's glaze. Display
   type is Baskerville SemiBold (installed on every iPhone and Mac, local()
   only); the printed book's pages are EB Garamond, as the app's PDF is.
   Tokens from Docs/design/design-system.md in the app's repo.
   ========================================================================== */

@font-face { font-family: "HT Garamond"; src: url("/apps/hearthtold/fonts/EBGaramond-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "HT Garamond"; src: url("/apps/hearthtold/fonts/EBGaramond-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "HT Garamond"; src: url("/apps/hearthtold/fonts/EBGaramond-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }

body.k-page.k-hearthtold {
  --k-bg: #FFFFFF;
  --k-bg-2: #E9EEF6;            /* accent fill: the pale china */
  --k-ink: #1C1C1E;             /* page text */
  --k-ink-2: #4E4E54;           /* 7.4:1 on the pale china */
  --k-accent: #354F7E;          /* china blue */
  --k-accent-ink: #FFFFFF;
  --k-card: #FFFFFF;
  --k-line: rgba(28, 28, 30, .12);
  --k-display: Baskerville, "Baskerville Old Face", "Libre Baskerville", Georgia, "Times New Roman", serif;
  --k-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  --ht-ground: #354F7E;         /* the china-blue field */
  --ht-night: #141D30;          /* the blue at night */
  --ht-night-2: #1E3256;        /* hero cards at night */
  --ht-g2: #E2EAF5;             /* ground-text-2: 6.7:1 on the ground */
  --ht-page2: #5C5C61;          /* the sentences not playing: 6.7:1 on white */
  --ht-rest: rgba(255, 255, 255, .45);
  --ht-orange: #FF9500;
  --ht-red: #FF3B30;
  --ht-paper: #FDFCF9;          /* a printed page */
  --ht-book: "HT Garamond", "EB Garamond", Garamond, Georgia, serif;
}
.k-hearthtold main :where(h1, h2, h3) { font-weight: 600; letter-spacing: -0.005em; }
.k-hearthtold .k-h2 { line-height: 1.06; }
.k-hearthtold .k-btn-primary { background: var(--ht-ground); color: #fff; }
.k-hearthtold .k-soon { cursor: default; }
.k-hearthtold .k-soon::before { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .28); }
.k-hearthtold .k-soon:hover { transform: none; }
.k-hearthtold .k-step-n::before { background: var(--ht-ground); }
.k-hearthtold .k-faq summary { font-family: var(--k-text); }
.k-hearthtold .k-pips i.is-on { background: var(--ht-ground); }
.ht-dark { --k-ink: #FFFFFF; --k-ink-2: var(--ht-g2); --k-line: rgba(255, 255, 255, .18); color: #fff; }
.ht-dark .k-body, .ht-dark .k-lead { color: var(--ht-g2); }

/* ---------- The hero: her chapter playing, and its page of the book filling ---------- */
.ht-hero { position: relative; overflow-x: clip; }
.ht-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); min-height: 100svh; }
.ht-hero-copy { align-self: center; padding: calc(var(--mx-header-h, 72px) + 40px) clamp(28px, 3.6vw, 64px) 48px max(var(--k-gutter), calc((100vw - var(--k-max)) / 2 + var(--k-gutter))); box-sizing: border-box; }
.k-hearthtold .ht-hero-copy > * + *, .k-hearthtold .ht-hero-head > * + *, .k-hearthtold .ht-hero-more > * + * { margin-top: clamp(14px, 2.4svh, 24px); }
.k-hearthtold .ht-hero-head > .k-h1 { margin-top: clamp(18px, 3svh, 30px); }
.ht-hero .k-h1 { font-size: clamp(40px, min(4.8vw, 8.4svh), 76px); line-height: 1.03; max-width: 12.5ch; }
.ht-promise { font-size: clamp(18px, min(1.5vw, 2.6svh), 22px); line-height: 1.4; color: var(--k-ink); max-width: 30em; }
.ht-hero .k-lead { font-size: clamp(16px, min(1.25vw, 2.2svh), 19px); max-width: 34em; }
.ht-price { font-size: 16px; line-height: 1.5; color: var(--k-ink-2); max-width: 34em; }
.ht-price b { color: var(--k-ink); font-weight: 600; }
.ht-hero .k-actions { flex-wrap: nowrap; }
.ht-hero .k-btn { padding: 0 18px; font-size: 16px; white-space: nowrap; }
.ht-hero .k-meta { font-size: 14px; }
@media (min-width: 900px) and (max-width: 1239px) { .ht-hero .ht-long { display: none; } }

/* The stage: the pale china, holding the chapter as one whole card, page 7 of her book overlapping
   it, and a print. Her voice is the card's strongest graphic; the page fills as she plays. */
.ht-stage { position: relative; margin-top: var(--mx-header-h, 72px); background: var(--k-bg-2); overflow: hidden; min-height: 540px; }
/* Behind the site's nav too, so no white strip shows when the nav slides away over the pinned hero */
@media (min-width: 900px) { .ht-stage { box-shadow: 0 calc(-1 * var(--mx-header-h, 72px)) 0 var(--k-bg-2); } }
.ht-chap { position: absolute; left: 3%; top: 50%; transform: translateY(-52%); width: min(57%, 440px); display: flex; flex-direction: column;
  padding: clamp(20px, 3.2svh, 32px) clamp(20px, 2.2vw, 30px) 0; box-sizing: border-box; background: var(--ht-ground); color: #fff; border-radius: 30px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(20, 29, 48, .12), 0 40px 80px -36px rgba(20, 29, 48, .55); }
.ht-byline { font-size: clamp(13px, 1vw, 15px); color: var(--ht-g2); }
.ht-title { margin-top: 6px !important; font-family: var(--k-display); font-weight: 600; font-size: clamp(30px, min(2.9vw, 5.6svh), 46px); line-height: 1.04; color: #fff; letter-spacing: -0.005em; }
.ht-facts { margin-top: 8px !important; font-size: clamp(13px, 1vw, 15px); line-height: 1.45; color: var(--ht-g2); }
.ht-player { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'disc times' 'parts parts'; align-items: center; column-gap: clamp(12px, 1.2vw, 16px); row-gap: 8px; margin-top: clamp(16px, 2.8svh, 26px) !important; }
.ht-player .ht-disc { grid-area: disc; }
.ht-player .ht-track { display: contents; }
.ht-player .ht-times { grid-area: times; }
.ht-player .ht-parts { grid-area: parts; }
.ht-disc { flex: none; width: clamp(48px, 3.8vw, 58px); aspect-ratio: 1; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.ht-disc svg { width: 32%; height: auto; }
.ht-track { position: relative; flex: 1; min-width: 0; }
.ht-times { display: flex; justify-content: space-between; font-size: clamp(13px, 1vw, 15px); color: var(--ht-g2); font-variant-numeric: tabular-nums; }
.ht-times b { color: #fff; font-weight: 600; }
.ht-parts { position: relative; height: 30px; margin-top: 0; }
.ht-part { position: absolute; top: 10px; height: 10px; border-radius: 5px; background: var(--ht-rest); overflow: hidden; transform-origin: 50% 50%; transition: transform .2s ease; }
.ht-part i { position: absolute; inset: 0; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
.ht-part.is-done i { transform: scaleX(1); }
.ht-part.is-on { transform: scaleY(2); }
.ht-knobway { position: absolute; left: 0; right: 0; top: 2px; height: 26px; pointer-events: none; will-change: transform; }
.ht-knob { position: absolute; top: 0; left: 0; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
/* Her words: a window of about three sentences around the one playing */
.ht-page { position: relative; height: clamp(150px, 26svh, 230px); margin: clamp(16px, 2.6svh, 24px) clamp(-12px, -.9vw, -8px) 0; background: #fff; border-radius: 22px 22px 0 0; overflow: hidden; color: var(--k-ink); }
.ht-page::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 21px; z-index: 1; pointer-events: none; background: linear-gradient(#fff 17px, rgba(255, 255, 255, 0)); }
.ht-page-in { padding: clamp(16px, 2.4svh, 22px) clamp(18px, 1.8vw, 24px) 30px; will-change: transform; }
.ht-q { display: none; }
.ht-words { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.45; }
.ht-words p + p { margin-top: .7em !important; }
.ht-words span { color: var(--ht-page2); transition: color .25s ease; }
.ht-words span.is-on { color: var(--k-ink); }
/* Page 7 of her book, in front of the card's lower right; each sentence lands in china blue, then ink */
.ht-print-page { position: absolute; right: 3%; top: 50%; width: min(43%, 340px); aspect-ratio: 432 / 648; transform: translateY(-42%) rotate(2.5deg); container-type: inline-size; z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 36px 60px -30px rgba(20, 29, 48, .6); }
.ht-print-page .ht-tb span { transition: opacity .3s ease, color .6s ease; }
html.k-motion .ht-print-page .ht-tb span[data-i]:not(.is-set) { opacity: 0; }
.ht-print-page .ht-tb span.is-new { color: var(--ht-ground); }
.ht-print { position: absolute; left: 6%; bottom: clamp(14px, 3svh, 30px); width: clamp(110px, 9.5vw, 150px); transform: rotate(-4deg); background: #fff; padding: clamp(5px, .5vw, 8px); border-radius: 10px; z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18), 0 18px 36px -18px rgba(0, 0, 0, .45); }
.ht-print img { display: block; width: 100%; height: auto; border-radius: 3px; filter: sepia(.16); }
@media (min-width: 900px) and (max-height: 760px) { .ht-print { display: none; } }
/* On a wide screen: one still life seen straight on, everything at least --ht-air inside the stage.
   Page 7 top right; the chapter card lower left, in front of the page's blank lower half (never
   over a line of it); the shop print in the free corner above the card. */
@media (min-width: 900px) {
  .ht-stage { --ht-air: clamp(24px, 4.6%, 40px); --ht-pw: min(49%, 380px, calc((100svh - var(--mx-header-h, 72px) - 2 * var(--ht-air)) / 1.5)); }
  .ht-print-page { left: auto; right: var(--ht-air); top: var(--ht-air); width: var(--ht-pw); transform: rotate(2deg); }
  .ht-chap { left: var(--ht-air); top: auto; bottom: var(--ht-air); transform: none; width: min(52%, 400px); z-index: 3; padding: 22px 26px 0; }
  .ht-chap .ht-title { font-size: clamp(28px, min(2.45vw, 4.6svh), 36px); }
  .ht-chap .ht-facts { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ht-chap .ht-player { margin-top: 14px !important; }
  .ht-print { left: var(--ht-air); top: calc(var(--ht-air) + 8px); bottom: auto; width: clamp(130px, 11vw, 160px); transform: rotate(-4deg); z-index: 1; }
}
/* Her voice: parts 14 px, the playing one 26 px, standing proud of a small ringed knob */
.ht-parts { height: 30px; }
.ht-part { top: 8px; height: 14px; border-radius: 7px; }
.ht-part.is-on { transform: scaleY(1.857); }
.ht-knobway { top: 8px; height: 14px; }
.ht-knob { width: 14px; height: 14px; margin-left: -7px; box-shadow: 0 0 0 3px var(--ht-ground), 0 1px 6px rgba(0, 0, 0, .35); }
/* Her words: three whole lines, kept on a line grid (the second paragraph indented, as a book sets
   it), with a soft edge top and bottom */
.ht-chap .ht-page { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.45; height: calc(3 * 1.45em + 36px); flex: none; }
.ht-chap .ht-page-in { padding: 18px clamp(18px, 1.8vw, 24px); }
.ht-chap .ht-words { font-size: 1em; line-height: inherit; }
.ht-chap .ht-words p + p { margin-top: 0 !important; text-indent: 1.4em; }
.ht-page::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; z-index: 1; pointer-events: none; background: linear-gradient(rgba(255, 255, 255, 0), #fff 5px); }
/* Pinned while it plays, in a window tall enough for all of it (Kit.pinHero). */
@media (min-width: 900px) and (min-height: 820px) {
  html.k-motion .ht-hero { height: 210svh; }
  html.k-motion .ht-hero-pin { position: sticky; top: 0; height: 100svh; }
  html.k-motion .ht-hero-grid { height: 100svh; min-height: 0; }
  .k-hearthtold .ht-hero-more > * + * { margin-top: clamp(10px, 1.6svh, 18px); }
}
@media (min-width: 900px) { .ht-stage { height: calc(100svh - var(--mx-header-h, 72px)); } }

/* On a phone: the name, the headline and the promise, then the card full width, then the rest. */
@media (max-width: 899px) {
  .ht-hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .ht-hero-copy { display: contents; }
  .ht-hero-head { order: 1; padding: calc(var(--mx-header-h, 60px) + 24px) var(--k-gutter) 20px; }
  .ht-stage { order: 2; margin-top: 0; height: min(500px, 72svh); min-height: 420px; }
  .ht-hero-more { order: 3; padding: 28px var(--k-gutter) 56px; }
  .ht-hero .k-h1 { font-size: clamp(34px, 9.6vw, 44px); max-width: none; }
  .k-hearthtold .ht-hero-head > .k-h1 { margin-top: 14px; }
  .k-hearthtold .ht-hero-head > .ht-promise { margin-top: 10px; font-size: 17px; }
  .ht-hero .k-lockup img { width: 48px; height: 48px; border-radius: 11px; }
  .ht-chap { left: 14px; right: 14px; width: auto; top: 16px; bottom: 0; transform: none; max-height: none; border-radius: 26px 26px 0 0; padding: 20px 18px 0; }
  .ht-title { font-size: clamp(26px, 7.4vw, 32px); padding-right: 28%; }
  .ht-byline { padding-right: 28%; }
  .ht-parts { height: 24px; }
  .ht-part { top: 6px; height: 12px; border-radius: 6px; }
  .ht-part.is-on { transform: scaleY(1.75); }
  .ht-knobway { top: 6px; height: 12px; }
  .ht-knob { width: 12px; height: 12px; margin-left: -6px; }
  .ht-page { margin: 16px -6px 0; border-radius: 20px 20px 0 0; }
  .ht-page-in { padding: 16px 16px 24px; }
  .ht-print { display: none; }
  .ht-print-page { right: 14px; top: 6px; width: 100px; transform: rotate(3deg); }
  .ht-chap { top: 22px; }
  .ht-chap .ht-page { height: auto; flex: 1 1 auto; min-height: 150px; font-size: 17px; }
  .ht-hero .k-actions { flex-wrap: wrap; }
}

@media (max-width: 399px) { .ht-facts { padding-right: 28%; } }

/* ---------- Chapter 1: at the table ---------- */
.ht-table { position: relative; width: 100%; max-width: 720px; height: min(640px, calc(100svh - 150px)); min-height: 520px; border-radius: 30px; background: var(--ht-ground); overflow: hidden; }
.ht-cup { position: absolute; width: 34%; max-width: 230px; aspect-ratio: 1; }
.ht-cup--a { left: -6%; top: -8%; }
.ht-cup--b { right: -9%; bottom: -12%; }
.ht-table .k-device { position: absolute; left: 4%; top: 50%; --k-device-w: min(260px, calc((100svh - 230px) * .46)); transform: translateY(-50%) rotate(-6deg); }
/* The Recording screen, drawn from the app's own layout (720 × 1564 capture: 1cqw = 7.2 of its pixels),
   so it can keep time with the transcript beside it. */
.ht-rs { container-type: inline-size; background: var(--ht-ground); color: #fff; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
.ht-rs > * { position: absolute; }
.ht-rs-bar { top: 5.2cqw; left: 15cqw; right: 9cqw; display: flex; justify-content: space-between; align-items: center; font-size: 4.3cqw; line-height: 1; }
.ht-rs-bar b { font-weight: 600; }
.ht-rs-bar i { width: 7.4cqw; height: 3.4cqw; border-radius: 1.1cqw; background: #fff; }
.ht-rs-ind { top: 16cqw; left: 3.6cqw; height: 9.7cqw; padding: 0 4.2cqw; display: flex; align-items: center; border-radius: 99px; background: #fff; color: #1C1C1E; font-size: 3.9cqw; font-weight: 600; white-space: nowrap; transition: background-color .2s ease; }
.ht-rs-on { display: flex; align-items: center; gap: 2.4cqw; }
.ht-rs-on i { width: 3cqw; height: 3cqw; border-radius: 50%; background: #FF3B30; }
.ht-rs-on em { font-style: normal; font-weight: 500; color: #6E6E73; font-variant-numeric: tabular-nums; }
.ht-rs-off { display: none; align-items: center; gap: 1.8cqw; }
.ht-rs-off svg { width: 3.8cqw; height: 3.8cqw; }
.ht-rs-q { top: 31.4cqw; left: 3.6cqw; right: 3.6cqw; padding: 3.6cqw 3.8cqw 4.4cqw; border-radius: 5cqw; background: #fff; color: #1C1C1E; }
.ht-rs-q small { display: flex; justify-content: space-between; font-size: 2.8cqw; color: #6E6E73; }
.ht-rs-q p { margin: 1.6cqw 0 0; font-family: var(--k-display); font-weight: 700; font-size: 7.2cqw; line-height: 1.2; }
.ht-rs-ask { top: 149cqw; left: 3.6cqw; right: 3.6cqw; height: 29cqw; border-radius: 5cqw; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 4.2cqw; font-weight: 600; transition: background-color .15s ease, opacity .2s ease; }
.ht-rs-ask > span { grid-area: 1 / 1; }
.ht-rs-held { visibility: hidden; color: var(--ht-ground); }
.ht-rs-ctl { top: 183.6cqw; left: 1.5cqw; right: 1.5cqw; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.ht-rs-ctl > span { display: flex; flex-direction: column; align-items: center; }
.ht-rs-c { width: 14.4cqw; height: 14.4cqw; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); transition: background-color .2s ease; }
.ht-rs-c > * { grid-area: 1 / 1; }
.ht-rs-c svg { width: 6cqw; height: 6cqw; }
.ht-rs-ctl small { margin-top: 2.6cqw; font-size: 3cqw; line-height: 1.2; max-width: 22cqw; }
.ht-rs-l2, .ht-rs-mic { display: none; }
.ht-rs-c.ht-rs-stop { background: #fff; box-shadow: none; }
.ht-rs-stop b { width: 4.4cqw; height: 4.4cqw; border-radius: .7cqw; background: #FF3B30; }
.ht-rs.is-asking .ht-rs-ask { background: #fff; }
.ht-rs.is-asking .ht-rs-idle { visibility: hidden; }
.ht-rs.is-asking .ht-rs-held { visibility: visible; }
.ht-rs.is-off .ht-rs-ind { background: #FF9500; }
.ht-rs.is-off .ht-rs-on { display: none; }
.ht-rs.is-off .ht-rs-off { display: flex; }
.ht-rs.is-off .ht-rs-ask { opacity: .4; }
.ht-rs.is-off .ht-rs-ctl > span:first-child .ht-rs-c { background: #fff; color: var(--ht-ground); }
.ht-rs.is-off .ht-rs-mic, .ht-rs.is-off .ht-rs-l2 { display: block; }
.ht-rs.is-off .ht-rs-mic-off, .ht-rs.is-off .ht-rs-l1 { display: none; }
.ht-card { position: absolute; right: 5%; top: 50%; transform: translateY(-50%); width: 47%; max-width: 330px; background: #fff; border-radius: 22px; padding: 20px 20px 18px; box-sizing: border-box; color: var(--k-ink); box-shadow: 0 30px 60px -32px rgba(0, 0, 0, .6); }
.ht-card-title { font: 600 15px/1.3 var(--k-text); }
.ht-card-note { font-size: 12px; color: #6E6E73; margin-top: 2px !important; }
.ht-win { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px); mask-image: linear-gradient(to bottom, transparent 0, #000 16px); position: relative; height: clamp(260px, calc(100svh - 470px), 340px); overflow: hidden; margin-top: 12px; }
html:not(.k-motion) .ht-win { height: auto; }
html:not(.k-motion) .ht-lines li:nth-child(-n+7) { display: none; }
.ht-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.38; }
.ht-lines li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px; }
.ht-lines time { color: #8A8A8E; font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 1px; }
.ht-lines .is-you span { font-style: italic; color: #6E6E73; }
.ht-lines .is-off span { color: #1C1C1E; font-weight: 600; }
.ht-lines .is-off time svg { width: 16px; height: 16px; color: #C46A00; }
@media (max-width: 899px) {
  .ht-table { background: none; height: auto; min-height: 0; overflow: visible; border-radius: 0; }
  .ht-cup, .ht-card { display: none; }
  .ht-table .k-device { position: relative; left: auto; top: auto; transform: none; margin: 0 auto; --k-device-w: min(66vw, 290px); }
}

/* The strip under a caption on a phone: the same content, small */
.ht-strip { display: none; }
@media (max-width: 899px) {
  .ht-strip { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; line-height: 1.35; color: var(--k-ink); }
  .ht-swin { position: relative; height: 66px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px); mask-image: linear-gradient(to bottom, transparent 0, #000 12px); }
  .ht-slist { display: grid; gap: 6px; }
  html:not(.k-motion) .ht-swin { height: auto; }
  html:not(.k-motion) .ht-slist p:nth-child(-n+5) { display: none; }
  .ht-slist p { display: grid; grid-template-columns: 38px minmax(0, 1fr); background: var(--k-bg-2); border-radius: 10px; padding: 7px 10px; }
  .ht-slist time { color: #6E6E73; font-variant-numeric: tabular-nums; }
  .ht-slist .is-you { font-style: italic; color: #55555A; }
  .ht-slist .is-off { font-weight: 600; background: #FFE7C2; }
}

/* ---------- Chapter 2: every story becomes a chapter ---------- */
.ht-chapters { position: relative; width: 100%; max-width: 640px; margin: 0 auto; background: #F2F2F7; border-radius: 30px; padding: 26px 22px 24px; box-sizing: border-box; box-shadow: 0 30px 70px -40px rgba(20, 29, 48, .45); }
.ht-ch-head { font: 600 15px/1.3 var(--k-text); color: #6E6E73; padding: 0 6px 10px; }
.ht-ch-title { font: 600 18px/1.3 var(--k-text); color: var(--k-ink); padding: 0 6px 2px; }
.ht-ch-list { background: #fff; border-radius: 22px; padding: 4px 0; }
.ht-ch { position: relative; }
.ht-ch + .ht-ch .ht-ch-row { border-top: 1px solid rgba(60, 60, 67, .16); }
.ht-ch-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 14px; gap: 14px; align-items: center; padding: 15px 20px; margin-left: 0; }
.ht-tick { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px #8E8E93; display: grid; place-items: center; }
.ht-tick.is-on { background: var(--ht-ground); box-shadow: none; }
.ht-tick svg { width: 12px; height: 12px; }
.ht-ch-row b { display: block; font: 400 clamp(17px, 1.43vw, 21px)/1.3 var(--k-text); color: var(--k-ink); }
.ht-ch-row small { display: block; font-size: 14px; color: #6E6E73; margin-top: 2px; }
.ht-chev { width: 8px; height: 14px; color: #C4C4C7; }
.ht-ch-lines { position: absolute; left: 12px; right: 12px; top: 4px; display: grid; gap: 4px; pointer-events: none; }
.ht-ch-lines p { font-size: 13.5px; line-height: 1.35; background: #fff; border-radius: 10px; padding: 6px 10px; box-shadow: 0 0 0 1px rgba(60, 60, 67, .12), 0 6px 14px -8px rgba(0, 0, 0, .25); display: grid; grid-template-columns: 32px minmax(0, 1fr); }
.ht-ch-lines time { color: #8A8A8E; font-variant-numeric: tabular-nums; }
.ht-ch-lines .is-you { font-style: italic; color: #6E6E73; }
.ht-ch-foot { font-size: 14px; color: #6E6E73; padding: 10px 6px 0; }
html:not(.k-motion) .ht-ch-lines { display: none; }

/* ---------- Chapter 3: tidied, never rewritten ---------- */
.ht-tidy-visual { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: clamp(18px, 2vw, 32px); width: 100%; }
.ht-tidy-visual .k-device { --k-device-w: min(260px, calc((100svh - 230px) * .46)); }
.ht-notes { display: grid; gap: 14px; width: min(290px, 100%); flex: none; }
.ht-note { background: #fff; border-radius: 20px; padding: 16px 18px; box-shadow: 0 0 0 1px var(--k-line), 0 24px 40px -30px rgba(20, 29, 48, .5); }
.ht-note-label { position: relative; height: 16px; font: 600 12px/16px var(--k-text); letter-spacing: .06em; text-transform: uppercase; color: #6E6E73; }
.ht-note-label span { position: absolute; left: 0; top: 0; }
.ht-note-label span + span { opacity: 0; color: var(--ht-ground); }
.ht-note-text { margin-top: 8px !important; font-size: 16px; line-height: 1.4; white-space: nowrap; overflow: hidden; }
.ht-note-text span { display: inline-block; }
.ht-note-text .ht-gone { color: #C46A00; text-decoration: line-through; text-decoration-thickness: 2px; }
.ht-note-play { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--k-bg-2); overflow: hidden; }
.ht-note-play i { display: block; height: 100%; width: 100%; background: var(--ht-ground); transform-origin: 0 50%; transform: scaleX(0); }
.ht-checked { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px 18px; border-radius: 999px; background: #E9EEF6; font: 600 16px/1.2 var(--k-text); color: var(--k-ink); box-shadow: inset 0 0 0 1px rgba(53, 79, 126, .18); }
.ht-checked .ht-tick { flex: none; }
html:not(.k-motion) .ht-note-text .ht-gone { display: none; }
html:not(.k-motion) .ht-note-label span:first-child { opacity: 0; }
html:not(.k-motion) .ht-note-label span + span { opacity: 1; }
html:not(.k-motion) .ht-note-play i { transform: scaleX(1); }
@media (max-width: 899px) {
  .ht-tidy-visual .ht-notes { display: none; }
  .ht-strip .ht-note { padding: 10px 12px; border-radius: 14px; box-shadow: 0 0 0 1px var(--k-line); }
  .ht-strip .ht-note-text { font-size: 14px; margin-top: 4px !important; }
}

/* ---------- Chapter 4: a gentle follow-up ---------- */
.ht-band-blue { background: var(--ht-ground); }
.ht-rec { position: relative; width: min(100%, 600px); margin: 0 auto; }
.ht-said { font-family: var(--k-display); font-weight: 600; font-size: clamp(22px, 2vw, 30px); line-height: 1.22; color: #fff; }
.ht-said small { display: block; font: 400 14px/1.4 var(--k-text); color: var(--ht-g2); margin-top: 8px; }
.ht-eg { font: 600 13px/1.2 var(--k-text); letter-spacing: .12em; text-transform: uppercase; color: var(--ht-g2); margin-bottom: 12px !important; }
.ht-quiet { display: flex; align-items: center; gap: 14px; margin: 22px 0 !important; }
.ht-quiet-bar { position: relative; flex: none; width: 160px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.ht-quiet-bar i { position: absolute; inset: 0; background: #fff; transform-origin: 0 50%; }
.ht-quiet-label { font-size: 15px; color: var(--ht-g2); }
.ht-qpage { --k-ink: #1C1C1E; background: #fff; border-radius: 26px; padding: 22px 22px 18px; color: #1C1C1E; }
.ht-qpage small { font-size: 14px; color: var(--ht-page2); }
.ht-qpage h3 { font-family: var(--k-display); font-size: clamp(26px, 2.3vw, 34px); line-height: 1.12; margin-top: 8px !important; }
.ht-follow { margin-top: 18px !important; border-top: 1px solid rgba(60, 60, 67, .16); padding-top: 14px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; }
.ht-follow svg { width: 22px; height: 22px; color: var(--ht-ground); }
.ht-follow b { display: block; font: 600 14px/1.3 var(--k-text); color: var(--ht-page2); }
.ht-follow span { display: block; font-size: 18px; line-height: 1.35; color: var(--k-ink); margin-top: 2px; }
.ht-rec-ind { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 8px 14px; font: 600 15px/1 var(--k-text); color: #1C1C1E; margin-bottom: 16px !important; }
.ht-rec-ind i { width: 11px; height: 11px; border-radius: 50%; background: var(--ht-red); }
.ht-rec-ind span { color: var(--ht-page2); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Chapter 5: the book's pages ---------- */
.ht-book-visual { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(24px, 3vw, 48px); width: 100%; }
.ht-pile { position: relative; width: min(470px, 36vw, calc((100svh - 150px) * .6667)); aspect-ratio: 432 / 648; container-type: inline-size; }
.ht-pile .ht-sheet { position: absolute; inset: 0; }
.ht-sheet { background: var(--ht-paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 22px 40px -26px rgba(20, 29, 48, .55); color: #111; font-family: var(--ht-book); }
.ht-pile .ht-sheet:nth-child(2) { rotate: -1.6deg; } .ht-pile .ht-sheet:nth-child(3) { rotate: 1.2deg; } .ht-pile .ht-sheet:nth-child(4) { rotate: -.8deg; }
.ht-pile .ht-sheet:nth-child(5) { rotate: 1.8deg; } .ht-pile .ht-sheet:nth-child(6) { rotate: -1.2deg; } .ht-pile .ht-sheet:nth-child(7) { rotate: .6deg; }
/* The text block, as the PDF sets it from the trim: 54 pt inside, 45 outside, 54 top, 63 bottom on a 432 × 648 pt page. */
.ht-tb { position: absolute; left: 12.5cqw; right: 10.42cqw; top: 12.5cqw; bottom: 14.58cqw; font-size: 2.546cqw; line-height: 1.18; }
.ht-sheet.is-verso .ht-tb { left: 10.42cqw; right: 12.5cqw; }
.ht-pn { position: absolute; left: 0; right: 0; bottom: 6.2cqw; text-align: center; font-size: 2.08cqw; }
.ht-centre { text-align: center; padding-top: 22cqw; }
.ht-sheet h4 { font-family: var(--ht-book); letter-spacing: 0; color: #111; }
.ht-centre h4 { font-weight: 600; font-size: 5.83cqw; line-height: 1.15; }
.ht-centre p { font-style: italic; margin-top: 2.55cqw !important; }
.ht-ded { text-align: center; font-style: italic; padding-top: 26cqw; }
.ht-tb h4 { font-weight: 600; font-size: 4.17cqw; line-height: 1.2; margin-bottom: 2.55cqw !important; }
.ht-tb .ht-it { font-style: italic; color: #444; margin-bottom: 2.04cqw !important; }
.ht-tb p { margin-bottom: 1.53cqw !important; }
.ht-tb .ht-body { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.ht-tb figure img { display: block; width: 100%; height: auto; }
.ht-tb figcaption { text-align: center; font-style: italic; color: #444; margin-top: 1.53cqw; }
.ht-colo { position: absolute; left: 0; right: 0; bottom: 0; }
@media (max-width: 899px) {
  .ht-book-visual .k-device { display: none; }
  .ht-pile { width: min(78vw, 330px, calc((100svh - 330px) * .6667)); }
}

/* ---------- Chapter 6: their files ---------- */
.ht-band-night { background: var(--ht-night); }
.ht-files { width: min(100%, 620px); margin: 0 auto; background: #1C2436; border-radius: 26px; padding: 20px 18px 14px; box-sizing: border-box; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 70px -40px rgba(0, 0, 0, .8); }
.ht-path { font: 600 14px/1.3 var(--k-text); color: var(--ht-g2); padding: 0 8px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.ht-path span + span::before { content: "›"; margin-right: 6px; color: #8E97AB; }
.ht-files ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ht-files li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 10px; min-height: 48px; box-sizing: border-box; border-radius: 12px; color: #fff; font-size: clamp(15px, 1.16vw, 17px); line-height: 1.3; }
.ht-files li.is-sub { padding-left: 34px; }
.ht-files li small { color: #A9B2C4; font-size: 13px; font-variant-numeric: tabular-nums; }
.ht-files svg { width: 22px; height: 22px; }
.ht-files li.is-zip { margin-top: 10px; background: rgba(155, 178, 224, .16); box-shadow: inset 0 0 0 1px rgba(155, 178, 224, .3); }
.ht-files .ht-fold { color: #9BB2E0; }
.ht-files .ht-doc { color: #E2EAF5; }
/* Save everything: each file's icon drops into the archive, the bar fills, then the archive is ready to share */
.ht-chip { position: absolute; left: 10px; top: 50%; width: 22px; height: 22px; margin-top: -11px; z-index: 3; opacity: 0; pointer-events: none; color: #E2EAF5; }
.ht-files li.is-sub .ht-chip { left: 34px; }
.ht-files li.is-zip { padding: 14px 12px 20px; }
.ht-files li.is-zip > span:first-of-type small { display: block; margin-top: 3px; }
.ht-zip-state { display: grid; justify-items: end; align-items: center; }
.ht-zip-state > span { grid-area: 1 / 1; }
.ht-making { font-size: 13px; color: #A9B2C4; }
.ht-ready { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: #fff; color: var(--ht-night); font: 600 14px/1 var(--k-text); white-space: nowrap; }
.ht-ready svg { width: 16px; height: 16px; }
.ht-zip-bar { position: absolute; left: 50px; right: 14px; bottom: 9px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.ht-zip-bar b { position: absolute; inset: 0; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
html:not(.k-motion) .ht-making, html:not(.k-motion) .ht-zip-bar { display: none; }
@media (max-width: 899px) { .ht-files li.is-zip { grid-template-columns: 28px minmax(0, 1fr); row-gap: 10px; } .ht-zip-state { grid-column: 2; justify-items: start; } }

/* ---------- The rest ---------- */
.ht-prints { display: flex; gap: 14px; align-items: flex-end; margin-top: 8px; }
.ht-prints figure { flex: 1; min-width: 0; background: #fff; padding: 7px 7px 0; border-radius: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, .16), 0 14px 26px -18px rgba(0, 0, 0, .45); }
.ht-prints figure:nth-child(1) { rotate: -2deg; } .ht-prints figure:nth-child(3) { rotate: 2deg; }
.ht-prints img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; filter: sepia(.14); }
.ht-prints figcaption { font: italic 13px/1.3 var(--ht-book); color: #4A4A4A; padding: 7px 2px 9px; }
.ht-mini { margin-top: auto; padding-top: 10px; }
.ht-u { text-decoration: underline; text-decoration-color: var(--ht-orange); text-decoration-thickness: 2.5px; text-underline-offset: 4px; }
.ht-sentence { font-size: 17px; line-height: 1.5; color: var(--k-ink) !important; background: var(--k-bg-2); border-radius: 14px; padding: 12px 14px; }
.ht-names { display: flex; flex-wrap: wrap; gap: 8px; }
.ht-names span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; background: var(--k-bg-2); font-size: 15px; color: var(--k-ink); }
.ht-names .ht-tick { width: 20px; height: 20px; }
.ht-big { display: flex; gap: 10px; }
.ht-big span { flex: 1; text-align: center; padding: 14px 8px; border-radius: 18px; font: 600 15px/1.2 var(--k-text); }
.ht-big .is-off { background: var(--ht-orange); color: #1C1C1E; }
.ht-big .is-stop { background: var(--ht-ground); color: #fff; }
@media (max-width: 899px) { .k-tiles .ht-big, .k-tiles .ht-names { display: none; } .k-hearthtold .k-tile { padding: 24px; } }
.ht-tile-blue { background: var(--ht-ground) !important; box-shadow: none !important; }
.ht-tile-blue :is(h3, p) { color: #fff !important; }
.ht-tile-blue p { color: var(--ht-g2) !important; }

.ht-plans .k-plan.k-plus { background: var(--ht-ground); }
.ht-plans .k-plan.k-plus li::before { border-color: #fff; }
.ht-plans .k-plan-price { font-family: var(--k-display); font-weight: 600; }
.ht-plan-note { margin-top: 20px !important; font-size: 15px; color: var(--k-ink-2); }
.ht-plans .k-plus .ht-plan-note { color: var(--ht-g2); }

.ht-close { background: var(--ht-ground); color: #fff; }
.ht-close .k-h2 { color: #fff; }
.ht-close .k-lockup b { color: #fff; }
.ht-close .k-lockup span { color: var(--ht-g2); }
.ht-close .k-subnav { justify-content: center; margin-top: 36px; }
.ht-close .k-subnav a { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .32); }
.ht-close .k-subnav a[aria-current] { background: #fff; color: var(--ht-ground); box-shadow: none; }
.ht-close .k-btn-primary { background: #fff; color: var(--ht-ground); }
.ht-close .k-soon::before { background: var(--ht-ground); box-shadow: 0 0 0 3px rgba(53, 79, 126, .25); }

.ht-section-head { max-width: 760px; }
.ht-section-head .k-lead { margin-top: 18px !important; max-width: 40em; }

@media (prefers-reduced-motion: reduce) {
  .ht-words span { transition: none; }
}

/* ---------- Round 1 of the design review ---------- */
/* Chapter titles no bigger than the hero's headline, on two or three lines */
.k-hearthtold main .k-h2 { font-size: clamp(34px, min(4.1vw, 7.4svh), 60px); }
.k-hearthtold .k-step .k-h2 { font-size: clamp(32px, min(3.7vw, 6.6svh), 54px); }
/* Bands fill a screen, like the scenes */
@media (min-width: 900px) {
  .k-hearthtold .k-band:not(.ht-compare) { min-height: 100svh; display: flex; align-items: center; box-sizing: border-box; }
  .k-hearthtold .k-band:not(.ht-compare) > .k-wrap { width: 100%; }
}
/* Captions and screens hand over quickly, so two never show at once */
html.k-motion .k-hearthtold .k-step { transition: opacity .16s ease, transform .3s ease; }
html.k-motion .k-hearthtold .k-step.is-on { transition-delay: .12s; }
html.k-motion .k-hearthtold .k-device-screen img { transition: opacity .12s linear; }
/* The tidy scene on a phone: the same phone as the table scene, centred */
@media (max-width: 899px) {
  .ht-tidy-visual { justify-content: center; }
  .ht-tidy-visual .k-device { --k-device-w: min(66vw, 290px); }
  .ht-strip .ht-note-play { margin-top: 8px; }
  .ht-strip-tick { display: flex; align-items: center; gap: 8px; margin-top: 8px !important; font: 600 14px/1.2 var(--k-text); }
  .ht-strip-tick .ht-tick { width: 20px; height: 20px; }
}
@media (min-width: 900px) { .ht-strip-tick, .ht-strip .ht-note-play { display: none; } }
/* The book: crop marks on the page that shows its trim, and the colophon's sentence beside the pile */
.ht-marked .ht-crop { position: absolute; inset: -4.2cqw; pointer-events: none;
  background:
    linear-gradient(#111, #111) 0 4.2cqw / 3cqw 1px no-repeat, linear-gradient(#111, #111) 4.2cqw 0 / 1px 3cqw no-repeat,
    linear-gradient(#111, #111) 100% 4.2cqw / 3cqw 1px no-repeat, linear-gradient(#111, #111) calc(100% - 4.2cqw) 0 / 1px 3cqw no-repeat,
    linear-gradient(#111, #111) 0 calc(100% - 4.2cqw) / 3cqw 1px no-repeat, linear-gradient(#111, #111) 4.2cqw 100% / 1px 3cqw no-repeat,
    linear-gradient(#111, #111) 100% calc(100% - 4.2cqw) / 3cqw 1px no-repeat, linear-gradient(#111, #111) calc(100% - 4.2cqw) 100% / 1px 3cqw no-repeat; }
.ht-trim { position: absolute; right: 4%; top: -8.6cqw; font: 600 max(11px, 2.9cqw)/1 var(--k-text); letter-spacing: .04em; color: var(--ht-ground); white-space: nowrap; }
.ht-callout { position: absolute; left: -20cqw; bottom: 62cqw; width: min(300px, 66cqw); margin: 0; background: #fff; border-radius: 20px; padding: 16px 18px; font-size: 16px; line-height: 1.45; color: var(--k-ink); box-shadow: 0 0 0 1px var(--k-line), 0 24px 40px -28px rgba(20, 29, 48, .5); z-index: 2; }
.ht-callout::after { content: ""; position: absolute; left: 62%; top: 100%; width: 1px; height: 33cqw; background: var(--ht-ground); }
.ht-callout span { display: block; font: 600 12px/1.2 var(--k-text); letter-spacing: .08em; text-transform: uppercase; color: #6E6E73; margin-bottom: 6px; }
@media (min-width: 900px) { .ht-book-visual { justify-content: flex-end; } }
@media (max-width: 899px) {
  .ht-callout { display: none; }
  .ht-strip-colo { font: 14px/1.45 var(--ht-book); color: #111; background: var(--ht-paper); border-radius: 12px; padding: 10px 12px; box-shadow: 0 0 0 1px var(--k-line); }
  .ht-strip-colo span { display: block; font: 600 11px/1.2 var(--k-text); letter-spacing: .08em; text-transform: uppercase; color: #6E6E73; margin-bottom: 4px; }
}
/* How it compares: the standout as a statement, then two lines */
.ht-big-line { font-family: var(--k-display); font-weight: 600; font-size: clamp(30px, min(4.1vw, 7.4svh), 60px); line-height: 1.12; color: var(--k-ink); max-width: 30ch; margin-top: 4px !important; }
.ht-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); margin-top: 36px; max-width: 1100px; }
.ht-two p { font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5; color: var(--k-ink-2); }
.ht-two b { color: var(--k-ink); font-weight: 600; }
.ht-compare-more { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 34px !important; }
.ht-compare-more span { font-size: 15px; color: var(--k-ink-2); }
@media (max-width: 899px) { .ht-two { grid-template-columns: minmax(0, 1fr); gap: 18px; } }

/* Long URLs in the legal pages wrap on narrow phones instead of pushing the page sideways */
.k-hearthtold .k-doc :is(p, li, td) { overflow-wrap: break-word; }

/* ---------- Round 3 of the design review ---------- */
/* Step titles on three lines at most, no word left alone; the visuals keep their room */
.k-hearthtold :is(.k-h1, .k-h2, .ht-big-line) { text-wrap: balance; }
.ht-close .k-h2 { max-width: 20ch; margin-left: auto; margin-right: auto; }
.ht-nb { white-space: nowrap; }
@media (min-width: 1280px) {
  .k-hearthtold .k-scene:not(.k-flip) .k-stage-grid { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 56px; }
  /* Band visuals fill their band the way the scenes' do: the visual's side is the wider */
  .k-hearthtold .k-band-grid { gap: 64px; }
  .k-hearthtold .k-band-grid:has(> .ht-section-head:first-child) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .k-hearthtold .k-band-grid:has(> .ht-section-head:last-child) { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .ht-rec, .ht-files { width: min(100%, 640px); }
}
/* The child pages' current pill in the app's china blue, as the app page's close has it in white */
.k-hearthtold .k-sub-hero .k-subnav a[aria-current] { background: var(--ht-ground); color: #fff; box-shadow: none; }
