/**
 * P4PN v3.0 — final audit fixes (loads last).
 */

/* ── Capabilities: 3-line desc, no button overlap ── */
body.p4pn-cover-page .p4p-service-card__desc {
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    margin-bottom: 0.5rem !important;
}

body.p4pn-cover-page .p4p-service-card__cta {
    position: relative;
    z-index: 2;
}

/* ── Craft Studio: hologram visible, readout scrolls ── */
body.p4pn-cover-page .p4p-studio-terminal {
    overflow: hidden !important;
    max-height: min(46vh, 420px) !important;
    height: min(46vh, 420px) !important;
}

body.p4pn-cover-page .p4p-term-display {
    overflow: hidden !important;
}

body.p4pn-cover-page .p4p-term-hologram {
    overflow: visible !important;
    z-index: 2;
}

body.p4pn-cover-page .p4p-term-readout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* ── Contact: glass form on finale ── */
body.p4pn-cover-page .p4p-command-center__form,
body.p4pn-cover-page .p4p-contact-form-shell {
    backdrop-filter: blur(14px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(140%) !important;
    background: rgba(8, 10, 18, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
}

/* ── Portfolio + About: lighter mesh (perf) ── */
body.p4pn-fluid.p4p-page--portfolio.p4p-page--grid-full .p4p-page-mesh,
body.p4pn-fluid.p4p-page--about.p4p-page--grid-full .p4p-page-mesh {
    filter: brightness(1.06) contrast(1.02) saturate(1.04) !important;
    mix-blend-mode: normal !important;
    opacity: 0.78 !important;
}

html.p4p-perf-tier-2 body.p4pn-fluid.p4p-page--portfolio.p4p-page--grid-full .p4p-page-mesh,
html.p4p-perf-tier-2 body.p4pn-fluid.p4p-page--about.p4p-page--grid-full .p4p-page-mesh {
    opacity: 0.5 !important;
}

/* ── Services timeline: keep on tablet, compact on coarse ── */
@media (pointer: coarse) {
    body.p4pn-cover-page.p4pn-home .p4p-tl-minimal {
        display: none !important;
    }

    body.p4pn-services .p4pn-tl {
        display: flex !important;
        position: fixed !important;
        bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
        top: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: min(96vw, 420px) !important;
        max-width: 96vw !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding: 0.5rem !important;
        border-radius: 14px !important;
        z-index: 9000 !important;
    }

    body.p4pn-services .p4pn-tl__node-label {
        display: none !important;
    }

    body.p4pn-services .p4pn-cover-shell {
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)) !important;
    }
}

/* ── Short viewports: careers + studio scale ── */
@media (max-height: 720px) {
    body.p4pn-cover-page .p4p-csgo-stage {
        width: min(340px, 72vw) !important;
        height: min(340px, 72vw) !important;
    }

    body.p4pn-cover-page .p4p-csgo-node:nth-child(1) { transform: rotate(0deg) translate(148px) rotate(0deg) !important; }
    body.p4pn-cover-page .p4p-csgo-node:nth-child(2) { transform: rotate(60deg) translate(148px) rotate(-60deg) !important; }
    body.p4pn-cover-page .p4p-csgo-node:nth-child(3) { transform: rotate(120deg) translate(148px) rotate(-120deg) !important; }
    body.p4pn-cover-page .p4p-csgo-node:nth-child(4) { transform: rotate(180deg) translate(148px) rotate(-180deg) !important; }
    body.p4pn-cover-page .p4p-csgo-node:nth-child(5) { transform: rotate(240deg) translate(148px) rotate(-240deg) !important; }
    body.p4pn-cover-page .p4p-csgo-node:nth-child(6) { transform: rotate(300deg) translate(148px) rotate(-300deg) !important; }

    body.p4pn-cover-page .p4p-studio-terminal {
        max-height: min(40vh, 360px) !important;
        height: min(40vh, 360px) !important;
    }
}

/* ── Override home-refined careers green hover ── */
body.p4pn-cover-page .p4p-section--careers .p4p-csgo-node.is-active .p4p-csgo-node__content,
body.p4pn-cover-page .p4p-section--careers .p4p-csgo-node:hover .p4p-csgo-node__content {
    background: rgba(232, 168, 124, 0.14) !important;
    border-color: rgba(232, 168, 124, 0.55) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(232, 168, 124, 0.25) !important;
}

/* ── Cursor lite on home: core only ── */
body.p4pn-home.p4p-fx-cursor .p4p-cursor__orbit,
body.p4pn-home.p4p-fx-cursor .p4p-cursor__ring-2,
body.p4pn-home.p4p-fx-cursor .p4p-cursor__trail,
body.p4pn-home.p4p-fx-cursor .p4p-cursor__beam-h,
body.p4pn-home.p4p-fx-cursor .p4p-cursor__beam-v {
    display: none !important;
}

body.p4pn-home.p4p-fx-cursor .p4p-cursor__core {
    width: 10px !important;
    height: 10px !important;
    margin: -5px 0 0 -5px !important;
}
