/* archetype.boo - Haunted Pattern Library */

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

body {
    background: #0D0A14;
    color: #E8DDD0;
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.8;
    overflow-x: hidden;
}

/* Grain Overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* Opening Field */
#opening-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0D0A14;
    z-index: 500;
    transition: opacity 0.8s ease;
}

#opening-field.split {
    opacity: 0;
    pointer-events: none;
}

/* Split Container */
#split-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Shadow Side */
#shadow-side {
    width: 45%;
    background: #0D0A14;
    position: relative;
    overflow: hidden;
}

/* Threshold Line */
#threshold {
    width: 0;
    background: linear-gradient(180deg, #0D0A14, #1E1640, #1A1520, #1E1640, #0D0A14);
    position: relative;
    z-index: 10;
    box-shadow: 0 0 15px rgba(122,255,178,0.1);
    transition: width 2s ease;
}

#threshold.open {
    width: 8px;
}

/* Conscious Side */
#conscious-side {
    width: 55%;
    background: rgba(26,21,32,0.92);
    background-image: linear-gradient(135deg, rgba(30,22,64,0.3) 0%, transparent 50%);
    min-height: 100vh;
    position: relative;
}

.conscious-content {
    max-width: 520px;
    padding: 80px 40px 120px 60px;
}

/* Particle Field */
#particle-field {
    position: fixed;
    left: 0;
    top: 0;
    width: 45%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #7AFFB2;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    from { transform: translateY(100vh); opacity: 0; }
    10% { opacity: var(--particle-opacity); }
    90% { opacity: var(--particle-opacity); }
    to { transform: translateY(-20px); opacity: 0; }
}

/* Whisper Text */
.whisper-text {
    position: absolute;
    right: 20px;
    top: 30%;
    font-family: 'Caveat', cursive;
    font-size: 0.85rem;
    color: #E8DDD0;
    opacity: 0;
    z-index: 6;
    width: 120px;
    text-align: right;
    transition: opacity 3s ease;
}

.whisper-text.active {
    opacity: 0.35;
}

/* Mask Zones */
.mask-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    padding: 40px;
}

.archetype-mask {
    transition: transform 0.3s ease;
}

/* Mask morph animation */
@keyframes maskMorphEyes {
    0%, 100% { ry: 10; }
    50% { ry: 6; }
}

@keyframes maskMorphMouth {
    0%, 100% { d: path("M75,155 Q100,170 125,155"); }
    50% { d: path("M75,155 Q100,160 125,155"); }
}

.mask-eye-left,
.mask-eye-right {
    animation: maskMorphEyes 8s ease-in-out infinite;
}

.mask-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #D4A853;
    margin-top: 20px;
    opacity: 0.6;
}

/* Mirror Fractures */
.mirror-fractures {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 8;
    pointer-events: none;
}

/* Headers */
#conscious-header {
    margin-bottom: 80px;
    padding-top: 60px;
}

.split-title {
    display: flex;
    flex-direction: column;
}

.title-archetype {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.12em;
    color: #E8DDD0;
    opacity: 0;
    transition: opacity 1s ease;
}

.title-archetype.visible {
    opacity: 1;
}

#shadow-title {
    position: fixed;
    left: 5%;
    top: 100px;
    z-index: 20;
}

.title-boo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.12em;
    color: #7AFFB2;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.title-boo.visible {
    opacity: 1;
}

.conscious-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8B8498;
    margin-top: 16px;
}

/* Conscious Sections */
.conscious-section {
    margin-bottom: 120px;
}

.archetype-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.08em;
    color: #D4A853;
    margin-bottom: 24px;
}

.conscious-section p {
    margin-bottom: 1.2em;
    color: #E8DDD0;
}

/* Threshold Moments */
.threshold-moment {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px 0;
}

.threshold-symbol {
    font-size: 3rem;
    color: #C4728F;
    opacity: 0.6;
    animation: symbolPulse 4s ease-in-out infinite;
}

@keyframes symbolPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Links */
a {
    color: #7AFFB2;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #C4728F;
}

/* Responsive */
@media (max-width: 900px) {
    #split-container {
        flex-direction: column;
    }
    #shadow-side {
        width: 100%;
        height: 60vh;
    }
    #conscious-side {
        width: 100%;
    }
    #threshold {
        width: 100% !important;
        height: 4px;
    }
    #particle-field {
        width: 100%;
        height: 60vh;
    }
    .mask-zone {
        height: 60vh;
    }
    #shadow-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 20px;
    }
    .conscious-content {
        padding: 40px 24px 80px;
    }
    .mirror-fractures {
        display: none;
    }
}
