/* ============================================
   mystery.boo — Inflated 3D / Cool Grays
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(170deg, #1a1d23 0%, #22262f 40%, #1e2129 70%, #1a1d23 100%);
    background-attachment: fixed;
    color: #9ca3af;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- SVG Texture Layer --- */
.texture-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 800ms ease;
}

.texture-layer.visible {
    opacity: 1;
}

.texture-crosshatch {
    opacity: 1;
    transition: opacity 2000ms ease;
}

.texture-gestural {
    opacity: 0;
    transition: opacity 2000ms ease;
}

body.revelation-active .texture-gestural {
    opacity: 1;
}

body.revelation-active .texture-crosshatch {
    opacity: 0.3;
}

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

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
}

.aurora-violet-1 {
    width: 50vw;
    height: 50vw;
    top: 10%;
    left: -10%;
    background: radial-gradient(ellipse at center, rgba(139,92,246,0.08) 0%, transparent 70%);
    animation: aurora-drift-1 20s ease-in-out infinite;
}

.aurora-teal-1 {
    width: 40vw;
    height: 40vw;
    top: 30%;
    right: -5%;
    background: radial-gradient(ellipse at center, rgba(6,182,212,0.06) 0%, transparent 70%);
    animation: aurora-drift-2 23s ease-in-out infinite;
}

.aurora-violet-2 {
    width: 45vw;
    height: 45vw;
    bottom: 10%;
    left: 20%;
    background: radial-gradient(ellipse at center, rgba(139,92,246,0.06) 0%, transparent 70%);
    animation: aurora-drift-3 18s ease-in-out infinite;
}

.aurora-teal-2 {
    width: 35vw;
    height: 35vw;
    top: 60%;
    right: 15%;
    background: radial-gradient(ellipse at center, rgba(6,182,212,0.05) 0%, transparent 70%);
    animation: aurora-drift-4 25s ease-in-out infinite;
}

.aurora-blob.active {
    opacity: 1;
    transition: opacity 1500ms ease;
}

body.revelation-active .aurora-blob {
    filter: brightness(2);
    transition: filter 2000ms ease;
}

@keyframes aurora-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.06; }
    25% { transform: translate(5%, 8%) scale(1.1); opacity: 0.09; }
    50% { transform: translate(-3%, 12%) scale(0.95); opacity: 0.04; }
    75% { transform: translate(8%, -5%) scale(1.05); opacity: 0.07; }
}

@keyframes aurora-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.05; }
    25% { transform: translate(-8%, 5%) scale(0.9); opacity: 0.08; }
    50% { transform: translate(6%, -7%) scale(1.1); opacity: 0.03; }
    75% { transform: translate(-4%, 10%) scale(1); opacity: 0.07; }
}

@keyframes aurora-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(0.95); opacity: 0.05; }
    33% { transform: translate(10%, -8%) scale(1.08); opacity: 0.08; }
    66% { transform: translate(-6%, 5%) scale(0.92); opacity: 0.04; }
}

@keyframes aurora-drift-4 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.04; }
    30% { transform: translate(-12%, 6%) scale(1.1); opacity: 0.07; }
    60% { transform: translate(8%, -10%) scale(0.9); opacity: 0.05; }
}

/* --- Drifting Text Fragments --- */
.drifting-fragments {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.drift-text {
    position: absolute;
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    white-space: nowrap;
}

.drift-1 {
    top: 15%;
    opacity: 0.18;
    animation: drift-horizontal 45s linear infinite;
}

.drift-2 {
    top: 35%;
    opacity: 0.22;
    animation: drift-horizontal 55s linear infinite reverse;
    animation-delay: -10s;
}

.drift-3 {
    top: 55%;
    opacity: 0.15;
    animation: drift-horizontal 38s linear infinite;
    animation-delay: -20s;
}

.drift-4 {
    top: 72%;
    opacity: 0.20;
    animation: drift-horizontal 50s linear infinite reverse;
    animation-delay: -5s;
}

.drift-5 {
    top: 88%;
    opacity: 0.16;
    animation: drift-horizontal 42s linear infinite;
    animation-delay: -15s;
}

@keyframes drift-horizontal {
    0% { transform: translateX(-20%); left: -10%; }
    100% { transform: translateX(0); left: 110%; }
}

/* --- Keyhole SVG --- */
.keyhole-svg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40vmin;
    height: 80vmin;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2000ms ease;
}

