/* ============================================
   miris.xyz - Memphis Design Fever Dream
   Colors: #FBF5E8, #E8506A, #4A80C8, #F0C840, #1A2040, #A8A0A0, #48A060
   Fonts: Poiret One, DM Sans, Rubik
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #FBF5E8;
    color: #1A2040;
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* --- Generative Canvas (Background) --- */
#generative-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Memphis Patterns Container --- */
.memphis-patterns {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.memphis-patterns .memphis-el {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    animation: memphisScatterIn 800ms ease-out forwards;
}

@keyframes memphisScatterIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-45deg);
    }
    60% {
        opacity: 0.7;
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 0.5;
        transform: scale(1) rotate(0deg);
    }
}

/* --- Navigation Trigger --- */
.nav-trigger {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    transition: transform 0.3s ease;
}

.nav-trigger:hover {
    transform: scale(1.15);
}

.nav-trigger.active .nav-dot {
    background: #FBF5E8;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1A2040;
    transition: background 0.3s ease;
}

.nav-trigger.pulse .nav-dot {
    animation: dotPulse 1.5s ease-in-out;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.6; }
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: #1A2040;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    clip-path: circle(0% at calc(100% - 48px) 48px);
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: all;
    clip-path: circle(150% at calc(100% - 48px) 48px);
    transition: clip-path 0.7s ease-in-out, opacity 0.3s ease;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.nav-link {
    font-family: 'Poiret One', cursive;
    font-size: clamp(28px, 5vw, 56px);
    color: #FBF5E8;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.nav-link:hover {
    color: #F0C840;
    transform: scale(1.05);
}

/* --- Sections Base --- */
.section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-inner {
    max-width: 1000px;
    width: 90%;
    padding: 80px 0;
}

.section-label {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #A8A0A0;
    display: block;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(32px, 5vw, 64px);
    color: #1A2040;
    margin-bottom: 40px;
    line-height: 1.2;
}

/* --- Hero Section --- */
.section-hero {
    height: 100vh;
    min-height: 100vh;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: left;
    padding-left: 8vw;
    align-self: flex-start;
    opacity: 0;
    animation: heroFadeIn 800ms ease-out 500ms forwards;
}

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

.logotype {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(48px, 8vw, 120px);
    color: #1A2040;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(14px, 1.5vw, 20px);
    color: #A8A0A0;
    margin-top: 12px;
    letter-spacing: 1px;
}

/* Floral bottom decoration */
.floral-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    animation: floralGrow 1200ms ease-out 300ms forwards;
}

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

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

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    opacity: 0;
    animation: heroFadeIn 800ms ease-out 1200ms forwards;
}

.scroll-morph {
    width: 24px;
    height: 24px;
    background: #E8506A;
    animation: scrollMorph 3s ease-in-out infinite;
}

@keyframes scrollMorph {
    0%, 100% { clip-path: circle(50%); transform: translateY(0); }
    33% { clip-path: polygon(50% 0%, 100% 100%, 0% 100%); transform: translateY(-6px); }
    66% { clip-path: polygon(10% 10%, 90% 10%, 90% 90%, 10% 90%); transform: translateY(6px); }
}

