/* =========================================
   DDAZZL.com — Holographic Prismatic Design
   ========================================= */

/* --- CSS Custom Properties --- */
:root {
    /* Palette from DESIGN.md */
    --void-black: #0a0a0f;
    --nebula-indigo: #1b1040;
    --prism-violet: #7b2ff7;
    --laser-magenta: #f72fab;
    --solar-gold: #f7c32f;
    --refraction-cyan: #2fe8f7;
    --frost-white: #f0f0f8;
    --opal-pink: #f7a0c4;

    /* Holographic sweep gradient */
    --holo-sweep: linear-gradient(135deg, #7b2ff7 0%, #2fe8f7 25%, #f7c32f 50%, #f72fab 75%, #7b2ff7 100%);

    /* Depth fade */
    --depth-fade: radial-gradient(ellipse at center, #1b1040 0%, #0a0a0f 100%);

    /* Cursor tracking */
    --cursor-x: 50%;
    --cursor-y: 50%;

    /* Typography sizes */
    --display-size: clamp(3rem, 8vw, 10rem);
    --heading-size: clamp(2rem, 5vw, 5rem);
    --body-size: 18px;
    --label-size: 0.75rem;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: var(--body-size);
    line-height: 1.7;
    color: var(--frost-white);
    background: var(--void-black);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Holographic Noise Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* --- Prism Shards (fixed decorative elements) --- */
#prism-shards {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.shard {
    position: absolute;
    background: var(--holo-sweep);
    background-size: 300% 300%;
    opacity: 0.06;
    animation: shard-drift 20s ease-in-out infinite, shimmer 8s ease infinite;
}

.shard-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -5%;
    clip-path: polygon(50% 0%, 100% 100%, 0% 80%);
    animation-delay: 0s;
}

.shard-2 {
    width: 200px;
    height: 200px;
    top: 30%;
    right: 5%;
    clip-path: polygon(20% 0%, 100% 20%, 80% 100%, 0% 60%);
    animation-delay: -4s;
}

.shard-3 {
    width: 250px;
    height: 250px;
    top: 55%;
    left: 15%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: -8s;
}

.shard-4 {
    width: 180px;
    height: 180px;
    top: 75%;
    right: 20%;
    clip-path: polygon(30% 0%, 100% 30%, 70% 100%, 0% 70%);
    animation-delay: -12s;
}

.shard-5 {
    width: 350px;
    height: 350px;
    top: 90%;
    left: 50%;
    clip-path: polygon(50% 0%, 90% 30%, 100% 80%, 20% 100%, 0% 40%);
    animation-delay: -16s;
}

@keyframes shard-drift {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(15deg) translateY(-30px); }
}

/* --- Light Leaks --- */
#light-leaks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.light-leak {
    position: absolute;
    width: 200vw;
    height: 200vh;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.08;
}

.leak-cyan {
    background: radial-gradient(circle, var(--refraction-cyan) 0%, transparent 60%);
    top: -50vh;
    left: -50vw;
    animation: leak-drift-1 25s ease-in-out infinite;
}

.leak-magenta {
    background: radial-gradient(circle, var(--laser-magenta) 0%, transparent 60%);
    bottom: -50vh;
    right: -50vw;
    animation: leak-drift-2 30s ease-in-out infinite;
}

@keyframes leak-drift-1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(15vw, 10vh); }
    66% { transform: translate(-5vw, 20vh); }
}

@keyframes leak-drift-2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-20vw, -15vh); }
    66% { transform: translate(10vw, -5vh); }
}

/* --- Viewport Sections --- */
.viewport-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    padding: 80px 5vw;
}

/* --- Opening Layer --- */
#opening {
    position: relative;
    overflow: hidden;
    padding: 0;
}

#holo-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at var(--cursor-x) var(--cursor-y), var(--prism-violet) 0%, transparent 50%),
        radial-gradient(ellipse at calc(100% - var(--cursor-x)) calc(100% - var(--cursor-y)), var(--refraction-cyan) 0%, transparent 50%),
        radial-gradient(ellipse at var(--cursor-x) calc(100% - var(--cursor-y)), var(--laser-magenta) 0%, transparent 40%),
        radial-gradient(ellipse at calc(100% - var(--cursor-x)) var(--cursor-y), var(--solar-gold) 0%, transparent 40%),
        var(--depth-fade);
    background-size: 100% 100%;
    transition: background 0.3s ease;
}

