/* NordForm 3D-Projektvitrine (#projekte). CSS-3D, Maße in cqw, Basis = Ruhepose; JS tweent nur Variablen.
   Zwischen Viewport und Flächen kein overflow/opacity/filter/mask/clip-path/will-change (sonst flach). */

.p3d { --mx: 0; --my: 0; --sway: 0; --cy: 4; --cz: 0; position: relative; container-type: inline-size; }
.p3d[data-count="5"] { --cz: -9; }
.p3d__frame { position: relative; }
/* c-v: Bilder erst nahe der Bühne laden (vor dem Hero-Pin läge sie in der Lazy-Schwelle) */
.p3d__viewport {
  position: relative; aspect-ratio: 1; overflow: hidden; content-visibility: auto;
  border-radius: var(--radius-lg); border: 1px solid var(--c-border);
  perspective: 230cqw; perspective-origin: 50% 40%;
  background:
    radial-gradient(60% 45% at 28% 18%, rgba(240,169,78,.10), transparent 70%),
    radial-gradient(40% 35% at 92% 30%, rgba(74,158,218,.08), transparent),
    radial-gradient(35% 25% at 30% 92%, rgba(150,67,42,.10), transparent),
    linear-gradient(160deg, #0e2130, #0a1620 70%);
}

.p3d__rig, .p3d__world, .p3d__slot, .dev, .dev__float, .box, .win { position: absolute; transform-style: preserve-3d; }
.p3d__rig, .p3d__world { inset: 0; }
.p3d__slot, .dev, .dev__float, .box { left: 0; top: 0; width: 0; height: 0; }
/* Kamera -16cqw/-10° (Spez. -20/-4° zu frontal); --cy/--cz je Variante */
.p3d__rig {
  --intro: 1; --dolly: 0; pointer-events: none;
  transform: translate3d(0, calc(var(--cy) * 1cqw), calc((var(--cz) - 16 + var(--dolly) * 12) * 1cqw)) rotateX(calc(-10deg - (1 - var(--intro)) * 20deg)) rotateY(calc(var(--dolly) * 6deg));
}
.p3d__world { transform: rotateY(calc(-8deg + var(--mx) * 10deg + var(--sway) * 2.5deg)) rotateX(calc(var(--my) * -6deg)); }
.f, .dev__slice, .dev__shadow, .dev__dim, .dev__plate, .dev__app, .win > *, .p3d__floor, .p3d__ruler { position: absolute; display: block; backface-visibility: hidden; }

/* Werkbank: Raster als SVG statt mask-image (Chromium verschiebt Masken auf großen 3D-Layern) */
.p3d__floor {
  --gridop: 1; left: -50cqw; top: -50cqw; width: 200cqw; height: 200cqw; pointer-events: none; opacity: var(--gridop);
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><pattern id='g' width='6' height='6' patternUnits='userSpaceOnUse' stroke='%23fff'><path d='M.1 0V6' stroke-opacity='.06' stroke-width='.22'/><path d='M0 .3H6' stroke-opacity='.05' stroke-width='.6'/></pattern><radialGradient id='r' cy='.76' r='.48'><stop offset='.45' stop-color='%23fff'/><stop offset='1' stop-color='%23fff' stop-opacity='0'/></radialGradient><radialGradient id='w'><stop stop-color='%23f0a94e' stop-opacity='.08'/><stop offset='1' stop-color='%23f0a94e' stop-opacity='0'/></radialGradient><mask id='m'><rect width='200' height='200' fill='url(%23r)'/></mask></defs><rect width='200' height='200' fill='url(%23g)' mask='url(%23m)'/><ellipse cx='94' cy='166' rx='46' ry='30' fill='url(%23w)'/></svg>") 0 0 / 100% 100%;
  transform: translate3d(0, 30cqw, -60cqw) rotateX(90deg);
}
/* Lineal an der Vorderkante, 0.6cqw unter der Bodenebene (sonst schneidet Chromium es ab) */
.p3d__ruler {
  left: -50cqw; top: 80.6cqw; width: 200cqw; height: 2cqw; pointer-events: none; transform: translateZ(40.3cqw);
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 2' preserveAspectRatio='none'><defs><linearGradient id='f'><stop offset='.22' stop-color='%23fff' stop-opacity='0'/><stop offset='.4' stop-color='%23fff'/><stop offset='.6' stop-color='%23fff'/><stop offset='.78' stop-color='%23fff' stop-opacity='0'/></linearGradient><mask id='m'><rect width='200' height='2' fill='url(%23f)'/></mask><pattern id='t' width='10' height='2' patternUnits='userSpaceOnUse'><path d='M.1 0v1.4M2.1 0v.6M4.1 0v.6M6.1 0v.6M8.1 0v.6' stroke='%23fff' stroke-opacity='.14' stroke-width='.2'/></pattern></defs><g mask='url(%23m)'><rect width='200' height='2' fill='%23fff' fill-opacity='.025'/><rect width='200' height='2' fill='url(%23t)'/><rect width='200' height='.22' fill='%2396432a' fill-opacity='.6'/></g></svg>") 0 0 / 100% 100%;
}

/* Slots = Fußpunkt-Mitte; B/C gegenüber Spez. verschoben (Phone verdeckte den ERP-Toast) */
.p3d__slot { left: 50%; top: 50%; transform: translate3d(calc(var(--x) * 1cqw), calc((30 - var(--fy)) * 1cqw), calc(var(--z) * 1cqw)) rotateY(calc(var(--ry) * 1deg)); }
.p3d__slot[data-slot="a"] { --x: -16; --z: -34; --ry: 16; --fy: 18; --haze: .18; --fd: -4.4s; }
.p3d__slot[data-slot="b"] { --x: -9; --z: -2; --ry: 24; --fy: .3; --haze: 0; --fd: -1.5s; }
.p3d__slot[data-slot="c"] { --x: 30; --z: 22; --ry: -18; --fy: 3; --haze: 0; --fd: -3.2s; }
.p3d__slot[data-slot="d"] { --x: 16; --z: -58; --ry: -14; --fy: 13; --haze: .26; --fd: -2.4s; }
.p3d__slot[data-slot="e"] { --x: -30; --z: 32; --ry: 22; --fy: 3; --haze: 0; --fd: -5.6s; }
/* n = 4: Phone vorn links, Tablet hinten rechts (sonst stünden zwei hohe Geräte hintereinander).
   Tablet-Linkskante rechts der Deckelecke: keine Überschneidung mit dem Deckel (Safari teilt sonst Ebenen) */
.p3d[data-count="4"] { --cz: -8; --cy: 7; }
.p3d[data-count="4"] [data-slot="a"] { --x: -8; --z: -40; --fy: 20; }
.p3d[data-count="4"] [data-slot="b"] { --x: 2; --z: -4; }
.p3d[data-count="4"] [data-slot="c"] { --x: -30; --z: 24; --ry: 20; --fy: 6; } /* schwebt: das vortretende Laptop-Deck läuft darunter durch */
.p3d[data-count="4"] [data-slot="d"] { --x: 35; --z: -26; --ry: -22; --fy: 5; --haze: .12; }
/* Browser-Schild: nach rechts, sonst verdeckt das Phone die „03“; liegend nach hinten, sonst schneidet es den Deckel (Safari) */
.p3d[data-count="4"] .dev--browser .dev__plate { margin-left: 6cqw; --pf: -1; }
.p3d[data-count="4"] .dev__app { left: -15.5cqw; } /* nur über dem Tablet, nicht über dem Browser dahinter */
.p3d[data-count="4"] .dev--browser { --fwd: 28; } /* ganz vor den Deckel, sonst schneidet er dessen linke obere Ecke */

/* Gerät */
.dev {
  --rise: 1; --act: 0; --dimmed: 0; --push: 0; --fwd: 12; display: block; pointer-events: auto; color: inherit;
  transform:
    translate3d(0, calc(((1 - var(--rise)) * 34 - var(--act) * 3) * 1cqw), calc((var(--act) * var(--fwd) + var(--push) * 30) * 1cqw))
    rotateY(calc(var(--ry) * -1deg * (.65 * var(--act) + .35 * var(--push)))) rotateX(calc((1 - var(--rise)) * 70deg));
}
/* Schatten liegt 0.1cqw über dem Boden und bleibt dort */
.dev__shadow {
  left: calc(var(--sw) * -.5cqw); top: calc(var(--sd) * -.5cqw); width: calc(var(--sw) * 1cqw); height: calc(var(--sd) * 1cqw);
  pointer-events: none; opacity: calc((1 - var(--act) * .65) * var(--rise));
  transform: translate3d(0, calc((var(--fy) - .1 + var(--act) * 3) * 1cqw), 0) rotateX(90deg) scale(calc(1 + var(--act) * .25));
}
.dev__shadow::before, .dev__shadow::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.dev__shadow::before { background: radial-gradient(closest-side, rgba(0,0,0,.6), rgba(0,0,0,.45) 62%, rgba(0,0,0,.2) 80%, transparent); }
.dev__shadow::after { inset: -10% 5% 20%; background: radial-gradient(closest-side, color-mix(in srgb, var(--acc) 12%, transparent), transparent); }
.dev__dim { pointer-events: none; background: #050b10; opacity: calc((var(--haze) + var(--dimmed) * .45) * (1 - var(--act))); }
/* Typenschild: --py/--pz Scharnier, --pk 1 = bleibt auf der Werkbank, --pf -1 = klappt nach hinten statt nach vorn */
.dev__plate {
  left: 0; top: 0; width: max-content; white-space: nowrap; padding: .9cqw 1.6cqw .95cqw; border-radius: .6cqw;
  font: 500 max(11px, 2.8cqw) / 1 var(--font-display); letter-spacing: -.01em; color: #1b0f08;
  background: linear-gradient(135deg, #e0ab70, #c17a45 50%, #96432a); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 .8cqw 2cqw rgba(0,0,0,.35);
  transform-origin: 50% 100%;
  transform:
    translate3d(-50%, calc(-100% + (var(--py) + var(--pk, 0) * var(--act) * 3) * 1cqw), calc(var(--pz) * 1cqw))
    rotateY(calc(var(--ry) * -1deg * (1 - .65 * var(--act) - .35 * var(--push)))) rotateX(calc((1 - var(--act)) * -90deg * var(--pf, 1)));
}
.dev__plate b { font-weight: 500; opacity: .7; margin-right: .35em; }
/* Trefferfläche bleibt per inverser Gerätetransformation in Ruhe: sonst fährt das aktive Gerät
   unter dem Zeiger weg und Hover flackert an den Rändern. --hz/--hx: Lage der Ebene */
.dev__hit {
  position: absolute; display: block; backface-visibility: hidden; transform-origin: 50% 100%;
  transform:
    rotateX(calc((1 - var(--rise)) * -70deg)) rotateY(calc(var(--ry) * 1deg * (.65 * var(--act) + .35 * var(--push))))
    translate3d(0, calc(((var(--rise) - 1) * 34 + var(--act) * 3) * 1cqw), calc((var(--act) * var(--fwd) + var(--push) * 30) * -1cqw))
    translateZ(calc(var(--hz) * 1cqw)) rotateX(calc(var(--hx, 0) * 1deg));
}
.dev--laptop .dev__hit { left: -31cqw; top: -56.6cqw; width: 62cqw; height: 56.6cqw; --hz: 18; --hx: 51.8; } /* Deck-Vorderkante → Deckeloberkante */
.dev--phone .dev__hit { left: -11cqw; top: -47.8cqw; width: 22cqw; height: 47.8cqw; --hz: .2; }
.dev--browser .dev__hit { left: -32cqw; top: -40cqw; width: 64cqw; height: 40cqw; --hz: .3; }
.dev--tablet .dev__hit { left: -15cqw; top: -42cqw; width: 30cqw; height: 42cqw; --hz: .2; }

/* Quader --w×--h×--d, Fuß y 0, Mitte z --zo */
.box { --zo: 0; }
.f--top, .f--front, .f--back { width: calc(var(--w) * 1cqw); left: calc(var(--w) * -.5cqw); }
.f--front, .f--back, .f--left, .f--right { height: calc(var(--h) * 1cqw); top: calc(var(--h) * -1cqw); }
.f--left, .f--right { width: calc(var(--d) * 1cqw); left: calc(var(--d) * -.5cqw); }
.f--top { height: calc(var(--d) * 1cqw); top: calc(var(--d) * -.5cqw); transform: translate3d(0, calc(var(--h) * -1cqw), calc(var(--zo) * 1cqw)) rotateX(90deg); }
.f--front { transform: translateZ(calc((var(--zo) + var(--d) / 2) * 1cqw)); }
.f--back { transform: translateZ(calc((var(--zo) - var(--d) / 2) * 1cqw)) rotateY(180deg); }
.f--left { transform: translate3d(calc(var(--w) * -.5cqw), 0, calc(var(--zo) * 1cqw)) rotateY(-90deg); }
.f--right { transform: translate3d(calc(var(--w) * .5cqw), 0, calc(var(--zo) * 1cqw)) rotateY(90deg); }
.f::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: #000; pointer-events: none; opacity: calc(var(--dimmed) * .45 * (1 - var(--act))); }
.f--left::after { opacity: clamp(0, .35 + var(--mx) * .25 + var(--dimmed) * .45, .9); }
.f--right::after { opacity: clamp(0, .35 - var(--mx) * .25 + var(--dimmed) * .45, .9); }

/* Laptop */
.dev--laptop { --open: 1; --sw: 73; --sd: 47; --py: .1; --pk: 1; --pz: 21; }
.dev__deck { --w: 56; --h: 1.3; --d: 36; }
.dev__lid { --w: 56; --h: 35; --d: .8; --zo: .4; transform: translate3d(0, -1.35cqw, -18cqw) rotateX(calc(-90deg + var(--open) * 104deg)); }
.dev__deck .f--top {
  border-radius: 1.2cqw;
  background:
    repeating-linear-gradient(90deg, transparent 0 3cqw, #26343f 3cqw 3.5cqw) 4.25cqw 3cqw / 47.5cqw 15.5cqw no-repeat,
    repeating-linear-gradient(transparent 0 2.6cqw, #26343f 2.6cqw 3.1cqw) 4.25cqw 3cqw / 47.5cqw 15.5cqw no-repeat,
    linear-gradient(#0f171d, #0f171d) 4.25cqw 3cqw / 47.5cqw 15.5cqw no-repeat,
    linear-gradient(rgba(255,255,255,.07), transparent 60%), linear-gradient(#2c3a45, #22323f);
}
.dev__deck .f--top::before { 
  content: ""; position: absolute; left: 50%; bottom: 2.4cqw; width: 19cqw; height: 11cqw; margin-left: -9.5cqw; border-radius: .9cqw;
  background: linear-gradient(rgba(255,255,255,.035), rgba(255,255,255,.01)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 1px 4px rgba(0,0,0,.45);
}
.dev__deck .f--front { background: linear-gradient(#26343f, #172129); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); border-radius: 0 0 .6cqw .6cqw; }
.dev--laptop .f--left { background: #1d2b36; }
.dev--laptop .f--right { background: #0f1922; }
.dev__lid .f--back { background: linear-gradient(160deg, rgba(255,255,255,.07), transparent 55%), linear-gradient(#2c3a45, #22323f); border-radius: 1cqw 1cqw .3cqw .3cqw; }
.dev__lid .f--top { background: #33424e; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.dev--laptop .dev__screen { padding: 1.5cqw 1.3cqw 2cqw; overflow: hidden; background: #0b1117; border-radius: 1cqw 1cqw .3cqw .3cqw; box-shadow: inset 0 0 0 .18cqw #2a3843, 0 0 5cqw rgba(74,158,218,.12); }
/* Laptop: Dimmer im Bildschirm selbst statt eigener Ebene davor (Safari teilte die Ebene → heller Streifen) */
.dev--laptop .dev__dim { display: none; }
.dev--laptop .dev__screen::before {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  background: #050b10; opacity: calc((var(--haze) + var(--dimmed) * .45) * (1 - var(--act)));
}
/* ERP-UI (design-tokens.json) */
.ui-erp { position: relative; height: 100%; overflow: hidden; border-radius: .25cqw; background: #f7f5f0; display: grid; grid-template: 3.2cqw 1fr / 8.6cqw 1fr; font-family: var(--font-sans); }
.ui-erp__top { grid-column: 1 / -1; display: flex; align-items: center; padding: 0 1.2cqw; background: #1e2a4a; }
.ui-erp__top img { height: 2.1cqw; width: auto; }
.ui-erp__top i { margin-left: auto; width: 12cqw; height: 1.3cqw; border-radius: 1cqw; background: rgba(255,255,255,.12); }
.ui-erp__side { display: flex; flex-direction: column; gap: 1.05cqw; padding: 1.5cqw 1.1cqw; background: #171c26; }
.ui-erp__side i { height: .75cqw; border-radius: .4cqw; background: rgba(255,255,255,.16); }
.ui-erp__side i:nth-child(odd) { width: 88%; }
.ui-erp__side i:nth-child(2) { width: 80%; background: #f7a503; }
.ui-erp__main { position: relative; display: flex; flex-direction: column; gap: 1cqw; padding: 1.7cqw 1.9cqw; }
.ui-erp__title { font: 600 max(7px, 2.2cqw) / 1.1 var(--font-sans); color: #171c26; letter-spacing: -.01em; }
.ui-erp__rows { display: grid; gap: .6cqw; }
.ui-erp__rows i {
  position: relative; height: 3cqw; border-radius: .5cqw; box-shadow: inset 0 0 0 1px #e6e2d9;
  background: linear-gradient(#cfc9bc, #cfc9bc) 1.3cqw 50% / 9cqw .7cqw no-repeat, linear-gradient(#e6e2d9, #e6e2d9) 12.5cqw 50% / 7cqw .7cqw no-repeat, #fff;
}
.ui-erp__rows i::before, .ui-erp__rows i::after { content: ""; position: absolute; right: 1.3cqw; top: .75cqw; width: 6cqw; height: 1.5cqw; border-radius: 1cqw; background: #6e8a55; }
.ui-erp__rows [data-s="rent"]::after, .ui-erp__rows [data-s="flip"]::before { background: #f7a503; }
.ui-erp__rows [data-s="off"]::after { background: #707b8b; }
.ui-erp__rows [data-s="flip"]::after { opacity: var(--act); }
.ui-erp__toast {
  position: absolute; right: 1.4cqw; bottom: 1.4cqw; padding: .8cqw 1.3cqw; border-radius: .6cqw; white-space: nowrap;
  font: 600 max(6px, 1.55cqw) / 1 var(--font-sans); color: #fff; background: #1e2a4a; box-shadow: 0 .6cqw 1.6cqw rgba(23,28,38,.25);
  transform: translateX(calc((1 - var(--act)) * 115%));
}
.ui-erp__toast b { color: #f7a503; }

/* Phone */
.dev--phone { --sw: 30; --sd: 12; --sg: .3; --py: 2.8; --pk: 1; --pz: 2.5; }
.dev--phone .dev__slice, .dev__glass, .dev--phone .dev__dim { left: -11cqw; top: -47.8cqw; width: 22cqw; height: 47.8cqw; border-radius: 3.3cqw; }
.dev--phone .dev__slice { background: #1d2a24; box-shadow: inset 0 0 0 .25cqw #34443c; transform: translateZ(calc((var(--i) + 1) * var(--sg) * -1cqw)); }
.dev__glass { position: absolute; padding: .9cqw; overflow: hidden; background: #050807; box-shadow: inset 0 0 0 .3cqw #2c3a33, inset 0 0 0 .4cqw #0b120e; }
.dev__glass img { width: 100%; height: 100%; object-fit: cover; border-radius: 2.5cqw; background: #23403a; background: color-mix(in srgb, var(--acc) 30%, #0a1620); }
.dev__glass .dev__alt { position: absolute; inset: .9cqw; width: auto; height: auto; opacity: var(--act); }
.dev__glass::before { 
  content: ""; position: absolute; z-index: 1; left: 50%; top: 1.4cqw; width: 6cqw; height: 1.65cqw; margin-left: -3cqw; border-radius: 1cqw; background: #0b120e;
}
/* Phone/Tablet: Dimmen per filter am Glas (Blatt) statt eigener Ebene davor; die Ebene bekam bei 4 Geräten Nahtlinien */
:is(.dev--phone, .dev--tablet) .dev__dim { display: none; }
:is(.dev--phone, .dev--tablet) .dev__glass { filter: brightness(calc(1 - (var(--haze) + var(--dimmed) * .45) * (1 - var(--act)))); }

/* Tablet (iPad hochkant, wie das Phone gebaut). Oben links schwebt das App-Icon davor (Blatt, eigener Dimmer per filter) */
.dev--tablet { --sw: 40; --sd: 14; --sg: .3; --py: 2.8; --pk: 0; --pz: 2.5; }
.dev--tablet .dev__slice, .dev--tablet .dev__glass, .dev--tablet .dev__dim { left: -15cqw; top: -42cqw; width: 30cqw; height: 42cqw; border-radius: 2.4cqw; }
.dev--tablet .dev__slice { background: #1a2232; box-shadow: inset 0 0 0 .22cqw #33405a; transform: translateZ(calc((var(--i) + 1) * var(--sg) * -1cqw)); }
.dev--tablet .dev__glass { padding: 1.3cqw; background: #060a12; box-shadow: inset 0 0 0 .25cqw #2b3852, inset 0 0 0 .35cqw #0b1220; }
.dev--tablet .dev__glass img { border-radius: 1.2cqw; }
.dev--tablet .dev__glass::before { top: .45cqw; width: .5cqw; height: .5cqw; margin-left: -.25cqw; background: #1b2539; }
.dev__app {
  left: -19cqw; top: -46cqw; width: 10cqw; height: 10cqw; max-width: none; pointer-events: none; transform: translateZ(2cqw);
  filter: drop-shadow(0 .5cqw .8cqw rgba(0,0,0,.5)) brightness(calc(1 - (var(--haze) + var(--dimmed) * .45) * (1 - var(--act))));
}

/* Browser (portal-ui.css); --fwd 24, sonst bleibt er hinter dem Deckel */
.dev--browser { --explode: 0; --fwd: 24; --sw: 82; --sd: 20; --py: 6.5; --pz: 2.5; }
.dev--browser .dev__slice, .win, .dev--browser .dev__dim { left: -32cqw; top: -40cqw; width: 64cqw; height: 40cqw; border-radius: 1.4cqw; }
.dev--browser .dev__slice { background: #18232c; box-shadow: inset 0 0 0 .2cqw #2a3742; transform: translateZ(calc((var(--i) + 1) * -.4cqw)); }
.dev--browser .dev__dim { transform: translateZ(.05cqw); }
.win__bar {
  left: 0; top: 0; width: 100%; height: 3.6cqw; display: flex; align-items: center; gap: .7cqw; padding: 0 1.5cqw;
  background: #0c161e; border-radius: 1.4cqw 1.4cqw 0 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(255,255,255,.05);
}
.win__bar i { width: 1cqw; height: 1cqw; border-radius: 50%; background: rgba(255,255,255,.16); }
.win__bar span { margin: 0 auto; width: 22cqw; height: 1.7cqw; border-radius: 1cqw; background: rgba(255,255,255,.06); }
.win__layer { transform: translateZ(calc(var(--layer) * (1.2 + var(--explode) * 3.4) * 1cqw)); }
.win__layer--aurora {
  --layer: 0; left: 0; top: 3.6cqw; width: 100%; height: 36.4cqw; overflow: hidden; border-radius: 0 0 1.4cqw 1.4cqw;
  background:
    radial-gradient(45% 55% at 12% 6%, rgba(240,169,78,.35), transparent 70%), radial-gradient(40% 50% at 92% 4%, rgba(70,150,190,.30), transparent 70%),
    radial-gradient(45% 50% at 6% 100%, rgba(60,120,150,.25), transparent 70%), radial-gradient(rgba(255,255,255,.06) 1px, transparent 1.4px) 0 0 / 2.4cqw 2.4cqw, #060d13;
}
.win__layer--side, .win__layer--card, .win__layer--badge { opacity: calc(1 - (var(--haze) + var(--dimmed) * .45) * (1 - var(--act))); }
.win__layer--side, .win__layer--card {
  top: 5.2cqw; height: 33.2cqw; border-radius: 1.3cqw; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(rgba(255,255,255,.065), rgba(255,255,255,.015)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.085);
}
.win__layer--side { --layer: 1; left: 1.5cqw; width: 13cqw; gap: 1.25cqw; padding: 1.7cqw 1.3cqw; }
.win__mark { margin-bottom: .6cqw; font: 500 max(6px, 1.6cqw) / 1 var(--font-display); color: #f6f8f9; white-space: nowrap; }
.win__mark b { font-weight: 600; color: #f0a94e; }
.win__layer--side i { height: .8cqw; border-radius: .4cqw; background: rgba(255,255,255,.12); }
.win__layer--side i:nth-of-type(odd) { width: 70%; }
.win__layer--side i:nth-of-type(2) { width: 85%; background: linear-gradient(90deg, #ffc677, #f0a94e); }
.win__layer--card { --layer: 2; left: 16.3cqw; width: 46.2cqw; gap: 1cqw; padding: 2.3cqw 2.5cqw; color: #f6f8f9; box-shadow: inset 0 0 0 1px rgba(255,255,255,.085), inset 0 1px 0 rgba(255,255,255,.12); }
.win__layer--card strong { font: 500 max(8px, 2.6cqw) / 1.05 var(--font-display); letter-spacing: -.01em; }
.win__layer--card span { font: 500 max(6px, 1.45cqw) / 1.2 var(--font-sans); color: #ffd8a6; }
.win__progress { position: relative; display: block; height: .9cqw; margin-top: .4cqw; border-radius: .5cqw; background: rgba(255,255,255,.08); }
.win__progress::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(35% + var(--act) * 45%); border-radius: inherit; background: linear-gradient(90deg, #ffc677, #f0a94e, #d9783a, #a9502c); }
.win__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8cqw; margin-top: auto; }
.win__grid i { aspect-ratio: 1; border-radius: .7cqw; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.win__grid i:first-child { background: linear-gradient(135deg, rgba(255,198,119,.55), rgba(169,80,44,.45)); }
.win__layer--badge {
  --layer: 3; right: 4cqw; top: 7.4cqw; padding: .75cqw 1.2cqw; border-radius: 2cqw; white-space: nowrap;
  font: 600 max(6px, 1.45cqw) / 1 var(--font-sans); color: #5fd3a5; background: rgba(6,13,19,.82); box-shadow: inset 0 0 0 1px rgba(95,211,165,.45);
}

/* Glanz */
.dev__screen::after, .win__layer--aurora::after {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; opacity: 1;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.10) 45%, transparent 60%) calc(50% + var(--mx) * 40%) 0 / 250% 100% no-repeat;
}
.win::after { content: none; }

/* Projektindex */
.p3d__title { margin: 1.6rem 0 .55rem; font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c-text-faint); }
.p3d__index { list-style: none; border-top: 1px solid var(--c-border); }
.p3d__link {
  --act: 0; position: relative; display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; column-gap: .3rem;
  min-height: 56px; padding: .7rem .9rem .7rem .8rem; border-bottom: 1px solid var(--c-border);
  background: rgba(255,255,255, calc(var(--act) * .04)); transition: background-color .3s var(--ease-out);
}
.p3d__link::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 3px; background: var(--acc); transform: scaleY(var(--act)); transition: transform .35s var(--ease-out); }
.p3d__no { grid-row: 1 / 3; font: 500 1rem / 1 var(--font-display); color: var(--c-text-faint); color: color-mix(in srgb, var(--acc) calc(var(--act) * 100%), var(--c-text-faint)); transition: color .3s; }
.p3d__name { font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--c-text); }
.p3d__kind { grid-column: 2; font-size: .85rem; line-height: 1.35; color: var(--c-text-dim); }
.p3d__arrow { grid-column: 3; grid-row: 1 / 3; width: 18px; height: 18px; color: var(--c-text-faint); transform: translateX(calc(var(--act) * 4px)); transition: transform .35s var(--ease-out), color .3s; }
.p3d__link.is-active .p3d__arrow { color: var(--c-text); }

/* Badge oben rechts, skaliert mit der Bühne */
.p3d__frame .about__badge {
  top: clamp(.7rem, 3.6cqw, 1.25rem); bottom: auto; left: auto; right: -1px; z-index: 1;
  font-size: clamp(.7rem, 2.66cqw, .8rem); padding: clamp(.62rem, 3cqw, .9rem) clamp(.85rem, 4cqw, 1.2rem);
}
.p3d__frame .about__badge strong { font-size: clamp(.8rem, 3.32cqw, 1rem); }

/* Pause-Knopf (JS entfernt hidden). Links oben statt rechts unten: dort verdeckte er bei 390/1100 px Phone und Typenschild */
.p3d__pause {
  position: absolute; left: 1rem; top: 1rem; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--c-border-strong); background: rgba(10,22,32,.6); color: var(--c-text);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .3s;
}
.p3d__pause:hover { border-color: var(--c-accent); }
/* Fokus in Gold wie .nav-desktop: Rost (--c-accent) hat auf dem Grund nur 2,7:1 */
.p3d__pause:focus-visible, .p3d__link:focus-visible { outline-color: var(--c-warm); }
.p3d__pause[hidden] { display: none; }
.p3d__pause svg { width: 18px; height: 18px; }
.p3d__pause[aria-pressed="true"] .p3d__ico-pause, .p3d__pause[aria-pressed="false"] .p3d__ico-play { display: none; }
.p3d__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Ohne JS: Zeile ↔ Gerät über :has() */
.p3d:not(.p3d--live):has(:is(.p3d__link, .dev):is(:hover, :focus-visible)) .dev { --dimmed: 1; }
.p3d:not(.p3d--live):has([data-i="0"]:is(:hover, :focus-visible)) [data-i="0"],
.p3d:not(.p3d--live):has([data-i="1"]:is(:hover, :focus-visible)) [data-i="1"],
.p3d:not(.p3d--live):has([data-i="2"]:is(:hover, :focus-visible)) [data-i="2"],
.p3d:not(.p3d--live):has([data-i="3"]:is(:hover, :focus-visible)) [data-i="3"],
.p3d:not(.p3d--live):has([data-i="4"]:is(:hover, :focus-visible)) [data-i="4"],
.p3d:not(.p3d--live):has(.dev:hover) .dev:hover { --act: 1; --dimmed: 0; --explode: 1; }
.p3d__link.is-active { --act: 1; }
.p3d:not(.p3d--live) .dev, .p3d:not(.p3d--live) .dev *, .p3d:not(.p3d--live) .dev *::before, .p3d:not(.p3d--live) .dev *::after {
  transition: transform .6s var(--ease-out), opacity .6s var(--ease-out), width .6s var(--ease-out), filter .6s var(--ease-out);
}

/* Live (JS): --act am .dev per Tween, nicht per Klasse */
.p3d--live .dev, .p3d--live .dev * { transition: none; }
.p3d.is-leaving { pointer-events: none; }
.p3d--still .dev.is-active { --act: 1; --dimmed: 0; --explode: 1; }
.p3d--still:has(.dev.is-active) .dev:not(.is-active) { --dimmed: 1; }
.p3d--still *, .p3d--still *::before, .p3d--still *::after { animation: none !important; transition: none !important; }
.p3d--live:not(.p3d--lite) .dev__float, .p3d--lite .dev.is-active .dev__float { animation: p3d-float 7s ease-in-out var(--fd, 0s) infinite alternate; }
.p3d--live:not(.p3d--lite) .dev__shadow::before, .p3d--lite .dev.is-active .dev__shadow::before { animation: p3d-shadow 7s ease-in-out var(--fd, 0s) infinite alternate; }
.p3d:is(.is-paused, .is-user-paused) *, .p3d:is(.is-paused, .is-user-paused) *::before { animation-play-state: paused !important; }
@keyframes p3d-float { to { transform: translateY(-1.2cqw); } }
@keyframes p3d-shadow { to { transform: scale(.92); opacity: .8; } }
/* Lite */
.p3d--lite .dev__screen::after, .p3d--lite .win__layer--aurora::after { display: none; }
.p3d--lite .dev--browser { --explode: 0 !important; }
.p3d--lite .dev--phone { --sg: .5; }
.p3d--lite .dev--phone .dev__slice:nth-child(-n+2), .p3d--lite .dev--tablet .dev__slice:first-child { display: none; }
.p3d--lite .dev--tablet { --sg: .45; }
/* Klick-Vorhang: JS setzt Startrand --wt/--wr/--wb/--wl (px, Bildschirm des Geräts) und tweent --wp 0 → 1 */
.p3d-wipe {
  --wp: 0; position: fixed; inset: 0; z-index: 9000; pointer-events: none; background-color: var(--c-bg);
  background-image: radial-gradient(60% 60% at 50% 50%, color-mix(in srgb, var(--acc, #96432a) 18%, transparent), transparent);
  clip-path: inset(calc(var(--wt, 0px) * (1 - var(--wp))) calc(var(--wr, 0px) * (1 - var(--wp))) calc(var(--wb, 0px) * (1 - var(--wp))) calc(var(--wl, 0px) * (1 - var(--wp))) round calc((1 - var(--wp)) * 12px));
}

/* Einzelbühne (Projektseiten): Kamera je Gerätetyp */
.p3d--single { --cy: -6; --cz: 12; }
.p3d--single:has(.dev--phone) { --cy: 0; --cz: 52; }
.p3d--single:has(.dev--browser) { --cy: 0; --cz: 24; }
.p3d--single:has(.dev--tablet) { --cy: 0; --cz: 46; }
.p3d--single .p3d__slot { --x: 0; --z: 0; --ry: -18; --fy: .3; --haze: 0; }
.p3d--single .p3d__slot:has(:is(.dev--phone, .dev--tablet)) { --fy: 3; }
.p3d--single .p3d__slot:has(.dev--browser) { --fy: 8; }
.p3d--single .dev { --fwd: 8; }

/* Fallbacks */
@media (prefers-reduced-motion: reduce) {
  .p3d *, .p3d *::before, .p3d *::after { animation: none !important; transition: none !important; }
  .p3d__pause { display: none !important; }
}
@supports not ((transform-style: preserve-3d) and (width: 1cqw)) { .p3d__frame { display: none; } }
@media (forced-colors: active) {
  .p3d__frame { display: none; }
  .p3d__name { text-decoration: underline; }
  .p3d__link::before { background: Highlight; }
}
@media print { .p3d__frame { display: none; } }
