.hagilight-footer {
  --hagilight-footer-border: var(--ifm-color-emphasis-300);
  --hagilight-footer-muted: var(--ifm-color-emphasis-700);
  border-top: 1px solid var(--hagilight-footer-border);
  color: var(--ifm-font-color-base);
  padding: 1.5rem var(--ifm-spacing-horizontal, 1rem) 1rem;
}

.hagilight-footer__sections {
  container: hagilight-cols / inline-size;
  margin: 0 auto 1.75rem;
  max-width: 72rem;
}

.hagilight-footer__base {
  margin: 0 auto;
  max-width: 72rem;
}

.hagilight-footer h2 {
  font-size: 0.95rem;
  font-weight: 650;
}

.hagilight-footer ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hagilight-footer a,
.hagilight-footer a:hover {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.2em;
}

.hagilight-footer a:hover {
  text-decoration: underline;
}

.hagilight-footer a:focus-visible {
  border-radius: 0.125rem;
  outline: 2px solid currentColor;
  outline-offset: 0.2rem;
}

.hagilight-footer__copyright {
  color: var(--hagilight-footer-muted);
  font-size: 0.8rem;
  margin: 1rem 0 0;
  text-align: center;
}

.hagilight-footer__attribution {
  overflow-wrap: anywhere;
}

.hagilight-footer__build {
  overflow-wrap: anywhere;
}

/* Footer columns: four level, purpose-based columns. Each column owns a rule that
   draws in as it scrolls into view and runs the full width while the column is
   used; the other columns' headings step back. */
.hagilight-cols,
.hagilight-footer__base {
  --_accent: var(--hagilight-footer-accent, var(--ifm-color-primary, currentColor));
  --_track: var(--hagilight-footer-border, color-mix(in srgb, currentColor 26%, transparent));
}

.hagilight-cols {
  --_ease: cubic-bezier(0.16, 1, 0.3, 1);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1.5rem;
}

@container hagilight-cols (max-width: 19rem) {
  .hagilight-cols { grid-template-columns: minmax(0, 1fr); }
}

@container hagilight-cols (min-width: 40rem) {
  .hagilight-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 2.25rem; }
}

.hagilight-col {
  --_seg: 0.12;
  position: relative;
  min-width: 0;
  padding-top: 1.125rem;
}

.hagilight-col::before,
.hagilight-col::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  pointer-events: none;
}

.hagilight-col::before { background: var(--_track); }

.hagilight-col::after {
  height: 2px;
  margin-top: -0.5px;
  background: var(--_accent);
  transform-origin: left center;
  scale: var(--_seg) 1;
  transition: scale 0.6s var(--_ease);
}

.hagilight-col h2 {
  margin: 0 0 0.875rem;
  transition: opacity 0.3s ease-out;
}

.hagilight-col ul { gap: 0.4rem; }

.hagilight-col a {
  position: relative;
  display: inline-block;
  padding-block: 0.125rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: text-decoration-color 0.25s ease-out;
  -webkit-tap-highlight-color: transparent;
}

/* The link's own rule draws in the gutter, so a hover never reflows the label. */
.hagilight-col a::before {
  content: '';
  position: absolute;
  top: 0.82em;
  left: -0.95rem;
  width: 0.7rem;
  height: 1px;
  background: var(--_accent);
  transform-origin: left center;
  scale: 0 1;
  transition: scale 0.35s var(--_ease);
}

.hagilight-col a[target='_blank']::after {
  /* Joined to the last word by no-break spaces, so the arrow never wraps onto a line of its own. */
  content: '\00a0\00a0\00a0';
  background: currentColor;
  opacity: 0.5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 11.5l7-7M5.5 4.5h6v6' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right center / 0.62em 0.62em no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 11.5l7-7M5.5 4.5h6v6' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right center / 0.62em 0.62em no-repeat;
  transition: mask-position 0.3s var(--_ease), opacity 0.3s ease-out;
}

.hagilight-col a:is(:hover, :focus-visible) { text-decoration-color: currentColor; }
.hagilight-col a:is(:hover, :focus-visible)::before { scale: 1 1; }
.hagilight-col a[target='_blank']:is(:hover, :focus-visible)::after {
    opacity: 0.9;
    -webkit-mask-position: calc(100% + 0.1em) calc(50% - 0.1em);
    mask-position: calc(100% + 0.1em) calc(50% - 0.1em);
  }

.hagilight-col:is(:hover, :focus-within) { --_seg: 1; }

@media (hover: hover) {
  .hagilight-cols:has(.hagilight-col:is(:hover, :focus-within)) .hagilight-col:not(:hover, :focus-within) h2 {
    opacity: 0.5;
  }
}

