/* --- Product mockups & interactive demos --- */

/* Scale-to-fit: inner screen is designed at a fixed size and scaled by demos.js */
.fit {
    position: relative;
    overflow: hidden;
}

.fit-inner {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
}

/* Devices */
.dv-laptop {
    position: relative;
}

.dv-lid {
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 14px 14px 4px 4px;
    padding: 2.2% 2.2% 3%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

.dv-laptop .fit {
    aspect-ratio: 16 / 10;
    border-radius: 3px;
    background: #fff;
}

.dv-base {
    height: 14px;
    width: 116%;
    margin-left: -8%;
    background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 60%, #0d0d0d 100%);
    border-radius: 2px 2px 14px 14px;
    position: relative;
}

.dv-base::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16%;
    height: 5px;
    background: #111;
    border-radius: 0 0 8px 8px;
}

/* The whole phone (frame + 390x844 screen) is drawn at 422x876 and scaled to fit */
.dv-phone {
    aspect-ratio: 422 / 876;
    filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6));
}

.ph-frame {
    width: 422px;
    height: 876px;
    background: #0c0c0c;
    border: 2px solid #3a3a3a;
    border-radius: 58px;
    padding: 14px;
    position: relative;
    box-shadow: inset 0 0 0 2px #000;
}

/* Camera dot in the bezel: a notch would cover the apps' own headers */
.ph-frame::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #1d1d1d;
    border-radius: 50%;
    z-index: 20;
}

