/* ============================================
   MasqproT.com - The Masquerade Protocol
   Glassmorphism + Venetian Carnival Secrecy
   ============================================ */

/* --- Palette Reference ---
   Deep Background:  #0A0514
   Secondary Dark:   #12091E
   Glass Tint:       #1A1030
   Warm Amber Glow:  #D4A574
   Burnished Gold:   #B8935A
   Parchment Light:  #E8DCC8
   Frost White:      #F4F0EA
   Violet Mist:      #6B4E8B
   Signal Red:       #8B3A3A
   --- */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0514;
    color: #E8DCC8;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* No scrollbar styling for immersion */
body::-webkit-scrollbar {
    width: 0;
    display: none;
}

body {
    scrollbar-width: none;
}

/* --- Typography --- */
.display-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #E8DCC8;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 2vw, 2.25rem);
    letter-spacing: 0.04em;
    color: rgba(232, 220, 200, 0.85);
    margin-bottom: 1rem;
}

.card-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(200, 195, 185, 0.9);
    max-width: 42em;
    margin-bottom: 1em;
}

.card-body:last-child {
    margin-bottom: 0;
}

.cipher-text {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: rgba(180, 160, 140, 0.3);
    letter-spacing: 0.12em;
}

/* --- Left Veil Panel --- */
#left-veil {
    position: fixed;
    top: 0;
    left: 0;
    width: 35%;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

#cipher-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
    white-space: pre;
    color: rgba(180, 160, 140, 0.3);
    letter-spacing: 0.12em;
    line-height: 1.8;
    padding: 2rem;
    animation: cipherScroll 120s linear infinite;
    will-change: transform;
}

@keyframes cipherScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Cipher row highlight animation */
.cipher-row-highlight {
    color: #D4A574 !important;
    transition: color 0.5s ease;
}

#veil-frost {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1A1030;
    background: rgba(26, 16, 48, 0.6);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    transition: backdrop-filter 600ms cubic-bezier(0.25, 0.1, 0.25, 1),
                -webkit-backdrop-filter 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: filter;
    z-index: 2;
}

#veil-frost.revealing {
    backdrop-filter: blur(0px) saturate(1.0);
    -webkit-backdrop-filter: blur(0px) saturate(1.0);
}

#veil-frost.partial {
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

#veil-reveal-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    padding: 2rem;
}

.reveal-phrase {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    color: #E8DCC8;
    text-align: center;
    display: none;
    opacity: 0;
    transition: opacity 600ms ease;
}

.reveal-phrase.active {
    display: block;
    opacity: 1;
}

#veil-mask-emblem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 60px;
    z-index: 3;
    opacity: 0.4;
    color: #6B4E8B;
}

#veil-mask-emblem svg {
    width: 100%;
    height: 100%;
}

/* --- Navigation Indicators --- */
#nav-indicators {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
}

.nav-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    transition: all 400ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav-dot.active {
    background: rgba(212, 165, 116, 0.3);
}

.nav-dot.active::after {
    box-shadow: 0 0 8px 4px rgba(212, 165, 116, 0.4);
    background: rgba(212, 165, 116, 0.6);
    width: 8px;
    height: 8px;
}

/* --- Right Stage --- */
#right-stage {
    margin-left: 35%;
    width: 65%;
    position: relative;
    z-index: 5;
}

/* --- Acts / Sections --- */
.act {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 3rem;
    position: relative;
}

/* ACT 1: The Approach */
#act-approach {
    min-height: 100vh;
    justify-content: center;
    align-items: center;
}

#hero-mask-watermark {
    position: absolute;
    width: 60vw;
    max-width: 600px;
    opacity: 0;
    z-index: 0;
    transition: opacity 2s cubic-bezier(0.25, 0.1, 0.25, 1);
    pointer-events: none;
}

#hero-mask-watermark.visible {
    opacity: 0.03;
}

#hero-mask-watermark svg {
    width: 100%;
    height: auto;
}

.act-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

#hero-title {
    font-size: clamp(3rem, 7vw, 9vw);
    letter-spacing: 0.08em;
    line-height: 1.1;
    overflow: hidden;
    white-space: nowrap;
}

