/**
 * AGENT SHARED — Splash Screen + Unified Header
 * Included by all agent subpages for identity consistency.
 * Now supports light/vibrant identity backgrounds.
 */

/* ─── VARIABLES (match hub) ─── */
:root {
    --c-sites: #03E3E2;
    --c-sistemas: #00FCA0;
    --c-design: #E58E19;
    --c-cardapios: #E20138;
    --c-convites: #E2D408;

    /* Light BG per agent — applied via page-level class */
    --bg-sites: #B8FAF9;
    --bg-sistemas: #B4FFE0;
    --bg-design: #FFDCAB;
    --bg-cardapios: #FFBDCC;
    --bg-convites: #FFF8A8;

    --v-dark: #0a0a0a;
    --v-white: #FFFFFF;
    --font-main: 'Outfit', sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════ */

.splash {
    position: fixed; inset: 0; z-index: 99999;
    background: var(--v-dark);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash.is-hidden {
    opacity: 0; visibility: hidden;
    pointer-events: none;
}

.splash__avatar {
    width: clamp(200px, 30vw, 340px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 60px var(--splash-color, #03E3E2));
    animation: splashFloat 2s ease-in-out infinite;
}

@keyframes splashFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.02); }
}

.splash__sector {
    margin-top: 28px;
    font-family: var(--font-main);
    font-size: 0.68rem; font-weight: 900;
    letter-spacing: 6px; text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

.splash__title {
    margin-top: 8px;
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900; text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--splash-color, #03E3E2);
    text-shadow: 0 0 40px var(--splash-color, #03E3E2);
}

.splash__bar {
    margin-top: 40px; width: 160px; height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px; overflow: hidden;
}
.splash__bar-fill {
    width: 0; height: 100%;
    background: var(--splash-color, #03E3E2);
    border-radius: 3px;
    animation: splashLoad 1.6s var(--ease) forwards;
}
@keyframes splashLoad {
    0% { width: 0; }
    60% { width: 70%; }
    100% { width: 100%; }
}

.splash__status {
    margin-top: 14px;
    font-family: monospace;
    font-size: 0.6rem; letter-spacing: 2px;
    color: rgba(255,255,255,0.15);
    text-transform: uppercase;
}

/* ═══════════════════════════════════════
   UNIFIED HEADER — adapts to light bg
   ═══════════════════════════════════════ */

.hdr-agent {
    position: sticky; top: 0; left: 0; width: 100%;
    height: 72px; z-index: 9999;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.hdr-agent__brand { text-decoration: none; }
.hdr-agent__brand img { height: 28px; filter: brightness(0); }
.hdr-agent__nav {
    display: flex; align-items: center; gap: 24px;
}
.hdr-agent__link {
    color: rgba(0,0,0,0.35); text-decoration: none;
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    transition: color 0.3s;
}
.hdr-agent__link:hover { color: var(--v-dark); }
.hdr-agent__link.is-active { color: var(--v-dark); }
.hdr-agent__cta {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 24px;
    background: var(--v-dark);
    border: none;
    border-radius: 4px; color: var(--v-white);
    text-decoration: none; font-size: 0.64rem; font-weight: 800;
    letter-spacing: 2px; text-transform: uppercase;
    transition: all 0.3s var(--ease);
}
.hdr-agent__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.hdr-agent__pulse {
    width: 7px; height: 7px;
    background: var(--c-sistemas); border-radius: 50%;
    animation: agPulse 2s ease infinite;
}
@keyframes agPulse {
    0%,100% { opacity:1; transform:scale(1); }
    50% { opacity:0.3; transform:scale(1.8); }
}

/* ─── GRAIN (subtle) ─── */
.grain-agent {
    position: fixed; inset: 0; z-index: 9998;
    pointer-events: none; opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 150px; mix-blend-mode: multiply;
}

/* ─── MOBILE ─── */
@media (max-width: 768px) {
    .hdr-agent { padding: 0 16px; height: 60px; }
    .hdr-agent__brand img { height: 22px; }
    .hdr-agent__link:not(.hdr-agent__cta) { display: none; }
    .hdr-agent__cta { padding: 9px 16px; font-size: 0.58rem; }
    .splash__avatar { width: clamp(160px, 50vw, 240px); }
}

/* ═══════════════════════════════════════
   PREMIUM OVERLAY — cursor, HUD, magnet
   ═══════════════════════════════════════ */

:root {
    --font-mono: "JetBrains Mono", "Courier New", monospace;
    --ease-power: cubic-bezier(0.77, 0, 0.18, 1);
}

@media (hover: hover) and (pointer: fine) {
    body.has-overlay { cursor: none; }
    body.has-overlay a, body.has-overlay button { cursor: none; }
}

.cursor {
    position: fixed; top: 0; left: 0;
    z-index: 100000; pointer-events: none;
}

.cursor.is-hidden { opacity: 0; }

.cursor__dot {
    position: fixed; top: 0; left: 0;
    width: 6px; height: 6px;
    background: #fff; border-radius: 999px;
    transform: translate3d(-50%, -50%, 0);
    transition: width 0.25s var(--ease), height 0.25s var(--ease);
    will-change: transform;
    mix-blend-mode: difference;
}

.cursor__ring {
    position: fixed; top: 0; left: 0;
    width: 36px; height: 36px;
    border: 1.5px solid #fff;
    border-radius: 999px;
    transform: translate3d(-50%, -50%, 0);
    transition: width 0.35s var(--ease-power), height 0.35s var(--ease-power), background 0.3s var(--ease);
    will-change: transform;
    mix-blend-mode: difference;
}

.cursor.is-link .cursor__dot { width: 0; height: 0; }
.cursor.is-link .cursor__ring { width: 56px; height: 56px; background: rgba(255,255,255,0.12); }
.cursor.is-cta  .cursor__dot { width: 0; height: 0; }
.cursor.is-cta  .cursor__ring { width: 84px; height: 84px; background: #fff; }

@media (hover: none) and (pointer: coarse) {
    .cursor { display: none; }
}

/* HUD overlay */
.hud {
    position: fixed; inset: 0;
    z-index: 9990; pointer-events: none;
    color: rgba(255,255,255,0.55);
    font-family: var(--font-mono);
    font-size: 0.62rem; letter-spacing: 2px; text-transform: uppercase;
}

.hud__bracket {
    position: absolute;
    width: 22px; height: 22px;
    border: 1.5px solid var(--hud-accent, var(--c-sites));
}
.hud__bracket--tl { top: 86px; left: 16px; border-right: 0; border-bottom: 0; }
.hud__bracket--tr { top: 86px; right: 16px; border-left: 0; border-bottom: 0; }
.hud__bracket--bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.hud__bracket--br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }

.hud__row {
    position: absolute;
    display: flex; align-items: center; gap: 14px;
}
.hud__row--bl { bottom: 50px; left: 28px; }
.hud__row--br { bottom: 50px; right: 28px; }

.hud__pill {
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 2px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.72);
    font-weight: 700;
}

.hud__live {
    color: var(--c-sistemas);
    border-color: color-mix(in srgb, var(--c-sistemas) 60%, transparent);
    background: rgba(0,0,0,0.55);
}
.hud__live::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    margin-right: 7px;
    border-radius: 999px;
    background: var(--c-sistemas);
    box-shadow: 0 0 6px var(--c-sistemas);
    animation: hudPulse 1.2s ease-in-out infinite;
    vertical-align: middle;
    transform: translateY(-1px);
}

@keyframes hudPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

.hud__signal {
    display: inline-flex; align-items: flex-end; gap: 2px; height: 10px;
}
.hud__signal span {
    display: block; width: 3px;
    background: var(--hud-accent, var(--c-sites));
}
.hud__signal span:nth-child(1) { height: 30%; }
.hud__signal span:nth-child(2) { height: 55%; }
.hud__signal span:nth-child(3) { height: 80%; }
.hud__signal span:nth-child(4) { height: 100%; opacity: 0.4; }

@media (max-width: 920px) {
    .hud { font-size: 0.52rem; letter-spacing: 1.4px; }
    .hud__bracket { width: 14px; height: 14px; top: 70px; left: 8px; }
    .hud__bracket--tr { right: 8px; left: auto; }
    .hud__bracket--bl { bottom: 8px; top: auto; }
    .hud__bracket--br { right: 8px; bottom: 8px; top: auto; left: auto; }
    .hud__row--bl { display: none; }
    .hud__row--br { right: 14px; bottom: 38px; }
    .hud__row--br .hud__pill:not(:last-child):not(:nth-last-child(2)) { display: none; }
}

/* Magnetic CTA */
.js-magnet {
    transform: translate(var(--mx, 0px), var(--my, 0px));
    transition: transform 0.4s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .splash { display: none !important; }
}
