/* The promo tour (public/js/promo.js): an ~80-second animated preview of the writing desk, the wax, the envelope
   and the moment a letter arrives. On the home page, and in a full-screen dialog from the "Tour" button on any
   page. Drawn in code; no video files, nothing third-party. Strict CSP: no style="" attributes anywhere; the
   script only sets CSS custom properties and transforms through the CSSOM. */

/* ───────── the handwriting the tour uses (the same self-hosted files as the writing desk) ───────── */
@font-face { font-family: 'Homemade Apple'; src: url('/fonts/apple.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Meddon'; src: url('/fonts/meddon.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Great Vibes'; src: url('/fonts/vibes.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Pinyon Script'; src: url('/fonts/pinyon.woff2') format('woff2'); font-display: swap; }

/* ───────── tokens: the desk at night ───────── */
.promo {
  --pp-bg: #2b1d15; --pp-bg-2: #4a3221; --pp-panel: rgb(0 0 0 / .28); --pp-panel-2: #3d2b1f;
  --pp-line: rgb(243 233 214 / .14); --pp-line-2: rgb(243 233 214 / .3);
  --pp-text: #f3e9d6; --pp-text-2: #cdb995; --pp-text-3: #9c8a6b;
  --brass: #d8b45a; --brass-soft: rgb(216 180 90 / .18); --red: #9e2b25; --red-ink: #fff7ee;
  --paper: #f5eedc; --paper-2: #fffcf5; --ink-blue: #2147a8; --ink-sepia: #6b4423; --ink-gold: #c9a24a;
  --f-serif: 'Garamond', 'EB Garamond', Georgia, serif; --f-ui: 'Atkinson', system-ui, sans-serif;
  position: relative; color: var(--pp-text); isolation: isolate; overflow: hidden;
  background:
    radial-gradient(70% 55% at 72% 0%, rgb(255 205 130 / .14), transparent 70%),
    repeating-linear-gradient(92deg, rgb(0 0 0 / 0) 0 18px, rgb(0 0 0 / .07) 18px 19px, rgb(255 255 255 / .02) 19px 41px),
    repeating-linear-gradient(88deg, rgb(255 230 190 / .025) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, var(--pp-bg-2), #33231a 60%, var(--pp-bg));
}
.promo-stage {
  position: relative; display: grid; grid-template-columns: minmax(260px, 34%) minmax(0, 1fr); align-items: center; gap: 3vw;
  height: clamp(540px, calc(100svh - 64px), 860px); padding: 32px 4vw 84px;
}
.promo-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(60% 50% at 62% 48%, rgb(255 220 160 / .08), transparent 70%); }
.promo-cap { position: relative; z-index: 2; align-self: center; }
.promo-kick { margin: 0 0 14px; font: 700 12px/1 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); display: flex; align-items: center; gap: 10px; }
.promo-kick::before { content: ""; width: 26px; height: 2px; background: var(--brass); }
.promo-title { margin: 0 0 16px; font: 500 clamp(32px, 3.9vw, 60px)/1.02 var(--f-serif); color: var(--pp-text); text-wrap: balance; }
.promo-title em { font-style: italic; color: var(--brass); }
.promo-line { margin: 0; max-width: 32ch; font: 400 clamp(15px, 1.2vw, 18px)/1.5 var(--f-ui); color: var(--pp-text-2); }
.promo-vis { position: relative; z-index: 1; height: 100%; min-height: 0; display: grid; place-items: center; perspective: 1600px; }
.promo-noscript { max-width: 640px; }

/* the cold open owns the whole stage */
.promo.cold .promo-cap { grid-column: 1 / -1; text-align: center; justify-self: center; }
.promo.cold .promo-kick { justify-content: center; }
.promo.cold .promo-kick::before { display: none; }
.promo.cold .promo-title { font-size: clamp(50px, 8.5vw, 120px); }
.promo.cold .promo-line { margin: 0 auto; max-width: 40ch; }
.promo.cold .promo-vis { position: absolute; inset: 0; z-index: 0; }
.pp-cold { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .45; }
.pp-cold .ln { fill: none; stroke: var(--brass); stroke-width: .8; vector-effect: non-scaling-stroke; }

@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  .promo-stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; align-items: start; gap: 18px; height: calc(100svh - 100px); min-height: 560px; padding: 18px 16px 80px; }
  .promo-vis { height: auto; }
  .promo .pphone { height: min(50svh, 500px); }
  .promo-title { font-size: clamp(28px, 7.5vw, 44px); margin-bottom: 8px; }
  .promo-line { max-width: none; font-size: 14.5px; }
  .promo-kick { margin-bottom: 8px; }
  .promo.cold .promo-cap { align-self: center; grid-row: 1 / -1; }
  .promo.cold .promo-title { font-size: clamp(44px, 13vw, 80px); }
}

