/* Projekt-Ring der Startseite (_partials/projekt-karussell.twig + js/karussell.js) */

.karussell {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    height: 100vh;
    height: 100svh;
    min-height: 520px;
    padding: calc(var(--kopf) + 1rem) var(--rand) 0;
    overflow: hidden;
}

.karussell__kopf {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--linie);
    color: var(--grau);
}

.karussell__claim {
    margin: 0;
    color: var(--akzent);
    font: inherit;
    letter-spacing: inherit;
}

.karussell__buehne {
    position: relative;
    perspective: 1800px;
    overflow: hidden;
    margin: 0 calc(var(--rand) * -1);
    user-select: none;
    touch-action: pan-y;
}

.karussell.is-bereit .karussell__buehne {
    cursor: grab;
}

.karussell.is-ziehen .karussell__buehne {
    cursor: grabbing;
}

.karussell__ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
}

.karussell__karte {
    position: absolute;
    display: block;
    width: var(--w, 560px);
    height: calc(var(--w, 560px) * 0.625);
    left: calc(var(--w, 560px) / -2);
    top: calc(var(--w, 560px) * -0.3125);
    color: inherit;
    text-decoration: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.karussell__karte::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: var(--grund);
    opacity: var(--dim, 0);
    pointer-events: none;
}

.karussell__karte:focus-visible {
    outline: none;
}

.karussell__karte:focus-visible .karussell__fenster {
    outline: 2px solid var(--akzent);
    outline-offset: 4px;
}

/* Browserfenster */
.karussell__fenster {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--linie);
    border-radius: 4px;
    background: var(--flaeche);
    font-size: calc(var(--w, 560px) / 48);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
}

.karussell__karte.is-vorne:hover .karussell__fenster {
    border-color: var(--akzent);
}

.karussell__leiste {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
    height: 2.4em;
    padding: 0 1em;
    background: #1c1c1f;
    border-bottom: 1px solid var(--linie);
}

.karussell__leiste b {
    width: 0.75em;
    height: 0.75em;
    border-radius: 50%;
    background: #ff5f57;
}

.karussell__leiste b:nth-child(2) {
    background: #febc2e;
}

.karussell__leiste b:nth-child(3) {
    background: #28c840;
}

.karussell__url {
    flex: 0 1 26em;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.6em;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 0.3em;
    background: #2a2a2e;
    color: var(--grau);
    font-family: var(--mono);
    font-size: 0.85em;
    white-space: nowrap;
    transform: translateX(-2.2em);
}

.karussell__ansicht {
    position: relative;
    display: block;
    flex: 1;
    overflow: hidden;
}

.karussell__ansicht img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    pointer-events: none;
}

