/* ==========================================================================
   misty.day - Inflated 3D Through Fog
   MiRiS game-making circle portal
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --fog-deep: #18161E;
    --fog-mid: #22202A;
    --misty-lavender: #E8E0F8;
    --purple-haze: #B0A8C0;
    --muted-gold: #D0C8A0;
    --fog-pink: #C0889C;
    --fog-teal: #68A0A0;
    --diffused-white: rgba(255, 255, 255, 0.06);

    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-accent: 'Space Grotesk', sans-serif;

    --radius-inflated: 40px;
    --radius-inflated-sm: 28px;
    --radius-bubble: 50%;

    --shadow-inflated: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.05);
    --shadow-inflated-deep: 0 12px 48px rgba(0, 0, 0, 0.4), inset 0 2px 6px rgba(255, 255, 255, 0.06);
    --shadow-bubble: 0 6px 20px rgba(0, 0, 0, 0.25);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.8;
    font-weight: 400;
    color: var(--purple-haze);
    background-color: var(--fog-deep);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Fog Particle Atmosphere --- */
#fog-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.fog-particle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    will-change: transform;
}

.fog-particle-1 {
    width: 500px;
    height: 500px;
    background: var(--fog-pink);
    opacity: 0.05;
    top: -10%;
    left: -5%;
    animation: fogDrift1 28s ease-in-out infinite;
}

.fog-particle-2 {
    width: 600px;
    height: 600px;
    background: var(--fog-teal);
    opacity: 0.04;
    top: 20%;
    right: -10%;
    animation: fogDrift2 35s ease-in-out infinite;
}

.fog-particle-3 {
    width: 450px;
    height: 450px;
    background: var(--fog-pink);
    opacity: 0.045;
    bottom: 10%;
    left: 30%;
    animation: fogDrift3 32s ease-in-out infinite;
}

.fog-particle-4 {
    width: 550px;
    height: 550px;
    background: var(--fog-teal);
    opacity: 0.05;
    top: 50%;
    left: -15%;
    animation: fogDrift4 25s ease-in-out infinite;
}

.fog-particle-5 {
    width: 400px;
    height: 400px;
    background: var(--fog-pink);
    opacity: 0.04;
    top: 70%;
    right: 10%;
    animation: fogDrift5 30s ease-in-out infinite;
}

.fog-particle-6 {
    width: 650px;
    height: 650px;
    background: var(--fog-teal);
    opacity: 0.05;
    top: -5%;
    right: 30%;
    animation: fogDrift6 38s ease-in-out infinite;
}

.fog-particle-7 {
    width: 350px;
    height: 350px;
    background: var(--fog-pink);
    opacity: 0.06;
    bottom: -5%;
    right: -5%;
    animation: fogDrift7 22s ease-in-out infinite;
}

.fog-particle-8 {
    width: 480px;
    height: 480px;
    background: var(--fog-teal);
    opacity: 0.04;
    top: 35%;
    left: 50%;
    animation: fogDrift8 40s ease-in-out infinite;
}

/* Fog Drift Keyframes */
@keyframes fogDrift1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(80px, 40px); }
    50% { transform: translate(40px, 80px); }
    75% { transform: translate(-30px, 50px); }
}

@keyframes fogDrift2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-60px, 30px); }
    50% { transform: translate(-100px, -40px); }
    75% { transform: translate(-40px, -60px); }
}

@keyframes fogDrift3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, -40px); }
    50% { transform: translate(-30px, -70px); }
    75% { transform: translate(40px, -20px); }
}

@keyframes fogDrift4 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(70px, -50px); }
    50% { transform: translate(120px, 20px); }
    75% { transform: translate(60px, 60px); }
}

@keyframes fogDrift5 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-50px, -30px); }
    50% { transform: translate(-80px, 40px); }
    75% { transform: translate(-20px, 60px); }
}

@keyframes fogDrift6 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(40px, 50px); }
    50% { transform: translate(-40px, 90px); }
    75% { transform: translate(-70px, 30px); }
}

@keyframes fogDrift7 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(60px, -40px); }
    50% { transform: translate(30px, -80px); }
    75% { transform: translate(-30px, -50px); }
}

@keyframes fogDrift8 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-70px, 40px); }
    50% { transform: translate(-40px, -30px); }
    75% { transform: translate(30px, -60px); }
}

/* Fog scroll response class */
.fog-active .fog-particle {
    animation-duration: 8s !important;
}

/* --- Inflated Bubble Decorations --- */
#bubble-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    box-shadow: var(--shadow-bubble);
    opacity: 0;
    transform: scale(0);
    transition: none;
}

.bubble.bubble-visible {
    opacity: 1;
    transform: scale(1);
}

.bubble-1 {
    width: 80px;
    height: 80px;
    top: 8%;
    left: 12%;
    background: radial-gradient(ellipse at 30% 30%, rgba(192, 136, 156, 0.15) 0%, rgba(192, 136, 156, 0.03) 60%);
    animation: bubbleBob1 8s ease-in-out infinite;
}

