/* The Heart of Thanksgiving. The film is one canvas (heart.js); everything here is the words on top of it and the greeting card it ends on.
   Speed: only opacity and transform ever change, nothing that moves carries a filter, and the soft light is a gradient that never moves.
   The brief's colours: Harvest Gold, Burnt Orange, Maple Red, Autumn Burgundy, Warm Ivory, Forest Olive, Candlelight Gold, Walnut Brown, Soft Cream, Deep Evergreen.
   Lettering from the font library: Brygada 1918 (the greeting), Alegreya (the message and the film's lines), Alegreya Sans (bubbles and buttons), Corinthia (the signature). */
:root {
  --gold: #D4A24C; --orange: #C66A32; --maple: #A54336; --burgundy: #713E45; --ivory: #F8EEDB;
  --olive: #596343; --candle: #F2C879; --walnut: #52382D; --cream: #FFF8E9; --evergreen: #344535;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2A1D16; }
body { font-family: 'Alegreya', Georgia, serif; color: var(--walnut); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
button { font: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the film */
#film { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; display: block; transition: opacity .25s ease; }
body.swap #film { opacity: 0; }
.vign { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 85% 80% at 50% 46%, rgba(30, 18, 10, 0) 58%, rgba(30, 18, 10, .34) 100%); }
/* the warm light of the doorway, which carries us from the porch to the table */
.flood { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; will-change: opacity; background: radial-gradient(ellipse 70% 70% at 50% 52%, #FFF6DC 0%, #F8D896 42%, #EBB466 100%); }
/* behind the greeting the family keeps eating, a little paler */
.veil { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; will-change: opacity; background: linear-gradient(180deg, rgba(248, 238, 219, .55), rgba(248, 238, 219, .9)); }

/* the film's lines: one at a time, small, low on the screen, on a soft shade that never moves */
.caps { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; pointer-events: none; display: grid; place-items: end center; padding: 0 22px max(30px, env(safe-area-inset-bottom)); min-height: 130px; background: linear-gradient(180deg, rgba(30, 18, 10, 0), rgba(30, 18, 10, .38)); }
body.greet .caps { visibility: hidden; }
.cap { grid-area: 1 / 1; margin: 0; max-width: 32em; text-align: center; font-style: italic; font-weight: 500; font-size: clamp(18px, 2.4vw, 27px); line-height: 1.3; color: var(--cream); text-shadow: 0 1px 2px rgba(30, 18, 10, .6); opacity: 0; will-change: opacity, transform; text-wrap: balance; }
.cap.small { font-size: clamp(16px, 1.9vw, 21px); }

/* a speech bubble beside whoever talks; heart.js slides it to them */
.bubble { position: fixed; left: 0; top: 0; z-index: 5; max-width: min(74vw, 290px); padding: 10px 15px 11px; background: var(--cream); color: var(--walnut); border-radius: 18px; border: 1px solid rgba(212, 162, 76, .55); box-shadow: 0 6px 16px rgba(30, 18, 10, .22);
  font-family: 'Alegreya Sans', system-ui, sans-serif; font-weight: 500; font-size: clamp(15px, 1.75vw, 18px); line-height: 1.25; opacity: 0; pointer-events: none; will-change: transform, opacity; }
.bubble i { position: absolute; left: 0; bottom: -7px; width: 14px; height: 14px; background: var(--cream); border-right: 1px solid rgba(212, 162, 76, .55); border-bottom: 1px solid rgba(212, 162, 76, .55); transform: translateX(30px) rotate(45deg); }

/* the two controls during the film: skip (top left) and the speaker (top right, drawn by speaker.js) */
.skip { position: fixed; top: max(14px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); z-index: 9000; padding: 9px 15px; min-height: 40px; border-radius: 999px; border: 1px solid rgba(248, 238, 219, .45);
  background: rgba(42, 29, 22, .45); color: var(--cream); font: 700 14px/1 'Alegreya Sans', system-ui, sans-serif; letter-spacing: .02em; white-space: nowrap; }
.skip:hover { background: rgba(113, 62, 69, .75); }
.skip:focus-visible, .btn:focus-visible { outline: 2px solid var(--candle); outline-offset: 3px; }
body.greet .skip { display: none; }
#snd-hint { position: fixed; top: max(26px, calc(env(safe-area-inset-top) + 12px)); right: 68px; z-index: 9000; margin: 0; font: 500 13px/1 'Alegreya Sans', system-ui, sans-serif; color: var(--cream); text-shadow: 0 1px 2px rgba(30, 18, 10, .7); opacity: .9; transition: opacity .6s ease; pointer-events: none; }
#snd-hint.gone, body.greet #snd-hint, body.editing #snd-hint { opacity: 0; }

/* the greeting card */
#greet-wrap { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 70px 16px 24px; pointer-events: none; opacity: 0; transform: translateY(22px) scale(.97); transition: opacity .9s ease, transform 1.15s cubic-bezier(.2, .7, .2, 1); }
body.greet #greet-wrap { opacity: 1; transform: none; pointer-events: auto; }
#greet { position: relative; width: min(100%, 472px); max-height: calc(100vh - 100px); overflow: auto; padding: clamp(28px, 6vw, 42px) clamp(22px, 6vw, 42px) 22px; text-align: center; border-radius: 4px;
  background: repeating-linear-gradient(94deg, rgba(212, 162, 76, .035) 0 2px, rgba(255, 248, 233, 0) 2px 7px), linear-gradient(180deg, #FFF9EC 0%, #F8EEDB 100%);
  box-shadow: 0 22px 54px rgba(30, 18, 10, .34), 0 3px 8px rgba(30, 18, 10, .18), inset 0 0 0 1px rgba(212, 162, 76, .7), inset 0 0 0 8px #FFF8E9, inset 0 0 0 9.5px rgba(212, 162, 76, .85); }
.sprig { position: absolute; width: 78px; height: 78px; pointer-events: none; }
.sprig svg { width: 100%; height: 100%; display: block; }
.sprig.tl { top: 10px; left: 10px; }
.sprig.br { bottom: 10px; right: 10px; transform: rotate(180deg); }
.g-for { margin: 0 0 2px; font-style: italic; font-weight: 500; font-size: 18px; color: var(--orange); }
#t-head { margin: 4px 0 2px; font-family: 'Brygada 1918', Georgia, serif; font-weight: 600; font-size: clamp(33px, 8.4vw, 50px); line-height: 1.08; color: var(--burgundy); letter-spacing: .005em; text-wrap: balance; }
#t-head:focus { outline: none; }
.rule { width: 210px; height: 22px; margin: 6px auto 14px; }
.rule svg { width: 100%; height: 100%; display: block; }
.g-msg { margin: 0 0 16px; white-space: pre-line; font-size: clamp(16px, 2.2vw, 18.5px); line-height: 1.55; color: #4A3428; }
.g-sign { margin: 0 0 20px; font-style: italic; font-size: 17px; color: #5E4232; }
.g-from { display: block; margin-top: 2px; font-family: 'Corinthia', cursive; font-style: normal; font-weight: 700; font-size: clamp(40px, 8vw, 52px); line-height: 1; color: var(--burgundy); }
.g-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: nowrap; }
.btn { min-height: 44px; padding: 11px 24px; border-radius: 999px; border: 1.5px solid var(--burgundy); background: var(--burgundy); color: var(--cream); font: 700 15px/1 'Alegreya Sans', system-ui, sans-serif; letter-spacing: .02em; white-space: nowrap; }
.btn:hover { background: #5E2F36; }
.btn.ghost { background: transparent; color: var(--burgundy); }
.btn.ghost:hover { background: rgba(113, 62, 69, .08); }
.fine { min-height: 18px; margin: 10px 0 0; font: 500 13px/1.35 'Alegreya Sans', system-ui, sans-serif; color: #6A5040; }

/* a phone turned sideways: the card is wider and lower, so it fits */
@media (max-height: 560px) {
  #greet-wrap { padding: 56px 16px 12px; }
  #greet { width: min(100%, 640px); max-height: calc(100vh - 68px); padding: 16px 30px 12px; }
  #t-head { font-size: 30px; }
  .rule { margin: 2px auto 8px; height: 18px; }
  .g-msg { font-size: 14.5px; line-height: 1.42; margin-bottom: 10px; }
  .g-sign { margin-bottom: 10px; font-size: 15px; }
  .g-from { font-size: 34px; }
  .sprig { width: 48px; height: 48px; }
  .cap { font-size: 17px; }
  .caps { min-height: 90px; padding-bottom: 16px; }
}
@media (max-width: 380px) { .sprig { width: 58px; height: 58px; } .btn { padding: 11px 18px; } }
@media (prefers-reduced-motion: reduce) { #greet-wrap { transition: opacity .4s ease; transform: none; } }