#hero-title .char {
    display: inline-block;
    opacity: 0;
    text-shadow: 0 0 20px rgba(212, 165, 116, 0.6);
    animation: charReveal 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes charReveal {
    0% {
        opacity: 0;
        text-shadow: 0 0 40px rgba(212, 165, 116, 0.9);
    }
    50% {
        text-shadow: 0 0 20px rgba(212, 165, 116, 0.5);
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 0px rgba(212, 165, 116, 0);
    }
}

.hero-subtitle {
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 2s 2.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* --- Glass Card System --- */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
    animation: borderBreathe 6s ease-in-out infinite;
    opacity: 0;
    transform: translateY(60px);
}

.glass-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes borderBreathe {
    0%, 100% { border-color: rgba(255, 255, 255, 0.05); }
    50% { border-color: rgba(255, 255, 255, 0.12); }
}

/* Card width variations */
.card-wide {
    width: 85%;
}

.card-medium {
    width: 70%;
    margin-left: 20px;
}

.card-narrow {
    width: 55%;
}

.card-centered {
    width: 80%;
    text-align: center;
}

/* Card Caustic Light */
.card-caustic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.card-caustic::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(212, 165, 116, 0.06) 0%, transparent 70%);
    top: -40px;
    right: -30px;
}

.card-caustic::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(107, 78, 139, 0.08) 0%, transparent 70%);
    bottom: -20px;
    left: -20px;
}

/* Condensation Effect */
.card-condensation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 400ms ease;
}

.glass-card:hover .card-condensation {
    opacity: 1;
}

.condensation-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #F4F0EA;
    opacity: 0.15;
}

/* Card Timestamp */
.card-timestamp {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid #B8935A;
    padding-bottom: 0.75rem;
}

.mask-micro {
    width: 16px;
    height: 12px;
    color: rgba(180, 160, 140, 0.3);
}

/* Card content z-index */
.glass-card h2,
.glass-card p,
.glass-card span {
    position: relative;
    z-index: 1;
}

/* --- ACT 4: The Inner Circle --- */
.act-inner {
    background: #12091E;
}

#protocol-alert {
    margin-top: 2rem;
    text-align: center;
}

.alert-badge {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: #8B3A3A;
    border: 1px solid rgba(139, 58, 58, 0.4);
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    background: rgba(139, 58, 58, 0.08);
    animation: alertPulse 3s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% { opacity: 0.6; border-color: rgba(139, 58, 58, 0.2); }
    50% { opacity: 1; border-color: rgba(139, 58, 58, 0.6); }
}

/* --- ACT 5: The Seal --- */
#act-seal {
    min-height: 100vh;
    justify-content: center;
    align-items: center;
}

#seal-mask-draw {
    width: 300px;
    height: 225px;
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity 1s ease;
}

#seal-mask-draw.visible {
    opacity: 1;
}

#seal-mask-svg {
    width: 100%;
    height: 100%;
}

#seal-mask-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#seal-mask-path.drawing {
    stroke-dashoffset: 0;
}

#act-seal .card-centered {
    margin-left: auto;
    margin-right: auto;
}

#act-seal .card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 4rem);
    color: #E8DCC8;
    margin-bottom: 2rem;
}

#amber-pulse-line {
    width: 120px;
    height: 2px;
    background: #D4A574;
    margin: 0 auto;
    opacity: 0.6;
    animation: amberPulse 3s ease-in-out infinite;
    mix-blend-mode: screen;
    cursor: pointer;
    pointer-events: auto;
}

@keyframes amberPulse {
    0%, 100% { opacity: 0.3; width: 100px; }
    50% { opacity: 0.9; width: 140px; }
}

/* --- Background Transitions --- */
body {
    transition: background-color 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

body.deep {
    background-color: #12091E;
}

/* --- Ambient Glow Effects --- */
#right-stage::before {
    content: '';
    position: fixed;
    top: 30%;
    left: 40%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(212, 165, 116, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
}

#right-stage::after {
    content: '';
    position: fixed;
    bottom: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(107, 78, 139, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    #left-veil {
        width: 100%;
        height: 100vh;
        z-index: 1;
    }

    #right-stage {
        margin-left: 0;
        width: 100%;
        position: relative;
        z-index: 5;
    }

    .act {
        padding: 3rem 1.5rem;
    }

    .card-wide,
    .card-medium,
    .card-narrow,
    .card-centered {
        width: 95%;
    }

    #nav-indicators {
        right: 12px;
    }

    #hero-title {
        white-space: normal;
    }

    #veil-mask-emblem {
        display: none;
    }
}
