/* Tragwerkstatt — additions on top of the ported draft CSS.
   Everything the Jaeger port needs that the static draft didn't have:
   sprite icons, attribution mark, edit-mode niceties. Keep the ported
   files (site/v3/header-b/…) close to the draft; put changes here. */

/* Registered so the logo colours fade with the header (see Logo below). */
@property --logo-eagle { syntax: '<color>'; inherits: true; initial-value: #a9aaac; }
@property --logo-ink { syntax: '<color>'; inherits: true; initial-value: #465056; }

@layer components {

  /* ---------- Startseite: page scrollbar hidden, scrolling still works ---------- */
  html:has(body.home) { scrollbar-width: none; }
  html:has(body.home)::-webkit-scrollbar { display: none; }

  /* ---------- Sprite icons in the draft's arrow slots ---------- */
  .link .icon, .btn .icon, .nav-cta .icon { --icon-size: 1.1em; vertical-align: -0.18em; }
  .ctrl .icon, .eh-nav .icon { --icon-size: 1.15em; }
  .v-switch .vs-toggle .icon { --icon-size: 20px; color: var(--blue); }
  .v-switch.is-collapsed .vs-toggle .icon { color: #fff; }
  .v-switch .vs-x .icon { --icon-size: 14px; }

  /* ---------- Switcher panel: rows grouped under a heading per page section
     (templates/partials/variant-switch.php); label left, options right. ---------- */
  .v-switch:not(.is-collapsed) { width: min(540px, calc(100vw - 32px)); }
  .v-switch.is-collapsed .vs-body { display: none; }
  @media (max-width: 760px) { .v-switch { display: none; } }   /* no switcher on phones (client wish 22.10.) */
  .vs-body { max-height: min(72vh, 620px); overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 6px; }
  .vs-sec + .vs-sec { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
  .v-switch .vs-h { margin: 2px 6px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
  .v-switch .row { align-items: flex-start; gap: 8px; padding: 2px 0; }
  .v-switch .row > span { flex: none; width: 150px; min-width: 0; padding: 7px 6px 0; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
  .v-switch .vs-opts { display: flex; flex-wrap: wrap; gap: 2px; }
  .v-switch .vs-opts button { padding: 6px 10px; font-size: 13px; }
  @media (max-width: 560px) {
    .v-switch:not(.is-collapsed) { width: auto; }
    .v-switch .row { flex-direction: column; gap: 2px; }
    .v-switch .row > span { display: block; width: auto; padding: 4px 6px 0; font-size: 12px; color: var(--muted); }
  }

  /* ---------- Skip link (template's), in the draft's look ---------- */
  .skip-link { background: var(--blue); color: #fff; border: 0; padding: 8px 12px; }

  /* ---------- Agency attribution in the dark footer ---------- */
  .site-footer .bottom { align-items: center; }
  .site-footer .attribution { color: #8c9197; font-size: 13px; }
  .site-footer .attribution__link { color: #d8dbde; }
  .site-footer .attribution__link:hover { color: #fff; text-decoration: none; }
  .site-footer .attribution__logo { filter: brightness(0) invert(1); opacity: .85; }
  .site-footer .attribution__preview { border-color: rgba(255,255,255,.18); }
  /* The hover preview card is pointless on touch and overflows narrow screens
     (the browser then zooms the whole page out). */
  @media (hover: none), (max-width: 760px) { .attribution__preview { display: none; } }

  /* ---------- Home: bottom row only, no rule above it ---------- */
  .site-footer--compact .bottom { border-top: 0; }

  /* Home footer on phones: centred and ordered — legal links first (with
     hairline dividers), then © + agency credit, on the hero's own ground so
     the page runs on seamlessly from the image. Desktop stays one row. */
  @media (max-width: 760px) {
    .site-footer--compact { background: #0b0d0f; }
    .site-footer--compact::before { height: 1px; background: rgb(255 255 255 / .1); }
    .site-footer--compact .bottom { display: grid; justify-content: center; justify-items: center; gap: 12px; padding-block: 26px calc(26px + env(safe-area-inset-bottom)); text-align: center; }
    .site-footer--compact .bottom nav { order: -1; display: flex; gap: 0; margin-bottom: 6px; }
    .site-footer--compact .bottom nav a { padding: 6px 16px; font-size: 14px; font-weight: 600; color: #d8dbde; }
    .site-footer--compact .bottom nav a + a { border-left: 1px solid rgb(255 255 255 / .16); }
    .site-footer--compact .bottom > span { font-size: 12.5px; }
    .site-footer--compact .attribution { font-size: 12px; opacity: .85; }
  }

  /* Variant hfoot b „Kompakt“: same separate dark block with the blue rule
     on top, but two slim rows — legal links + agency logo, then ©. */
  @media (max-width: 760px) {
    .hfoot-b .site-footer--compact { background: var(--dark); }
    .hfoot-b .site-footer--compact::before { height: 2px; background: var(--blue); }
    .hfoot-b .site-footer--compact .bottom {
      grid-template-columns: 1fr auto; justify-content: stretch; justify-items: start; align-items: center;
      gap: 8px 16px; padding-block: 14px calc(14px + env(safe-area-inset-bottom)); text-align: left;
    }
    .hfoot-b .site-footer--compact .bottom nav { grid-area: 1 / 1; margin: 0; }
    .hfoot-b .site-footer--compact .bottom nav a { padding: 2px 12px; font-size: 13px; }
    .hfoot-b .site-footer--compact .bottom nav a:first-child { padding-left: 0; }
    .hfoot-b .site-footer--compact .attribution { grid-area: 1 / 2; opacity: 1; }
    .hfoot-b .site-footer--compact .attribution__prefix { display: none; }   /* logo only; the link keeps its name as alt text */
    .hfoot-b .site-footer--compact .bottom > span { grid-area: 2 / 1 / 3 / -1; font-size: 11.5px; }
  }

  /* ---------- Header bar: wordmark left, everything else right ---------- */
  .mainbar { justify-content: flex-start; }
  .mainbar > a:first-child { margin-right: auto; }

  /* Theme change: no transition storm across the page. */
  .theme-switching, .theme-switching * { transition: none !important; }

  /* ---------- Studio: „die tragwerkstatt“ (templates/partials/studio-about.php,
     switcher group `studio`: b „Werkstatt“, c „Nebeneinander“, d „Rahmen“) ---------- */
  .about { padding-block: clamp(40px, 5vw, 72px) clamp(56px, 7vw, 112px); }
  .ab-title { font-size: clamp(48px, 7.2vw, 124px); font-weight: 300; line-height: .95; letter-spacing: -.035em; }
  .ab-title b, .ab-lead b, .ab-cols b { font-weight: inherit; font-style: italic; }
  .ab-fig { margin: 0; overflow: hidden; background: #14110d; }
  .ab-fig img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .ab-text { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); margin-top: clamp(40px, 5vw, 80px); }
  .ab-label { grid-column: 1 / span 3; align-self: start; position: sticky; top: calc(var(--header-h) + 28px); padding-top: .55em; }
  .ab-body { grid-column: 4 / -1; }
  .ab-lead { margin: 0; max-width: 30em; font-size: clamp(22px, 2.1vw, 34px); font-weight: 300; line-height: 1.38; letter-spacing: -.012em; color: var(--ink); }
  .ab-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 56px); margin-top: clamp(32px, 3.5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
  .ab-cols p { margin: 0; font-size: clamp(16px, 1.15vw, 18px); line-height: 1.68; color: var(--ink-2); }
  .ab-cols p:only-child { grid-column: 1 / -1; max-width: 40em; }

  /* C „Nebeneinander“ + D „Rahmen“: picture left, text right — one column
     of text (label, heading, lead, paragraphs stacked). */
  .ab-split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
  .ab-split .ab-fig { grid-column: 1 / span 6; grid-row: 1; aspect-ratio: 1 / 1; }
  .ab-split .ab-fig img { object-position: 45% 48%; }
  .ab-side { grid-column: 8 / -1; grid-row: 1; }
  .ab-side .ab-label { position: static; display: block; padding-top: 0; margin-bottom: 18px; }
  .ab-side .ab-title { font-size: clamp(40px, 4.6vw, 76px); margin-bottom: clamp(24px, 2.6vw, 40px); }
  .ab-side .ab-lead { font-size: clamp(19px, 1.5vw, 24px); }
  .ab-side .ab-cols { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; padding-top: 20px; }

  /* D „Rahmen“: like C, the picture with a blue frame set off behind it —
     the frame slides out from under the picture when it comes into view. */
  .about--d { padding-bottom: calc(clamp(56px, 7vw, 112px) + var(--ab-off)); --ab-off: clamp(16px, 2vw, 32px); }
  .ab-frame { position: relative; grid-column: 1 / span 6; grid-row: 1; }
  .ab-frame::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--blue); transition: transform 1.1s var(--ease) .25s; }
  .ab-frame:has(.is-in)::before { transform: translate(var(--ab-off), var(--ab-off)); }
  .ab-frame .ab-fig { position: relative; aspect-ratio: 5 / 4; }
  .about--d .ab-side { grid-column: 8 / -1; }
  .about--d .ab-label { display: flex; align-items: center; gap: 12px; }
  .about--d .ab-label::before { content: ""; width: 40px; height: 2px; background: var(--blue); }
  @media (prefers-reduced-motion: reduce) { .ab-frame::before { transition: none; transform: translate(var(--ab-off), var(--ab-off)); } }

  /* ---------- Design „Grau“ 190/195/198 (switcher row „Design“, <html class="theme-grau">,
     always data-theme="light" — see App\Support\Theme). Text, lines, the blue and the
     logo's eagle are darkened so they keep their contrast on the grey (≥ 4.4:1);
     surfaces (cards, placeholders) sit a touch lighter than the ground. Both the
     semantic tokens and the brand aliases are set: the aliases are resolved on
     :root, so overriding only the semantic ones on body wouldn't reach them. */
  :root.theme-grau body {
    --color-bg: #bec3c6; --color-bg-subtle: #c9cdd0; --color-bg-muted: #b2b7bb; --color-bg-inset: #c9cdd0;
    --color-text-muted: #3a3e42; --color-text-subtle: #4b5055; --color-border: #9aa0a5;
    --color-accent: #125687; --color-accent-hover: #0e4168; --color-focus-ring: #125687;
    --bg: #bec3c6; --bg-2: #c9cdd0; --ink-2: #3a3e42; --muted: #4b5055; --line: #9aa0a5;
    --blue: #125687; --blue-dark: #0e4168; --blue-tint: #d2dde5; --tag-fg: #0e4168;
    --glass: rgb(190 195 198 / .96); --brand-eagle: #878c90;
  }

  /* Dark areas (footer, hero) keep the original blue — the darkened one is for the grey ground. */
  .theme-grau :is(.site-footer, .xhero) { --blue: #1e83ca; --blue-dark: #166aa6; }

  /* ---------- Design „Anthrazit“ (switcher row „Design“, <html class="theme-anthrazit">,
     always data-theme="dark"): the dark design on a lighter black. Grounds,
     surfaces, lines and the footer/topbar black step up; text stays as in dark. ---------- */
  :root.theme-anthrazit body {
    --color-bg: #2a2d30; --color-bg-subtle: #33373a; --color-bg-muted: #3d4145; --color-bg-inset: #33373a;
    --color-border: #474c51; --color-text-subtle: #9aa0a6; --muted: #9aa0a6;
    --bg: #2a2d30; --bg-2: #33373a; --line: #474c51; --dark: #1f2225;
    --blue-tint: #1d3447; --glass: rgb(42 45 48 / .94);
  }

  /* ---------- Home hero: picture transition (switcher group `xfx`, body.xfx-*).
     a = the draft's wipe with the blue line (v3.css). home.js only swaps
     .is-active / .is-under — each look restyles those states. ---------- */
  :is(.xfx-b, .xfx-c, .xfx-d) .xwipe { display: none; }

  /* b „Überblenden“: slow crossfade; the picture keeps drifting in. */
  .xfx-b .xs { clip-path: none; opacity: 0; }
  .xfx-b .xs.is-under { opacity: 1; }
  .xfx-b .xs.is-active { opacity: 1; clip-path: none; transition: opacity 1.8s cubic-bezier(.4, 0, .2, 1); }

  /* c „Diagonal“: the new picture sweeps in behind a slanted edge (left → right). */
  .xfx-c .xs { clip-path: polygon(-50% 0, 0 0, -25% 100%, -50% 100%); }
  .xfx-c .xs.is-under { clip-path: polygon(-50% 0, 125% 0, 100% 100%, -50% 100%); }
  .xfx-c .xs.is-active { clip-path: polygon(-50% 0, 125% 0, 100% 100%, -50% 100%); transition: clip-path 1.6s cubic-bezier(.77, 0, .18, 1); }

  /* d „Schieben“: the new picture rises from below, the old one slides up and dims. */
  .xfx-d .xs { clip-path: inset(100% 0 0 0); }
  .xfx-d .xs.is-active { clip-path: inset(0); transition: clip-path 1.4s cubic-bezier(.77, 0, .18, 1); }
  .xfx-d .xs.is-under { clip-path: inset(0); transform: translateY(-14%); filter: brightness(.55); transition: transform 1.4s cubic-bezier(.77, 0, .18, 1), filter 1.4s ease; }
  @media (prefers-reduced-motion: reduce) { .xfx-d .xs.is-under { transition: none; transform: none; filter: none; } }

  /* e „Fokus“: crossfade like b with a focus pull — the new picture comes in
     soft and sharpens, the old one blurs away underneath. */
  .xfx-e .xwipe { display: none; }
  .xfx-e .xs { clip-path: none; opacity: 0; filter: blur(16px); }
  .xfx-e .xs.is-under { opacity: 1; filter: blur(12px); transition: filter 1.6s ease; }
  .xfx-e .xs.is-active { opacity: 1; filter: blur(0); clip-path: none; transition: opacity 1.6s cubic-bezier(.4, 0, .2, 1), filter 1.6s cubic-bezier(.4, 0, .2, 1); }
  @media (prefers-reduced-motion: reduce) { .xfx-e .xs, .xfx-e .xs.is-under { filter: none; transition: none; } }

  /* ---------- Project detail: picture carousel (templates/pages/project.php,
     public/assets/js/carousel.js). One row at a fixed height, each picture in
     its own proportions; starts flush with the content, runs out to the right
     screen edge (like the home slider). ---------- */
  .pd-gal { --edge: max(var(--container-gutter), (100vw - var(--container-default)) / 2); padding-bottom: clamp(48px, 6vw, 96px); overflow: clip; }
  .pd-gal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .pd-gal-ctrl { display: flex; align-items: center; gap: 8px; }
  .pd-gal-ctrl .count { margin-right: 12px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .pd-gal-ctrl .count b { color: var(--ink); font-weight: 600; }
  .pd-gal-ctrl button { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--ink); color: var(--ink); transition: background .2s, border-color .2s, color .2s, opacity .2s; }
  .pd-gal-ctrl button:hover:not(:disabled) { background: var(--blue); border-color: var(--blue); color: #fff; }
  .pd-gal-ctrl button:disabled { opacity: .3; cursor: default; }
  .pd-gal-track {
    display: flex; gap: var(--gap); overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge); padding-inline: var(--edge);
    scrollbar-width: none; cursor: grab; outline-offset: -2px;
  }
  .pd-gal-track::-webkit-scrollbar { display: none; }
  .pd-gal-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
  .pd-gal-track.is-dragging figure { pointer-events: none; }
  .pd-gal-track figure { flex: none; margin: 0; height: clamp(260px, 38vw, 580px); max-width: calc(100vw - 2 * var(--edge)); overflow: hidden; background: var(--bg-2); scroll-snap-align: start; cursor: zoom-in; }
  .pd-gal-track.is-dragging, .pd-gal-track.is-dragging figure { cursor: grabbing; }
  .pd-gal-track img { display: block; height: 100%; width: auto; max-width: none; object-fit: cover; transition: transform .8s var(--ease); user-select: none; }
  .pd-gal-track figure:hover img { transform: scale(1.025); }
  .pd-gal-bar { height: 2px; margin-top: 18px; background: var(--line); overflow: hidden; }
  .pd-gal-bar i { display: block; height: 100%; background: var(--blue); transform: scaleX(.04); transform-origin: left; transition: transform .2s linear; }
  @media (max-width: 760px) {
    .pd-gal-track figure { height: 62vw; max-width: 86vw; }
    .pd-gal-ctrl button { width: 42px; height: 42px; }
  }
  /* „Kompakt“ (switcher group `pgal`): lower pictures, several in view at once. */
  .pgal-b .pd-gal-track { gap: clamp(10px, 1vw, 16px); }
  .pgal-b .pd-gal-track figure { height: clamp(200px, 23vw, 340px); }
  @media (max-width: 760px) { .pgal-b .pd-gal-track figure { height: 46vw; max-width: 70vw; } }

  /* ---------- Topbar (phone · e-mail above the nav) in the header's own colour
     instead of the dark band; over the home hero it stays transparent/white
     (header-b.css, more specific). ---------- */
  .topbar { background: transparent; color: var(--ink-2); }
  .topbar a:hover { color: var(--blue); }

  /* ---------- Studio: memberships (switcher group `mitgl`) — a in Rudolf's CV
     next to „Lehre“, b as a third column beside „Publikationen & Vorträge“. ---------- */
  .mitgl-a .mg-b, .mitgl-b .mg-a { display: none; }
  .rows--plain li { grid-template-columns: 1fr; }
  @media (min-width: 1101px) { .mitgl-b .two-cols { grid-template-columns: 1fr 1fr minmax(0, .75fr); } }
  @media (min-width: 901px) and (max-width: 1100px) { .mitgl-b .two-cols .mg-b { grid-column: 1 / -1; } }


  /* B „Werkstatt“: the dark workshop picture full-bleed with the heading on it;
     text continues on the picture's warm black, drifting slightly on scroll. */
  .about--b { --ab-dark: #100e0b; --ab-fade: clamp(220px, 26vw, 420px); padding-top: 0; color: #efe9df;
    /* The warm black runs out softly into the page ground (any design) instead of a
       hard edge: an eased (S-curve) gradient mixed in OKLab — a plain linear one
       shows a flat grey band in the middle. */
    padding-bottom: calc(clamp(40px, 4vw, 64px) + var(--ab-fade));
    background: linear-gradient(180deg, var(--ab-dark) 0, var(--ab-dark) calc(100% - var(--ab-fade)),
      color-mix(in oklab, var(--ab-dark) 97%, var(--bg)) calc(100% - var(--ab-fade) * .9),
      color-mix(in oklab, var(--ab-dark) 90%, var(--bg)) calc(100% - var(--ab-fade) * .8),
      color-mix(in oklab, var(--ab-dark) 79%, var(--bg)) calc(100% - var(--ab-fade) * .7),
      color-mix(in oklab, var(--ab-dark) 65%, var(--bg)) calc(100% - var(--ab-fade) * .6),
      color-mix(in oklab, var(--ab-dark) 50%, var(--bg)) calc(100% - var(--ab-fade) * .5),
      color-mix(in oklab, var(--ab-dark) 35%, var(--bg)) calc(100% - var(--ab-fade) * .4),
      color-mix(in oklab, var(--ab-dark) 21%, var(--bg)) calc(100% - var(--ab-fade) * .3),
      color-mix(in oklab, var(--ab-dark) 10%, var(--bg)) calc(100% - var(--ab-fade) * .2),
      color-mix(in oklab, var(--ab-dark) 3%, var(--bg)) calc(100% - var(--ab-fade) * .1),
      var(--bg) 100%); }
  /* Dark designs: black into near-black needs only a short fade. */
  :root[data-theme="dark"] .about--b { --ab-fade: 120px; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme]) .about--b { --ab-fade: 120px; } }
  .about--b .ab-stage { position: relative; height: min(86vh, 940px); min-height: 520px; overflow: hidden; }
  .about--b .ab-fig { position: absolute; inset: 0; }
  .about--b .ab-fig img { object-position: 45% 50%; }
  .about--b .ab-fig::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(16 14 11 / .2) 0%, rgb(16 14 11 / 0) 35%, rgb(16 14 11 / .75) 82%, var(--ab-dark) 100%); }
  .about--b .ab-over { position: absolute; left: 0; right: 0; bottom: clamp(28px, 4vw, 64px); z-index: 2; }
  .about--b .ab-title { color: #fff; }
  .about--b .ab-text { margin-top: clamp(24px, 3vw, 48px); }
  .about--b .ab-label { color: var(--blue-light); }
  .about--b .ab-lead { color: #f4efe7; }
  .about--b .ab-cols { border-top-color: rgb(255 255 255 / .14); }
  .about--b .ab-cols p { color: rgb(239 233 223 / .68); }

  /* E „Werkstatt hell“: exactly like B down to the heading — then, right under
     „die tragwerkstatt“, the warm black runs out into the page ground (eased,
     OKLab) and the text sits on the normal page ground in the normal colours. */
  .about--e { --ab-dark: #100e0b; --ab-fade: clamp(160px, 18vw, 300px); padding-top: 0; }
  .about--e .ab-stage { position: relative; height: min(86vh, 940px); min-height: 520px; }
  .about--e .ab-fig { position: absolute; inset: 0; }
  .about--e .ab-fig img { object-position: 45% 50%; }
  .about--e .ab-fig::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(16 14 11 / .2) 0%, rgb(16 14 11 / 0) 35%, rgb(16 14 11 / .75) 82%, var(--ab-dark) 100%); }
  .about--e .ab-stage::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: var(--ab-fade); pointer-events: none;
    background: linear-gradient(180deg, var(--ab-dark) 0,
      color-mix(in oklab, var(--ab-dark) 97%, var(--bg)) 10%,
      color-mix(in oklab, var(--ab-dark) 90%, var(--bg)) 20%,
      color-mix(in oklab, var(--ab-dark) 79%, var(--bg)) 30%,
      color-mix(in oklab, var(--ab-dark) 65%, var(--bg)) 40%,
      color-mix(in oklab, var(--ab-dark) 50%, var(--bg)) 50%,
      color-mix(in oklab, var(--ab-dark) 35%, var(--bg)) 60%,
      color-mix(in oklab, var(--ab-dark) 21%, var(--bg)) 70%,
      color-mix(in oklab, var(--ab-dark) 10%, var(--bg)) 80%,
      color-mix(in oklab, var(--ab-dark) 3%, var(--bg)) 90%,
      var(--bg) 100%); }
  .about--e .ab-over { position: absolute; left: 0; right: 0; bottom: clamp(28px, 4vw, 64px); z-index: 2; }
  .about--e .ab-title { color: #fff; }
  .about--e > .container { position: relative; z-index: 1; }
  .about--e .ab-text { margin-top: calc(var(--ab-fade) * .85); }
  :root[data-theme="dark"] .about--e { --ab-fade: 120px; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme]) .about--e { --ab-fade: 120px; } }
  @media (max-width: 900px) { .about--e .ab-stage { height: 72svh; min-height: 420px; } }
  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .about--b .ab-fig img { animation: ab-drift linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    }
  }
  @keyframes ab-drift { to { transform: scale(1.08) translateY(6%); } }

  @media (max-width: 900px) {
    .ab-label, .ab-body { grid-column: 1 / -1; }
    .ab-label { position: static; padding-top: 0; }
    .ab-cols { grid-template-columns: 1fr; gap: 18px; }
    .about--b .ab-stage { height: 72svh; min-height: 420px; }
    .ab-split .ab-fig, .ab-frame, .ab-frame .ab-fig { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
    .ab-frame { margin-right: var(--ab-off); }
    .ab-side, .about--d .ab-side { grid-column: 1 / -1; grid-row: 2; }
    .about--c .ab-side { margin-top: 28px; }
    .about--d .ab-side { margin-top: calc(28px + var(--ab-off)); }
    .about--d { padding-bottom: clamp(56px, 7vw, 112px); }
  }

  /* ---------- Hero headline on phones: bigger than the desktop clamp's 44px
     floor; 15.5vw still fits the longest word („Netztragwerke.“) on one line. ---------- */
  @media (max-width: 760px) { .xtitle .xslogan { font-size: clamp(50px, 15.5vw, 62px); } }

  /* ---------- Hero slogan in two lines („Wir verbinden / Architektur & Engineering.“):
     line 1 light, line 2 bold italic. Longest line 2 ≈ 26 characters, so the
     headline takes the full width and a smaller size; on phones line 2 wraps. ---------- */
  .xtitle:has(.xverb) { grid-column: 1 / -1; }
  .xtitle:has(.xverb) .xslogan { font-size: clamp(40px, 6.2vw, 104px); }
  .xverb span { font-weight: 300; font-style: normal; }
  .xverb span::after { content: none; }
  .xword span { align-self: end; }
  .xword span.still { transition: none; }
  @media (max-width: 760px) {
    .xtitle:has(.xverb) .xslogan { font-size: clamp(36px, 10.5vw, 48px); }
    .xtitle:has(.xverb) .xword:not(.xverb) span { white-space: normal; }
  }

  /* ---------- Hero A: "Nächstes Projekt" strip (variant group `next`) ---------- */
  .xnext { grid-column: 1 / -1; position: relative; margin-top: clamp(20px, 3.5vh, 40px); border-top: 1px solid rgba(255,255,255,.28); }
  .xnext-bar { position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--blue); transform: scaleX(0); transform-origin: left; animation: bar var(--dur, 7s) linear forwards; }
  .xnext-btn { display: flex; align-items: baseline; gap: 14px; width: 100%; padding-top: 14px; text-align: left; color: #fff; font-size: 15px; }
  .xnext-btn .lbl { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }
  .xnext-btn .t { font-weight: 600; transition: color .25s; }
  .xnext-btn .m { color: rgba(255,255,255,.65); font-size: 14px; }
  .xnext-btn .ar { margin-left: auto; align-self: center; display: inline-flex; transition: transform .25s; }
  .xnext-btn:hover .t { color: #7cc0ef; }
  .xnext-btn:hover .ar { transform: translateX(4px); }
  body:not(.xnext-off) .xscroll { display: none; }
  /* Off keeps its space so the headline stays put. */
  .xnext-off .xnext { visibility: hidden; }
  @media (max-width: 560px) { .xnext-btn .m { display: none; } }

  /* ---------- Korrekturen 16.10. (variant group `k1610`, body.kor-1610 = „Nachher“) ----------
     Page 1 of the client PDF: wider content block, hero eyebrow „architecture &
     engineering of structures“, smaller headline, „Nächstes Projekt“ strip gone. */
  /* Wider block: only header + hero on the home page (the PDF's arrows);
     the rest of the content keeps its width. Inherited by their .container. */
  .kor-1610.home .site-header, .kor-1610 .xhero, .kor-1610.home .site-footer { --container-default: calc(1840px - 2 * var(--container-gutter)); }
  .kor-1610 .xtitle:has(.xverb) .xslogan { font-size: clamp(36px, 5vw, 84px); }
  .kor-1610 .xnext { display: none; }
  /* Eyebrow in lowercase as typed (client wish 22.10.) — tighter tracking than the caps. */
  .xtitle .eyebrow { text-transform: none; letter-spacing: .04em; font-size: 16px; }
  /* Page 2: no Projekte dropdown (the link stays; JS skips opening it). */
  .kor-1610 #mega-projekte { display: none; }
  .kor-1610 .site-nav a[data-mega="projekte"]::after { content: none; }
  /* The remaining dropdown (Leistungen) keeps its old width. */
  .kor-1610 .mega .container, .navw-wide .mega .container { max-width: calc(1440px - 2 * var(--container-gutter)); }
  /* Subpages as wide as the home header — header and content (switcher group `navw`). */
  .navw-wide .site-header,
  .navw-wide:not(.home) { --container-default: calc(1840px - 2 * var(--container-gutter)); --container-wide: calc(1840px - 2 * var(--container-gutter)); }
  .kor-1610 .xhero-in { padding-bottom: clamp(64px, 11vh, 110px); }  /* room the strip used to take; clears the scroll cue */
  @media (min-width: 901px) { .kor-1610 .xscroll { display: block; } }
  @media (max-width: 760px) {
    .kor-1610 .xtitle:has(.xverb) .xslogan { font-size: clamp(36px, 11vw, 50px); }
    /* The small line stays small next to the headline and on one line. */
    .kor-1610 .xtitle .eyebrow { font-size: 12.5px; letter-spacing: .04em; gap: 10px; margin-bottom: 12px; }
    .kor-1610 .xtitle .eyebrow::before { width: 24px; }
    /* Headline closer to the bottom edge (client wish 22.10.; no scroll cue / switcher on phones). */
    .kor-1610 .xhero-in { padding-bottom: 28px; }
    /* Line 2 reserves room for the longest slogan (two lines on phones); a
       one-line slogan sits right under line 1, the spare room stays below. */
    .kor-1610 .xtitle:has(.xverb) .xword:not(.xverb) span { align-self: start; }
    /* …so the waiting slogans have to start below the full two-line box. */
    .kor-1610 .xtitle:has(.xverb) .xword:not(.xverb) span:not(.in):not(.out) { transform: translateY(2.2em); }
  }
  @media (prefers-reduced-motion: reduce) { .xnext-bar { display: none; } }
}

@layer components {
  /* ---------- Projekte filter: links (work without JS), styled like the draft's buttons ---------- */
  .filters a { font-size: 14px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--line); color: var(--ink-2); transition: all .2s; }
  .filters a:hover { border-color: var(--blue); color: var(--blue); }
  .filters a[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
  #portfolio [hidden] { display: none !important; }
  .pf-grid .cards { view-transition-name: pf-cards; }
}

@layer components {
  /* ---------- Click-to-load map (Kontakt) ---------- */
  .map[data-embed] { display: grid; place-items: center; position: relative; }
  .map-consent { max-width: 44ch; text-align: center; padding: 24px; }
  .map-consent p { color: var(--ink-2); font-size: 15px; }
  .map-consent a { color: var(--blue); text-decoration: underline; }
  .map[data-embed] iframe { position: absolute; inset: 0; }
  .contact .link .icon { --icon-size: 1em; }
}

@layer components {
  /* Home: the draft placed the switcher between the studio variants and the
     slider (`.variants + .v-switch + .sel3`); here it sits after the footer. */
  .variants + .sel3 { padding-top: clamp(40px, 5vw, 80px); }
  .founder .role span { display: block; }
}

@layer components {
  /* ---------- Legal pages (Impressum, Datenschutz) ---------- */
  .legal h2:first-child { margin-top: 0; }
  .legal a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
  .legal code { font-size: .9em; background: var(--bg-2); padding: 1px 5px; }
  .legal-dl { margin: 20px 0 0; font-size: 15px; border-top: 2px solid var(--blue); }
  .legal-dl div { display: grid; grid-template-columns: minmax(0, 14em) 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .legal-dl dt { color: var(--muted); }
  .legal-dl dd { margin: 0; }
  @media (max-width: 600px) { .legal-dl div { grid-template-columns: 1fr; gap: 2px; } }
  .legal-credit { margin-top: 32px; }
}

@layer components {
  /* Dropdown images: not rendered (→ lazy images not fetched) until a menu opens. */
  .site-header:not(.mega-open) .mega img { display: none; }
}

@layer components {
  /* Draft bug (hidden by its demo cut): on phones the typology table kept
     display:table and grew to its content width. */
  @media (max-width: 760px) {
    .typo, .typo tbody { display: block; width: 100%; }
    .typo td a { white-space: normal; display: inline-block; }
  }
}


@layer components {
  /* ---------- Leistungen: crossfading picture slider in a service block ---------- */
  .svc-slides { position: relative; }
  .svc-slides .ss { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.1s ease; }
  .svc-slides .ss.is-active { opacity: 1; z-index: 1; }
  .svc-slides .ss img { width: 100%; height: 100%; object-fit: cover; }
  .svc-slides figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 30px; color: #fff; font-weight: 600; font-size: 15px;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.6)); }
  .ss-bars { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 14px; display: flex; gap: 6px; }
  .ss-bars button { flex: 1; height: 14px; padding: 6px 0; background: none; cursor: pointer; }
  .ss-bars i { display: block; height: 2px; background: rgba(255,255,255,.35); position: relative; overflow: hidden; }
  .ss-bars i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
  .ss-bars .is-active i::after { animation: bar var(--dur, 5s) linear forwards; }
  @media (prefers-reduced-motion: reduce) { .svc-slides .ss { transition: none; } .ss-bars .is-active i::after { animation: none; transform: none; } }

}

@layer components {
  /* ---------- Studio: publications cut where the awards end + „Mehr anzeigen“ ---------- */
  .pub-clip { position: relative; overflow: hidden; transition: max-height .6s var(--ease); }
  .pub-clip.is-clipped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--bg)); }
  .pub-more { margin-top: 18px; cursor: pointer; background: none; padding: 0; font-size: 15px; }
  .pub-more .icon { transition: transform .3s var(--ease); }
  .pub-more[aria-expanded="true"] .icon { transform: rotate(180deg); }
  @media (prefers-reduced-motion: reduce) { .pub-clip { transition: none; } }

  /* ---------- Logo (eagle + wordmark, public/assets/img/logo.svg via Logo::tag()).
     Two colours inherit into the <use>: --logo-eagle, --logo-ink. Brand grey on
     light grounds; the white version over the hero, in the footer and in the
     dark full-screen menu. ---------- */
  .brand { display: block; line-height: 0; }
  /* Test: original and redrawn logo side by side (switcher Logo → „Vergleich“). */
  .logo-compare { display: flex; gap: clamp(16px, 2.5vw, 40px); align-items: flex-start; }
  .logo-compare > span { display: block; position: relative; }
  .logo-compare small { position: absolute; left: 0; top: 100%; margin-top: 1px; font-size: 9px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); white-space: nowrap; }
  @media (max-width: 760px) { .logo-compare .logo { --logo-h: 36px; } .logo-compare { gap: 10px; } }
  .logo {
    display: block; height: var(--logo-h, 74px); width: auto; aspect-ratio: 424 / 134;
    --logo-eagle: var(--brand-eagle); --logo-ink: var(--brand-ink);
    transition: --logo-eagle .35s, --logo-ink .35s;
  }
  .home .site-header:not(.is-solid):not(.menu-open):not(.mega-open) .logo,
  .mnav-a .site-header.menu-open .logo,
  .site-footer .logo { --logo-ink: #fff; --logo-eagle: rgb(255 255 255 / .5); }
  /* The eagle's outlines are hairlines in the artwork (~0.3 px at header
     size) and smear into a grey haze. --logo-eagle-stroke (viewBox units)
     thickens them to roughly half a pixel; bigger value = smaller logo. */
  .logo { --logo-eagle-stroke: 1; --logo-line: 1px; }   /* --logo-line: the redrawn logo-neu.svg (screen px) */
  .site-footer .logo { --logo-h: 72px; --logo-eagle-stroke: 1; --logo-line: 1.15px; }
  .mnav-head .logo { --logo-h: 44px; --logo-eagle-stroke: 1.5; }
  @media (max-width: 760px) { .site-header .logo { --logo-h: 50px; --logo-eagle-stroke: 1.3; } }
}

/* Topbar stays while scrolling (header-b.css) — the sticky Studio label sits below it on desktop
   (the topbar is hidden ≤ 760px). */
@layer components {
  @media (min-width: 761px) {
    .ab-label { top: calc(var(--header-h) + 28px + var(--topbar-h)); }
  }
}
@layer components {
  @media (min-width: 761px) { html { scroll-padding-top: calc(var(--header-h) + var(--topbar-h) + 3px); } }
}

/* Studio „Philosophie“: text under the rule in ONE column, as wide as the lead
   above it (lead: max-width 30em at its own font size) — client wish 22.10. */
@layer components {
  .ab-text .ab-cols { grid-template-columns: 1fr; gap: 1.1em; max-width: calc(30 * clamp(22px, 2.1vw, 34px)); }
  .ab-text .ab-cols p:only-child { max-width: none; }
}

/* ---------- Large screens (32" / 4K, client wish 22.10.) ----------
   Above ~2000 px the layout stopped growing: same type and picture sizes as on
   a laptop, huge empty margins. Instead, the whole page scales up in steps so it
   looks like the 1920 px design, just bigger (--z ≈ viewport / 1920).
   `zoom` also scales vw/vh units, so the few viewport-sized things divide by
   --z to stay exactly one screen tall / wide. */
@layer components {
  @media (min-width: 2100px) { :root { --z: 1.1; } }
  @media (min-width: 2300px) { :root { --z: 1.2; } }
  @media (min-width: 2500px) { :root { --z: 1.3; } }
  @media (min-width: 2800px) { :root { --z: 1.45; } }
  @media (min-width: 3200px) { :root { --z: 1.65; } }
  @media (min-width: 3600px) { :root { --z: 1.85; } }
  @media (min-width: 2100px) {
    html { zoom: var(--z); }
    body { min-height: calc(100svh / var(--z)); }
    .xhero { height: calc(100svh / var(--z)); }
    .about--b .ab-stage, .about--e .ab-stage { height: min(calc(86vh / var(--z)), 940px); }
    .pd-gal { --edge: max(var(--container-gutter), (100vw / var(--z) - var(--container-default)) / 2); }
    .pd-gal-track figure { max-width: calc(100vw / var(--z) - 2 * var(--edge)); }
    .s3-slider .track { --edge: max(var(--gutter), calc((100vw / var(--z) - var(--max)) / 2 + var(--gutter))); }
    .lightbox img { max-width: calc(100vw / var(--z) - 2 * var(--gutter)); max-height: calc(100vh / var(--z) - 120px); }
  }
}

/* /projekte: the filter bar sticks and docks right under the header while
   scrolling (01.11.; it was made non-sticky on 22.10.). Header = 4px blue stripe
   + topbar (desktop only) + main bar; the 1px overlap hides behind the header's
   bottom border. On phones the filters stay one swipeable row so the docked
   bar stays slim. */
@layer components {
  #portfolio .toolbar { position: sticky; top: calc(var(--header-h) + var(--topbar-h) + 4px); }
  @media (max-width: 760px) {
    #portfolio .toolbar { top: calc(var(--header-h) + 4px); }
    #portfolio .filters { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    #portfolio .filters::-webkit-scrollbar { display: none; }
    #portfolio .filters a { flex: none; white-space: nowrap; }
  }
}

/* SEO / accessibility (01.11.): headings that structure a page for Google and
   screen readers without being shown (home H1, project section headings), and
   the footer address block (<address> is italic by default). */
@layer utilities {
  .visually-hidden:not(:focus):not(:active) {
    position: absolute !important; width: 1px !important; height: 1px !important;
    margin: -1px !important; padding: 0 !important; overflow: hidden !important;
    clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important;
  }
}
@layer components {
  .site-footer address { font-style: normal; }
}

/* Home hero: the blue mark after the slogan (client 01.11.: „ein Strich statt dem
   Punkt“). Switcher group `xdot`: strich = dash character, linie = drawn line
   (echoes the line before the eyebrow), punkt = the original full stop (v3.css). */
@layer components {
  .xdot-strich .xword:not(.xverb) span::after { content: "\2013"; margin-left: .06em; }
  .xdot-linie .xword:not(.xverb) span::after {
    content: ""; display: inline-block; width: .55em; height: .075em; margin-left: .14em;
    background: var(--blue); vertical-align: .3em;
  }
}
