/* ============================================================
   PURESYSTEMS.AI — motion layer styles
   Boot preloader, cursor follower, hero dot-field, brand marquee
   ============================================================ */

/* ---------- Boot preloader ---------- */
#ps-preloader {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: #fcfcfc;
    clip-path: inset(0 0 0 0);
    will-change: clip-path;
}

html.ps-lock,
html.ps-lock body {
    overflow: hidden;
}

.ps-preloader__inner {
    position: absolute;
    inset: 0;
}

.ps-preloader__brand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ps-preloader__icon {
    height: 26px;
    width: auto;
}

.ps-preloader__logo {
    height: 15px;
    width: auto;
}

.ps-preloader__count {
    position: absolute;
    left: clamp(1rem, 4vw, 3rem);
    bottom: clamp(1rem, 3.5vw, 2.5rem);
    font-size: clamp(3.5rem, 11vw, 8rem);
    line-height: 1;
    color: #000;
    font-variant-numeric: tabular-nums;
}

.ps-preloader__meta {
    position: absolute;
    right: clamp(1rem, 4vw, 3rem);
    bottom: clamp(1.25rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.7rem;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #444;
    text-align: right;
}

.ps-preloader__bar {
    display: block;
    position: relative;
    width: min(220px, 42vw);
    height: 7px;
    border: 1px solid rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.ps-preloader__bar > span {
    position: absolute;
    inset: 0;
    display: block;
    background: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 7px);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* ---------- Hero dot-field ---------- */
.hero-dotfield {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: min(76%, 820px);
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 98%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 98%);
}

.hero-dotfield canvas {
    display: block;
}

/* keep content above the canvas */
.hero-dotfield ~ div {
    position: relative;
    z-index: 1;
}

/* ---------- Brand marquee ---------- */
.brand-marquee {
    overflow: hidden;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.85);
    padding: clamp(1rem, 2.5vw, 2rem) 0;
    margin-top: clamp(2rem, 6vw, 5rem);
}

.brand-marquee__track {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform;
}

.brand-marquee__item {
    display: inline-block;
    font-size: clamp(2.75rem, 9vw, 7.5rem);
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #000;
}

.brand-marquee__item .brand-marquee__sep {
    opacity: 0.25;
    padding: 0 0.35em;
}

/* ---------- Cursor follower (fine pointers) ---------- */
.ps-cursor,
.ps-cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100002;
    mix-blend-mode: difference;
    opacity: 0;
}

.ps-cursor {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1px solid #fff;
    transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, opacity 0.25s ease;
}

.ps-cursor-dot {
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    background: #fff;
    transition: opacity 0.25s ease;
}

html.ps-cursor-on .ps-cursor,
html.ps-cursor-on .ps-cursor-dot {
    opacity: 1;
}

.ps-cursor.is-hover {
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
}

html.ps-cursor-on .ps-cursor.is-hidden,
html.ps-cursor-on .ps-cursor-dot.is-hidden {
    opacity: 0;
}

/* ---------- Magnetic buttons: let GSAP own transforms ---------- */
.is-magnetic {
    transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}

/* ---------- Nav polish on scroll ---------- */
body.scrolled #mainContent > nav {
    box-shadow: 0 12px 32px -20px rgba(0, 0, 0, 0.3);
}

/* ---------- Reduced motion / small screens ---------- */
@media (prefers-reduced-motion: reduce) {
    #ps-preloader,
    .ps-cursor,
    .ps-cursor-dot,
    .hero-dotfield {
        display: none !important;
    }

    .brand-marquee__track {
        transform: none !important;
    }
}
