/* muhan.studio - Glassmorphic Infinite Atrium */

/* CSS Custom Properties */
:root {
    --glacier-white: #edf2f8;
    --frosted-periwinkle: #c8daf0;
    --twilight-navy: #1a2744;
    --slate-drift: #3a4d6e;
    --celestial-iris: #6b8cce;
    --lavender-steel: #7b93b8;
    --aurora-frost: #a3c4f3;
    --veined-alabaster: #f7f4f0;
    --rose-quartz: #e8c4c4;

    --depth-1-blur: 20px;
    --depth-2-blur: 40px;
    --depth-3-blur: 60px;

    --font-headline: 'Inter', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-accent: 'Space Mono', monospace;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--glacier-white);
    color: var(--slate-drift);
}

body {
    position: relative;
}

/* SVG Definitions - hidden */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Marble Background Layer */
.marble-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

.marble-svg {
    width: 100%;
    height: 100%;
}

/* Floating Particles */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: rgba(107, 140, 206, 0.08);
    will-change: transform;
    animation: particleFloat var(--dur) ease-in-out var(--delay) infinite;
}

.particle-triangle {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.particle-pentagon {
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.particle-lemniscate-frag {
    clip-path: ellipse(50% 25% at 50% 50%);
    border-radius: 50%;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(90deg);
    }
    50% {
        transform: translateY(10px) rotate(180deg);
    }
    75% {
        transform: translateY(-30px) rotate(270deg);
    }
}

/* Dashboard Grid */
.dashboard-grid {
    position: relative;
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 25vh);
    z-index: 2;
    padding: 16px;
    gap: 0;
}

/* Infinity Corridor */
.infinity-corridor {
    grid-column: 3 / 5;
    grid-row: 1 / 5;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    position: relative;
}

.corridor-lemniscate {
    width: 200px;
    height: 100px;
    opacity: 0;
    animation: corridorFadeIn 2s ease-out 4s forwards;
}

.corridor-lemniscate .lemniscate-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: lemniscateDraw 12s ease-in-out 5s infinite;
    stroke-opacity: 0.25;
}

@keyframes lemniscateDraw {
    0% {
        stroke-dashoffset: 800;
        stroke-opacity: 0.15;
    }
    40% {
        stroke-dashoffset: 0;
        stroke-opacity: 0.35;
    }
    55% {
        stroke-dashoffset: 0;
        stroke-opacity: 0.35;
    }
    100% {
        stroke-dashoffset: -800;
        stroke-opacity: 0.15;
    }
}

@keyframes corridorFadeIn {
    to { opacity: 1; }
}

.corridor-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: rgba(107, 140, 206, 0.08);
    box-shadow: 0 0 40px rgba(107, 140, 206, 0.06), 0 0 80px rgba(107, 140, 206, 0.03);
    opacity: 0;
    animation: corridorGlowIn 3s ease-out 3s forwards;
}

@keyframes corridorGlowIn {
    to { opacity: 1; }
}

/* Panel Base Styles */
.panel {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    overflow: hidden;
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                backdrop-filter 0.6s ease,
                -webkit-backdrop-filter 0.6s ease,
                box-shadow 0.6s ease;
}

.panel-penrose {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    pointer-events: none;
}

