/* Movement Dashboard — deep global presence panel */

.movement-dashboard {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

#movement-dashboard .reveal {
    opacity: 1;
    transform: none;
}

/* ---- Ambient backdrop ---- */
.movement-dashboard__backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.movement-dashboard__particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.75;
}

.movement-dashboard__grid-lines {
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(196, 168, 224, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(196, 168, 224, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 20%, transparent 75%);
    animation: movement-grid-drift 80s linear infinite;
}

@keyframes movement-grid-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(48px, 48px); }
}

.movement-dashboard__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 85% 70% at 50% 40%, transparent 35%, rgba(26, 18, 32, 0.65) 100%);
}

.movement-dashboard__motes {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.movement-mote {
    position: absolute;
    left: var(--mx);
    top: var(--my);
    font-size: 0.55rem;
    color: rgba(251, 191, 36, 0.35);
    animation: movement-mote-float var(--md) ease-in-out infinite;
    opacity: var(--ms);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}

@keyframes movement-mote-float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: calc(var(--ms) * 0.6); }
    50% { transform: translateY(-12px) rotate(12deg); opacity: var(--ms); }
}

.movement-dashboard__constellation {
    position: absolute;
    width: 220px;
    height: 220px;
    top: 12%;
    right: 8%;
    opacity: 0.18;
    animation: movement-constellation-spin 120s linear infinite;
}

.movement-dashboard__constellation--left {
    left: 6%;
    right: auto;
    top: auto;
    bottom: 14%;
    width: 160px;
    height: 160px;
    animation-direction: reverse;
    animation-duration: 90s;
}

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

.movement-dashboard__grid {
    display: grid;
    gap: 2rem;
    align-items: stretch;
    position: relative;
    z-index: 2;
}

@media (min-width: 1024px) {
    .movement-dashboard__grid {
        grid-template-columns: minmax(300px, 1.05fr) minmax(320px, 1fr);
        gap: 3.5rem;
    }
}

/* ---- WebGL Globe stage ---- */
.movement-globe {
    position: relative;
    aspect-ratio: 1;
    max-width: 480px;
    margin: 0 auto;
    min-height: 280px;
}

.movement-globe__stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 280px;
    border-radius: 50%;
}

.movement-globe__canvas {
    position: absolute;
    inset: 8%;
    width: 84%;
    height: 84%;
    margin: auto;
    display: block;
    border-radius: 50%;
    z-index: 4;
}

.movement-globe__halo {
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, rgba(196, 168, 224, 0.22) 0%, transparent 48%),
        radial-gradient(circle at 62% 68%, rgba(201, 167, 216, 0.14) 0%, transparent 42%);
    filter: blur(2px);
    animation: movement-halo-breathe 5s ease-in-out infinite;
    z-index: 1;
}

.movement-globe__stage--live .movement-globe__halo {
    animation-duration: 3.2s;
    background: radial-gradient(circle at 38% 32%, rgba(251, 191, 36, 0.32) 0%, transparent 45%),
        radial-gradient(circle at 62% 68%, rgba(233, 183, 159, 0.22) 0%, transparent 42%);
}

.movement-globe__stage--pulsing .movement-globe__halo {
    background: radial-gradient(circle at 42% 35%, rgba(255, 224, 102, 0.28) 0%, transparent 48%),
        radial-gradient(circle at 58% 62%, rgba(251, 191, 36, 0.18) 0%, transparent 44%);
}

.movement-globe__stage--pulsing .movement-globe__orbit--3 {
    border-color: rgba(251, 191, 36, 0.22);
    animation-duration: 10s;
}

@keyframes movement-halo-breathe {
    0%, 100% { opacity: 0.55; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.03); }
}

.movement-globe__orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid transparent;
    pointer-events: none;
    z-index: 2;
}

.movement-globe__orbit--1 {
    inset: 0;
    border-color: rgba(196, 168, 224, 0.18);
    animation: movement-orbit-tilt 18s ease-in-out infinite;
}

.movement-globe__orbit--2 {
    inset: 10%;
    border-color: rgba(201, 167, 216, 0.14);
    animation: movement-orbit-tilt 14s ease-in-out infinite reverse;
    animation-delay: -4s;
}

.movement-globe__orbit--3 {
    inset: 20%;
    border-color: rgba(233, 183, 159, 0.12);
    animation: movement-orbit-tilt 22s ease-in-out infinite;
    animation-delay: -8s;
}

@keyframes movement-orbit-tilt {
    0%, 100% { transform: rotateX(62deg) rotateZ(0deg); opacity: 0.45; }
    50% { transform: rotateX(58deg) rotateZ(180deg); opacity: 0.9; }
}

.movement-globe__flare {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
    animation: movement-flare-pulse 7s ease-in-out infinite;
}

.movement-globe__flare--tl {
    top: 2%;
    left: 8%;
    background: rgba(196, 168, 224, 0.15);
}

.movement-globe__flare--br {
    bottom: 6%;
    right: 4%;
    background: rgba(233, 183, 159, 0.12);
    animation-delay: -3s;
}

@keyframes movement-flare-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 0.85; transform: scale(1.1); }
}

.movement-globe__credit {
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.65);
    white-space: nowrap;
    z-index: 5;
}

.movement-globe__fallback {
    position: relative;
    width: 72%;
    height: 72%;
    margin: 14% auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(196, 168, 224, 0.2);
}

