@font-face {
  font-family: "Google Sans Flex";
  src: url("fonts/google-sans-flex-400-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: Alexandria;
  src: url("fonts/alexandria-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --design-ink: #101113;
  --design-paper: #f7f7f7;
  --design-lime: #abff02;
  --design-margin: clamp(16px, 3.125vw, 60px);
  --design-gap: clamp(10px, 1.04167vw, 20px);
  --design-wide: calc(100% - 2 * var(--design-margin));
  /* Six columns and five gaps, centered within the eight-column grid. */
  --design-inner: calc(var(--design-wide) * .75 - var(--design-gap) * .25);
  --design-header-top: clamp(12px, 2.75vw, 54px);
  scroll-padding-top: calc(var(--design-header-top) + 78px);
}

.brand-wrap {
  width: var(--design-inner);
  margin-inline: auto;
}

.mast {
  top: var(--design-header-top);
  /* Give the fixed-size labels space between the mobile and desktop widths. */
  width: max(var(--design-inner), min(calc(628px + 24vw), var(--design-wide)));
}

.mast-bar {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.25vw, 24px);
  min-height: 64px;
  padding: 10px clamp(10px, 1.15vw, 22px);
  border: 0;
  border-radius: 8px;
  /* Keep the white links legible over the hero image and the light page surfaces. */
  background: linear-gradient(#101113a6, #101113a6), #99999936;
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
  box-shadow: none;
}

.mast .brand img,
.footer .brand img {
  width: clamp(96px, 10.5vw, 202px);
  height: auto;
  filter: none;
}

.mast-links {
  justify-content: space-evenly;
  gap: clamp(4px, .6vw, 12px);
}

.mast-links > a,
.mobile-toggle {
  font: 600 12pt/1.2 Alexandria, system-ui, sans-serif;
  letter-spacing: normal;
}

.mast .mast-links > a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  color: #fff;
}

.mast-links > a:hover,
.mast-links > a:focus-visible,
.mast:has(.mega:is(:hover, :focus-within)) .mast-links > a[aria-expanded="true"],
.mast-links > a[aria-current="page"] {
  color: var(--design-lime);
}

.mast-links .chevron {
  flex: none;
  inline-size: 1.35ex;
  block-size: 1ex;
  margin-inline-start: .35em;
  background: currentColor;
  clip-path: polygon(0 12%, 10% 0, 50% 72%, 90% 0, 100% 12%, 50% 100%);
  font-size: inherit;
}

.mast-actions {
  justify-content: flex-end;
}

.mast-demo {
  display: grid;
  align-items: center;
  flex: none;
  width: clamp(96px, 9.63542vw, 185px);
  min-height: 44px;
  border-radius: 7px;
}

.mast-demo > img {
  width: 100%;
  aspect-ratio: 185 / 40.08;
}

.mast-demo > img,
.footer-social-link > img {
  grid-area: 1 / 1;
}

.mast-demo-hover,
.footer-social-hover {
  visibility: hidden;
}

.mast-demo:is(:focus-visible, :active) > .mast-demo-idle,
.footer-social-link:is(:focus-visible, :active) > .footer-social-idle {
  visibility: hidden;
}

.mast-demo:is(:focus-visible, :active) > .mast-demo-hover,
.footer-social-link:is(:focus-visible, :active) > .footer-social-hover {
  visibility: visible;
}

@media (hover: hover) {
  .mast-demo:hover > .mast-demo-idle,
  .footer-social-link:hover > .footer-social-idle {
    visibility: hidden;
  }

  .mast-demo:hover > .mast-demo-hover,
  .footer-social-link:hover > .footer-social-hover {
    visibility: visible;
  }
}

.mast .mega,
.mast .mobile-nav {
  max-height: calc(100vh - var(--design-header-top) - 82px);
  max-height: calc(100dvh - var(--design-header-top) - 82px);
  overscroll-behavior: contain;
  border-radius: 8px;
  background: #242527;
  font-family: "Google Sans Flex", system-ui, sans-serif;
}

.mast .mobile-nav {
  display: none;
}

.mast :focus-visible,
.footer :focus-visible {
  outline-color: var(--design-lime);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  :root {
    --design-inner: var(--design-wide);
    --design-header-top: 12px;
  }
}

/* Keep the same breakpoint as the existing menu controller. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .mast {
    top: clamp(7px, 1.9vw, 12px);
    width: min(1164px, calc(100% - 2 * clamp(4px, .85vw, 12px)));
  }

  .mast-bar {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    min-height: clamp(58px, 17.9vw, 78px);
    padding: 5px clamp(9px, 3vw, 18px);
    background: rgb(74 75 77 / 93%);
  }

  .mast .brand {
    min-height: 44px;
  }

  .mast .brand img {
    width: clamp(90px, 29vw, 158px);
  }

  .mast-demo {
    width: clamp(68px, 22vw, 112px);
    aspect-ratio: 220.24 / 100.56;
    background: url("design/bkf-header-mobile.svg") center / contain no-repeat;
  }

  .mast-demo > img {
    display: none;
  }

  .mobile-toggle {
    gap: clamp(4px, 1.2vw, 7px);
    padding: 0;
    color: #fff;
    font: 750 clamp(15px, 4.3vw, 21px)/1 "Google Sans Flex", system-ui, sans-serif;
  }

  .mobile-toggle span {
    display: block;
    width: clamp(14px, 4.2vw, 21px);
    aspect-ratio: 41.97 / 29.72;
    background: url("design/menue_mobil.svg") center / contain no-repeat;
  }

  .mobile-toggle span::before,
  .mobile-toggle span::after {
    content: none;
  }

  @media (forced-colors: active) {
    .mobile-toggle span {
      forced-color-adjust: none;
      background: ButtonText;
      mask: url("design/menue_mobil.svg") center / contain no-repeat;
    }

    .mast-demo {
      forced-color-adjust: none;
      background-color: #101113;
    }
  }

  .mast .mega {
    display: none;
  }

  .mast .mobile-nav {
    display: grid;
  }
}

.footer {
  --footer-step: clamp(22px, 2.6vw, 50px);
  --footer-bevel: clamp(66px, 7vw, 136px);
  --footer-turn: calc((100% - var(--design-inner)) / 2 + (var(--design-inner) + var(--design-gap)) / 6 - var(--design-gap) / 2);
  --footer-edge: calc(var(--footer-turn) + var(--footer-bevel));
  padding: calc(var(--footer-step) + clamp(12px, .8vw, 16px)) 0 clamp(26px, 2.4vw, 46px);
  background: var(--design-ink);
  color: #fff;
  font-family: "Google Sans Flex", system-ui, sans-serif;
  clip-path: polygon(
    0 0,
    calc(var(--footer-turn) - 7px) 0,
    calc(var(--footer-turn) + 5px) 2px,
    calc(var(--footer-edge) - 8px) calc(var(--footer-step) - 2px),
    calc(var(--footer-edge) + 4px) var(--footer-step),
    100% var(--footer-step),
    100% 100%,
    0 100%
  );
}

.footer::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("design/x-pattern-gruen.svg") repeat center / clamp(50px, 4.6vw, 88px);
  pointer-events: none;
  opacity: 0;
  mask-image: radial-gradient(150px circle at var(--footer-pointer-x, 0px) var(--footer-pointer-y, 0px),
    #000 0%, rgb(0 0 0 / .88) 16%, rgb(0 0 0 / .61) 33%, rgb(0 0 0 / .32) 50%,
    rgb(0 0 0 / .13) 67%, rgb(0 0 0 / .04) 83%, transparent 100%);
  transition: opacity .18s ease;
}

@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion-off]) .footer[data-footer-pointer]::after {
    opacity: .72;
  }
}

.footer-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
  gap: var(--design-gap);
  margin-block-start: clamp(22px, 1.9vw, 36px);
}

.footer-note,
.footer-address,
.footer .meta,
.footer-grid nav :is(h2, h3),
.footer-social > :is(h2, h3, p) {
  margin: 0;
  color: #fff;
  font: 500 clamp(.72rem, .74vw, .875rem)/1.7 "Geist Mono", Consolas, monospace;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.footer-note {
  max-width: 19ch;
}

.footer-address {
  font-style: normal;
  overflow-wrap: anywhere;
}

.footer-grid nav {
  gap: 0;
}

.footer-grid nav > :is(h2, h3, .meta),
.footer-social > :is(h2, h3, p) {
  margin-block-end: clamp(12px, 1.65vw, 31px);
}

.footer-grid nav > a {
  display: flex;
  align-items: center;
  min-height: 25px;
  color: #fff;
  text-decoration: none;
}

.footer-grid nav > a:is(:hover, :focus-visible) {
  color: var(--design-lime);
}

.footer-social {
  display: grid;
  justify-items: end;
  justify-self: end;
  max-width: 100%;
  text-align: right;
}

.footer-social-links {
  display: flex;
  align-items: center;
  gap: clamp(4px, .35vw, 6px);
}

.footer-social-link,
.footer-social-unlinked {
  display: grid;
  place-items: center;
  padding-inline: 5px;
  min-height: 44px;
  border-radius: 4px;
}
.footer-social-links > :first-child { padding-inline-start: 0; }
.footer-social-links > :last-child { padding-inline-end: 0; }

.footer-social-link > img,
.footer-social-unlinked > img {
  width: auto;
  max-width: clamp(24px, 2.05vw, 38px);
  height: clamp(16px, 1.37vw, 26.33px);
  object-fit: contain;
}

.footer-utility {
  --footer-rule-gap: 8px;
  display: grid;
  grid-template-columns: max-content 1fr max-content 1fr max-content 1fr max-content;
  margin-block-start: clamp(92px, 12vw, 228px);
}

.footer-controls,
.footer-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  justify-items: start;
  gap: 0;
}
.footer-controls {
  padding-block-end: var(--footer-rule-gap);
}
.footer-controls > .motion-control { grid-area: 1 / 5 / 2 / 7; }
.footer-controls > a { grid-area: 1 / 6 / 2 / 8; justify-self: end; }
.footer-bottom {
  margin: 0;
  padding-block-start: var(--footer-rule-gap);
  border-top-color: #ffffff28;
  color: #c6c7c9;
  font-size: clamp(.6875rem, 1.8vw, .875rem);
  line-height: 1.3;
  text-align: center;
}

.footer .footer-bottom .legal-links {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  justify-items: start;
  width: 100%;
  gap: 0;
}
.legal-links a:nth-child(2) { grid-column: 3; }
.legal-links a:last-child { grid-column: 5; justify-self: end; }

.footer .footer-controls :is(a, .motion-control),
.footer .footer-bottom a,
.footer .footer-bottom > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  color: #c6c7c9;
  font-size: inherit;
  text-decoration: none;
}

.footer .footer-controls :is(a, .motion-control) {
  font-size: .875rem;
}

.footer :is(.footer-controls, .footer-bottom) :is(a, .motion-control):is(:hover, :focus-visible) {
  color: var(--design-lime);
}

/* Keep the underline anchored to the first letter on both entry and exit. */
:is(.mast-links > a, .mobile-nav > a, .footer-grid nav > a, .legal-links a, .footer-controls > :is(a, button)) {
  --line-scale: 0;
  --line-duration: 120ms;
  --line-easing: cubic-bezier(.42, 0, .75, .15);
  transition: color 120ms linear;
}

.mast:has(.mega:is(:hover, :focus-within)) .mast-links > a[aria-expanded="true"],
:is(.mast-links > a, .mobile-nav > a, .footer-grid nav > a, .legal-links a, .footer-controls > :is(a, button)):is(:focus-visible, :active, [aria-current="page"]) {
  --line-scale: 1;
  --line-duration: 320ms;
  --line-easing: cubic-bezier(.2, .25, .3, 1);
  transition-duration: 160ms;
  color: var(--design-lime);
}

@media (any-hover: hover) {
  :is(.mast-links > a, .mobile-nav > a, .footer-grid nav > a, .legal-links a, .footer-controls > :is(a, button)):hover {
    --line-scale: 1;
    --line-duration: 320ms;
    --line-easing: cubic-bezier(.2, .25, .3, 1);
    transition-duration: 160ms;
  }
}

.nav-label, .footer-grid nav > a, .legal-links a, .footer-controls > :is(a, button) {
  position: relative;
}
.nav-label { display: inline-block; }
.nav-label::after, .footer-grid nav > a::after, .legal-links a::after, .footer-controls > :is(a, button)::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: max(0px, calc((var(--link-target-height, 25px) - 1.2em) / 2 - 1px));
  height: clamp(1px, .125em, 2px);
  background: var(--design-lime);
  pointer-events: none;
  transform-origin: left center;
  transform: scaleX(var(--line-scale));
  transition: transform var(--line-duration) var(--line-easing);
}
.nav-label::after { inset-block: calc(50% + .53em) auto; }
.legal-links, .footer-controls { --link-target-height: 32px; }