.panel-content {
    position: relative;
    z-index: 2;
    padding: 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Layer 1 - Foreground */
.panel-layer1 {
    backdrop-filter: blur(var(--depth-1-blur));
    -webkit-backdrop-filter: blur(var(--depth-1-blur));
    background: rgba(200, 218, 240, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 8px 32px rgba(31, 38, 135, 0.12);
    z-index: 10;
}

/* Layer 2 - Midground */
.panel-layer2 {
    backdrop-filter: blur(var(--depth-2-blur));
    -webkit-backdrop-filter: blur(var(--depth-2-blur));
    background: rgba(180, 200, 230, 0.15);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 8px 32px rgba(31, 38, 135, 0.08);
    z-index: 6;
}

/* Layer 3 - Background */
.panel-layer3 {
    backdrop-filter: blur(var(--depth-3-blur));
    -webkit-backdrop-filter: blur(var(--depth-3-blur));
    background: rgba(160, 185, 220, 0.08);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 8px 32px rgba(31, 38, 135, 0.05);
    z-index: 3;
}

/* Panel Grid Positions - Layer 3 (Background) */
.panel-bg-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.panel-bg-2 {
    grid-column: 4 / 7;
    grid-row: 2 / 4;
}

.panel-bg-3 {
    grid-column: 1 / 4;
    grid-row: 3 / 5;
}

/* Panel Grid Positions - Layer 2 (Midground) */
.panel-mid-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
}

.panel-mid-2 {
    grid-column: 5 / 7;
    grid-row: 1 / 3;
}

.panel-mid-3 {
    grid-column: 1 / 3;
    grid-row: 3 / 5;
}

/* Panel Grid Positions - Layer 1 (Foreground) */
.panel-fg-1 {
    grid-column: 1 / 4;
    grid-row: 1 / 3;
}

.panel-fg-2 {
    grid-column: 4 / 7;
    grid-row: 1 / 2;
}

.panel-fg-3 {
    grid-column: 5 / 7;
    grid-row: 2 / 4;
}

.panel-fg-4 {
    grid-column: 2 / 5;
    grid-row: 3 / 5;
}

/* Panel Hover Effects */
.panel:hover {
    transform: scale(1.02) translateZ(10px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 12px 40px rgba(31, 38, 135, 0.16);
}

.panel-layer1:hover {
    --depth-1-blur: 15px;
}

.panel-layer2:hover {
    --depth-2-blur: 35px;
}

/* Gradient Mask for organic focal point */
.panel-layer1::before,
.panel-layer2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 40%, rgba(0,0,0,0.6) 100%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 40%, rgba(0,0,0,0.6) 100%);
    background: inherit;
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
}

/* Panel Reveal Animations */
@keyframes panelReveal1 {
    from {
        opacity: 0;
        clip-path: circle(0% at 50% 50%);
    }
    to {
        opacity: 1;
        clip-path: circle(150% at 50% 50%);
    }
}

@keyframes panelReveal2 {
    from {
        opacity: 0;
        clip-path: circle(0% at 30% 40%);
    }
    to {
        opacity: 1;
        clip-path: circle(150% at 30% 40%);
    }
}

@keyframes panelReveal3 {
    from {
        opacity: 0;
        clip-path: circle(0% at 70% 60%);
    }
    to {
        opacity: 1;
        clip-path: circle(150% at 70% 60%);
    }
}

@keyframes panelReveal4 {
    from {
        opacity: 0;
        clip-path: circle(0% at 20% 80%);
    }
    to {
        opacity: 1;
        clip-path: circle(150% at 20% 80%);
    }
}

@keyframes panelReveal5 {
    from {
        opacity: 0;
        clip-path: circle(0% at 80% 20%);
    }
    to {
        opacity: 1;
        clip-path: circle(150% at 80% 20%);
    }
}

@keyframes panelReveal6 {
    from {
        opacity: 0;
        clip-path: circle(0% at 60% 70%);
    }
    to {
        opacity: 1;
        clip-path: circle(150% at 60% 70%);
    }
}

@keyframes panelRevealBg {
    from {
        opacity: 0;
        clip-path: circle(0% at 50% 50%);
    }
    to {
        opacity: 1;
        clip-path: circle(160% at 50% 50%);
    }
}

