:root {
  color-scheme: light;
  background: #fff;
  --logo-width: clamp(150px, 15.7vw, 380px);
  --header-top: 4.1vh;
  --marker-size: clamp(7px, 0.6vw, 16px);
  --step: clamp(44px, 6.81vh, 100px);
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.pages {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overflow-anchor: none;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  background: #fff;
}

.pages.moving-to-slide { scroll-snap-type: none; }

.pages::-webkit-scrollbar {
  display: none;
}

.pages section {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.slide-background {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

/* Keep the poster painted until the decoder has presented its first frame. */
.media-box { position: relative; overflow: hidden; }
.media-box > video, .media-box > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: inherit;
  object-position: inherit;
  pointer-events: none;
}
.media-box.has-frame > img { visibility: hidden; }

.preview-slide {
  position: relative;
  isolation: isolate;
  background: #171717;
}

.preview-frame {
  position: absolute;
  top: 50%;
  left: 38.5%;
  width: min(55.5%, calc(61.5% - 44px));
  z-index: 1;
  transform: translateY(-50%);
}

.preview-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
}

.applications-preview::before,
.map-preview::before,
.overview-preview::before {
  /* Behind the transparent screen opening of the 1672 × 1240 frame. */
  content: "";
  position: absolute;
  inset: 13.95% 7.8% 14.8%;
  background: white var(--preview-image) center / var(--preview-size, contain) no-repeat;
  pointer-events: none;
}

.applications-preview { --preview-image: url("assets/bewerbungsliste-vorschau.jpg?v=betriebe-1"); }
.map-preview {
  --preview-image: url("assets/standortkarte-vorschau.jpg?v=betriebe-1");
  --preview-size: cover;
}
.overview-preview { --preview-image: url("assets/uebersicht-vorschau.jpg?v=betriebe-1"); }
.applications-preview img, .map-preview img, .overview-preview img { position: relative; }
.map-credit {
  position: absolute;
  right: 8.6%;
  bottom: 15.4%;
  padding: 1px 4px;
  background: #fffe;
  color: #242424;
  font: 10px/1.2 Arial, sans-serif;
}

.preview-frame:focus-visible {
  outline: 3px solid #e62457;
  outline-offset: 3px;
  border-radius: 8px;
}

@media (min-aspect-ratio: 7/3) {
  /* Align with the centered 16:9 video on ultrawide displays. */
  .preview-frame {
    left: calc(50% - 20.44vh);
    width: 98.67vh;
  }
}

.intro-slide {
  position: relative;
  container-type: size;
}

.applications-link {
  /* The lettering ends at about 82% of the centered video frame. */
  --video-height: max(100cqh, 56.25cqw);
  --button-width: clamp(148px, min(18.5cqw, 26cqh), 280px);
  --button-height: max(44px, calc(var(--button-width) * 196 / 753));
  position: absolute;
  left: 50%;
  top: min(calc(50% + var(--video-height) * .34 + 6px),
           calc(100% - var(--button-height) - max(8px, env(safe-area-inset-bottom))));
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: var(--button-width);
  min-height: var(--button-height);
  border-radius: 8px;
  touch-action: manipulation;
}

.applications-link img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 150ms ease-out, filter 150ms ease-out;
}

@media (hover: hover) {
  .applications-link:hover img {
    transform: translateY(-3px) rotate(-1.5deg);
    filter: drop-shadow(2px 3px 0 #e62457);
  }
}

.applications-link:focus-visible {
  outline: 3px solid #e62457;
  outline-offset: 4px;
}

.applications-link:active img {
  transform: translateY(1px);
}

@media (orientation: portrait), (min-aspect-ratio: 7/3) {
  .slide-background { object-fit: contain; }
  .applications-link { --video-height: min(100cqh, 56.25cqw); }
}

@media (prefers-reduced-motion: reduce) {
  .applications-link img { transition: none; }
  .applications-link:is(:hover, :active) img { transform: none; }
}

.page-slider {
  position: fixed;
  top: 50.3%;
  right: max(4.05vw, 24px, env(safe-area-inset-right));
  transform: translate(50%, -50%);
  display: grid;
  grid-auto-rows: var(--step);
  align-items: center;
}

.page-slider a {
  display: grid;
  place-items: center;
  width: 44px;
  height: min(44px, var(--step));
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border-radius: 4px;
}

.page-slider a::after {
  content: "";
  width: var(--marker-size);
  height: var(--marker-size);
  border-radius: 2px;
  background: #b6b6b6;
  transition: height 160ms ease-out, background-color 160ms ease-out;
}

.page-slider a[aria-current="page"]::after {
  height: calc(var(--marker-size) * 3);
  background: #ff7357;
}

.page-slider a:focus-visible {
  outline: 2px solid #525252;
  outline-offset: -2px;
}

@media (max-height: 300px) {
  :root { --step: 15vh; }
}

@media (prefers-reduced-motion: reduce) {
  .page-slider a::after { transition: none; }
}

.board-logo {
  position: fixed;
  z-index: 1;
  top: var(--header-top);
  left: 5.22vw;
  display: block;
  width: var(--logo-width);
  height: auto;
}

.board-buttons {
  --button-height: clamp(34px, 3.05vw, 70px);
  position: fixed;
  z-index: 1;
  top: calc(var(--header-top) + 1.15vh);
  right: 3.65vw;
  max-width: calc(100% - 8.87vw);
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.65vw, 16px);
}