/* --- Morph Transitions --- */
.morph-transition {
    position: relative;
    z-index: 2;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.morph-shape {
    width: 80px;
    height: 80px;
    transition: clip-path 800ms ease-in-out, background 800ms ease-in-out;
}

.morph-shape-1 {
    background: #E8506A;
    clip-path: circle(50%);
}

.morph-shape-1.morphed {
    clip-path: polygon(10% 10%, 90% 10%, 90% 90%, 10% 90%);
    background: #4A80C8;
}

.morph-shape-2 {
    background: #4A80C8;
    clip-path: polygon(10% 10%, 90% 10%, 90% 90%, 10% 90%);
}

.morph-shape-2.morphed {
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: #F0C840;
}

.morph-shape-3 {
    background: #F0C840;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.morph-shape-3.morphed {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    background: #E8506A;
}

.morph-shape-4 {
    background: #E8506A;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.morph-shape-4.morphed {
    clip-path: circle(50%);
    background: #48A060;
}

/* --- About Section --- */
.section-about {
    background: rgba(251, 245, 232, 0.92);
}

.about-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text p {
    margin-bottom: 20px;
    color: #1A2040;
}

.about-visual {
    display: flex;
    gap: 20px;
}

.duotone-card {
    flex: 1;
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.4s ease;
}

.duotone-card:hover {
    transform: rotate(3deg) scale(1.04);
}

.duotone-card-pink {
    background: rgba(232, 80, 106, 0.1);
    border: 2px solid #E8506A;
}

.duotone-card-blue {
    background: rgba(74, 128, 200, 0.1);
    border: 2px solid #4A80C8;
    margin-top: 30px;
}

.duotone-card svg {
    width: 100%;
    height: auto;
}

/* --- Work Section --- */
.section-work {
    background: rgba(251, 245, 232, 0.88);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.work-item {
    position: relative;
    background: #FBF5E8;
    border: 2px solid #1A2040;
    border-radius: 12px;
    padding: 40px 32px 32px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-item:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 0 rgba(26, 32, 64, 0.15);
}

.work-item-shape {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    opacity: 0.25;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.work-item:hover .work-item-shape {
    transform: rotate(45deg) scale(1.2);
    opacity: 0.45;
}

.work-item[data-color="pink"] .work-item-shape {
    background: #E8506A;
    clip-path: circle(50%);
}

.work-item[data-color="blue"] .work-item-shape {
    background: #4A80C8;
    clip-path: polygon(10% 10%, 90% 10%, 90% 90%, 10% 90%);
}

.work-item[data-color="yellow"] .work-item-shape {
    background: #F0C840;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.work-item[data-color="green"] .work-item-shape {
    background: #48A060;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.work-item-content {
    position: relative;
    z-index: 1;
}

.work-item-content h3 {
    font-family: 'Poiret One', cursive;
    font-size: clamp(22px, 2.5vw, 32px);
    margin-bottom: 10px;
    color: #1A2040;
}

.work-item-content p {
    color: #A8A0A0;
    margin-bottom: 16px;
    font-size: clamp(13px, 1vw, 15px);
}

.work-tag {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid #1A2040;
    color: #1A2040;
    display: inline-block;
}

/* --- Lab Section --- */
.section-lab {
    background: rgba(251, 245, 232, 0.92);
}

.lab-intro {
    color: #A8A0A0;
    max-width: 600px;
    margin-bottom: 48px;
}

.lab-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.lab-item {
    text-align: center;
}

.lab-preview {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #1A2040;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: #FBF5E8;
    margin-bottom: 14px;
}

.lab-name {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #A8A0A0;
}

/* --- Contact Section --- */
.section-contact {
    text-align: center;
    min-height: 80vh;
}

.section-contact .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-text {
    color: #A8A0A0;
    max-width: 500px;
    margin-bottom: 32px;
}

.contact-link {
    font-family: 'Poiret One', cursive;
    font-size: clamp(24px, 3.5vw, 48px);
    color: #E8506A;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: #F0C840;
    transition: width 0.4s ease;
}

.contact-link:hover {
    color: #4A80C8;
}

.contact-link:hover::after {
    width: 100%;
}

.contact-shapes {
    display: flex;
    gap: 32px;
    margin-top: 60px;
}

.contact-shape {
    width: 40px;
    height: 40px;
    transition: transform 0.5s ease;
}

.contact-shape:hover {
    transform: scale(1.3) rotate(20deg);
}

.shape-circle {
    background: #E8506A;
    clip-path: circle(50%);
}

.shape-triangle {
    background: #4A80C8;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.shape-square {
    background: #F0C840;
    clip-path: polygon(10% 10%, 90% 10%, 90% 90%, 10% 90%);
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 20px 30px;
    background: rgba(251, 245, 232, 0.95);
}

.footer-text {
    font-family: 'Rubik', sans-serif;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #A8A0A0;
}

.footer-zigzag {
    margin-top: 16px;
}

.footer-zigzag svg {
    width: 200px;
    height: auto;
    opacity: 0.4;
}

/* --- Scroll Reveal Animations --- */
.section-inner {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-visual {
        justify-content: center;
    }

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

    .lab-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-content {
        padding-left: 6vw;
    }

    .nav-link {
        font-size: clamp(24px, 6vw, 42px);
    }

    .contact-shapes {
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .lab-grid {
        grid-template-columns: 1fr;
    }

    .about-visual {
        flex-direction: column;
        align-items: center;
    }

    .duotone-card-blue {
        margin-top: 0;
    }
}
