/* ============================================================
   Profile Intro — cinematic landing (dedicated night-studio palette)
   Palette is intentionally independent from the profile persona theme.
   ============================================================ */
:root {
    --piv-brand: #7c5cff;
    --piv-brand2: #3d8bfd;
    --piv-user: #a78bfa;
    --piv-bg: #07060f;
    --piv-ink: #f4f0ff;
    --piv-muted: #9b93b8;
    --piv-cream: #efe8ff;
    --piv-amber: #f0b429;
    --piv-gold: #e8c07a;
    --piv-rose: #ff6b9d;
    --piv-teal: #2dd4bf;
    --piv-card: color-mix(in srgb, #1a1630 72%, transparent);
    --piv-card-solid: #14102a;
    --piv-border: color-mix(in srgb, #a78bfa 22%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }

.piv-body, .piv-cinematic {
    margin: 0;
    min-height: 100dvh;
    width: 100%;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    background: var(--piv-bg);
    color: var(--piv-ink);
    overflow-x: hidden;
    position: relative;
}

/* ── Living fullscreen FX ── */
.piv-fx {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
}
.piv-fx-grad {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% -5%, color-mix(in srgb, var(--piv-brand) 38%, transparent), transparent 58%),
        radial-gradient(ellipse 45% 40% at 100% 70%, color-mix(in srgb, var(--piv-rose) 22%, transparent), transparent 55%),
        radial-gradient(ellipse 40% 35% at 0% 55%, color-mix(in srgb, var(--piv-teal) 16%, transparent), transparent 50%),
        radial-gradient(ellipse 50% 30% at 70% 100%, color-mix(in srgb, var(--piv-amber) 14%, transparent), transparent 50%),
        linear-gradient(160deg, #0c0a1a 0%, var(--piv-bg) 42%, #0a0814 100%);
    animation: pivBgPulse 10s ease-in-out infinite alternate;
}
@keyframes pivBgPulse {
    from { filter: hue-rotate(0deg) brightness(1) saturate(1); }
    to { filter: hue-rotate(18deg) brightness(1.08) saturate(1.15); }
}
.piv-fx-wave {
    position: absolute; inset: auto 0 -15% 0; height: 42%;
    background: radial-gradient(ellipse 110% 90% at 50% 100%, color-mix(in srgb, var(--piv-brand) 20%, transparent), transparent 70%);
    animation: pivWave 7s ease-in-out infinite alternate;
}
@keyframes pivWave {
    from { transform: translateY(0) scaleX(1); opacity: .65; }
    to { transform: translateY(-22px) scaleX(1.08); opacity: 1; }
}
.piv-fx-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(color-mix(in srgb, var(--piv-user) 7%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--piv-user) 7%, transparent) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
    animation: pivGridDrift 28s linear infinite;
    opacity: .55;
}
@keyframes pivGridDrift { to { background-position: 64px 64px; } }
.piv-fx-beam {
    position: absolute; top: -20%; left: 50%; width: 2px; height: 140%;
    background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--piv-cream) 35%, transparent), transparent);
    transform: translateX(-50%) rotate(18deg);
    animation: pivBeam 6s ease-in-out infinite alternate;
    opacity: .35;
}
.piv-fx-beam-2 { transform: translateX(-50%) rotate(-22deg); animation-delay: -2s; opacity: .22; }
@keyframes pivBeam {
    from { opacity: .15; filter: blur(0); }
    to { opacity: .45; filter: blur(1px); }
}
.piv-fx-dust span {
    position: absolute; width: 3px; height: 3px; border-radius: 50%;
    background: var(--piv-cream); opacity: .28;
    animation: pivDust linear infinite;
}
.piv-fx-dust span:nth-child(odd) { background: var(--piv-user); }
.piv-fx-dust span:nth-child(3n) { background: var(--piv-amber); width: 2px; height: 2px; }
.piv-fx-dust span:nth-child(5n) { background: var(--piv-teal); width: 4px; height: 4px; }
@keyframes pivDust {
    0% { transform: translateY(100vh) scale(0) rotate(0); opacity: 0; }
    12% { opacity: .5; }
    100% { transform: translateY(-12vh) scale(1) rotate(180deg); opacity: 0; }
}
.piv-fx-orb {
    position: absolute; border-radius: 50%; filter: blur(40px);
    animation: pivOrbFloat 9s ease-in-out infinite alternate;
}
.piv-fx-orb-a {
    width: 180px; height: 180px; top: 12%; right: 8%;
    background: color-mix(in srgb, var(--piv-brand) 45%, transparent);
}
.piv-fx-orb-b {
    width: 140px; height: 140px; bottom: 18%; left: 6%;
    background: color-mix(in srgb, var(--piv-rose) 35%, transparent);
    animation-delay: -3s;
}
@keyframes pivOrbFloat {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-24px, 30px) scale(1.2); }
}

