/* ============================================
   muhan.studio - Avant-Garde Antiquarian Gallery
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #1A1618;
    color: #B0A898;
    font-family: 'Alegreya', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.9;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* --- Fixed Sidebar --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 180px;
    height: 100vh;
    background-color: #2A2428;
    border-right: 1px solid #4A4048;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 0;
    transform: translateX(-180px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

#sidebar.visible {
    transform: translateX(0);
}

#sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 60px;
}

.logo-letter {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2rem;
    color: #C0A060;
    letter-spacing: 0.05em;
}

#sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px;
}

.nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: #7A7068;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 10px 0;
    position: relative;
    transition: color 0.4s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 0;
    height: 1px;
    background-color: #C0A060;
    transition: width 0.4s ease;
    transform: translateY(-50%);
}

.nav-link:hover,
.nav-link.active {
    color: #E8E0D4;
}

.nav-link.active::before {
    width: 12px;
}

#sidebar-footer {
    padding: 0 20px;
    text-align: center;
}

.sidebar-year {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    color: #4A4048;
    letter-spacing: 0.3em;
}

/* --- Main Content Area --- */
#main-content {
    margin-left: 180px;
    position: relative;
    min-height: 100vh;
}

/* --- Paper-Aged Texture Overlay --- */
#paper-texture {
    position: fixed;
    top: 0;
    left: 180px;
    width: calc(100% - 180px);
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 60px;
}

.marble-frame {
    position: relative;
    padding: 60px 80px;
    border: 1px solid transparent;
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.marble-frame::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(
        135deg,
        rgba(138, 122, 104, 0.12) 0%,
        rgba(138, 122, 104, 0.04) 25%,
        rgba(138, 122, 104, 0.12) 50%,
        rgba(138, 122, 104, 0.04) 75%,
        rgba(138, 122, 104, 0.12) 100%
    );
    z-index: -1;
}

.marble-frame::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(138, 122, 104, 0.08);
    pointer-events: none;
}

.marble-frame-inner {
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.2s ease 0.4s, transform 1.2s ease 0.4s;
}

.marble-frame-inner.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #E8E0D4;
    letter-spacing: 0.2em;
    line-height: 1.2;
    margin-bottom: 24px;
}

.title-dot {
    color: #C0A060;
    display: inline-block;
    margin: 0 0.05em;
}

.hero-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.hero-subtitle p {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    color: #7A7068;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.gold-line {
    display: block;
    width: 40px;
    height: 1px;
    background-color: #C0A060;
    opacity: 0;
    transition: opacity 1.5s ease 1s, width 1.5s ease 1s;
}

.gold-line.visible {
    opacity: 0.6;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 1.5s ease 1.8s;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.65rem;
    color: #4A4048;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, #4A4048, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.3); }
}

/* --- Fade-Reveal Sections --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Content Sections --- */
.content-section {
    padding: 120px 80px;
    position: relative;
}

.section-header {
    margin-bottom: 80px;
}

.section-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    color: #C0A060;
    letter-spacing: 0.3em;
    display: block;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #E8E0D4;
    letter-spacing: 0.08em;
    margin-bottom: 24px;
}

.section-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, #C0A060, transparent);
}

/* --- Works Grid --- */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 48px;
}

.work-item {
    position: relative;
}

.work-frame {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.work-frame.marble-accent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(138, 122, 104, 0.12) 0%,
        transparent 40%,
        transparent 60%,
        rgba(138, 122, 104, 0.12) 100%
    );
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.work-frame:hover.marble-accent::before {
    opacity: 0.6;
}

.work-placeholder {
    background-color: #1A1618;
    border: 1px solid #4A4048;
    transition: border-color 0.5s ease;
}

.work-frame:hover .work-placeholder {
    border-color: #8A7A68;
}

.work-svg {
    display: block;
    width: 100%;
    height: auto;
}

.work-title {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #E8E0D4;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.work-meta {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    color: #7A7068;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* --- Process Section --- */
.process-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px;
}

