/* muhan.ai - Swiss-Glitch Design System */
/* Colors: #f5ede3 #3b2e1e #5c4a3a #8b6f47 #c4825a #a0522d #ede5d8 #d44a26 */
/* Fonts: Bebas Neue, Inter, Space Mono */

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

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

body {
    background-color: #f5ede3;
    color: #5c4a3a;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 18px);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* Fixed Logo - Top Left */
.fixed-logo {
    position: fixed;
    top: 24px;
    left: 24px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    color: #8b6f47;
    letter-spacing: 0.04em;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.fixed-logo.visible {
    opacity: 1;
}

/* Scroll Position Indicator - Bottom Right */
.scroll-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #8b6f47;
    opacity: 0.6;
    z-index: 100;
    letter-spacing: 0.02em;
}

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

.hero-content {
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(64px, 12vw, 160px);
    font-weight: 400;
    color: #3b2e1e;
    letter-spacing: 0.04em;
    line-height: 0.92;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.hero-title.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(32px, 6vw, 80px);
    font-weight: 400;
    color: #3b2e1e;
    letter-spacing: 0.08em;
    line-height: 0.92;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
}

.hero-subtitle.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.hero-wave {
    position: absolute;
    bottom: 15%;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 1;
}

.hero-wave svg {
    width: 100%;
    height: 100%;
}

.wave-draw {
    stroke-dasharray: 3200;
    stroke-dashoffset: 3200;
    transition: stroke-dashoffset 1.5s ease-out;
}

.wave-draw.animate-in {
    stroke-dashoffset: 0;
}

/* Hero sticky fade effect */
.hero.sticky-fade {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Portfolio Grid Container */
.portfolio-grid-container {
    position: relative;
    z-index: 2;
    padding: clamp(24px, 4vw, 64px);
    background-color: #f5ede3;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 2px;
    row-gap: 2px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Grid Cell Base */
.grid-cell {
    position: relative;
    overflow: hidden;
    background-color: #ede5d8;
    min-height: 200px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.grid-cell.cell-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Glitch effect class */
.grid-cell.glitching {
    transform: translate(3px, 2px);
    box-shadow: 4px 4px 0 rgba(91, 74, 58, 0.15);
}

.grid-cell.glitching::after {
    content: '';
    position: absolute;
    left: 20%;
    width: 60%;
    height: 1px;
    background-color: #d44a26;
    z-index: 10;
    pointer-events: none;
}

/* Cell Sizes */
.cell-1x1 {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1 / 1;
}

.cell-2x1 {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 200px;
}

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

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

/* Dark Cell Variant */
.cell-dark {
    background-color: #3b2e1e;
}

/* Collage Cells */
.cell-collage {
    cursor: default;
}

.collage-shape {
    position: absolute;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease-out;
}

.cell-collage:hover .collage-shape {
    transform: rotate(var(--hover-rotation, 0deg));
}

.cell-collage:hover .collage-shape[style*='rotate(3deg)'] {
    transform: rotate(6deg) !important;
}

.cell-collage:hover .collage-shape[style*='rotate(5deg)'] {
    transform: rotate(10deg) !important;
}

.cell-collage:hover .collage-shape[style*='rotate(-2deg)'] {
    transform: rotate(-4deg) !important;
}

.cell-collage:hover .collage-shape[style*='rotate(-3deg)'] {
    transform: rotate(-6deg) !important;
}

.cell-collage:hover .collage-shape[style*='rotate(-5deg)'] {
    transform: rotate(-10deg) !important;
}

.cell-collage:hover .collage-shape[style*='rotate(2deg)'] {
    transform: rotate(4deg) !important;
}

.cell-collage:hover .collage-shape[style*='rotate(4deg)'] {
    transform: rotate(8deg) !important;
}

/* Typographic Fragment Cells */
.cell-typo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.typo-fragment {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(80px, 15vw, 200px);
    font-weight: 400;
    color: #3b2e1e;
    line-height: 0.8;
    letter-spacing: 0.04em;
    user-select: none;
}

.cell-dark .typo-fragment {
    color: #f5ede3;
}

.typo-small {
    font-size: clamp(60px, 10vw, 150px);
}

.typo-infinity {
    font-size: clamp(120px, 20vw, 320px);
    color: #3b2e1e;
}

/* Wave Cells */
.cell-wave {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.waveform-svg {
    width: 200%;
    height: 60px;
    overflow: hidden;
}

.waveform-offset {
    margin-top: -20px;
    opacity: 0.7;
}

.wave-group {
    animation: waveShift 8s linear infinite;
}

.wave-group-slow {
    animation: waveShift 12s linear infinite;
}

@keyframes waveShift {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-200px);
    }
}

/* Infinity Row */
.infinity-row {
    width: 100%;
    overflow: hidden;
    height: 96px;
    margin: 48px 0;
    background-color: #f5ede3;
    position: relative;
}

.infinity-track {
    display: flex;
    width: 200%;
    height: 100%;
    animation: infiniteScroll 20s linear infinite;
}

.infinity-wave {
    width: 50%;
    height: 100%;
    flex-shrink: 0;
}

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

/* Lower Grid */
.portfolio-grid-lower {
    margin-top: 0;
}

/* Footer */
.footer {
    padding: 64px clamp(24px, 4vw, 64px);
    background-color: #3b2e1e;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 32px;
    color: #f5ede3;
    letter-spacing: 0.04em;
}

.footer-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #8b6f47;
    font-weight: 400;
}

.footer-mono {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #5c4a3a;
}

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

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

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cell-2x1 {
        grid-column: span 2;
    }

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

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

    .grid-cell {
        min-height: 150px;
    }

    .typo-fragment {
        font-size: clamp(48px, 12vw, 120px);
    }

    .typo-infinity {
        font-size: clamp(80px, 16vw, 200px);
    }
}
