/* ═══════════════════════════════════════════════════════════════
   RADIAL SERVICE MENU — Fullscreen Cyberpunk Overlay
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay backdrop — semi-dark outside the circle ── */
#radial-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    /* padding-top set dynamically by JS to clear the navbar */
}
#radial-menu-overlay.is-open {
    opacity: 1;
    pointer-events: none;  /* overlay itself doesn't block clicks */
}

/* stage receives all pointer events */
.rm-stage {
    pointer-events: all;
}

/* ── Vignette layer — darkens everything outside the circle ── */
#rm-vignette {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: radial-gradient(
        ellipse 55% 58% at 50% 50%,
        transparent 0%,
        transparent 42%,
        rgba(0, 0, 0, 0.65) 65%,
        rgba(0, 0, 0, 0.90) 100%
    );
}
#rm-vignette.is-visible {
    opacity: 1;
}

/* ── Close button (position set dynamically by JS) ── */
#rm-close-btn {
    position: fixed;
    z-index: 10600;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(10, 12, 20, 0.55);
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.75) rotate(-45deg);
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34,1.56,0.64,1),
                background 0.2s, border-color 0.2s, color 0.2s;
}
#rm-close-btn.is-visible {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) rotate(0deg);
}
#rm-close-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.35);
    color: #fff;
    transform: scale(1.1) rotate(90deg) !important;
    box-shadow: 0 0 16px rgba(200,215,255,0.25);
}

/* ── Canvas stage — size set dynamically by JS based on available space ── */
.rm-stage {
    position: relative;
    flex-shrink: 0;
}

/* ── SVG layer ── */
.rm-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

/* radial connection lines (center → node) */
.rm-line {
    stroke: rgba(255,255,255,0.55);
    stroke-width: 1.2;
    fill: none;
    transition: stroke 0.35s, stroke-width 0.35s, opacity 0.35s;
}
.rm-line.active-line {
    stroke: rgba(220,235,255,0.95);
    stroke-width: 1.8;
}
.rm-line.is-dimmed {
    opacity: 0.2;
}

/* panel connector line (node → panel) */
.rm-panel-line {
    stroke: rgba(190,210,255,0.5);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    opacity: 0;
    filter: drop-shadow(0 0 3px rgba(180,200,255,0.6));
}

/* light sweep gradient along panel connector */
.rm-panel-sweep {
    stroke-width: 3;
    fill: none;
    stroke: url(#rm-sweep-grad);
    stroke-dasharray: 60 1000;
    stroke-dashoffset: 400;
    opacity: 0;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px rgba(210,225,255,0.9));
}

/* energy pulse dot (radial line) */
.rm-pulse-dot {
    r: 2.5;
    fill: rgba(200,220,255,0.9);
    filter: drop-shadow(0 0 5px rgba(180,210,255,1));
    opacity: 0;
}

/* ── Segment slices — dark lens effect ── */
.rm-segment {
    fill: rgba(0, 0, 0, 0.62);
    stroke: rgba(255,255,255,0.15);
    stroke-width: 0.5;
    transition: fill 0.3s ease;
}
.rm-segment.is-active {
    fill: rgba(0, 0, 0, 0.45);
}
.rm-segment.is-dimmed {
    fill: rgba(0, 0, 0, 0.75);
}

/* orbit rings */
.rm-orbit {
    fill: none;
    stroke: rgba(255,255,255,0.35);
    stroke-width: 1.2;
}
.rm-orbit-2 {
    fill: none;
    stroke: rgba(255,255,255,0.25);
    stroke-width: 0.8;
    stroke-dasharray: 6 10;
}
.rm-grid-ring {
    transform-origin: center;
    animation: rm-grid-rotate 24s linear infinite;
}
@keyframes rm-grid-rotate { to { transform: rotate(360deg); } }

