/* =========================================================
   muhan.studio -- Midnight Blue Vaporwave Portfolio
   ========================================================= */

/* --- CSS Custom Properties --- */
:root {
    --deep-bg: #0d1b2a;
    --primary-bg: #1b2838;
    --atmosphere: #2a3f5f;
    --vaporwave-pink: #e8a0bf;
    --warm-cream: #f5ece3;
    --pale-lavender: #c8b8d4;
    --geometric-teal: #5b9ea6;
    --leather-accent: #a67c52;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Libre Baskerville', 'Times New Roman', serif;
    --font-ui: 'DM Sans', 'Helvetica Neue', sans-serif;

    --display-size: clamp(3.5rem, 9vw, 8rem);
    --floor-title-size: clamp(1.6rem, 3.5vw, 2.8rem);
    --body-size: clamp(0.95rem, 1.1vw, 1.15rem);
    --ui-size: clamp(0.7rem, 0.9vw, 0.85rem);

    --corridor-gap: clamp(4rem, 8vh, 10rem);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-bg);
    color: var(--warm-cream);
    font-family: var(--font-body);
    font-size: var(--body-size);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Noise Overlay (analog texture) --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Geometric Wayfinding Navigation --- */
#wayfinding {
    position: fixed;
    left: clamp(1rem, 2.5vw, 2.5rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.waypoint {
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 300ms ease, transform 300ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.waypoint:hover {
    opacity: 0.75;
    animation: waypointPulse 400ms ease;
}

.waypoint.active {
    opacity: 1;
    transform: scale(1.2);
}

@keyframes waypointPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.waypoint.active:hover {
    animation: none;
}

/* --- ATRIUM (Hero) --- */
.atrium {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--deep-bg) 0%, rgba(42,63,95,0.15) 50%, var(--deep-bg) 100%);
    overflow: hidden;
}

.atrium-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.atrium-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: var(--display-size);
    letter-spacing: 0.08em;
    line-height: 1.1;
    color: var(--warm-cream);
    text-shadow: 0 0 80px rgba(232,160,191,0.12);
}

/* --- Geometric Mobile Shapes --- */
.mobile-shape {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    will-change: transform;
}

.mobile-shape svg {
    display: block;
    filter: blur(0.5px);
}

.shape-1 {
    top: 12%;
    left: 15%;
    animation: drift1 25s ease-in-out infinite;
}
.shape-2 {
    top: 20%;
    right: 18%;
    animation: drift2 32s ease-in-out infinite;
}
.shape-3 {
    bottom: 25%;
    left: 22%;
    animation: drift3 28s ease-in-out infinite;
}
.shape-4 {
    top: 55%;
    right: 12%;
    animation: drift4 35s ease-in-out infinite;
}
.shape-5 {
    top: 8%;
    left: 55%;
    animation: drift5 22s ease-in-out infinite;
}
.shape-6 {
    bottom: 15%;
    right: 30%;
    animation: drift6 40s ease-in-out infinite;
}
.shape-7 {
    bottom: 35%;
    left: 8%;
    animation: drift7 18s ease-in-out infinite;
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -15px) rotate(8deg); }
    50% { transform: translate(-10px, 25px) rotate(-5deg); }
    75% { transform: translate(15px, 10px) rotate(12deg); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-25px, 20px) rotate(-10deg); }
    66% { transform: translate(15px, -10px) rotate(6deg); }
}
@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, 20px) rotate(5deg); }
    50% { transform: translate(-20px, -10px) rotate(-8deg); }
    75% { transform: translate(10px, -25px) rotate(3deg); }
}
@keyframes drift4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-18px, 15px) rotate(-12deg); }
}
@keyframes drift5 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(12px, -20px) rotate(7deg); }
    66% { transform: translate(-15px, 10px) rotate(-4deg); }
}
@keyframes drift6 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-10px, -15px) rotate(-6deg); }
    50% { transform: translate(20px, 10px) rotate(10deg); }
    75% { transform: translate(-5px, 20px) rotate(-3deg); }
}
@keyframes drift7 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(18px, -12px) rotate(9deg); }
}

/* --- Elevator Transition --- */
.elevator-transition {
    height: 20vh;
    background: linear-gradient(180deg, var(--deep-bg) 0%, var(--primary-bg) 100%);
}

/* --- Floor Sections --- */
.floor {
    position: relative;
    padding: var(--corridor-gap) clamp(3rem, 8vw, 10rem);
    padding-left: clamp(5rem, 10vw, 12rem);
    min-height: 80vh;
}

.floor-gradient {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, var(--atmosphere) 0%, var(--primary-bg) 60%, var(--deep-bg) 100%);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.floor.in-view .floor-gradient {
    opacity: 0.3;
}

/* --- Floor Header with Column Divider --- */
.floor-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-bottom: clamp(2rem, 4vh, 4rem);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(200,184,212,0.15);
}

.column-divider {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.column-silhouette {
    width: 20px;
    height: 40px;
    position: relative;
    opacity: 0.3;
}

.column-silhouette::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2px;
    right: 2px;
    height: 6px;
    background: var(--pale-lavender);
    border-radius: 1px;
}

.column-silhouette::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2px;
    right: 2px;
    height: 6px;
    background: var(--pale-lavender);
    border-radius: 1px;
}

.column-silhouette-shaft {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 5px;
    right: 5px;
    background: var(--pale-lavender);
}

