/* ===========================================
   muhan.studio - Glassmorphism Architecture
   =========================================== */

/* --- Design Palette Reference ---
   #1A1614  Deep Warm Ground
   #2A2420  Dark Warm Edge
   #C4A070  Warm Glow Center
   #8A6A4A  Abstract Shape Fill A
   #6A4A8A  Abstract Shape Fill B
   #F0E8DC  Primary Text
   #B0A898  Secondary Text
   #D4A850  Accent Gold
   --- */

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.3vw, 1.05rem);
    line-height: 1.65;
    color: #B0A898;
    background: #1A1614;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Warm Luminous Background --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at 50% 30%,
        #C4A070 0%,
        rgba(196, 160, 112, 0.08) 25%,
        #2A2420 55%,
        #1A1614 80%
    );
    opacity: 0.95;
    z-index: 0;
    pointer-events: none;
}

/* --- Background Abstract Shapes --- */
#bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.shape-warm-1 {
    width: 380px;
    height: 320px;
    background: #8A6A4A;
    opacity: 0.08;
    top: 8%;
    left: 15%;
    border-radius: 60% 40% 50% 50%;
}

.shape-warm-2 {
    width: 280px;
    height: 280px;
    background: rgba(138, 106, 74, 0.06);
    top: 35%;
    right: 10%;
    border-radius: 50%;
}

.shape-purple-1 {
    width: 320px;
    height: 350px;
    background: #6A4A8A;
    opacity: 0.06;
    top: 20%;
    right: 25%;
    border-radius: 40% 60% 55% 45%;
}

.shape-warm-3 {
    width: 400px;
    height: 300px;
    background: rgba(138, 106, 74, 0.07);
    top: 55%;
    left: 5%;
    border-radius: 55% 45% 60% 40%;
}

.shape-purple-2 {
    width: 250px;
    height: 250px;
    background: rgba(106, 74, 138, 0.06);
    top: 65%;
    right: 20%;
    border-radius: 50%;
}

.shape-warm-4 {
    width: 350px;
    height: 280px;
    background: rgba(138, 106, 74, 0.08);
    top: 80%;
    left: 30%;
    border-radius: 45% 55% 50% 50%;
}

.shape-purple-3 {
    width: 300px;
    height: 300px;
    background: rgba(106, 74, 138, 0.06);
    top: 90%;
    left: 60%;
    border-radius: 50% 50% 40% 60%;
}

.shape-warm-5 {
    width: 260px;
    height: 340px;
    background: rgba(138, 106, 74, 0.07);
    top: 120%;
    right: 5%;
    border-radius: 40% 60% 50% 50%;
}

/* Gradient mesh effects */
.shape-mesh-1 {
    width: 500px;
    height: 500px;
    background: conic-gradient(
        from 45deg at 50% 50%,
        rgba(196, 160, 112, 0.04) 0deg,
        rgba(138, 106, 74, 0.06) 90deg,
        rgba(212, 168, 80, 0.03) 180deg,
        rgba(196, 160, 112, 0.05) 270deg,
        rgba(138, 106, 74, 0.04) 360deg
    );
    top: 40%;
    left: -5%;
    border-radius: 50%;
}

.shape-mesh-2 {
    width: 450px;
    height: 450px;
    background: conic-gradient(
        from 120deg at 50% 50%,
        rgba(212, 168, 80, 0.04) 0deg,
        rgba(106, 74, 138, 0.05) 120deg,
        rgba(196, 160, 112, 0.03) 240deg,
        rgba(212, 168, 80, 0.04) 360deg
    );
    top: 75%;
    right: -8%;
    border-radius: 50%;
}

/* --- Panels Container --- */
#panels-container {
    position: relative;
    z-index: 1;
    padding: 0 5vw;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Glass Panel Base --- */
.glass-panel {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 248, 240, 0.12);
    border: 1px solid rgba(255, 248, 240, 0.15);
    border-radius: 12px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, backdrop-filter 0.6s ease;
}

