/* ───────────────────────────────────────────────
   Spatial Layout + Depth — Firm D v2
   ─────────────────────────────────────────────── */

* {
    box-sizing: border-box;
    cursor: none !important; /* custom cursor takes over */
}

body {
    background: radial-gradient(ellipse at 30% 20%, #0f1f3d 0%, #0a0e1a 50%, #030712 100%);
    min-height: 100vh;
    overflow: hidden;
    perspective: 1400px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#scene-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

.spatial-container {
    position: relative;
    width: 100%;
    height: 100vh;
    padding: 22px 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.spatial-header {
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}

.spatial-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 3px;
    background: linear-gradient(135deg, #c8d8ff 0%, #ffffff 50%, #b8d0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInDown 0.9s cubic-bezier(0.23, 1, 0.32, 1) 0.1s forwards;
}

.spatial-header h2 {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-8px);
    animation: fadeInDown 0.9s cubic-bezier(0.23, 1, 0.32, 1) 0.25s forwards;
}

.updated-at {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
    font-family: monospace;
    opacity: 0;
    animation: fadeIn 1s ease 0.5s forwards;
}

/* ── Spatial Grid ── */
.spatial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 18px;
    flex: 1;
    min-height: 0;
    position: relative;
    transform-style: preserve-3d;
}

/* Panel placement + staggered entrance */
#engineering-panel  { grid-area: 1 / 1 / 2 / 2; --depth: 1;   animation-delay: 0.35s; }
#marketing-panel    { grid-area: 1 / 2 / 2 / 3; --depth: 2;   animation-delay: 0.45s; }
#intelligence-panel { grid-area: 1 / 3 / 2 / 4; --depth: 3;   animation-delay: 0.55s; }
#security-panel     { grid-area: 2 / 1 / 3 / 2; --depth: 1.5; animation-delay: 0.55s; }
#operations-panel   { grid-area: 2 / 2 / 3 / 4; --depth: 2.5; animation-delay: 0.65s; }

.glass-panel {
    animation: panelEntrance 0.9s cubic-bezier(0.23, 1, 0.32, 1) both;
    transform-style: preserve-3d;
}

/* ── Animations ── */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes panelEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Micro-ambient grid lines ── */
.spatial-container::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.5) 0%, transparent 75%);
}

/* ── Corner vignette ── */
.spatial-container::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .spatial-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    #engineering-panel  { grid-area: auto; }
    #marketing-panel    { grid-area: auto; }
    #intelligence-panel { grid-area: auto; }
    #security-panel     { grid-area: auto; }
    #operations-panel   { grid-column: span 2; }
}

@media (max-width: 768px) {
    body { overflow-y: auto; }
    .spatial-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    #operations-panel { grid-column: span 1; }
    .spatial-header h1 { font-size: 1.8rem; }
}
