/* ==========================================================================
   THE ORBIS PROJECT - CYBER-MINIMALIST 3D HUD STYLESHEET
   Target: Zero frameworks, Ultra performance, High Visual Impact
   ========================================================================== */

:root {
    --bg-dark: #020610;
    --cyan-glow: #00f3ff;
    --emerald-glow: #00ff9d;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(8, 15, 30, 0.75);
    --glass-border: rgba(0, 243, 255, 0.25);
    --glass-border-hover: rgba(0, 255, 157, 0.75);
    --neon-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* RESET E BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

/* CANVAS SFONDO INTERATTIVO */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: auto;
}

/* VIGNETTATURA & AMBIENCE OVERLAY */
.cyber-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 35%, rgba(2, 6, 16, 0.9) 100%);
}

/* NAVBAR SUPERIORE */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(2, 6, 16, 0.5);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* LOGO RITAGLIATO A CERCHIO PERFETTO */
.brand-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--glass-border);
    filter: drop-shadow(0 0 6px var(--cyan-glow));
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.brand-logo-img:hover {
    transform: scale(1.08);
    border-color: var(--cyan-glow);
}

.brand-text {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.1;
    color: var(--text-primary);
}

/* EVIDENZIAZIONE PAROLA "ORBIS" (ARGENTO METALLICO LUCIDO) */
.brand-orbis {
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: 2.5px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.center-links {
    display: flex;
    gap: 1.8rem;
}

.center-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.85;
    transition: all 0.3s ease;
}

.center-links a:hover {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 0 12px var(--cyan-glow);
}

.system-controls {
    display: flex;
    gap: 10px;
}

.cyber-btn {
    background: rgba(0, 243, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--cyan-glow);
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cyber-btn:hover {
    background: rgba(0, 243, 255, 0.22);
    box-shadow: var(--neon-shadow);
}

/* PULSANTE LINGUA SOBRIO E SATINATO */
.lang-btn-subtle {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #e2e8f0 !important;
}

.lang-btn-subtle:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.2) !important;
}

/* HERO MAIN & HUD LAYOUT */
.hero-hud {
    position: relative;
    z-index: 5;
    width: 100vw;
    height: calc(100vh - 110px);
    margin-top: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

/* TITOLI CENTRALI */
.hero-titles {
    text-align: center;
    max-width: 900px;
}

.hero-titles h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    margin-bottom: 0.8rem;
}

.hero-titles p {
    font-size: 1.1rem;
    font-weight: 400;
    color: #e2e8f0;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

/* HUD CONTAINER CENTRALE */
.hud-container {
    position: relative;
    width: 100%;
    max-width: 920px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* PIANETA ORBIS INGRANDITO E INTERATTIVO */
.hud-center.planet-interactive {
    width: 250px;
    height: 250px;
    position: absolute;
    z-index: 2;
    cursor: pointer;
    filter: drop-shadow(0 0 30px rgba(0, 243, 255, 0.45));
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.hud-center.planet-interactive:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 50px rgba(0, 255, 157, 0.65));
}

.cyber-logo-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* STILI DELLE SFACCETTATURE 3D PIRAMIDE */
.shield-facet-top,
.shield-facet-left,
.shield-facet-right {
    transition: all 0.3s ease;
}

.shield-facet-top:hover {
    fill-opacity: 0.95;
    filter: brightness(1.3);
}

.shield-facet-left:hover,
.shield-facet-right:hover {
    fill-opacity: 0.85;
    filter: brightness(1.2);
}

.core-dot-3d {
    animation: pulseCoreDot 2.5s infinite ease-in-out;
}

@keyframes pulseCoreDot {
    0%, 100% {
        r: 6px;
        fill: #00ff9d;
        filter: drop-shadow(0 0 6px #00ff9d);
    }
    50% {
        r: 8px;
        fill: #ffffff;
        filter: drop-shadow(0 0 14px #00f3ff);
    }
}

/* 6 ANELLI ORBITALI MULTI-LIVELLO STILE SATURNO */
.ring {
    fill: none;
    stroke-linecap: round;
    transform-origin: center;
}

.ring-saturn-1 {
    stroke: var(--cyan-glow);
    stroke-width: 1.2;
    stroke-dasharray: 60 20 120 40;
    animation: rotateClockwise 32s linear infinite;
    opacity: 0.75;
}

.ring-saturn-2 {
    stroke: var(--emerald-glow);
    stroke-width: 1.5;
    stroke-dasharray: 40 80 50 30;
    animation: rotateCounterClockwise 22s linear infinite;
    opacity: 0.65;
}

.ring-saturn-3 {
    stroke: #a855f7;
    stroke-width: 1;
    stroke-dasharray: 30 50 90 20;
    animation: rotateClockwise 18s linear infinite;
    opacity: 0.55;
}

.ring-saturn-4 {
    stroke: #fbbf24;
    stroke-width: 1.2;
    stroke-dasharray: 80 30 40 10;
    animation: rotateCounterClockwise 26s linear infinite;
    opacity: 0.6;
}

.ring-saturn-5 {
    stroke: var(--cyan-glow);
    stroke-width: 0.8;
    stroke-dasharray: 100 20 30 40;
    animation: rotateClockwise 40s linear infinite;
    opacity: 0.45;
}

.ring-saturn-6 {
    stroke: rgba(0, 255, 157, 0.4);
    stroke-width: 1;
    stroke-dasharray: 15 40;
    animation: rotateCounterClockwise 15s linear infinite;
    opacity: 0.35;
}

@keyframes rotateClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateCounterClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* 4 NODI FLUTTUANTI (POSIZIONAMENTO HUD 3D) */
.hud-node {
    position: absolute;
    width: 270px;
    padding: 14px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(0, 243, 255, 0.05);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 3;
    opacity: 1;
    transform: scale(1);
}

/* STATO NASCOSTO INIZIALE ("BIG BANG" READY) */
.hud-node-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.1) translate(0, 0) !important;
}

.node-top-left     { top: 15px; left: 30px; }
.node-top-right    { top: 15px; right: 30px; }
.node-bottom-left  { bottom: 15px; left: 30px; }
.node-bottom-right { bottom: 15px; right: 30px; }

.hud-node:not(.hud-node-hidden):hover {
    border-color: var(--emerald-glow);
    background: rgba(12, 24, 48, 0.85);
    box-shadow: 0 0 25px rgba(0, 255, 157, 0.3), inset 0 0 18px rgba(0, 255, 157, 0.15);
    transform: translateY(-4px) scale(1.03);
}

.node-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 6px rgba(0, 243, 255, 0.5));
}

