/**
 * P4PN Cover System — every section fills the viewport, content scales to fit.
 * No HD/FHD locks — uses dvh + dynamic scale only.
 */

body.p4pn-home,
body.p4pn-cover-page {
    --p4pn-header-h: var(--p4p-header, 72px);
    --p4pn-cover-scale: 1;
    --p4pn-pad-x: clamp(0.75rem, 2.5vw, 1.5rem);
    --p4pn-pad-y: clamp(0.35rem, 1.2vh, 0.75rem);
    overflow: hidden;
    background: #0a0a12;
}

/* ── Mesh: edge-to-edge frame ── */
body.p4pn-home .p4p-home-canvas {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    pointer-events: none;
    z-index: 1;
}

body.p4pn-home .p4p-home-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

body.p4pn-home .p4p-home-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 min(80px, 8vw) min(24px, 3vw) rgba(6, 6, 12, 0.5);
}

/* ── Fullpage stack ── */
body.p4pn-home .p4p-home-main {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

body.p4pn-home .p4p-section {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100dvh;
    height: 100svh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.p4pn-home .p4p-section__shell {
    width: min(100% - var(--p4pn-pad-x) * 2, 72rem);
    height: calc(100dvh - var(--p4pn-header-h) - var(--p4pn-pad-y));
    max-height: calc(100svh - var(--p4pn-header-h) - var(--p4pn-pad-y));
    margin: 0 auto;
    padding: calc(var(--p4pn-header-h) + var(--p4pn-pad-y)) var(--p4pn-pad-x) var(--p4pn-pad-y);
    box-sizing: border-box;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    text-align: center;
}

/* Cover stage — JS scales this to always fit */
body.p4pn-home .p4pn-stage {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    transform: scale(var(--p4pn-cover-scale, 1));
    transform-origin: center center;
    will-change: transform;
}

body.p4pn-home .p4pn-stage--capabilities {
    transform-origin: center center;
}

body.p4pn-home .p4p-hero-v4 {
    min-height: 0 !important;
    padding-top: 0 !important;
    width: 100%;
    position: relative;
}

body.p4pn-home .p4p-hero-v3__orbit {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

body.p4pn-home .p4p-hero-v4__title {
    font-size: clamp(1.75rem, 5cqi, 3.5rem) !important;
}

body.p4pn-home .p4p-hero-v4__lead {
    font-size: clamp(0.82rem, 2cqi, 1.05rem) !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Capabilities — layout in p4pn-home-refined.css; cover-fit scales stack */

body.p4pn-home .p4p-cap-band__intro {
    font-size: clamp(0.62rem, 1.4cqi, 0.78rem);
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gateway */
body.p4pn-home .p4p-portals-3d {
    max-height: min(38cqi, 38vh);
}

body.p4pn-home .p4p-portal-door {
    max-height: min(34cqi, 34vh) !important;
    min-height: 0 !important;
}

/* Experience */
body.p4pn-home .p4p-section--experience .p4p-studio-terminal {
    height: min(38cqi, 38vh) !important;
    max-height: min(360px, 40vh) !important;
}

/* Careers — globe + preview in p4pn-home-refined.css */

body.p4pn-home .p4p-csgo-core__desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Finale / contact */
body.p4pn-home .p4p-section--finale .p4p-section__shell {
    max-width: min(100% - var(--p4pn-pad-x) * 2, 58rem) !important;
}

body.p4pn-home .p4p-command-center {
    width: 100%;
    max-height: 100%;
}

body.p4pn-home .p4p-command-center__form {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Timeline chrome */
body.p4pn-home .p4p-tl-minimal {
    z-index: 5000;
}

body.p4pn-home .p4p-next-indicator {
    z-index: 3950;
}

/* FPS: lighter ambients */
body.p4pn-home .p4p-ambient-light {
    filter: blur(40px) !important;
    opacity: 0.55 !important;
}

body.p4pn-home .p4p-careers-globe .p4p-csgo-node__content {
    backdrop-filter: none !important;
    background: rgba(8, 10, 18, 0.92) !important;
}

@media (prefers-reduced-motion: reduce) {
    body.p4pn-cover-page [data-p4pn-cover-target],
    body.p4pn-home [data-p4pn-cover-target] {
        transform: none !important;
    }
}
