/* Shared navigation for the homepage and press page. */
.desktop-navigation {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.desktop-navigation a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #3d2b1f;
  font:
    400 0.875rem 'DM Sans',
    sans-serif;
  text-decoration: none;
}
.desktop-navigation a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
.mobile-navigation {
  display: none;
}
#funktionen,
#ablauf,
#stimmen,
#premium {
  scroll-margin-top: 100px;
}
@media (max-width: 1100px) {
  #navbar {
    gap: 0.75rem;
    padding: 0 1.5rem;
    height: 72px;
    mask: none;
    -webkit-mask: none;
    overflow: visible;
  }
  #navbar .logo {
    width: 126px;
  }
  #navbar .nav-right {
    margin-left: auto;
  }
  #navbar .desktop-navigation,
  .site-nav .press-nav,
  .site-nav > .back-link {
    display: none;
  }
  .site-nav {
    flex-wrap: nowrap;
  }
  .mobile-navigation {
    display: block;
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
    color: #3d2b1f;
    font:
      500 0.875rem 'DM Sans',
      sans-serif;
  }
  #navbar .mobile-navigation {
    margin-left: 0;
  }
  .mobile-navigation summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    list-style: none;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border: 1px solid #6b4c3b40;
    border-radius: 999px;
  }
  .mobile-navigation summary::-webkit-details-marker {
    display: none;
  }
  .mobile-navigation summary span {
    width: 14px;
    height: 8px;
    border-top: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
  }
  .mobile-navigation[open] summary {
    background: #f5ecd8;
  }
  .mobile-navigation summary:focus-visible {
    outline: 2px solid #985025;
    outline-offset: 3px;
  }
  .mobile-navigation-links {
    position: absolute;
    right: 0;
    top: calc(100% + 0.75rem);
    width: min(280px, calc(100vw - 3rem));
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    padding: 0.5rem;
    background: #faf6ef;
    border: 1px solid #ded2bd;
    border-radius: 16px;
    box-shadow: 0 12px 30px #3d2b1f1a;
    z-index: 110;
  }
  .mobile-navigation-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.75rem 1rem;
    color: #3d2b1f;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 10px;
  }
  .mobile-navigation-links a:hover,
  .mobile-navigation-links a:focus-visible {
    background: #f5ecd8;
  }
}
@media (max-width: 380px) {
  #navbar {
    padding-inline: 1rem;
    gap: 0.5rem;
  }
  #navbar .logo {
    width: 105px;
  }
}

/* Full-width mobile panel, with the same paper edge as the page sections. */
@media (max-width: 1100px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #faf6ef;
  }
  .site-nav {
    position: static;
    min-height: 72px;
    padding-block: 0;
  }
  .mobile-navigation {
    position: static;
  }
  .mobile-navigation summary {
    position: relative;
    z-index: 113;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
  }
  .mobile-navigation summary span {
    position: relative;
    width: 20px;
    height: 16px;
    border: 0;
  }
  .mobile-navigation summary span::before,
  .mobile-navigation summary span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 1.5px;
    background: currentColor;
    transition:
      transform 0.18s ease,
      top 0.18s ease;
  }
  .mobile-navigation summary span::before {
    top: 4px;
  }
  .mobile-navigation summary span::after {
    top: 11px;
  }
  .mobile-navigation[open] summary span::before {
    top: 7px;
    transform: rotate(45deg);
  }
  .mobile-navigation[open] summary span::after {
    top: 7px;
    transform: rotate(-45deg);
  }
  .mobile-navigation[open] summary {
    background: transparent;
  }
  .navigation-backdrop {
    position: fixed;
    inset: 72px 0 0;
    z-index: 109;
    width: 100%;
    height: calc(100dvh - 72px);
    border: 0;
    background: #3d2b1f26;
    cursor: default;
  }
  .mobile-navigation-links {
    position: absolute;
    inset: 100% 0 auto;
    width: 100%;
    max-height: calc(100dvh - 88px);
    padding: 1rem max(1.5rem, env(safe-area-inset-left)) 3rem;
    background: #faf6ef;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    z-index: 112;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V380C1120 400 920 400 720 387S240 372 0 387Z' fill='white'/%3E%3C/svg%3E")
      center / 100% 100% no-repeat;
  }
  .mobile-navigation-links a {
    position: relative;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.4;
    min-height: 56px;
    padding: 0.8rem 1rem;
    border-radius: 0;
  }
  .mobile-navigation-links a[aria-current='location'] {
    font-weight: 500;
  }
  .mobile-navigation-links a[aria-current='location']::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: #d4823a;
    transform: translateY(-50%);
  }
  .mobile-navigation[open] .mobile-navigation-links {
    animation: navigation-reveal 0.18s ease-out;
  }
  #fakten,
  #geschichte,
  #screenshots,
  #marke,
  #kontakt {
    scroll-margin-top: 100px;
  }
}
@keyframes navigation-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-navigation[open] .mobile-navigation-links {
    animation: none;
  }
  .mobile-navigation summary span::before,
  .mobile-navigation summary span::after {
    transition: none;
  }
}
/* Preserve the homepage scroll banner; an open menu takes precedence. */
@media (max-width: 1100px) {
  #navbar .nav-cta {
    display: inline-flex !important;
  }
  #navbar:has(.mobile-navigation[open]) {
    transform: none;
    pointer-events: auto;
  }
  #navbar:has(.mobile-navigation[open]) ~ .app-bar {
    visibility: hidden;
    pointer-events: none;
  }
}
