/* ============================================================
   VIDEO PLAYER SYSTEM — live capture frames
   Portrait footage inside .mp phone frames, landscape footage
   inside .bm browser frames. Signal-acquisition load-in,
   chip tab switcher, audio toggle for the subtitle demo.
   ============================================================ */

/* ========== WRAP BASE ========== */
.vp-wrap { position: relative; overflow: hidden; background: #0E100F; }
.vp-wrap video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vp-portrait { aspect-ratio: 9 / 18; }
.vp-portrait video { object-position: 50% 12%; }
.vp-land { aspect-ratio: 2320 / 1440; }

/* Portrait phone frame carrying real footage */
.vp-mp .mp-screen { min-height: 0; padding: 6px; }
.vp-mp .vp-wrap { flex: 1; border-radius: 0 0 6px 6px; }
.pcard .vp-mp { width: clamp(140px, 68%, 190px); }

/* Equalize the a11y CSS-demo phone (UNIT 06) with the video phones:
   same footprint, screen height locked to the same 9/18 proportion */
.sec-products .pcard .mp-sm { width: clamp(140px, 68%, 190px); }
.sec-products .pcard .mp-sm .mp-screen { min-height: 0; aspect-ratio: 9 / 18; }

/* Products strip must fit inside one fullpage viewport (~900px):
   compact spacing for this section only */
.sec-products.sec { padding-bottom: 56px; }
.sec-products.sec[data-band] { padding-top: 104px; }
.sec-products .sec-head { margin-bottom: 20px; }
.sec-products .sec-head .btn { margin-top: 10px; }
.sec-products .pcard-media { padding: 10px 12px 8px; }
.sec-products .pcard-info { padding: 9px 14px 10px; }
.feature-demo .vp-mp { width: min(300px, 30vh); }
.feature-demo .vp-mp .mp-screen { min-height: 0; }

/* REC chip on portrait app bars */
.vp-mp .mp-app-bar { position: relative; }
.vp-mp .mp-app-bar::after {
    content: '\25CF REC';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.42rem;
    letter-spacing: 0.08em;
    color: var(--screen-accent);
    animation: vpBlink 1.6s steps(2, jump-none) infinite;
}

/* ========== LANDSCAPE BROWSER FRAME ========== */
.bm-video { position: relative; width: 100%; transition: transform var(--transition), box-shadow var(--transition); }
.bm-video:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 rgba(19, 19, 18, 0.18); }
.bm-video .bm-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    color: var(--color-accent-pale);
}
.bm-video .bm-live::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-accent-pale);
    animation: vpBlink 1.6s steps(2, jump-none) infinite;
}
/* corner rivets (diagonal pair) */
.bm-video::before,
.bm-video::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border: 1px solid var(--color-border-hover);
    background: var(--color-bg);
    z-index: 2;
}
.bm-video::before { top: -3px; left: -3px; }
.bm-video::after { bottom: -3px; right: -3px; }

/* ========== SIGNAL-ACQUISITION LOAD-IN (injected by video-player.js) ========== */
.vp-signal {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        linear-gradient(rgba(242, 241, 234, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(242, 241, 234, 0.045) 1px, transparent 1px),
        #0E100F;
    background-size: 24px 24px, 24px 24px, auto;
    opacity: 1;
}
.vp-signal::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(242, 241, 234, 0.06) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(242, 241, 234, 0.03) 0 2px, transparent 2px 5px);
    animation: vpNoise 0.5s steps(3, jump-none) infinite;
}
.vp-signal::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -18%;
    height: 18%;
    background: linear-gradient(180deg, transparent, rgba(var(--screen-accent-rgb), 0.22));
    animation: vpScan 1.8s linear infinite;
}
.vp-sig-label {
    position: absolute;
    left: 10px;
    bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(242, 241, 234, 0.6);
    animation: vpBlink 1.2s steps(2, jump-none) infinite;
}
.vp-sig-label .vp-sig-lock { display: none; color: var(--screen-accent-light); }
.vp-locked .vp-sig-label { animation: none; }
.vp-locked .vp-sig-label .vp-sig-acq { display: none; }
.vp-locked .vp-sig-label .vp-sig-lock { display: inline; }
.vp-locked .vp-signal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease 0.35s, visibility 0s linear 0.8s;
}

@keyframes vpNoise {
    0% { opacity: 0.9; transform: translateY(0); }
    50% { opacity: 0.5; transform: translateY(1px); }
    100% { opacity: 0.75; transform: translateY(-1px); }
}
@keyframes vpScan {
    from { transform: translateY(0); }
    to { transform: translateY(680%); }
}
@keyframes vpBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* ========== AUDIO TOGGLE (injected on [data-vp-audio] wraps) ========== */
.vp-audio-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--block-black);
    color: var(--on-black);
    border: 1px solid var(--on-black-border);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.vp-audio-btn:hover { background: var(--color-accent); color: var(--on-accent); }
.vp-audio-btn.on { background: var(--color-accent); color: var(--on-accent); }
.vp-audio-btn svg { flex-shrink: 0; }

/* ========== TAB SWITCHER ========== */
.vp-frame { position: relative; }
.vp-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.vp-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-mid);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}
.vp-tab::before { content: '\25B8'; color: var(--color-text-dim); transition: var(--transition); }
.vp-tab:hover { border-color: var(--color-border-hover); color: var(--color-text); }
.vp-tab.active { background: var(--color-accent); border-color: var(--color-accent); color: var(--on-accent); }
.vp-tab.active::before { content: '\25BE'; color: var(--on-accent); }
.vp-pane { display: none; }
.vp-pane.active { display: block; }

/* ========== NEW INDEX SECTION: WEB WORKBENCH ========== */
.web-layout {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 48px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.web-layout .ext-features { max-width: none; }

/* ========== PRODUCTS PAGE: WIDE (LANDSCAPE) FEATURE ROW ========== */
.feature-row.wide {
    grid-template-columns: 1fr;
    gap: 26px;
    max-width: min(820px, 88vh);
    margin: 0 auto;
}
.feature-row.wide .feature-text h2 { margin-bottom: 10px; }
.feature-row.wide .feature-text p { margin-bottom: 12px; }
.feature-row.wide .feature-text { text-align: center; }
.feature-row.wide .feature-list { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 8px 26px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .web-layout { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
    .pcard .vp-mp, .sec-products .pcard .mp-sm { width: min(160px, 100%); }
    .feature-demo .vp-mp { width: 200px; }
    .vp-tabs { gap: 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .vp-tabs::-webkit-scrollbar { display: none; }
    .vp-tab { padding: 6px 10px; font-size: 0.6rem; flex-shrink: 0; }
    .feature-row.wide .feature-list { flex-direction: column; align-items: center; gap: 8px; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .vp-signal, .vp-signal::before, .vp-signal::after { animation: none !important; }
    .vp-signal { display: none; }
    .vp-mp .mp-app-bar::after, .bm-video .bm-live::before { animation: none !important; }
}