.bubble-2 {
    width: 120px;
    height: 120px;
    top: 15%;
    right: 8%;
    background: radial-gradient(ellipse at 30% 30%, rgba(104, 160, 160, 0.12) 0%, rgba(104, 160, 160, 0.02) 60%);
    animation: bubbleBob2 10s ease-in-out infinite;
}

.bubble-3 {
    width: 50px;
    height: 50px;
    top: 30%;
    left: 5%;
    background: radial-gradient(ellipse at 30% 30%, rgba(208, 200, 160, 0.14) 0%, rgba(208, 200, 160, 0.03) 60%);
    animation: bubbleBob3 7s ease-in-out infinite;
}

.bubble-4 {
    width: 100px;
    height: 100px;
    top: 45%;
    right: 15%;
    background: radial-gradient(ellipse at 30% 30%, rgba(192, 136, 156, 0.12) 0%, rgba(192, 136, 156, 0.02) 60%);
    animation: bubbleBob4 9s ease-in-out infinite;
}

.bubble-5 {
    width: 65px;
    height: 65px;
    top: 55%;
    left: 20%;
    background: radial-gradient(ellipse at 30% 30%, rgba(104, 160, 160, 0.15) 0%, rgba(104, 160, 160, 0.03) 60%);
    animation: bubbleBob5 6s ease-in-out infinite;
}

.bubble-6 {
    width: 90px;
    height: 90px;
    top: 70%;
    right: 25%;
    background: radial-gradient(ellipse at 30% 30%, rgba(208, 200, 160, 0.12) 0%, rgba(208, 200, 160, 0.02) 60%);
    animation: bubbleBob6 8s ease-in-out infinite;
}

.bubble-7 {
    width: 45px;
    height: 45px;
    top: 22%;
    left: 45%;
    background: radial-gradient(ellipse at 30% 30%, rgba(192, 136, 156, 0.14) 0%, rgba(192, 136, 156, 0.03) 60%);
    animation: bubbleBob7 7s ease-in-out infinite;
}

.bubble-8 {
    width: 110px;
    height: 110px;
    top: 82%;
    left: 8%;
    background: radial-gradient(ellipse at 30% 30%, rgba(104, 160, 160, 0.12) 0%, rgba(104, 160, 160, 0.02) 60%);
    animation: bubbleBob8 10s ease-in-out infinite;
}

.bubble-9 {
    width: 70px;
    height: 70px;
    top: 60%;
    left: 65%;
    background: radial-gradient(ellipse at 30% 30%, rgba(208, 200, 160, 0.15) 0%, rgba(208, 200, 160, 0.03) 60%);
    animation: bubbleBob9 9s ease-in-out infinite;
}

.bubble-10 {
    width: 55px;
    height: 55px;
    top: 40%;
    left: 75%;
    background: radial-gradient(ellipse at 30% 30%, rgba(192, 136, 156, 0.13) 0%, rgba(192, 136, 156, 0.02) 60%);
    animation: bubbleBob10 6s ease-in-out infinite;
}

/* Bubble Bobbing Keyframes */
@keyframes bubbleBob1 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1); }
}

@keyframes bubbleBob2 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1); }
}

@keyframes bubbleBob3 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1); }
}

@keyframes bubbleBob4 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-18px) scale(1); }
}

@keyframes bubbleBob5 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1); }
}

@keyframes bubbleBob6 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-16px) scale(1); }
}

@keyframes bubbleBob7 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1); }
}

@keyframes bubbleBob8 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1); }
}

@keyframes bubbleBob9 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-14px) scale(1); }
}

@keyframes bubbleBob10 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-11px) scale(1); }
}

/* --- Content Grid - Broken Grid Layout --- */
#content-grid {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 100px 40px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Inflated Panel Base --- */
.inflated-panel {
    background: var(--fog-mid);
    background-image: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 60%);
    border-radius: var(--radius-inflated);
    box-shadow: var(--shadow-inflated);
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    transition: opacity 0.4s ease, box-shadow 0.4s ease, transform 0.1s ease;
    will-change: transform;
    transform-style: preserve-3d;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.inflated-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-inflated);
    background: radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.panel-inner {
    position: relative;
    z-index: 2;
}

/* Depth Layer System */
.depth-foreground {
    z-index: 30;
    opacity: 1;
}

.depth-midground {
    z-index: 20;
    opacity: 0.85;
}

.depth-background {
    z-index: 10;
    opacity: 0.7;
}

/* Depth promotion on scroll */
.inflated-panel.depth-promoted {
    opacity: 1 !important;
    z-index: 30 !important;
    box-shadow: var(--shadow-inflated-deep) !important;
}

/* --- Hero Panel --- */
#hero-panel {
    grid-column: 2 / 11;
    grid-row: 1;
    text-align: center;
    padding: 80px 60px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    filter: blur(20px);
    transform: scale(0.9);
}

#hero-panel.hero-revealed {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    transition: opacity 0.8s ease-out, filter 0.8s ease-out, transform 0.8s ease-out;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--misty-lavender);
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--purple-haze);
    margin-bottom: 12px;
    line-height: 1.8;
}

