/*
  BUS AACHOOKI blinking eyes and the BUS AACH(eyes)KI wordmark. Shared by the agency website and the passenger website: both serve an identical copy of this file and of
  brand-eyes.js, loaded once from each site's _Layout.cshtml. A test checks the copies stay identical.

  Each eye (an inline SVG, 100 units across) is a white outer ring 14% thick, a blue radial-gradient iris, a navy pupil 32% across and an
  orange highlight 10% across at the pupil's upper-right edge. A blink squashes the iris and pupil to 10% height while a navy lid covers
  them; the white ring stays visible. Close 90ms, hold 40ms, open 140ms. brand-eyes.js decides when.
*/

:root {
  --ba-eye-size: 22px;
  --ba-eye-offset: 12px;
  --ba-eye-glow: 0 0 8px rgba(8, 102, 245, 0.45);
}
@media (min-width: 768px) {
  :root {
    --ba-eye-size: 28px;
    --ba-eye-offset: 16px;
  }
}

/* The shared gradient and clip, defined once per page. Not display:none, which would break the references in some browsers. */
.ba-eyes-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

.ba-eyes {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--ba-eye-size) * 0.06);
  flex: none;
  line-height: 0;
}

.ba-eye {
  display: block;
  width: var(--ba-eye-size);
  height: var(--ba-eye-size);
  border-radius: 50%;
  box-shadow: var(--ba-eye-glow);
  overflow: visible;
}

.ba-eye__ball { transform-box: fill-box; transform-origin: 50% 50%; }
.ba-eye__lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); }

.ba-eyes.is-blinking .ba-eye__ball { animation: ba-eye-squash 270ms linear both; }
.ba-eyes.is-blinking .ba-eye__lid { animation: ba-eye-lid 270ms linear both; }

/* 0–90ms close, 90–130ms hold, 130–270ms open. */
@keyframes ba-eye-squash {
  0% { transform: scaleY(1); animation-timing-function: cubic-bezier(0.4, 0, 1, 1); }
  33.333% { transform: scaleY(0.1); }
  48.148% { transform: scaleY(0.1); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
  100% { transform: scaleY(1); }
}
@keyframes ba-eye-lid {
  0% { transform: scaleY(0); animation-timing-function: cubic-bezier(0.4, 0, 1, 1); }
  33.333% { transform: scaleY(1); }
  48.148% { transform: scaleY(1); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
  100% { transform: scaleY(0); }
}

/* The home link: the top-left pair. */
.ba-eyes-home {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  text-decoration: none;
}
.ba-eyes-home:focus-visible { outline: 2px solid #0866F5; outline-offset: 4px; }

/*
  The BUS AACH(eyes)KI wordmark: the header logo on both websites, top-left, inside .ba-eyes-home. BUS in navy, AACH..KI in royal blue,
  and the two blinking eyes standing in for the OO at the letters' size. No separate or decorative pair of eyes anywhere in the header.
*/
.brand-name {
  display: inline-flex; align-items: center; white-space: nowrap; line-height: 1;
  font-size: 1.375rem; font-weight: 800; letter-spacing: 0.04em; color: #071B35;
}
.brand-name__bus { margin-right: 0.32em; }
.brand-name__word { display: inline-flex; align-items: center; color: #0866F5; }
.ba-eyes--word { gap: 0.05em; margin: 0 0.05em 0 0.03em; pointer-events: none; }
.ba-eyes--word .ba-eye { width: 0.9em; height: 0.9em; box-shadow: 0 0 6px rgba(8, 102, 245, 0.4); }
.ba-eyes-home:hover .brand-name__bus { color: #0866F5; }
@media (max-width: 767.98px) { .brand-name { font-size: 1.15rem; } }
@media (max-width: 419.98px) { .brand-name { font-size: 1.05rem; letter-spacing: 0.03em; } }
@media (max-width: 379.98px) { .brand-name { font-size: 1rem; letter-spacing: 0.02em; } }

@media (prefers-reduced-motion: reduce) {
  .ba-eyes.is-blinking .ba-eye__ball,
  .ba-eyes.is-blinking .ba-eye__lid { animation: none; }
}