.movement-globe__fallback-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: movement-fallback-spin 120s linear infinite;
}

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

.movement-globe__fallback-shade {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 28%, transparent 40%, rgba(26, 18, 32, 0.55) 100%);
}

.movement-globe__caption {
    text-align: center;
    margin-top: 2rem;
    padding: 0 0.5rem;
}

.movement-globe__caption strong {
    display: block;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.4rem;
    color: #f8fafc;
    font-weight: 400;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.movement-globe__caption span {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.55;
}

/* ---- Dashboard panel ---- */
.movement-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.movement-panel__clock {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding: 1.15rem 1.35rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(36, 26, 46, 0.72), rgba(52, 40, 72, 0.45));
    border: 1px solid rgba(196, 168, 224, 0.14);
    overflow: hidden;
}

.movement-panel__clock::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.6), transparent);
    animation: movement-scan 6s ease-in-out infinite;
}

@keyframes movement-scan {
    0% { left: -60%; opacity: 0; }
    20% { opacity: 1; }
    100% { left: 120%; opacity: 0; }
}

.movement-panel__clock-time {
    font-variant-numeric: tabular-nums;
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #f8fafc;
    text-shadow: 0 0 24px rgba(196, 168, 224, 0.15);
}

.movement-panel__clock-meta {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
}

.movement-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .movement-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.movement-stat-card {
    position: relative;
    padding: 1.15rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(52, 40, 72, 0.7), rgba(36, 26, 46, 0.5));
    border: 1px solid rgba(196, 168, 224, 0.1);
    text-align: center;
    transition: border-color 0.35s, transform 0.35s, box-shadow 0.35s;
    overflow: hidden;
}

.movement-stat-card::before,
.movement-stat-card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: rgba(233, 183, 159, 0.25);
    border-style: solid;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.movement-stat-card::before {
    top: 6px;
    left: 6px;
    border-width: 1px 0 0 1px;
}

.movement-stat-card::after {
    bottom: 6px;
    right: 6px;
    border-width: 0 1px 1px 0;
}

.movement-stat-card:hover {
    border-color: rgba(233, 183, 159, 0.28);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(26, 18, 32, 0.35), 0 0 24px rgba(196, 168, 224, 0.08);
}

.movement-stat-card:hover::before,
.movement-stat-card:hover::after {
    opacity: 1;
}

.movement-stat-card__value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f8fafc;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.movement-stat-card.is-updated .movement-stat-card__value {
    transform: scale(1.06);
}

.movement-stat-card__label {
    margin-top: 0.4rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #64748b;
}

.movement-chart {
    position: relative;
    padding: 1.35rem 1.25rem 1.25rem;
    border-radius: 1.25rem;
    background: linear-gradient(160deg, rgba(36, 26, 46, 0.62), rgba(52, 40, 72, 0.38));
    border: 1px solid rgba(196, 168, 224, 0.12);
}

.movement-chart__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: #64748b;
    margin-bottom: 1rem;
}

.movement-chart__title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: movement-live-blink 2s ease-in-out infinite;
}

.movement-chart__bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    min-height: 128px;
    padding-top: 0.5rem;
}

.movement-chart__bar-wrap {
    flex: 1;
    max-width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.movement-chart__bar {
    width: 100%;
    min-height: 8px;
    border-radius: 0.5rem 0.5rem 0.125rem 0.125rem;
    background: linear-gradient(to top, rgba(196, 168, 224, 0.95), rgba(201, 167, 216, 0.75));
    transition: height 0.9s cubic-bezier(0.34, 1.2, 0.64, 1);
    box-shadow: 0 0 22px rgba(196, 168, 224, 0.22);
    position: relative;
    overflow: hidden;
}

.movement-chart__bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, transparent 45%);
    opacity: 0.7;
}

.movement-chart__bar--accent {
    background: linear-gradient(to top, rgba(233, 183, 159, 0.98), rgba(251, 191, 36, 0.65));
    box-shadow: 0 0 26px rgba(233, 183, 159, 0.3);
}

.movement-chart__bar-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.movement-chart__bar-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    text-align: center;
}

.movement-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: #86efac;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.08);
}

.movement-live-pill.is-idle {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.25);
    color: #94a3b8;
    box-shadow: none;
}

.movement-live-pill__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: movement-live-blink 1.5s ease-in-out infinite;
}

.movement-live-pill.is-idle .movement-live-pill__dot {
    animation: none;
}

@keyframes movement-live-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.85); }
}

/* Section header ornament */
.movement-dashboard__eyebrow-icon {
    animation: movement-eyebrow-spin 12s linear infinite;
}

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

/* PR8Y prayer variant */
.movement-dashboard--prayer .movement-chart__bar {
    background: linear-gradient(to top, rgba(196, 168, 224, 0.95), rgba(34, 211, 238, 0.7));
}

.movement-dashboard--prayer .movement-globe__orbit--3 {
    border-color: rgba(251, 191, 36, 0.2);
}

.movement-dashboard--prayer .movement-mote {
    color: rgba(34, 211, 238, 0.4);
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
}

@media (prefers-reduced-motion: reduce) {
    .movement-dashboard__grid-lines,
    .movement-globe__orbit,
    .movement-globe__halo,
    .movement-globe__flare,
    .movement-mote,
    .movement-dashboard__constellation,
    .movement-globe__fallback-img,
    .movement-panel__clock::before,
    .movement-dashboard__eyebrow-icon {
        animation: none !important;
    }
}
