/* Layered brand logo: the moon, three birds and the word cut from the client's own artwork.
   Birds glide on their own paths with short bursts of wing beats; ME lifts and stands out. */
.logo { --h: 34px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo img { height: auto; transition: none; }
.logo:hover img:first-child { transform: none; }
.lg-mark { position: relative; display: block; width: calc(var(--h) * 192 / 202); height: var(--h); flex: none; }
.lg-mark > img, .lg-fly, .lg-fly > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.lg-word { position: relative; display: block; height: var(--h); width: calc(var(--h) * 347 / 99); flex: none; }
.lg-word img { position: absolute; inset: 0; width: 100%; height: 100%; }
.w-night { display: none; }
[data-theme="dark"] .w-day { display: none; }
[data-theme="dark"] .w-night { display: block; }
[data-theme="dark"] .logo .lg-moon, [data-theme="dark"] .logo .dark-ink { filter: invert(1) brightness(1.4); }
[data-theme="dark"] .logo img, [data-theme="dark"] .footer-brand img { filter: none; }
[data-theme="dark"] .logo .lg-moon, [data-theme="dark"] .logo .dark-ink { filter: invert(.92); }

/* Each bird is cut into a body and its wings (see brand/layers/*-body, *-w1, *-w2).
   At rest the birds drift slowly in place with folded-still wings; on hover they fly:
   the wings beat around the shoulder and the body rises a little on every downstroke. */
.f0 { animation: drift-a 4.8s ease-in-out infinite; }
.f1 { animation: drift-b 5.6s ease-in-out infinite; }
.f2 { animation: drift-c 4.2s ease-in-out infinite; }
@keyframes drift-a { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5%); } }
@keyframes drift-b { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2%); } }
@keyframes drift-c { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2%); } }
/* Shoulder points, in % of the 192×202 artwork. */
.w0a { transform-origin: 76% 29.7%; }
.w0b { transform-origin: 82.3% 31.7%; }
.w1a { transform-origin: 41.7% 45.5%; }
.w1b { transform-origin: 47.9% 52.5%; }
.w2a { transform-origin: 56.3% 84.7%; }
/* A paired shoulder stroke, followed by a longer recovery and a glide. */
.f0 { --beat: 1.65s; --lag: -.18s; }
.f1 { --beat: 1.9s; --lag: -.7s; }
.f2 { --beat: 1.75s; --lag: -.44s; }
.w0a { --sweep: -13deg; } .w0b { --sweep: 16deg; }
.w1a { --sweep: -17deg; } .w1b { --sweep: 12deg; }
.w2a { --sweep: -14deg; }

@keyframes wing-stroke {
  0%, 74%, 100% { transform: rotate(0) scaleY(1); }
  28% { transform: rotate(var(--sweep)) scaleY(.84); }
}
@keyframes bird-lift {
  0%, 82%, 100% { transform: translateY(0); }
  38% { transform: translateY(-1.8%); }
}
.logo:is(:hover, :focus-visible) .lg-fly { animation: bird-lift var(--beat) ease-in-out var(--lag) infinite; }
.logo:is(:hover, :focus-visible) .wing { animation: wing-stroke var(--beat) ease-in-out var(--lag) infinite; }

/* Preserve the original ME shapes and baseline; just colour the blue ink. */
.logo .lg-me { transition: filter .32s ease; }
.logo:is(:hover, :focus-visible) .lg-me { filter: saturate(1.3) brightness(1.08); }

.logo-foot { --h: 34px; width: fit-content; }
.footer-brand .logo img { height: 100%; margin: 0; }
@media (max-width: 760px) { .topbar .logo { --h: 28px; gap: 6px; } }
@media (max-width: 380px) { .topbar .lg-word { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .lg-fly, .lg-fly > img, .lg-me, .lg-word img { animation: none !important; }
}

.motion-logo { gap:7px; }
.motion-logo .rr-brandmark { width:34px; height:36px; flex:none; }
.motion-word { position:relative; display:block; width:121px; aspect-ratio:347/99; }
.motion-logo .motion-word img { position:absolute; inset:0; width:100%; height:100%; }
.logo-foot .motion-word { width:calc(var(--h) * 347 / 99); }
.motion-logo .me-bold { opacity:0; transition:opacity .2s ease; }
.motion-logo:is(:hover,:focus-visible) .me-bold { opacity:1; }
[data-theme="dark"] .rr-brandmark path[fill="#000"], [data-theme="dark"] .rr-brandmark path[fill="#2a2a2a"] { fill:#e9edf6; }
@media(max-width:760px) { .motion-logo .rr-brandmark { width:28px; height:30px; } .motion-word { width:105px; } }
@media(max-width:380px) { .motion-word { width:89px; } }