.piv-app {
    position: relative; z-index: 1;
    min-height: 100dvh; width: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

.piv-stage-wrap {
    width: 100%; height: 100dvh; max-height: 100dvh;
    position: relative; overflow: hidden;
}
.piv-stage { position: absolute; inset: 0; overflow: hidden; background: transparent; }

.piv-scene {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: clamp(20px, 4vw, 56px) clamp(16px, 4vw, 48px) 110px;
    opacity: 0;
    transform: scale(1.06) translateY(28px);
    filter: blur(14px);
    transition:
        opacity .85s cubic-bezier(.4,0,.2,1),
        transform .85s cubic-bezier(.4,0,.2,1),
        filter .85s ease;
    pointer-events: none;
}
.piv-scene.is-active {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    pointer-events: auto;
}

.piv-scene-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.piv-blob {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45;
    animation: pivDrift 11s ease-in-out infinite alternate;
}
.piv-blob-1 { width: 55%; height: 48%; top: -18%; right: -12%; background: var(--piv-brand); }
.piv-blob-2 { width: 42%; height: 36%; bottom: -12%; left: -10%; background: var(--piv-rose); opacity: .28; animation-delay: -4s; }
.piv-blob-3 { width: 28%; height: 22%; top: 42%; left: 38%; background: var(--piv-teal); opacity: .12; animation-delay: -7s; }
.piv-ring {
    position: absolute; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--piv-user) 30%, transparent);
    animation: pivRingPulse 5s ease-in-out infinite;
}
.piv-ring-1 { width: min(70vw, 520px); height: min(70vw, 520px); top: 50%; left: 50%; margin: -260px 0 0 -260px; }
.piv-ring-2 { width: min(50vw, 360px); height: min(50vw, 360px); top: 50%; left: 50%; margin: -180px 0 0 -180px; animation-delay: -1.5s; border-color: color-mix(in srgb, var(--piv-amber) 25%, transparent); }
@keyframes pivRingPulse {
    0%, 100% { transform: scale(1); opacity: .35; }
    50% { transform: scale(1.08); opacity: .7; }
}
@keyframes pivDrift {
    from { transform: translate(0,0) scale(1); }
    to { transform: translate(28px,-30px) scale(1.16); }
}

.piv-scene-content {
    position: relative; z-index: 1;
    width: min(960px, 100%);
    text-align: center;
}

.piv-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .7rem; font-weight: 800; letter-spacing: .1em;
    color: var(--piv-amber); margin-bottom: 12px;
    padding: 6px 14px; border-radius: 999px;
    background: color-mix(in srgb, var(--piv-amber) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--piv-amber) 28%, transparent);
    opacity: 0; transform: translateY(12px) scale(.92);
}
.piv-scene.is-active .piv-kicker {
    animation: pivRise .55s .08s ease forwards;
}
.piv-kicker::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--piv-amber); box-shadow: 0 0 10px var(--piv-amber);
    animation: pivBlinkDot 1.2s ease infinite;
}
@keyframes pivBlinkDot { 50% { opacity: .35; transform: scale(.7); } }
@keyframes pivRise { to { opacity: 1; transform: translateY(0) scale(1); } }

