/* layer2.id - Prismatic Identity */
/* Colors: #6BCB77, #FFFBEA, #FF6B35, #9B59B6, #F5E6D3, #1A0A2E, #FFD93D, #4D96FF, #4A1942 */
/* Fonts: Cormorant Garamond, Space Grotesk, Inter */

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: #1A0A2E;
    color: #FFFBEA;
    font-family: 'Space Grotesk', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Scroll Container with Snap */
.scroll-container {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Full viewport sections */
.section {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Holographic Background */
.holographic-bg {
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from var(--angle),
        #1A0A2E 0%,
        #4A1942 15%,
        #9B59B6 25%,
        #4D96FF 35%,
        #6BCB77 45%,
        #FFD93D 55%,
        #FF6B35 65%,
        #F5E6D3 75%,
        #4A1942 85%,
        #1A0A2E 100%
    );
    opacity: 0.15;
    animation: holoRotate 20s linear infinite;
    z-index: 0;
}

.holo-shifted {
    animation-duration: 25s;
    animation-direction: reverse;
    opacity: 0.12;
}

.holo-membrane {
    animation-duration: 30s;
    opacity: 0.18;
    background: conic-gradient(
        from var(--angle),
        #4D96FF 0%,
        #6BCB77 20%,
        #FFD93D 40%,
        #FF6B35 60%,
        #9B59B6 80%,
        #4D96FF 100%
    );
}

.holo-root {
    animation-duration: 35s;
    opacity: 0.08;
}

.holo-identity {
    animation-duration: 15s;
    opacity: 0.22;
    background: conic-gradient(
        from var(--angle),
        #FFD93D 0%,
        #FF6B35 20%,
        #9B59B6 40%,
        #4D96FF 60%,
        #6BCB77 80%,
        #FFD93D 100%
    );
}

@keyframes holoRotate {
    from { --angle: 0deg; }
    to { --angle: 360deg; }
}

/* Section Content */
.section-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Leaf-shaped containers */
.leaf-container {
    background: rgba(26, 10, 46, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 251, 234, 0.1);
    padding: 3rem 4rem;
    max-width: 600px;
    position: relative;
}

.leaf-hero {
    border-radius: 60% 40% 70% 30% / 50% 60% 30% 60%;
    text-align: center;
    padding: 5rem 4rem;
    background: rgba(26, 10, 46, 0.5);
    border: 1px solid rgba(255, 251, 234, 0.08);
}

.leaf-left {
    border-radius: 30% 70% 40% 60% / 60% 30% 70% 40%;
    margin-right: auto;
    margin-left: 5vw;
}

.leaf-right {
    border-radius: 70% 30% 60% 40% / 40% 70% 30% 60%;
    margin-left: auto;
    margin-right: 5vw;
}

.leaf-center {
    border-radius: 50% 50% 60% 40% / 40% 60% 40% 60%;
    text-align: center;
}

.leaf-dark {
    background: rgba(26, 10, 46, 0.75);
}

.leaf-accent {
    background: rgba(77, 150, 255, 0.08);
    border-color: rgba(77, 150, 255, 0.15);
}

.leaf-identity {
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    background: rgba(26, 10, 46, 0.4);
    border: 1px solid rgba(255, 217, 61, 0.15);
    padding: 5rem 4rem;
}

/* Section-specific layouts */
.section-refraction .section-content {
    flex-direction: row;
    gap: 3rem;
    flex-wrap: wrap;
    padding: 2rem 5vw;
}

.section-root .section-content {
    flex-direction: row;
    gap: 3rem;
    flex-wrap: wrap;
    padding: 2rem 5vw;
}

.section-surface .section-content {
    flex-direction: column;
    gap: 2rem;
}

/* Typography */
.domain-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.08em;
    color: #FFFBEA;
    line-height: 1;
    text-shadow: 0 0 80px rgba(77, 150, 255, 0.3), 0 0 160px rgba(155, 89, 182, 0.15);
}

.tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    color: #F5E6D3;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    margin-top: 1.5rem;
    opacity: 0.8;
}

.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.06em;
    color: #FFFBEA;
    margin-bottom: 1.5rem;
    text-transform: lowercase;
}

.section-body {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.8;
    color: #F5E6D3;
    opacity: 0.85;
}

.identity-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: 0.08em;
    color: #FFFBEA;
    text-shadow: 0 0 60px rgba(255, 217, 61, 0.3), 0 0 120px rgba(107, 203, 119, 0.2);
}

.identity-statement {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #F5E6D3;
    margin-top: 2rem;
    letter-spacing: 0.05em;
    line-height: 1.6;
    opacity: 0.9;
}

/* Identity spectrum dots */
.identity-spectrum {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 3rem;
}

.spectrum-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: spectrumPulse 3s ease-in-out infinite;
}

.spectrum-dot:nth-child(1) { animation-delay: 0s; }
.spectrum-dot:nth-child(2) { animation-delay: 0.4s; }
.spectrum-dot:nth-child(3) { animation-delay: 0.8s; }
.spectrum-dot:nth-child(4) { animation-delay: 1.2s; }
.spectrum-dot:nth-child(5) { animation-delay: 1.6s; }

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

/* Scroll Indicator */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: scrollBob 2s ease-in-out infinite;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 1.5px solid #F5E6D3;
    border-bottom: 1.5px solid #F5E6D3;
    transform: rotate(45deg);
    opacity: 0.5;
}

.scroll-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #F5E6D3;
    opacity: 0.4;
}

@keyframes scrollBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* Prism Shards */
.prism-shard {
    position: absolute;
    z-index: 1;
    opacity: 0;
    animation: shardFloat 12s ease-in-out infinite;
}

