/* base.css – nur MECHANIK der Bauteile (Funktion, Barrierefreiheit, Zustände).
   Jede sichtbare Gestaltung (Farben, Schriften, Formen, Abstände, Layout) kommt aus theme.css,
   die pro Projekt neu geschrieben wird. Hier stehen nur neutrale Standardwerte als Variablen. */

:root {
  --bg: #fff; --ink: #111; --muted: #666; --accent: #333; --accent-ink: #fff; --line: rgba(0,0,0,.12);
  --f-body: system-ui, sans-serif; --f-display: var(--f-body); --f-brand: var(--f-display);
  --nav-h: 72px; --radius: 0px; --gutter: clamp(1rem, 4vw, 3rem); --maxw: 1400px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --fx-colors: #ffffff, #bbbbbb;   /* Farben für Canvas-Effekte (Partikel, Loader, Malen) */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
main, footer { overflow-x: clip; }
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:where(html[lang="de"]) p { hyphens: auto; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 10000; padding: .7rem 1rem; background: var(--ink); color: var(--bg); transition: top .2s; }
.skip:focus { top: 1rem; }

/* ---------- Loader ---------- */
body.is-loading { overflow: hidden; }
.loader { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; background: var(--bg); clip-path: inset(0 0 0 0); }
.loader__canvas { width: min(92vw, 900px); height: min(40vw, 360px); }
.loader__count { position: absolute; right: var(--gutter); bottom: var(--gutter); font-variant-numeric: tabular-nums; opacity: .6; }
.reduced .loader { display: none; }

/* ---------- Navigation + Vollbild-Menü ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 800; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0 var(--gutter); transition: transform .5s var(--ease), background .4s, backdrop-filter .4s; }
.nav.is-hidden { transform: translateY(-110%); }
.nav__links { display: flex; gap: clamp(1rem, 2vw, 2rem); list-style: none; margin: 0; padding: 0; }
.nav__burger { position: relative; width: 44px; height: 44px; display: none; }
.nav__burger span { position: absolute; left: 10px; right: 10px; height: 2px; background: currentColor; transition: transform .4s var(--ease); }
.nav__burger span:first-child { top: 17px; } .nav__burger span:last-child { top: 25px; }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
@media (max-width: 860px) { .nav__links { display: none; } .nav__burger { display: block; } }
.menu { position: fixed; inset: 0; z-index: 790; display: grid; align-content: center; padding: var(--nav-h) var(--gutter) var(--gutter); }
.menu__bg { position: absolute; inset: 0; background: var(--bg); z-index: -1; }
.menu__links { display: grid; gap: .3em; font-size: clamp(2rem, 9vw, 4rem); line-height: 1.1; }
.menu__links a { text-decoration: none; }

/* ---------- Cursor ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; pointer-events: none; position: fixed; inset: 0; z-index: 9500; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.has-cursor input, .has-cursor textarea, .has-cursor select { cursor: text; }
.cursor__dot, .cursor__ring { position: fixed; left: 0; top: 0; border-radius: 50%; translate: -50% -50%; }
.cursor__dot { width: 6px; height: 6px; background: var(--accent); }
.cursor__ring { width: 36px; height: 36px; border: 1px solid var(--accent); display: grid; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), background .3s, border-color .3s; }
.cursor.is-link .cursor__ring { width: 56px; height: 56px; }
.cursor.is-view .cursor__ring { width: 92px; height: 92px; background: var(--accent); }
.cursor.is-paint .cursor__ring { border-style: dashed; width: 70px; height: 70px; }
.cursor.is-hidden { opacity: 0; }
.cursor__label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); opacity: 0; transition: opacity .2s; }
.cursor.is-view .cursor__label { opacity: 1; }

/* ---------- Text-Effekte ---------- */
.line { display: block; overflow: hidden; padding: .06em .08em .14em 0; }
.char { display: inline-block; }
[data-fx="words"] .w { opacity: .15; }
.reduced [data-fx="words"] .w { opacity: 1; }
.molten { background-image: linear-gradient(100deg, var(--fx-colors)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: molten 9s linear infinite; }
@keyframes molten { to { background-position: 300% 0; } }

/* ---------- Canvas-Ebenen ---------- */
canvas[data-fx="particles"], canvas[data-fx="paint"] { position: absolute; inset: 0; width: 100%; height: 100%; }
canvas[data-fx="particles"] { pointer-events: none; }
[data-fx="spotlight"] { -webkit-mask-image: radial-gradient(circle var(--r, 220px) at var(--sx, 50%) var(--sy, 50%), #000 35%, rgba(0,0,0,.18) 100%);
  mask-image: radial-gradient(circle var(--r, 220px) at var(--sx, 50%) var(--sy, 50%), #000 35%, rgba(0,0,0,.18) 100%); }
[data-fx="spotlight"].spot-off { -webkit-mask-image: none; mask-image: none; }

/* ---------- Laufband ---------- */
[data-fx="marquee"] { display: flex; overflow: hidden; white-space: nowrap; }
.marquee__track { display: flex; flex: none; gap: 2em; padding-right: 2em; }
.reduced [data-fx="marquee"] { flex-wrap: wrap; white-space: normal; }

/* ---------- Horizontale Strecke ---------- */
.hscroll__pin { overflow: hidden; }
.hscroll__track { display: flex; gap: clamp(1rem, 2vw, 2rem); padding: 0 var(--gutter); width: max-content; }
.hscroll__progress { height: 2px; background: var(--line); margin: 1.5rem var(--gutter) 0; }
.hscroll__progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
@media (max-width: 860px) {
  .hscroll__pin { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .hscroll__track > * { scroll-snap-align: start; }
  .hscroll__progress { display: none; }
}

/* ---------- Galerie ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button { padding: .5em 1em; border: 1px solid var(--line); border-radius: 999px; min-height: 44px; }
.filters button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.filters sup { margin-left: .3em; opacity: .6; font-size: .7em; }
.masonry { columns: 4 260px; column-gap: 1rem; }
.tile { position: relative; display: block; width: 100%; margin: 0 0 1rem; break-inside: avoid; overflow: hidden; border-radius: var(--radius); }
.tile img { width: 100%; transition: transform .8s var(--ease); }
.tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem .8rem .7rem; text-align: left; font-size: .85rem;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; opacity: 0; transform: translateY(8px); transition: .4s var(--ease); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.05); }
.tile:hover span, .tile:focus-visible span { opacity: 1; transform: none; }
@media (hover: none) { .tile span { opacity: 1; transform: none; } }
.more { text-align: center; margin-top: 2rem; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 9200; background: rgba(0,0,0,.92); color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.lb__bar { display: flex; justify-content: space-between; align-items: center; padding: 1rem var(--gutter); gap: 1rem; }
.lb__fig { margin: 0; display: grid; place-items: center; padding: 0 clamp(3rem, 8vw, 6rem); min-height: 0; }
.lb__fig img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.lb__nav { position: absolute; top: 50%; translate: 0 -50%; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); font-size: 1.3rem; }
.lb__prev { left: 1rem; } .lb__next { right: 1rem; }
.lb__close { width: 44px; height: 44px; font-size: 1.6rem; }
.lb__title { padding: 0 var(--gutter) 1.2rem; text-align: center; opacity: .85; }

/* ---------- Vorher/Nachher ---------- */
.compare__stage { position: relative; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: var(--radius); --pos: 50%; }
.compare__after { width: 100%; }
.compare__before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); z-index: 1; }
.compare__before img { width: 100%; height: 100%; object-fit: cover; }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 2; width: 44px; translate: -50% 0; cursor: ew-resize; }
.compare__handle::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; translate: -50% 0; background: #fff; }
.compare__handle::after { content: "⟷"; position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: #111; }
.compare__tabs { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.compare__tabs button { width: 64px; height: 64px; overflow: hidden; border-radius: var(--radius); opacity: .55; transition: opacity .3s; }
.compare__tabs button[aria-selected="true"] { opacity: 1; outline: 2px solid var(--accent); }
.compare__tabs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Lupe ---------- */
[data-fx="lens"] { position: relative; overflow: hidden; touch-action: none; }
.lens__glass { position: absolute; width: 220px; height: 220px; border-radius: 50%; translate: -50% -50%; pointer-events: none;
  background-repeat: no-repeat; box-shadow: 0 0 0 2px #fff, 0 20px 50px rgba(0,0,0,.45); opacity: 0; scale: .6; transition: opacity .25s, scale .35s var(--ease); }
[data-fx="lens"].is-on .lens__glass { opacity: 1; scale: 1; }

/* ---------- Umschalter ---------- */
.toggle__item { position: relative; display: block; width: 100%; overflow: hidden; border-radius: var(--radius); }
.toggle__item img { width: 100%; transition: opacity .9s var(--ease); }
.toggle__item .on { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; }
[data-fx="toggle"].is-on .toggle__item .on { opacity: 1; }
.toggle__switch { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; }
.toggle__switch i { position: relative; width: 48px; height: 26px; border-radius: 999px; background: var(--line); transition: background .3s; }
.toggle__switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: translate .4s var(--ease), background .3s; }
.toggle__switch[aria-pressed="true"] i { background: var(--accent); }
.toggle__switch[aria-pressed="true"] i::after { translate: 22px 0; background: var(--accent-ink); }

/* ---------- Projektliste mit Vorschau ---------- */
.projects__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.projects__list li { border-bottom: 1px solid var(--line); }
.projects__list li.is-extra { display: none; }
.projects.is-open .projects__list li.is-extra { display: block; }
.projects__list button { width: 100%; display: grid; grid-template-columns: 3rem 1fr auto; gap: 1rem; align-items: baseline; padding: 1.2rem 0; text-align: left; transition: padding .4s var(--ease); }
.projects__list button:hover { padding-left: 1rem; }
.projects__list .s { display: block; opacity: .6; font-size: .9em; }
.projects__more { margin-top: 2rem; }
.projects__preview { position: fixed; left: 0; top: 0; z-index: 700; width: 280px; aspect-ratio: 4 / 3; pointer-events: none; opacity: 0; scale: .7; overflow: hidden; border-radius: var(--radius); }
.projects__preview img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none) { .projects__preview { display: none; } }

/* ---------- 3D-Band ---------- */
.rail { overflow: hidden; perspective: 1200px; cursor: grab; touch-action: pan-y; padding: 2rem 0; }
.rail.is-drag { cursor: grabbing; }
.rail__track { display: flex; gap: 1.5rem; width: max-content; padding: 0 var(--gutter); transform-style: preserve-3d; will-change: transform; }
.rail__item { width: clamp(180px, 22vw, 300px); flex: none; transform-style: preserve-3d; }
.rail__item img { width: 100%; pointer-events: none; user-select: none; box-shadow: 0 20px 40px rgba(0,0,0,.25); }

/* ---------- Video + Karte (Klick zum Laden) ---------- */
.vid { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #000; }
.vid img { width: 100%; height: 100%; object-fit: cover; opacity: .8; transition: opacity .4s, transform .8s var(--ease); }
.vid:hover img { opacity: 1; transform: scale(1.04); }
.vid iframe { width: 100%; height: 100%; border: 0; }
.vid__play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.9); }
.vid__play::after { content: ""; position: absolute; left: 26px; top: 20px; border: 12px solid transparent; border-left: 18px solid #111; border-right: 0; }
.vid__t { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem 1rem .8rem; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); font-size: .9rem; }
.map { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: var(--line); }

/* ---------- Buttons (Form nur minimal – Stil in theme.css) ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 48px; padding: .8em 1.6em;
  text-decoration: none; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); overflow: hidden; isolation: isolate; }
.btn::before { content: ""; position: absolute; left: var(--mx, 50%); top: var(--my, 50%); width: 0; height: 0; border-radius: 50%; translate: -50% -50%;
  background: rgba(255,255,255,.18); transition: width .5s var(--ease), height .5s var(--ease); z-index: -1; }
.btn:hover::before { width: 260%; height: 600%; }
.btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }

/* ---------- Formular ---------- */
.form { position: relative; display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field input, .field textarea, .field select { width: 100%; font: inherit; color: inherit; padding: .85em 1em; background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius); }
.field textarea { min-height: 9rem; resize: vertical; }
.field.is-invalid input, .field.is-invalid textarea, .check.is-invalid { border-color: #d33; box-shadow: 0 0 0 1px #d33; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: .3em; width: 18px; height: 18px; flex: none; }
.hp { position: absolute !important; left: -9999px; }
.form__status { min-height: 1.5em; }
.form__status.err { color: #d33; }

/* ---------- Rechtstexte ---------- */
.legal { max-width: 72ch; margin: 0 auto; padding: calc(var(--nav-h) + 3rem) var(--gutter) 5rem; }
.legal h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.1; }
.legal h2 { margin-top: 2.5rem; font-size: 1.25rem; }
.legal .note { padding: .8rem 1rem; border-left: 3px solid var(--accent); background: rgba(127,127,127,.08); }

/* ---------- Bewegung reduziert ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
