/* ==========================================
   MasqproT.com — Styles
   Streetwear-meets-protocol visual language
   ========================================== */

/* ---- CSS Custom Properties ---- */
:root {
    --bg-warm-cream: #FAF5F0;
    --surface-oat: #F0E8E0;
    --border-biscuit: #E8DDD4;
    --text-dark-roast: #3D2E22;
    --text-cocoa: #6B5B4E;
    --text-espresso: #4A3D33;
    --accent-blush: #E8B4B8;
    --accent-lavender: #C4B8D8;
    --accent-sage: #B8CCBA;
    --accent-butter: #E8D8A8;
    --muted-linen: #D8C4B8;
    --accent-mono: #8B7A6C;

    --spring-ease: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);

    --wave-offset-x: 0px;
    --wave-offset-y: 0px;
}

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

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

body {
    background-color: var(--bg-warm-cream);
    color: var(--text-espresso);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
.hero-wordmark {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 72px;
    color: var(--text-dark-roast);
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.section-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 42px;
    color: var(--text-dark-roast);
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 24px;
}

.hero-tagline {
    font-family: 'Varela Round', sans-serif;
    font-weight: 400;
    font-size: 20px;
    color: var(--text-cocoa);
    margin-top: 16px;
    letter-spacing: 0.01em;
}

.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    color: var(--text-espresso);
    line-height: 1.65;
    margin-bottom: 24px;
}

.code-pill {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #8B7A6C;
    background-color: var(--surface-oat);
    border-radius: 6px;
    padding: 2px 8px;
    display: inline-block;
}

.counter-label {
    font-family: 'Varela Round', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-cocoa);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-top: 6px;
}

.node-label {
    font-family: 'Varela Round', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-cocoa);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 10px;
    display: block;
    text-align: center;
}

/* ---- Floating Pill Navigation ---- */
.pill-nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(250, 245, 240, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 999px;
    padding: 10px 28px;
    display: flex;
    gap: 24px;
    z-index: 1000;
    border: 1px solid var(--border-biscuit);
    box-shadow: 0 4px 24px rgba(90, 70, 55, 0.06);
}

.nav-link {
    font-family: 'Varela Round', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-cocoa);
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-dark-roast);
}

/* ---- Background Waves ---- */
.background-waves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.wave-layer {
    position: absolute;
    width: 200%;
    height: 100%;
    top: 0;
    left: -50%;
}

.wave-layer-1 {
    animation: waveDrift1 60s linear infinite;
    transform: translateX(var(--wave-offset-x));
}

.wave-layer-2 {
    animation: waveDrift2 80s linear infinite;
    transform: translateX(calc(var(--wave-offset-x) * 0.7));
}

.wave-layer-3 {
    animation: waveDrift3 120s linear infinite;
    transform: translateX(calc(var(--wave-offset-x) * 0.5));
}

.wave-layer-4 {
    animation: waveDrift4 90s linear infinite;
    transform: translateX(calc(var(--wave-offset-x) * 0.3));
}

@keyframes waveDrift1 {
    0% { transform: translateX(0); }
    100% { transform: translateX(-25%); }
}

@keyframes waveDrift2 {
    0% { transform: translateX(0); }
    100% { transform: translateX(25%); }
}

@keyframes waveDrift3 {
    0% { transform: translateX(0); }
    100% { transform: translateX(-15%); }
}

@keyframes waveDrift4 {
    0% { transform: translateX(0); }
    100% { transform: translateX(20%); }
}

/* ---- Wave Dividers ---- */
.wave-divider {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 60px;
    overflow: hidden;
}

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

/* ---- Scenes (Sections) ---- */
.scene {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

/* ---- Hero Scene ---- */
.hero-scene {
    height: 100vh;
    min-height: 100vh;
    padding-top: 100px;
}

.hero-panel {
    background: var(--bg-warm-cream);
    border: 2px solid var(--border-biscuit);
    border-radius: 32px;
    padding: 64px 80px;
    box-shadow: 0 8px 32px rgba(90, 70, 55, 0.08);
    text-align: center;
    max-width: 720px;
    position: relative;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--spring-ease);
}

.hero-panel.visible {
    opacity: 1;
    transform: scale(1);
}

.hero-version {
    margin-top: 24px;
}

.hero-chevron {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    animation: chevronPulse 2s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

/* ---- Mask Panels ---- */
.mask-panel {
    background: var(--bg-warm-cream);
    border: 2px solid var(--border-biscuit);
    border-radius: 24px;
    padding: 48px 56px;
    box-shadow: 0 8px 32px rgba(90, 70, 55, 0.08);
}

.offset-narrow {
    max-width: 680px;
    margin-left: calc(50% - 340px - 15%);
}

.offset-narrow-right {
    max-width: 680px;
    margin-left: calc(50% - 340px + 15%);
}

/* ---- Concept Scene ---- */
.concept-scene {
    padding: 120px 40px;
}

.concept-content {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1200px;
    width: 100%;
}

.concept-text-panel {
    flex: 1;
    margin-left: 0;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--spring-ease);
}

.concept-text-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.concept-illustration {
    flex: 0 0 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mask-illustration {
    width: 320px;
    height: 320px;
}

.mask-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease-out;
}

.mask-illustration.animate .mask-draw {
    stroke-dashoffset: 0;
}

/* Counter Stats */
.counter-stats {
    display: flex;
    gap: 32px;
    margin-top: 32px;
    flex-wrap: wrap;
}

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

.counter-number {
    font-size: 22px;
    font-weight: 400;
    display: inline-block;
    min-width: 80px;
    transition: transform 0.3s var(--spring-ease);
}

.counter-number.pulse {
    animation: counterPulse 0.4s var(--spring-ease);
}