.piv-title {
    font-size: clamp(1.15rem, 2.8vw, 1.55rem);
    font-weight: 900; margin-bottom: 16px; letter-spacing: -.02em;
    opacity: 0; transform: translateY(18px) scale(.96);
}
.piv-scene.is-active .piv-title {
    animation: pivTitlePop .7s .14s cubic-bezier(.22,1.35,.36,1) forwards;
}
@keyframes pivTitlePop {
    0% { opacity: 0; transform: translateY(22px) scale(.92); filter: blur(6px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.piv-glass {
    background: var(--piv-card);
    border: 1px solid var(--piv-border);
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    border-radius: 24px;
    box-shadow:
        0 24px 70px rgba(0,0,0,.45),
        inset 0 1px 0 color-mix(in srgb, var(--piv-cream) 14%, transparent),
        0 0 0 1px color-mix(in srgb, var(--piv-brand) 8%, transparent);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s;
}
.piv-glass:hover {
    transform: translateY(-4px);
    box-shadow:
        0 30px 80px rgba(0,0,0,.5),
        0 0 48px color-mix(in srgb, var(--piv-brand) 22%, transparent);
    border-color: color-mix(in srgb, var(--piv-user) 45%, var(--piv-border));
}

/* ════════════ OPENING HERO (slide 1) ════════════ */
.piv-open {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: clamp(18px, 3vw, 36px);
    align-items: start;
    text-align: right;
    padding: clamp(18px, 3vw, 32px);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}
.piv-open::before {
    content: "";
    position: absolute; inset: -40% auto auto -20%;
    width: 55%; height: 80%;
    background: radial-gradient(circle, color-mix(in srgb, var(--piv-brand) 30%, transparent), transparent 70%);
    pointer-events: none; animation: pivDrift 8s ease-in-out infinite alternate;
}
@media (max-width: 720px) {
    .piv-open { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

.piv-open-photo { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.piv-open-halo {
    position: absolute; inset: -10px; border-radius: 50%;
    background: conic-gradient(from 0deg, var(--piv-brand), var(--piv-rose), var(--piv-amber), var(--piv-teal), var(--piv-brand));
    animation: pivSpin 8s linear infinite;
    filter: blur(0); opacity: .85;
}
.piv-open-halo::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--piv-bg);
}
@keyframes pivSpin { to { transform: rotate(360deg); } }
.piv-open-avatar {
    position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px);
    border-radius: 50%; object-fit: cover; z-index: 2;
    border: 3px solid color-mix(in srgb, var(--piv-cream) 80%, transparent);
    box-shadow:
        0 0 40px color-mix(in srgb, var(--piv-brand) 55%, transparent),
        0 18px 40px rgba(0,0,0,.55);
    animation: pivAvatarPop 1s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes pivAvatarPop {
    from { transform: scale(0) rotate(-18deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}
.piv-open-emoji {
    position: absolute; bottom: 6px; left: 6px; z-index: 3;
    font-size: 1.5rem; width: 40px; height: 40px;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--piv-card-solid); border: 2px solid var(--piv-border);
    animation: pivBounce 1.8s ease infinite;
}
@keyframes pivBounce { 50% { transform: translateY(-8px); } }

.piv-open-body { position: relative; z-index: 1; min-width: 0; }
.piv-open-name {
    font-size: clamp(1.45rem, 3.6vw, 2.1rem); font-weight: 900; margin: 0;
    background: linear-gradient(120deg, var(--piv-cream), var(--piv-user), var(--piv-amber));
    background-size: 200% 100%;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    animation: pivShimmer 5s linear infinite, pivRise .55s .15s ease both;
}
@keyframes pivShimmer { to { background-position: 200% 50%; } }
.piv-open-handle {
    font-size: .95rem; color: var(--piv-user); direction: ltr;
    margin-top: 6px; font-weight: 700;
    opacity: 0; animation: pivRise .5s .28s ease forwards;
}

.piv-open-url {
    direction: ltr; text-align: left; margin-top: 14px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 14px; max-width: 100%;
    background: color-mix(in srgb, #000 35%, var(--piv-card-solid));
    border: 1px solid var(--piv-border);
    font-size: clamp(.72rem, 1.8vw, .9rem); font-weight: 700; color: var(--piv-cream);
    opacity: 0; animation: pivRise .5s .4s ease forwards;
    overflow: hidden;
}
.piv-open-url-ico {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: grid; place-items: center; font-size: .75rem;
    background: color-mix(in srgb, var(--piv-brand) 30%, transparent);
}
.piv-typed { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piv-cursor { color: var(--piv-amber); animation: pivBlink .7s step-end infinite; }
@keyframes pivBlink { 50% { opacity: 0; } }

.piv-open-bio {
    margin-top: 14px; font-size: clamp(.82rem, 1.9vw, .95rem);
    line-height: 1.9; color: color-mix(in srgb, var(--piv-ink) 88%, transparent);
    opacity: 0; animation: pivRise .55s .52s ease forwards;
    max-width: 52ch;
}
@media (max-width: 720px) { .piv-open-bio { max-width: none; } }

.piv-open-social {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
    justify-content: flex-start;
}
@media (max-width: 720px) { .piv-open-social { justify-content: center; } }
.piv-soc-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--piv-brand) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--piv-user) 32%, transparent);
    font-size: .72rem; font-weight: 700; color: var(--piv-ink);
    text-decoration: none;
    opacity: 0; transform: translateY(12px) scale(.9);
    transition: transform .25s, background .25s, box-shadow .25s;
}
.piv-scene.is-active .piv-soc-chip {
    animation: pivChipIn .5s cubic-bezier(.34,1.4,.64,1) forwards;
}
.piv-soc-chip:hover {
    transform: translateY(-3px) scale(1.04);
    background: color-mix(in srgb, var(--piv-brand) 28%, transparent);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--piv-brand) 35%, transparent);
    color: #fff;
}
.piv-soc-chip .ico { font-size: .95rem; }
@keyframes pivChipIn { to { opacity: 1; transform: translateY(0) scale(1); } }

.piv-open-qr {
    position: absolute; top: 18px; left: 18px;
    width: 72px; height: 72px; border-radius: 12px;
    background: #fff; padding: 5px; object-fit: contain;
    box-shadow: 0 10px 28px rgba(0,0,0,.4);
    opacity: 0;
}
.piv-scene.is-active .piv-open-qr {
    animation: pivRise .5s .55s ease forwards;
}
@media (max-width: 720px) {
    .piv-open-qr { position: static; margin: 14px auto 0; display: block; }
}

/* floating glyphs around hero */
.piv-glyph {
    position: absolute; font-size: 1.1rem; opacity: .35; pointer-events: none;
    animation: pivGlyphFloat 5s ease-in-out infinite;
}
.piv-glyph-1 { top: 8%; right: 6%; animation-delay: 0s; color: var(--piv-amber); }
.piv-glyph-2 { bottom: 16%; right: 10%; animation-delay: -1s; color: var(--piv-teal); font-size: 1.4rem; }
.piv-glyph-3 { top: 20%; left: 4%; animation-delay: -2s; color: var(--piv-rose); }
.piv-glyph-4 { bottom: 22%; left: 8%; animation-delay: -3s; color: var(--piv-user); }
@keyframes pivGlyphFloat {
    0%, 100% { transform: translateY(0) rotate(0); opacity: .3; }
    50% { transform: translateY(-14px) rotate(8deg); opacity: .7; }
}

/* ── Activity footprint trail ── */
.piv-trail {
    position: relative;
    max-width: 940px;
    margin: 8px auto 0;
    padding: 12px 6px 8px;
}
.piv-trail-glow {
    position: absolute; inset: 8% 5% auto;
    height: 55%; border-radius: 50%;
    background: radial-gradient(ellipse, color-mix(in srgb, var(--piv-brand) 28%, transparent), transparent 70%);
    filter: blur(28px); pointer-events: none; opacity: .7;
}
.piv-trail-path {
    display: block;
    width: 100%;
    height: clamp(40px, 9vw, 64px);
    margin-bottom: -10px;
    opacity: 0;
    overflow: visible;
}
.piv-scene.is-active .piv-trail-path {
    animation: pivRise .5s .1s ease forwards;
}
.piv-scene.is-active .piv-trail-path path {
    stroke-dasharray: 140;
    stroke-dashoffset: 140;
    animation: pivTrailDraw 1.6s .2s ease forwards;
}
@keyframes pivTrailDraw {
    to { stroke-dashoffset: 0; }
}
.piv-trail-nodes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 18px 12px;
    align-items: start;
    position: relative;
    z-index: 1;
}
.piv-trail-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(48px) scale(.4);
    filter: blur(10px);
}
.piv-trail-node.piv-trail-l { transform: translate(-10px, 52px) scale(.4) rotate(-18deg); }
.piv-trail-node.piv-trail-r { transform: translate(10px, 52px) scale(.4) rotate(18deg); }
.piv-scene.is-active .piv-trail-node {
    animation: pivStampIn .95s cubic-bezier(.18,1.45,.32,1) forwards;
    animation-delay: calc(.2s + var(--piv-i, 0) * .13s);
}
@keyframes pivStampIn {
    0% { opacity: 0; filter: blur(12px); transform: translateY(56px) scale(.25) rotate(-22deg); }
    45% { opacity: 1; filter: blur(0); transform: translateY(-10px) scale(1.18) rotate(8deg); }
    70% { transform: translateY(4px) scale(.96) rotate(-3deg); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1) rotate(0); }
}
.piv-trail-print {
    width: 28px; height: 38px;
    color: color-mix(in srgb, var(--piv-amber) 70%, #fff);
    opacity: 0;
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--piv-amber) 45%, transparent));
}
.piv-trail-l .piv-trail-print { transform: scaleX(-1) rotate(-28deg); margin-inline-end: 22px; }
.piv-trail-r .piv-trail-print { transform: rotate(28deg); margin-inline-start: 22px; }
.piv-scene.is-active .piv-trail-print {
    animation: pivPrintDrop .7s calc(.12s + var(--piv-i, 0) * .13s) ease forwards;
}
@keyframes pivPrintDrop {
    0% { opacity: 0; filter: blur(8px) drop-shadow(0 0 0 transparent); }
    100% { opacity: .88; filter: blur(0) drop-shadow(0 0 8px color-mix(in srgb, var(--piv-amber) 45%, transparent)); }
}
.piv-foot-svg { width: 100%; height: 100%; display: block; }
.piv-trail-stamp {
    position: relative;
    width: 74px; height: 74px;
    border-radius: 50%;
    display: grid; place-items: center;
    background:
        radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--piv-cream) 30%, transparent), transparent 52%),
        radial-gradient(circle at 70% 75%, color-mix(in srgb, var(--piv-brand) 40%, transparent), transparent 55%),
        linear-gradient(145deg, color-mix(in srgb, var(--piv-brand) 58%, #1a1630), #0e0a1c);
    border: 2px solid color-mix(in srgb, var(--piv-user) 45%, transparent);
    box-shadow:
        0 12px 30px rgba(0,0,0,.5),
        0 0 28px color-mix(in srgb, var(--piv-brand) 38%, transparent),
        inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
}
.piv-trail-ink {
    position: absolute; inset: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--piv-amber) 22%, transparent), transparent 68%);
    opacity: 0; pointer-events: none;
}
.piv-scene.is-active .piv-trail-ink {
    animation: pivInkBloom .9s calc(.4s + var(--piv-i, 0) * .13s) ease-out both;
}
@keyframes pivInkBloom {
    0% { opacity: 0; transform: scale(.4); }
    40% { opacity: 1; }
    100% { opacity: .55; transform: scale(1.15); }
}
.piv-trail-ripple {
    position: absolute; inset: -8px; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--piv-amber) 55%, transparent);
    opacity: 0; pointer-events: none;
}
.piv-scene.is-active .piv-trail-ripple {
    animation: pivRipple 1.15s calc(.38s + var(--piv-i, 0) * .13s) ease-out both;
}
@keyframes pivRipple {
    0% { opacity: .95; transform: scale(.55); }
    100% { opacity: 0; transform: scale(1.65); }
}
.piv-trail-ico {
    position: relative; z-index: 1;
    font-size: 1.45rem;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--piv-amber) 55%, transparent));
    animation: pivPulseSoft 2.6s ease-in-out infinite;
}
.piv-trail-a .piv-trail-stamp { border-color: color-mix(in srgb, #f0b429 55%, transparent); color: #f0b429; }
.piv-trail-b .piv-trail-stamp { border-color: color-mix(in srgb, #ff6b9d 55%, transparent); color: #ff6b9d; }
.piv-trail-c .piv-trail-stamp { border-color: color-mix(in srgb, #a78bfa 55%, transparent); color: #a78bfa; }
.piv-trail-d .piv-trail-stamp { border-color: color-mix(in srgb, #2dd4bf 55%, transparent); color: #2dd4bf; }
.piv-trail-e .piv-trail-stamp { border-color: color-mix(in srgb, #3d8bfd 55%, transparent); color: #3d8bfd; }
.piv-trail-f .piv-trail-stamp { border-color: color-mix(in srgb, #e8c07a 55%, transparent); color: #e8c07a; }
.piv-trail-g .piv-trail-stamp { border-color: color-mix(in srgb, #c4b5fd 55%, transparent); color: #c4b5fd; }
.piv-trail-a .piv-trail-print { color: #f0b429; }
.piv-trail-b .piv-trail-print { color: #ff6b9d; }
.piv-trail-c .piv-trail-print { color: #a78bfa; }
.piv-trail-d .piv-trail-print { color: #2dd4bf; }
.piv-trail-e .piv-trail-print { color: #3d8bfd; }
.piv-trail-f .piv-trail-print { color: #e8c07a; }
.piv-trail-g .piv-trail-print { color: #c4b5fd; }
.piv-trail-meta { text-align: center; }
.piv-trail-val {
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    font-weight: 900; color: var(--piv-user); line-height: 1.1;
}
.piv-trail-a .piv-trail-val, .piv-trail-f .piv-trail-val { color: var(--piv-amber); }
.piv-trail-b .piv-trail-val { color: var(--piv-rose); }
.piv-trail-d .piv-trail-val, .piv-trail-g .piv-trail-val { color: var(--piv-teal); }
.piv-trail-lbl { font-size: .62rem; color: var(--piv-muted); margin-top: 3px; font-weight: 700; }

/* legacy stats grid kept for safety */
.piv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 14px; max-width: 860px; margin: 0 auto;
}
.piv-stat-orb {
    aspect-ratio: 1; max-width: 148px; margin: 0 auto; width: 100%;
    border-radius: 28px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--piv-user) 22%, transparent), transparent 55%),
        var(--piv-card-solid);
    border: 1px solid var(--piv-border);
    box-shadow: 0 12px 32px rgba(0,0,0,.4), inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent);
    opacity: 0; transform: scale(.4) rotate(-8deg);
}
.piv-scene.is-active .piv-stat-orb {
    animation: pivOrbIn .75s cubic-bezier(.34,1.45,.64,1) forwards;
}
.piv-scene.is-active .piv-stat-orb:nth-child(1) { animation-delay: .05s; }
.piv-scene.is-active .piv-stat-orb:nth-child(2) { animation-delay: .12s; }
.piv-scene.is-active .piv-stat-orb:nth-child(3) { animation-delay: .19s; }
.piv-scene.is-active .piv-stat-orb:nth-child(4) { animation-delay: .26s; }
.piv-scene.is-active .piv-stat-orb:nth-child(5) { animation-delay: .33s; }
.piv-scene.is-active .piv-stat-orb:nth-child(6) { animation-delay: .4s; }
.piv-scene.is-active .piv-stat-orb:nth-child(7) { animation-delay: .47s; }
@keyframes pivOrbIn { to { opacity: 1; transform: scale(1) rotate(0); } }
.piv-stat-ico { font-size: 1.25rem; margin-bottom: 4px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--piv-amber) 50%, transparent)); }
.piv-stat-val { font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 900; color: var(--piv-user); line-height: 1.1; }
.piv-stat-orb:nth-child(odd) .piv-stat-val { color: var(--piv-amber); }
.piv-stat-orb:nth-child(3n) .piv-stat-val { color: var(--piv-teal); }
.piv-stat-label { font-size: .6rem; color: var(--piv-muted); margin-top: 4px; }

/* ── Charts ── */
.piv-charts {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; max-width: 900px; margin: 0 auto;
}
@media (max-width: 720px) { .piv-charts { grid-template-columns: 1fr; } }
.piv-chart-card {
    padding: 18px 16px 14px; text-align: right; position: relative; overflow: hidden;
    opacity: 0; transform: translateY(28px) scale(.94);
}
.piv-scene.is-active .piv-chart-card {
    animation: pivCardSlide .7s cubic-bezier(.22,1.35,.36,1) forwards;
}
.piv-scene.is-active .piv-chart-card:nth-child(1) { animation-delay: .08s; }
.piv-scene.is-active .piv-chart-card:nth-child(2) { animation-delay: .16s; }
.piv-scene.is-active .piv-chart-card:nth-child(3) { animation-delay: .24s; }
.piv-scene.is-active .piv-chart-card:nth-child(4) { animation-delay: .32s; }
@keyframes pivCardSlide {
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.piv-chart-card::after {
    content: ""; position: absolute; top: -30%; left: -20%; width: 60%; height: 60%;
    background: radial-gradient(circle, color-mix(in srgb, var(--piv-brand) 18%, transparent), transparent 70%);
    pointer-events: none;
}
.piv-chart-label { font-size: .75rem; font-weight: 800; color: var(--piv-amber); margin-bottom: 12px; position: relative; }
.piv-bars {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 6px; height: 140px; padding: 0 4px; position: relative;
}
.piv-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.piv-bar {
    width: 100%; max-width: 36px; border-radius: 10px 10px 4px 4px; height: 0;
    background: linear-gradient(180deg, var(--piv-user), var(--piv-brand));
    box-shadow: 0 0 18px color-mix(in srgb, var(--piv-brand) 40%, transparent);
    transition: height 1.25s cubic-bezier(.34,1.2,.64,1);
}
.piv-bar.alt { background: linear-gradient(180deg, var(--piv-amber), var(--piv-rose)); }
.piv-bar.teal { background: linear-gradient(180deg, var(--piv-teal), var(--piv-brand2)); }
.piv-bar-lbl { font-size: .55rem; color: var(--piv-muted); white-space: nowrap; }

/* ── Tags ── */
.piv-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 14px; justify-content: flex-start;
}
@media (max-width: 720px) {
    .piv-tags { justify-content: center; }
}
.piv-tags-board { justify-content: center; margin-bottom: 16px; }
.piv-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 999px;
    font-size: .72rem; font-weight: 700;
    background: color-mix(in srgb, var(--piv-amber) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--piv-amber) 35%, transparent);
    color: var(--piv-cream);
    opacity: 0; transform: translateY(10px) scale(.9);
}
.piv-scene.is-active .piv-tag {
    animation: pivChipIn .5s cubic-bezier(.34,1.4,.64,1) forwards;
}
.piv-scene.is-active .piv-tag:nth-child(1) { animation-delay: .18s; }
.piv-scene.is-active .piv-tag:nth-child(2) { animation-delay: .26s; }
.piv-scene.is-active .piv-tag:nth-child(3) { animation-delay: .34s; }
.piv-scene.is-active .piv-tag:nth-child(4) { animation-delay: .42s; }
.piv-scene.is-active .piv-tag:nth-child(5) { animation-delay: .5s; }
.piv-scene.is-active .piv-tag:nth-child(6) { animation-delay: .58s; }
.piv-scene.is-active .piv-tag:nth-child(n+7) { animation-delay: .66s; }
.piv-tag-emo { font-size: .95rem; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--piv-amber) 50%, transparent)); }
.piv-tag:hover {
    transform: translateY(-2px) scale(1.04);
    background: color-mix(in srgb, var(--piv-amber) 28%, transparent);
}

/* ── Compact opening ── */
.piv-open-compact { padding: clamp(14px, 2.5vw, 24px); max-width: 820px; }
.piv-open-compact .piv-open-bio { margin-top: 10px; font-size: clamp(.78rem, 1.7vw, .9rem); line-height: 1.75; }
.piv-open-compact .piv-open-photo { width: 150px; height: 150px; }

/* ── Graphical activity tiles ── */
.piv-act-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}
.piv-act-tile {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
    text-align: right;
    padding: 16px;
    border-radius: 22px;
    background: var(--piv-card);
    border: 1px solid color-mix(in srgb, var(--piv-accent, var(--piv-user)) 35%, var(--piv-border));
    box-shadow: 0 16px 40px rgba(0,0,0,.35);
    opacity: 0;
    transform: translateY(40px) scale(.86) rotateX(12deg);
    transform-origin: 50% 120%;
}
.piv-scene.is-active .piv-act-tile {
    animation: pivActIn .8s cubic-bezier(.22,1.4,.36,1) forwards;
}
.piv-act-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 22px 50px rgba(0,0,0,.45), 0 0 28px color-mix(in srgb, var(--piv-accent, var(--piv-user)) 30%, transparent);
}
@keyframes pivActIn {
    0% { opacity: 0; transform: translateY(48px) scale(.8) rotateX(18deg); filter: blur(6px); }
    70% { filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotateX(0); filter: blur(0); }
}
.piv-act-visual { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.piv-act-emoji {
    font-size: 1.8rem; z-index: 1;
    filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--piv-accent, var(--piv-user)) 45%, transparent));
    animation: pivPulseSoft 2.4s ease-in-out infinite;
}
.piv-act-ring {
    position: absolute; inset: 0; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--piv-accent, var(--piv-user)) 35%, transparent), transparent 70%);
    border: 1px solid color-mix(in srgb, var(--piv-accent, var(--piv-user)) 40%, transparent);
    animation: pivRingPulse 3.5s ease-in-out infinite;
}
.piv-act-kind { font-size: .62rem; font-weight: 800; color: var(--piv-accent, var(--piv-amber)); }
.piv-act-title { font-size: .9rem; font-weight: 800; margin-top: 4px; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.piv-act-meta { font-size: .7rem; color: var(--piv-muted); margin-top: 6px; }

/* ── Floating donate papers (آخرین دونیت‌ها) ── */
.piv-scene-float { width: min(980px, 100%); }
.piv-float-stage {
    position: relative;
    width: 100%;
    height: min(52vh, 420px);
    margin-top: 8px;
}
.piv-float-note {
    position: absolute !important;
    width: min(190px, 42vw);
    z-index: 1;
}
.piv-sticky-note {
    position: relative;
    z-index: 1;
    min-height: 158px;
    padding: 22px 14px 16px;
    border-radius: 4px 4px 6px 6px;
    text-align: right;
    box-shadow: 2px 8px 0 rgba(0,0,0,.1), 0 18px 36px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.25) inset;
    transform-origin: 50% 0%;
    opacity: 0;
    overflow: hidden;
}
.piv-sticky-note::before {
    content: "";
    position: absolute; top: 0; left: 0;
    width: 0; height: 0;
    border-style: solid;
    border-width: 0 0 18px 18px;
    border-color: transparent transparent rgba(0,0,0,.12) transparent;
    filter: drop-shadow(1px 1px 0 rgba(255,255,255,.35));
}
.piv-sticky-note::after {
    content: "";
    position: absolute; top: 0; left: 0;
    width: 0; height: 0;
    border-style: solid;
    border-width: 18px 18px 0 0;
    border-color: rgba(255,255,255,.55) transparent transparent transparent;
    opacity: .9;
}
.piv-note-shine {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 48%, transparent 62%);
    transform: translateX(-120%);
}
.piv-scene.is-active .piv-sticky-note,
.piv-sticky-note.is-stuck {
    animation: pivPaperFly 1.05s cubic-bezier(.18,1.2,.32,1) forwards;
    animation-delay: var(--piv-delay, calc(.08s + var(--piv-i, 0) * .14s));
}
.piv-scene.is-active .piv-sticky-note .piv-note-shine,
.piv-sticky-note.is-stuck .piv-note-shine {
    animation: pivShineSweep 1.2s .55s ease forwards;
}
@keyframes pivPaperFly {
    0% {
        opacity: 0;
        transform: var(--piv-from, translateY(-130%) rotate(calc(var(--piv-rot, 0deg) - 28deg)) scale(.35));
        filter: blur(10px) brightness(1.4);
    }
    55% {
        opacity: 1;
        filter: blur(0) brightness(1.05);
        transform: translateY(8px) rotate(calc(var(--piv-rot, 0deg) + 6deg)) scale(1.06);
    }
    78% { transform: translateY(-4px) rotate(calc(var(--piv-rot, 0deg) - 2deg)) scale(1.01); }
    100% {
        opacity: 1;
        filter: blur(0) brightness(1);
        transform: translateY(0) rotate(var(--piv-rot, 0deg)) scale(1);
    }
}
@keyframes pivShineSweep {
    to { transform: translateX(130%); }
}
.piv-sticky-note:hover { z-index: 5; filter: brightness(1.03); }

