/* ========================================
   yongzoon.xyz - Memphis-Classical Fusion
   Bento-Box Dreamy Ethereal Experience
   ======================================== */

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

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: #2D2D2D;
    background-color: #F5F0E8;
    overflow: hidden;
    height: 100%;
}

/* ---------- Typography ---------- */
.display-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 9vw, 8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 0.95;
    color: #1E4D2B;
    text-shadow: 0 2px 20px rgba(30, 77, 43, 0.3);
}

.subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.8rem, 1vw, 1rem);
    letter-spacing: 0.04em;
    color: #7DA88E;
    margin-top: 1rem;
}

.body-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: #2D2D2D;
    margin-top: 1.5rem;
    max-width: 38ch;
}

.accent-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    letter-spacing: 0.04em;
    color: #F0EDE8;
}

.typo-fragment {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #1E4D2B;
    opacity: 0.15;
    letter-spacing: 0.05em;
}

/* ---------- Radial Navigation ---------- */
#nav-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2A2A2F;
    border: 1px solid #C8A96E;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    backdrop-filter: blur(8px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

#nav-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(200, 169, 110, 0.3);
}

#nav-toggle svg {
    transition: transform 0.3s ease;
}

#nav-toggle.active svg {
    transform: rotate(180deg);
}

#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 42, 47, 0);
    backdrop-filter: blur(0px);
    z-index: 999;
    pointer-events: none;
    transition: background-color 0.5s ease, backdrop-filter 0.5s ease;
}

#nav-overlay.active {
    background-color: rgba(42, 42, 47, 0.6);
    backdrop-filter: blur(4px);
    pointer-events: all;
}

#nav-menu {
    position: fixed;
    top: 24px;
    right: 24px;
    transform-origin: top right;
}

.nav-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    opacity: 0;
    transform: scale(0) translate(0, 0);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.nav-item.visible {
    opacity: 1;
    pointer-events: all;
}

.nav-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #2A2A2F;
    border: 1px solid #C8A96E;
    display: block;
    transition: background-color 0.2s ease;
}

.nav-item:hover .nav-circle {
    background-color: #1E4D2B;
}

.nav-label {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.75rem;
    color: #F0EDE8;
    margin-top: 4px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ---------- Particle Canvas ---------- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
}

/* ---------- Plates Container ---------- */
#plates-container {
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.plate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: filter 0.8s ease-in-out, opacity 0.8s ease-in-out;
    will-change: filter, opacity;
}

.plate.blur-out {
    filter: blur(6px);
    opacity: 0.4;
}

.plate.blur-in {
    filter: blur(10px);
    opacity: 0;
}

.plate.active {
    filter: blur(0px);
    opacity: 1;
}

.plate.hidden {
    filter: blur(10px);
    opacity: 0;
    pointer-events: none;
}

/* ---------- Bento Grid ---------- */
.bento-grid {
    display: grid;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 900px;
    gap: 1px;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 4px,
        rgba(200, 169, 110, 0.15) 4px,
        rgba(200, 169, 110, 0.15) 5px
    );
}

/* Plate 1 Grid */
.plate-1-grid {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 2fr 0.5fr 1fr;
    grid-template-areas:
        "hero-a accent-b accent-d"
        "memphis-c memphis-c memphis-c"
        "atmos-e atmos-e terrazzo-f";
}

.plate-1-grid .cell-a { grid-area: hero-a; }
.plate-1-grid .cell-b { grid-area: accent-b; }
.plate-1-grid .cell-c { grid-area: memphis-c; }
.plate-1-grid .cell-d { grid-area: accent-d; }
.plate-1-grid .cell-e { grid-area: atmos-e; }
.plate-1-grid .cell-f { grid-area: terrazzo-f; }

/* Plate 2 Grid */
.plate-2-grid {
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 2fr 0.5fr 1fr;
    grid-template-areas:
        "arch-g hero-h stairs-j"
        "memphis-i memphis-i memphis-i"
        "dark-k dark-k terrazzo-l";
}

.plate-2-grid .cell-g { grid-area: arch-g; }
.plate-2-grid .cell-h { grid-area: hero-h; }
.plate-2-grid .cell-i { grid-area: memphis-i; }
.plate-2-grid .cell-j { grid-area: stairs-j; }
.plate-2-grid .cell-k { grid-area: dark-k; }
.plate-2-grid .cell-l { grid-area: terrazzo-l; }

/* Plate 3 Grid */
.plate-3-grid {
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 2fr 0.5fr 1fr;
    grid-template-areas:
        "book-m hero-n frag-p"
        "memphis-o memphis-o memphis-o"
        "dark-q dark-q terrazzo-r";
}