.hagilight-cols ::selection,
.hagilight-footer__base ::selection {
  background: color-mix(in srgb, var(--_accent) 34%, transparent);
  color: inherit;
}

/* The one authored moment: columns rise out of a blur, one after another, as the footer scrolls in.
   Without scroll-driven animation support, or under reduced motion, the columns are simply there. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .hagilight-col {
      animation-name: hagilight-col-in;
      animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
      animation-fill-mode: both;
      animation-timeline: view();
      animation-range: entry calc(var(--hagilight-col-i, 0) * 6%) entry calc(46% + var(--hagilight-col-i, 0) * 6%);
    }

    .hagilight-col::after {
      animation-name: hagilight-col-rule;
      animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
      animation-fill-mode: both;
      animation-timeline: view();
      animation-range: entry calc(var(--hagilight-col-i, 0) * 6%) entry calc(60% + var(--hagilight-col-i, 0) * 6%);
    }
  }
}

@keyframes hagilight-col-in {
  from { opacity: 0; translate: 0 1.25rem; filter: blur(6px); }
  to { opacity: 1; translate: 0 0; filter: blur(0); }
}

@keyframes hagilight-col-rule {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* The bottom row: feeds on the start side, filings on the end side. */
.hagilight-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  border-top: 1px solid var(--_track);
  padding-top: 1rem;
}

.hagilight-footer__feeds,
.hagilight-footer__filings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.hagilight-footer__feeds a,
.hagilight-footer__filings a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: text-decoration-color 0.25s ease-out;
}

.hagilight-footer__feeds a:is(:hover, :focus-visible),
.hagilight-footer__filings a:is(:hover, :focus-visible) { text-decoration-color: currentColor; }

/* Product statement: headline, summary, calls to action, and the three pillars. */
.hagilight-footer .hagilight-brand {
  --_heading: var(--ifm-heading-color, currentColor);
  --_muted: var(--hagilight-footer-muted, var(--ifm-color-emphasis-700, color-mix(in srgb, currentColor 72%, transparent)));
  --_rule: var(--hagilight-footer-border, var(--ifm-color-emphasis-300));
  container: hagilight-brand / inline-size;
  display: grid;
  gap: 2.25rem;
  margin: 0 auto 2rem;
  max-width: 72rem;
  padding-block: 1rem 2.25rem;
  border-bottom: 1px solid var(--_rule);
}

/* Korean breaks between words, not inside them. */
.hagilight-footer .hagilight-brand:lang(ko) {
  overflow-wrap: break-word;
  word-break: keep-all;
}

.hagilight-footer .hagilight-brand__lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 3.5rem;
}

.hagilight-footer .hagilight-brand__title {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

/* The decorative avatar keeps a fixed box, so neither the fan nor a swap ever moves the headline. */
.hagilight-footer .hagilight-brand__avatar {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
}

.hagilight-footer .hagilight-brand__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0.5rem;
  object-fit: cover;
}

/*
 * The fan: three 56 px cards pivot on a point below the stack, so the side cards open like a hand of cards.
 * The vendored default is the first centre card and fades out as the random cards are dealt over it. Each
 * turn the left card leaves, the others shift left and a card waiting off stage enters on the right.
 */