.shard-1 {
    width: 200px;
    height: 200px;
    top: 15%;
    right: 10%;
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.08), rgba(77, 150, 255, 0.06));
    border-radius: 60% 40% 70% 30% / 50% 60% 30% 60%;
    animation-delay: 0s;
}

.shard-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 8%;
    background: linear-gradient(225deg, rgba(155, 89, 182, 0.1), rgba(107, 203, 119, 0.06));
    border-radius: 40% 60% 30% 70% / 60% 40% 60% 30%;
    animation-delay: 4s;
}

.shard-3 {
    width: 100px;
    height: 100px;
    top: 40%;
    left: 25%;
    background: linear-gradient(45deg, rgba(255, 107, 53, 0.08), rgba(255, 251, 234, 0.04));
    border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%;
    animation-delay: 8s;
}

@keyframes shardFloat {
    0% { opacity: 0; transform: translateY(20px) rotate(0deg); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-20px) rotate(15deg); }
}

/* Prism SVG */
.refraction-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.prism-svg {
    width: 100%;
    max-width: 350px;
    height: auto;
    animation: prismGlow 8s ease-in-out infinite;
}

@keyframes prismGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(77, 150, 255, 0.2)); }
    50% { filter: drop-shadow(0 0 30px rgba(155, 89, 182, 0.4)); }
}

/* Bubble Field */
.bubble-field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.bubble { opacity: 0.3; }

.bubble-float-1 { animation: bubbleRise1 25s linear infinite; }
.bubble-float-2 { animation: bubbleRise2 30s linear infinite; animation-delay: 2s; }
.bubble-float-3 { animation: bubbleRise1 35s linear infinite; animation-delay: 5s; }
.bubble-float-4 { animation: bubbleRise2 22s linear infinite; animation-delay: 3s; }
.bubble-float-5 { animation: bubbleRise1 28s linear infinite; animation-delay: 7s; }
.bubble-float-6 { animation: bubbleRise2 40s linear infinite; animation-delay: 1s; }
.bubble-float-7 { animation: bubbleRise1 32s linear infinite; animation-delay: 9s; }
.bubble-float-8 { animation: bubbleRise2 26s linear infinite; animation-delay: 4s; }
.bubble-float-9 { animation: bubbleRise1 38s linear infinite; animation-delay: 6s; }
.bubble-float-10 { animation: bubbleRise2 20s linear infinite; animation-delay: 8s; }
.bubble-float-11 { animation: bubbleRise1 45s linear infinite; animation-delay: 11s; }
.bubble-float-12 { animation: bubbleRise2 33s linear infinite; animation-delay: 13s; }
.bubble-float-13 { animation: bubbleRise1 18s linear infinite; animation-delay: 2s; }
.bubble-float-14 { animation: bubbleRise2 27s linear infinite; animation-delay: 10s; }
.bubble-float-15 { animation: bubbleRise1 42s linear infinite; animation-delay: 15s; }

@keyframes bubbleRise1 {
    0% { transform: translateY(0) translateX(0); opacity: 0.12; }
    25% { opacity: 0.3; }
    50% { transform: translateY(-200px) translateX(30px); opacity: 0.4; }
    75% { opacity: 0.25; }
    100% { transform: translateY(-400px) translateX(-20px); opacity: 0.12; }
}

@keyframes bubbleRise2 {
    0% { transform: translateY(0) translateX(0); opacity: 0.15; }
    30% { opacity: 0.35; }
    60% { transform: translateY(-250px) translateX(-40px); opacity: 0.3; }
    100% { transform: translateY(-500px) translateX(25px); opacity: 0.1; }
}

/* Root Visual */
.root-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
}

.root-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.root-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawRoot 4s ease-out forwards;
}

@keyframes drawRoot {
    to { stroke-dashoffset: 0; }
}

/* Convergence Field */
.convergence-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* Section Navigation */
.section-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 251, 234, 0.3);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
}

.nav-dot:hover {
    border-color: #FFFBEA;
    background: rgba(255, 251, 234, 0.2);
}

.nav-dot.active {
    background: #FFFBEA;
    border-color: #FFFBEA;
    transform: scale(1.3);
}

/* Section backgrounds */
.section-surface {
    background: linear-gradient(180deg, #1A0A2E 0%, #4A1942 100%);
}

.section-refraction {
    background: linear-gradient(180deg, #4A1942 0%, #1A0A2E 50%, #4A1942 100%);
}

.section-membrane {
    background: linear-gradient(180deg, #1A0A2E 0%, rgba(77, 150, 255, 0.08) 50%, #1A0A2E 100%);
}

.section-root {
    background: linear-gradient(180deg, #1A0A2E 0%, rgba(26, 10, 46, 0.95) 100%);
}

.section-identity {
    background: linear-gradient(180deg, #1A0A2E 0%, #4A1942 50%, #1A0A2E 100%);
}

/* Section enter animations */
.section-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Parallax text shadow effect on domain title */
.domain-title {
    transition: text-shadow 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .section-refraction .section-content,
    .section-root .section-content {
        flex-direction: column;
        padding: 2rem;
    }

    .leaf-container {
        padding: 2rem 2.5rem;
        max-width: 90vw;
    }

    .leaf-left {
        margin-left: auto;
    }

    .leaf-right {
        margin-right: auto;
    }

    .leaf-hero {
        padding: 3rem 2rem;
    }

    .section-nav {
        right: 1rem;
    }

    .root-visual {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .leaf-hero {
        border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%;
        padding: 2.5rem 1.5rem;
    }

    .leaf-container {
        padding: 1.5rem 2rem;
    }

    .identity-spectrum {
        gap: 0.6rem;
    }
}