/* New type + text animations (see text-fx.js).
   Baloo 2 for headings, Poppins for text, Kalam (handwritten) for little personal notes. */

/* ---------- type ---------- */
body { font-family: var(--f-ui); letter-spacing: -.005em; }
.brand { font: 800 42px/1 var(--f-display); letter-spacing: -.01em; margin-top: 20px; }
.pname { font: 800 clamp(21px, 5.9vw, 27px)/1.05 var(--f-display); font-style: normal; letter-spacing: -.01em; }
.sec-h { font: 800 25px/1.1 var(--f-display); }
.card h3 { font: 700 19px/1.1 var(--f-display); }
.sheet h2 { font: 800 26px/1.1 var(--f-display); }
.cb-title { font: 800 30px/1.08 var(--f-display); }
.share h3, .track h3 { font: 800 21px/1.15 var(--f-display); }
.app-card h2 { font: 800 26px/1.1 var(--f-display); }
.hh-title { font-family: var(--f-display); font-weight: 800; font-size: 44px; line-height: .92; }
.hh-title em { font-style: normal; }
.tag, .hint, .psub, .hh-when, .tr-note, .cb-sub { font-family: var(--f-hand); }
.tag { font-size: 17px; line-height: 1.35; }
.hint { font-size: 14px; font-weight: 700; color: #b9b2a6; }
.psub { font-size: 15px; font-weight: 700; }
.hh-when { font-size: 14px; font-weight: 700; }
.tr-note, .cb-sub { font-size: 16px; }
.sheet label { font-weight: 600; }

/* ---------- split pieces ---------- */
.tx .tx-w { display: inline-block; white-space: nowrap; }
.tx .tx-l, .tx .tx-emo { display: inline-block; }

/* headings: letters drop in with a bounce */
.tx-letters.tx-play .tx-l {
  animation: tx-drop .62s cubic-bezier(.3, 1.55, .5, 1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes tx-drop {
  0% { opacity: 0; transform: translateY(-.55em) rotate(-14deg) scale(.4); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* lines: words rise in */
.tx-words.tx-play .tx-w {
  animation: tx-rise .5s cubic-bezier(.2, .8, .3, 1.15) both;
  animation-delay: var(--d, 0ms);
}
@keyframes tx-rise {
  0% { opacity: 0; transform: translateY(.7em) scale(.92); }
  100% { opacity: 1; transform: none; }
}

/* emojis: pop in, then a gentle bob forever */
.tx-words.tx-play .tx-emo { animation: tx-bob 1.3s ease-in-out 2; animation-delay: calc(var(--d, 0ms) + .5s); transform-origin: 50% 80%; }
.tx-letters.tx-play .tx-emo { animation: tx-drop .62s cubic-bezier(.3, 1.55, .5, 1) both, tx-bob 1.3s ease-in-out 2; animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + .8s); }
@keyframes tx-bob {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  25% { translate: 0 -2px; rotate: -10deg; }
  50% { translate: 0 0; rotate: 0deg; }
  75% { translate: 0 -1px; rotate: 8deg; }
}

/* brand: a golden shine keeps sweeping across the letters */
@property --tx-sh { syntax: '<length>'; inherits: true; initial-value: 0px; }
.brand { --tx-sh: 0px; }
.brand.tx-play { animation: tx-shine 1.8s linear 1 .9s; }
.brand .tx-l {
  background: linear-gradient(100deg, var(--text) 0 40%, #ffd98a 47%, #fff6dc 50%, #f2a65a 53%, var(--text) 60% 100%);
  background-size: 700px 100%;
  background-position: calc(var(--i) * -24px + var(--tx-sh)) 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes tx-shine { from { --tx-sh: -300px; } to { --tx-sh: 700px; } }

/* Happy Hour title: the old gradient lived on the heading, but moving letters need it on themselves */
.hh-title { background: none; color: #ffd38a; -webkit-background-clip: initial; background-clip: initial; --tx-sh: 0px; animation: none; }
.hh-title .tx-l {
  background: linear-gradient(100deg, #fff4e2 0%, #ffd38a 25%, #ff8a3d 50%, #ffd38a 75%, #fff4e2 100%);
  background-size: 520px 100%; background-position: calc(var(--i) * -30px + var(--tx-sh)) 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .04em;
}
@keyframes tx-shine2 { 0%, 100% { --tx-sh: 0px; } 50% { --tx-sh: 300px; } }
/* Happy Hour title keeps waving */
.hh-title .tx-l { animation-name: tx-drop, tx-wave; animation-duration: .62s, 2.2s; animation-timing-function: cubic-bezier(.3, 1.55, .5, 1), ease-in-out; animation-iteration-count: 1, 2; animation-fill-mode: both, none; animation-delay: var(--d, 0ms), calc(var(--i) * 90ms + 1s); }
@keyframes tx-wave { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 0 -5px; } }

/* builder pizza name: a little glow under it */
.pname .tx-l { text-shadow: 0 2px 14px rgba(242, 166, 90, .35); }

/* section heading: underline draws itself */
.sec-h { position: relative; display: inline-block; }
.sec-h::after {
  content: ''; position: absolute; left: 0; bottom: -3px; height: 4px; width: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold)); transform-origin: left; transform: scaleX(0);
}
.sec-h.tx-play::after { animation: tx-line .7s .45s cubic-bezier(.3, 1.3, .5, 1) forwards; }
@keyframes tx-line { to { transform: scaleX(1); } }

/* errors give a small shake (class added by checkout when an error appears) */
.err.tx-shake { animation: tx-shake .42s ease; }
@keyframes tx-shake { 20% { translate: -4px 0; } 40% { translate: 4px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }

/* numbers bump when they change */
.tx-bump { display: inline-block; animation: tx-bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tx-bump { 0% { scale: 1; } 35% { scale: 1.22; color: var(--gold); } 100% { scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  .tx *, .tx, .brand, .tx-bump { animation: none !important; }
}