#logotype {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    animation: logotype-emerge 1.5s ease-out 1.5s forwards;
}

#logotype h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(4rem, 12vw, 14rem);
    letter-spacing: 0.05em;
    line-height: 1;
}

@keyframes logotype-emerge {
    0% {
        opacity: 0;
        clip-path: inset(50% 50% 50% 50%);
        transform: scale(0.9);
    }
    60% {
        opacity: 1;
        clip-path: inset(10% 10% 10% 10%);
    }
    100% {
        opacity: 1;
        clip-path: inset(0% 0% 0% 0%);
        transform: scale(1);
    }
}

/* --- Spectral Text Treatment --- */
.spectral-text {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: var(--heading-size);
    background: var(--holo-sweep);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 8s ease infinite;
    line-height: 1.15;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Spectral Dividers --- */
.spectral-divider {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100px;
    background: var(--holo-sweep);
    background-size: 400% 100%;
    animation: spectral-slide 12s linear infinite;
    opacity: 0.3;
    mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 30%, black 70%, transparent 100%);
}

@keyframes spectral-slide {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

/* --- Asymmetric Grid (7 columns: 1:2:1:3:1:2:1) --- */
.asymmetric-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 3fr 1fr 2fr 1fr;
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    align-items: center;
}

/* --- Prism Panels (Frosted Glass) --- */
.prism-panel {
    position: relative;
    padding: 40px;
    background: rgba(27, 16, 64, 0.5);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(127, 47, 247, 0.2);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.prism-panel::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 4px;
    padding: 1px;
    background: var(--holo-sweep);
    background-size: 300% 300%;
    animation: shimmer 8s ease infinite;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.prism-panel:hover::before {
    opacity: 1;
}

.prism-panel:hover {
    border-color: transparent;
    box-shadow:
        0 0 20px rgba(127, 47, 247, 0.15),
        0 0 40px rgba(47, 232, 247, 0.08);
}

/* Diffraction edge effect */
.prism-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    box-shadow:
        inset 1px 0 0 rgba(127, 47, 247, 0.3),
        inset -1px 0 0 rgba(47, 232, 247, 0.3),
        inset 0 1px 0 rgba(247, 47, 171, 0.3),
        inset 0 -1px 0 rgba(247, 195, 47, 0.3);
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.prism-panel:hover::after {
    opacity: 1;
}

/* Panel column placement */
.panel-a { grid-column: 2 / 5; }
.panel-b { grid-column: 5 / 8; }
.panel-c { grid-column: 1 / 4; }
.panel-d { grid-column: 4 / 8; }
.panel-e { grid-column: 2 / 6; }
.panel-f { grid-column: 5 / 8; }
.panel-g { grid-column: 1 / 5; }
.panel-h { grid-column: 4 / 8; }

/* --- Panel Labels --- */
.panel-label {
    display: inline-block;
    font-family: 'Space Mono', monospace;
    font-size: var(--label-size);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--refraction-cyan);
    margin-bottom: 16px;
    opacity: 0.8;
}

/* --- Panel Body Text --- */
.prism-panel p {
    color: rgba(240, 240, 248, 0.75);
    margin-top: 16px;
    max-width: 540px;
}

/* --- Panel Visuals --- */
.panel-visual {
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Crystal frame visual */
.crystal-frame {
    perspective: 600px;
}

.crystal-inner {
    width: 200px;
    height: 200px;
    background: var(--holo-sweep);
    background-size: 300% 300%;
    animation: shimmer 8s ease infinite, crystal-rotate 15s linear infinite;
    clip-path: polygon(
        50% 0%,
        85% 15%,
        100% 50%,
        85% 85%,
        50% 100%,
        15% 85%,
        0% 50%,
        15% 15%
    );
    box-shadow: 0 0 60px rgba(127, 47, 247, 0.3);
}

@keyframes crystal-rotate {
    0% { transform: rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateY(360deg) rotateZ(15deg); }
}

/* Hexagonal frame visual */
.hex-frame {
    perspective: 600px;
}

.hex-inner {
    width: 220px;
    height: 220px;
    background: var(--holo-sweep);
    background-size: 300% 300%;
    animation: shimmer 8s ease infinite reverse;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
    transform: rotateX(10deg);
    box-shadow: 0 0 60px rgba(247, 47, 171, 0.3);
}

/* Interference pattern visual */
.interference-pattern {
    flex-direction: column;
}

.ring {
    position: absolute;
    border: 2px solid;
    border-radius: 50%;
    animation: ring-pulse 4s ease-in-out infinite;
}

.ring-1 {
    width: 80px;
    height: 80px;
    border-color: var(--prism-violet);
    animation-delay: 0s;
}

.ring-2 {
    width: 140px;
    height: 140px;
    border-color: var(--refraction-cyan);
    animation-delay: -1s;
}

.ring-3 {
    width: 200px;
    height: 200px;
    border-color: var(--laser-magenta);
    animation-delay: -2s;
}

.ring-4 {
    width: 260px;
    height: 260px;
    border-color: var(--solar-gold);
    animation-delay: -3s;
}

@keyframes ring-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Gem facets visual */
.gem-facets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
    width: 280px;
    height: 200px;
}