.piv-tone-cream { background: linear-gradient(165deg, #fff6d8, #f5e4a8); color: #3a2a12; }
.piv-tone-lilac { background: linear-gradient(165deg, #efe6ff, #d9c8ff); color: #2a1848; }
.piv-tone-peach { background: linear-gradient(165deg, #ffe4d6, #ffc9b0); color: #4a2214; }
.piv-tone-mint  { background: linear-gradient(165deg, #ddfaf0, #b6efd9); color: #134034; }

.piv-note-tape {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(-2deg);
    width: 52px; height: 16px;
    background: color-mix(in srgb, #fff 55%, transparent);
    border: 1px solid color-mix(in srgb, #000 8%, transparent);
}
.piv-note-pin { position: absolute; top: 6px; right: 8px; font-size: 1.15rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.piv-note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.piv-note-avatar {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(255,255,255,.7); flex-shrink: 0;
}
.piv-note-avatar-fallback {
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--piv-brand) 35%, #fff);
    font-size: .85rem; font-weight: 900; color: #fff;
}
.piv-note-name { font-size: .78rem; font-weight: 800; line-height: 1.2; }
.piv-note-date { font-size: .62rem; opacity: .7; margin-top: 2px; }
.piv-note-gift {
    display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 6px;
    background: rgba(0,0,0,.08); font-weight: 700;
}
.piv-note-body { font-size: .78rem; line-height: 1.7; font-weight: 600; max-height: 4.8em; overflow: hidden; }

@media (max-width: 640px) {
    .piv-act-grid { grid-template-columns: 1fr; }

    /* Stack donate notes as readable cards — absolute scatter is illegible on phones */
    .piv-float-stage {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 4px 2px 8px;
        max-height: min(58vh, 460px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: y proximity;
    }
    .piv-float-note {
        position: relative !important;
        top: auto !important;
        inset-inline-start: auto !important;
        width: 100% !important;
        max-width: 100%;
        margin: 0 auto;
        scroll-snap-align: start;
        --piv-rot: 0deg !important;
        --piv-from: translateY(48px) scale(.92) !important;
    }
    .piv-sticky-note {
        min-height: 0;
        padding: 18px 14px 14px;
        border-radius: 16px;
        box-shadow: 0 12px 28px rgba(0,0,0,.35);
    }
    .piv-sticky-note::before,
    .piv-sticky-note::after { display: none; }
    .piv-note-body {
        font-size: .86rem;
        line-height: 1.75;
        max-height: none;
        -webkit-line-clamp: 4;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }
    .piv-note-name { font-size: .88rem; }
}

/* ── Achievements ── */
.piv-ach-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 720px; margin: 0 auto; }
.piv-ach-item {
    width: 112px; padding: 16px 10px; border-radius: 20px; text-align: center;
    background: var(--piv-card); border: 1px solid var(--piv-border);
    opacity: 0; transform: translateY(24px) scale(.85);
}
.piv-scene.is-active .piv-ach-item {
    animation: pivRise .55s cubic-bezier(.34,1.35,.64,1) forwards;
}
.piv-ach-item:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 18px 40px rgba(0,0,0,.4), 0 0 28px color-mix(in srgb, var(--piv-amber) 30%, transparent);
}
.piv-ach-icon {
    width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.45rem;
    background: color-mix(in srgb, var(--piv-amber) 22%, transparent);
    box-shadow: 0 0 22px color-mix(in srgb, var(--piv-amber) 35%, transparent);
    animation: pivPulseSoft 2.4s ease-in-out infinite;
}
@keyframes pivPulseSoft { 50% { transform: scale(1.08); } }
.piv-ach-name { font-size: .68rem; font-weight: 700; line-height: 1.4; }

/* ── Featured ── */
.piv-feat-card {
    padding: 26px 24px; max-width: 480px; margin: 0 auto; text-align: right;
    opacity: 0; transform: translateY(32px) scale(.92);
}
.piv-scene.is-active .piv-feat-card {
    animation: pivCardSlide .75s .12s cubic-bezier(.22,1.35,.36,1) forwards;
}
.piv-feat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.piv-feat-emoji {
    width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
    font-size: 1.6rem;
    background: linear-gradient(145deg, color-mix(in srgb, var(--piv-brand) 40%, transparent), color-mix(in srgb, var(--piv-teal) 25%, transparent));
    border: 1px solid color-mix(in srgb, var(--piv-user) 35%, transparent);
}
.piv-feat-title { font-size: 1.05rem; font-weight: 800; }
.piv-feat-kind { font-size: .72rem; color: var(--piv-amber); margin-top: 2px; }
.piv-feat-bar { height: 12px; border-radius: 999px; background: color-mix(in srgb, #000 40%, var(--piv-card-solid)); overflow: hidden; }
.piv-feat-fill {
    height: 100%; width: 0; border-radius: 999px;
    background: linear-gradient(90deg, var(--piv-brand), var(--piv-amber), var(--piv-rose));
    background-size: 200% 100%;
    animation: pivShimmer 3s linear infinite;
    transition: width 1.35s cubic-bezier(.34,1.2,.64,1);
    box-shadow: 0 0 16px color-mix(in srgb, var(--piv-brand) 50%, transparent);
}
.piv-feat-pct { font-size: .78rem; color: var(--piv-muted); margin-top: 10px; }

/* ── Outro ── */
.piv-outro-logo {
    width: 104px; height: 104px; object-fit: contain;
    filter: drop-shadow(0 12px 36px color-mix(in srgb, var(--piv-brand) 55%, transparent));
    animation: pivPulse 2.2s ease-in-out infinite;
}
@keyframes pivPulse { 50% { transform: scale(1.1); } }
.piv-outro-site {
    font-size: clamp(1.1rem, 3vw, 1.45rem); font-weight: 900;
    direction: ltr; margin-top: 18px;
    background: linear-gradient(90deg, var(--piv-user), var(--piv-amber));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.piv-outro-slogan { font-size: 1rem; color: var(--piv-muted); margin-top: 14px; line-height: 1.8; max-width: 420px; margin-inline: auto; }
.piv-outro-cta {
    display: inline-block; margin-top: 22px; padding: 13px 30px; border-radius: 999px;
    background: linear-gradient(135deg, var(--piv-brand), var(--piv-rose));
    color: #fff; font-size: .85rem; font-weight: 800; text-decoration: none;
    box-shadow: 0 12px 36px color-mix(in srgb, var(--piv-brand) 45%, transparent);
    transition: transform .25s, box-shadow .25s;
}
.piv-outro-cta:hover { transform: translateY(-3px) scale(1.04); color: #fff; }

/* ── Controls ── */
.piv-controls {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    width: 100%; padding: 12px 16px 18px;
    background: linear-gradient(to top, color-mix(in srgb, var(--piv-bg) 94%, transparent), transparent);
    backdrop-filter: blur(10px);
    max-width: 560px; margin-inline: auto;
}
.piv-progress { height: 3px; background: color-mix(in srgb, var(--piv-cream) 12%, transparent); border-radius: 3px; overflow: hidden; margin-bottom: 12px; }
.piv-progress-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--piv-brand), var(--piv-amber), var(--piv-rose));
    background-size: 200% 100%;
    animation: pivShimmer 2.5s linear infinite;
    border-radius: 3px; transition: width .12s linear;
}
.piv-controls-row { display: flex; flex-wrap: wrap; gap: 8px; }
.piv-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px;
    border-radius: 14px; border: none; font-family: inherit; font-size: .82rem;
    font-weight: 700; cursor: pointer; text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.piv-btn:hover { transform: translateY(-2px); }
.piv-btn-play {
    background: linear-gradient(135deg, var(--piv-brand), var(--piv-rose));
    color: #fff; flex: 1; justify-content: center;
    box-shadow: 0 8px 26px color-mix(in srgb, var(--piv-brand) 40%, transparent);
}
.piv-btn-download {
    background: var(--piv-card); color: var(--piv-cream);
    border: 1px solid var(--piv-border); flex: 1; justify-content: center;
}
.piv-btn-back {
    background: transparent; color: var(--piv-muted);
    border: 1px solid var(--piv-border); width: 100%; justify-content: center;
}
.piv-status { font-size: .7rem; color: var(--piv-muted); text-align: center; margin: 10px 0 0; }
.piv-canvas-hidden { position: fixed; left: -9999px; top: 0; pointer-events: none; }
.piv-app.is-busy .piv-btn-play,
.piv-app.is-busy .piv-btn-download { opacity: .5; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}


/* Outro brand-only + mute + export */
.piv-outro-only { display: flex; flex-direction: column; align-items: center; }
.piv-outro-only .piv-outro-site { margin-top: 20px; font-size: clamp(1.3rem, 3.5vw, 1.7rem); }
.piv-outro-cta { display: none !important; }
.piv-btn-mute {
    background: var(--piv-card); color: var(--piv-cream);
    border: 1px solid var(--piv-border);
    min-width: 48px; justify-content: center; padding-inline: 12px;
}
.piv-mute-ico { font-size: 1.05rem; line-height: 1; }
body.piv-export-mode .piv-controls { display: none !important; }
body.piv-export-mode .piv-stage-wrap {
    width: 1920px !important; height: 1080px !important; max-height: none !important;
    position: fixed !important; left: 0; top: 0; z-index: 5;
}
body.piv-export-mode .piv-scene { padding: 48px 64px; }
body.piv-export-mode .piv-canvas-hidden {
    position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; opacity: 0; z-index: -1;
}

/* ════════════ Mobile clarity pass ════════════ */
@media (max-width: 720px) {
    .piv-body, .piv-cinematic {
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
    }
    .piv-scene {
        padding: 16px 14px calc(132px + env(safe-area-inset-bottom, 0px));
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        filter: none;
        transform: translateY(18px) scale(1.02);
    }
    .piv-scene.is-active {
        transform: translateY(0) scale(1);
        filter: none;
    }
    .piv-scene-content {
        width: 100%;
        padding-top: 8px;
    }
    .piv-title {
        font-size: clamp(1.05rem, 5.2vw, 1.35rem);
        margin-bottom: 14px;
        line-height: 1.45;
        text-shadow: 0 2px 16px rgba(0,0,0,.45);
    }
    .piv-kicker {
        font-size: .68rem;
        margin-bottom: 10px;
    }
    .piv-open-compact,
    .piv-open {
        padding: 16px 14px;
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
    }
    .piv-open-photo { width: 112px; height: 112px; }
    .piv-open-name { font-size: clamp(1.25rem, 6vw, 1.55rem); }
    .piv-open-handle { font-size: .85rem; }
    .piv-open-url {
        width: 100%;
        justify-content: center;
        font-size: .72rem;
        padding: 9px 10px;
    }
    .piv-open-bio {
        font-size: .82rem !important;
        line-height: 1.75 !important;
        color: color-mix(in srgb, var(--piv-ink) 92%, transparent);
    }
    .piv-trail-path { display: none; }
    .piv-trail-glow { height: 40%; opacity: .45; }
    .piv-trail-nodes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 10px;
    }
    .piv-trail-print { width: 22px; height: 30px; }
    .piv-trail-stamp { width: 56px; height: 56px; }
    .piv-trail-ico { font-size: 1.15rem; }
    .piv-trail-val { font-size: 1.05rem; }
    .piv-trail-lbl { font-size: .66rem; line-height: 1.35; }
    .piv-glass {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: color-mix(in srgb, var(--piv-card-solid, #16122a) 92%, transparent);
    }
    .piv-charts { gap: 10px; }
    .piv-chart-card { padding: 14px 12px 10px; }
    .piv-bars { height: 110px; }
    .piv-act-tile {
        grid-template-columns: 56px 1fr;
        padding: 14px 12px;
        text-align: right;
    }
    .piv-act-visual { width: 52px; height: 52px; }
    .piv-act-emoji { font-size: 1.45rem; }
    .piv-act-title { font-size: .88rem; }
    .piv-controls {
        max-width: none;
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(to top, rgba(7,6,15,.98) 55%, rgba(7,6,15,.55) 100%);
    }
    .piv-controls-row { gap: 6px; }
    .piv-btn {
        padding: 10px 12px;
        font-size: .78rem;
        border-radius: 12px;
        min-height: 44px;
    }
    .piv-btn-back { order: 4; }
    .piv-status { font-size: .65rem; margin-top: 8px; }
    .piv-ring-1, .piv-ring-2 { display: none; }
    .piv-blob { filter: blur(70px); opacity: .32; }
    .piv-fx-grid { opacity: .35; }
    .piv-ach-item { width: calc(50% - 8px); max-width: 140px; }
}
