/* mysterious.boo - Dark Neon Aurora Honeycomb */

:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #161624;
    --neon-magenta: #e930a8;
    --neon-cyan: #30e8d7;
    --neon-lime: #a8f03c;
    --earth-sienna: #7a5c3e;
    --wash-violet: #4a2d6b;
    --ember-peach: #f5a66e;
    --hex-size: clamp(160px, 22vw, 280px);
    --hex-gap: 4px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--earth-sienna);
    font-family: 'Architects Daughter', cursive;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* SVG Defs Hidden */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

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

/* Aurora Borealis Background */
.aurora-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-layer {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
}

.aurora-layer-1 {
    width: 60vw;
    height: 60vh;
    top: -10vh;
    left: -10vw;
    background: radial-gradient(ellipse, rgba(233,48,168,0.15), transparent 70%);
    animation: auroraFloat1 60s ease-in-out infinite;
}

.aurora-layer-2 {
    width: 50vw;
    height: 50vh;
    top: 30vh;
    right: -15vw;
    background: radial-gradient(ellipse, rgba(48,232,215,0.12), transparent 70%);
    animation: auroraFloat2 45s ease-in-out infinite;
}

.aurora-layer-3 {
    width: 70vw;
    height: 40vh;
    bottom: -5vh;
    left: 20vw;
    background: radial-gradient(ellipse, rgba(74,45,107,0.2), transparent 70%);
    animation: auroraFloat3 80s ease-in-out infinite;
}

@keyframes auroraFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20vw, 15vh) scale(1.2); }
    66% { transform: translate(-10vw, 30vh) scale(0.9); }
}

@keyframes auroraFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25vw, -10vh) scale(1.1); }
    66% { transform: translate(15vw, -20vh) scale(0.85); }
}

@keyframes auroraFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-15vw, -20vh) scale(1.15); }
    50% { transform: translate(10vw, -35vh) scale(1.3); }
    75% { transform: translate(25vw, -15vh) scale(0.95); }
}

/* Hexagonal Navigation Button */
.hex-nav-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    width: 44px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--neon-magenta);
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease;
    padding: 0;
}

.hex-nav-btn:hover {
    opacity: 1;
    color: var(--neon-cyan);
}

.hex-nav-btn svg {
    width: 100%;
    height: 100%;
}

/* Hex Navigation Overlay */
.hex-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 998;
    background: rgba(10, 10, 18, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.hex-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hex-nav-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 600px;
    padding: 40px;
}

.hex-nav-item {
    width: 140px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--bg-secondary);
    border: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.hex-nav-item:hover {
    background: var(--wash-violet);
    transform: scale(1.08);
}

.hex-nav-label {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--neon-cyan);
    text-align: center;
}

/* Panels */
.panel {
    position: relative;
    min-height: 100vh;
    width: 100%;
    z-index: 1;
    overflow: hidden;
}

/* Honeycomb Grid */
.honeycomb-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    gap: 0;
    width: 100%;
    position: relative;
}

/* Hexagonal Cells */
.hex-cell {
    width: var(--hex-size);
    height: calc(var(--hex-size) * 1.1547);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out, filter 0.8s ease-out;
    margin: calc(var(--hex-size) * -0.06) calc(var(--hex-size) * 0.02);
}

.hex-cell.dormant {
    background: var(--bg-secondary);
    opacity: 0.3;
    animation: dormantPulse 4s ease-in-out infinite;
}

.hex-cell.dormant::after {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(233, 48, 168, 0.08);
}

@keyframes dormantPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.35; }
}

.hex-cell.awakening {
    animation: hexAwaken 0.8s ease-out forwards;
}

@keyframes hexAwaken {
    0% { opacity: 0.2; }
    50% { opacity: 0.6; border-color: rgba(233, 48, 168, 0.4); }
    100% { opacity: 0.8; }
}

.hex-cell.awakening::after {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(233, 48, 168, 0.4);
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(233, 48, 168, 0.2); }
    50% { border-color: rgba(48, 232, 215, 0.4); }
}

.hex-inner {
    width: 85%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}

/* Zoom-focus reveal animation */
.hex-cell[data-reveal='true'] {
    opacity: 0;
    transform: scale(2.5);
    filter: blur(20px);
}

.hex-cell[data-reveal='true'].revealed {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* Panel 1: The Veil */
.panel-veil {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.panel-veil .honeycomb-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
}

.veil-title-hex {
    position: relative;
    z-index: 10;
    width: calc(var(--hex-size) * 2.5);
    height: calc(var(--hex-size) * 2.5 * 1.1547);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 18, 0.6);
}

.veil-title-content {
    text-align: center;
}

.title-mysterious {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: 0.03em;
    line-height: 1.2;
    color: var(--neon-magenta);
    text-shadow:
        0 0 4px var(--neon-magenta),
        0 0 16px var(--neon-magenta),
        0 0 40px rgba(233, 48, 168, 0.5),
        0 0 80px rgba(233, 48, 168, 0.3);
}

.title-boo {
    font-family: 'Gochi Hand', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--neon-cyan);
    text-shadow:
        0 0 4px var(--neon-cyan),
        0 0 16px var(--neon-cyan),
        0 0 40px rgba(48, 232, 215, 0.4);
    display: block;
}

/* Panel 2: The Symbols */
.panel-symbols {
    background: var(--bg-primary);
    padding: 40px 0;
}

.panel-symbols .honeycomb-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.symbol-cell {
    background: var(--bg-secondary);
    cursor: default;
}

.symbol-cell .hex-inner {
    padding: 15px;
}

.symbol-svg {
    width: 100%;
    height: 100%;
    max-width: 160px;
    max-height: 160px;
}

