/* ===== Live Demo Section ===== */
.live-demo-card {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3rem;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--color-scheme--border-neutral);
    border-radius: 32px;
    padding: 3.25rem;
    overflow: hidden;
}

.live-demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--_primitives---colors--primary), rgba(254, 87, 41, 0.12));
}

.live-demo-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--_typography---font-styles--body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--_primitives---colors--primary);
    background: rgba(254, 87, 41, 0.07);
    border: 1px solid rgba(254, 87, 41, 0.16);
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    margin-bottom: 1.35rem;
}

.live-demo-pulse {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--_primitives---colors--primary);
    flex-shrink: 0;
}

.live-demo-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(254, 87, 41, 0.5);
    animation: liveDemoPulse 2s ease-out infinite;
}

@keyframes liveDemoPulse {
    0% {
        transform: scale(0.6);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.live-demo-title {
    font-family: var(--_typography---font-styles--heading);
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--color-scheme--text-title);
    margin: 0 0 1rem;
}

.live-demo-copy {
    font-family: var(--_typography---font-styles--body);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.65;
    color: var(--color-scheme--supporting-text);
    max-width: 46ch;
    margin: 0 0 1.75rem;
}

.live-demo-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.live-demo-points li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--_typography---font-styles--body);
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--color-scheme--text-title);
}

.live-demo-points li::before {
    content: '\2713';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(254, 87, 41, 0.1);
    color: var(--_primitives---colors--primary);
    font-size: 0.62rem;
    font-weight: 700;
    flex-shrink: 0;
}

.live-demo-panel {
    position: relative;
    background:
        radial-gradient(circle at 100% 0%, rgba(254, 87, 41, 0.18), transparent 45%),
        linear-gradient(145deg, #181818 0%, #0e0e0e 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 1.75rem;
    color: #ffffff;
    overflow: hidden;
}

.live-demo-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.5;
    pointer-events: none;
}

.live-demo-panel>* {
    position: relative;
    z-index: 1;
}

.live-demo-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.live-demo-dots {
    display: flex;
    gap: 6px;
}

.live-demo-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.live-demo-dots span:nth-child(1) {
    background: #ff5f57;
}

.live-demo-dots span:nth-child(2) {
    background: #febc2e;
}

.live-demo-dots span:nth-child(3) {
    background: #28c840;
}

.live-demo-panel-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--_typography---font-styles--body);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.live-demo-panel-label svg {
    width: 12px;
    height: 12px;
}

.live-demo-field {
    margin-bottom: 0.85rem;
}

.live-demo-field-label {
    display: block;
    font-family: var(--_typography---font-styles--body);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
    margin-bottom: 0.4rem;
}

.live-demo-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.55rem 0.55rem 0.55rem 0.9rem;
    min-height: 48px;
}

.live-demo-value code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.live-demo-copy-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.live-demo-copy-btn:hover {
    background: rgba(254, 87, 41, 0.2);
    border-color: rgba(254, 87, 41, 0.4);
    color: #ffffff;
}

.live-demo-copy-btn:focus-visible {
    outline: 2px solid var(--_primitives---colors--primary);
    outline-offset: 2px;
}

.live-demo-copy-btn svg {
    width: 15px;
    height: 15px;
}

.live-demo-copy-btn .icon-check {
    display: none;
}

.live-demo-copy-btn.is-copied {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.4);
    color: #4ade80;
    transform: scale(0.96);
}

.live-demo-copy-btn.is-copied .icon-copy {
    display: none;
}

.live-demo-copy-btn.is-copied .icon-check {
    display: block;
}

.live-demo-launch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 1.35rem;
    padding: 0.95rem 1.5rem;
    border: 1px solid var(--_primitives---colors--primary);
    border-radius: 12px;
    background: var(--_primitives---colors--primary);
    color: #ffffff;
    font-family: var(--_typography---font-styles--body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.live-demo-launch:hover {
    background: #d8411b;
    border-color: #d8411b;
    transform: translateY(-1px);
}

.live-demo-launch:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.live-demo-launch svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.live-demo-launch:hover svg {
    transform: translate(2px, -2px);
}

.live-demo-note {
    margin: 0.9rem 0 0;
    font-family: var(--_typography---font-styles--body);
    font-size: 0.7rem;
    line-height: 1.5;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 991px) {
    .live-demo-card {
        grid-template-columns: 1fr;
        gap: 2.25rem;
        padding: 2.5rem;
    }

    .live-demo-copy {
        max-width: none;
    }
}

@media (max-width: 767px) {
    .live-demo-card {
        padding: 1.75rem;
        border-radius: 24px;
    }

    .live-demo-title {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }

    .live-demo-panel {
        padding: 1.35rem;
        border-radius: 20px;
    }

    .live-demo-value code {
        font-size: 0.76rem;
    }
}

@media (max-width: 479px) {
    .live-demo-card {
        padding: 1.35rem;
    }

    .live-demo-points {
        flex-direction: column;
        align-items: flex-start;
    }

    .live-demo-panel-head {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-demo-pulse::after {
        animation: none;
    }

    .live-demo-copy-btn,
    .live-demo-launch,
    .live-demo-launch svg {
        transition: none;
    }
}

/* ===== Floating Live Demo Shortcut ===== */
#live-demo {
    scroll-margin-top: 7rem;
}

#live-demo:focus,
#live-demo-title:focus {
    outline: none;
}

.live-demo-fab {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: #ffffff;
    color: #131313;
    text-decoration: none;
    border: 1px solid rgba(19, 19, 19, 0.08);
    box-shadow: 0 10px 30px rgba(19, 19, 19, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.live-demo-fab:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 40px rgba(19, 19, 19, 0.22);
}

.live-demo-fab:focus-visible {
    outline: 3px solid var(--_primitives---colors--primary);
    outline-offset: 4px;
}

.live-demo-fab.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(0.88);
    pointer-events: none;
}

.live-demo-fab-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(254, 87, 41, 0.45);
    animation: liveDemoFabPulse 2.4s ease-out infinite;
    pointer-events: none;
}

.live-demo-fab-ring {
    position: absolute;
    inset: 9px;
    width: calc(100% - 18px);
    height: calc(100% - 18px);
    transform-origin: 50% 50%;
    animation: liveDemoFabSpin 16s linear infinite;
}

.live-demo-fab-ring text {
    fill: #131313;
    font-family: var(--_typography---font-styles--body);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2.8px;
}

.live-demo-fab-core {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--_primitives---colors--primary);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(254, 87, 41, 0.35);
}

.live-demo-fab-core svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

@keyframes liveDemoFabSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes liveDemoFabPulse {
    0% {
        transform: scale(0.92);
        opacity: 0.7;
    }

    70%,
    100% {
        transform: scale(1.16);
        opacity: 0;
    }
}

@media (max-width: 767px) {
    #live-demo {
        scroll-margin-top: 6.5rem;
    }

    .live-demo-fab {
        left: 1rem;
        bottom: 1rem;
        width: 84px;
        height: 84px;
    }

    .live-demo-fab-ring {
        inset: 8px;
        width: calc(100% - 16px);
        height: calc(100% - 16px);
    }

    .live-demo-fab-ring text {
        font-size: 7.2px;
        letter-spacing: 2.2px;
    }

    .live-demo-fab-core {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-demo-fab,
    .live-demo-fab-ring,
    .live-demo-fab-pulse {
        animation: none;
        transition: none;
    }
}