.glass-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Depth variations */
.glass-panel[data-depth="near"] {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-panel[data-depth="far"] {
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

/* Initially, panels start with strong blur before typewriter completes */
.glass-panel.typing {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

.glass-panel.typed {
    transition: backdrop-filter 0.8s ease;
}

.glass-panel.typed[data-depth="near"] {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-panel.typed[data-depth="mid"] {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-panel.typed[data-depth="far"] {
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

/* --- Typography --- */
h1 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    color: #F0E8DC;
    letter-spacing: 0.02em;
    margin-bottom: 0.5em;
}

h2 {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #F0E8DC;
    letter-spacing: 0.02em;
    margin-bottom: 0.8em;
}

p {
    color: #B0A898;
    margin-bottom: 1em;
    max-width: 55ch;
}

em {
    font-style: italic;
    color: #B0A898;
}

/* Korean text */
.korean-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    color: #F0E8DC;
    display: block;
    margin-bottom: 0.3em;
}

/* Studio marks */
.studio-mark {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: rgba(240, 232, 220, 0.35);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-top: 1.5em;
}

/* Typewriter cursor */
.typewriter-text {
    position: relative;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
}

.typewriter-text.typing::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #D4A850;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.6s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Section Layouts (Asymmetric Grid) --- */
.panel-section {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: clamp(60px, 10vh, 120px);
    position: relative;
}

/* Section 1: Hero - Large panel, left of center */
.section-hero {
    min-height: 100vh;
    align-items: center;
    padding-top: 25vh;
    margin-bottom: 0;
}

.panel-hero {
    grid-column: 2 / 9;
    grid-row: 1;
    text-align: left;
}

.hero-subtitle {
    margin-top: 0.5em;
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: #B0A898;
    display: block;
    margin-top: 0.2em;
}

/* Section 2: Philosophy - Two panels, staggered */
.section-philosophy {
    margin-top: -5vh;
}

.panel-philosophy-main {
    grid-column: 3 / 10;
    grid-row: 1;
    z-index: 2;
}

.panel-philosophy-accent {
    grid-column: 7 / 12;
    grid-row: 1;
    margin-top: 180px;
    z-index: 1;
}

/* Section 3: Practice - Narrow left, wide right */
.panel-practice-narrow {
    grid-column: 1 / 5;
    grid-row: 1;
}

.panel-practice-wide {
    grid-column: 5 / 13;
    grid-row: 1;
    margin-top: 60px;
}

/* Section 4: Work - Large top, small offset */
.panel-work-large {
    grid-column: 2 / 11;
    grid-row: 1;
}

.panel-work-small {
    grid-column: 8 / 13;
    grid-row: 1;
    margin-top: 260px;
    z-index: 2;
}

/* Work grid inside panel */
.work-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    margin: 1.5em 0;
}

.work-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 0.8em;
    border-bottom: 1px solid rgba(255, 248, 240, 0.08);
}

.work-title {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: #F0E8DC;
}

.work-meta {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: rgba(240, 232, 220, 0.35);
    letter-spacing: 0.05em;
}

/* Section 5: Studio - Three panels, cascading */
.section-studio {
    grid-template-rows: auto auto auto;
}

.panel-studio-top {
    grid-column: 1 / 8;
    grid-row: 1;
}

.panel-studio-mid {
    grid-column: 5 / 12;
    grid-row: 2;
    margin-top: -40px;
    z-index: 2;
}

.panel-studio-bottom {
    grid-column: 3 / 7;
    grid-row: 3;
    margin-top: -20px;
    padding: 1rem 1.5rem;
}

/* Section 6: Contact - Centered but offset */
.section-contact {
    margin-bottom: 30vh;
}

.panel-contact {
    grid-column: 4 / 11;
    grid-row: 1;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin-top: 1em;
}

.contact-link {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: #D4A850;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    cursor: pointer;
}

.contact-link:hover {
    color: #F0E8DC;
}

/* --- Overlap Pulse Effect --- */
.overlap-zone {
    animation: overlap-pulse 8s ease-in-out infinite;
}

@keyframes overlap-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 1.02; }
}

/* --- Scroll Indicator --- */
#scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    transition: opacity 0.5s ease;
}

#scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D4A850;
    animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #panels-container {
        padding: 0 4vw;
    }

    .panel-section {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .glass-panel {
        width: 100%;
        margin-top: 0 !important;
    }

    .panel-philosophy-accent,
    .panel-practice-wide,
    .panel-work-small,
    .panel-studio-mid,
    .panel-studio-bottom {
        margin-top: 0;
    }

    .section-hero {
        padding-top: 15vh;
        min-height: 70vh;
    }

    .work-item {
        flex-direction: column;
        gap: 0.3em;
    }

    .bg-shape {
        transform: scale(0.6);
    }
}

@media (max-width: 600px) {
    #panels-container {
        padding: 0 3vw;
    }

    .section-hero {
        padding-top: 12vh;
    }
}
