/* Webdesign, Variante: nur die Bausteine dieser Seite.
   Gemeinsame Bausteine stehen in ../shared/service-base.css. */

/* ------------------------------------------------------------------ */
/* Hero: Studio mit Markenwahl                                          */
/* ------------------------------------------------------------------ */
.wd-studio__fallback {
    position: absolute;
    inset: 0;
    width: min(78%, 620px);
    height: fit-content;
    margin: auto;
    background: var(--white);
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7);
    transform: perspective(1400px) rotateY(-16deg) rotateX(6deg);
}

.wd-studio__fallback-bar { display: flex; height: 28px; align-items: center; gap: 6px; padding-inline: 12px; border-bottom: 1px solid rgba(7, 17, 15, 0.08); color: var(--muted); font-size: 0.72rem; }
.wd-studio__fallback-bar i { width: 7px; height: 7px; border-radius: 50%; background: #c9d3cf; }
.wd-studio__fallback-bar span { margin-left: auto; }
.wd-studio__fallback img { display: block; width: 100%; height: auto; }
.is-live > .wd-studio__fallback { display: none; }

.wd-brands {
    position: absolute;
    z-index: 3;
    /* Rechts neben dem Pause-Schalter: alle Bedienelemente der Szene an einer Stelle. */
    right: calc(clamp(0.75rem, 2vw, 1.5rem) + 52px);
    bottom: 92px;
    display: flex;
    max-width: calc(100% - 6rem);
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    pointer-events: auto;
}

.wd-studio:not(.is-live) .wd-brands { display: none; }

.wd-brands button {
    --c: 9px;
    position: relative;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
    padding: 0.5rem 0.9rem 0.55rem 0.75rem;
    border: 0;
    background: rgba(14, 26, 23, 0.8);
    color: #dfe8e4;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c) * 0.577) 100%, 0 100%);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 200ms ease, color 200ms ease;
}

.wd-brands button[aria-pressed="true"] { background: var(--white); color: var(--ink); }
.wd-brands button:focus-visible { clip-path: none; }

@media (hover: hover) and (pointer: fine) {
    .wd-brands button[aria-pressed="false"]:hover { background: rgba(31, 49, 44, 0.94); color: var(--white); }
}

.wd-brands__dots { display: inline-flex; gap: 2px; }
.wd-brands__dots i { width: 10px; aspect-ratio: 2 / 1.732; background: var(--c); clip-path: var(--hex); }
.wd-brands__bar { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* ------------------------------------------------------------------ */
/* Einordnung: der Weg eines Besuchers                                  */
/* ------------------------------------------------------------------ */
.wd-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15em 0.5em;
    margin-top: clamp(1.6rem, 3vw, 2.4rem);
    font-size: clamp(1.7rem, 3vw, 3.1rem);
    font-stretch: 80%;
    font-weight: 560;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.wd-path i { display: inline-block; width: 0.12em; height: 0.78em; background: var(--teal); transform: skewX(-30deg); }

/* ------------------------------------------------------------------ */
/* Leistungsumfang: Ersatzbild ohne WebGL                               */
/* ------------------------------------------------------------------ */
.wd-fallback-stack { position: absolute; inset: 0; width: min(40%, 300px); height: auto; margin: auto; overflow: visible; }
.wd-fallback-stack polygon { fill: rgba(195, 206, 201, 0.06); stroke: rgba(195, 206, 201, 0.45); stroke-linejoin: round; stroke-width: 1.2; }
.wd-fallback-stack .is-on { fill: var(--accent); stroke: var(--accent); }
.is-live > .wd-fallback-stack { display: none; }
.wd-legend-icon polygon { stroke-width: 2.4; }

/* ------------------------------------------------------------------ */
/* Beispiel: Die unübersichtliche Seite löst sich ab                    */
/* ------------------------------------------------------------------ */
.wd-scene {
    position: relative;
    padding-block: clamp(0.5rem, 2vw, 1.5rem);
    container-type: inline-size;
    perspective: 1600px;
    perspective-origin: 50% 20%;
}

.wd-space {
    width: min(100%, 980px);
    margin-inline: auto;
    transform: rotateX(22deg) rotateY(-12deg);
    transform-style: preserve-3d;
}

.wd-browser { position: relative; background: var(--white); box-shadow: 0 60px 90px -60px rgba(0, 0, 0, 0.9); transform-style: preserve-3d; }

.wd-browser__bar {
    display: grid;
    height: 34px;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    padding-inline: 14px;
    border-bottom: 1px solid rgba(7, 17, 15, 0.08);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 550;
}

.wd-dots { display: inline-flex; gap: 6px; }
.wd-dots i { width: 8px; height: 8px; border-radius: 50%; background: #c9d3cf; }
.wd-browser__title { overflow: hidden; grid-area: 1 / 2; text-overflow: ellipsis; white-space: nowrap; transition: opacity 300ms ease; }

.wd-browser__screen { position: relative; aspect-ratio: 1422 / 800; transform-style: preserve-3d; }
.wd-shot { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }

.wd-wire {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 60fr) minmax(0, 36fr);
    grid-template-rows: 14% minmax(0, 1fr) 24%;
    gap: 4%;
    padding: 0 4% 4%;
    background: #f4f5f4;
    color: #59615e;
    font-size: clamp(0.5rem, 1.15cqw, 0.92rem);
    transform-origin: 50% 0;
    transition: transform 900ms var(--ease-in-out), opacity 600ms ease 150ms;
}

.wd-wire__nav { display: flex; grid-column: 1 / -1; align-items: center; gap: 4%; border-bottom: 1px solid #dcdfdd; font-weight: 600; }
.wd-wire__logo { width: 9%; height: 46%; margin-right: auto; background: #c9cfcc; }
.wd-wire__main { display: flex; flex-direction: column; justify-content: center; gap: 1.1em; }
.wd-wire__main strong { color: #3f4744; font-size: 2em; font-weight: 640; letter-spacing: -0.02em; line-height: 1.1; }
.wd-wire__lines { display: grid; gap: 0.55em; }
.wd-wire__lines i { height: 0.55em; background: #d5dad8; }
.wd-wire__lines i:nth-child(2) { width: 92%; }
.wd-wire__lines i:nth-child(3) { width: 78%; }
.wd-wire__lines i:nth-child(4) { width: 60%; }
.wd-wire__buttons { display: flex; gap: 0.8em; }
.wd-wire__buttons span { padding: 0.6em 1em; border: 1px solid #9aa3a0; font-weight: 600; }
.wd-wire__buttons span:first-child { background: #9aa3a0; color: var(--white); }

.wd-wire__side { display: flex; flex-direction: column; gap: 1.2em; padding: 1.4em; background: #e7eae8; }
.wd-wire__badge { align-self: flex-start; padding: 0.35em 0.75em; background: #ffd23f; color: #3d3200; font-weight: 800; box-shadow: 0.25em 0.25em 0 #e8505b; transform: rotate(-6deg); }
.wd-wire__slider { display: flex; gap: 0.5em; margin-top: auto; }
.wd-wire__slider i { width: 0.7em; height: 0.7em; border-radius: 50%; background: #b9c0bd; }
.wd-wire__slider i:first-child { background: #e8505b; }

.wd-wire__boxes { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3%; }
.wd-wire__boxes span { border: 1px solid #d3d8d6; background: #e1e5e3; }
.wd-wire__boxes span:nth-child(2) { background: linear-gradient(120deg, #4f7cff, #e8505b); }

/* Markierungen: Punkt auf der Seite, Nadel in den Raum, Schild darüber */
.wd-note { position: absolute; top: var(--y); left: var(--x); width: 0; height: 0; pointer-events: none; transform-style: preserve-3d; }

.wd-note__dot {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(34, 230, 189, 0.3);
    transition: transform 300ms var(--ease-out), opacity 300ms ease;
}

.wd-note__pin {
    position: absolute;
    top: 0;
    left: -1px;
    width: 2px;
    height: var(--h);
    background: var(--accent);
    transform: rotateX(90deg) scaleY(var(--grow, 1));
    transform-origin: 50% 0;
    transition: transform 500ms var(--ease-out);
}

.wd-note__chip {
    --c: 9px;
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem 0.5rem 0.5rem;
    background: var(--ink);
    color: var(--white);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c) * 0.577) 100%, 0 100%);
    font-size: clamp(0.72rem, 1.1cqw, 0.92rem);
    font-weight: 600;
    white-space: nowrap;
    transform: translate3d(-50%, calc(-100% - 10px), var(--h));
    transition: opacity 400ms ease, transform 500ms var(--ease-out);
}

.wd-note--ask .wd-note__chip { background: var(--white); color: var(--ink); }
.wd-note--ask .gx-hex { background: var(--mist-strong); }

/* Zustände */
.wd-example[data-state="before"] [data-show="after"],
.wd-example[data-state="after"] [data-show="before"] { --grow: 0; }

.wd-example[data-state="before"] .wd-browser__title[data-show="after"],
.wd-example[data-state="after"] .wd-browser__title[data-show="before"] { opacity: 0; }

.wd-example[data-state="before"] .wd-note[data-show="after"] .wd-note__chip,
.wd-example[data-state="after"] .wd-note[data-show="before"] .wd-note__chip { opacity: 0; transform: translate3d(-50%, calc(-100% - 10px), 0); transition-delay: 0ms; }

.wd-example[data-state="before"] .wd-note[data-show="after"] .wd-note__dot,
.wd-example[data-state="after"] .wd-note[data-show="before"] .wd-note__dot { opacity: 0; transform: scale(0.4); }

.wd-example[data-state="after"] .wd-wire { opacity: 0; pointer-events: none; transform: translate3d(3%, -6%, 180px) rotateX(-16deg) rotateZ(-4deg); }

.wd-example[data-state="after"] .wd-note[data-show="after"] .wd-note__pin,
.wd-example[data-state="after"] .wd-note[data-show="after"] .wd-note__chip,
.wd-example[data-state="after"] .wd-note[data-show="after"] .wd-note__dot { transition-delay: calc(600ms + var(--k, 0) * 90ms); }

.wd-example[data-state="before"] .wd-note[data-show="before"] .wd-note__pin,
.wd-example[data-state="before"] .wd-note[data-show="before"] .wd-note__chip,
.wd-example[data-state="before"] .wd-note[data-show="before"] .wd-note__dot { transition-delay: calc(500ms + var(--k, 0) * 90ms); }

.wd-legend { display: none; }

.wd-inline-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.wd-inline-link:hover { text-decoration-color: var(--ink); }

/* ------------------------------------------------------------------ */
/* Responsiv                                                            */
/* ------------------------------------------------------------------ */
/* Schmale Desktops: Text und Szene rücken zusammen, die Markenwahl wandert über die Szene. */
@media (min-width: 901px) and (max-width: 1200px) {
    .wd-brands { top: 100px; right: clamp(0.75rem, 2vw, 1.5rem); bottom: auto; max-width: calc(100% - 1.5rem); }
}

@media (max-width: 900px) {
    /* Auf schmalen Bildschirmen liegt die Markenwahl unter der Szene statt darüber. */
    .wd-studio { --stage-h: clamp(300px, 92vw, 520px); height: auto; padding-top: var(--stage-h); }
    .wd-studio > .gx-canvas { bottom: auto; height: var(--stage-h); }
    .wd-studio > .wd-studio__fallback { bottom: auto; height: fit-content; max-height: var(--stage-h); }
    .wd-studio > .gx-motion { top: calc(var(--stage-h) - 56px); bottom: auto; }
    .wd-brands { position: static; max-width: none; justify-content: flex-start; margin-top: 0.5rem; padding-inline: var(--page-gutter); }
}

@media (max-width: 760px) {
    .wd-brands button { padding-inline: 0.65rem 0.75rem; font-size: 0.78rem; }
    .wd-space { transform: rotateX(10deg); }
    .wd-note { --h: 30px !important; }
    .wd-note__chip { gap: 0; padding: 0; background: none; font-size: 0; }
    .wd-note--ask .wd-note__chip { background: none; }
    .wd-wire__badge { box-shadow: 0.15em 0.15em 0 #e8505b; }

    .wd-legend { display: grid; gap: 0.55rem; margin: 1.25rem 0 0; padding: 0; color: var(--text-on-dark); font-size: 0.92rem; list-style: none; }
    .wd-legend li { display: flex; align-items: center; gap: 0.6rem; }
    .wd-example[data-state="before"] .wd-legend [data-show="after"],
    .wd-example[data-state="after"] .wd-legend [data-show="before"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wd-wire,
    .wd-note__pin,
    .wd-note__chip,
    .wd-note__dot { transition-property: opacity; transition-delay: 0ms !important; }
}