.process-block {
    position: relative;
    padding-top: 40px;
}

.process-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 1px;
    background-color: #4A4048;
}

.process-number {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #C0A060;
    letter-spacing: 0.2em;
    margin-bottom: 16px;
}

.process-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #E8E0D4;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.process-text {
    color: #B0A898;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.9;
}

/* --- Archive Section --- */
.archive-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.archive-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 32px;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid rgba(74, 64, 72, 0.4);
    position: relative;
    transition: background-color 0.4s ease;
}

.archive-item:first-child {
    border-top: 1px solid rgba(74, 64, 72, 0.4);
}

.archive-item:hover {
    background-color: rgba(42, 36, 40, 0.5);
}

.archive-year {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    color: #7A7068;
    letter-spacing: 0.15em;
}

.archive-name {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #E8E0D4;
    letter-spacing: 0.03em;
    transition: color 0.4s ease;
}

.archive-item:hover .archive-name {
    color: #C0A060;
}

.archive-type {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    color: #7A7068;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.archive-line {
    display: none;
}

/* --- Contact Section --- */
.contact-content {
    max-width: 600px;
}

.contact-block {
    margin-bottom: 60px;
}

.contact-text {
    font-family: 'Alegreya', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    color: #B0A898;
    line-height: 1.9;
}

.contact-details {
    margin-bottom: 80px;
}

.contact-line {
    display: flex;
    align-items: baseline;
    gap: 32px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(74, 64, 72, 0.3);
}

.contact-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    color: #7A7068;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    min-width: 100px;
}

.contact-value {
    font-family: 'Alegreya', serif;
    font-weight: 500;
    font-size: 1rem;
    color: #E8E0D4;
}

.contact-closing {
    text-align: center;
    padding-top: 40px;
}

.marble-divider {
    width: 120px;
    height: 1px;
    margin: 0 auto 40px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(138, 122, 104, 0.3),
        rgba(192, 160, 96, 0.4),
        rgba(138, 122, 104, 0.3),
        transparent
    );
}

.closing-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #E8E0D4;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
}

.closing-subtext {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.65rem;
    color: #7A7068;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* --- Marble Vein Decorative Backgrounds --- */
.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        160deg,
        transparent 0%,
        transparent 40%,
        rgba(138, 122, 104, 0.03) 45%,
        transparent 50%,
        transparent 70%,
        rgba(138, 122, 104, 0.02) 75%,
        transparent 80%
    );
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #sidebar {
        width: 60px;
        padding: 20px 0;
    }

    #sidebar.visible {
        transform: translateX(0);
    }

    #sidebar-nav .nav-link {
        font-size: 0;
        padding: 8px 0;
    }

    #sidebar-nav .nav-link::after {
        content: attr(data-section);
        font-size: 0.55rem;
        display: block;
        text-align: center;
        letter-spacing: 0.1em;
    }

    .nav-link::before {
        display: none;
    }

    #main-content {
        margin-left: 60px;
    }

    #paper-texture {
        left: 60px;
        width: calc(100% - 60px);
    }

    .content-section {
        padding: 80px 32px;
    }

    .hero-title {
        letter-spacing: 0.1em;
    }

    .marble-frame {
        padding: 40px 30px;
    }

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

    .process-content {
        grid-template-columns: 1fr;
    }

    .archive-item {
        grid-template-columns: 60px 1fr;
        gap: 16px;
    }

    .archive-type {
        display: none;
    }
}

@media (max-width: 600px) {
    #sidebar {
        width: 50px;
    }

    #main-content {
        margin-left: 50px;
    }

    #paper-texture {
        left: 50px;
        width: calc(100% - 50px);
    }

    .content-section {
        padding: 60px 20px;
    }

    .marble-frame {
        padding: 30px 20px;
    }

    .hero-subtitle {
        flex-direction: column;
        gap: 12px;
    }

    .contact-line {
        flex-direction: column;
        gap: 4px;
    }
}
