/* Paper tricks, driven by fx.js.
   The dove on the wire: a red wire under the header links, a small paper dove perched
   on it, and the T&L monogram leaning in. The paper cursor: a red flower over links and
   buttons, a flat trail of cut-outs laid under the type, and a flower bloom on click.
   Nothing here is needed to read the page. */
:root{
  --fx-ready:1;
  --fx-ease:cubic-bezier(.2,.7,.2,1);
  --fx-spring:cubic-bezier(.25,1.15,.4,1);
  --fx-boing:cubic-bezier(.3,1.45,.45,1);
}
@supports (transition-timing-function:linear(0,1)){
  /* Damped springs: about 3% overshoot (spring) and 13% (boing). */
  :root{
    --fx-spring:linear(0,.022,.077,.155,.246,.342,.438,.531,.616,.693,.762,.82,.87,.911,.944,.97,.99,1.005,1.015,1.022,1.026,1.028,1.028,1.027,1.025,1.023,1.02,1.018,1.015,1.012,1.01,1.008,1.006,1.004,1.003,1.002,1);
    --fx-boing:linear(0,.037,.132,.263,.41,.559,.698,.821,.924,1.003,1.061,1.099,1.12,1.126,1.122,1.11,1.094,1.076,1.057,1.039,1.023,1.01,1,.993,.988,.985,.984,.985,.986,.988,.99,.993,.995,.997,.999,1,1);
  }
}

/* ---------- Paper cursor: a native cursor image, so it never lags ---------- */
@media (hover:hover) and (pointer:fine){
  a[href],button,.motion{
    cursor:url("assets/fx/cursor-flower.png") 16 16,pointer;
    cursor:-webkit-image-set(url("assets/fx/cursor-flower.png") 1x,url("assets/fx/cursor-flower-2x.png") 2x) 16 16,pointer;
    cursor:image-set(url("assets/fx/cursor-flower.png") 1x,url("assets/fx/cursor-flower-2x.png") 2x) 16 16,pointer;
  }
}

/* ---------- The flat trail: above the paper scene, under the type ---------- */
.fx-trail{position:fixed;inset:0;pointer-events:none;overflow:hidden;contain:strict}
.fx-scrap{position:absolute;left:0;top:0;pointer-events:none;opacity:0;background:center/contain no-repeat}
.fx-scrap--leaf-blue{background-image:url("assets/fx/leaf-blue-sm.webp")}
.fx-scrap--leaf-cream{background-image:url("assets/fx/leaf-cream-sm.webp")}
.fx-scrap--flower-red{background-image:url("assets/fx/flower-red-sm.webp")}
.fx-scrap--coral-yellow{background-image:url("assets/fx/coral-yellow-sm.webp")}
.fx-scrap--dove-pink{background-image:url("assets/fx/dove-pink-sm.webp")}
.fx-scrap--branch-green{background-image:url("assets/fx/branch-green-sm.webp")}

/* The click bloom. In the header it sits on the header's paper, under the links. */
.fx-bloom{position:absolute;left:0;top:0;width:44px;height:44px;margin:-22px 0 0 -22px;pointer-events:none;background:url("assets/fx/flower-red-sm.webp") center/contain no-repeat;animation:fx-bloom .75s var(--fx-ease) both}
header>.fx-bloom{z-index:-1}
@keyframes fx-bloom{0%{opacity:0;transform:scale(.2) rotate(-50deg)}30%{opacity:.95;transform:scale(1.15) rotate(0)}100%{opacity:0;transform:scale(1.35) rotate(25deg)}}