.facet {
    background: var(--holo-sweep);
    background-size: 400% 400%;
    animation: shimmer 8s ease infinite;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.facet:hover {
    opacity: 1;
    transform: scale(1.05);
}

.facet-1 {
    clip-path: polygon(0% 0%, 100% 0%, 60% 100%);
    animation-delay: 0s;
    grid-column: 1 / 2;
}

.facet-2 {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 20% 80%);
    animation-delay: -1.5s;
    grid-column: 2 / 3;
}

.facet-3 {
    clip-path: polygon(40% 0%, 100% 20%, 100% 100%, 0% 100%);
    animation-delay: -3s;
    grid-column: 3 / 4;
}

.facet-4 {
    clip-path: polygon(0% 0%, 80% 20%, 100% 100%, 0% 100%);
    animation-delay: -4.5s;
    grid-column: 1 / 2;
}

.facet-5 {
    clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 80%);
    animation-delay: -6s;
    grid-column: 2 / 4;
}

/* --- Chromatic Birth Reveal Animation --- */
.reveal-element {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s ease, transform 0.8s ease, filter 0.8s ease;
    filter: hue-rotate(-60deg) brightness(0.5);
}

.reveal-element.revealed {
    opacity: 1;
    transform: scale(1);
    filter: hue-rotate(0deg) brightness(1);
}

/* Chromatic ghost outline state */
.reveal-element.chromatic-ghost {
    opacity: 0.3;
    transform: scale(0.9);
    filter: hue-rotate(-40deg) brightness(0.7) saturate(2);
}

/* --- Deep Layer (Final Inversion) --- */
#deep-layer {
    background: var(--void-black);
    text-align: center;
    flex-direction: column;
    min-height: 100vh;
}

.deep-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.deep-glow-text {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 6rem);
    color: var(--frost-white);
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
    line-height: 1.2;
}

.deep-body {
    color: rgba(240, 240, 248, 0.7);
    font-size: 1.125rem;
    line-height: 1.8;
    max-width: 600px;
}

.deep-sigil {
    position: relative;
    padding: 32px 64px;
    margin: 20px 0;
}

.sigil-text {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 3vw, 3rem);
    color: var(--frost-white);
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.4),
        0 0 60px rgba(255, 255, 255, 0.2),
        0 0 100px rgba(255, 255, 255, 0.1);
    letter-spacing: 0.3em;
}

.deep-sigil::before,
.deep-sigil::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 1px;
    background: var(--frost-white);
    top: 50%;
    opacity: 0.4;
}

.deep-sigil::before {
    left: -20px;
}

.deep-sigil::after {
    right: -20px;
}

.deep-coda {
    margin-top: 20px;
}

.mono-accent {
    font-family: 'Space Mono', monospace;
    font-size: var(--label-size);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(240, 240, 248, 0.5);
    line-height: 2.2;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .asymmetric-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .panel-a, .panel-b, .panel-c, .panel-d,
    .panel-e, .panel-f, .panel-g, .panel-h {
        grid-column: 1 / -1;
    }

    .prism-panel {
        padding: 32px 24px;
    }

    .viewport-section {
        padding: 60px 24px;
    }
}

@media (max-width: 600px) {
    :root {
        --body-size: 16px;
    }

    #logotype h1 {
        font-size: clamp(2.5rem, 15vw, 5rem);
    }

    .panel-visual {
        min-height: 200px;
    }

    .crystal-inner,
    .hex-inner {
        width: 150px;
        height: 150px;
    }

    .ring-3, .ring-4 {
        display: none;
    }
}
