/* freifisch – Stylesheet */

/* ---------- Schrift ---------- */
@font-face { font-family: "Barlow"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fonts/barlow-300.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/barlow-700.woff2") format("woff2"); }

/* ---------- Farben & Variablen ---------- */
:root {
  --bg: #000;
  --fg: #fff;
  --hover: #9a9a9a;
  --font: "Barlow", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pad: clamp(20px, 3vw, 44px);
  --max: 1240px;                    /* gemeinsame Inhaltsbreite aller Seiten */
  --zoom: 1;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fff;
  --fg: #000;
  --hover: #666;
  color-scheme: light;
}
:root[data-size="1"] { --zoom: 1.15; }
:root[data-size="2"] { --zoom: 1.3; }

/* ---------- Farbwechsel (Kreis-Reveal vom Button aus, siehe site.js) ---------- */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* Browser ohne View Transitions: weiches Überblenden */
@supports not (view-transition-name: none) {
  body { transition: background-color .7s cubic-bezier(.16, 1, .3, 1), color .7s cubic-bezier(.16, 1, .3, 1); }
}

/* ---------- Seitenübergang: Inhalt blendet weich über, Fußleiste bleibt stehen ---------- */
@view-transition { navigation: auto; }

:root:not([data-vt="theme"]) main { view-transition-name: page; }

::view-transition-old(page) { animation: page-out .25s ease both; }
::view-transition-new(page) { animation: page-in .55s cubic-bezier(.16, 1, .3, 1) both; }

@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(1.2vh); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- Sprachumschaltung ---------- */
html[lang="de"] [lang="en"],
html[lang="en"] [lang="de"] { display: none; }

/* ---------- Basis ---------- */
* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 300 clamp(16px, 1.4vw, 22px) / 1.4 var(--font);
  scrollbar-width: thin;
  scrollbar-color: currentColor transparent;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; transition: color .2s; }
a:hover, .hl:hover { color: var(--hover); }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--fg); outline-offset: 4px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  text-decoration: none;
  position: absolute;
  left: -9999px; top: 8px;
  z-index: 20;
  padding: 12px 16px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 300;
}
.skip:focus { left: 8px; }


/* ---------- Fortschrittslinie (Seite 1–5, siehe site.js) ---------- */
.progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 1;
  height: 2px;
  pointer-events: none;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--fg);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Seitengerüst ---------- */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  align-items: center;
  padding: var(--pad);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
main:focus { outline: none; }

.wrap {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vh, 32px);
  width: min(100%, var(--max));
  container-type: inline-size;      /* Titelgröße bezieht sich auf die Inhaltsbreite */
}

/* ---------- Titel ---------- */
h1 {
  margin: 0 0 0 -.05em;            /* optischer Randausgleich links */
  font-weight: 300;
  font-size: max(36px, min(16cqw, 20vh, 260px));   /* eine Größe für alle Seitentitel, bemessen am längsten Wort */
  line-height: .85;
  letter-spacing: -.05em;
  padding-bottom: .08em;           /* Unterlängen nicht abschneiden */
  white-space: nowrap;
  width: fit-content;
}
h1:focus { outline: none; }

/* Titel: Buchstaben einzeln (aus site.js), steigen beim Öffnen auf */
h1 .ch { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  h1.is-in .ch { animation: title-in .9s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i) * 38ms); }
  @keyframes title-in { from { opacity: 0; transform: translateY(.28em); } }
}

/* Titel öffnet sich beim Darüberfahren ganz langsam (nur mit Maus, nicht bei reduzierter Bewegung) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  h1 { transition: letter-spacing 1.6s cubic-bezier(.16, 1, .3, 1); }
  h1:hover { letter-spacing: -.035em; }
}

/* ---------- Inhalt ---------- */
.body { zoom: var(--zoom); }

.rule {
  padding-top: clamp(12px, 2vh, 24px);
  border-top: 1px solid currentColor;
}