@keyframes counterPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ---- Flow Scene ---- */
.flow-scene {
    padding: 120px 40px;
}

.flow-heading {
    margin-bottom: 60px;
}

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 1200px;
    width: 100%;
    flex-wrap: wrap;
}

.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(0.7) translateY(20px);
    transition: opacity 0.5s var(--ease-out), transform 0.6s var(--spring-ease);
}

.flow-node.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.node-avatar {
    width: 80px;
    height: 80px;
}

.node-avatar svg {
    width: 100%;
    height: 100%;
}

.flow-connection {
    width: 120px;
    height: 60px;
    flex-shrink: 0;
}

.connection-draw {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.8s ease-out;
}

.flow-scene.in-view .connection-draw {
    stroke-dashoffset: 0;
}

/* Badge Cluster */
.badge-cluster {
    display: flex;
    gap: 20px;
    margin-top: 60px;
    flex-wrap: wrap;
    justify-content: center;
}

.sticker-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--badge-bg, var(--surface-oat));
    border: 2px solid var(--border-biscuit);
    border-radius: 16px;
    padding: 12px 20px;
    transform: rotate(var(--rotate, 0deg));
    opacity: 0;
    transition: opacity 0.5s var(--ease-out), transform 0.6s var(--spring-ease);
}

.sticker-badge.visible {
    opacity: 1;
}

.sticker-badge span {
    font-family: 'Varela Round', sans-serif;
    font-size: 14px;
    color: var(--text-cocoa);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- Detail Scene ---- */
.detail-scene {
    padding: 120px 40px;
    background: linear-gradient(180deg, transparent, rgba(232, 180, 184, 0.08) 50%, transparent);
}

.detail-panels {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 1200px;
    width: 100%;
}

.detail-panels .mask-panel {
    opacity: 0;
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--spring-ease);
}

.slide-left {
    transform: translateX(-60px);
}

.slide-right {
    transform: translateX(60px);
}

.slide-left.visible,
.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.detail-stats {
    display: flex;
    gap: 40px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* ---- Identity Scene ---- */
.identity-scene {
    padding: 120px 40px;
    min-height: 100vh;
}

.identity-heading {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--spring-ease);
}

.identity-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.identity-mosaic {
    position: relative;
    width: 400px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mosaic-badge {
    position: absolute;
    opacity: 0;
    transform: translate(calc(var(--final-x) * 3), calc(var(--final-y) * 3)) rotate(calc(var(--rotate) * 3)) scale(0.5);
    transition: opacity 0.8s var(--ease-out), transform 1.2s var(--spring-ease);
}

.mosaic-badge.converge {
    opacity: 1;
    transform: translate(var(--final-x), var(--final-y)) rotate(var(--rotate)) scale(1);
}

.mosaic-badge.idle {
    animation: badgeIdle 4s ease-in-out infinite;
}

@keyframes badgeIdle {
    0%, 100% { transform: translate(var(--final-x), var(--final-y)) rotate(var(--rotate)); }
    25% { transform: translate(calc(var(--final-x) + 3px), calc(var(--final-y) - 2px)) rotate(var(--rotate)); }
    50% { transform: translate(calc(var(--final-x) - 2px), calc(var(--final-y) + 4px)) rotate(var(--rotate)); }
    75% { transform: translate(calc(var(--final-x) + 4px), calc(var(--final-y) + 1px)) rotate(var(--rotate)); }
}

.identity-wordmark {
    text-align: center;
    margin-top: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--spring-ease);
    transition-delay: 1.4s;
}

.identity-wordmark.visible {
    opacity: 1;
    transform: translateY(0);
}

.identity-logo {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 56px;
    color: var(--text-dark-roast);
    letter-spacing: -0.025em;
}

.identity-tagline {
    font-family: 'Varela Round', sans-serif;
    font-size: 18px;
    color: var(--text-cocoa);
    margin-top: 12px;
}

/* ---- Footer ---- */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px;
    border-top: 1px solid var(--border-biscuit);
}

.footer-text {
    font-family: 'Varela Round', sans-serif;
    font-size: 14px;
    color: var(--muted-linen);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .hero-wordmark {
        font-size: 48px;
    }

    .section-heading {
        font-size: 32px;
    }

    .hero-panel {
        padding: 40px 36px;
        margin: 0 20px;
    }

    .concept-content {
        flex-direction: column;
    }

    .concept-illustration {
        flex: 0 0 auto;
    }

    .mask-illustration {
        width: 240px;
        height: 240px;
    }

    .offset-narrow,
    .offset-narrow-right {
        max-width: 100%;
        margin-left: 0;
    }

    .pill-nav {
        padding: 8px 16px;
        gap: 12px;
    }

    .nav-link {
        font-size: 12px;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-connection {
        transform: rotate(90deg);
        width: 60px;
        height: 40px;
    }

    .identity-mosaic {
        width: 300px;
        height: 250px;
        transform: scale(0.85);
    }

    .identity-logo {
        font-size: 40px;
    }

    .scene {
        padding: 60px 20px;
    }

    .concept-scene,
    .flow-scene,
    .detail-scene {
        padding: 80px 20px;
    }
}

@media (max-width: 600px) {
    .hero-wordmark {
        font-size: 36px;
    }

    .section-heading {
        font-size: 26px;
    }

    .pill-nav {
        gap: 8px;
        padding: 6px 12px;
    }

    .nav-link {
        font-size: 11px;
    }

    .counter-stats {
        gap: 16px;
    }

    .badge-cluster {
        gap: 12px;
    }

    .mask-panel {
        padding: 28px 24px;
    }

    .detail-stats {
        gap: 20px;
    }
}