.plate-3-grid .cell-m { grid-area: book-m; }
.plate-3-grid .cell-n { grid-area: hero-n; }
.plate-3-grid .cell-o { grid-area: memphis-o; }
.plate-3-grid .cell-p { grid-area: frag-p; }
.plate-3-grid .cell-q { grid-area: dark-q; }
.plate-3-grid .cell-r { grid-area: terrazzo-r; }

/* Plate 4 Grid */
.plate-4-grid {
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 1.5fr 0.5fr 1.5fr 0.5fr;
    grid-template-areas:
        "terrarium-s hero-t frag-w"
        "memphis-u memphis-u memphis-u"
        "rosette-v rosette-v terrazzo-x"
        "rosette-v rosette-v terrazzo-x";
}

.plate-4-grid .cell-s { grid-area: terrarium-s; }
.plate-4-grid .cell-t { grid-area: hero-t; }
.plate-4-grid .cell-u { grid-area: memphis-u; }
.plate-4-grid .cell-v { grid-area: rosette-v; }
.plate-4-grid .cell-w { grid-area: frag-w; }
.plate-4-grid .cell-x { grid-area: terrazzo-x; }

/* Plate 5 Grid */
.plate-5-grid {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 2fr 0.5fr 1fr;
    grid-template-areas:
        "hero-y iso-z frag-cc"
        "memphis-aa memphis-aa memphis-aa"
        "dark-bb dark-bb terrazzo-dd";
}

.plate-5-grid .cell-y { grid-area: hero-y; }
.plate-5-grid .cell-z { grid-area: iso-z; }
.plate-5-grid .cell-aa { grid-area: memphis-aa; }
.plate-5-grid .cell-bb { grid-area: dark-bb; }
.plate-5-grid .cell-cc { grid-area: frag-cc; }
.plate-5-grid .cell-dd { grid-area: terrazzo-dd; }

/* ---------- Bento Cells ---------- */
.bento-cell {
    position: relative;
    overflow: hidden;
    background-color: #F5F0E8;
    filter: blur(0.5px);
    transition: filter 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease;
}

.bento-cell.in-view {
    filter: blur(0px);
}