/* ── Center energy core ── */
.rm-core {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%) scale(0.8);
    width: 120px; height: 120px;
    display: flex; align-items: center; justify-content: center;
    cursor: default;
    z-index: 2;
    opacity: 0;
}
.rm-core-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}
.rm-core-ring-1 {
    border: 1px solid rgba(200,215,255,0.12);
    animation: rm-core-pulse 3.5s ease-in-out infinite;
}
.rm-core-ring-2 {
    inset: 12px;
    border: 1px solid rgba(200,215,255,0.22);
    animation: rm-core-pulse 3.5s ease-in-out 0.4s infinite;
}
.rm-core-body {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%,
        rgba(30, 35, 60, 0.88) 0%,
        rgba(15, 18, 40, 0.92) 55%,
        rgba(8, 10, 25, 0.96) 100%);
    border: 1px solid rgba(200,215,255,0.35);
    box-shadow:
        0 0 28px rgba(180,200,255,0.22),
        0 0 70px rgba(140,170,255,0.12),
        inset 0 0 24px rgba(200,220,255,0.10);
}
.rm-core-label {
    position: relative;
    z-index: 2;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    color: rgba(230,235,255,0.85);
    text-align: center;
    line-height: 1.3;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(180,200,255,0.6);
}
@keyframes rm-core-pulse {
    0%,100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.04); }
}

/* ── Service nodes ── */
.rm-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transform: translate(-50%,-50%) scale(0.4);
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 3;
    user-select: none;
    -webkit-user-select: none;
    text-decoration: none;
}
.rm-node:focus { outline: none; }

/* icon circle */
.rm-icon {
    position: relative;
    width: 54px; height: 54px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    backdrop-filter: blur(6px);
}

/* static glow ring */
.rm-icon::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 1.5px solid rgba(200,215,255,0);
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* rotating arc ring */
.rm-icon::after {
    content: '';
    position: absolute;
    inset: -13px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-top-color: rgba(200,215,255,0);
    border-right-color: rgba(200,215,255,0);
    transition: border-color 0.3s;
}

/* node label */
.rm-node-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: color 0.3s, text-shadow 0.3s;
    max-width: 110px;
    line-height: 1.3;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0,0,0,0.9), 0 0 16px rgba(0,0,0,0.7);
}

/* image icon inside node */
.rm-node-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    position: absolute;
    inset: 0;
}

/* ── Hover on node (managed via JS class .is-hovered) ── */
.rm-node.is-hovered .rm-icon {
    background: rgba(200,215,255,0.10);
    border-color: rgba(200,215,255,0.35);
    box-shadow:
        0 0 18px rgba(180,200,255,0.28),
        0 0 40px rgba(160,185,255,0.13),
        inset 0 0 12px rgba(200,220,255,0.07);
    transform: scale(1.13);
}
.rm-node.is-hovered .rm-icon::before {
    border-color: rgba(200,215,255,0.5);
    box-shadow: 0 0 14px rgba(180,200,255,0.35);
}
.rm-node.is-hovered .rm-icon::after {
    border-top-color: rgba(200,215,255,0.65);
    border-right-color: rgba(200,215,255,0.3);
    animation: rm-ring-spin 1.1s linear infinite;
}
.rm-node.is-hovered .rm-node-title {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255,255,255,0.7), 0 1px 4px rgba(0,0,0,0.9);
}

/* fade siblings */
.rm-node.is-dimmed {
    opacity: 0.32 !important;
}
.rm-line.is-dimmed {
    opacity: 0.22;
}

@keyframes rm-ring-spin { to { transform: rotate(360deg); } }

/* soft node pulse every 2 s (added via JS) */
@keyframes rm-node-pulse {
    0%, 100% { box-shadow:
        0 0 18px rgba(180,200,255,0.28),
        0 0 40px rgba(160,185,255,0.13),
        inset 0 0 12px rgba(200,220,255,0.07); }
    50%       { box-shadow:
        0 0 30px rgba(180,200,255,0.48),
        0 0 70px rgba(160,185,255,0.22),
        inset 0 0 18px rgba(200,220,255,0.12); }
}
.rm-node.is-hovered .rm-icon {
    animation: rm-node-pulse 2s ease-in-out infinite;
}

/* ── Click flash ── */
.rm-node.clicked .rm-icon {
    transform: scale(1.5) !important;
    box-shadow: 0 0 50px rgba(200,220,255,0.55) !important;
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out !important;
}