/* Phase 1: First panel appears */
.panel-fg-1.revealed {
    animation: panelReveal1 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Phase 2: Additional panels stagger in */
.panel-fg-2.revealed {
    animation: panelReveal2 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-fg-3.revealed {
    animation: panelReveal3 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-fg-4.revealed {
    animation: panelReveal4 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-mid-1.revealed {
    animation: panelReveal5 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-mid-2.revealed {
    animation: panelReveal6 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-mid-3.revealed {
    animation: panelReveal2 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-bg-1.revealed {
    animation: panelRevealBg 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-bg-2.revealed {
    animation: panelRevealBg 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.panel-bg-3.revealed {
    animation: panelRevealBg 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Typography */
.panel-headline {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--twilight-navy);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
    mix-blend-mode: normal;
    margin-bottom: 12px;
}

.panel-headline .dot {
    color: var(--celestial-iris);
}

.panel-title {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--twilight-navy);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
    mix-blend-mode: normal;
    margin-bottom: 10px;
}

.panel-label {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lavender-steel);
    mix-blend-mode: normal;
    margin-bottom: 8px;
    display: block;
}

.panel-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--slate-drift);
    mix-blend-mode: normal;
    max-width: 480px;
}

.panel-text em {
    font-style: italic;
    color: var(--celestial-iris);
}

/* Infinity Watermark */
.infinity-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-accent);
    font-size: 200px;
    color: var(--celestial-iris);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
}

/* Corner Filigree */
.filigree {
    position: absolute;
    width: 32px;
    height: 32px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

@media (min-width: 1024px) {
    .filigree {
        opacity: 1;
    }
}

.filigree-tl {
    top: 8px;
    left: 8px;
    transform: rotate(0deg);
}

.filigree-tr {
    top: 8px;
    right: 8px;
    transform: rotate(90deg);
}

.filigree-bl {
    bottom: 8px;
    left: 8px;
    transform: rotate(-90deg);
}

.filigree-br {
    bottom: 8px;
    right: 8px;
    transform: rotate(180deg);
}

/* Mobile Luminous Divider */
.mobile-divider {
    display: none;
}

/* Responsive - Mobile Layout */
@media (max-width: 767px) {
    html, body {
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        gap: 16px;
        padding: 16px;
    }

    .infinity-corridor {
        display: none;
    }

    .mobile-divider {
        display: block;
        position: fixed;
        left: 50%;
        top: 0;
        transform: translateX(-50%);
        width: 2px;
        height: 100%;
        background: rgba(107, 140, 206, 0.1);
        box-shadow: 0 0 20px rgba(107, 140, 206, 0.05);
        z-index: 1;
        pointer-events: none;
    }

    .panel {
        grid-column: unset !important;
        grid-row: unset !important;
        min-height: 200px;
        border-radius: 20px;
    }

    .panel-layer3 {
        display: none;
    }

    .panel-fg-1 { order: 1; }
    .panel-fg-2 { order: 2; }
    .panel-mid-1 { order: 3; }
    .panel-fg-3 { order: 4; }
    .panel-mid-2 { order: 5; }
    .panel-fg-4 { order: 6; }
    .panel-mid-3 { order: 7; }

    /* Alternating slide-in from left/right */
    .panel-fg-1.revealed { animation: slideFromLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .panel-fg-2.revealed { animation: slideFromRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .panel-mid-1.revealed { animation: slideFromLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .panel-fg-3.revealed { animation: slideFromRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .panel-mid-2.revealed { animation: slideFromLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .panel-fg-4.revealed { animation: slideFromRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
    .panel-mid-3.revealed { animation: slideFromLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

    .panel-headline {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .panel-title {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }

    .infinity-watermark {
        font-size: 120px;
    }
}

@keyframes slideFromLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tablet adjustment */
@media (min-width: 768px) and (max-width: 1023px) {
    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(5, 20vh);
    }

    .infinity-corridor {
        grid-column: 2 / 4;
        grid-row: 1 / 6;
    }

    .panel-bg-1 { grid-column: 1 / 3; grid-row: 1 / 3; }
    .panel-bg-2 { grid-column: 3 / 5; grid-row: 2 / 4; }
    .panel-bg-3 { grid-column: 1 / 3; grid-row: 3 / 5; }

    .panel-mid-1 { grid-column: 1 / 2; grid-row: 1 / 2; }
    .panel-mid-2 { grid-column: 4 / 5; grid-row: 1 / 3; }
    .panel-mid-3 { grid-column: 1 / 2; grid-row: 4 / 6; }

    .panel-fg-1 { grid-column: 1 / 3; grid-row: 1 / 3; }
    .panel-fg-2 { grid-column: 3 / 5; grid-row: 1 / 2; }
    .panel-fg-3 { grid-column: 3 / 5; grid-row: 3 / 5; }
    .panel-fg-4 { grid-column: 1 / 4; grid-row: 4 / 6; }
}

/* Hover corridor glow enhancement */
.panel:hover ~ .infinity-corridor .corridor-glow {
    box-shadow: 0 0 60px rgba(107, 140, 206, 0.2), 0 0 120px rgba(107, 140, 206, 0.08);
}

/* Rose Quartz accent in corridor */
.infinity-corridor::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 40%;
    background: rgba(232, 196, 196, 0.15);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    animation: roseQuartzPulse 8s ease-in-out 6s infinite;
}

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