.bento-cell.reveal {
    animation: cellReveal 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes cellReveal {
    from {
        transform: scale(0.95);
        filter: blur(4px);
        opacity: 0;
    }
    to {
        transform: scale(1);
        filter: blur(0);
        opacity: 1;
    }
}

.cell-content {
    position: relative;
    z-index: 2;
    padding: clamp(16px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* ---------- Hero Cells ---------- */
.hero-cell {
    background-color: #F5F0E8;
}

/* ---------- Dark Cells ---------- */
.dark-cell {
    background-color: #2A2A2F;
}

.dark-cell .body-text {
    color: #F0EDE8;
}

.dark-content {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding-bottom: clamp(20px, 3vw, 40px);
}

/* ---------- Atmospheric Panels ---------- */
.atmospheric-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.atmospheric-panel.dark {
    background-color: #2A2A2F;
}

.frosted-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(12px) saturate(0.7);
    z-index: 1;
}

.frosted-overlay.dark {
    background-color: rgba(42, 42, 47, 0.4);
}

/* ---------- Column Ghosts ---------- */
.column-ghost {
    position: absolute;
    width: 40px;
    height: 80%;
    bottom: 0;
    background: linear-gradient(to top, rgba(250, 250, 247, 0.05), rgba(250, 250, 247, 0.02));
    border-radius: 20px 20px 0 0;
}

.column-ghost:first-child {
    left: 15%;
}

.col-2 {
    left: 55%;
    height: 70%;
}

.col-3 {
    left: 25%;
    height: 85%;
}

.col-4 {
    left: 65%;
    height: 60%;
}

.col-5 {
    left: 10%;
    height: 90%;
}

.col-6 {
    left: 40%;
    height: 75%;
}

.col-7 {
    left: 70%;
    height: 65%;
}

/* ---------- Isometric Icons ---------- */
.iso-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.iso-icon {
    width: 80%;
    height: 80%;
    max-width: 140px;
    max-height: 140px;
    transition: transform 0.4s ease;
}

.bento-cell:hover .iso-icon {
    transform: rotateX(-5deg) rotateY(10deg);
}

.bento-cell:hover {
    box-shadow: 0 0 30px rgba(30, 77, 43, 0.15);
}

/* Icon cells - glow vein effect on hover */
.iso-icon-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 4px,
        rgba(200, 169, 110, 0.15) 4px,
        rgba(200, 169, 110, 0.15) 5px
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.bento-cell:hover .iso-icon-container::before {
    opacity: 1;
}

/* ---------- Memphis Strip ---------- */
.memphis-strip {
    background-color: #FAFAF7;
    overflow: hidden;
}

.memphis-shapes {
    display: flex;
    align-items: center;
    gap: 30px;
    height: 100%;
    padding: 0 20px;
    animation: memphisDrift 40s linear infinite;
    width: max-content;
}

@keyframes memphisDrift {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.memphis-triangle {
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 32px solid #1E4D2B;
    animation: triRotate 20s linear infinite;
    flex-shrink: 0;
}

@keyframes triRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.memphis-squiggle {
    width: 100px;
    height: 30px;
    flex-shrink: 0;
}

.memphis-squiggle svg {
    width: 100%;
    height: 100%;
}

.squiggle-path {
    animation: squiggleWave 4s ease-in-out infinite;
}

@keyframes squiggleWave {
    0%, 100% { d: path("M0,15 Q25,0 50,15 Q75,30 100,15 Q125,0 150,15 Q175,30 200,15"); }
    50% { d: path("M0,15 Q25,30 50,15 Q75,0 100,15 Q125,30 150,15 Q175,0 200,15"); }
}

.memphis-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.dot {
    display: block;
    border-radius: 50%;
    animation: dotPulse 3s ease-in-out infinite;
}

.dot-pink {
    width: 8px;
    height: 8px;
    background-color: #E8A0BF;
    animation-delay: 0s;
}

.dot-teal {
    width: 5px;
    height: 5px;
    background-color: #3A8C7A;
    animation-delay: 0.5s;
}

.dot-gold {
    width: 6px;
    height: 6px;
    background-color: #C8A96E;
    animation-delay: 1s;
}

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

.memphis-halfcircle {
    width: 32px;
    height: 16px;
    background-color: #3A8C7A;
    border-radius: 32px 32px 0 0;
    flex-shrink: 0;
    animation: triRotate 25s linear infinite reverse;
}

.memphis-zigzag {
    width: 60px;
    height: 20px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1E4D2B 25%, transparent 25%) -10px 0,
                linear-gradient(225deg, #1E4D2B 25%, transparent 25%) -10px 0,
                linear-gradient(315deg, #1E4D2B 25%, transparent 25%),
                linear-gradient(45deg, #1E4D2B 25%, transparent 25%);
    background-size: 20px 20px;
    background-color: transparent;
}

/* ---------- Terrazzo Cells ---------- */
.terrazzo-cell {
    background-color: #F5F0E8;
    background-image:
        radial-gradient(circle at 20% 30%, #E8A0BF 3px, transparent 3px),
        radial-gradient(circle at 60% 20%, #3A8C7A 2px, transparent 2px),
        radial-gradient(circle at 80% 60%, #C8A96E 4px, transparent 4px),
        radial-gradient(circle at 40% 70%, #E8A0BF 2.5px, transparent 2.5px),
        radial-gradient(circle at 10% 80%, #3A8C7A 3px, transparent 3px),
        radial-gradient(circle at 70% 40%, #C8A96E 2px, transparent 2px),
        radial-gradient(circle at 30% 50%, #E8A0BF 1.5px, transparent 1.5px),
        radial-gradient(circle at 90% 85%, #3A8C7A 3.5px, transparent 3.5px),
        radial-gradient(circle at 50% 90%, #C8A96E 2px, transparent 2px),
        radial-gradient(circle at 15% 15%, #E8A0BF 2px, transparent 2px);
}

/* ---------- Rosette ---------- */
.rosette-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F5F0E8;
}

.rosette {
    width: 90%;
    height: 90%;
    max-width: 300px;
    max-height: 300px;
}

/* ---------- Typo Fragment Cells ---------- */
.cell-d,
.cell-p,
.cell-w,
.cell-cc {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-d .cell-content,
.cell-p .cell-content,
.cell-w .cell-content,
.cell-cc .cell-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ---------- Mobile Layout ---------- */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        grid-template-areas: none !important;
        max-height: none;
        gap: 1px;
    }

    .bento-cell {
        min-height: 30vh;
    }

    .hero-cell {
        min-height: 40vh;
    }

    .memphis-strip {
        min-height: 60px !important;
    }

    .plate {
        overflow-y: auto;
        align-items: flex-start;
    }

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

    #nav-toggle {
        top: 16px;
        right: 16px;
    }
}

/* ---------- Plate Transition States ---------- */
.plate {
    opacity: 0;
    filter: blur(10px);
    pointer-events: none;
    z-index: 1;
}

.plate.active {
    opacity: 1;
    filter: blur(0px);
    pointer-events: all;
    z-index: 10;
}

.plate.exiting {
    opacity: 0.4;
    filter: blur(6px);
    pointer-events: none;
    z-index: 5;
    transition: filter 0.6s ease-out, opacity 0.6s ease-out;
}

.plate.entering {
    opacity: 1;
    filter: blur(0px);
    pointer-events: all;
    z-index: 10;
    transition: filter 0.8s ease-in-out, opacity 0.8s ease-in-out;
}
