/* Our Legendry homepage proposal.
   Same palette, type and media as canvas/service-showcase; a new structure.
   Every scene reads without JavaScript; motion is added only when .js is present
   and is reduced to plain fades under prefers-reduced-motion. */

@font-face { font-family: Cormorant; src: url('fonts/CormorantGaramond-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Cochineal; src: url('fonts/Cochineal-Roman.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Cochineal; src: url('fonts/Cochineal-Italic.otf') format('opentype'); font-style: italic; font-display: swap; }

:root {
  --plum: #3a1226;
  --plum-soft: #462036;
  --mid: #6b1f45;
  --paper: #f3ede3;
  --sand: #e8ddc9;
  --stone: #e4d7c3;
  --leaf: #faf4ea;
  --gold: #a8894a;
  --gold-text: #6b552c;
  --gold-light: #d2b77f;
  --ink: #352732;
  --muted: #6d5c60;
  --umber: #795347;
  --night: #1d0c15;
  --wood: #19130f;
  --atlas: #281b2b;
  --serif: Cormorant, Georgia, serif;
  --book: Cochineal, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gutter: clamp(20px, 5.5vw, 92px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.035em; line-height: 1.02; text-wrap: balance; }
h2 { font-size: clamp(40px, 4.8vw, 74px); }
h1 em, h2 em { font-family: var(--book); font-weight: 400; font-style: italic; letter-spacing: -.035em; }
p { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 5px; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: #21101a; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 5px; }
.skip { position: absolute; z-index: 20; top: -100px; left: 16px; padding: 12px 18px; background: var(--paper); color: var(--plum); }
.skip:focus { top: 12px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow { font: 500 11px/1.5 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); }

/* ---------- Actions ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 30px; background: var(--plum); color: var(--paper); font: 500 15px/1 var(--sans); letter-spacing: .01em; text-decoration: none; border-radius: 2px; transition: background .25s, transform .25s var(--ease); }
.button:hover { background: var(--mid); }
.button:active { transform: translateY(1px); }
.button-light { background: var(--paper); color: var(--plum); }
.button-light:hover { background: #fff8ee; }
.assure { margin-top: 14px; font: 13px/1.55 var(--sans); color: var(--muted); max-width: 36ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.invite .actions { justify-content: center; }
.assure a { color: inherit; text-underline-offset: 4px; }
.text-link { display: inline-flex; gap: 14px; align-items: center; min-height: 44px; font: 13px/1.4 var(--sans); text-decoration: none; border-bottom: 1px solid var(--gold); }
.text-link:hover { border-color: currentColor; }
.text-link.light { color: var(--paper); border-color: #8a7458; }

/* ---------- Masthead ---------- */
.masthead { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px var(--gutter); background: var(--sand); border-bottom: 1px solid #d8cab2; }
.wordmark { font: 600 27px/1 var(--serif); letter-spacing: .19em; text-decoration: none; white-space: nowrap; color: var(--plum); }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); }
.site-nav a, .menu nav a { font: 13px/1.4 var(--sans); text-decoration: none; padding: 8px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { border-color: var(--gold); }
.site-nav a[aria-current="page"] { border-color: var(--plum); }
.site-nav .nav-app { padding: 11px 18px; background: var(--plum); color: var(--paper); border: 0; border-radius: 2px; }
.site-nav .nav-app:hover { background: var(--mid); }
.menu { display: none; }

/* ---------- 1 · Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(320px, .74fr) 1.26fr; gap: clamp(36px, 4.4vw, 76px); align-items: center; min-height: clamp(560px, calc(100svh - 76px), 940px); padding: clamp(28px, 4.5vh, 60px) var(--gutter) clamp(36px, 6vh, 70px); background: var(--sand); color: var(--plum); overflow: clip; }
.hero h1 { font-size: clamp(52px, 5.4vw, 90px); line-height: .98; letter-spacing: -.045em; }
.hero h1 em { display: block; font-size: .84em; line-height: 1.14; color: var(--umber); }
html:not(.js) .hero { align-items: start; }
html:not(.js) .hero-copy { position: sticky; top: 24px; }
.lede { margin: 26px 0 30px; font: 19px/1.62 var(--book); color: #4b3440; max-width: 34ch; }

/* The book */
.edition { min-width: 0; }
.edition-top { display: flex; align-items: baseline; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; margin-bottom: 18px; }
.edition-label { font: italic 17px/1.4 var(--book); color: var(--umber); }
.chapters { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.chapters a { font: 12.5px/1.4 var(--sans); padding: 8px 0; text-decoration: none; border-bottom: 2px solid transparent; color: #5a3f4a; }
.chapters a:hover { border-color: #b99b7c; }
.chapters a[aria-current="true"] { color: var(--plum); font-weight: 600; border-color: var(--plum); }

.stage { position: relative; touch-action: pan-y pinch-zoom; }
.spread { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: clamp(430px, 35vw, 540px); margin-bottom: 40px; background: var(--leaf); border-radius: 3px 3px 2px 2px;
  box-shadow: 0 2px 0 #d9ccb5, 0 4px 0 #f1e8d8, 0 6px 0 #d2c3a8, 0 8px 0 #efe5d3, 0 10px 0 #cdbd9f, 0 12px 0 #5b3f35, 0 34px 44px -14px #3a122655, 0 16px 22px -10px #3a122640; }
.spread::before { content: ""; position: absolute; z-index: 2; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; background: #c9b899; pointer-events: none; }
.page { position: relative; min-width: 0; }
.page-image { display: flex; flex-direction: column; overflow: hidden; border-radius: 3px 0 0 2px; background: #f4ecdf; box-shadow: inset -26px 0 26px -24px #5c3f2c88; }
.page-image > img:first-child { flex: 1 1 0; width: 100%; min-height: 0; height: 0; object-fit: cover; }
.page-caption { flex: none; padding: 12px 22px 34px; font: 11px/1.55 var(--sans); color: #5d4a4f; background: inherit; }
.page-caption small { display: block; font-size: 9.5px; color: #6a5a5e; margin-top: 2px; }
.page-text { display: flex; flex-direction: column; padding: clamp(24px, 2.7vw, 42px) clamp(22px, 2.6vw, 40px) 44px; border-radius: 0 3px 2px 0; background: linear-gradient(90deg, #f1e8da, var(--leaf) 9%, var(--leaf) 94%, #f4ecdf); }
.page-text .kicker { margin: 0; font: 500 10.5px/1.5 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--gold-text); }
.page-text h2 { margin: 14px 0 0; font-size: clamp(29px, 2.45vw, 40px); line-height: 1.03; letter-spacing: -.03em; color: var(--plum); }
.page-text h2 a { text-decoration: none; }
.page-text h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.page-text h2::after { content: ""; display: block; width: 42px; height: 1px; margin: 18px 0 4px; background: #b49869; }
.page-text p { margin-top: 12px; font: 16px/1.6 var(--book); color: #3f2c36; max-width: 42ch; }
.page-text blockquote { margin: 16px 0 0; font: italic 19px/1.45 var(--book); color: var(--mid); }
.look { display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; min-height: 44px; margin-top: 16px; font: 500 12.5px/1.4 var(--sans); color: var(--plum); text-underline-offset: 4px; }
.folio { position: absolute; bottom: 13px; font: 11px var(--book); color: #74645d; }
.page-image .folio { left: 22px; }
.page-text .folio { right: 24px; }

/* Individual spreads */
.page-velvet { position: relative; }
.page-velvet > img:first-child { object-position: 47% 38%; }
.page-velvet .inset { position: absolute; right: 18px; top: 48%; width: 23%; height: auto; padding: 5px; background: #fbf6ec; box-shadow: 0 10px 18px #1c0a1233; transform: rotate(2.5deg); }
.page-dark { background: var(--atlas); color: var(--paper); }
.page-dark .page-caption, .page-night .page-caption { color: #d7c9cc; }
.page-dark > img:first-child { object-fit: contain; padding: 18px 10px 0; }
.page-dark .folio, .page-night .folio { color: #a99aa0; }
.page-night { background: #0b111c; color: var(--paper); }
/* The two maps are wide: crop each to its own story's part of the world. */
.spread-migration .page-image > img:first-child { object-fit: cover; object-position: 31% 50%; padding: 0; transform: scale(1.22); }
.spread-escape .page-image > img:first-child { object-fit: cover; object-position: 39% 50%; transform: scale(1.3); transform-origin: 50% 34%; }
.spread-migration .page-caption, .spread-escape .page-caption { position: relative; z-index: 1; }
/* The families: the whole spread for the chart, the story beneath it. */
.spread-families { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.spread-families::before { display: none; }
.spread-families .page-image { border-radius: 3px 3px 0 0; box-shadow: none; }
.spread-families .page-image > img:first-child { object-fit: contain; padding: 16px 28px 0; }
.spread-families .page-caption { padding-bottom: 12px; }
.spread-families .page-image .folio { display: none; }
.spread-families .page-text { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: 6px 34px; align-items: center; padding: 18px 34px 24px; border-radius: 0 0 2px 2px; background: var(--leaf); }
.spread-families .page-text .kicker { grid-column: 1 / -1; }
.spread-families .page-text h2 { margin: 0; font-size: clamp(26px, 2.1vw, 32px); }
.spread-families .page-text h2::after { display: none; }
.spread-families .page-text p:not(.kicker) { margin: 0; font-size: 15px; }
.spread-families .look { margin: 0; }
.spread-families .page-text .folio { display: none; }
.page-paper { background: #e9ddc6; justify-content: center; }
.page-paper > img.advert { flex: none; height: auto; width: 82%; margin: auto auto 0; object-fit: contain; transform: rotate(-3deg); box-shadow: 8px 16px 24px #3a122630; mix-blend-mode: multiply; }
.page-paper .page-caption { margin-top: auto; }
.page-portrait { background: #d6cfba; }
.page-portrait > img:first-child { object-fit: contain; padding: 22px 22px 0; }
.page-red { background: #8e2d22; }
.page-red > img:first-child { object-position: center 28%; }
.page-red .page-caption { background: var(--leaf); }
.crossings { display: flex; gap: 22px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #d5c7ae; }
.crossings li { font: 10.5px/1.5 var(--sans); color: var(--muted); }
.crossings b { display: block; font: 600 27px/1 var(--serif); color: var(--plum); margin-bottom: 4px; }
.page-text .score { width: 100%; height: 86px; object-fit: cover; margin-top: 18px; border: 1px solid #ddd0b8; }

.edition-foot { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: -8px; }
.edition-foot[hidden] { display: none; }
.turn { width: 46px; height: 46px; border: 1px solid #bda98a; border-radius: 50%; background: transparent; color: var(--plum); font: 18px/1 var(--book); cursor: pointer; transition: background .2s, border-color .2s; }
.turn:hover { background: #f3eadb; border-color: var(--plum); }
.count { font: 12.5px/1 var(--sans); color: var(--muted); min-width: 44px; text-align: center; letter-spacing: .04em; }
.count b { color: var(--plum); font-weight: 600; }

/* One spread at a time once the script is running */
.js .stage { display: grid; }
.js .spread { grid-area: 1 / 1; visibility: hidden; }
.js .spread.is-active { visibility: visible; }
.js .stage.is-dragging .spread.is-active { transition: none; transform: perspective(1600px) rotateY(var(--drag, 0deg)); }
.js .spread.turn-next .page-text { animation: leaf-next .62s var(--ease) both; transform-origin: left center; }
.js .spread.turn-next .page-image { animation: settle .5s ease both; }
.js .spread.turn-prev .page-image { animation: leaf-prev .62s var(--ease) both; transform-origin: right center; }
.js .spread.turn-prev .page-text { animation: settle .5s ease both; }
@keyframes leaf-next { from { transform: perspective(1600px) rotateY(-62deg); opacity: .15; } to { transform: none; opacity: 1; } }
@keyframes leaf-prev { from { transform: perspective(1600px) rotateY(62deg); opacity: .15; } to { transform: none; opacity: 1; } }
@keyframes settle { from { opacity: .35; } to { opacity: 1; } }
.js .page-text { cursor: pointer; }
.js .page-image { cursor: grab; }

/* ---------- 2 · The idea, and how a story comes together ---------- */
.gathering { background: var(--plum-soft); color: var(--paper); padding: clamp(80px, 11vh, 120px) var(--gutter) clamp(70px, 9vh, 100px); }
.idea { display: grid; grid-template-columns: 1fr 1fr; gap: 3% 8%; align-items: end; max-width: 1260px; margin: 0 auto 72px; }
.idea .eyebrow { grid-column: 1 / -1; color: var(--gold-light); }
.idea h2 { font-size: clamp(46px, 5.4vw, 84px); }
.idea h2 em { display: block; color: #e3c9a0; }
.idea > p:last-child { font: 20px/1.62 var(--book); color: #eadbde; max-width: 36ch; padding-bottom: 8px; }

.loop { display: grid; grid-template-columns: 1fr 1fr 1.5fr 1.15fr; gap: clamp(24px, 3vw, 44px); align-items: start; max-width: 1260px; margin: auto; counter-reset: step; }
.step { position: relative; min-width: 0; }
.step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font: 500 12px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); }
.step-title span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #b89a63; border-radius: 50%; font: 600 15px/1 var(--serif); letter-spacing: 0; color: #f0dfbf; }
.step-family::after, .step-search::after, .step-letter::after { content: ""; position: absolute; top: 14px; right: calc(-1 * clamp(24px, 3vw, 44px) + 6px); width: calc(clamp(24px, 3vw, 44px) - 12px); border-top: 1px dashed #b89a6399; }

.piece { position: relative; transform: rotate(var(--r, 0deg)); margin-bottom: 16px; padding: 18px 20px 20px; background: #f7efe2; color: var(--plum); border-left: 3px solid var(--c, var(--gold)); box-shadow: 0 16px 28px -14px #0e050a88; }
.piece-memory { --c: #b8873b; --r: -1.2deg; }
.piece-photo { --c: #b8873b; --r: .8deg; margin-left: 14px; }
.piece-research { --c: #6f7fa6; --r: -.6deg; }
.piece-photo img, .piece-research img { display: block; width: 100%; height: auto; object-fit: cover; }
.piece-photo img { aspect-ratio: 4 / 3; margin-top: 12px; object-position: 50% 42%; }
.piece-research img { aspect-ratio: 3 / 2; margin-bottom: 14px; object-position: 50% 24%; }
.piece-research .said { margin-top: 0; }
/* The letter: two lines in his own hand, each with its English */
.history.letter { padding: 24px 24px 26px; }
.hand { margin: 14px -12px 0; }
.hand img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }
.hand figcaption { margin: 2px 12px 0; font: italic 16px/1.4 var(--book); color: #3a2530; }
.history p.letter-credit { margin-top: 14px; font: 11.5px/1.45 var(--sans); color: #7a6670; }
/* The story it became */
.story-door { padding: 24px 24px 26px; background: #f7efe2; color: var(--plum); box-shadow: 6px 6px 0 #dccbaf, 0 30px 44px -18px #0e050a99; --r: -.6deg; transform: rotate(var(--r)); }
.story-door h3 { margin: 0 0 12px; font-size: clamp(22px, 1.8vw, 30px); line-height: 1.08; }
.story-door p { font: 16.5px/1.6 var(--book); color: #3a2530; }
.door-read { display: inline-block; margin-top: 16px; padding: 9px 14px; border-radius: 999px; background: var(--plum); color: var(--paper); font: 600 12px/1 var(--sans); text-decoration: none; }
.door-read:hover { background: #5a2a43; }
/* Step 5: the story goes back to the family, and keeps growing */
.step-grow { grid-column: 1 / -1; }
.step-grow .step-title { justify-content: center; }
.piece-grow { --c: #b8873b; display: grid; grid-template-columns: auto 1fr; gap: 12px 28px; align-items: center; max-width: 760px; margin: 0 auto; padding: 22px 28px; }
.grow-art { display: flex; align-items: center; gap: 20px; }
.grow-art .wave { margin-top: 0; }
.grow-art .snap { width: 110px; margin-top: 0; }
.piece-grow .said { margin-top: 6px; }
.who { font: 12px/1.4 var(--sans); color: #6a5560; }
.who strong { font: 600 19px/1 var(--serif); letter-spacing: -.01em; color: var(--plum); margin-right: 4px; }
.said { margin-top: 10px; font: 17px/1.45 var(--book); color: #3a2530; }
.wave { display: flex; align-items: center; gap: 3px; height: 26px; margin-top: 12px; }
.wave i { display: block; width: 3px; height: calc(8px + (var(--h, 5) * 3px)); background: #b8873b; border-radius: 2px; }
.wave i:nth-child(3n) { --h: 2; } .wave i:nth-child(4n) { --h: 5; } .wave i:nth-child(5n+1) { --h: 3; } .wave i:nth-child(7n) { --h: 6; } .wave i:nth-child(2n+1) { --h: 1; }
.snap { position: relative; display: block; height: 58px; margin-top: 12px; }
.snap span { position: absolute; width: 64px; height: 50px; background: #d9c8ad; border: 4px solid #fbf6ec; box-shadow: 0 5px 10px #2a0f1c33; }
.snap span:first-child { left: 0; top: 4px; transform: rotate(-6deg); background: linear-gradient(160deg, #cdb998, #a88e6b); }
.snap span:last-child { left: 42px; top: 0; transform: rotate(5deg); background: linear-gradient(200deg, #d7c5a8, #9e8561); }

.phone { width: 100%; max-width: 330px; margin: 0 auto; padding: 10px; border-radius: 44px; background: #140a10; box-shadow: 0 0 0 1px #5e4452, 0 40px 60px -24px #0a0306cc, inset 0 0 0 2px #2b1a23; }
.phone-screen { position: relative; overflow: hidden; border-radius: 35px; background: #f6f1ea; color: var(--plum); padding: 12px 14px 0; display: flex; flex-direction: column; }
.phone-bar { display: flex; justify-content: space-between; align-items: center; height: 24px; padding: 0 12px; font: 600 12px/1 var(--sans); color: #1c0d15; }
.phone-bar i { position: absolute; left: 50%; top: 10px; width: 62px; height: 19px; border-radius: 10px; background: #140a10; transform: translateX(-50%); }
.phone-bar .bars { width: 22px; height: 10px; border: 1.5px solid #1c0d15; border-radius: 3px; position: relative; }
.phone-bar .bars::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: #1c0d15; border-radius: 1px; }
.app-top { display: flex; align-items: center; justify-content: space-between; margin: 12px 2px 12px; }
.app-top .avatar { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #7b5c68; }
.app-top .family { font: 600 10px/1 var(--serif); letter-spacing: .2em; text-transform: uppercase; color: #775c2c; }
.app-top .add { font: 600 11px/1 var(--sans); padding: 6px 10px; border-radius: 999px; background: #ece3d6; }
.app-card { padding: 14px 14px 14px; border-radius: 16px; background: #fffaf2; box-shadow: 0 1px 0 #e6dccd, 0 10px 22px -14px #3a122655; }
.app-label { font: 600 9px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #775c2c; }
.app-title { margin: 7px 0 7px; font: 600 23px/1.02 var(--serif); letter-spacing: -.02em; color: #2b1520; }
.app-excerpt { font: 12.5px/1.45 var(--book); color: #5a4550; }
.app-read { display: inline-block; margin-top: 11px; padding: 7px 12px; border-radius: 999px; background: var(--plum); color: var(--paper); font: 600 10.5px/1 var(--sans); }
.app-label-quiet { margin: 16px 4px 4px; color: #6f6066; }
.app-list { padding: 0 4px; }
.app-list li { position: relative; padding: 6px 0 6px 16px; font: 11.5px/1.35 var(--sans); color: #4e3a44; border-bottom: 1px solid #ebe1d2; }
.app-list li::before { content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--d); }
.dot-uncle { --d: #b8873b; } .dot-brother { --d: #9b5c7e; } .dot-aunt { --d: #3f8a80; } .dot-research { --d: #6f7fa6; }
.app-list .dot-research { border-bottom: 0; }
.app-ask { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #efe5d6; }
.app-question { margin: 5px 0 9px; font: 600 16.5px/1.12 var(--serif); color: #2b1520; }
.app-answer { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid #b89b8a; font: 600 10px/1 var(--sans); color: var(--plum); }
.app-tabs { display: flex; justify-content: space-around; margin: 16px -14px 0; padding: 8px 6px 14px; background: #fbf7f1; border-top: 1px solid #e6dccd; }
.app-tabs span { display: flex; flex-direction: column; align-items: center; gap: 3px; font: 500 8.5px/1 var(--sans); color: #6f6066; }
.app-tabs svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.app-tabs .on { color: var(--plum); }

.history { position: relative; padding: 30px 30px 34px; background: #f7efe2; color: var(--plum); box-shadow: 6px 6px 0 #dccbaf, 12px 12px 0 #cdb99a55, 0 30px 44px -18px #0e050a99; --r: .8deg; transform: rotate(var(--r)); }
.history .history-kicker { margin: 0; font: 600 10px/1.4 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--gold-text); }
.history h3 { margin: 12px 0 18px; font-size: clamp(30px, 2.6vw, 38px); line-height: 1.02; }
.history h3::after { content: ""; display: block; width: 40px; height: 1px; margin-top: 16px; background: #b49869; }
.history p { margin-top: 12px; font: 16.5px/1.6 var(--book); color: #3a2530; }
.history mark { background: none; color: inherit; padding: 0 0 1px; box-shadow: inset 0 -2px 0 var(--m); }
.m-family { --m: #b8873b; } .m-records { --m: #6f7fa6; }
/* The key under the sample: what the family shared, what our research found */
.history-key { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 0; padding: 14px 0 0; border-top: 1px solid #e2d3bb; font: 600 10px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #6a5560; list-style: none; }
.history-key li { display: inline-flex; align-items: center; gap: 9px; }
.history-key i { display: block; width: 22px; height: 2px; }
.history-key .k-family i { background: #b8873b; }
.history-key .k-records i { background: #6f7fa6; }
.gathering-note { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 10px 22px; max-width: 1260px; margin: 64px auto 0; padding-top: 28px; border-top: 1px solid #ffffff22; font: italic 21px/1.5 var(--book); color: #eadbde; text-align: center; }
.gathering-note .eyebrow { font-style: normal; color: var(--gold-light); }

/* The story assembling itself, once, when it comes into view */
.js .loop [data-piece] { opacity: 0; transform: translateY(18px) rotate(var(--r, 0deg)); transition: opacity .7s ease, transform .9s var(--ease); }
.js .loop [data-piece].seen { opacity: 1; transform: rotate(var(--r, 0deg)); }
.js .loop .history mark { box-shadow: inset 0 0 0 var(--m); transition: box-shadow .8s ease; }
.js .loop .history.seen mark { box-shadow: inset 0 -2px 0 var(--m); }
.js .loop .history.seen .m-family { transition-delay: .6s; }
.js .loop .history.seen .m-records { transition-delay: .95s; }
/* Wide screens show the three steps together, so they arrive in order. */
@media (min-width: 761px) {
  .js .loop .piece-photo.seen { transition-delay: .25s; }
  .js .loop .piece-research.seen { transition-delay: .55s; }
  .js .loop .letter.seen { transition-delay: .9s; }
  .js .loop .letter.seen .m-family { transition-delay: 1.6s; }
  .js .loop .letter.seen .m-records { transition-delay: 1.95s; }
  .js .loop .story-door.seen { transition-delay: 1.3s; }
  .js .loop .piece-grow.seen { transition-delay: 1.7s; }
}

/* ---------- 3 · Kinds of story ---------- */
.kinds { background: var(--paper); padding: clamp(84px, 12vh, 124px) var(--gutter); }
.kinds-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; max-width: 1260px; margin: 0 auto 50px; }
.kinds-head h2 { max-width: 15ch; color: var(--plum); }
.kinds-grid { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1260px; margin: auto; border-top: 1px solid #d6c8b1; border-left: 1px solid #d6c8b1; }
.kinds-grid li { border-right: 1px solid #d6c8b1; border-bottom: 1px solid #d6c8b1; }
.kinds-grid a { display: flex; flex-direction: column; height: 100%; padding: 30px 30px 34px; text-decoration: none; transition: background .3s; }
.kinds-grid a:hover { background: #ece2d2; }
.kinds-grid a:hover .kind-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.device { display: flex; align-items: flex-end; gap: 10px; height: 112px; margin-bottom: 24px; color: var(--mid); }
.device-years b { font: 600 96px/.8 var(--serif); letter-spacing: -.05em; }
.device-years i { font: italic 17px/1 var(--book); color: var(--umber); padding-bottom: 6px; }
.device-silk { gap: 6px; }
.device-silk i { width: 11px; height: 100px; background: var(--s); }
.device-silk i:nth-child(1) { --s: #a45a4b; height: 92px; } .device-silk i:nth-child(2) { --s: #d8b36c; height: 84px; } .device-silk i:nth-child(3) { --s: #5e8a86; }
.device-silk i:nth-child(4) { --s: #8a5877; height: 88px; } .device-silk i:nth-child(5) { --s: #cdb88e; height: 96px; } .device-silk i:nth-child(6) { --s: #6c4a67; height: 80px; }
.device-silk i:nth-child(7) { --s: #9c7c3c; height: 94px; } .device-silk i:nth-child(8) { --s: #6a8aa3; height: 86px; } .device-silk i:nth-child(9) { --s: #b0564a; }
.device-silk i:nth-child(10) { --s: #c9a26f; height: 90px; } .device-silk i:nth-child(11) { --s: #7c6d99; height: 82px; } .device-silk i:nth-child(12) { --s: #b27a5b; height: 92px; }
.device-route { font: 600 36px/1 var(--serif); letter-spacing: -.02em; color: var(--plum); padding-bottom: 6px; }
.device-route b { color: var(--gold); font-weight: 400; }
.device-dates { padding-bottom: 8px; }
.device-dates i { font: italic 40px/1 var(--book); color: var(--plum); }
.device-dates b { font: 400 30px/1 var(--book); color: var(--gold); }
.device-year { font: 600 104px/.8 var(--serif); letter-spacing: -.05em; }
.device-recipe img { height: 112px; width: auto; border: 1px solid #ddd0b8; box-shadow: 4px 8px 14px #3a122622; transform: rotate(-3deg); }
.kind-meta { font: 500 10.5px/1.5 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--gold-text); }
.kind-title { margin: 10px 0 10px; font: 600 30px/1.05 var(--serif); letter-spacing: -.025em; color: var(--plum); }
.kind-line { font: 16.5px/1.55 var(--book); color: #5b4852; }

/* ---------- 4 · The families behind your family ---------- */
.world { background: var(--stone); color: var(--plum); padding: clamp(84px, 12vh, 124px) var(--gutter); }
.world-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3% 7%; align-items: end; max-width: 1260px; margin: 0 auto 40px; }
.world-head .eyebrow { grid-column: 1 / -1; }
.world-head h2 em { display: block; color: var(--mid); }
.world-head > p:last-child { font: 19px/1.62 var(--book); color: #4b3440; max-width: 38ch; padding-bottom: 8px; }
.world-views { max-width: 1260px; margin: auto; }
.view-switch { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border: 1px solid #bfa98a; border-radius: 999px; }
.view-switch[hidden] { display: none; }
.view-switch button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font: 13px/1 var(--sans); cursor: pointer; }
.view-switch button[aria-pressed="true"] { background: var(--plum); color: var(--paper); }
.view { margin-bottom: 26px; padding: clamp(14px, 3vw, 44px) clamp(10px, 3vw, 44px) clamp(16px, 2.4vw, 30px); background: var(--atlas); border-radius: 3px; box-shadow: 0 36px 50px -26px #3a122677; }
.view figcaption { margin-top: 14px; font: italic 16px/1.4 var(--book); color: #d8cbcf; }
.view-place img { width: 100%; }
.js .world-views.one .view { display: none; }
.js .world-views.one .view.is-shown { display: block; }

.view-time { padding: 0; background: #111a2c; overflow: hidden; }
.view-time figcaption { margin: 0; padding: 14px 22px 18px; background: #111a2c; }
.rivers { width: 100%; height: auto; }

/* ---------- 5 · The waltz ---------- */
.waltz { background: var(--night); color: var(--paper); padding: clamp(96px, 15vh, 160px) var(--gutter) clamp(80px, 11vh, 120px); }
.waltz-grid { display: grid; grid-template-columns: minmax(240px, .72fr) 1.28fr; gap: clamp(36px, 7vw, 110px); align-items: center; max-width: 1180px; margin: auto; }
.waltz-portrait img { width: 100%; max-width: 380px; margin: auto; padding: 12px; background: #d6cfba; box-shadow: 0 0 0 1px #6d5646, 0 40px 60px -20px #000a; transform: rotate(-1.5deg); }
.waltz-portrait figcaption { margin-top: 20px; text-align: center; font: italic 15px/1.4 var(--book); color: #bfaeb5; }
.waltz-copy .eyebrow { color: var(--gold-light); }
.waltz-copy h2 { margin: 18px 0 26px; font-size: clamp(44px, 5.4vw, 84px); line-height: 1; }
.waltz-copy h2 em { display: block; color: #e9d3a6; }
.waltz-copy > p:not(.eyebrow) { font: 20px/1.62 var(--book); color: #e5d6da; max-width: 40ch; }
.player { display: flex; align-items: center; gap: 20px; margin-top: 38px; }
.player audio { width: min(100%, 420px); }
.play { display: inline-flex; align-items: center; gap: 18px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.play[hidden], .time[hidden] { display: none; }
.play-icon { position: relative; display: grid; place-items: center; flex: none; width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--night) 93%, transparent 94%), conic-gradient(var(--gold-light) calc(var(--p, 0) * 360deg), #ffffff26 0); transition: transform .3s var(--ease); }
.play:hover .play-icon { transform: scale(1.05); }
.play-icon::before { content: ""; margin-left: 5px; border-left: 18px solid #f1dfb6; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.is-playing .play-icon::before { margin-left: -10px; width: 6px; height: 22px; border: 0; background: #f1dfb6; box-shadow: 11px 0 #f1dfb6; }
.play-label { font: 600 25px/1.1 var(--serif); letter-spacing: -.01em; color: var(--paper); }
.time { font: 13px/1 var(--sans); color: #bfaeb5; font-variant-numeric: tabular-nums; }
.waltz-copy > p.player-note { margin-top: 16px; font: italic 14.5px/1.5 var(--book); color: #bfaeb5; max-width: 46ch; }
.score-strip { max-width: 820px; margin: clamp(56px, 8vh, 90px) auto 0; }
.score-frame { position: relative; padding: 14px; background: #ecdfc6; box-shadow: 0 30px 50px -24px #000c; transform: rotate(-.6deg); }
.score-frame img { width: 100%; }
.score-progress { position: absolute; left: 14px; right: 14px; bottom: 5px; height: 3px; background: #3a122622; }
.score-progress::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%); background: var(--mid); }
.score-strip figcaption { margin-top: 16px; font: 12px/1.5 var(--sans); color: #a8979e; }

/* ---------- 6 · The real book ---------- */
.keep { background: var(--wood); color: var(--paper); padding: clamp(90px, 13vh, 140px) var(--gutter) clamp(80px, 11vh, 120px); text-align: center; }
.keep-head { max-width: 760px; margin: 0 auto 60px; }
.keep-head .eyebrow { color: var(--gold-light); }
.keep-head h2 { margin: 18px 0 22px; }
.keep-head h2 em { display: block; color: #e9d3a6; }
.keep-head > p:last-child { font: 19px/1.62 var(--book); color: #ddd0c4; }
.real-book { max-width: 1120px; margin: 0 auto; }
.real-spread { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #fbf7ee; box-shadow: 0 2px 0 #d9d0bf, 0 4px 0 #f4ede0, 0 6px 0 #d2c7b3, 0 8px 0 #3b2a22, 0 50px 70px -24px #000d; transform: perspective(2200px) rotateX(var(--tilt, 0deg)); transform-origin: 50% 100%; transition: transform 1.2s var(--ease); }
.real-spread::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 36px); width: 72px; background: linear-gradient(90deg, #0000, #40281817 38%, #3b24164d 50%, #40281817 62%, #0000); pointer-events: none; }
.real-spread img { width: 100%; }
.real-book figcaption { margin-top: 26px; font: italic 16px/1.5 var(--book); color: #bdb0a4; }
.js .keep .real-spread { --tilt: 16deg; }
.js .keep.in .real-spread { --tilt: 0deg; }
.editions { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1120px; margin: 56px auto 40px; border-top: 1px solid #ffffff1f; }
.editions li { padding: 20px 16px 0; font: 16px/1.5 var(--book); color: #cfc2b6; text-align: left; border-left: 1px solid #ffffff14; }
.editions li:first-child { border-left: 0; padding-left: 0; }
.editions span { display: block; margin-bottom: 4px; font: 600 23px/1.1 var(--serif); letter-spacing: -.015em; color: var(--paper); }

/* ---------- 7 · Invitation ---------- */
.invite { background: var(--plum); color: var(--paper); padding: clamp(90px, 14vh, 150px) var(--gutter); text-align: center; }
.seal { width: 34px; height: 70px; margin: 0 auto 30px; color: var(--gold-light); }
.invite h2 { max-width: 15ch; margin: 0 auto; font-size: clamp(46px, 5.8vw, 90px); }
.invite > p:not(.assure) { max-width: 36ch; margin: 26px auto 38px; font: 20px/1.6 var(--book); color: #eadbde; }
.invite .assure { margin: 16px auto 0; color: #cdb9c1; }

/* ---------- Footer ---------- */
.site-footer { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; padding: 60px var(--gutter) 70px; background: var(--paper); }
.footer-brand p { margin-top: 16px; font: 16px var(--book); }
.site-footer nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 30px; }
.site-footer nav a { font: 13px/1.4 var(--sans); text-decoration: none; padding: 10px 0; }
.site-footer nav a:hover { text-decoration: underline; }

/* ---------- Medium screens ---------- */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 40px; }
  .hero-copy { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0 6%; align-items: start; }
  .hero-copy h1 { grid-row: span 3; }
  .lede { margin-top: 0; }
  .loop { grid-template-columns: 1fr 1fr; row-gap: 52px; }
  .step-family::after, .step-search::after, .step-letter::after { display: none; }
  .kinds-grid { grid-template-columns: 1fr 1fr; }
  .editions { grid-template-columns: 1fr 1fr; row-gap: 26px; }
  .editions li:nth-child(3) { border-left: 0; padding-left: 0; }
}

/* ---------- Compact menu below laptop width ---------- */
@media (max-width: 1100px) {
  .site-nav { display: none; }
  .menu { display: block; position: relative; }
  .menu summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 16px; border: 1px solid #bfa98a; border-radius: 999px; font: 500 13px/1 var(--sans); color: var(--plum); }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] summary { background: var(--plum); color: var(--paper); border-color: var(--plum); }
  .menu nav { position: absolute; right: 0; top: calc(100% + 10px); z-index: 10; display: flex; flex-direction: column; min-width: 230px; padding: 10px 22px 16px; background: var(--paper); border: 1px solid #d8cab2; box-shadow: 0 24px 40px -18px #3a122666; }
  .menu nav a { padding: 12px 0; font: 15px/1.4 var(--sans); text-decoration: none; border-bottom: 1px solid #eadfce; }
  .menu nav .nav-app { border-bottom: 0; font-weight: 600; }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .masthead { padding: 16px 20px; }
  .wordmark { font-size: 20px; letter-spacing: .17em; }

  .hero { padding: 30px 20px 44px; gap: 34px; }
  .hero-copy { display: block; }
  .hero h1 { font-size: clamp(44px, 12.4vw, 58px); }
  .lede { margin: 20px 0 24px; font-size: 18px; }
  .button { width: 100%; }
  .edition-top { display: block; margin-bottom: 14px; }
  .edition-label { font-size: 16px; margin-bottom: 8px; }
  .chapters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 0 -20px; padding: 2px 20px 6px; scroll-snap-type: x proximity; scroll-padding-inline: 20px; }
  .chapters::-webkit-scrollbar { display: none; }
  .chapters a { flex: none; padding: 9px 14px; border: 1px solid #cdb99a; border-radius: 999px; scroll-snap-align: start; }
  .chapters a[aria-current="true"] { background: var(--plum); color: var(--paper); border-color: var(--plum); }
  .spread { grid-template-columns: 1fr; margin-bottom: 30px; }
  .spread::before { display: none; }
  .page-image { border-radius: 3px 3px 0 0; box-shadow: none; }
  .spread { min-height: 0; }
  .page-velvet .inset { top: 14px; right: 14px; width: 24%; }
  .page-image > img:first-child { flex: none; aspect-ratio: 4 / 3; height: auto; }
  .page-portrait > img:first-child, .page-dark > img:first-child { aspect-ratio: 16 / 11; }
  .page-paper { min-height: 230px; padding-top: 40px; }
  .page-caption { padding-bottom: 14px; }
  .page-image .folio { display: none; }
  .page-text { padding: 26px 22px 40px; border-radius: 0 0 2px 2px; background: var(--leaf); }
  .spread-families .page-text { display: flex; padding: 22px 22px 30px; }
  .spread-families .page-text h2 { margin: 12px 0 10px; }
  .spread-families .page-image > img:first-child { padding: 10px 8px 0; }
  .page-text h2 { font-size: 32px; }
  .page-text p { font-size: 17px; }
  .js .spread { display: none; }
  .js .spread.is-active { display: grid; }

  .gathering { padding: 72px 20px 64px; }
  .idea { display: block; margin-bottom: 48px; }
  .idea h2 { margin: 14px 0 20px; font-size: 46px; }
  .idea > p:last-child { font-size: 18px; }
  .loop { display: block; }
  .step { margin-bottom: 44px; }
  .piece-photo { margin-left: 0; }
  .piece-grow { grid-template-columns: 1fr; padding: 20px 22px; }
  .step-grow .step-title { justify-content: flex-start; }
  .gathering-note { margin-top: 20px; font-size: 19px; }

  .kinds { padding: 72px 0 64px; }
  .kinds-head { padding: 0 20px; margin-bottom: 30px; }
  .kinds-grid { display: flex; overflow-x: auto; gap: 14px; padding: 0 20px 10px; border: 0; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none; }
  .kinds-grid::-webkit-scrollbar { display: none; }
  .kinds-grid li { flex: 0 0 80%; border: 1px solid #d6c8b1; scroll-snap-align: center; background: #f7f1e7; }
  .kinds-grid a { padding: 24px 22px 28px; }
  .device { height: 92px; }
  .device-years b, .device-year { font-size: 80px; }

  .world { padding: 72px 20px; }
  .world-head { display: block; margin-bottom: 26px; }
  .world-head h2 { margin: 14px 0 18px; }
  .view { padding: 12px 8px 16px; }
  .view.view-time { padding: 0; }
  .chart-scroll { overflow-x: auto; scrollbar-width: thin; }
  .chart-scroll .rivers { min-width: 760px; }
  .view figcaption { padding: 0 8px; font-size: 15px; }

  .waltz { padding: 80px 20px 70px; }
  .waltz-grid { grid-template-columns: 1fr; gap: 36px; }
  .waltz-portrait img { max-width: 240px; }
  .waltz-copy h2 { font-size: 44px; }
  .waltz-copy > p { font-size: 18px; }
  .player { margin-top: 30px; }
  .play-icon { width: 66px; height: 66px; }
  .play-label { font-size: 22px; }
  .score-frame { padding: 8px; }
  .score-progress { left: 8px; right: 8px; bottom: 2px; }

  .keep { padding: 80px 20px 70px; }
  .keep-head { margin-bottom: 36px; text-align: left; }
  .real-book { margin: 0 -8px; }
  .real-book figcaption { padding: 0 8px; text-align: left; font-size: 15px; }
  .editions { grid-template-columns: 1fr; row-gap: 0; margin-top: 36px; }
  .editions li { border-left: 0; padding-left: 0; padding-bottom: 14px; border-bottom: 1px solid #ffffff14; }
  .keep .text-link { width: 100%; justify-content: space-between; }

  .invite { padding: 80px 20px; }
  .invite h2 { font-size: 44px; }
  .invite > p:not(.assure) { font-size: 18px; }

  .site-footer { grid-template-columns: 1fr; padding: 48px 20px 60px; }
  .site-footer nav { grid-template-columns: 1fr 1fr; }
}

/* ---------- Less motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .spread.turn-next .page-text, .js .spread.turn-prev .page-image, .js .spread.turn-next .page-image, .js .spread.turn-prev .page-text { animation: settle .25s ease both; }
  .js .loop [data-piece] { transform: none !important; transition: opacity .4s ease !important; transition-delay: 0s !important; }
  .js .loop .history mark { transition: none !important; }
  .js .keep .real-spread { --tilt: 0deg; transition: none; }
  .play-icon, .button { transition: none; }
}

/* Early access: the invitation form (one email field). Without an endpoint it hands the request to the
   visitor's email app, addressed to the support address; see INVITE_ENDPOINT in build_preview.py. */
.invite-form { margin: 4px 0 18px; max-width: 480px; }
.invite-form label { display: block; margin-bottom: 8px; font: 500 15px/1.4 var(--sans); color: var(--ink); }
.invite-row { display: flex; gap: 10px; }
.invite-row input { flex: 1; min-width: 0; height: 54px; padding: 0 16px; border: 1px solid #b9a78b; border-radius: 2px; background: #fbf7f0; font: 17px var(--sans); color: var(--ink); }
.invite-row input:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
.invite-row .button { white-space: nowrap; border: 0; cursor: pointer; }
.invite-note, .invite-done { margin-top: 12px; font: 15px/1.55 var(--sans); color: var(--muted); max-width: 46ch; }
.invite-done { color: var(--ink); }
.invite-relative { margin-top: 4px; }
.invite-done strong { font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* robots fill it in; the waiting list then saves nothing */
@media (max-width: 760px) {
  .invite-row { flex-direction: column; }
  .invite-row input { flex: none; width: 100%; }
  .invite-row .button { width: 100%; }
}

/* The headline in one upright face (founder, 23 Oct) */
.hero h1 { font-size: clamp(46px, 4.5vw, 70px); line-height: 1.02; }

/* From our first families */
.voices { padding: clamp(64px, 9vh, 104px) var(--gutter); background: var(--paper); }
.voices > .eyebrow { max-width: 1260px; margin: 0 auto 30px; }
.voices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7%; max-width: 1260px; margin: 0 auto; }
.voice blockquote { margin: 0; }
.voice blockquote p { font: 25px/1.5 var(--book); color: var(--ink); text-wrap: pretty; }
.voice blockquote p::before { content: "“"; display: block; height: 34px; font: 600 72px/1 var(--serif); color: var(--gold); }
.voice figcaption { margin-top: 18px; font: 15px/1.5 var(--sans); color: var(--muted); }
.voice figcaption b { font-weight: 600; color: var(--ink); }
@media (max-width: 760px) {
  .voices-grid { grid-template-columns: 1fr; gap: 44px; }
  .voice blockquote p { font-size: 21px; }
}