.column-divider::before,
.column-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(200,184,212,0.2);
}

.floor-label {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: var(--ui-size);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--pale-lavender);
    white-space: nowrap;
}

/* --- Portfolio Grid --- */
.portfolio-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(1rem, 2vw, 2rem);
}

.portfolio-item {
    opacity: 0;
    transform: translateY(40px);
}

.portfolio-item.visible {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.portfolio-item.span-8 {
    grid-column: span 8;
}

.portfolio-item.span-4 {
    grid-column: span 4;
}

.portfolio-item.span-3 {
    grid-column: span 3;
}

@keyframes bounceEnter {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Portfolio Item Card --- */
.item-inner {
    position: relative;
    border: 1px solid rgba(166,124,82,0.3);
    border-radius: 2px;
    overflow: hidden;
    background: var(--primary-bg);
    box-shadow: 0 4px 20px rgba(13,27,42,0.4);
    transition: transform 400ms ease, border-color 400ms ease, box-shadow 400ms ease;
    cursor: pointer;
}

.item-inner:hover {
    transform: translateY(-4px);
    border-color: rgba(232,160,191,0.5);
    box-shadow: 0 8px 30px rgba(232,160,191,0.15);
}

/* --- Leather Texture Overlay --- */
.leather-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 70%, rgba(166,124,82,0.04), transparent 50%),
        radial-gradient(circle at 70% 20%, rgba(166,124,82,0.03), transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(166,124,82,0.02), transparent 60%);
    background-size: 120px 120px, 80px 80px, 200px 200px;
}

/* --- Visual Placeholder (gradient-based imagery) --- */
.item-visual {
    width: 100%;
    height: clamp(180px, 25vw, 320px);
    position: relative;
}

.visual-placeholder {
    background: linear-gradient(
        135deg,
        var(--atmosphere) 0%,
        var(--primary-bg) 40%,
        rgba(232,160,191,0.08) 70%,
        var(--deep-bg) 100%
    );
}

.visual-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, var(--primary-bg) 100%);
}

/* --- Item Content --- */
.item-content {
    position: relative;
    z-index: 2;
    padding: clamp(1rem, 2vw, 1.5rem);
}

.item-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.08em;
    line-height: 1.1;
    color: var(--warm-cream);
    margin-bottom: 0.4rem;
}

.item-meta {
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: var(--ui-size);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--pale-lavender);
    margin-bottom: 0;
}

.item-hover-text {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    line-height: 1.6;
    color: var(--vaporwave-pink);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 300ms ease 200ms, max-height 300ms ease;
    margin-top: 0.5rem;
    font-style: italic;
}

.item-inner:hover .item-hover-text {
    opacity: 1;
    max-height: 60px;
}

/* --- Category Markers --- */
.category-marker {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.5rem;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.category-marker.triangle {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 12px solid var(--vaporwave-pink);
}

.category-marker.circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--geometric-teal);
}

.category-marker.square {
    width: 12px;
    height: 12px;
    background: var(--pale-lavender);
}

.category-marker.hexagon {
    width: 14px;
    height: 14px;
    background: var(--vaporwave-pink);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* --- About Section --- */
.floor-about {
    padding-bottom: clamp(4rem, 10vh, 8rem);
}

.about-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.about-text {
    font-family: var(--font-body);
    font-size: var(--body-size);
    line-height: 1.75;
    color: var(--warm-cream);
    margin-bottom: 1.5rem;
}

.about-contact {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(166,124,82,0.25);
}

.contact-label {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: var(--ui-size);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--pale-lavender);
    display: block;
    margin-bottom: 0.5rem;
}

.contact-link {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: 0.08em;
    color: var(--vaporwave-pink);
    text-decoration: none;
    transition: color 300ms ease;
    border-bottom: 1px solid rgba(232,160,191,0.3);
    padding-bottom: 2px;
}

.contact-link:hover {
    color: var(--warm-cream);
    border-bottom-color: var(--warm-cream);
}

/* --- Footer --- */
.site-footer {
    position: relative;
    padding: 3rem clamp(3rem, 8vw, 10rem);
    padding-left: clamp(5rem, 10vw, 12rem);
    background: var(--deep-bg);
    border-top: 1px solid rgba(200,184,212,0.1);
}

.footer-text {
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: var(--ui-size);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--pale-lavender);
    opacity: 0.6;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .portfolio-item.span-8 {
        grid-column: span 12;
    }
    .portfolio-item.span-4 {
        grid-column: span 6;
    }
    .portfolio-item.span-3 {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    #wayfinding {
        left: 0.5rem;
        gap: 1rem;
    }

    .waypoint {
        width: 22px;
        height: 22px;
    }

    .waypoint svg {
        width: 10px;
        height: 10px;
    }

    .floor {
        padding-left: clamp(3rem, 6vw, 5rem);
        padding-right: clamp(1.5rem, 4vw, 3rem);
    }

    .site-footer {
        padding-left: clamp(3rem, 6vw, 5rem);
    }

    .portfolio-item.span-8,
    .portfolio-item.span-4,
    .portfolio-item.span-3 {
        grid-column: span 12;
    }
}

@media (max-width: 480px) {
    #wayfinding {
        display: none;
    }

    .floor {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .site-footer {
        padding-left: 1.5rem;
    }
}