.board-buttons .bb-button {
  width: calc(var(--button-height) * 3.15);
  min-height: 44px;
}

.board-buttons .bb-button--kopf {
  width: calc(var(--button-height) * 1.025);
}

.board-buttons .bb-hover {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

@media (max-width: 650px) {
  .board-buttons {
    --button-height: clamp(22px, 7.6vw, 38px);
    top: calc(var(--header-top) + var(--logo-width) * 294 / 976 + 14px);
  }
}

.white-logo, .light-logo .intro-logo { display: none; }
.light-logo .white-logo { display: inline; }

.board-logo .wink-frames {
  visibility: hidden;
}

.wink-open-eye {
  transform-origin: 192px 202px;
}

.wink-closed-eye {
  opacity: 0;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .board-logo:hover .wink-frames {
    animation: show-wink 480ms step-end;
  }

  .board-logo:hover .wink-open-eye {
    animation: close-eye 480ms ease-in-out;
  }

  .board-logo:hover .wink-closed-eye {
    animation: show-closed-lid 480ms ease-in-out;
  }
}

@keyframes show-wink {
  0% { visibility: visible; }
  100% { visibility: hidden; }
}

@keyframes close-eye {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  22%, 62% { transform: scaleY(0.08); opacity: 0; }
}

@keyframes show-closed-lid {
  0%, 9%, 100% { opacity: 0; }
  22%, 64% { opacity: 1; }
}

.admin-login { container-type: inline-size; font-family: "Helvetica Neue",Arial,sans-serif; }
.login-screen {
  position: absolute; inset: 14.5% 8.3% 15.4%; color: #19171a;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 5.2%; background: #f5f4f3; border-radius: 2px;
}
.login-screen h1 { margin: 0; font-size: clamp(17px,7.7cqw,76px); line-height: 1.06; font-weight: 850; font-style: italic; letter-spacing: -.055em; }
.login-screen h1 span { text-decoration: underline; text-decoration-color: #ec245b; text-underline-offset: .075em; text-decoration-thickness: .10em; }
.login-screen p { margin: 3% 0 7%; font-size: clamp(11px,2.4cqw,22px); line-height: 1.3; }
.login-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
  padding: .62em 1.1em; background: white; color: #19171a; font-size: clamp(13px,3cqw,27px); font-weight: 750;
  border: 2px solid currentColor; border-radius: 7px; box-shadow: 2px 3px #19171a; text-decoration: none;
}
.login-link:is(:hover,:focus-visible) { background: #ff83ab; }
@media (max-width:560px) {
  .login-screen { padding: 4%; }
  .login-screen p { margin: 4% 0; }
  .login-link { min-height: 34px; padding: .35em .55em; }
}
@media (max-height:430px) { .login-screen p { margin: 2% 0; } }

.slide-title { display: none; }
.board-logo, .board-buttons { z-index: 4; }
.page-slider { z-index: 5; }
.board-buttons .bb-button { display: grid; align-content: center; }

@media (orientation: portrait) and (min-width: 700px) {
  :root { --logo-width: clamp(180px, 23vw, 260px); --header-top: max(26px, env(safe-area-inset-top)); }
  .board-logo { left: 3vw; }
  .board-buttons { right: 3vw; --button-height: clamp(34px, 4vw, 48px); }
  .page-slider { right: 21px; }
  .preview-slide .slide-background, .intro-slide .slide-background {
    position: absolute; top: 50%; transform: translateY(-50%);
    height: min(91vw, 78%); object-fit: cover; object-position: 28% center;
  }
  .preview-slide { background: #181719; }
  .preview-slide .preview-frame { left: 36.5%; width: calc(60% - 19px); top: 54%; }
  .preview-frame img { max-height: none; }
  .slide-title {
    display: block; position: absolute; left: 39%; bottom: calc(46% + 21vw);
    margin: 0; color: white; font: italic 850 clamp(32px, 5vw, 58px)/1 Arial,sans-serif;
    letter-spacing: -.055em; text-decoration: underline .09em #ed245e; text-underline-offset: .11em;
  }
  .intro-slide .slide-background { height: min(86vw, 70%); object-position: center; }
  .intro-slide .applications-link { --video-height: min(86cqw, 70cqh); --button-width: clamp(190px, 27cqw, 280px); }
  #seite-5 .slide-background { height: min(70vw, 70%); object-position: center; }
}

@media (orientation: portrait) and (max-width: 699px) {
  :root {
    --logo-width: clamp(154px, 42vw, 214px);
    --phone-head: calc(66px + env(safe-area-inset-top));
    --phone-dock: calc(62px + env(safe-area-inset-bottom));
    --rail-width: 34px;
    --step: clamp(34px, 5.2svh, 48px);
  }
  .board-logo { top: calc(8px + env(safe-area-inset-top)); left: max(15px, env(safe-area-inset-left)); }
  .board-buttons {
    inset: auto 0 0; width: 100%; max-width: none; height: var(--phone-dock);
    display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) 44px;
    gap: clamp(3px,1vw,8px); align-items: center;
    padding: 5px max(9px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left));
    background: #f7f6f5; border-top: 2px solid #19171a;
  }
  .board-buttons .bb-button, .board-buttons .bb-button--kopf { width: 100%; height: 46px; }
  .board-buttons .bb-button img { max-height: 43px; object-fit: contain; }
  .page-slider { right: env(safe-area-inset-right); top: 46%; transform: translateY(-50%); }
  .page-slider a { width: var(--rail-width); height: var(--step); }
  .page-slider a::after { box-shadow: 0 0 0 1px #5559; }
  .page-slider a[aria-current="page"]::after { background: #ed245e; }
  .preview-slide {
    display: grid; grid-template-rows: minmax(0,1fr) minmax(0,1fr);
    padding-block: var(--phone-head) var(--phone-dock); background: #191819;
  }
  .preview-slide .slide-background {
    grid-area: 1 / 1; min-height: 0; object-fit: cover; object-position: 16% center;
    border-bottom: 2px solid #393639;
  }
  .slide-title {
    grid-area: 1 / 1; display: block; align-self: center; justify-self: end; z-index: 1;
    margin: 0 calc(var(--rail-width) + 6px) 0 0; color: #fff;
    font: italic 850 clamp(22px,6.6vw,36px)/1.12 Arial,sans-serif; letter-spacing: -.055em;
    text-decoration: underline .11em #ed245e; text-underline-offset: .12em;
    text-shadow: 1px 2px 2px #181719;
  }
  .preview-slide .preview-frame {
    position: relative; grid-area: 2 / 1; align-self: center; justify-self: center; left: auto; top: auto;
    transform: none; margin-right: 17px;
    width: min(calc(100% - var(--rail-width) - 13px), calc((100svh - var(--phone-head) - var(--phone-dock)) * .64));
  }
  .preview-frame img { max-height: none; }
  .login-screen { padding: 5%; }
  .login-screen h1 { font-size: clamp(22px, 9cqw, 40px); }
  .login-screen p { margin: .4em 0 .85em; font-size: clamp(13px, 4cqw, 16px); }
  .login-link { min-height: 44px; font-size: clamp(14px, 4.8cqw, 18px); padding: .36em .75em; }
  #seite-5 .slide-background {
    grid-row: 1 / -1; align-self: center; height: min(80vw, 76%); object-position: 51% center;
    border-block: 2px solid #393639;
  }
  .intro-slide .slide-background {
    position: absolute; left: 0; top: 45%; transform: translateY(-50%);
    height: min(105vw, 59%); object-fit: cover; object-position: center;
    border-block: 2px solid #19171a;
  }
  .intro-slide .applications-link {
    --button-width: clamp(164px, 52vw, 250px);
    top: min(calc(45% + min(52.5cqw,29.5cqh) + 14px),calc(100% - var(--phone-dock) - var(--button-height) - 6px));
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  :root { --header-top: max(7px,env(safe-area-inset-top)); --logo-width: clamp(110px, 17vw, 168px); --step: min(44px,12vh); }
  .board-logo { left: max(15px,env(safe-area-inset-left)); }
  .board-buttons { --button-height: clamp(24px, 3.9vw, 37px); right: max(14px,env(safe-area-inset-right)); top: var(--header-top); }
  .page-slider { right: max(19px,env(safe-area-inset-right)); top: 56%; }
  .preview-slide .preview-frame { left: 43%; top: 56%; width: min(calc(50% - 22px), 102vh); }
  .preview-frame img { max-height: none; }
  .login-link { min-height: 38px; }
  .intro-slide .applications-link { --button-width: min(26vw, 164px); }
}

.board-logo > svg { display: block; width: 100%; }
.board-logo:focus-visible, .music-toggle:focus-visible { outline: 3px solid #e62457; outline-offset: 4px; }

.music-toggle {
  position: absolute;
  left: max(3.65vw, 14px, env(safe-area-inset-left));
  bottom: max(3.5vh, 12px, env(safe-area-inset-bottom));
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 9px;
  border: 2px solid #171519; border-radius: 50%;
  background: #fff; color: #171519; box-shadow: 0 3px #171519;
  cursor: pointer; touch-action: manipulation;
}
.music-toggle svg { width: 23px; height: 23px; }
.music-toggle[aria-pressed="false"] .sound-on,
.music-toggle[aria-pressed="true"] .sound-off { display: none; }
.music-toggle:is(:hover, :focus-visible) { background: #ff83ab; }
@media (orientation: portrait) and (max-width: 699px) {
  .music-toggle { bottom: calc(var(--phone-dock) + 10px); }
}

.login-screen { gap:clamp(5px,2.1cqw,18px); }
.interview-link { color:inherit; font-size:clamp(12px,2.5cqw,21px); font-weight:650; text-underline-offset:.2em; }
.interview-link:is(:hover,:focus-visible) { color:#9c1b44; }