.node-text h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.node-text span {
    font-size: 0.73rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* BOTTOM NODE (ETICA & CODICE) */
.bottom-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 26px;
    background: rgba(0, 243, 255, 0.04);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    color: var(--cyan-glow);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
}

.bottom-node:not(.hud-node-hidden):hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--emerald-glow);
    box-shadow: var(--neon-shadow), 0 0 20px rgba(0, 255, 157, 0.3);
    color: #ffffff;
    transform: translateY(-2px);
}

.pulse-dot {
    width: 9px;
    height: 9px;
    background-color: var(--emerald-glow);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--emerald-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.35); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

/* XENON: LA GUIDA ALIENA DIVERSIFICATA E DINAMICA */
#xenon-container {
    position: fixed;
    bottom: 52px;
    right: 30px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.xenon-float {
    animation: xenonDrift 9s ease-in-out infinite;
}

@keyframes xenonDrift {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
    }
    25% {
        transform: translate(-12px, -18px) rotate(-3deg);
    }
    50% {
        transform: translate(-25px, -8px) rotate(2deg);
    }
    75% {
        transform: translate(-8px, -24px) rotate(-1.5deg);
    }
}

/* FUMETTO GLASSMORPHISM DI XENON */
.xenon-bubble {
    pointer-events: auto;
    background: rgba(8, 15, 30, 0.88);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    border-radius: 14px 14px 2px 14px;
    padding: 12px 16px;
    max-width: 280px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 243, 255, 0.15);
    transition: all 0.3s ease;
}

.xenon-bubble p {
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.45;
    letter-spacing: 0.2px;
}

.xenon-avatar-btn {
    pointer-events: auto;
    width: 78px;
    height: 78px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.xenon-avatar-btn:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 18px rgba(0, 255, 157, 0.65));
}

.xenon-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* MODAL XENON BANNER INTERNO */
.modal-xenon-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 1.5rem;
}

.xenon-mini-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px var(--emerald-glow));
}

.modal-xenon-bar p {
    font-size: 0.82rem;
    color: #e2e8f0;
    line-height: 1.35;
}

/* FOOTER STRUTTURATO */
.bottom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 42px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: rgba(2, 6, 16, 0.88);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    gap: 1.2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--cyan-glow);
}

.footer-credits {
    color: var(--text-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* BIANCO LUCIDO VETTORIALE PER ICONE SOCIAL SVG */
.social-icons {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.social-svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
    opacity: 0.85;
    transition: fill 0.25s ease, opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.social-link:hover .social-svg {
    fill: #ffffff;
    opacity: 1;
    transform: translateY(-2px) scale(1.1);
    filter: drop-shadow(0 0 6px rgba(0, 243, 255, 0.8));
}

/* SCHEDE MODALI & GLASSMORPHISM INSET VIEWPORT */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 16, 0.8);
    backdrop-filter: blur(16px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#modal-content-box {
    position: relative;
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    max-width: 1200px;
    max-height: 800px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 2.5rem;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.85), inset 0 0 30px rgba(0, 243, 255, 0.05);
}

.cyber-btn-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 50, 50, 0.3);
    color: #ff5555;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cyber-btn-close:hover {
    background: rgba(255, 50, 50, 0.35);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 50, 50, 0.4);
}

/* RESPONSIVE DESIGN (MOBILE & TABLET) */
@media (max-width: 850px) {
    .center-links { display: none; }
    .footer-credits { display: none; }

    .hero-titles h2 { font-size: 1.45rem; }
    .hero-titles p { font-size: 0.95rem; }

    .hud-container {
        height: auto;
        flex-direction: column;
        gap: 12px;
        margin: 1rem 0;
    }

    .hud-center.planet-interactive {
        position: relative;
        width: 170px;
        height: 170px;
        margin-bottom: 0.8rem;
    }

    .hud-node {
        position: relative;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100%;
        max-width: 330px;
    }

    #xenon-container {
        bottom: 50px;
        right: 15px;
    }

    .xenon-bubble {
        max-width: 220px;
        padding: 10px 12px;
    }

    .xenon-bubble p {
        font-size: 0.75rem;
    }

    .xenon-avatar-btn {
        width: 62px;
        height: 62px;
    }

    /* Bottom Sheet per Mobile */
    #modal-content-box {
        width: 100vw;
        height: 92dvh;
        max-height: 92dvh;
        position: fixed;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        padding: 1.5rem;
    }
}