/* Platzhalter: laufendes Projekt */
.karussell__ongoing {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: radial-gradient(120% 90% at 20% 10%, #24262b 0, var(--grund) 60%);
}

.karussell__zeilen {
    position: absolute;
    inset: 14% 18%;
    display: grid;
    gap: 7%;
    opacity: 0.5;
    filter: blur(3px);
}

.karussell__zeilen i {
    display: block;
    background: linear-gradient(90deg, #35373e, #1d1e22);
}

.karussell__zeilen i:nth-child(2) {
    width: 70%;
}

.karussell__zeilen i:nth-child(4) {
    width: 55%;
}

.karussell__pille {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.6em 1.2em;
    border: 1px solid var(--linie);
    background: rgba(11, 11, 12, 0.7);
    color: var(--text);
    font-size: 1.3em;
    text-transform: uppercase;
}

.karussell__pille::before {
    content: "";
    width: 0.55em;
    height: 0.55em;
    border-radius: 50%;
    background: var(--akzent);
    box-shadow: 0 0 0.7em var(--akzent);
}

/* App: iPhone statt Browserfenster */
.karussell__fenster--app {
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    overflow: visible;
}

.karussell__handy {
    position: relative;
    display: block;
    height: 100%;
    aspect-ratio: 9 / 19.5;
    padding: 1.1%;
    border: 1px solid var(--linie);
    border-radius: 13% / 6%;
    background: #1c1c1f;
    box-shadow: 0 0 0 0.35em #0f0f11, 0 1.5em 3em rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease;
}

/* Abdunkeln nur auf dem Handy, nicht auf der ganzen Kartenfläche */
.karussell__karte.is-app::after {
    display: none;
}

.karussell__handy::after {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 3;
    border-radius: inherit;
    background: var(--grund);
    opacity: var(--dim, 0);
    pointer-events: none;
}

.karussell__karte.is-vorne:hover .karussell__fenster--app {
    border: 0;
}

.karussell__karte:focus-visible .karussell__fenster--app {
    outline: none;
}

.karussell__karte:focus-visible .karussell__handy {
    outline: 2px solid var(--akzent);
    outline-offset: 4px;
}

.karussell__karte.is-vorne:hover .karussell__handy {
    border-color: var(--akzent);
}

.karussell__insel {
    position: absolute;
    left: 50%;
    top: 3.2%;
    z-index: 2;
    width: 30%;
    height: 3.2%;
    border-radius: 99px;
    background: #000;
    transform: translateX(-50%);
}

.karussell__handy-bild {
    position: relative;
    display: grid;
    place-items: center;
    height: 100%;
    overflow: hidden;
    border-radius: 11.5% / 5.3%;
    background: radial-gradient(120% 70% at 20% 10%, #24262b 0, var(--grund) 65%);
}

.karussell__handy-bild img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.karussell__app-zeilen {
    position: absolute;
    inset: 14% 9% 18%;
    display: grid;
    gap: 5%;
    opacity: 0.5;
    filter: blur(2px);
}

.karussell__app-zeilen i {
    display: block;
    border-radius: 0.6em;
    background: linear-gradient(90deg, #35373e, #1d1e22);
}

.karussell__app-zeilen i:first-child {
    width: 60%;
    height: 40%;
    align-self: end;
}

.karussell__app-leiste {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    justify-content: space-around;
    padding: 6% 10% 9%;
    border-top: 1px solid var(--linie);
    background: rgba(28, 28, 31, 0.8);
}

.karussell__app-leiste i {
    width: 0.9em;
    height: 0.9em;
    border-radius: 0.25em;
    background: #3a3c43;
}

.karussell__app-leiste i:first-child {
    background: var(--akzent);
}

.karussell__fenster--app .karussell__pille {
    font-size: 1em;
}

/* Platzhalter: bald online */
.karussell__bald {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 5%;
    padding: 7% 9%;
    background: #e9ece9;
    color: #18221d;
}

.karussell__bald strong {
    font-family: var(--display);
    font-size: 3.4em;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
}

.karussell__bald i {
    display: block;
    width: 60%;
    height: 0.8em;
    background: #cdd5d0;
}

.karussell__bald i:nth-of-type(2) {
    width: 45%;
}

.karussell__bald i:nth-of-type(3) {
    width: 30%;
}

.karussell__bald em {
    margin-top: auto;
    font-style: normal;
    font-size: 1.1em;
    color: #4a5c53;
    text-transform: uppercase;
}

/* Name des vorderen Projekts */
.karussell__mitte {
    position: relative;
    z-index: 3;
    padding: 0 0 1.25rem;
    text-align: center;
}

.karussell__titel {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.4rem, 2.6vw, 2.6rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.karussell__typ {
    margin: 0.6rem 0 0;
    color: var(--grau);
    font-size: var(--klein);
    text-transform: uppercase;
}

/* Fusszeile */
.karussell__fuss {
    position: relative;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 0.9rem 0 1.1rem;
    border-top: 1px solid var(--linie);
    color: var(--grau);
    font-size: var(--klein);
}

.karussell__fuss p {
    margin: 0;
}

.karussell__fuss nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.karussell__fuss a {
    color: var(--grau);
    text-decoration: none;
    transition: color 0.2s ease;
}

.karussell__fuss a:hover {
    color: var(--akzent);
}

/* Ohne JavaScript: Fenster als einfache Liste */
.karussell:not(.is-bereit) {
    height: auto;
    min-height: 100vh;
}

.karussell:not(.is-bereit) .karussell__ring {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    width: auto;
    height: auto;
    padding: 2rem 0;
}

.karussell:not(.is-bereit) .karussell__karte {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    aspect-ratio: 16 / 10;
}

.karussell:not(.is-bereit) .karussell__karte.is-wiederholung,
.karussell:not(.is-bereit) .karussell__mitte {
    display: none;
}

@media (max-width: 899px) {
    .karussell__fuss-copy,
    .karussell__kopf > span {
        display: none;
    }

    .karussell__titel {
        font-size: 1.6rem;
    }
}
