/* UX package "nav". Owned by its package; see docs/superpowers/specs/2026-10-20-ux-komponenten-design.md.
   Mobile menu (assets/js/ux/menu.js) and the letter roll on links (assets/js/ux/char-roll.js). */

/* ---------- Masthead: logo swap and the menu toggle ---------- */
.mast__logo-dark { display: none; }
/* The dark logo stays until the closing wipe has left the corner it sits in. */
html:is(.menu-open, .menu-closing, .mast-dark) .mast__logo img { display: none; }
html:is(.menu-open, .menu-closing, .mast-dark) .mast__logo .mast__logo-dark { display: block; }

/* The masthead bands (mast-solid, mast-dark) live in base.css. While the menu is open or closing, the masthead lies
   on the dark panel: no band, so the panel shows through. */
html:is(.menu-open, .menu-closing) .mast { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

.menu-toggle { display: none; }
@media (max-width: 760px) {
  /* 44px target; the negative margins keep the masthead row as tall as the small CTA and let the
     target reach into the page margin, so the icon lines up with the content edge. */
  .menu-toggle { display: inline-flex; align-items: center; gap: 10px; min-width: 44px; min-height: 44px; margin: -3px -13px -3px -8px;
    padding: 0 13px 0 8px; border: 0; background: none; color: var(--ink); cursor: pointer; visibility: hidden;
    transition: color 0s 130ms; }
  /* Shown once the script has wired it; without JavaScript the button would do nothing. */
  .menu-toggle[data-menu-ready] { visibility: visible; }
  /* Room for "SCHLIESSEN" (uppercase turns ß into SS), so the CTA next to it does not move when the label changes. */
  .menu-toggle__label { min-width: 7.6em; text-align: right; }
  .mast__right { gap: 14px; }
}
/* On small phones the label stays as the button name, the icon carries the meaning. */
@media (max-width: 479px) {
  .menu-toggle { justify-content: flex-end; }
  .menu-toggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Two lines that cross when the menu is open. Drawn as borders, which forced colours keep visible. */
.menu-toggle i { position: relative; flex: none; width: 18px; height: 8px; }
.menu-toggle i::before, .menu-toggle i::after { content: ""; position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid;
  transition: transform .3s cubic-bezier(.2, 0, 0, 1); }
.menu-toggle i::before { top: 0; }
.menu-toggle i::after { bottom: 0; }
.menu-toggle[aria-expanded="true"] i::before { transform: translateY(3px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] i::after { transform: translateY(-3px) rotate(-45deg); }

/* Open menu: no page scroll, and the gutter keeps the layout from jumping where scrollbars take space. */
html.menu-open { overflow: hidden; scrollbar-gutter: stable; }

/* ---------- Menu panel ---------- */
.menu { position: fixed; inset: 0; z-index: 19; display: none; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 104px var(--margin) 28px; overflow-y: auto; overscroll-behavior: contain; background: var(--bg-sunk); color: var(--ink);
  background-image: radial-gradient(circle, #1C1C1F 3px, transparent 3.8px); background-size: 24px 24px; }
@media (max-width: 760px) { .menu.is-shown { display: flex; } }

.menu__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.menu__list li { border-bottom: 1px solid var(--line); }
/* Masks only while rows move, so the focus ring is never cut off. */
.menu.is-moving .menu__list li { overflow: hidden; }
/* Same cut as the service lines (.lines li b): Poppins 600, tight. */
.menu__list a { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0 12px; text-decoration: none;
  font: 600 clamp(40px, 11vw, 84px)/1 var(--sans); letter-spacing: -.045em; }
.menu__no { flex: none; margin-top: 8px; color: var(--gold); }

.menu__foot { display: grid; justify-items: start; gap: 12px; }
.menu__mail { font: 600 18px/1.3 var(--sans); letter-spacing: -.01em; text-decoration: none; }
/* The service pages, in the light grey of the legal links but at reading size. */
.menu__services { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 8px; }
.menu__services a { display: inline-block; padding: 6px 0; font: 500 16px/1.3 var(--sans); text-decoration: none; color: var(--ink-soft); }
.menu__services a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.menu__mail:hover { box-shadow: inset 0 -2px 0 var(--gold); }
.menu__legal { display: flex; gap: 20px; color: var(--ink-faint); }
.menu__legal a { display: inline-block; padding: 4px 0; text-decoration: none; }

/* ---------- Letter roll ([data-roll]) ---------- */
/* Each letter carries its second row as a text shadow one line plus a little below; the word clips both rows.
   The first value of each pair is the fallback for browsers without the lh unit. */
.roll { display: inline-block; white-space: nowrap; clip-path: inset(-.1em -.1em -.2em); }
.roll__c { display: inline-block; text-shadow: 0 1.4em currentColor; text-shadow: 0 calc(1lh + .4em) currentColor;
  transition: transform .45s cubic-bezier(.2, 0, 0, 1) calc(var(--i, 0) * 15ms); }   /* EASE.out, 15 ms per letter */
a:focus-visible .roll__c { transform: translateY(-1.4em); transform: translateY(calc(-1lh - .4em)); }
@media (hover: hover) {
  a:hover .roll__c { transform: translateY(-1.4em); transform: translateY(calc(-1lh - .4em)); }
}

/* Forced colours drop the text shadow, so the second row would be empty: keep the letters still. */
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .roll__c { transition: none; transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .mast, .menu-toggle, .menu-toggle i::before, .menu-toggle i::after { transition: none; }
}
