/* =========================================================
   Premium-Navigation
   ========================================================= */
:root { --ease-premium: cubic-bezier(0.22, 1, 0.36, 1); --ease-inout: cubic-bezier(0.65, 0, 0.35, 1); }

body { padding-top: 5.25rem; }

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  transition: transform .6s var(--ease-premium), padding .7s var(--ease-premium);
  pointer-events: none;
}
.site-header.is-hidden { transform: translateY(-130%); }

.header-bar {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  background: rgba(255, 255, 255, 0);
  border: 1px solid transparent;
  border-radius: 0;
  overflow: hidden;
  transition:
    max-width .7s var(--ease-premium),
    padding .7s var(--ease-premium),
    border-radius .7s var(--ease-premium),
    background-color .5s var(--ease-premium),
    border-color .5s var(--ease-premium),
    box-shadow .7s var(--ease-premium);
}
.site-header.is-scrolled { padding: .65rem var(--gutter) 0; }
.site-header.is-scrolled .header-bar {
  max-width: 1080px;
  padding: .5rem .5rem .5rem 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  border-color: rgba(18, 48, 77, .08);
  box-shadow: 0 1px 2px rgba(18, 48, 77, .06), 0 14px 40px -14px rgba(18, 48, 77, .3);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}

/* Rote Fortschrittslinie unten in der Leiste */
.header-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--red);
  transform: scaleX(var(--progress, 0)); transform-origin: left;
  opacity: 0; transition: opacity .4s var(--ease-premium);
  pointer-events: none;
}
.site-header.is-scrolled .header-progress { opacity: 1; }

/* Marke: Schachbrett-Wappen, Felder drehen sich beim Hover */
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; flex: none; }
.brand-name {
  font-family: var(--serif); font-size: 1.55rem; color: var(--adriatic); line-height: 1;
  transition: font-size .7s var(--ease-premium), color .4s var(--ease-premium);
}
.site-header.is-scrolled .brand-name { font-size: 1.3rem; }
.brand-mark {
  width: 26px; height: 28px; flex: none; overflow: hidden;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr);
  border: 1.5px solid var(--red);
  border-radius: 3px 3px 13px 13px;
  background: repeating-conic-gradient(var(--red) 0 25%, var(--paper) 0 50%) 0 0 / 12px 14px;
  transition: transform .6s var(--ease-premium);
}
.brand-mark.has-tiles { background: var(--paper); }
.brand-mark i {
  display: block; background: var(--red);
  transition: transform .55s var(--ease-inout);
  transition-delay: calc(var(--d, 0) * 35ms);
}
.brand-mark i.w { background: var(--paper); }
.brand:hover .brand-mark i, .brand:focus-visible .brand-mark i { transform: rotateY(180deg) scale(.55); }
.brand:hover .brand-mark { transform: rotate(-8deg); }

/* Links mit wanderndem Pill-Indikator */
.nav { position: relative; display: flex; gap: .2rem; margin-left: auto; }
.nav a {
  position: relative; z-index: 1;
  text-decoration: none; font-weight: 500; font-size: .98rem; color: var(--ink);
  padding: .6rem 1rem; border-radius: 999px;
  transition: color .4s var(--ease-premium);
}
.nav a.is-lit { color: #fff; }
.nav-indicator {
  position: absolute; z-index: 0; top: 0; left: 0; height: 100%;
  width: var(--w, 0px); transform: translateX(var(--x, 0px));
  background: var(--adriatic); border-radius: 999px;
  opacity: 0;
  transition: transform .55s var(--ease-premium), width .55s var(--ease-premium), opacity .35s var(--ease-premium);
}
.nav-indicator.is-on { opacity: 1; }
.nav-indicator::after {
  content: ""; position: absolute; left: 50%; bottom: 5px;
  width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--red);
}

/* Buchstaben rollen beim Hover nach oben */
.roll { display: inline-flex; overflow: hidden; vertical-align: top; line-height: 1.3; height: 1.3em; }
.roll .ch {
  display: inline-block; position: relative; white-space: pre;
  transition: transform .55s var(--ease-inout);
  transition-delay: calc(var(--i) * 16ms);
}
.roll .ch::after { content: attr(data-c); position: absolute; left: 0; top: 100%; }
a:hover .roll .ch, a:focus-visible .roll .ch { transform: translateY(-100%); }