/* Einzelner Abschnitt (sozpaed, 404) */
.feature { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; margin-top: 6mm; }
.feature h2 { margin: 0; font-size: clamp(18px, 1.8vw, 26px); font-weight: 300; }
.feature .row { display: flex; align-items: flex-start; gap: clamp(20px, 2.4vw, 36px); width: 100%; }
.feature .text { max-width: 28em; line-height: 1.2; letter-spacing: -.02em; font-size: clamp(20px, 3vw, 46px); font-weight: 300; }
.feature .note { margin-top: 18px; font-size: clamp(16px, 1.4vw, 21px); line-height: 1.3; letter-spacing: 0; }

.arrow {
  display: flex; align-items: center; justify-content: center;
  flex: none;
  width: 64px; height: 64px;
  border: 1px solid var(--fg);
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.arrow svg { transition: transform .25s; }
.arrow:hover { background: var(--fg); color: var(--bg); }
.arrow:hover svg { transform: translate(3px, -3px); }

/* Raster (kontakt, info, datenschutz) */
.grid {
  display: grid;
  gap: clamp(20px, 2vw, 36px) clamp(32px, 6vw, 96px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  align-items: start;
  font-size: clamp(14px, 1vw, 17px);
  line-height: 1.35;
}
.grid--row { display: flex; flex-wrap: wrap; justify-content: flex-start; }
.grid--row .links a { white-space: nowrap; }
.grid--privacy {
  grid-template-columns: 1fr 1.8fr 1.1fr 1.1fr 1.1fr;   /* mittlere Spalte (Daten & Cookies) ist die längste */
  gap: 0 clamp(16px, 2.2vw, 32px);
  font-size: clamp(12px, .95vw, 15px);
  line-height: 1.4;
}
@media (max-width: 1023px) {
  .grid--privacy { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 24px 32px; font-size: 16px; }
}
.grid--kontakt { font-size: clamp(18px, 2.4vw, 38px); }
.grid--info { font-size: clamp(20px, 2.8vw, 42px); }
.grid > div { min-width: 0; }
.grid h2 { margin: 0 0 8px; font-size: 16px; font-weight: 300; }
.grid:not(.grid--privacy) h2 { font-size: clamp(14px, 1.2vw, 18px); }
.grid .strong { font-weight: 300; }
.grid .lines { white-space: pre-line; }

.links { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.links a {
  display: block;
  font-size: inherit;
  line-height: 1.2;
  text-decoration: underline dotted 1px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);   /* sanfte Punkte */
  text-underline-offset: 6px;
  transition: color .2s, text-decoration-color .3s;
}
.links a:hover { text-decoration-color: currentColor; }
.grid--kontakt .links a { font-size: clamp(18px, 2.6vw, 40px); }
.grid--kontakt .links--small a { font-size: clamp(20px, 1.8vw, 26px); }
.links a.has-ext { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.links a.has-ext .ext-label {
  text-decoration: underline dotted 1px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 6px;
}
.ext {
  display: flex; align-items: center; justify-content: center;
  flex: none;
  width: 28px; height: 28px;
  border: 1px solid currentColor;
  transition: background-color .2s, color .2s;
  order: -1;                          /* Quadrat vor dem Text: steht immer bündig */
}
.ext svg { transition: transform .25s; }
.links a.has-ext:hover .ext { background: var(--fg); color: var(--bg); }
.links a.has-ext:hover .ext svg { transform: translate(1px, -1px); }
.links a.has-ext:hover .ext-label { text-decoration-color: currentColor; }
.grid--kontakt .links--save { margin-top: 14px; }
.grid--kontakt .links--save a { font-size: clamp(15px, 1.2vw, 18px); }

.copy {
  display: flex; align-items: center; justify-content: center;
  flex: none;
  width: 28px; height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.copy svg { width: 12px; height: 12px; }
.copy:hover { background: var(--fg); color: var(--bg); }
.copy .ok { display: none; }
.copy.is-copied .ok { display: block; }
.copy.is-copied .clip { display: none; }

.clients-label { margin: 0 0 calc(8px + 2mm); font-size: clamp(14px, 1.2vw, 18px); font-weight: 300; }
.clients-label strong { font-weight: 700; }   /* einzige Fettschrift der Seite */
.clients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Auf breiten Bildschirmen füllen alle Kacheln genau eine Reihe (Anzahl --n kommt aus dem HTML) */
@media (min-width: 1330px) {
  .clients { grid-template-columns: repeat(var(--n, 11), minmax(0, 1fr)); }
}
/* Größere Textgröße (A+ / A++): Kacheln bleiben im Verhältnis zur Schrift, dafür brechen sie in mehrere Reihen */
:root[data-size="1"] .clients,
:root[data-size="2"] .clients { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

.clients li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 4px;
  border: 1px solid currentColor;
  background: var(--bg);
  font-size: 18px;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* Aktiv: Maus darüber, angetippt (.is-on) oder beim Scrollen (.is-lit) – dezent größer mit Code-Angaben */
.clients li .sel { inset: -1px; }
.clients li .anno {
  position: absolute;
  left: 8px;
  font: 400 10px/1 var(--mono);
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .25s;
}
.clients li .anno--tag { top: 7px; }
.clients li .anno--value { bottom: 7px; }
.clients li.is-on, .clients li.is-lit { z-index: 2; transform: scale(1.06); }
.clients li.is-on .sel, .clients li.is-lit .sel { opacity: 1; }
.clients li.is-on .sel i, .clients li.is-lit .sel i { transform: none; }
.clients li.is-on .anno, .clients li.is-lit .anno { opacity: .85; }
@media (hover: hover) {
  .clients li:hover { z-index: 2; transform: scale(1.06); }
  .clients li:hover .sel { opacity: 1; }
  .clients li:hover .sel i { transform: none; }
  .clients li:hover .anno { opacity: .85; }
}
@media (hover: none) {
  .clients li { cursor: pointer; -webkit-tap-highlight-color: transparent; }
}
@media (prefers-reduced-motion: no-preference) {
  .clients li { transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
  /* Einlauf: Kacheln kommen nacheinander von unten (--i aus site.js) */
  .clients.is-entering li { animation: tile-in .8s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i, 0) * 55ms + 120ms); }
  @keyframes tile-in { from { opacity: 0; transform: translateY(28px); } }
}

/* ---------- Startseite ---------- */
.home {
  container-type: inline-size;
  width: min(100%, var(--max));
  display: grid;
  gap: clamp(14px, 2.4vh, 32px);
}

.home-base {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px clamp(32px, 6vw, 96px);
  padding-top: clamp(16px, 2.6vh, 28px);
  border-top: 1px solid currentColor;
}
.home-meta { margin: 0; font-size: clamp(18px, 1.8vw, 28px); line-height: 1.25; }
.home-meta .who { display: block; font-weight: 300; }
.home-meta .since { display: block; font-weight: 300; }

.home-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px clamp(16px, 2vw, 32px);
  margin-top: clamp(12px, 2vh, 20px);
  font-size: clamp(15px, 1.2vw, 19px);
}
.home-contact .links { margin-top: 0; }

.home-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px clamp(24px, 3.4vw, 56px); }
.home-nav a {
  position: relative;
  padding: 2px 0;
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 28px);
  line-height: 1.25;
  text-decoration: none;
  transition: color .2s;
}
/* Nummer über jedem Link (= Taste 2–5) */
.home-nav a::before {
  content: attr(data-n);
  position: absolute;
  left: 0; bottom: 100%;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  opacity: .5;
  transition: opacity .3s;
}
.home-nav a:hover::before,
.home-nav a:focus-visible::before,
:root[data-code] .home-nav a::before { opacity: 0; }

/* ---------- Code-Inspektor (site.js): Rahmen mit Eckpunkten, Code-Schild, Maße ---------- */
.inspect { position: relative; }
.inspect:focus-visible { outline: none; }

.sel {
  position: absolute;
  inset: -4px -8px -5px;
  border: 1px solid currentColor;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
}
.sel i {
  position: absolute;
  width: 7px; height: 7px;
  background: var(--bg);
  border: 1px solid currentColor;
}
.sel i:nth-child(1) { left: -4px;  top: -4px; }
.sel i:nth-child(2) { right: -4px; top: -4px; }
.sel i:nth-child(3) { left: -4px;  bottom: -4px; }
.sel i:nth-child(4) { right: -4px; bottom: -4px; }

.sel .tag,
.sel .dim {
  position: absolute;
  font: 400 12px/1 var(--mono);
  letter-spacing: 0;
  white-space: nowrap;
}
.sel .tag {
  left: -1px;
  bottom: calc(100% + 7px);
  padding: 4px 7px;
  background: var(--fg);
  color: var(--bg);
}
.sel .tag::after {                       /* blinkender Cursor */
  content: "";
  display: inline-block;
  width: .55em; height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: currentColor;
  animation: caret 1s steps(1) infinite;
}
.sel .dim { right: -1px; bottom: calc(100% + 11px); font-size: 11px; opacity: .65; }
@keyframes caret { 50% { opacity: 0; } }

.inspect:hover .sel,
.inspect:focus-visible .sel,
.inspect.is-inspect .sel { opacity: 1; }
.inspect:focus-visible .sel { border-width: 3px; }   /* Tastaturfokus: kräftiger Rahmen (ersetzt den Standard-Fokusring) */

@media (prefers-reduced-motion: no-preference) {
  .sel { transform: scale(.96); transition: opacity .25s, transform .45s cubic-bezier(.16, 1, .3, 1); }
  .sel i { transform: scale(0); transition: transform .35s cubic-bezier(.34, 1.7, .64, 1); }
  .sel i:nth-child(2) { transition-delay: .04s; }
  .sel i:nth-child(3) { transition-delay: .08s; }
  .sel i:nth-child(4) { transition-delay: .12s; }
  .inspect:hover .sel, .inspect:focus-visible .sel, .inspect.is-inspect .sel,
  .inspect:hover .sel i, .inspect:focus-visible .sel i, .inspect.is-inspect .sel i { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sel .tag::after { animation: none; }
}

/* Text bleibt beim Darüberfahren kräftig, der Rahmen ist der Effekt */
main a.inspect:not(.arrow):hover, main a.inspect:not(.arrow):focus-visible,
.back.inspect:hover, .back.inspect:focus-visible { color: var(--fg); }

/* Rahmen je Element */
h1.inspect .sel { inset: -.02em -.1em -.06em -.02em; }   /* rechts mehr Luft wegen negativer Laufweite */
h1.inspect .sel i { width: 9px; height: 9px; }
h1.inspect .sel i:nth-child(odd) { left: -5px; }
h1.inspect .sel i:nth-child(even) { right: -5px; }
h1.inspect .sel i:nth-child(-n+2) { top: -5px; }
h1.inspect .sel i:nth-child(n+3) { bottom: -5px; }
.back.inspect .sel { inset: -2px -8px -3px; }
.arrow.inspect .sel,
.step.inspect .sel,
.copy.inspect .sel { inset: -5px; }
.foot-end .inspect .sel { inset: -4px -6px; }

/* Code-Schild rechtsbündig, wo links kein Platz ist */
.arrow.inspect .sel .tag,
.foot-end .inspect .sel .tag { left: auto; right: -1px; }

/* Maße unten statt oben bzw. ausgeblendet */
.arrow.inspect .sel .dim,
.step.inspect .sel .dim { bottom: auto; top: calc(100% + 7px); }
main a.inspect .sel .dim,
.copy.inspect .sel .dim,
.foot-end .inspect .sel .dim { display: none; }

/* ---------- Quelltext-Ansicht (Button </>, Taste X) ---------- */
.btn--code { font: 400 15px/1 var(--mono); letter-spacing: 0; }
.btn--code[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
:root[data-code] .inspect .sel,
:root[data-code] .clients li .sel { opacity: 1; }
:root[data-code] .inspect .sel i,
:root[data-code] .clients li .sel i { transform: none; }
:root[data-code] .clients li .anno { opacity: .85; }
:root[data-code] footer .inspect:not(:hover) .sel .tag,
:root[data-code] .inspect:not(:hover) .sel .dim { display: none; }
:root[data-code] h1.inspect .sel .dim { display: block; }
:root[data-code] .sel .tag::after { animation: none; opacity: 0; }

.coords {                                 /* Koordinaten neben der Maus */
  position: fixed;
  z-index: 60;
  display: none;
  padding: 3px 5px;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0;
  background: var(--fg);
  color: var(--bg);
  pointer-events: none;
}
:root[data-code] .coords.is-on { display: block; }

/* ---------- Kurzmeldung oben links (Seitenwechsel, Farbwechsel) ---------- */
.cmd {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: var(--pad);
  z-index: 50;
  padding: 4px 7px;
  font: 400 12px/1 var(--mono);
  letter-spacing: 0;
  background: var(--fg);
  color: var(--bg);
  opacity: 0;
  pointer-events: none;
}
.cmd.is-shown { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .cmd { transition: opacity .5s; }
}

/* ---------- Kleinteile ---------- */
.uptime {                                 /* Laufzeit seit 2001, Startseite */
  display: block;
  margin-top: 6px;
  font: 400 12px/1.3 var(--mono);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  opacity: .55;
}

.meta {                                   /* Ladezeile, unterer Abschluss */
  align-self: center;
  width: min(100% - 2 * var(--pad), var(--max));
  margin: 0 0 clamp(14px, 2.6vh, 28px);
  font: 400 11px/1 var(--mono);
  letter-spacing: 0;
  text-align: right;
  opacity: .5;
}
@media (max-width: 759px), (hover: none), (max-height: 500px) {
  .meta { display: none; }               /* Handy, Tablet, Querformat */
}

.term {                                   /* 404 als Terminal */
  margin: 0;
  font: 400 clamp(16px, 1.8vw, 26px)/1.5 var(--mono);
  letter-spacing: 0;
  white-space: pre-wrap;
}
.term a { text-decoration: underline dotted; text-underline-offset: 4px; }
.caret {
  display: inline-block;
  width: .55em; height: 1.1em;
  margin-left: 4px;
  vertical-align: -.2em;
  background: currentColor;
  animation: caret 1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

/* ---------- Fußleiste ---------- */
footer {
  flex: none;
  align-self: center;
  width: min(100% - 2 * var(--pad), var(--max));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px clamp(8px, 3vw, 24px);
  padding: clamp(16px, 2.4vh, 28px) 0 calc(clamp(8px, 2vh, 28px) + env(safe-area-inset-bottom, 0px));
}
.foot-start { justify-self: start; }
.foot-end { justify-self: end; display: flex; align-items: center; gap: 8px; }
.foot-nav { justify-self: center; display: flex; align-items: center; gap: 12px; }

.back {
  padding: 12px 0;
  font-weight: 300;
  font-size: clamp(20px, 3.2vw, 46px);
  line-height: 1;
  text-decoration: none;
}

.step {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.step:hover { background: var(--fg); color: var(--bg); }
.step[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.step--prev svg { transform: rotate(180deg); }
.pos { margin-left: 8px; font-size: 16px; font-weight: 300; }

.btn {
  min-width: 44px;
  min-height: 44px;
  padding: 11px 8px;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 300;
  transition: color .2s;
}
.btn:hover { color: var(--hover); }
.btn--theme { display: flex; align-items: center; justify-content: center; padding: 11px; }
.btn--theme > i { display: block; width: 22px; height: 22px; background: currentColor; }
.btn--menu {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0 12px 12px;
  font-weight: 300;
  font-size: clamp(16px, 4.2vw, 21px);
}
.burger { display: flex; flex-direction: column; gap: 7px; }
.burger i { display: block; width: clamp(22px, 6vw, 30px); height: 3px; background: currentColor; }

/* ---------- Menü ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .7s;
}
.menu.is-open {
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition-delay: 0s;
}
.menu-close { align-self: flex-end; padding: clamp(18px, 2.4vw, 32px) var(--pad); background: none; border: 0; cursor: pointer; font-size: 24px; font-weight: 300; }
.menu nav { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--pad) 40px; }
.menu li { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: clamp(16px, 2vw, 32px); }
.menu ul { margin: 0; padding: 0; list-style: none; }
/* Menü als Dateibaum */
.menu ul::before {
  content: "freifisch/";
  display: block;
  margin-bottom: 6px;
  font: 400 clamp(13px, 1.1vw, 16px)/1 var(--mono);
  letter-spacing: 0;
  opacity: .55;
}
.menu li {
  --size: clamp(32px, min(8vw, 10vh), 106px);
  position: relative;
  padding-left: clamp(30px, 3.4vw, 52px);
}
.menu li::before,
.menu li::after {
  content: "";
  position: absolute;
  left: 5px;
  opacity: .45;
}
.menu li::before { top: 0; bottom: 0; border-left: 1px solid currentColor; }            /* senkrechte Linie */
.menu li:last-child::before { bottom: auto; height: calc(var(--size) * .55); }          /* └ endet am letzten Eintrag */
.menu li::after { top: calc(var(--size) * .55); width: clamp(14px, 2vw, 32px); border-top: 1px solid currentColor; }   /* waagrechter Ast */
.menu li a {
  font-weight: 300;
  font-size: clamp(32px, min(8vw, 10vh), 106px);
  line-height: 1.05;
  letter-spacing: -.05em;
  text-decoration: none;
  text-underline-offset: 10px;
  text-decoration-thickness: 1px;
  text-decoration-style: dotted;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}
.menu li a:hover { text-decoration-line: underline; }
.menu li a[aria-current="page"] { text-decoration-line: underline; }
.menu li > span { font-size: clamp(14px, 1.3vw, 19px); }
.menu .keys { margin: 0; padding: 0 var(--pad) 28px; font-size: clamp(14px, 1.15vw, 18px); }

.nowrap { white-space: nowrap; }   /* z. B. Telefonnummer nie umbrechen */

.print-only { display: none; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 759px) {
  .grid--row .links a { white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 759px) and (min-height: 500px) {
  .home-base { grid-template-columns: 1fr; }
  .home-nav { justify-content: flex-start; flex-direction: column; gap: 10px; }
  .home-nav a::before { position: static; display: inline-block; margin: 0 10px 0 0; vertical-align: .6em; }
}

/* Tablet und Handy (bis 1023 px): Fußleiste in zwei Zeilen – oben freifisch + Blättern, unten Sprache / Textgröße / Quelltext / Design / Menü.
   In einer Zeile würden sich die Bedienknöpfe sonst mit der Blätterleiste überlappen. */
@media (max-width: 1023px) {
  /* Flache Fußleiste in zwei Zeilen: oben freifisch + Blättern, unten Sprache / Textgröße / Design / Menü */
  footer {
    grid-template-columns: 1fr auto;
    gap: 0 12px;
    margin-bottom: 5mm;
    padding-top: 8px;
    padding-bottom: 0;
  }
  .foot-start { grid-column: 1; grid-row: 1; }
  .foot-nav { grid-column: 2; grid-row: 1; order: 0; gap: 8px; }
  .foot-end { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: space-between; }
  .back { display: flex; align-items: center; min-height: 44px; padding: 0; font-size: 26px; }
  .step { width: 44px; height: 44px; }
  .pos {                                /* Seitenname nur noch für Screenreader */
    position: absolute;
    width: 1px; height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Druck ---------- */
@page { margin: 16mm; }
@media print {
  html, body, .page, main { height: auto !important; overflow: visible !important; background: #fff !important; color: #000 !important; }
  main { display: block; padding: 0; }
  footer, .menu, .skip, .arrow, .meta, .cmd, .coords, .sel, .anno { display: none !important; }
  h1 { font-size: 34pt; line-height: 1.05; margin: 0 0 10mm; }
  .home { display: block; }
  .home-base, .rule { border-color: #000; }
  .body { zoom: 1; font-size: 11pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .print-only { display: block; margin-top: 12mm; font-size: 9pt; }
}