.keyhole-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 3000ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.revelation-active .keyhole-svg {
    opacity: 1;
}

body.revelation-active .keyhole-path {
    stroke-dashoffset: 0;
}

/* --- Floating Eye Navigation --- */
.floating-eye {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    width: 48px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 500ms ease;
    padding: 0;
}

.floating-eye.visible {
    opacity: 1;
}

.eye-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.eye-outline {
    transition: stroke 300ms ease;
}

.eye-iris {
    transform-origin: 24px 16px;
    transition: transform 300ms ease, filter 300ms ease;
}

.floating-eye:hover .eye-iris {
    transform: scale(1.4);
    filter: drop-shadow(0 0 8px rgba(139,92,246,0.6));
}

.floating-eye:hover .eye-outline {
    stroke: #e2e6ec;
}

.eye-svg.blink .eye-outline,
.eye-svg.blink .eye-iris,
.eye-svg.blink .eye-pupil {
    transform: scaleY(0.1);
    transform-origin: center;
}

/* --- Overlay Navigation --- */
.overlay-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 80vw;
    height: 100vh;
    background: rgba(26,29,35,0.95);
    backdrop-filter: blur(20px);
    z-index: 99;
    transform: translateX(100%);
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-nav.open {
    transform: translateX(0);
}

.overlay-nav-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
}

.nav-item {
    font-family: 'Righteous', sans-serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2.4rem);
    letter-spacing: 0.02em;
    color: #e2e6ec;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 300ms ease, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), color 300ms ease;
}

.overlay-nav.open .nav-item {
    opacity: 1;
    transform: scale(1);
}

.overlay-nav.open .nav-item:nth-child(1) { transition-delay: 80ms; }
.overlay-nav.open .nav-item:nth-child(2) { transition-delay: 160ms; }
.overlay-nav.open .nav-item:nth-child(3) { transition-delay: 240ms; }
.overlay-nav.open .nav-item:nth-child(4) { transition-delay: 320ms; }
.overlay-nav.open .nav-item:nth-child(5) { transition-delay: 400ms; }

.nav-item:hover {
    color: #8b5cf6;
}

.nav-item:hover::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: #06b6d4;
    margin-top: 4px;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.hero-title {
    font-family: 'Bungee Shade', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 10vw, 9rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #b0b8c4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    line-height: 1.1;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: scale(0);
    will-change: transform, opacity;
}

.hero-title .letter.inflated {
    opacity: 1;
    transform: scale(1);
    animation: letter-inflate 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hero-title .letter.settled {
    animation: hero-settle 300ms ease forwards;
}

.hero-title .dot {
    color: #8b5cf6;
}

@keyframes letter-inflate {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes hero-settle {
    0% { transform: scale(1) translateY(0); }
    33% { transform: scale(1) translateY(-3px); }
    66% { transform: scale(1) translateY(1px); }
    100% { transform: scale(1) translateY(0); }
}

.hero-subtitle {
    font-family: 'Righteous', sans-serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2.4rem);
    letter-spacing: 0.02em;
    color: #e2e6ec;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease 200ms, transform 800ms ease 200ms;
    margin-top: 1.5rem;
}

.hero-subtitle.visible {
    opacity: 0.7;
    transform: translateY(0);
}

/* --- Content Layer --- */
.content-layer {
    position: relative;
    z-index: 5;
}

/* --- Flow Grid --- */
.flow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: minmax(100px, auto);
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: clamp(1.5rem, 4vw, 4rem);
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 20vh;
}

/* Grid span variations */
.span-3-2 {
    grid-column: span 3;
    grid-row: span 2;
}

.span-2-1 {
    grid-column: span 2;
    grid-row: span 1;
}

.span-2-2 {
    grid-column: span 2;
    grid-row: span 2;
}

.span-3-1 {
    grid-column: span 3;
    grid-row: span 1;
}