/* Anruf-Button: magnetisch, Füllung wischt herein, Ring pulsiert */
.header-call {
  position: relative; isolation: isolate; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 2.75rem; padding: .45rem 1.15rem .45rem .45rem;
  background: var(--red); color: #fff; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .95rem; font-variant-numeric: tabular-nums;
  transition: box-shadow .4s var(--ease-premium);
}
.header-call::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--adriatic);
  transform: scaleX(0); transform-origin: right;
  transition: transform .6s var(--ease-inout);
}
.header-call:hover::before, .header-call:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.header-call:hover { box-shadow: 0 12px 26px -12px rgba(18, 48, 77, .8); }
.call-icon {
  position: relative; display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
}
.call-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .75);
  animation: call-ring 2.8s var(--ease-premium) infinite;
}
.header-call:hover .call-icon svg { animation: call-wiggle .55s var(--ease-inout); }
@keyframes call-ring { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(1.75); opacity: 0; } }
@keyframes call-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-16deg); } 50% { transform: rotate(13deg); } 75% { transform: rotate(-6deg); } }

/* Burger */
.burger {
  display: none; position: relative; z-index: 2; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 0; background: var(--adriatic); cursor: pointer;
  transition: background-color .4s var(--ease-premium);
}
.burger span {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px;
  background: #fff; border-radius: 2px;
  transition: transform .55s var(--ease-inout), width .55s var(--ease-inout);
}
.burger span:nth-child(1) { transform: translateY(-4px); }
.burger span:nth-child(2) { transform: translateY(4px); width: 12px; }
.burger:hover span:nth-child(2) { width: 18px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: rotate(-45deg); width: 18px; }

/* Mobiles Vollbild-Menü: öffnet als Kreis aus dem Burger */
.mobile-menu {
  position: fixed; inset: 0; z-index: 55;
  background: var(--adriatic); color: #fff;
  clip-path: circle(0px at var(--cx, 90%) var(--cy, 2.5rem));
  transition: clip-path .85s var(--ease-inout);
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { clip-path: circle(150vmax at var(--cx, 90%) var(--cy, 2.5rem)); }
.mobile-menu::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
  background: repeating-conic-gradient(var(--red) 0 25%, var(--paper) 0 50%) 0 0 / 44px 44px;
  transform: translateX(-44px);
  transition: transform 1.2s var(--ease-premium);
}
.mobile-menu.is-open::after { transform: none; }
.mm-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; padding: 7rem var(--gutter) 4.5rem; }
.mm-nav { display: flex; flex-direction: column; gap: .2rem; }
.mm-nav a { display: block; overflow: hidden; text-decoration: none; padding: .15rem 0; }
.mm-nav a span {
  display: inline-block;
  font-family: var(--serif); font-size: clamp(2.3rem, 11vw, 3.6rem); line-height: 1.12;
  transform: translateY(110%) rotate(4deg); transform-origin: left bottom;
  transition: transform .8s var(--ease-premium), color .3s;
}
.mm-nav a:hover span, .mm-nav a:focus-visible span { color: #f6b3be; }
.mobile-menu.is-open .mm-nav a span { transform: none; }
.mobile-menu.is-open .mm-nav a:nth-child(1) span { transition-delay: .22s, 0s; }
.mobile-menu.is-open .mm-nav a:nth-child(2) span { transition-delay: .29s, 0s; }
.mobile-menu.is-open .mm-nav a:nth-child(3) span { transition-delay: .36s, 0s; }
.mobile-menu.is-open .mm-nav a:nth-child(4) span { transition-delay: .43s, 0s; }
.mm-info { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease-premium), transform .5s var(--ease-premium); }
.mobile-menu.is-open .mm-info { opacity: 1; transform: none; transition-delay: .55s; }
.mm-info p { margin-top: 1.25rem; color: #c9d5e0; }

body.menu-open { overflow: hidden; }
body.menu-open .site-header { transform: none; }
body.menu-open .brand-name { color: #fff; }
body.menu-open .header-bar { background: transparent !important; border-color: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
body.menu-open .header-progress { opacity: 0; }
body.menu-open .burger { background: var(--red); }

/* Einblenden beim Laden */
.js-anim .header-bar > :not(.header-progress) { opacity: 0; }

@media (max-width: 1080px) {
  .nav a { padding: .6rem .7rem; font-size: .93rem; }
  .header-bar { gap: 1rem; }
}
@media (max-width: 960px) {
  .nav { display: none; }
  .burger { display: block; }
  .header-call { margin-left: auto; }
}
@media (max-width: 640px) {
  body { padding-top: 4.5rem; }
  .header-bar { padding: .8rem var(--gutter); gap: .5rem; }
  .site-header.is-scrolled { padding: .5rem .6rem 0; }
  .site-header.is-scrolled .header-bar { padding: .35rem .35rem .35rem 1rem; }
  .header-call { padding: .4rem; }
  .header-call .call-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .call-icon { background: none; }
  .brand-name { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu, .mobile-menu::after, .mm-nav a span, .mm-info { transition: none !important; }
  .mm-nav a span, .mm-info { transform: none; }
  .call-icon::after { animation: none; }
  .roll .ch, .brand-mark i { transition: none; }
  a:hover .roll .ch, .brand:hover .brand-mark i { transform: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