/* ---------- Dove on the wire ---------- */
.fx-nav{position:relative}
.fx-nav a:hover{border-color:transparent}
.fx-wire{position:absolute;left:0;bottom:0;width:100px;height:2.5px;background:var(--red);border-radius:1px 3px 2px 1px;transform-origin:0 50%;transform:translateX(var(--wx,0px)) scaleX(var(--ws,0));transition:transform .55s var(--fx-spring),background-color .35s;pointer-events:none}
.is-finale .fx-wire{background:var(--yellow)}
.fx-dove{--face:1;position:absolute;left:0;bottom:1.5px;width:25px;height:23px;transform:translateX(var(--dx,0px));transition:transform .6s var(--fx-spring);pointer-events:none}
.fx-dove__hop{display:block;width:100%;height:100%;transform-origin:50% 100%}
.fx-dove__hop.is-hopping{animation:fx-hop .6s var(--fx-ease)}
.fx-dove__body{display:block;width:100%;height:100%;background:url("assets/fx/dove-pink-sm.webp") 50% 100%/contain no-repeat;transform:scaleX(var(--face));filter:drop-shadow(0 1px .5px rgba(34,40,26,.16))}
.is-finale .fx-dove__body{filter:drop-shadow(0 1px .5px rgba(5,10,50,.35))}
.fx-nav:not(.fx-placed) .fx-wire,.fx-nav:not(.fx-placed) .fx-dove{visibility:hidden}
.fx-nav.fx-no-anim .fx-wire,.fx-nav.fx-no-anim .fx-dove{transition:none}
/* Takes off leaning into the way it's going, lands with a squash. */
@keyframes fx-hop{
  0%{transform:none}
  12%{transform:translateY(1px) scale(1.08,.9)}
  45%{transform:translateY(-12px) rotate(calc(-7deg * var(--face)))}
  82%{transform:translateY(0) scale(1.1,.86)}
  100%{transform:none}
}

/* The monogram: T and L lean in, the "&" twirls; a click pops a flower out of the "&". */
.fx-mono{position:relative}
.monogram .fx-letter{display:inline-block;font:inherit;margin:0;transition:transform .5s var(--fx-spring)}
.monogram .fx-letter--t{transform-origin:100% 100%}
.monogram .fx-letter--l{transform-origin:0 100%}
.monogram .fx-amp{display:inline-block;transform-origin:50% 62%}
@media (hover:hover){
  .fx-mono:hover .fx-letter--t{transform:rotate(10deg) translateX(1px)}
  .fx-mono:hover .fx-letter--l{transform:rotate(-10deg) translateX(-1px)}
  .fx-mono:hover .fx-amp{animation:fx-twirl .8s var(--fx-boing)}
}
.fx-mono:focus-visible .fx-letter--t{transform:rotate(10deg)}
.fx-mono:focus-visible .fx-letter--l{transform:rotate(-10deg)}
.fx-mono.is-kissing .fx-letter--t{transform:rotate(12deg) translateX(3px)}
.fx-mono.is-kissing .fx-letter--l{transform:rotate(-12deg) translateX(-3px)}
.fx-mono.is-kissing .fx-amp{animation:fx-hopamp .55s var(--fx-ease)}
.fx-pop{position:absolute;left:50%;top:-5px;width:19px;height:19px;margin-left:-9.5px;opacity:0;pointer-events:none;background:url("assets/fx/flower-red-sm.webp") center/contain no-repeat}
.fx-mono.is-kissing .fx-pop{animation:fx-popflower .95s var(--fx-ease)}
@keyframes fx-twirl{from{transform:rotate(0)}to{transform:rotate(360deg)}}
@keyframes fx-hopamp{0%,100%{transform:none}40%{transform:translateY(-6px) rotate(-8deg)}}
@keyframes fx-popflower{0%{opacity:0;transform:translateY(8px) scale(.2) rotate(-40deg)}30%{opacity:1;transform:translateY(-12px) scale(1.1) rotate(0)}100%{opacity:0;transform:translateY(-32px) scale(.9) rotate(30deg)}}

@media (max-width:700px){
  .fx-wire{height:2px}
  .fx-dove{width:20px;height:18px;bottom:1px}
  @keyframes fx-hop{
    0%{transform:none}
    12%{transform:translateY(1px) scale(1.08,.9)}
    45%{transform:translateY(-10px) rotate(calc(-7deg * var(--face)))}
    82%{transform:translateY(0) scale(1.1,.86)}
    100%{transform:none}
  }
}

/* ---------- Motion paused (the page's button) or reduced: things jump, nothing plays ---------- */
.fx-still .fx-wire,.fx-still .fx-dove,.fx-still .monogram .fx-letter{transition:none}
.fx-still .fx-dove__hop,.fx-still .fx-amp,.fx-still .fx-pop,.fx-still .fx-bloom{animation:none!important}
.fx-still .fx-bloom,.fx-still .fx-trail{display:none}
@media (prefers-reduced-motion:reduce){
  .fx-dove__hop,.fx-amp,.fx-pop,.fx-bloom{animation:none!important}
  .fx-trail,.fx-bloom{display:none}
}
