/* I'm Fine. Why? (public/templates/im-fine-why.html; the film is drawn by fine.js on one canvas).
   Lettering from the font library, each for its joke: Libre Caslon Display (the composed "I'm Fine."), Homemade Apple (the scribbled "Why?" underneath, and the
   signature), Onest (what they say, in their bubbles, and the phone screens), Libre Caslon Text (the card), Orbitron (the bedside clock, on the canvas).
   Only transform and opacity ever move; nothing that moves carries a filter. */
:root { --ink: #2A2733; --night: #151B2E; --plum: #5A3A5E; --rose: #C2557A; --amber: #F2B06E; --card: #FFFBF4; --gold: #C9A25A; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #120E18; color: var(--ink); overflow: hidden; -webkit-tap-highlight-color: transparent; }
body { font-family: Onest, system-ui, sans-serif; }
#film { position: fixed; inset: 0; display: block; z-index: 1; }
.veil { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 30; background: #0C0910; }

/* the time of day, top left, as each scene begins */
#stamp { position: fixed; left: max(16px, env(safe-area-inset-left)); top: max(16px, env(safe-area-inset-top)); z-index: 40; margin: 0; padding: 7px 12px 8px; border-radius: 10px; background: rgba(12, 9, 16, .5); color: #FBF1E4; opacity: 0; pointer-events: none; display: none; will-change: opacity; white-space: nowrap; }
.playing #stamp { display: block; }
#stamp b { font: 700 15px/1.1 Onest, sans-serif; letter-spacing: .02em; margin-right: 8px; }
#stamp span { font: 500 13px/1.1 Onest, sans-serif; color: #D9C9E2; }

/* a speech bubble at whoever is talking */
.bubble { position: fixed; left: 0; top: 0; z-index: 45; max-width: min(300px, 76vw); padding: 10px 14px 11px; border-radius: 18px; background: #FFFFFF; color: var(--ink); font: 600 clamp(15px, 3.9vw, 19px)/1.3 Onest, sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); 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.her { background: #FFF8EE; }
.bubble.him { background: #EEF3FA; }
.bubble.off { font-style: italic; }

/* the opening: her picture, the title, the line under it, Play */
#intro { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 24px 16px; background: radial-gradient(120% 90% at 50% 28%, #2E2A48 0%, #151B2E 62%, #0E1220 100%); color: #FBF1E4; text-align: center; }
.intro #intro { display: grid; }
.i-box { width: min(440px, 100%); }
#i-pic { width: min(210px, 52vw); height: auto; display: block; margin: 0 auto 8px; }
.i-for { margin: 0 0 6px; font: 500 15px/1.3 Onest, sans-serif; color: #D9C9E2; }
#intro h1 { margin: 0; font: 400 clamp(38px, 11vw, 56px)/1 'Libre Caslon Display', Georgia, serif; color: #FBF1E4; }
#intro h1 b { display: block; margin-top: 4px; font: 400 clamp(30px, 8.6vw, 44px)/1.5 'Homemade Apple', cursive; color: var(--amber); }
.i-tag { margin: 10px auto 22px; max-width: 360px; font: 500 clamp(15px, 4vw, 17px)/1.45 Onest, sans-serif; color: #D9C9E2; }
.btn { appearance: none; border: 0; border-radius: 999px; padding: 15px 26px; min-height: 48px; font: 700 17px/1 Onest, sans-serif; cursor: pointer; background: var(--amber); color: #2A1A10; }
.btn:hover { background: #F6C188; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.ghost:hover { background: rgba(90, 58, 94, .08); }
#b-play.wait::after { content: ' ·'; }
.i-quiet { display: block; margin: 14px auto 0; background: none; border: 0; color: #B9AECB; font: 500 14px/1.2 Onest, 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(12, 9, 16, .55); color: #FBF1E4; font: 600 13px/1 Onest, sans-serif; cursor: pointer; }
.pill:hover { background: rgba(12, 9, 16, .75); }
/* if the voices could not be fetched, the bubbles still say every line */
#vnote { position: fixed; right: 12px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 50; margin: 0; padding: 7px 12px; border-radius: 999px; background: rgba(12, 9, 16, .6); color: #F4E4D2; font: 500 12px/1.2 Onest, sans-serif; pointer-events: none; }
.greet #vnote { display: none; }

/* the greeting card: at 0:56 it rises from her nightstand and opens; then it stays, with Share and Watch again */
#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(18, 14, 24, .45); overflow-y: auto; }
#greet { position: relative; width: min(420px, 100%); transform-style: preserve-3d; will-change: transform; }
.inside { position: relative; padding: 30px 26px 24px; border-radius: 14px; background: var(--card); box-shadow: 0 18px 44px rgba(0, 0, 0, .4); text-align: center; overflow: hidden; }
.inside::before { content: ''; position: absolute; inset: 9px; border: 1.5px solid #E8D6B4; border-radius: 9px; pointer-events: none; }
#g-in { opacity: 0; }
.greet #g-in { opacity: 1; }
#g-cover { position: absolute; inset: 0; z-index: 3; border-radius: 14px; background: linear-gradient(165deg, #2E2A48, #151B2E); color: #FBF1E4; 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(36px, 10vw, 48px)/1 'Libre Caslon Display', Georgia, serif; }
#g-cover p span { display: block; margin-top: 6px; font: 400 clamp(28px, 8vw, 38px)/1.6 'Homemade Apple', cursive; color: var(--amber); }
.greet #g-cover { display: none; }
.g-for { margin: 0 0 8px; font: 500 15px/1.2 Onest, sans-serif; color: #8E6E54; }
#t-head { margin: 0; font: 400 clamp(34px, 9vw, 44px)/1 'Libre Caslon Display', Georgia, serif; color: var(--ink); }
#t-head b { display: block; margin-top: 2px; font: 400 clamp(26px, 7vw, 34px)/1.55 'Homemade Apple', cursive; color: var(--rose); }
#g-tag { margin: 4px auto 16px; max-width: 320px; font: italic 400 14px/1.4 'Libre Caslon Text', Georgia, serif; color: #7A6E86; }
.inside p.toast { margin: 0 auto 14px; max-width: 330px; font: 400 clamp(17px, 4.5vw, 19px)/1.5 'Libre Caslon Text', Georgia, serif; color: var(--ink); }
#t-msg { margin: 0 auto 14px; max-width: 330px; font: italic 400 clamp(16px, 4.2vw, 18px)/1.5 'Libre Caslon Text', Georgia, serif; color: #4A4256; white-space: pre-line; }
#t-sent { margin: 6px 0 6px; font: 400 clamp(22px, 6vw, 27px)/1.2 'Libre Caslon Display', Georgia, serif; color: var(--plum); }
.g-sign { margin: 8px 0 4px; font: 400 16px/1.3 'Libre Caslon Text', Georgia, serif; color: #6A5A50; }
.g-from { display: inline-block; font: 400 clamp(20px, 5.4vw, 25px)/1.8 'Homemade Apple', cursive; color: var(--rose); margin-left: 6px; }
.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 Onest, sans-serif; color: #6A5A60; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* the sender'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 .bubble, .rm #stamp { transition: opacity .3s; }
@media (max-width: 420px) { .inside { padding: 26px 20px 20px; } }
