/**
 * Startseite – zusätzliche Abschnitte: Willkommenskarte live, KynxBot Assistant, Häufige Fragen.
 * Baut auf landing.css auf (.kx-section, .kx-showcase, .kx-discord, .kx-chip …).
 */

/* ---------- Showcase gespiegelt (Demo links, Text rechts) ---------- */
.kx-showcase--flip { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.kx-showcase--flip > .kx-showcase__copy { order: 2; }
.kx-showcase--flip > .kx-showcase__demo { order: 1; }
.kx-discord--flip { transform: perspective(1400px) rotateY(4deg) rotateX(2deg); }

/* ---------- Willkommenskarte live ---------- */
.kx-livecard {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 2 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #1e1f22;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.kx-livecard > .kx-livecard__host {
    position: absolute;
    top: 0;
    left: 0;
    width: 800px;
    height: 400px;
    transform-origin: 0 0;
    transition: opacity 0.25s ease;
}
.kx-livecard.is-swapping > .kx-livecard__host { opacity: 0.25; }
.kx-livecard__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.1rem;
}
.kx-livecard__chips { margin-top: 0; }
.kx-livecard__name {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    height: 38px;
    padding: 0 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(235, 237, 245, 0.6);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.kx-livecard__name:focus-within { border-color: rgba(88, 101, 242, 0.7); background: rgba(88, 101, 242, 0.12); }
.kx-livecard__name input {
    width: 130px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
}
.kx-livecard__name input::placeholder { color: rgba(235, 237, 245, 0.45); }

/* ---------- KynxBot Assistant (Demo) ---------- */
.kx-eyebrow .fa-wand-magic-sparkles { margin-right: 0.15rem; }
.kx-agentdemo {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(88, 101, 242, 0.22), transparent 60%),
        radial-gradient(90% 70% at 0% 100%, rgba(235, 69, 158, 0.12), transparent 60%),
        rgba(17, 18, 28, 0.88);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(88, 101, 242, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.kx-agentdemo__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.kx-agentdemo__head strong { display: block; color: #fff; font-size: 0.95rem; }
.kx-agentdemo__head small { display: block; color: rgba(235, 237, 245, 0.55); font-size: 0.78rem; }
.kx-agentdemo__logo {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #5865f2, #eb459e);
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.45);
}
.kx-agentdemo__replay {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(235, 237, 245, 0.75);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.kx-agentdemo__replay:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.kx-agentdemo__replay:focus-visible { outline: 2px solid #8b93ff; outline-offset: 2px; }
.kx-agentdemo__body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.2rem 1.1rem 1.3rem;
    min-height: 330px;
}
.kx-agentdemo__bubble {
    max-width: 88%;
    padding: 0.7rem 0.95rem;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.5;
}
.kx-agentdemo__bubble--me {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: #fff;
    background: linear-gradient(135deg, #5865f2, #6f78ff);
}
.kx-agentdemo__bubble--bot {
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #eef0ff;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.kx-agentdemo__steps {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    display: grid;
    gap: 0.55rem;
}
.kx-agentdemo__steps li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(235, 237, 245, 0.82);
    font-size: 0.88rem;
}
.kx-agentdemo__steps b { color: #fff; font-weight: 700; }
.kx-agentdemo__ico {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.18);
}
/* Schritt läuft: drehender Ring */
.kx-agentdemo [data-step].is-running .kx-agentdemo__ico {
    border-color: rgba(139, 147, 255, 0.25);
    border-top-color: #8b93ff;
    animation: kx-agent-spin 0.8s linear infinite;
}
/* Schritt fertig: grüner Haken */
.kx-agentdemo [data-step].is-done .kx-agentdemo__ico {
    border-color: transparent;
    background: linear-gradient(135deg, #3ba55d, #2d8a4c);
}
.kx-agentdemo [data-step].is-done .kx-agentdemo__ico::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.kx-agentdemo [data-step].is-done { border-color: rgba(59, 165, 93, 0.28); background: rgba(59, 165, 93, 0.07); }
@keyframes kx-agent-spin { to { transform: rotate(360deg); } }

/* Ein-/Ausblenden der Schritte (nur mit JS; ohne JS bleibt alles sichtbar) */
.kx-agentdemo.is-animated [data-step] {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.3s ease, background 0.3s ease;
}
.kx-agentdemo.is-animated [data-step].is-shown { opacity: 1; transform: none; }

/* ---------- Häufige Fragen ---------- */
.kx-faq {
    max-width: 820px;
    margin: 0 auto;
    display: grid;
    gap: 0.7rem;
}
.kx-faq__item {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.kx-faq__item[open] { border-color: rgba(88, 101, 242, 0.45); background: rgba(88, 101, 242, 0.08); }
.kx-faq__item summary {
    position: relative;
    padding: 1rem 3rem 1rem 1.2rem;
    list-style: none;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.4;
}
.kx-faq__item summary::-webkit-details-marker { display: none; }
.kx-faq__item summary::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -6px;
    border: solid rgba(235, 237, 245, 0.6);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin 0.2s ease;
}
.kx-faq__item[open] summary::after { transform: rotate(-135deg); margin-top: -1px; }
.kx-faq__item summary:focus-visible { outline: 2px solid #8b93ff; outline-offset: -2px; border-radius: 14px; }
.kx-faq__item p {
    margin: 0;
    padding: 0 1.2rem 1.1rem;
    color: rgba(235, 237, 245, 0.72);
    line-height: 1.6;
    font-size: 0.93rem;
}

@media (max-width: 960px) {
    .kx-showcase--flip { grid-template-columns: 1fr; }
    .kx-showcase--flip > .kx-showcase__copy { order: 1; }
    .kx-showcase--flip > .kx-showcase__demo { order: 2; }
    .kx-discord--flip { transform: none; }
    .kx-agentdemo__body { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .kx-agentdemo [data-step].is-running .kx-agentdemo__ico { animation: none; }
    .kx-agentdemo.is-animated [data-step] { transition: none; }
    .kx-livecard > .kx-livecard__host { transition: none; }
}

/* ---------- Warum KynxBot statt selbst coden ---------- */
.kx-why {
    max-width: 1000px;
    margin: 0 auto;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(14, 16, 26, 0.6);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    overflow: hidden;
}
.kx-why__head,
.kx-why__row {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr) minmax(0, 1.15fr);
}
.kx-why__head > span {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 1rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.kx-why__h-diy { color: rgba(235, 237, 245, 0.5); }
.kx-why__h-kx {
    color: #fff;
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.32), rgba(88, 101, 242, 0.14));
    border-left: 1px solid rgba(88, 101, 242, 0.35);
}
.kx-why__h-kx img { border-radius: 6px; }
.kx-why__row > div {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.95rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.92rem;
    line-height: 1.5;
}
.kx-why__topic { color: #fff; font-weight: 700; }
.kx-why__topic i { width: 18px; margin-top: 3px; color: #8b93ff; text-align: center; }
.kx-why__diy { color: rgba(235, 237, 245, 0.55); }
.kx-why__diy i { margin-top: 4px; color: rgba(237, 66, 69, 0.75); font-size: 0.8rem; }
.kx-why__kx {
    color: #eef0ff;
    background: rgba(88, 101, 242, 0.08);
    border-left: 1px solid rgba(88, 101, 242, 0.25);
}
.kx-why__kx i {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    font-size: 0.6rem;
    color: #fff;
    background: linear-gradient(135deg, #3ba55d, #2d8a4c);
}
.kx-why__row:hover > div { background-color: rgba(255, 255, 255, 0.025); }
.kx-why__row:hover > .kx-why__kx { background-color: rgba(88, 101, 242, 0.13); }

.kx-why__api {
    max-width: 1000px;
    margin: 1.1rem auto 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-radius: 18px;
    border: 1px dashed rgba(139, 147, 255, 0.35);
    background: rgba(88, 101, 242, 0.06);
}
.kx-why__api-ico {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #c9cdfb;
    background: rgba(88, 101, 242, 0.2);
}
.kx-why__api-txt { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.kx-why__api-txt b { color: #fff; font-size: 1rem; }
.kx-why__api-txt span { color: rgba(235, 237, 245, 0.66); font-size: 0.9rem; line-height: 1.5; }
.kx-why__api-btns { display: flex; gap: 0.6rem; flex-shrink: 0; }

@media (max-width: 760px) {
    .kx-why__head { display: none; }
    .kx-why__row { grid-template-columns: 1fr; padding: 0.4rem 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
    .kx-why__row:first-of-type { border-top: 0; }
    .kx-why__row > div { border: 0; padding: 0.45rem 1rem; background: none; }
    .kx-why__kx { border-left: 0; border-radius: 10px; margin: 0 0.6rem 0.4rem; background: rgba(88, 101, 242, 0.1); }
    .kx-why__api { flex-direction: column; align-items: flex-start; }
    .kx-why__api-btns { flex-wrap: wrap; }
}