/* --- Inflated Panels --- */
.inflated-panel {
    background: rgba(42,46,55,0.6);
    border-radius: 2rem;
    box-shadow: 0 20px 80px rgba(0,0,0,0.35), inset 0 -4px 12px rgba(255,255,255,0.06);
    backdrop-filter: blur(2px);
    padding: clamp(1.5rem, 3vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    will-change: transform, opacity;
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 400ms ease;
    transform-style: preserve-3d;
    perspective: 800px;
}

.inflated-panel:hover {
    box-shadow: 0 28px 100px rgba(0,0,0,0.4), inset 0 -4px 12px rgba(255,255,255,0.08);
}

/* --- Inflated Decorative Shapes --- */
.inflated-shape {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    will-change: transform;
}

.shape-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 35% 30%, #3a3f4a 0%, #2a2e37 60%, #1e2128 100%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), inset 0 4px 8px rgba(255,255,255,0.05), inset 0 -6px 12px rgba(0,0,0,0.3);
    justify-self: center;
    align-self: center;
}

.shape-pill {
    width: 160px;
    height: 80px;
    border-radius: 40px;
    background: radial-gradient(ellipse at 35% 30%, #3a3f4a 0%, #2a2e37 60%, #1e2128 100%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), inset 0 4px 8px rgba(255,255,255,0.05), inset 0 -6px 12px rgba(0,0,0,0.3);
    justify-self: center;
    align-self: center;
}

.shape-keyhole {
    width: 100px;
    height: 140px;
    justify-self: center;
    align-self: center;
}

.shape-moon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 35% 30%, #3a3f4a 0%, #2a2e37 60%, #1e2128 100%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), inset 0 4px 8px rgba(255,255,255,0.05), inset 0 -6px 12px rgba(0,0,0,0.3);
    justify-self: center;
    align-self: center;
}

.inflated-shape svg {
    width: 60%;
    height: 60%;
}

.inflated-shape.emerged {
    opacity: 1;
    animation: float-bob 6s ease-in-out infinite;
}

@keyframes float-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

/* --- Typography --- */
.section-heading {
    font-family: 'Bungee Shade', sans-serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 4vw, 3.5rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #b0b8c4;
    line-height: 1.2;
}

.body-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #9ca3af;
}

.body-text.emphasized {
    color: #e2e6ec;
    font-weight: 500;
    font-style: italic;
}

.mono-label {
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    opacity: 0.6;
}

/* Aurora Rose accent — notification dot for mono-labels */
.mono-label::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e879a0;
    margin-right: 8px;
    vertical-align: middle;
}

/* --- Emergence Animations --- */
.emerge-left {
    transform: translateX(-60px) rotate(-5deg);
}

.emerge-right {
    transform: translateX(60px) rotate(5deg);
}

.emerge-inflate {
    transform: scale(0.7);
}

.emerge-drop {
    transform: translateY(-50px);
}

.emerge-left.emerged,
.emerge-right.emerged,
.emerge-inflate.emerged,
.emerge-drop.emerged {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Revelation Zone --- */
body.revelation-active .revelation-panel {
    box-shadow: 0 20px 80px rgba(0,0,0,0.35), inset 0 -4px 12px rgba(255,255,255,0.06), 0 0 60px rgba(139,92,246,0.05);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .aurora-blob {
        animation: none !important;
    }

    .drift-text {
        animation: none !important;
    }

    .inflated-shape.emerged {
        animation: none !important;
    }

    .hero-title .letter.inflated {
        animation: none !important;
        opacity: 1;
        transform: scale(1);
    }

    .hero-title .letter.settled {
        animation: none !important;
    }

    .emerge-left.emerged,
    .emerge-right.emerged,
    .emerge-inflate.emerged,
    .emerge-drop.emerged {
        transition: opacity 700ms ease !important;
        transform: none !important;
    }

    .keyhole-path {
        transition: none !important;
        stroke-dashoffset: 0 !important;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .flow-grid {
        grid-template-columns: 1fr;
    }

    .span-3-2,
    .span-2-1,
    .span-2-2,
    .span-3-1 {
        grid-column: span 1;
        grid-row: span 1;
    }

    .hero-title {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .overlay-nav {
        width: 100%;
        max-width: 100%;
    }

    .inflated-shape {
        width: 80px !important;
        height: 80px !important;
    }
}

@media (max-width: 480px) {
    .floating-eye {
        top: 1rem;
        right: 1rem;
    }

    .inflated-panel {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }
}
