:root {
  --bg: #1d1234; --ink: #fff6e0; --a: #ff4f79; --b: #ffd23f; --on: #1d1234;
  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --serif: "Libre Caslon Text", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #0d0a14; color: var(--ink); font: 16px/1.4 var(--font); display: grid; place-items: center; overflow: hidden; }
button, input { font: inherit; }
a { color: inherit; }

/* Story frame: 9:16 on desktop, the whole screen on phones. */
#frame {
  position: relative; overflow: hidden;
  width: min(100vw, calc(100dvh * 9 / 16)); height: min(100dvh, calc(100vw * 16 / 9));
  background: var(--bg); color: var(--ink); transition: background .45s, color .45s;
  container-type: inline-size;
}
@media (max-width: 600px) { #frame { width: 100vw; height: 100dvh; } }

.bars { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 4px; z-index: 6; }
.bars i { flex: 1; height: 3px; border-radius: 2px; background: currentColor; opacity: .25; }
.bars i.on { opacity: .95; }
.brand { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 12px); left: 14px; font-weight: 800; font-size: 14px; z-index: 6; opacity: .85; }
.close { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) - 1px); right: 2px; z-index: 7; border: 0; background: none; color: inherit; font-weight: 600; font-size: 14px; cursor: pointer; opacity: .8; padding: 0 12px; min-width: 44px; min-height: 44px; }
.tap { position: absolute; top: 0; bottom: 0; z-index: 4; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tap.prev { left: 0; width: 30%; }
.tap.next { right: 0; width: 70%; }
.hint { position: absolute; bottom: max(8px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 14px; opacity: .55; z-index: 5; pointer-events: none; }
.slide { position: absolute; inset: 0; padding: calc(max(10px, env(safe-area-inset-top)) + 54px) 7cqw calc(max(8px, env(safe-area-inset-bottom)) + 28px); display: flex; flex-direction: column; }

h1, h2, p { margin: 0; }
.kicker { font-weight: 600; font-size: 4.2cqw; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.huge { font-weight: 800; font-size: 15cqw; line-height: .92; letter-spacing: -.02em; overflow-wrap: anywhere; }
.big { font-weight: 800; font-size: 9.5cqw; line-height: 1.02; letter-spacing: -.015em; overflow-wrap: anywhere; }
.mid { font-weight: 600; font-size: 6.2cqw; line-height: 1.15; }
.small { font-size: max(14px, 3.6cqw); opacity: .8; line-height: 1.4; }
.a { color: var(--a); } .b { color: var(--b); }
.grow { flex: 1; min-height: 0; }
.center { display: flex; flex-direction: column; justify-content: center; }

/* Entrance animation, staggered by --d. */
.rise { opacity: 0; transform: translateY(18px); animation: rise .55s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--d, 0) * 120ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.pop { transform: scale(.2); opacity: 0; animation: pop .6s cubic-bezier(.2,1.4,.3,1) forwards; animation-delay: calc(var(--d, 0) * 140ms + 100ms); }
@keyframes pop { to { transform: none; opacity: 1; } }
.dot { transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.2,1.4,.3,1) both; }
@media (prefers-reduced-motion: reduce) { .rise, .pop, .dot { animation: none; opacity: 1; transform: none; } }

svg.map { width: 100%; height: 100%; display: block; }

/* Start screen */
.start { justify-content: safe center; overflow-y: auto; }
.start .field { position: relative; display: block; margin-top: 4cqw; }
.start label { display: block; font-size: max(14px, 3.6cqw); font-weight: 600; opacity: .85; margin-bottom: 1.5cqw; }
.start input { width: 100%; border: 0; border-radius: 3cqw; padding: 3.6cqw 4cqw; font-size: max(16px, 5.4cqw); font-weight: 600; background: rgba(255,255,255,.12); color: inherit; outline: none; }
.start input:focus { background: rgba(255,255,255,.2); }
.start input::placeholder { color: inherit; opacity: .4; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 10; margin-top: 1cqw; background: #2b2047; border-radius: 3cqw; overflow: hidden; box-shadow: 0 3cqw 8cqw rgba(0,0,0,.4); }
.sugg button { display: flex; justify-content: space-between; width: 100%; border: 0; background: none; color: var(--ink); text-align: left; padding: 2.8cqw 4cqw; min-height: 44px; align-items: center; font-size: 4.2cqw; font-weight: 600; cursor: pointer; }
.sugg button + button { border-top: 1px solid rgba(255,255,255,.08); }
.sugg button:hover, .sugg button:focus { background: rgba(255,255,255,.1); outline: none; }
.sugg small { opacity: .6; font-weight: 400; }
.go { margin-top: 5cqw; width: 100%; border: 0; border-radius: 99px; padding: 4cqw; font-size: 5.2cqw; font-weight: 800; background: var(--ink); color: var(--bg); cursor: pointer; }
.go:disabled { opacity: .5; cursor: default; }
.err { min-height: 1.4em; margin-top: 2cqw; font-size: max(14px, 3.6cqw); color: var(--b); }

/* Book page */
.page { background: #f3ede1; color: #221d17; border-radius: 2cqw; padding: 4cqw 5cqw; font-family: var(--serif); box-shadow: 0 2cqw 6cqw rgba(0,0,0,.3); transform: rotate(var(--rot, -1.5deg)); }
.page .hd { display: flex; justify-content: space-between; font-size: 3cqw; color: #8c8273; margin-bottom: 2cqw; font-style: italic; }
.page ol { list-style: none; margin: 0; padding: 0; font-size: 4.4cqw; line-height: 1.5; }
.page li.dim { color: #8c8273; }
.page li.blur { color: #b8ad99; letter-spacing: .3em; }
.page li.hit { color: #a3301f; font-weight: 700; font-size: 5.6cqw; position: relative; z-index: 0; }
.page li.hit::before { content: ""; position: absolute; left: -2cqw; right: -2cqw; top: 8%; bottom: 8%; background: rgba(163,48,31,.12); border-radius: 1cqw; z-index: -1; }
.page.none { font-family: var(--font); padding: 5cqw; }

/* Surname types */
.badge { border-radius: 5cqw; padding: 5cqw; color: var(--on); }
.badge .t { font-weight: 800; font-size: 7.4cqw; line-height: 1; }
.badge .who { font-size: max(14px, 3.4cqw); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; opacity: .75; margin-bottom: 1.5cqw; }
.badge p { margin-top: 2cqw; font-size: 3.8cqw; }

/* Final: card + controls */
.final { padding-top: calc(max(10px, env(safe-area-inset-top)) + 40px); gap: 3cqw; padding-left: 5cqw; padding-right: 5cqw; }
.cardwrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.card { container-type: inline-size; background: var(--cbg); color: var(--cink); border-radius: 3cqw; overflow: hidden; position: relative; display: flex; flex-direction: column; padding: 6cqw;
        box-shadow: 0 0 0 1.5px rgba(255,255,255,.18), 0 3cqw 8cqw rgba(0,0,0,.45); }
/* Stories cover the top (progress bar, profile) and bottom (reply bar, stickers) of the image; Meta suggests
   keeping ~250 px of 1920 clear at each end. The card keeps its content inside that safe zone. */
.card.story { aspect-ratio: 9 / 16; height: 100%; max-width: 100%; }
/* The content box, in % of the card (so screen and saved image match). Square posts: 6% all round. Stories, per
   Meta's guidance for Instagram, Facebook and Messenger Stories: keep the top 14% (profile, progress bar) and the
   bottom 20% (reply bar, buttons) clear, plus 6% at the sides; the background still fills the whole image. */
.card { padding: 0; }
.card > .safe { position: absolute; inset: 6%; display: flex; flex-direction: column; }
.card.story > .safe { inset: 14% 6% 20% 6%; }
.card.square { aspect-ratio: 1; width: 100%; max-height: 100%; }
.card .cb { font-weight: 800; font-size: 4cqw; letter-spacing: .04em; opacity: .85; }
.card .names { font-weight: 800; line-height: .95; letter-spacing: -.02em; margin-top: 4cqw; overflow-wrap: anywhere; }
.card.story .names { font-size: 11cqw; }
.card.square .names { font-size: 8.5cqw; }
.card .names .x { font-size: .55em; opacity: .7; }
.card .facts { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 4cqw; }
.card .f .l { font-size: 3.2cqw; text-transform: uppercase; letter-spacing: .1em; opacity: .7; font-weight: 600; }
.card .f .v { font-size: 6.4cqw; font-weight: 800; line-height: 1.05; }
.card .f.letters .v { font-size: 22cqw; line-height: .85; }
.card .f.map { flex: 1; min-height: 20cqw; }
.card .foot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6cqw; margin-top: 2cqw; font-size: 3.2cqw; opacity: .75; font-weight: 600; }  /* centred: clear of the lower-right buttons */
.controls { flex: none; display: grid; gap: 2.4cqw; font-size: max(14px, 3.4cqw); }
.row { display: flex; gap: 1.6cqw; flex-wrap: wrap; align-items: center; }
.row .lbl { font-weight: 600; opacity: .7; width: 15cqw; }
.tg { border: 1.5px solid currentColor; background: none; color: inherit; border-radius: 99px; padding: 1.2cqw 2.6cqw; font-size: max(14px, 3.2cqw); font-weight: 600; cursor: pointer; opacity: .6; }
.tg.on { background: var(--ink); color: var(--bg); border-color: var(--ink); opacity: 1; }
.tg:disabled { opacity: .25; cursor: default; }
.toast { position: fixed; left: 50%; bottom: 18cqw; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 2cqw 4cqw; border-radius: 99px; font-weight: 600; font-size: max(14px, 3.6cqw); z-index: 20; }

/* "Did you mean" under the form */
.dym { color: var(--ink); font-size: 3.8cqw; line-height: 1.5; }
.dym + .dym { margin-top: 2cqw; }
.dym button { border: 0; border-radius: 99px; margin: 1cqw 1cqw 0 0; padding: 1.4cqw 3cqw; font-weight: 700; font-size: 3.8cqw; background: var(--b); color: var(--on); cursor: pointer; }
.dym button.keep { background: none; color: inherit; border: 1.5px solid currentColor; font-weight: 600; opacity: .8; }
/* Outbound links on slides sit above the tap zones. */
.out { position: relative; z-index: 6; align-self: flex-start; margin-top: 3cqw; font-weight: 600; font-size: 3.8cqw; }

/* "Put … on the map" */

/* Story mode owns touch: no page scrolling or pull-to-refresh fighting the swipe gestures. */
#frame.story { touch-action: none; user-select: none; -webkit-user-select: none; }
.toprow { display: flex; justify-content: space-between; align-items: center; }
.clear { border: 1.5px solid currentColor; background: none; color: inherit; border-radius: 99px; padding: 1.2cqw 3.4cqw; font-weight: 600; font-size: max(14px, 3.4cqw); cursor: pointer; opacity: .75; }
.toast { display: flex; align-items: center; gap: 3cqw; }
.toast button { border: 0; background: none; color: inherit; font-weight: 800; font-size: max(14px, 3.6cqw); text-decoration: underline; cursor: pointer; padding: 0; }

/* Pull to refresh on the start screen */
.start { overscroll-behavior-y: contain; }
.ptr { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -48px); opacity: 0; z-index: 30;
       display: flex; align-items: center; gap: 2cqw; padding: 2cqw 4cqw; border-radius: 99px; background: var(--ink); color: var(--bg);
       font-weight: 700; font-size: max(14px, 3.6cqw); pointer-events: none; }
.ptr-icon { display: inline-block; transition: transform .2s; }
.ptr.ready .ptr-icon { transform: rotate(180deg); }
.ptr.spinning .ptr-icon { animation: ptrspin .7s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }

/* Top 3 towns, Wrapped style */
.top3 { display: grid; gap: 1.6cqw; margin-top: 1.5cqw; }
.rk { display: grid; grid-template-columns: 8cqw 1fr auto; align-items: center; gap: 2cqw; }
.rk .no { font-weight: 800; font-size: 7cqw; line-height: 1; }
.rk .tn { font-weight: 800; font-size: 5cqw; line-height: 1.05; }
.rk .tn small { display: block; font-weight: 400; font-size: max(14px, 3.2cqw); opacity: .7; }
.rk .v { font-weight: 600; font-size: 3.6cqw; opacity: .8; }
.card .f .v.tv { font-size: 4.6cqw; }

/* Share row and secondary links */
.linkish { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }
.start .linkish { font-size: max(14px, 3.4cqw); opacity: .8; }

/* Feedback bottom sheet */
.sheet-wrap { position: fixed; inset: 0; justify-content: center; z-index: 40; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; touch-action: auto; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(100vw, calc(100dvh * 9 / 16)); background: #2b2047; color: #fff6e0; border-radius: 5cqw 5cqw 0 0; padding: 5cqw 5cqw calc(5cqw + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2,.8,.2,1); max-height: 90%; overflow-y: auto; }
@keyframes up { from { transform: translateY(100%); } }
.sheet-hd { display: flex; justify-content: space-between; align-items: center; font-size: 4.6cqw; margin-bottom: 3cqw; }
.sheet-x { border: 0; background: none; color: inherit; font-size: 4.6cqw; cursor: pointer; opacity: .8; }
.sheet .chips { display: flex; flex-wrap: wrap; gap: 2cqw; margin-bottom: 3cqw; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; border: 1.5px solid currentColor; border-radius: 99px; padding: 1.6cqw 3cqw; font-size: max(14px, 3.4cqw); font-weight: 600; cursor: pointer; opacity: .75; }
.chip input:checked + span { background: #fff6e0; color: #1d1234; border-color: #fff6e0; opacity: 1; }
.chip input:focus-visible + span { outline: 2px solid #ffd23f; }
.sheet textarea, .sheet input[type=email] { width: 100%; border: 0; border-radius: 3cqw; padding: 3cqw; font: inherit; font-size: max(16px, 4cqw); background: rgba(255,255,255,.12); color: inherit; outline: none; margin-bottom: 2.4cqw; resize: none; }
.sheet .check { display: flex; gap: 2cqw; align-items: flex-start; font-size: max(14px, 3.4cqw); margin-bottom: 2.4cqw; opacity: .9; }
.sheet .go { margin-top: 1cqw; background: #fff6e0; color: #1d1234; }
.sheet-note { font-size: max(14px, 3cqw); opacity: .7; margin: 2cqw 0 0; text-align: center; }
.sheet-done { text-align: center; padding: 6cqw 0; }

/* Start screen: the page itself scrolls (so phone browsers can tuck their address bar away), and our
   pull-to-refresh replaces the browser's. The story keeps its fixed full-screen frame. */
html.start-mode { overscroll-behavior-y: none; }
html.start-mode body { overflow-y: auto; align-items: start; }
html.start-mode #frame { height: auto; min-height: min(100dvh, calc(100vw * 16 / 9)); overflow: visible; }
@media (max-width: 600px) { html.start-mode #frame { min-height: 100dvh; } }
html.start-mode .slide.start { position: relative; inset: auto; min-height: inherit; overflow: visible; }
.topbtns { display: flex; gap: 2cqw; align-items: center; }
.help { width: 8cqw; height: 8cqw; border-radius: 50%; border: 1.5px solid currentColor; background: none; color: inherit; font-weight: 800; font-size: 4cqw; line-height: 1; cursor: pointer; opacity: .8; padding: 0; }
.field .xclear { position: absolute; right: 2cqw; bottom: 2.9cqw; width: 8cqw; height: 8cqw; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: inherit; font-size: 5cqw; line-height: 1; cursor: pointer; padding: 0; }
.field input { padding-right: 12cqw; }
.sheet-body p { margin: 0 0 3cqw; font-size: 3.8cqw; line-height: 1.5; opacity: .92; }
.sheet-links { display: flex; justify-content: center; gap: 2cqw; font-size: max(14px, 3.6cqw); font-weight: 600; margin-top: 1cqw; }

/* A best-effort OCR reading: dashed highlight so it reads as "probably" */
.page.fuzzy li.hit::before { background: none; border: 1.5px dashed rgba(163,48,31,.6); }

/* Fun facts */
.ff { background: rgba(255,255,255,.07); border-radius: 4cqw; padding: 4cqw; }
.ff-name { font-weight: 800; font-size: 6cqw; margin-bottom: 2cqw; }
/* Label on its own line above the text: side by side, long labels like NEIGHBOURS ran into the text. */
.ff-row { padding: 1.8cqw 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 3.8cqw; line-height: 1.4; }
.ff-l { display: block; font-weight: 700; font-size: max(14px, 2.9cqw); text-transform: uppercase; letter-spacing: .08em; opacity: .65; margin-bottom: .6cqw; }
.ff-t { display: block; }

/* ---------- Phase 1 visuals ---------- */
/* Soft glows from the theme colours plus a faint grain, behind every slide. */
#frame::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 88% -5%, color-mix(in srgb, var(--a) 30%, transparent), transparent 62%),
    radial-gradient(100% 60% at -5% 105%, color-mix(in srgb, var(--b) 24%, transparent), transparent 62%); }
#frame::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.slide { z-index: 1; }

/* Letter ripple */
svg text.lit { transform-box: fill-box; transform-origin: center; animation: lit .5s cubic-bezier(.2,1.4,.3,1) both; }
@keyframes lit { from { opacity: .15; transform: scale(.3); } }



/* Confetti */
canvas.confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 15; pointer-events: none; }

/* Share card tilt and glare */
.card { transition: transform .25s ease-out; will-change: transform; }
.card.tilting { transition: none; }
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(60% 45% at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.22), transparent 70%); }
.card.tilting::after { opacity: 1; }

/* ? sheet extras */
.sheet-body .credits { font-size: max(14px, 3.2cqw); opacity: .7; }
.sheet-body .check { display: flex; gap: 2cqw; align-items: center; min-height: 44px; font-size: 3.8cqw; font-weight: 600; margin-top: 1cqw; }

/* Less motion: the switch in the ? sheet does what the system setting does. */
html.less-motion .rise, html.less-motion .pop, html.less-motion .dot, html.less-motion svg text.lit { animation: none !important; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  svg text.lit { animation: none !important; opacity: 1; }
  .card { transition: none; }
}

/* Two pages on the book slide: smaller so the stage fits under the headline */

/* ---------- Phase 2: map camera ---------- */
/* Town markers and the province label appear once the camera arrives; the arc draws itself on the way. */
svg .tm { opacity: 0; transform-box: fill-box; transform-origin: center; }
svg.arrived .tm { animation: tm .45s cubic-bezier(.2,1.4,.3,1) both; }
svg.arrived .tm:nth-of-type(2) { animation-delay: .12s; } svg.arrived .tm:nth-of-type(3) { animation-delay: .24s; }
@keyframes tm { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
svg[data-camera] .lbl { opacity: 0; transition: opacity .4s; }
svg[data-camera].arrived .lbl { opacity: 1; }
svg .arc { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .7; }
svg.drawarc .arc { transition: stroke-dashoffset 1.4s ease-in-out; stroke-dashoffset: 0; }
svg.still .arc { transition: none; }
svg.still .tm, svg.still .lbl { animation: none; opacity: 1; }
html.less-motion svg .tm, html.less-motion svg .lbl { animation: none !important; opacity: 1 !important; }

/* Sources sheet */
.src { margin-bottom: 14px; }
.src-name { font-weight: 800; font-size: 1.05em; margin-bottom: 4px; }
.src .ff-t a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Phase 3: fact cards ---------- */
/* Slides sit above the tap zones but let taps through, except on things meant to be pressed (buttons, links,
   the fact deck). Without this, buttons inside a slide were covered by the invisible next/back zones. */
#frame.story > .slide:not(.final) { z-index: 5; pointer-events: none; }
#frame.story > .slide:not(.final) :is(a, button, input, label, select, textarea, .deck, .dots) { pointer-events: auto; }

.deckwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 1cqw; margin: 3cqw -7cqw 2cqw; }
/* A stack: cards on top of each other; pos 0 is the top card, 1 and 2 peek out above it, the rest wait behind. */
.deck { flex: 0 1 118cqw; min-height: 0; position: relative; margin-top: 7cqw; touch-action: pan-y; }
.fc { position: absolute; left: 10cqw; right: 10cqw; top: 0; bottom: 0; perspective: 1400px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; outline: none; transform-origin: 50% 0;
  transition: transform .4s cubic-bezier(.2,.9,.25,1.05), opacity .3s, filter .3s; }
.fc[data-pos="0"] { z-index: 3; }
.fc[data-pos="1"] { z-index: 2; transform: translateY(-3.5cqw) scale(.95); filter: brightness(.8); }
.fc[data-pos="2"] { z-index: 1; transform: translateY(-7cqw) scale(.9); filter: brightness(.65); }
.fc[data-pos="x"] { z-index: 0; transform: translateY(-7cqw) scale(.9); opacity: 0; pointer-events: none; }
.fc.dragging { transition: none; }
html.less-motion .fc { transition: none; }
.fc-in { position: relative; height: 100%; transition: transform .6s cubic-bezier(.3,1.3,.5,1); transform-style: preserve-3d; }
.fc.flipped .fc-in { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; border-radius: 5cqw; padding: 5cqw; display: flex; flex-direction: column;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.fc-front { background: var(--a); color: var(--on); box-shadow: 0 3cqw 8cqw rgba(0,0,0,.3); }
.fc.b .fc-front { background: var(--b); }
.fc-back { transform: rotateY(180deg); background: #2b2047; background: color-mix(in srgb, var(--bg) 82%, white);
  border: 2px solid var(--a); color: var(--ink); }
.fc.b .fc-back { border-color: var(--b); }
.fc:focus-visible .fc-face { outline: 3px solid var(--ink); outline-offset: 2px; }
.fc-top { display: flex; justify-content: space-between; align-items: center; font-size: max(14px, 3.2cqw); font-weight: 700; opacity: .75; }
.fc-name { text-transform: uppercase; letter-spacing: .08em; }
.fc-l { margin-top: 5cqw; font-size: max(14px, 3.4cqw); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.fc-t { margin-top: 2cqw; font-size: 6.6cqw; font-weight: 800; line-height: 1.18; letter-spacing: -.01em; }
.fc-t.long { font-size: 5.2cqw; }
.fc-list { list-style: none; padding: 0; margin: 2cqw 0 0; display: flex; flex-direction: column; gap: 2.4cqw; font-size: 5.2cqw; font-weight: 800; line-height: 1.2; }
.fc-list li { padding-left: 4cqw; position: relative; }
.fc-list li::before { content: ""; position: absolute; left: 0; top: .45em; width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: currentColor; opacity: .5; }
.fc-hint { margin-top: auto; font-size: max(14px, 3.2cqw); font-weight: 700; opacity: .6; }
.fc-why { margin-top: 3cqw; overflow-y: auto; font-size: max(14px, 3.7cqw); line-height: 1.5; }
.fc-why p { margin: 0 0 2.6cqw; }
.fc-why a, .fc-why .linkish { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 700; }
.dots { display: flex; justify-content: center; }
/* The visible dot is small; the button around it is a finger-sized target: 44px tall, and as wide as ten dots
   allow on a phone (two names, five cards each). */
.dots button { width: 9cqw; max-width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dots button::before { content: ""; width: 2.4cqw; height: 2.4cqw; border-radius: 99px; background: var(--a); opacity: .35; transition: width .25s, opacity .25s; }
.dots button.b::before { background: var(--b); }
.dots button.on::before { width: 6cqw; opacity: 1; }
html.less-motion .fc-in, html.less-motion .dots button::before { transition: none; }
@media (prefers-reduced-motion: reduce) { .fc-in, .dots button::before { transition: none; } }

/* ---------- Last page: share icons and a folding Customize panel ---------- */
.custom { display: grid; gap: 2.4cqw; }
.custom-tg { justify-self: center; border: 0; background: none; color: inherit; padding: 0 2cqw; min-height: 32px;
  font-size: max(14px, 3.3cqw); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; opacity: .85; }
.controls { grid-template-columns: minmax(0, 1fr); }
.si { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: inherit;
  font: inherit; text-decoration: none; cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.si span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); transition: transform .15s; }
.si:active span { transform: scale(.92); }
.si svg { width: 22px; height: 22px; }
.si small { font-size: 12px; font-weight: 600; opacity: .85; white-space: nowrap; }
.done { width: 100%; min-height: 48px; border: 0; border-radius: 99px; background: var(--a); color: var(--on); font: inherit; font-weight: 800; font-size: max(16px, 4.4cqw); cursor: pointer; }

/* ---------- Real map ---------- */
svg .land path { fill: currentColor; fill-opacity: .07; stroke: currentColor; stroke-opacity: .22; stroke-width: .7px;
  vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg .land path.home { stroke-opacity: .6; }
svg .land path.shade { stroke-opacity: .35; animation: shade .5s ease-out both; }
@keyframes shade { from { opacity: 0; } to { opacity: 1; } }
svg .ringline { fill: none; stroke: currentColor; stroke-width: 2.2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
html.less-motion svg .land path.shade { animation: none; }
@media (prefers-reduced-motion: reduce) { svg .land path.shade { animation: none; } }
#frame.story > .slide:not(.final) [data-zoom] { pointer-events: auto; cursor: pointer; }
svg .tm .tzl { opacity: 0; transition: opacity .3s; pointer-events: none; }
svg .tm.zoomed .tzl { opacity: 1; }
.top3 .rk { border-radius: 2cqw; transition: background .2s; -webkit-tap-highlight-color: transparent; }
.top3 .rk.on { background: rgba(255,255,255,.1); }
/* The share card is a still image: no fade-ins, or the saved picture could catch them half-way. */
.card svg .land path.shade, .card .dot { animation: none; }
.card.dense .facts { gap: 2.6cqw; } .card.dense .f .v { font-size: 5.4cqw; } .card.dense .f .v.tv { font-size: 4cqw; } .card.dense .f.letters .v { font-size: 16cqw; }
.card.denser .facts { gap: 1.8cqw; } .card.denser .f .v { font-size: 4.6cqw; } .card.denser .f .v.tv { font-size: 3.5cqw; } .card.denser .f.letters .v { font-size: 12cqw; }


/* The tapped town's real boundary in the close-up. */
svg .townline { fill: currentColor; fill-opacity: .14; stroke: currentColor; stroke-width: 1.6px; vector-effect: non-scaling-stroke;
  stroke-linejoin: round; animation: shade .4s ease-out both; pointer-events: none; }
html.less-motion svg .townline { animation: none; }

/* ---------- Map polish ---------- */
/* Letter map: the coastline, faintly, under the letters. */
svg .coast path { fill: currentColor; fill-opacity: .045; stroke: currentColor; stroke-opacity: .12; stroke-width: .5px; vector-effect: non-scaling-stroke; }
/* Home map: callouts are page elements over the map, so they stay readable at any map size. */
.mapwrap { position: relative; width: 100%; height: 100%; }
.callouts { position: absolute; inset: 0; pointer-events: none; transition: opacity .3s; }
.mapwrap.zoomed .callouts { opacity: 0; }
.mapwrap.zoomed .callouts .co { pointer-events: none; }
.callouts .leaders { position: absolute; inset: 0; overflow: visible; }
.callouts .leaders line { stroke: currentColor; stroke-width: 1; opacity: .6; }
.co { position: absolute; display: flex; align-items: center; gap: 1.4cqw; padding: 1cqw 2.6cqw 1cqw 1cqw; border-radius: 99px;
  border: 1.5px solid currentColor; background: var(--bg); color: inherit; font: inherit; font-size: max(14px, 3.3cqw); font-weight: 800;
  white-space: nowrap; cursor: pointer; pointer-events: auto; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; -webkit-tap-highlight-color: transparent; }
.co .no { width: max(22px, 4.6cqw); height: max(22px, 4.6cqw); border-radius: 50%; display: grid; place-items: center; font-size: max(14px, 2.8cqw); color: var(--on); background: var(--a); }
.co.b .no { background: var(--b); }
html.less-motion .co { animation: none; }
.zoomout { position: absolute; top: 1cqw; left: 50%; transform: translateX(-50%); border: 0; border-radius: 99px; padding: 1.6cqw 3.6cqw;
  background: var(--ink); color: var(--bg); font: inherit; font-size: max(14px, 3.3cqw); font-weight: 800; cursor: pointer; z-index: 2; }
.zoomout[hidden] { display: none; }
#frame.story > .slide:not(.final) :is(.co, .zoomout) { pointer-events: auto; }
/* Share card "split": the map behind the right half, full height; the facts in the left column over it. */
.card.split .f:not(.map) { position: relative; z-index: 1; text-shadow: 0 0 1.6cqw var(--cbg), 0 0 .8cqw var(--cbg), 0 0 .4cqw var(--cbg); }
/* The whole map, never cropped: inside the card's safe area, behind the facts, dimmed so the text reads first. */
.card.split .f.map { position: absolute; z-index: 0; left: 0; right: 0; top: 17%; bottom: 9%; min-height: 0; opacity: .75; pointer-events: none; }  /* within .safe */
.card.split .f.map svg { width: auto; height: 100%; margin-left: auto; }  /* hug the right edge, away from the text */
.card.split.dense .f.map { opacity: .38; }  /* crowded: dim it further so the text reads first */
/* If facts still don't fit, they run down past the space, never up over the names. */
.card .facts { justify-content: safe center; }

/* Last page: the three themes as a fanned hand of cards. The front one is shared; the others tilt out behind it,
   dimmed, from a pivot near the bottom like cards held in a hand. */
.cardstrip { position: relative; height: 100%; width: 100%; touch-action: pan-y; cursor: grab; }
.cslide { position: absolute; top: 0; left: 50%; width: var(--cw, 62%); height: 100%; margin-left: calc(var(--cw, 62%) / -2);
  display: grid; place-items: center; transform-origin: 50% 92%; transition: transform .42s cubic-bezier(.2,.9,.25,1.05), filter .3s; }
.cslide.front { z-index: 3; }
.cslide.left { z-index: 1; transform: translateX(-17%) rotate(-8deg) scale(.9); filter: brightness(.7); }
.cslide.right { z-index: 2; transform: translateX(17%) rotate(8deg) scale(.9); filter: brightness(.7); }
.cslide.dragging { transition: none; cursor: grabbing; }
.cslide .card.story, .cslide .card.square { width: 100%; height: auto; max-width: none; max-height: none; }  /* shape kept by aspect-ratio */
html.less-motion .cslide { transition: none; }
.themes { display: flex; justify-content: center; gap: 2cqw; }
.themes button { border: 0; background: none; color: inherit; font: inherit; font-size: max(14px, 3.2cqw); font-weight: 700; opacity: .55;
  padding: 1cqw 2.4cqw; border-radius: 99px; cursor: pointer; }
.themes button.on { opacity: 1; background: rgba(255,255,255,.12); }
.sheet-body h3 { margin: 4cqw 0 1.6cqw; font-size: max(14px, 3.4cqw); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }

/* The book slide's link to the virtual book */
.booklink { color: inherit; font-weight: 800; font-size: 4cqw; text-decoration: underline; text-underline-offset: .2em; position: relative; z-index: 3; }

/* ---------- Accessibility ---------- */
/* Finger-sized targets: small controls keep their look, and an invisible ::after makes the tap area at least
   44 x 44 px. */
:is(.tg, .clear, .help, .sheet-x, .chip span, .custom-tg, .themes button, .dym button, .toast button,
    .sheet-links :is(a, .linkish)) { position: relative; }
:is(.tg, .clear, .help, .xclear, .sheet-x, .chip span, .custom-tg, .themes button, .dym button, .toast button,
    .sheet-links :is(a, .linkish), .co, .zoomout, .out, .booklink, .rk[data-zoom])::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
.top3 .rk[data-zoom] { position: relative; }

/* Keyboard focus: a ring in the slide's ink; mouse and touch focus stay unstyled. The sheets have fixed colours. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.start input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sugg button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.sheet :focus-visible, .sheet textarea:focus-visible, .sheet input[type=email]:focus-visible { outline: 2px solid #fff6e0; outline-offset: 2px; }
.fc:focus-visible { outline: none; }  /* the card's face gets the ring (above) */

/* Less motion, from the ? switch or the phone's setting: sheets appear in place, and callouts, town outlines and
   cards stop sliding and fading. */
html.less-motion :is(.sheet-wrap, .sheet, .co, svg .townline) { animation: none !important; }
html.less-motion :is(.fc, .fc-in, .cslide, .callouts, svg.drawarc .arc) { transition: none !important; }
/* Counting numbers keep their width, so the line doesn't jiggle as they climb. */
[data-count] { font-variant-numeric: tabular-nums; }

/* Tap a province: an invisible copy of each shaded province, a little fatter (the stroke) so small islands are
   easier to hit, opens a callout with its name and share. */
svg .hits path { fill: transparent; stroke: transparent; stroke-width: 10px; vector-effect: non-scaling-stroke; stroke-linejoin: round;
  cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
#frame.story > .slide:not(.final) [data-prov] { pointer-events: all; }
svg .hits path.picked, svg .hits path:focus-visible { fill: currentColor; fill-opacity: .22; }
.provtip { position: absolute; z-index: 8; max-width: calc(100% - 16px); display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em 1.6cqw;
  padding: 1.4cqw 3cqw; border-radius: 3cqw; border: 1.5px solid currentColor; background: var(--bg); color: var(--ink);
  font-size: max(14px, 3.3cqw); font-weight: 600; line-height: 1.25; pointer-events: none; box-shadow: 0 2cqw 5cqw rgba(0,0,0,.3);
  animation: rise .3s cubic-bezier(.2,.8,.2,1) both; }
.provtip b { font-weight: 800; }

html.less-motion .provtip { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .provtip { animation: none !important; }
  .sheet-wrap, .sheet, .co, svg .townline { animation: none !important; }
  .fc, .fc-in, .cslide, .callouts, svg.drawarc .arc { transition: none !important; }
  svg .tm, svg[data-camera] .lbl { animation: none !important; opacity: 1 !important; }
}


/* ---------- The history slides (2-7) ---------- */
/* Running text on the history slides: lighter than .mid, so a paragraph reads as prose. */
/* Each history slide ends with its sources, small, at the bottom. */
.srcline { flex: none; margin-top: 2.5cqw; font-size: max(12px, 3.1cqw); line-height: 1.35; opacity: .7; }
/* Slide 7: how many carry a name from the book, by region (meta.coverage), and the other ways. */
.cov { display: grid; gap: .5cqw; margin-top: 2.5cqw; }
.cov-r { display: grid; grid-template-columns: 26cqw 1fr 15cqw; align-items: center; gap: 2cqw; font-size: max(12px, 3.3cqw); font-weight: 700; line-height: 1.15; }
.cov-t { position: relative; height: 2.6cqw; border-radius: 99px; background: rgba(0,0,0,.1); }
.cov-t i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: currentColor; }
.cov-t i.rng { opacity: .45; }
.cov-v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* History fact cards: the same for everyone, in the ink colour. */
.fc.h .fc-front { background: var(--ink); color: var(--bg); }
.fc.h .fc-back { border-color: var(--ink); }
.dots button.h::before { background: var(--ink); }
/* The ? sheet's reading list. */
.sheet-body .reading { margin: 0 0 3cqw; padding-left: 4.5cqw; font-size: max(14px, 3.4cqw); line-height: 1.4; opacity: .9; }
.sheet-body .reading li + li { margin-top: 1.4cqw; }

/* ---------- Story v3 ---------- */
/* Top bar: ‹ back, the brand, a shortcut to your card, ✕. */
.back { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) - 1px); left: 0; z-index: 7; border: 0; background: none; color: inherit;
  font-size: 26px; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; opacity: .85; }
.back:disabled { opacity: .2; cursor: default; }
.brand { left: 42px; }
.toshare { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) - 1px); right: 46px; z-index: 7; border: 0; background: none; color: inherit;
  min-width: 44px; min-height: 44px; display: grid; place-items: center; cursor: pointer; opacity: .85; padding: 0; }
.toshare svg { width: 20px; height: 20px; }
/* A name never breaks across lines; fitText shrinks it to fit. */
[data-fit] { white-space: nowrap; overflow-wrap: normal; }
[data-fit]:has(.nm) { white-space: normal; }
.nm { display: inline-block; white-space: nowrap; overflow-wrap: normal; }
.fc-who, .hl .nm { white-space: nowrap; }
/* History cards: a hero (a big serif word, number or picture), the headline, one line, the source. */
.hero-wrap { align-items: center; text-align: center; padding: 2cqw 0; }
.hero { font-family: var(--serif); font-weight: 700; font-size: 17cqw; line-height: 1; letter-spacing: -.01em; max-width: 100%; }
.gloss { font-family: var(--serif); font-style: italic; font-size: max(15px, 5cqw); opacity: .85; margin-top: 1.5cqw; }
.slide > .big { font-size: 8.4cqw; margin-top: 2cqw; }
.line { margin-top: 2.4cqw; font-size: max(15px, 4.5cqw); font-style: italic; font-family: var(--serif); line-height: 1.35; }
.tiny { margin-top: 2cqw; font-size: max(13px, 3.4cqw); line-height: 1.35; opacity: .9; }
.tiny .tag { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: max(12px, 2.9cqw); opacity: .75; }
.tiny .cite { opacity: .7; }
/* The hook */
.hooknames { font-weight: 800; font-size: 9cqw; line-height: 1.05; letter-spacing: -.015em; }
.hooknames .x { opacity: .6; font-size: .7em; }
.hooknames.big-names { font-size: 13cqw; text-align: center; }
h1.hook { font-family: var(--serif); font-weight: 700; font-size: 11cqw; line-height: 1.05; margin-top: 4cqw; letter-spacing: -.01em; }
/* 1c: Di-ma- names that flip to their meaning */
.chips4 { display: grid; grid-template-columns: 1fr 1fr; gap: 2cqw; margin-top: 3cqw; }
.flipchip { position: relative; min-height: 44px; border: 1.5px solid currentColor; border-radius: 3cqw; background: rgba(0,0,0,.08); color: inherit;
  font: inherit; font-weight: 800; font-size: max(14px, 3.8cqw); line-height: 1.15; padding: 1.4cqw 2cqw; cursor: pointer; }
.flipchip .bk { display: none; font-family: var(--serif); font-style: italic; font-weight: 400; }
.flipchip.on { background: currentColor; }
.flipchip.on .fr { display: none; }
.flipchip.on .bk { display: inline; color: var(--bg); filter: none; }
/* 3: one name down a tax list */
.ledger { width: 100%; max-width: 78cqw; background: #f3ede1; color: #221d17; border-radius: 2cqw; padding: 3cqw 4cqw; font-family: var(--serif);
  box-shadow: 0 2cqw 6cqw rgba(0,0,0,.3); transform: rotate(-1.5deg); text-align: left; }
.ledger .lhd { display: flex; justify-content: space-between; font-size: max(12px, 3cqw); font-style: italic; color: #8c8273; border-bottom: 1px solid #c9bfae; padding-bottom: 1cqw; }
.ledger .lrow { display: flex; gap: 3cqw; font-size: max(14px, 4.4cqw); line-height: 1.6; border-bottom: 1px solid #e2d9c8; }
.ledger .lrow span { color: #8c8273; width: 4cqw; text-align: right; }
/* 4: the cover, with two real pages fanned behind it */
.bookfan { position: relative; width: 44cqw; height: 46cqw; margin-bottom: 3cqw; }
.bookfan img { position: absolute; top: 0; width: 30cqw; height: auto; border-radius: 1cqw; box-shadow: 0 2cqw 5cqw rgba(0,0,0,.35); }
.bookfan .cover { left: 0; transform: rotate(-6deg); }
.bookfan .pg { left: 14cqw; background: #fff; animation: fan .8s cubic-bezier(.2,.8,.2,1) both; }
.bookfan .p1 { --to: 6deg; animation-delay: .5s; }
.bookfan .p2 { --to: 14deg; left: 17cqw; animation-delay: .7s; }
@keyframes fan { from { opacity: 0; transform: rotate(-6deg) translateX(-14cqw); } to { opacity: 1; transform: rotate(var(--to)); } }
.bookfan .p1, .bookfan .p2 { transform: rotate(var(--to)); }
/* 5: old Albay, letter by letter */
.mapbox { min-height: 0; display: grid; place-items: center; margin: 1cqw -3cqw 0; }
svg.albay { width: 100%; height: 100%; max-height: 100%; }
svg.albay .land path { fill: currentColor; fill-opacity: .06; stroke: currentColor; stroke-opacity: .25; stroke-width: .6px; vector-effect: non-scaling-stroke; }
svg.albay .land path.old { fill-opacity: .16; stroke-opacity: .55; }
svg.albay .stop { animation: stop .5s cubic-bezier(.2,1.4,.3,1) both; animation-delay: calc(var(--d) * 380ms + 400ms); transform-box: fill-box; transform-origin: center; }
@keyframes stop { from { opacity: 0; transform: scale(.4); } }
svg.albay circle { fill: currentColor; }
svg.albay .L { font-family: var(--serif); font-weight: 700; font-size: 2.6px; fill: var(--a); paint-order: stroke; stroke: var(--bg); stroke-width: .5px; }
svg.albay .nm { font-size: .95px; font-weight: 700; fill: currentColor; paint-order: stroke; stroke: var(--bg); stroke-width: .3px; display: inline; }
/* 6: the real 1849 page, dark around the visitor's line */
.turn { align-items: stretch; }
.scan { position: relative; width: 100%; overflow: hidden; border-radius: 2.5cqw; background: #fff; box-shadow: 0 2cqw 6cqw rgba(0,0,0,.35); }
.scan img { position: absolute; max-width: none; height: auto; display: block; }
.scan .glow { position: absolute; border-radius: 1cqw; box-shadow: 0 0 0 999px rgba(16, 10, 24, .74), 0 0 0 2px var(--a), 0 0 4cqw 1cqw color-mix(in srgb, var(--a) 60%, transparent);
  animation: glow 1s ease-out .5s both; }
@keyframes glow { from { box-shadow: 0 0 0 999px rgba(16, 10, 24, 0), 0 0 0 2px transparent, 0 0 0 0 transparent; } }
.dimname { text-align: center; }
.halves { gap: 3cqw; justify-content: center; }
.half .hl { font-size: max(15px, 4.4cqw); font-weight: 600; margin-bottom: 1.4cqw; }
.half .page { transform: none; padding: 3cqw 4cqw; }
.half .page ol { font-size: 3.9cqw; line-height: 1.4; }
.half .page li.hit { font-size: 4.8cqw; }
.booklink.sm { font-size: max(14px, 3.6cqw); }
.halves .tiny { margin-top: 1cqw; }
/* 7a: how many carry a name from the book */
.slide .cov { margin-top: 2cqw; }
/* 7b: the other ways, lighting up in turn */
.ways { display: flex; flex-wrap: wrap; gap: 1.6cqw; margin-top: 2.4cqw; }
.way { padding: 1.4cqw 3cqw; border-radius: 99px; border: 1.5px solid currentColor; font-weight: 700; font-size: max(14px, 3.7cqw);
  animation: way 2.4s ease-in-out both; animation-delay: calc(var(--d) * 450ms + 700ms); opacity: .5; }
@keyframes way { 0% { opacity: .35; } 20%, 45% { opacity: 1; background: var(--ink); color: var(--bg); } 100% { opacity: 1; } }
.way { color: inherit; }
/* Decks: hero type on the cards */
.fc-body { display: flex; flex-direction: column; min-height: 0; }
.fc-hero { margin-top: 2.5cqw; font-family: var(--serif); font-weight: 700; font-size: 15cqw; line-height: 1; letter-spacing: -.01em; }
.fc-head { margin-top: 2cqw; font-size: 5.6cqw; font-weight: 800; line-height: 1.15; }
.fc-line { margin-top: 2cqw; font-size: max(14px, 4cqw); font-weight: 600; line-height: 1.32; }
.fc-rows { display: grid; gap: 2.6cqw; margin-top: 3cqw; }
.fc-row { display: grid; }
.fc-who { font-size: max(12px, 3cqw); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.fc-v { font-family: var(--serif); font-weight: 700; font-size: 9cqw; line-height: 1.05; }
.fc-v.sm { font-size: 6.4cqw; }
.fc-row small { font-size: max(13px, 3.4cqw); font-weight: 600; line-height: 1.3; opacity: .85; }
.fc-src { margin-top: auto; padding-top: 2cqw; font-size: max(11px, 2.8cqw); line-height: 1.3; opacity: .7; }
.fc-name { flex: 1; min-width: 0; display: block; }
.fc.ab .fc-front { background: linear-gradient(140deg, var(--a), var(--b)); }
.fc.ab .fc-back { border-color: var(--a); }
.dots button.ab::before { background: linear-gradient(90deg, var(--a), var(--b)); }
.fc.exit .fc-front { background: none; color: var(--ink); border: 2px dashed currentColor; box-shadow: none; justify-content: center; text-align: center; }
.fc.exit .makecard { margin-top: 5cqw; align-self: center; }
.dots button.exit::before { background: var(--ink); }
.fc .por { width: 16cqw; height: 16cqw; object-fit: cover; object-position: 50% 12%; border-radius: 50%; box-shadow: 0 0 0 2px currentColor; margin-top: 2cqw; }
/* The Clavería deck: its cards hold more text, so a smaller hero */
.deck[data-tap="next"] .fc-hero { font-size: 9cqw; }
.deck[data-tap="next"] .fc-head { font-size: 5cqw; }
.deck[data-tap="next"] .fc-line { font-size: max(13px, 3.5cqw); }
.deck[data-tap="next"] { flex-basis: 132cqw; margin-top: 5cqw; }
/* The fun-facts way out, always visible */
.deckfoot { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; margin-top: 1cqw; }
.makecard { border: 0; border-radius: 99px; min-height: 44px; padding: 0 5cqw; background: var(--a); color: var(--on); font: inherit; font-weight: 800; font-size: max(15px, 4.2cqw); cursor: pointer; }
.deckfoot .linkish { font-size: max(14px, 3.4cqw); opacity: .85; }
/* Less motion */
html.less-motion :is(.bookfan .pg, svg.albay .stop, .scan .glow, .way) { animation: none !important; }
html.less-motion .way { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .bookfan .pg, svg.albay .stop, .scan .glow, .way { animation: none !important; }
  .way { opacity: 1; }
}
/* As many dots as cards, however many: they share the width, each still a finger-high target. */
.dots { padding: 0 4cqw; }
.dots button { flex: 0 1 9cqw; min-width: 0; }

/* ---------- Round 2 ---------- */
/* The share slide: one row of three, Share · Save · Copy link. */
.shares { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2cqw; }
.shares.one { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.si span { width: 44px; height: 44px; background: var(--ink); color: var(--bg); }
.inapp { text-align: center; font-size: max(14px, 3.6cqw); font-weight: 600; line-height: 1.3; }
/* Optional decks (Before Spain, what the names were for): the cards read like the slide itself. */
.fc.st .fc-front { background: color-mix(in srgb, var(--ink) 9%, var(--bg)); color: var(--ink); box-shadow: 0 2cqw 6cqw rgba(0,0,0,.25);
  border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); }
.fc.st .fc-l { display: none; }
.fc.st .fc-hero { font-size: 13cqw; margin-top: 3cqw; }
.fc-gloss { font-family: var(--serif); font-style: italic; font-size: max(15px, 4.6cqw); opacity: .85; margin-top: .6cqw; }
.fc.st .fc-head { font-size: 6.2cqw; margin-top: 3cqw; }
.fc-line.st { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: max(15px, 4.3cqw); line-height: 1.35; }
.fc-note { margin-top: 2cqw; font-size: max(13px, 3.4cqw); line-height: 1.35; opacity: .9; }
.fc.st .chips4 { margin-top: 2.5cqw; }
.fc.st .fc-hero .x { opacity: .6; font-size: .6em; }
.dots button.st::before { background: var(--ink); }
.deck[data-tap="story"] { flex: 1 1 auto; margin-top: 8cqw; }
/* The mosaic slide's myth check */
.myth { margin-top: 2cqw; padding: 2cqw 3cqw; border-radius: 3cqw; background: rgba(0,0,0,.12); font-size: max(13px, 3.4cqw); line-height: 1.35; }
.myth .tag { display: block; font-size: max(12px, 2.9cqw); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin-bottom: .6cqw; }
/* Sources are links: a quiet underline, the same small size, and a finger-high tap area that doesn't move the
   layout (inline padding). */
.src-a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; padding: 10px 0; }
#frame.story > .slide:not(.final) .src-a { pointer-events: auto; }
/* The hint under a deck (Tap for how we know, Swipe for more): small, centred, below the dots. */
.deckhint { text-align: center; font-size: 12px; font-weight: 700; line-height: 1.3; opacity: .85; margin-top: -1cqw; }