@media (prefers-reduced-motion: reduce) {
  :is(.mast-links > a, .mobile-nav > a, .footer-grid nav > a, .legal-links a, .footer-controls > :is(a, button)),
  :is(.nav-label, .footer-grid nav > a, .legal-links a, .footer-controls > :is(a, button))::after {
    transition: none !important;
  }
}
@media (forced-colors: active) {
  :is(.nav-label, .footer-grid nav > a, .legal-links a, .footer-controls > :is(a, button))::after {
    background: LinkText;
    forced-color-adjust: none;
  }
}

@media (max-width: 1170px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: clamp(26px, 4vw, 45px);
  }

  .footer-utility {
    margin-block-start: clamp(48px, 8vw, 110px);
  }
}

@media (max-width: 620px) {
  .footer {
    --footer-turn: 28%;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .footer-controls > .motion-control { grid-column: 1 / 5; }
}

@media (forced-colors: active) {
  .mast-bar,
  .mast .mega,
  .mast .mobile-nav {
    border: 1px solid CanvasText;
    background: Canvas;
    backdrop-filter: none;
  }

  .mast .brand,
  .footer .brand,
  .footer-social-link,
  .footer-social-unlinked {
    forced-color-adjust: none;
    background: #101113;
  }

  .mast-links .chevron {
    forced-color-adjust: none;
    background: LinkText;
  }

  .footer::before,
  .footer::after {
    display: none;
  }
}