/* ───────── an app window inside the tour ───────── */
.pf { position: relative; width: 100%; max-height: 100%; aspect-ratio: 16 / 10; display: grid; grid-template-rows: auto 1fr;
  background: var(--pp-bg); border: 1px solid var(--pp-line-2); border-radius: 10px; overflow: hidden; container-type: inline-size;
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .04); transform-origin: 50% 60%; }
.pf-bar { display: flex; align-items: center; gap: 1.4cqw; height: 6.4cqw; min-height: 26px; padding: 0 1.6cqw; background: var(--paper-2); border-bottom: 1px solid #e1d5c1; font: 700 clamp(7px, 1.2cqw, 13px)/1 var(--f-ui); color: #4a4136; }
.pf-brand { display: flex; align-items: center; gap: .8cqw; color: #2b2620; }
.pf-brand svg { width: 3.6cqw; height: 3.6cqw; min-width: 14px; min-height: 14px; }
.pf-brand b { font: 600 1.25em/1 var(--f-serif); }
.pf-brand small { display: block; font: 700 .62em/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: #6f6353; margin-top: .3cqw; }
.pf-tabs { display: flex; gap: .4cqw; margin-left: 1cqw; }
.pf-tabs span { padding: .9cqw 1cqw; border-radius: .8cqw; }
.pf-tabs span.on { background: #efe6d6; color: #2b2620; }
.pf-sp { flex: 1; }
.pf-in { padding: .9cqw 1.3cqw; border: 1px solid #e1d5c1; border-radius: 1cqw; color: #2b2620; }
.pf-body { position: relative; min-height: 0; overflow: hidden; perspective: 1400px; perspective-origin: 50% 30%; background: linear-gradient(180deg, #4a3221, #33231a 60%, #2b1d15); }
.pf-body.light { background: #f3eadb; }
.pf-body.counter { background: linear-gradient(180deg, #d7e2d3, #c5d3c1); }
.pf-layer { position: absolute; inset: 0; }
@media (max-width: 820px), (max-aspect-ratio: 1/1) { .pf-tabs span:not(.on), .pf-in { display: none; } }

/* ───────── the sheet of letter paper ───────── */
.ps { position: absolute; left: 4%; top: 6%; width: 56%; aspect-ratio: 1 / 1.1; padding: 5cqw 5cqw 5cqw 5.5cqw; background: var(--paper); color: #222;
  box-shadow: 0 1px 1px rgb(0 0 0 / .12), 0 14px 34px rgb(0 0 0 / .35); font: 400 2.05cqw/2 'Homemade Apple', cursive; --ink: var(--ink-blue); overflow: hidden; transform-origin: 50% 40%; }
.ps.alone { left: 50%; top: 50%; width: 60%; transform: translate(-50%, -50%); }
.ps.alone.small { width: 44%; top: 44%; }
.ps.h-meddon { font-family: 'Meddon', cursive; font-size: 1.9cqw; }
.ps.h-pinyon { font-family: 'Pinyon Script', cursive; font-size: 2.6cqw; }
.ps.p-laid { background: repeating-linear-gradient(90deg, rgb(140 115 70 / .08) 0 1px, transparent 1px 27px), repeating-linear-gradient(0deg, rgb(140 115 70 / .05) 0 1px, transparent 1px 3px), #f5eedc; }
.ps.p-aged { background: radial-gradient(150% 120% at 50% 45%, transparent 58%, rgb(90 55 15 / .22)), radial-gradient(6px 6px at 18% 22%, rgb(140 85 30 / .5), transparent), radial-gradient(10px 10px at 72% 64%, rgb(140 85 30 / .4), transparent), radial-gradient(5px 5px at 40% 80%, rgb(140 85 30 / .45), transparent), radial-gradient(8px 8px at 86% 18%, rgb(140 85 30 / .35), transparent), radial-gradient(4px 4px at 60% 35%, rgb(140 85 30 / .5), transparent), #e8dbb8; }
.ps.p-night { background: #26272b; color: #e9e4d8; }
.ps.p-air { background: radial-gradient(120% 80% at 30% 20%, rgb(255 255 255 / .45), transparent 60%), #dfe9f2; }
.ps.p-ruled { background: repeating-linear-gradient(to bottom, transparent 0 calc(4.1cqw - 1px), rgb(70 110 170 / .25) calc(4.1cqw - 1px) 4.1cqw), #fbf8ef; }
.ps-date { text-align: right; margin-bottom: .4em; }
.ps p { margin: 0 0 .5em; text-wrap: pretty; }
.ps-close { margin-top: .3em; padding-left: 40%; }
.ps-sig { position: relative; display: inline-block; font: 400 2.2em/1.2 'Great Vibes', cursive; padding-right: 1em; }
.ps-sig svg { position: absolute; left: -6%; bottom: -.1em; width: 115%; height: .6em; overflow: visible; }
.ps-sig path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ps .w, .ps-date, .ps-signoff, .ps-name { color: var(--ink); }
.ps .unw { clip-path: inset(-40% 110% -50% -10%); }
.ps.ink-gold .w, .ps.ink-gold .ps-date, .ps.ink-gold .ps-signoff, .ps.ink-gold .ps-name { background-image: linear-gradient(100deg, #e6c76e, #b8902f 50%, #8a6a1f); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ppen { position: absolute; left: 0; top: 0; width: 11cqw; height: 11cqw; pointer-events: none; z-index: 3; filter: drop-shadow(3px 8px 6px rgb(0 0 0 / .3)); opacity: 0; }
.ppen svg { width: 100%; height: 100%; }
.ps-kiss { position: absolute; right: 8%; bottom: 7%; width: 24%; opacity: 0; transform: rotate(-12deg); mix-blend-mode: multiply; }
.ps-kiss path { fill: #8e1e4a; }
.ps-mist { position: absolute; inset: 0; pointer-events: none; }
.ps-mist i { position: absolute; width: 2.2cqw; height: 2.2cqw; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / .75), rgb(255 255 255 / 0) 70%); opacity: 0; }

/* the tools panel beside the sheet (the writing desk) */
.pt { position: absolute; right: 3%; top: 6%; width: 33%; display: grid; gap: 1.2cqw; }
.pt-panel { background: linear-gradient(180deg, #f8f1e1, #f1e7d1); border: 1px solid #c9b48d; border-radius: 1.2cqw; padding: 1.6cqw; box-shadow: 0 6px 16px rgb(0 0 0 / .25); color: #2b2620; font: 400 1.35cqw/1.35 var(--f-ui); }
.pt-panel h4 { margin: 0 0 .8cqw; font: 600 2cqw/1.1 var(--f-serif); }
.pt-panel .lbl { display: block; font: 700 .95em/1 var(--f-ui); margin: 1cqw 0 .5cqw; }
.pt-panel .glbl { display: block; font: 700 .72em/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: #6f6353; margin: 1.1cqw 0 .5cqw; }
.pt-box { min-height: 7cqw; border: 1.5px solid #e1d5c1; border-radius: .9cqw; padding: 1cqw 1.2cqw; background: #fffdf8; white-space: pre-wrap; }
.pt-box .caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: -.2em; background: #2b2620; animation: pp-blink 1s steps(1) infinite; }
@keyframes pp-blink { 50% { opacity: 0; } }
.chips { display: flex; flex-wrap: wrap; gap: .6cqw; }
.chip { display: inline-flex; align-items: center; gap: .6cqw; padding: .55cqw .9cqw; border: 1.5px solid #e1d5c1; border-radius: .8cqw; background: #fffdf8; font: 400 .92em/1 var(--f-ui); color: #2b2620; white-space: nowrap; }
.chip.on { border-color: #2b2620; box-shadow: inset 0 0 0 1px #2b2620; background: #fff; }
.chip i { width: 1.6cqw; height: 1.6cqw; border-radius: 50%; box-shadow: inset 0 -3px 5px rgb(0 0 0 / .25), 0 0 0 1px rgb(0 0 0 / .15); }
.chip i.pap { border-radius: 2px; width: 1.4cqw; height: 1.9cqw; }
.chip .hp { font-size: 1.15em; line-height: 1; }

/* a moving cursor and its click ripple */
.pcur { position: absolute; left: 0; top: 0; width: 2.4cqw; height: 2.4cqw; min-width: 14px; min-height: 14px; z-index: 9; pointer-events: none; opacity: 0; filter: drop-shadow(1px 2px 2px rgb(0 0 0 / .4)); }
.pcur path { fill: #fff; stroke: #2b2620; stroke-width: 1.4; stroke-linejoin: round; }
.prip { position: absolute; width: 3cqw; height: 3cqw; margin: -1.5cqw 0 0 -1.5cqw; border: 2px solid var(--brass); border-radius: 50%; z-index: 8; pointer-events: none; opacity: 0; }

/* ───────── folding and the envelope ───────── */
.pfold { position: absolute; left: 50%; top: 8%; width: 44%; transform: translateX(-50%); transform-style: preserve-3d; transform-origin: 50% 50%; }
.pfold > div { position: relative; width: 100%; height: 11cqw; background: var(--paper); color: #222; font: 400 1.5cqw/1.9 'Meddon', cursive; padding: 1.4cqw 2cqw; overflow: hidden; backface-visibility: visible; transform-style: preserve-3d; }
.pfold > div span { color: var(--ink-sepia); }
.pfold .f-top { transform-origin: 50% 100%; box-shadow: 0 -1px 0 rgb(0 0 0 / .06); z-index: 3; }
.pfold .f-bot { transform-origin: 50% 0; z-index: 2; }
.pfold .f-mid { z-index: 1; box-shadow: 0 14px 34px rgb(0 0 0 / .35); }
.pfold .f-top::after, .pfold .f-bot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0), rgb(0 0 0 / .08)); opacity: 0; }
.pe { position: absolute; left: 50%; top: 50%; width: 58%; aspect-ratio: 1.55; transform: translate(-50%, -50%); transform-style: preserve-3d; }
.pe-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 4px; }
.pe-back { --env: linear-gradient(180deg, #74222f, #5e1a25); --liner: linear-gradient(135deg, #b8902f, #e6c76e 45%, #a87f27); }
.pe-base { position: absolute; inset: 0; border-radius: 4px; background: var(--env); box-shadow: 0 16px 34px rgb(0 0 0 / .4); }
.pe-pocket { position: absolute; inset: 0; background: var(--env); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); filter: brightness(.96); z-index: 2; }
.pe-pocket::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgb(255 255 255 / .12), transparent 40%, rgb(0 0 0 / .08)); }
.pe-flap { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 60%); background: var(--env); transform-origin: 50% 0; filter: brightness(.92); z-index: 3; }
.pe-flap.open { transform: scaleY(-1); background: var(--liner); }
.pe-letter { position: absolute; left: 6%; right: 6%; top: 8%; height: 76%; background: var(--paper); box-shadow: 0 1px 3px rgb(0 0 0 / .2); z-index: 1; }
.pe-wax { position: absolute; left: 50%; top: 60%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 5; }
.pe-wax svg, .pe-half svg { width: 100%; height: 100%; overflow: visible; }
.pe-half { position: absolute; left: 50%; top: 60%; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 5; pointer-events: none; }
.pe-wax .emb { font: italic 600 46px var(--f-serif); fill: #ffd9a8; }
.pe-tool { position: absolute; left: 50%; top: 60%; width: 18%; aspect-ratio: .42; z-index: 6; transform: translate(-50%, -170%); opacity: 0;
  background: linear-gradient(90deg, #3a2414, #6b4528 40%, #3a2414); border-radius: 40% 40% 12% 12% / 20% 20% 6% 6%; box-shadow: 0 10px 18px rgb(0 0 0 / .35); }
.pe-tool::after { content: ""; position: absolute; left: -12%; right: -12%; bottom: -6%; height: 16%; border-radius: 4px; background: linear-gradient(180deg, #e3c06a, #a8843e); }
.pe-front { transform: rotateY(180deg); background: linear-gradient(180deg, #74222f, #5e1a25); box-shadow: 0 16px 34px rgb(0 0 0 / .4); overflow: hidden; }
.pe-front::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgb(255 255 255 / .08), rgb(0 0 0 / .06)); }
.pe-name { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font: 400 5.2cqw/1 'Meddon', cursive; color: #d9b57a; white-space: nowrap; }
.pe-name svg { position: absolute; left: -4%; bottom: -.35em; width: 108%; height: .5em; overflow: visible; }
.pe-name path { fill: none; stroke: #d9b57a; stroke-width: 1.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pe-stamp { position: absolute; right: 4.5%; top: 6%; width: 17%; aspect-ratio: 5 / 6; transform: rotate(-2deg); opacity: 0; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .3)); }
.pe-stamp svg { width: 100%; height: 100%; overflow: visible; }
.pe-mark { position: absolute; right: 12%; top: 8%; width: 36%; aspect-ratio: 2.2; opacity: 0; transform: rotate(-7deg); }
.pe-mark svg { width: 100%; height: 100%; overflow: visible; }
.pe-mark .pm { fill: none; stroke: rgb(38 38 44 / .85); stroke-width: 2.4; stroke-linecap: round; }
.pe-mark text { fill: rgb(38 38 44 / .85); font: 700 9px var(--f-ui); }
.pscent { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); max-width: 88%; padding: .8cqw 1.6cqw; border-radius: 1cqw; background: rgb(20 12 8 / .72); text-align: center; font: italic 2.2cqw/1.3 var(--f-serif); color: var(--pp-text); opacity: 0; }

/* the "sealed and ready" card */
.psent { position: absolute; left: 50%; top: 50%; width: 72%; transform: translate(-50%, -50%); background: #fffcf5; color: #2b2620; border-radius: 1.4cqw; padding: 2cqw 2.4cqw; box-shadow: 0 8px 24px rgb(0 0 0 / .3); font: 400 1.5cqw/1.45 var(--f-ui); }
.psent h4 { margin: 0 0 .6cqw; font: 600 2.6cqw/1.1 var(--f-serif); }
.psent p { margin: 0 0 1cqw; }
.plink { display: flex; align-items: center; gap: 1cqw; border: 1.5px solid #e1d5c1; border-radius: 1cqw; padding: 1cqw 1.2cqw; background: #fffdf8; font: 500 1.45cqw/1 ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; }
.plink .key { color: var(--red); background: #f5e1dd; border-radius: .4cqw; padding: .2cqw .3cqw; }
.plink .caret { width: 2px; height: 1.1em; background: #2b2620; animation: pp-blink 1s steps(1) infinite; }
.pbtns { display: flex; flex-wrap: wrap; gap: .8cqw; margin-top: 1.2cqw; }
.pbtn { padding: 1cqw 1.4cqw; border: 1.5px solid #e1d5c1; border-radius: 1cqw; background: #fffcf5; font: 700 1.25cqw/1 var(--f-ui); color: #2b2620; opacity: 0; }
.pbtn.primary { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.plock { position: absolute; right: 2.6cqw; top: 2cqw; width: 7cqw; height: 8cqw; }
.plock svg { width: 100%; height: 100%; overflow: visible; }
.plock .body { fill: var(--brass); stroke: #8a6a1f; stroke-width: 1.2; }
.plock .shackle { fill: none; stroke: #8a6a1f; stroke-width: 5; stroke-linecap: round; }
.plock .hole { fill: #5a4416; }

/* ───────── the reading room ───────── */
.pshelf { position: absolute; inset: 0; padding: 3cqw; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2cqw; align-content: start; }
.pcard { display: grid; gap: .3cqw; background: #fffcf5; border: 1px solid #e1d5c1; border-radius: 1cqw; padding: 1.3cqw 1.4cqw; color: #2b2620; box-shadow: 0 1px 2px rgb(60 40 20 / .08), 0 10px 26px rgb(60 40 20 / .1); }
.pcard b { font: 600 1.7cqw/1.15 var(--f-serif); }
.pcard span { font: 400 1.15cqw/1.3 var(--f-ui); color: #6f6353; }
.pcard.hl { border-color: var(--red); }
.pshelf-head { grid-column: 1 / -1; color: #2b2620; margin-bottom: .6cqw; }
.pshelf-head b { display: block; font: 500 2.8cqw/1.1 var(--f-serif); }
.pshelf-head span { font: 400 1.2cqw/1.3 var(--f-ui); color: #6f6353; }

/* ───────── the phone (the counter layout, dictation, the letter box) ───────── */
.pphone { position: relative; height: 100%; max-height: 100%; aspect-ratio: 9 / 18.5; padding: 2.2%; border-radius: 13% / 6.4%; background: linear-gradient(145deg, #3a3238, #0b0f16); box-shadow: 0 40px 90px -30px rgb(0 0 0 / .8), inset 0 0 0 1.5px rgb(255 255 255 / .12); container-type: inline-size; }
.pphone::before { content: ""; position: absolute; top: 3.2%; left: 50%; width: 26%; height: 2.8%; transform: translateX(-50%); border-radius: 99px; background: #05070a; z-index: 3; }
.pphone-scr { position: relative; height: 100%; overflow: hidden; border-radius: 10% / 4.9%; background: linear-gradient(180deg, #d7e2d3, #c5d3c1); }
.pphone-strip { position: absolute; inset: 0; display: flex; width: 200%; }
.pphone-strip > div { position: relative; width: 50%; height: 100%; padding: 14cqw 5cqw 5cqw; color: #22352c; font: 400 3.6cqw/1.4 var(--f-ui); }
.pph-h { font: 500 6.4cqw/1.1 var(--f-serif); margin: 0 0 2cqw; }
.pph-steps { display: flex; gap: 1.2cqw; flex-wrap: wrap; margin-bottom: 3cqw; }
.pph-steps span { display: inline-flex; align-items: center; gap: 1cqw; padding: 1.6cqw 2cqw; border: 1.5px solid #b9a882; border-radius: 2cqw; background: #fbf5e4; font: 700 3cqw/1 var(--f-ui); color: #2b2620; }
.pph-steps span i { display: inline-grid; place-items: center; width: 4.6cqw; height: 4.6cqw; border-radius: 50%; border: 1.5px solid currentColor; font-style: normal; font-size: 2.6cqw; }
.pph-steps span.on { border-color: #2b2620; background: #fff; }
.pph-panel { background: #fbf5e4; border: 1px solid #b9a882; border-radius: 1.2cqw; padding: 3cqw; color: #2b2620; }
.pph-panel h5 { margin: 0 0 2cqw; font: 600 5cqw/1.1 var(--f-serif); display: flex; align-items: center; gap: 2cqw; }
.pph-panel h5::before { content: attr(data-n); display: inline-grid; place-items: center; width: 7cqw; height: 7cqw; border: 2px solid #9b2420; color: #9b2420; border-radius: 50%; font: 700 3.4cqw/1 var(--f-ui); transform: rotate(-8deg); }
.pph-box { min-height: 26cqw; border: 1.5px solid #e1d5c1; border-radius: 2cqw; padding: 2.4cqw; background: #fffdf8; font-size: 3.6cqw; line-height: 1.45; white-space: pre-wrap; }
.pph-keys { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; background: #d2d5da; display: grid; grid-template-rows: repeat(4, 1fr); gap: 1.8cqw; padding: 2.4cqw 1.6cqw 3cqw; }
.pph-keys div { display: flex; gap: 1.4cqw; justify-content: center; }
.pph-keys i { flex: 1; max-width: 8.4cqw; background: #fff; border-radius: 1.2cqw; box-shadow: 0 1px 0 #8a8f96; }
.pph-keys i.sp { max-width: 44cqw; }
.pph-keys i.mic { background: #9e2b25; max-width: 10cqw; position: relative; }
.pph-keys i.mic::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2.2cqw; height: 3.6cqw; transform: translate(-50%, -55%); border-radius: 99px; background: #fff; }
.pph-keys i.mic.live { box-shadow: 0 0 0 1.4cqw rgb(158 43 37 / .35); }
.pph-kept { display: grid; gap: 1.6cqw; }
.pph-kept div { border: 1px solid #e1d5c1; background: #fffdf8; border-radius: 2cqw; padding: 2.2cqw 2.6cqw; opacity: 0; }
.pph-kept b { display: block; font: 600 4.2cqw/1.2 var(--f-serif); color: #2b2620; }
.pph-kept span { font: 400 3cqw/1.3 var(--f-ui); color: #6f6353; }
.pph-kept div.on { border-color: #9b2420; box-shadow: inset 4px 0 0 #9b2420; }

/* ───────── pen pals: a globe, a few lights, an envelope on its way ───────── */
.pglobe { position: absolute; inset: 0; width: 100%; height: 100%; }
.pglobe .ln { fill: none; stroke: var(--brass); stroke-width: .7; vector-effect: non-scaling-stroke; opacity: .7; }
.pglobe .dot { fill: var(--brass); }
.pglobe .arc { fill: none; stroke: var(--pp-text); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.pglobe .env { fill: var(--paper); stroke: #8e6a42; stroke-width: 1; }
.pglobe .lbl { fill: var(--pp-text-2); font: 600 4.6px var(--f-ui); letter-spacing: .3px; text-transform: uppercase; }
.pcoming { position: absolute; right: 4%; top: 6%; padding: 1cqw 1.6cqw; border: 2px solid var(--brass); border-radius: .8cqw; color: var(--brass); font: 700 1.6cqw/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; transform: rotate(6deg); opacity: 0; }

/* ───────── controls ───────── */
.promo-bar { position: absolute; left: 50%; bottom: 16px; z-index: 6; transform: translateX(-50%); width: min(920px, calc(100% - 32px));
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px;
  background: rgb(43 29 21 / .86); border: 1px solid var(--pp-line-2); backdrop-filter: blur(10px); }
.promo-bar button { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--pp-text); cursor: pointer; font: 700 11px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.promo-bar button:hover { background: var(--brass-soft); }
.promo-bar button svg { width: 18px; height: 18px; }
.promo-bar .pp { background: var(--brass); color: #2b1d15; }
.promo-bar .pp:hover { background: var(--brass); filter: brightness(1.08); }
.promo-ch { flex: 1; display: flex; gap: 4px; min-width: 0; }
.promo-ch button { flex: 1; position: relative; min-width: 0; height: 30px; padding: 0; border-radius: 3px; display: block; }
.promo-ch button::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 2px; background: var(--pp-line-2); }
.promo-ch button i { position: absolute; left: 0; top: 13px; height: 4px; width: calc(var(--p, 0) * 100%); border-radius: 2px; background: var(--brass); }
.promo-ch button span { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; padding: 5px 8px; border-radius: 4px; background: var(--pp-panel-2); border: 1px solid var(--pp-line-2); font: 700 10px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--pp-text); opacity: 0; pointer-events: none; transition: opacity .15s; }
.promo-ch button:hover span, .promo-ch button:focus-visible span { opacity: 1; }
.promo-time { font: 700 11px/1 var(--f-ui); color: var(--pp-text-2); min-width: 78px; text-align: center; font-variant-numeric: tabular-nums; }
.promo-bar .x { display: none; }
.promo-dialog .promo-bar .x { display: inline-grid; }
@media (max-width: 560px) { .promo-time { display: none; } .promo-bar { gap: 6px; } .promo-bar .skip span { display: none; } }

/* ───────── the ending card ───────── */
.promo-end { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px 16px 90px; background: radial-gradient(ellipse at 50% 40%, rgb(43 29 21 / .55), var(--pp-bg) 78%); opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.promo.ended .promo-end { opacity: 1; visibility: visible; transition: opacity .6s; }
.promo-cap, .promo-vis { transition: opacity .45s, filter .45s; }
.promo.ended .promo-cap, .promo.ended .promo-vis { opacity: 0; filter: blur(6px); pointer-events: none; }
.promo-end-in { text-align: center; width: 100%; max-width: 760px; min-width: 0; }
.promo-end .mark svg { width: 72px; height: 72px; margin: 0 auto 10px; }
.promo-end h2 { margin: 0 0 12px; font: 500 clamp(38px, 6.5vw, 84px)/1 var(--f-serif); color: var(--pp-text); }
.promo-end h2 em { font-style: italic; color: var(--brass); }
.promo-end p { margin: 0 auto 22px; max-width: 46ch; font: 400 17px/1.5 var(--f-ui); color: var(--pp-text-2); }
.promo-end .cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 18px; }
.promo-end .cta a { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 10px 24px; border-radius: 10px; text-decoration: none; font: 700 17px/1 var(--f-ui); }
.promo-end .cta a small { margin-top: 5px; font: 400 12px/1 var(--f-ui); opacity: .85; }
.promo-end .cta .go-write { background: var(--red); color: var(--red-ink); border: 1.5px solid var(--red); transition: transform .15s, filter .15s; }
.promo-end .cta .go-write:hover { filter: brightness(1.08); transform: translateY(-1px); color: var(--red-ink); }
.promo-end .cta .go-read { border: 1.5px solid var(--brass); color: var(--pp-text); background: var(--brass-soft); }
.promo-end .cta .go-read:hover { transform: translateY(-1px); color: var(--pp-text); }
.promo-end .sub { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font: 700 12px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.promo-end .sub button, .promo-end .sub a { border: 0; background: none; padding: 8px 4px; color: var(--pp-text-2); cursor: pointer; text-decoration: none; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.promo-end .sub button:hover, .promo-end .sub a:hover { color: var(--pp-text); }
.promo-ticker { margin-top: 26px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.promo-ticker div { display: flex; gap: 28px; width: max-content; animation: pp-tick 48s linear infinite; font: 700 11px/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--pp-text-3); }
.promo-ticker b { color: var(--brass); font-weight: 700; }
@keyframes pp-tick { to { transform: translateX(-50%); } }

/* ───────── as a full-screen dialog (the Tour button on any page) ───────── */
.promo-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; }
.promo-dialog::backdrop { background: rgb(20 12 8 / .85); backdrop-filter: blur(6px); }
.promo-dialog .promo { height: 100%; }
.promo-dialog .promo-stage { height: 100dvh; max-height: none; }

/* the Tour button in the header */
.tour-btn b { font-weight: 700; }
@media (max-width: 640px) { .tour-btn b { display: none; } .tour-btn { min-width: 38px; padding: 0 .6rem; } }

@media (prefers-reduced-motion: reduce) {
  .promo-ticker div, .pt-box .caret, .plink .caret { animation: none; }
}
.pp-wait { opacity: 0; }