/* Symbol Animations */
.zigzag-serpent {
    animation: serpentUndulate 3s ease-in-out infinite;
}

@keyframes serpentUndulate {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.concentric-triangles {
    animation: triangleRotate 30s linear infinite;
}

@keyframes triangleRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spiral-vortex {
    animation: spiralPulse 4s ease-in-out infinite;
}

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

.dotted-constellation {
    animation: constellationTwinkle 5s ease-in-out infinite;
}

@keyframes constellationTwinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Panel 3: The Grimoire */
.panel-grimoire {
    background: var(--bg-primary);
    padding: 40px 0;
    position: relative;
}

.panel-grimoire .honeycomb-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.grimoire-cell {
    background: var(--bg-secondary);
}

.grimoire-text {
    font-family: 'Architects Daughter', cursive;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    line-height: 1.65;
    color: var(--earth-sienna);
    letter-spacing: 0.01em;
}

.redacted {
    position: relative;
    display: inline;
}

.redacted::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
    background: var(--wash-violet);
    opacity: 0.7;
    filter: url(#watercolor);
    pointer-events: none;
}

.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.connection-line {
    stroke: var(--ember-peach);
    stroke-width: 1.5;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    opacity: 0.5;
    transition: stroke-dashoffset 1.5s ease-out;
}

.connection-line.drawn {
    stroke-dashoffset: 0;
}

/* Panel 4: The Aurora */
.panel-aurora {
    background: var(--bg-primary);
    position: relative;
    padding: 40px 0;
}

.aurora-intense {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.panel-aurora.active .aurora-intense {
    opacity: 1;
}

.aurora-intense-layer {
    position: absolute;
    border-radius: 50%;
}

.aurora-intense-1 {
    width: 80vw;
    height: 70vh;
    top: 10%;
    left: -10%;
    background: radial-gradient(ellipse, rgba(233,48,168,0.5), transparent 60%);
    filter: blur(80px);
    animation: auroraIntense1 20s ease-in-out infinite;
    mix-blend-mode: screen;
}

.aurora-intense-2 {
    width: 70vw;
    height: 60vh;
    top: 20%;
    right: -5%;
    background: radial-gradient(ellipse, rgba(48,232,215,0.45), transparent 60%);
    filter: blur(70px);
    animation: auroraIntense2 15s ease-in-out infinite;
    mix-blend-mode: screen;
}

.aurora-intense-3 {
    width: 90vw;
    height: 50vh;
    bottom: 0;
    left: 5%;
    background: radial-gradient(ellipse, rgba(74,45,107,0.6), transparent 60%);
    filter: blur(90px);
    animation: auroraIntense3 25s ease-in-out infinite;
    mix-blend-mode: screen;
}

@keyframes auroraIntense1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(15vw, 10vh); }
}

@keyframes auroraIntense2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20vw, -5vh); }
}

@keyframes auroraIntense3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10vw, -15vh); }
}

.panel-aurora .honeycomb-grid {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.aurora-cell {
    background: rgba(22, 22, 36, 0.4);
    transition: border-opacity 3s ease, transform 0.8s ease-out, opacity 0.8s ease-out, filter 0.8s ease-out;
}

.aurora-cell.dissolving::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid transparent;
    animation: borderDissolve 3s ease forwards;
}

@keyframes borderDissolve {
    0% { border-color: rgba(233, 48, 168, 0.3); }
    50% { border-color: transparent; }
    100% { border-color: rgba(48, 232, 215, 0.3); }
}

/* Panel 5: The Residue */
.panel-residue {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 80px 20px;
}

.residue-grid {
    opacity: 0.3;
}

.residue-cell {
    background: transparent;
    opacity: 0.2;
}

.residue-final-text {
    position: relative;
    z-index: 10;
    text-align: center;
    margin: 60px 0;
}

.residue-message {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--neon-magenta);
    opacity: 0;
    transition: opacity 2s ease;
    text-shadow:
        0 0 4px var(--neon-magenta),
        0 0 16px rgba(233, 48, 168, 0.4);
}

.residue-message.visible {
    opacity: 0.8;
}

.residue-stains {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.stain {
    position: absolute;
    opacity: 0.5;
}

.stain-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 5%;
}

.stain-2 {
    width: 200px;
    height: 200px;
    top: 40%;
    right: 10%;
}

.stain-3 {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 30%;
}

/* Transition Stains */
.transition-stain {
    position: absolute;
    width: 100vw;
    height: 200px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
}

.transition-stain-1 {
    top: calc(200vh - 100px);
    left: 0;
}

.transition-stain-2 {
    top: calc(400vh - 100px);
    left: 0;
}

/* Handwritten Annotations */
.annotation {
    position: absolute;
    font-family: 'Gochi Hand', cursive;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: var(--ember-peach);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.annotation.visible {
    opacity: 0.6;
}

/* Hex Nav Button glow when in residue */
.hex-nav-btn.glowing {
    opacity: 1;
    animation: navGlow 2s ease-in-out infinite;
}

@keyframes navGlow {
    0%, 100% { color: var(--neon-magenta); }
    50% { color: var(--neon-cyan); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --hex-size: clamp(120px, 40vw, 180px);
    }

    .veil-title-hex {
        width: calc(var(--hex-size) * 2);
        height: calc(var(--hex-size) * 2 * 1.1547);
    }

    .hex-nav-grid {
        gap: 10px;
    }

    .hex-nav-item {
        width: 100px;
        height: 115px;
    }

    .hex-nav-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    :root {
        --hex-size: clamp(100px, 45vw, 150px);
    }
}
