/* ==========================================================================
   Product pages (Nexus, Nexus Mobile, Sidi, the Console) — 2026-11
   Shared motion, chart and device-frame primitives for the Platform pages.
   Layout comes from marketing-console.css (.mc-*), the live product-page
   system; this file adds only what those pages need beyond it.
   Everything is scoped under .pp so nothing leaks onto other pages.
   Light-theme re-binds for the --pp-* accents live in design-system.css
   (§PRODUCT PAGES 2026-11), per light-theme-spec §5.2.
   ========================================================================== */

.pp {
    --pp-cyan: var(--color-accent-cyan);
    --pp-violet: #a78bfa;
    --pp-green: #4ade80;
    --pp-amber: #fbbf24;
    --pp-rose: #f472b6;
    --pp-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reveal on scroll (only once the script has run) ---------- */
.pp.pp-js .pp-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s var(--pp-ease), transform .7s var(--pp-ease);
}
.pp.pp-js .pp-reveal.is-in { opacity: 1; transform: none; }
.pp.pp-js .pp-reveal[data-pp-delay="1"] { transition-delay: .08s; }
.pp.pp-js .pp-reveal[data-pp-delay="2"] { transition-delay: .16s; }
.pp.pp-js .pp-reveal[data-pp-delay="3"] { transition-delay: .24s; }

/* ---------- Charts ---------- */
/* Line / area chart: <svg class="pp-chart"><path class="pp-draw" pathLength="1" …/> */
.pp-chart { display: block; width: 100%; height: auto; overflow: visible; }
.pp-chart .pp-grid { stroke: var(--color-border); stroke-width: 1; }
.pp-chart .pp-axis { fill: var(--color-text-tertiary); font: 500 10px/1 var(--font-mono, ui-monospace, monospace); }
.pp-chart .pp-draw {
    fill: none;
    stroke: var(--pp-line, var(--pp-cyan));
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}
.pp-chart .pp-area { fill: var(--pp-line, var(--pp-cyan)); opacity: .12; }
.pp.pp-js .pp-anim .pp-draw { stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--pp-ease); }
.pp.pp-js .pp-anim.is-in .pp-draw { stroke-dashoffset: 0; }
.pp.pp-js .pp-anim .pp-area { opacity: 0; transition: opacity 1s ease .9s; }
.pp.pp-js .pp-anim.is-in .pp-area { opacity: .12; }
.pp-chart .pp-dot { fill: var(--pp-line, var(--pp-cyan)); }

/* Bars: <div class="pp-bars pp-anim"><span style="--h:40%"></span>… */
.pp-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 72px;
}
.pp-bars > span {
    flex: 1;
    height: var(--h, 50%);
    border-radius: 3px 3px 0 0;
    background: linear-gradient(to top, color-mix(in srgb, var(--pp-bar, var(--pp-cyan)) 35%, transparent), var(--pp-bar, var(--pp-cyan)));
    transform-origin: bottom;
}
.pp.pp-js .pp-bars.pp-anim > span { transform: scaleY(0); transition: transform .9s var(--pp-ease); }
.pp.pp-js .pp-bars.pp-anim.is-in > span { transform: scaleY(1); }
.pp.pp-js .pp-bars.pp-anim > span:nth-child(2n) { transition-delay: .06s; }
.pp.pp-js .pp-bars.pp-anim > span:nth-child(3n) { transition-delay: .12s; }

/* Donut / ring: <svg class="pp-ring" viewBox="0 0 36 36"><circle class="pp-ring__track"…/><circle class="pp-ring__value" pathLength="100" style="--v:72"…/> */
.pp-ring { width: 100%; height: auto; transform: rotate(-90deg); }
.pp-ring circle { fill: none; stroke-width: 3.2; }
.pp-ring__track { stroke: var(--color-surface-3); }
.pp-ring__value {
    stroke: var(--pp-line, var(--pp-cyan));
    stroke-linecap: round;
    stroke-dasharray: var(--v, 50) 100;
}
.pp.pp-js .pp-anim .pp-ring__value { stroke-dasharray: 0 100; transition: stroke-dasharray 1.4s var(--pp-ease); }
.pp.pp-js .pp-anim.is-in .pp-ring__value { stroke-dasharray: var(--v, 50) 100; }