.ph-frame > .app {
    width: 390px;
    height: 844px;
    border-radius: 44px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.ph-frame > .app > img,
.dv-laptop .fit-inner > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Mockup stage (case thumbnail) */
.mk-stage {
    position: relative;
    aspect-ratio: 16 / 11.5;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    isolation: isolate;
    border: 1px solid rgba(0, 196, 180, 0.18);
    box-shadow: 0 30px 80px rgba(0, 196, 180, 0.14), 0 20px 50px rgba(0, 0, 0, 0.5);
}

.mk-stage.vox {
    background:
        radial-gradient(circle at 30% 20%, rgba(35, 164, 173, 0.35) 0%, transparent 55%),
        radial-gradient(circle at 90% 90%, rgba(1, 196, 182, 0.25) 0%, transparent 50%),
        linear-gradient(160deg, #0E2653 0%, #071430 100%);
}

.mk-stage.aravoi {
    background:
        radial-gradient(circle at 70% 15%, rgba(0, 196, 180, 0.3) 0%, transparent 55%),
        radial-gradient(circle at 10% 95%, rgba(0, 196, 180, 0.15) 0%, transparent 50%),
        linear-gradient(160deg, #111 0%, #000 100%);
}

.mk-stage .dv-laptop {
    position: absolute;
    left: 3%;
    top: 11%;
    width: 77%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mk-stage .dv-phone {
    position: absolute;
    right: 3%;
    bottom: 4%;
    width: 30%;
    z-index: 2;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mk-stage:hover .dv-laptop {
    transform: translateY(-6px);
}

.mk-stage:hover .dv-phone {
    transform: translateY(-14px) rotate(-1.5deg);
}

.mk-stage .fit-inner {
    pointer-events: none;
}

/* T.I.O.: no prototype yet, the logo takes the mockup's place */
.mk-stage.tio {
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 45%, rgba(0, 196, 180, 0.28) 0%, transparent 55%),
        radial-gradient(circle at 85% 90%, rgba(0, 196, 180, 0.12) 0%, transparent 45%),
        linear-gradient(160deg, #101a1a 0%, #050808 100%);
}

.tio-logo {
    width: 46%;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(0, 196, 180, 0.35));
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mk-stage.tio:hover .tio-logo {
    transform: scale(1.04);
}

.mk-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--primary);
    color: #000;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    padding: 0.9rem 1.5rem 0.9rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 0 8px rgba(0, 196, 180, 0.18), 0 15px 35px rgba(0, 0, 0, 0.45);
    transition: var(--transition);
    white-space: nowrap;
}

.mk-play span.ring {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #000;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mk-stage:hover .mk-play {
    box-shadow: 0 0 0 14px rgba(0, 196, 180, 0.15), 0 15px 35px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -50%) scale(1.04);
}

.mk-caption {
    margin-top: 0.8rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.7;
}

/* ========== Demo modal ========== */
.dm {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.dm[hidden] {
    display: none;
}

.dm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dm-panel {
    position: relative;
    width: min(1100px, 100%);
    height: min(860px, 100%);
    background: #0a0a0a;
    border: 1px solid rgba(0, 196, 180, 0.25);
    border-radius: 24px;
    box-shadow: 0 0 80px rgba(0, 196, 180, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dm-head {
    position: relative;
    z-index: 11;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-head .t {
    flex: 1;
    min-width: 0;
}

.dm-head .t b {
    display: block;
    font-size: 1.1rem;
}

.dm-head .t small {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.dm-timer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

.dm-timer .bar {
    width: 90px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.dm-timer .bar i {
    display: block;
    height: 100%;
    background: var(--primary);
    width: 100%;
    transition: width 1s linear;
}

.dm-x {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.dm-x:hover {
    background: rgba(255, 255, 255, 0.14);
}

.dm-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(300px, 460px);
    justify-content: center;
    gap: 4rem;
    padding: 1.5rem 2rem;
}

.dm-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    max-width: 440px;
}

.dm-steps {
    list-style: none;
    display: grid;
    gap: 0.6rem;
}

.dm-steps li {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--text-dim);
    font-size: 0.98rem;
    opacity: 0.55;
    transition: var(--transition);
}

.dm-steps li span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.dm-steps li.on {
    color: #fff;
    opacity: 1;
}

.dm-steps li.on span {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    box-shadow: 0 0 15px var(--primary-glow);
}

.dm-steps li.done {
    opacity: 0.85;
}

.dm-steps li.done span {
    border-color: var(--primary);
    color: var(--primary);
}

.dm-note {
    background: rgba(0, 196, 180, 0.06);
    border: 1px solid rgba(0, 196, 180, 0.25);
    border-radius: 16px;
    padding: 1.3rem 1.4rem;
}

.dm-note small {
    display: block;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.dm-note p {
    font-size: 0.95rem;
    line-height: 1.55;
}

.dm-tip {
    color: var(--text-dim);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dm-tip i {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: dm-pulse 1.6s infinite;
}

.dm-stage {
    position: relative;
    min-height: 0;
    min-width: 0;
    container-type: size;
}

/* One device per tab; the real app runs in an iframe inside it */
.dm-device {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-device[hidden] {
    display: none;
}

.dm-device .app iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.dm-device.phone .dv-phone {
    height: 100%;
    max-height: 876px;
    width: auto;
}

.dm-device.laptop .dv-laptop {
    width: min(92cqw, (100cqh - 24px) * 1.48);
}

.dm-device .fit-inner .app {
    width: 1280px;
    height: 800px;
}

.dm-device .ph-frame > .app {
    width: 390px;
    height: 844px;
    overflow: hidden;
}

.dm-loading {
    position: absolute;
    color: var(--text-dim);
    font-size: 0.9rem;
    pointer-events: none;
    transition: opacity 0.3s;
}

.dm-device.ready .dm-loading {
    opacity: 0;
}

.dm-tabs {
    display: flex;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem;
    border-radius: 50px;
}

.dm-tabs button {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
}

.dm-tabs button.on {
    background: var(--primary);
    color: #000;
}

.dm-sub {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.dm-side .dm-steps li {
    align-items: flex-start;
    font-size: 0.92rem;
    line-height: 1.45;
}

.dm.is-laptop .dm-body {
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 2rem;
}

.dm-toast {
    position: absolute;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    z-index: 9;
    max-width: min(520px, calc(100% - 2rem));
    background: #1a1a1a;
    border: 1px solid rgba(0, 196, 180, 0.4);
    color: #fff;
    font-size: 0.9rem;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: dm-in 0.3s ease;
}

.dm-toast[hidden] {
    display: none;
}

/* End-of-demo CTA */
.dm-end {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at 50% 30%, rgba(0, 196, 180, 0.18) 0%, transparent 60%), rgba(5, 5, 5, 0.96);
    animation: dm-in 0.5s ease;
}

.dm-end[hidden] {
    display: none;
}

.dm-end-box {
    max-width: 620px;
    text-align: center;
}

.dm-end-box .ok {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 196, 180, 0.12);
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
}

.dm-end-box small {
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.dm-end-box h3 {
    font-size: 2.4rem;
    line-height: 1.15;
    margin: 0.8rem 0 1rem;
}

.dm-end-box p {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 2.2rem;
}

.dm-end-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.dm-end-actions button {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    cursor: pointer;
}

.dm-end-actions .btn-primary {
    border: none;
}

.dm-end-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.dm-end-links button {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.dm-end-links button:hover {
    color: #fff;
}

@keyframes dm-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes dm-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 196, 180, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 196, 180, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 196, 180, 0); }
}

body.dm-open {
    overflow: hidden;
}

/* Highlighted next action inside the demo */
.dm [data-hint] {
    animation: dm-pulse 1.6s infinite;
}

@media (max-width: 860px) {
    .dm {
        padding: 0;
    }
    .dm-panel {
        border-radius: 0;
        height: 100%;
        border: none;
    }
    .dm-body {
        grid-template-columns: 1fr;
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .dm-side {
        display: none;
    }
    .dm-timer .bar {
        width: 50px;
    }
    .dm-head {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    .dm-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    .dm.is-laptop .dm-body {
        grid-template-columns: 1fr;
    }
    .dm-end-box h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 968px) {
    .mk-play {
        font-size: 0.85rem;
        padding: 0.6rem 1.1rem 0.6rem 0.7rem;
    }
    .mk-play span.ring {
        width: 24px;
        height: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dm [data-hint],
    .dm-tip i {
        animation: none;
    }
}