.hero-accent {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--muted-gold);
    display: block;
}

/* --- About Panel --- */
#about-panel {
    grid-column: 1 / 6;
    grid-row: 2;
    margin-top: -30px;
}

/* --- Philosophy Panel --- */
#philosophy-panel {
    grid-column: 5 / 12;
    grid-row: 2;
    margin-top: 40px;
}

/* --- Works Panel --- */
#works-panel {
    grid-column: 2 / 13;
    grid-row: 3;
    margin-top: -20px;
}

/* --- Process Panel --- */
#process-panel {
    grid-column: 1 / 7;
    grid-row: 4;
    margin-top: -40px;
}

/* --- Members Panel --- */
#members-panel {
    grid-column: 6 / 13;
    grid-row: 4;
    margin-top: 20px;
}

/* --- Journal Panel --- */
#journal-panel {
    grid-column: 1 / 11;
    grid-row: 5;
    margin-top: -30px;
}

/* --- Contact Panel --- */
#contact-panel {
    grid-column: 4 / 12;
    grid-row: 6;
    margin-top: -20px;
    text-align: center;
}

/* --- Panel Typography --- */
.panel-tag {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--muted-gold);
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}

.panel-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--misty-lavender);
    margin-bottom: 20px;
    line-height: 1.15;
}

.panel-body {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.8;
    font-weight: 400;
    color: var(--purple-haze);
    max-width: 600px;
}

/* --- Works Grid --- */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.work-item {
    padding: 32px 24px;
    text-align: center;
}

.work-orb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.orb-pink {
    background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.15) 0%, var(--fog-pink) 60%);
}

.orb-teal {
    background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.15) 0%, var(--fog-teal) 60%);
}

.orb-gold {
    background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.2) 0%, var(--muted-gold) 60%);
}

.work-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--misty-lavender);
    margin-bottom: 8px;
}

.work-desc {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--purple-haze);
}

/* --- Glassmorphic Card --- */
.glassmorphic-card {
    background: rgba(34, 32, 42, 0.6);
    background-image: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
    border-radius: var(--radius-inflated-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* --- Members Row --- */
.members-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.member-bubble {
    text-align: center;
}

.member-orb {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.1) 0%, var(--fog-mid) 60%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.member-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--misty-lavender);
    margin-bottom: 4px;
}

.member-role {
    display: block;
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--muted-gold);
}

/* --- Journal Entries --- */
.journal-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.journal-entry {
    padding: 28px 24px;
}

.journal-date {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--muted-gold);
    display: block;
    margin-bottom: 10px;
}

.journal-heading {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--misty-lavender);
    margin-bottom: 10px;
    line-height: 1.3;
}

.journal-excerpt {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--purple-haze);
}

/* --- Contact --- */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 24px;
}

.contact-link {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--fog-teal);
    padding: 12px 28px;
    border-radius: 24px;
    background: rgba(104, 160, 160, 0.08);
    border: 1px solid rgba(104, 160, 160, 0.15);
    transition: background 0.3s ease, color 0.3s ease;
}

.contact-link:hover {
    background: rgba(104, 160, 160, 0.15);
    color: var(--misty-lavender);
}

/* --- Footer --- */
#site-footer {
    position: relative;
    z-index: 5;
    padding: 60px 40px 40px;
    text-align: center;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.footer-mark {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--misty-lavender);
    opacity: 0.4;
}

.footer-divider {
    width: 1px;
    height: 16px;
    background: var(--purple-haze);
    opacity: 0.2;
}

.footer-text {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--purple-haze);
    opacity: 0.4;
}

/* --- Scroll Reveal for Panels --- */
.inflated-panel:not(#hero-panel) {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.inflated-panel:not(#hero-panel).panel-visible {
    transform: translateY(0);
}

.inflated-panel:not(#hero-panel).panel-visible.depth-foreground {
    opacity: 1;
}

.inflated-panel:not(#hero-panel).panel-visible.depth-midground {
    opacity: 0.85;
}

.inflated-panel:not(#hero-panel).panel-visible.depth-background {
    opacity: 0.7;
}

.inflated-panel:not(#hero-panel).panel-visible.depth-promoted {
    opacity: 1;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    #content-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 80px 20px 60px;
    }

    #hero-panel,
    #about-panel,
    #philosophy-panel,
    #works-panel,
    #process-panel,
    #members-panel,
    #journal-panel,
    #contact-panel {
        margin-top: 0;
    }

    .inflated-panel {
        padding: 36px 24px;
        border-radius: 32px;
    }

    #hero-panel {
        min-height: 300px;
        padding: 60px 24px;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .members-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .journal-entries {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    /* Reduce bubbles on mobile */
    .bubble-6, .bubble-7, .bubble-8, .bubble-9, .bubble-10 {
        display: none;
    }

    /* Reduce fog particles on mobile */
    .fog-particle-5, .fog-particle-6, .fog-particle-7, .fog-particle-8 {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .panel-title {
        font-size: 1.4rem;
    }

    .members-row {
        grid-template-columns: 1fr 1fr;
    }
}
