/* Your Knee Is Officially a Senior Citizen (public/templates/knee-senior-citizen.html; the film is drawn by knee.js on one canvas).
   Lettering from the font library, each for its joke: Caprasimo (the title, a warm retro face), Rubik Mono One (the deadpan captions, like a film's title cards),
   Shantell Sans (what people say, in their bubbles), Azeret Mono (the computer that types her chart, on the canvas), Rubik Dirt (the rubber stamps),
   Corben (the retirement community's signs and the banner), Young Serif and Yellowtail (the greeting card and its signature).
   Only transform and opacity ever move; nothing that moves carries a filter. */
:root { --ink: #2B2430; --cream: #FBF6EC; --gold: #E2B03A; --red: #D23B3B; --plum: #7C3A5E; --card: #FFFDF7; --shade: rgba(20, 12, 18, .55); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1A1418; color: var(--ink); overflow: hidden; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Shantell Sans', system-ui, sans-serif; }
#film { position: fixed; inset: 0; display: block; z-index: 1; }
.veil, .flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 30; }
.veil { background: #0E0A0D; }
.flash { background: #FFFFFF; z-index: 31; }

/* the captions: one deadpan line at a time, low on the screen */
.caps { position: fixed; left: 0; right: 0; bottom: max(84px, calc(env(safe-area-inset-bottom) + 78px)); display: flex; justify-content: center; padding: 0 16px; pointer-events: none; z-index: 40; }
.cap { margin: 0; max-width: 680px; padding: 10px 16px 11px; border-radius: 10px; background: rgba(20, 12, 18, .78); color: #FFF4D8; font: 400 clamp(13px, 3.4vw, 19px)/1.45 'Rubik Mono One', Impact, sans-serif; letter-spacing: .02em; text-align: center; opacity: 0; will-change: transform, opacity; }

/* a speech bubble over whoever is talking */
.bubble { position: fixed; left: 0; top: 0; z-index: 45; max-width: min(320px, 78vw); padding: 10px 14px 11px; border-radius: 18px; background: #FFFFFF; color: var(--ink); font: 600 clamp(15px, 3.9vw, 19px)/1.32 'Shantell Sans', 'Comic Sans MS', sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.bubble i { position: absolute; left: 0; bottom: -7px; width: 14px; height: 14px; background: inherit; border-radius: 2px; }
.bubble.whisper { background: #F1ECF6; font-style: italic; font-weight: 500; font-size: clamp(13px, 3.4vw, 16px); }
.bubble.shout { background: #FFE7A0; font: 800 clamp(26px, 8vw, 44px)/1.05 'Shantell Sans', sans-serif; letter-spacing: .02em; padding: 12px 18px; }

/* the opening: the title, the tagline, Play */
#intro { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 24px 16px; background: radial-gradient(120% 90% at 50% 30%, #3A2A3A 0%, #1A1418 70%); color: var(--cream); text-align: center; }
.intro #intro { display: grid; }
.i-box { width: min(440px, 100%); }
#i-pic { width: min(230px, 56vw); height: auto; display: block; margin: 0 auto 10px; }
.i-for { margin: 0 0 6px; font: 500 15px/1.3 'Shantell Sans', sans-serif; color: #E8D8C4; }
#intro h1 { margin: 0; font: 400 clamp(30px, 8.4vw, 44px)/1.04 Caprasimo, Georgia, serif; color: #FFF4D8; }
#intro h1 b { display: block; font-weight: 400; color: var(--gold); }
.i-tag { margin: 12px 0 22px; font: 500 clamp(15px, 4vw, 18px)/1.4 'Shantell Sans', sans-serif; color: #E8D8C4; }
.btn { appearance: none; border: 0; border-radius: 999px; padding: 15px 26px; min-height: 48px; font: 700 17px/1 'Shantell Sans', sans-serif; cursor: pointer; background: var(--gold); color: #2B1A10; }
.btn:hover { background: #F0C24E; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
#b-play.wait::after { content: ' ·'; }
.i-quiet { display: block; margin: 14px auto 0; background: none; border: 0; color: #CDBFAE; font: 500 14px/1.2 'Shantell Sans', sans-serif; text-decoration: underline; cursor: pointer; padding: 8px; }

/* during the film: Pause and Skip, quiet, low on the left (the speaker is at the top right, from speaker.js) */
#ctl { position: fixed; left: 12px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 50; display: none; gap: 8px; }
.playing #ctl { display: flex; }
.greet #ctl, .editing #ctl { display: none; }
.pill { appearance: none; border: 0; border-radius: 999px; padding: 9px 14px; min-height: 38px; background: rgba(20, 12, 18, .55); color: #FFF4D8; font: 600 13px/1 'Shantell Sans', sans-serif; cursor: pointer; }
.pill:hover { background: rgba(20, 12, 18, .75); }

/* the end: a tiny line on black */
#theend { position: fixed; left: 0; right: 0; top: 50%; margin: 0; transform: translateY(-50%); z-index: 35; text-align: center; color: #CDBFAE; font: 400 11px/1.4 'Rubik Mono One', sans-serif; letter-spacing: .14em; opacity: 0; pointer-events: none; }

/* the greeting card: it floats in, its cover turns open; then it stays, with Share and Replay */
#greet-wrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 70px 16px 90px; opacity: 0; visibility: hidden; perspective: 1400px; pointer-events: none; }
.greet #greet-wrap { opacity: 1; visibility: visible; pointer-events: auto; background: rgba(26, 20, 24, .38); overflow-y: auto; }
#greet { position: relative; width: min(430px, 100%); transform-style: preserve-3d; will-change: transform; }
.inside { position: relative; padding: 26px 24px 22px; border-radius: 14px; background: var(--card); box-shadow: 0 18px 44px rgba(0, 0, 0, .35); text-align: center; overflow: hidden; }
.inside::before { content: ''; position: absolute; inset: 9px; border: 1.5px solid #E9D7B4; border-radius: 9px; pointer-events: none; }
#g-cover { position: absolute; inset: 0; z-index: 3; border-radius: 14px; background: linear-gradient(160deg, #7C3A5E, #4A2240); color: #FFF4D8; display: grid; place-items: center; transform-origin: 0 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; will-change: transform; }
#g-cover p { margin: 0; font: 400 clamp(28px, 8vw, 40px)/1.05 Caprasimo, Georgia, serif; }
#g-cover p span { display: block; font: 400 15px/1.3 'Shantell Sans', sans-serif; color: var(--gold); margin-top: 10px; }
.greet #g-cover { display: none; }
.g-for { margin: 0 0 6px; font: 500 15px/1.2 'Shantell Sans', sans-serif; color: #8E6A3E; }
#t-head { margin: 0 0 14px; font: 400 clamp(24px, 6.6vw, 31px)/1.12 'Young Serif', Georgia, serif; color: var(--plum); }
.pages { display: grid; }
.pages > div { grid-area: 1 / 1; }
#pageA p, #pageB p { margin: 0 0 10px; font: 400 clamp(16px, 4.3vw, 18px)/1.45 'Young Serif', Georgia, serif; color: var(--ink); white-space: pre-line; }
#pageB { opacity: 0; }
.greet #pageA { display: none; }
.greet #pageB { opacity: 1; }
#g-stamp { margin: 14px auto 2px; max-width: 320px; padding: 9px 12px; border: 3px double var(--red); border-radius: 6px; color: var(--red); font: 400 clamp(13px, 3.6vw, 15px)/1.3 'Rubik Dirt', Impact, sans-serif; letter-spacing: .03em; opacity: 0; transform: rotate(-8deg); will-change: transform, opacity; }
.gws { font-weight: 400 !important; color: var(--plum) !important; font-size: clamp(20px, 5.4vw, 24px) !important; margin-top: 12px !important; }
.g-sign { margin: 10px 0 4px; font: 400 17px/1.3 'Young Serif', Georgia, serif; color: #6A4A30; }
.g-from { font: 400 clamp(30px, 8vw, 38px)/1 Yellowtail, cursive; color: var(--plum); margin-left: 4px; }
.g-acts { display: none; justify-content: center; gap: 10px; margin-top: 16px; }
.greet .g-acts { display: flex; }
.g-acts .btn { padding: 12px 22px; min-height: 44px; font-size: 15px; }
.g-acts .ghost { color: var(--plum); }
.fine { min-height: 1.2em; margin: 8px 0 0; font: 500 13px/1.3 'Shantell Sans', sans-serif; color: #6A5A50; }
#peek { position: absolute; right: 0; top: 18%; width: 30%; max-width: 130px; z-index: -1; transform: translateX(0); will-change: transform; pointer-events: none; }
.greet #peek { display: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the host's guided editor: the card at rest, with nothing playing behind it */
.editing #intro { display: none !important; }
/* less motion: the stills change with a fade, nothing slides */
.rm .cap, .rm .bubble { transition: opacity .3s; }
@media (max-width: 420px) { .inside { padding: 22px 18px 18px; } }