.hagilight-footer .hagilight-brand__avatar[data-random-fan] {
  --_card-ring: var(--ifm-background-color, Canvas);
  position: relative;
  width: 112px;
  height: 76px;
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] img,
.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card {
  position: absolute;
  top: 10px;
  left: 28px;
  width: 56px;
  height: 56px;
  box-shadow: 0 0 0 2px var(--_card-ring), 0 3px 8px -2px rgb(0 0 0 / 0.35);
  transform-origin: 50% 140%;
  transition: opacity 320ms ease-out, transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan {
  position: absolute;
  inset: 0;
  display: block;
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] img[data-fan-out] {
  opacity: 0;
  transform: scale(0.9);
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card {
  z-index: 0;
  opacity: 0;
  transform: scale(0.6);
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card[data-slot="0"] {
  z-index: 1;
  opacity: 1;
  transform: translate(-6px, 1px) rotate(-17deg);
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card[data-slot="1"] {
  z-index: 3;
  opacity: 1;
  transform: none;
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card[data-slot="2"] {
  z-index: 2;
  opacity: 1;
  transform: translate(6px, 1px) rotate(17deg);
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card[data-slot="3"],
.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card[data-slot="4"] {
  transform: translate(10px, 0) rotate(34deg) scale(0.7);
}

.hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card[data-slot="5"] {
  transform: translate(-10px, 0) rotate(-36deg) scale(0.7);
}

@media (prefers-reduced-motion: reduce) {
  .hagilight-footer .hagilight-brand__avatar[data-random-fan] img,
  .hagilight-footer .hagilight-brand__avatar[data-random-fan] .hagilight-fan__card {
    transition: none;
  }
}

/* Hidden in a brand block narrower than 360 px, where the headline needs the full width. */
@container hagilight-brand (max-width: 359.98px) {
  .hagilight-footer .hagilight-brand__avatar {
    display: none;
  }
}

.hagilight-footer .hagilight-brand__headline {
  margin: 0;
  color: var(--_heading);
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3rem);
  font-size: clamp(1.75rem, 1rem + 3.2cqi, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

.hagilight-footer .hagilight-brand__headline:lang(zh),
.hagilight-footer .hagilight-brand__headline:lang(ja),
.hagilight-footer .hagilight-brand__headline:lang(ko) {
  letter-spacing: 0;
  line-height: 1.25;
}

.hagilight-footer .hagilight-brand__body {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  min-width: 0;
}

.hagilight-footer .hagilight-brand__summary {
  margin: 0;
  max-width: 62ch;
  color: var(--_muted);
  font-size: 1rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.hagilight-footer .hagilight-brand__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
}

.hagilight-footer .hagilight-brand__primary,
.hagilight-footer .hagilight-brand__secondary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--_heading);
  text-decoration: none;
}

.hagilight-footer .hagilight-brand__primary {
  gap: 0.6rem;
  border: 2px solid currentColor;
  border-radius: 0.5rem;
  padding-inline: 1.1rem;
  font-weight: 650;
  transition: background-color 180ms ease-out;
}

.hagilight-footer .hagilight-brand__primary:hover {
  background-color: color-mix(in srgb, currentColor 10%, transparent);
}

.hagilight-footer .hagilight-brand__arrow {
  flex: none;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hagilight-footer .hagilight-brand__primary:hover .hagilight-brand__arrow,
.hagilight-footer .hagilight-brand__primary:focus-visible .hagilight-brand__arrow {
  transform: translateX(0.3rem);
}

.hagilight-footer .hagilight-brand__secondary {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.hagilight-footer .hagilight-brand__secondary:hover {
  text-decoration-thickness: 2px;
}

.hagilight-footer .hagilight-brand a:focus-visible {
  border-radius: 0.25rem;
  outline: 2px solid currentColor;
  outline-offset: 0.25rem;
}

.hagilight-footer .hagilight-brand__pillars {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.hagilight-footer .hagilight-brand__pillar {
  position: relative;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--_rule);
}

/* The heavy rule that the scroll-driven reveal draws over the hairline track. */
.hagilight-footer .hagilight-brand__pillar::before {
  content: '';
  position: absolute;
  inset: -1px 0 auto;
  height: 2px;
  background: var(--_heading);
  transform-origin: left center;
}

.hagilight-footer .hagilight-brand__pillar dt {
  margin: 0 0 0.4rem;
  color: var(--_heading);
  font-size: 1.05rem;
  font-weight: 650;
}

.hagilight-footer .hagilight-brand__pillar dd {
  margin: 0;
  max-width: none;
  color: var(--_muted);
  font-size: 0.9rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Breakpoints follow the width the footer is given, not the viewport: Starlight's content pane is narrow. */
@container hagilight-brand (min-width: 40rem) {
  .hagilight-footer .hagilight-brand__pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 2.5rem;
  }

  .hagilight-footer .hagilight-brand__pillar dd {
    max-width: 34ch;
  }
}

@container hagilight-brand (min-width: 52rem) {
  .hagilight-footer .hagilight-brand__lead {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: end;
  }
}

/*
 * The one authored moment: as the footer scrolls into view the headline is uncovered from
 * its baseline and the three pillar rules draw in left to right, one after another.
 * Without scroll-driven animation, or with reduced motion, everything is simply shown.
 */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .hagilight-footer .hagilight-brand__headline {
      animation-name: hagilight-brand-uncover;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }

    .hagilight-footer .hagilight-brand__pillar::before {
      animation-name: hagilight-brand-draw;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: view();
      animation-range:
        entry calc(10% + var(--hagilight-brand-i, 0) * 14%)
        entry calc(70% + var(--hagilight-brand-i, 0) * 14%);
    }
  }
}

@keyframes hagilight-brand-uncover {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translateY(0.4em);
  }

  to {
    clip-path: inset(0 0 -0.2em 0);
    transform: none;
  }
}

@keyframes hagilight-brand-draw {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}