/* ═══════════════════════════════════════════════════════════════
   INFO PANEL — floating glass card
   ═══════════════════════════════════════════════════════════════ */
#rm-info-panel {
    position: fixed;
    z-index: 10700;   /* above close button (10600) */
    width: 272px;
    pointer-events: all;
    opacity: 0;
}

.rm-panel-inner {
    position: relative;
    background: rgba(12, 14, 22, 0.72);
    border: 1px solid rgba(200,215,255,0.14);
    border-radius: 14px;
    padding: 22px 22px 20px;
    backdrop-filter: blur(22px) saturate(1.1);
    -webkit-backdrop-filter: blur(22px) saturate(1.1);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04),
        0 8px 40px rgba(0,0,0,0.55),
        0 0 30px rgba(160,180,255,0.08),
        inset 0 1px 0 rgba(255,255,255,0.06);
    /* starts fully clipped — JS animates this */
    clip-path: inset(0 100% 0 0 round 14px);
    overflow: hidden;
    /* transition defined here for CSS fallback path */
    will-change: clip-path;
}

/* top accent line */
.rm-panel-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 16px; right: 16px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(200,215,255,0.35) 40%,
        rgba(200,215,255,0.35) 60%,
        transparent);
    border-radius: 1px;
}

/* corner accent */
.rm-panel-inner::after {
    content: '';
    position: absolute;
    top: -1px; left: -1px;
    width: 28px; height: 28px;
    border-top: 1.5px solid rgba(200,215,255,0.5);
    border-left: 1.5px solid rgba(200,215,255,0.5);
    border-radius: 14px 0 0 0;
    pointer-events: none;
}

.rm-panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(235,240,255,0.95);
    text-transform: uppercase;
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(8px);
    text-shadow: 0 0 16px rgba(180,200,255,0.45);
}

.rm-panel-lines {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rm-panel-line-text {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(185,195,220,0.78);
    line-height: 1.55;
    letter-spacing: 0.2px;
    opacity: 0;
    transform: translateY(6px);
    position: relative;
    padding-left: 12px;
}
.rm-panel-line-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(200,215,255,0.4);
}

/* ── Particles ── */
.rm-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.rm-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(200,215,255,0.55);
    animation: rm-float linear infinite;
    opacity: 0;
}
@keyframes rm-float {
    0%   { opacity: 0;   transform: translateY(0) scale(0.5); }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.4; }
    100% { opacity: 0;   transform: translateY(-100px) scale(1); }
}
.rm-streak {
    position: absolute;
    height: 1px;
    border-radius: 1px;
    background: linear-gradient(90deg, transparent, rgba(200,215,255,0.5), transparent);
    animation: rm-streak-slide linear infinite;
    opacity: 0;
}
@keyframes rm-streak-slide {
    0%   { opacity: 0;   transform: translateX(-120px); }
    15%  { opacity: 0.6; }
    85%  { opacity: 0.3; }
    100% { opacity: 0;   transform: translateX(120px); }
}

/* ── Nav trigger active ── */
.nav-item.has-dropdown.rm-active > a {
    color: rgba(220,228,255,0.95);
}
.nav-item.has-dropdown.rm-active .nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* body scroll lock when menu open */
body.rm-open {
    overflow: hidden;
    touch-action: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .rm-core  { width: 88px; height: 88px; }
    .rm-core-label { font-size: 9px; letter-spacing: 2px; }
    .rm-icon  { width: 42px; height: 42px; font-size: 17px; }
    .rm-node-title { font-size: 7px; max-width: 72px; }
    #rm-info-panel { width: 220px; }
    .rm-panel-title { font-size: 12px; }
    .rm-panel-line-text { font-size: 11px; }
}
@media (max-width: 400px) {
    .rm-core  { width: 72px; height: 72px; }
    .rm-icon  { width: 36px; height: 36px; font-size: 14px; }
    .rm-node-title { font-size: 6px; max-width: 60px; }
    #rm-info-panel { width: 190px; }
}