/* Progress meter: <div class="pp-meter pp-anim" style="--v:64%"><span></span></div> */
.pp-meter { height: 6px; border-radius: 99px; background: var(--color-surface-3); overflow: hidden; }
.pp-meter > span { display: block; height: 100%; width: var(--v, 50%); border-radius: inherit; background: var(--pp-line, var(--pp-cyan)); }
.pp.pp-js .pp-meter.pp-anim > span { width: 0; transition: width 1.2s var(--pp-ease); }
.pp.pp-js .pp-meter.pp-anim.is-in > span { width: var(--v, 50%); }

/* ---------- Live signals ---------- */
.pp-live {
    position: relative;
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--pp-line, var(--pp-green));
    flex: none;
}
.pp-live::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: pp-ping 2s ease-out infinite;
}
@keyframes pp-ping { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.8); opacity: 0; } }

/* Voice waveform: <div class="pp-wave"><span></span>×n</div> */
.pp-wave { display: flex; align-items: center; gap: 3px; height: 28px; }
.pp-wave > span {
    width: 3px; height: 100%;
    border-radius: 2px;
    background: var(--pp-line, var(--pp-cyan));
    animation: pp-wave 1.1s ease-in-out infinite;
    transform-origin: center;
}
.pp-wave > span:nth-child(2n) { animation-delay: -.3s; }
.pp-wave > span:nth-child(3n) { animation-delay: -.6s; }
.pp-wave > span:nth-child(5n) { animation-delay: -.85s; }
@keyframes pp-wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* Typing: <span data-pp-type="text…"></span> gets a caret while typing. */
.pp-caret::after {
    content: "";
    display: inline-block;
    width: 2px; height: 1em;
    margin-left: 2px;
    vertical-align: -0.15em;
    background: currentColor;
    animation: pp-blink 1s steps(1) infinite;
}
@keyframes pp-blink { 50% { opacity: 0; } }

/* Rotating set: [data-pp-cycle] children take .is-active in turn. */
.pp [data-pp-cycle] > * { transition: background-color .4s ease, border-color .4s ease, opacity .4s ease; }

.pp-float { animation: pp-float 6s ease-in-out infinite; }
@keyframes pp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Device frames ---------- */
/* Phone: <div class="pp-phone"><div class="pp-phone__screen">…</div></div> */
.pp-phone {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 9 / 19.5;
    margin-inline: auto;
    padding: 10px;
    border-radius: 44px;
    background: linear-gradient(160deg, var(--color-surface-4), var(--color-surface-2));
    border: 1px solid var(--color-border);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .55);
}
.pp-phone::before { /* camera island */
    content: "";
    position: absolute;
    top: 20px; left: 50%;
    width: 30%; height: 22px;
    transform: translateX(-50%);
    border-radius: 99px;
    background: #000;
    z-index: 2;
}
.pp-phone__screen {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 34px;
    background: var(--pp-screen, #05070b);
    color: #e8edf4;
    font-size: 12px;
}

/* Desktop window frame for app (not browser) screenshots. */
.pp-window {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: var(--pp-screen, #05070b);
    color: #e8edf4;
    box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .6);
}
.pp-window__bar {
    display: flex; align-items: center; gap: 6px;
    height: 34px; padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    font: 500 11px/1 var(--font-mono, ui-monospace, monospace);
    color: rgba(232, 237, 244, .5);
}
.pp-window__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.pp-window__title { margin-left: 8px; }

/* App screenshots stay in the app's own (dark) palette in both site themes:
   the products are dark-first, so the frame is the honest picture. */

/* ---------- Motion off ---------- */
@media (prefers-reduced-motion: reduce) {
    .pp *, .pp *::before, .pp *::after { animation: none !important; transition: none !important; }
    .pp.pp-js .pp-reveal { opacity: 1; transform: none; }
    .pp.pp-js .pp-anim .pp-draw { stroke-dashoffset: 0; }
    .pp.pp-js .pp-anim .pp-area { opacity: .12; }
    .pp.pp-js .pp-bars.pp-anim > span { transform: none; }
    .pp.pp-js .pp-anim .pp-ring__value { stroke-dasharray: var(--v, 50) 100; }
    .pp.pp-js .pp-meter.pp-anim > span { width: var(--v, 50%); }
}
