/* === iggi.boo - Dopamine Ghost Playground === */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0a1a;
    color: #e0dff0;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    /* Palette: #0a0a1a #1a1040 #e8ff5a #ff5eb5 #5effed #b55eff #ff8e5e #e0dff0 #8a89a6 #ffffff */
}

/* === CRT Scanline Overlay === */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
}

/* === Sparkles === */
#sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    animation: sparkleRotate var(--sparkle-duration, 6s) linear infinite,
               sparklePulse var(--sparkle-pulse, 4s) ease-in-out infinite;
}

.sparkle::before,
.sparkle::after {
    content: '';
    position: absolute;
    background: var(--sparkle-color, #e8ff5a);
}

.sparkle::before {
    width: 2px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.sparkle::after {
    width: 100%;
    height: 2px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes sparkleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sparklePulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.8; }
}

/* === Sections === */
.section {
    position: relative;
    width: 100%;
}

/* === Section 1: The Boo Zone === */
#boo-zone {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.neon-dot {
    position: absolute;
    border-radius: 50%;
    animation: driftDot 8s ease-in-out infinite;
}

@keyframes driftDot {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    25% { transform: translate(15px, -20px); opacity: 0.9; }
    50% { transform: translate(-10px, -30px); opacity: 0.4; }
    75% { transform: translate(20px, -10px); opacity: 0.7; }
}

/* Iggi Main Character */
.iggi-character {
    position: absolute;
    left: 15%;
    top: 50%;
    transform: translateY(-50%);
}

.ghost-body {
    width: 280px;
    height: 320px;
    background: #e8ff5a;
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    position: relative;
    box-shadow: 0 0 40px rgba(232, 255, 90, 0.4), 0 0 80px rgba(232, 255, 90, 0.2);
    animation: wobble1 6s ease-in-out infinite;
}

.ghost-body.small {
    width: 140px;
    height: 160px;
}

.ghost-eye {
    position: absolute;
    width: 24px;
    height: 30px;
    background: #0a0a1a;
    border-radius: 50%;
    top: 35%;
}

.ghost-eye.left {
    left: 30%;
}

.ghost-eye.right {
    right: 30%;
}

.ghost-body.small .ghost-eye {
    width: 14px;
    height: 18px;
}

.ghost-mouth {
    position: absolute;
    width: 20px;
    height: 22px;
    background: #0a0a1a;
    border-radius: 50%;
    bottom: 35%;
    left: 50%;
    transform: translateX(-50%);
}

.ghost-body.small .ghost-mouth {
    width: 12px;
    height: 14px;
}

@keyframes wobble1 {
    0%, 100% { border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%; }
    33% { border-radius: 55% 45% 40% 60% / 40% 55% 45% 60%; }
    66% { border-radius: 45% 55% 60% 40% / 60% 45% 55% 40%; }
}

/* Hero Text */
.hero-text {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
}

.domain-title {
    font-family: 'Bungee Shade', cursive;
    font-size: clamp(60px, 10vw, 140px);
    font-weight: 400;
    color: #e8ff5a;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-shadow: 0 0 30px rgba(232, 255, 90, 0.37), 0 0 60px rgba(232, 255, 90, 0.19);
}

.letter {
    display: inline-block;
    animation: letterBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes letterBounce {
    0% { transform: translateY(60px) scale(0.3); opacity: 0; }
    60% { transform: translateY(-10px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.tagline {
    font-family: 'Caveat', cursive;
    font-size: 28px;
    font-weight: 400;
    color: #5effed;
    margin-top: 16px;
    opacity: 0;
    animation: fadeIn 1s ease-out 1s forwards;
}

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

/* Glow pulse rings on hover */
.iggi-character:hover .ghost-body::before,
.iggi-character:hover .ghost-body::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    border: 2px solid #e8ff5a;
    transform: translate(-50%, -50%);
}

.iggi-character:hover .ghost-body::before {
    animation: glowRing 0.8s ease-out forwards;
}

.iggi-character:hover .ghost-body::after {
    animation: glowRing 1.2s ease-out forwards;
}

@keyframes glowRing {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* === Section 2: Ghost Gallery === */
#ghost-gallery {
    min-height: 250vh;
    padding: 100px 0;
    position: relative;
}

.ghost-card {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    margin: 80px auto;
    max-width: 700px;
    opacity: 0;
    transform: scale(0.3);
}

.ghost-card.visible {
    animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ghost-card.left {
    margin-left: 10%;
    margin-right: auto;
    flex-direction: row;
}

.ghost-card.right {
    margin-right: 10%;
    margin-left: auto;
    flex-direction: row-reverse;
    text-align: right;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Ghost blobs with unique shapes */
.ghost-blob {
    width: 120px;
    height: 140px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ghost-blob:hover {
    transform: scale(1.1);
}

.ghost-blob .ghost-eye {
    width: 14px;
    height: 18px;
}

.ghost-blob .ghost-mouth {
    width: 12px;
    height: 14px;
}

.ghost-1 {
    background: #ff5eb5;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: 0 0 20px rgba(255, 94, 181, 0.4), 0 0 40px rgba(255, 94, 181, 0.2);
    animation: wobble2 5.5s ease-in-out infinite;
}

.ghost-2 {
    background: #5effed;
    border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%;
    box-shadow: 0 0 20px rgba(94, 255, 237, 0.4), 0 0 40px rgba(94, 255, 237, 0.2);
    animation: wobble3 6.2s ease-in-out infinite;
}

.ghost-3 {
    background: #b55eff;
    border-radius: 50% 50% 35% 65% / 45% 55% 45% 55%;
    box-shadow: 0 0 20px rgba(181, 94, 255, 0.4), 0 0 40px rgba(181, 94, 255, 0.2);
    animation: wobble4 7s ease-in-out infinite;
}

.ghost-4 {
    background: #ff8e5e;
    border-radius: 60% 40% 50% 50% / 35% 65% 35% 65%;
    box-shadow: 0 0 20px rgba(255, 142, 94, 0.4), 0 0 40px rgba(255, 142, 94, 0.2);
    animation: wobble5 5.8s ease-in-out infinite;
}

.ghost-5 {
    background: #e8ff5a;
    border-radius: 45% 55% 65% 35% / 55% 45% 55% 45%;
    box-shadow: 0 0 20px rgba(232, 255, 90, 0.4), 0 0 40px rgba(232, 255, 90, 0.2);
    animation: wobble6 6.5s ease-in-out infinite;
}

.ghost-6 {
    background: #ff5eb5;
    border-radius: 55% 45% 40% 60% / 50% 50% 50% 50%;
    box-shadow: 0 0 20px rgba(255, 94, 181, 0.4), 0 0 40px rgba(255, 94, 181, 0.2);
    animation: wobble7 7.2s ease-in-out infinite;
}

@keyframes wobble2 {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    33% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    66% { border-radius: 50% 50% 60% 40% / 40% 60% 40% 60%; }
}

@keyframes wobble3 {
    0%, 100% { border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%; }
    33% { border-radius: 40% 60% 70% 30% / 30% 70% 30% 70%; }
    66% { border-radius: 60% 40% 40% 60% / 50% 50% 50% 50%; }
}

@keyframes wobble4 {
    0%, 100% { border-radius: 50% 50% 35% 65% / 45% 55% 45% 55%; }
    33% { border-radius: 35% 65% 55% 45% / 55% 45% 55% 45%; }
    66% { border-radius: 65% 35% 45% 55% / 40% 60% 40% 60%; }
}

@keyframes wobble5 {
    0%, 100% { border-radius: 60% 40% 50% 50% / 35% 65% 35% 65%; }
    33% { border-radius: 45% 55% 35% 65% / 65% 35% 65% 35%; }
    66% { border-radius: 55% 45% 65% 35% / 50% 50% 50% 50%; }
}

@keyframes wobble6 {
    0%, 100% { border-radius: 45% 55% 65% 35% / 55% 45% 55% 45%; }
    33% { border-radius: 65% 35% 45% 55% / 35% 65% 35% 65%; }
    66% { border-radius: 35% 65% 55% 45% / 65% 35% 65% 35%; }
}

@keyframes wobble7 {
    0%, 100% { border-radius: 55% 45% 40% 60% / 50% 50% 50% 50%; }
    33% { border-radius: 40% 60% 60% 40% / 40% 60% 40% 60%; }
    66% { border-radius: 60% 40% 50% 50% / 60% 40% 60% 40%; }
}

.ghost-name {
    font-family: 'Caveat', cursive;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ghost-desc {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: #e0dff0;
    line-height: 1.65;
}

/* Zigzag Connectors */
.zigzag-connectors {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.zigzag-connectors line {
    stroke: rgba(138, 137, 166, 0.3);
    stroke-width: 1;
    stroke-dasharray: 6 4;
}

/* === Section 3: Glow Field === */
#glow-field {
    height: 100vh;
    position: relative;
}

#glow-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* === Section 4: Whisper Wall === */
#whisper-wall {
    height: 300vh;
    position: relative;
}

.whisper-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.whisper-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 300vw;
    height: 100%;
    will-change: transform;
}

.whisper-text {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    white-space: nowrap;
    text-shadow: 0 0 20px currentColor;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.whisper-text:hover {
    opacity: 1;
    transform: scale(1.1) !important;
}

/* === Section 5: The Goodbye === */
#goodbye {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    position: relative;
}

.iggi-farewell {
    animation: floatUp 8s ease-in-out infinite;
}

.ghost-wave {
    position: absolute;
    right: -30px;
    top: 30%;
    font-size: 24px;
    animation: wave 1s ease-in-out infinite alternate;
}

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

@keyframes wave {
    0% { transform: rotate(-10deg); }
    100% { transform: rotate(20deg); }
}

.farewell-title {
    font-size: clamp(40px, 6vw, 80px);
    color: #b55eff;
    text-shadow: 0 0 30px rgba(181, 94, 255, 0.37), 0 0 60px rgba(181, 94, 255, 0.19);
    opacity: 0.7;
}

.farewell-boo {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    color: #8a89a6;
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .iggi-character {
        left: 50%;
        top: 25%;
        transform: translate(-50%, -50%) scale(0.7);
    }

    .hero-text {
        right: auto;
        left: 50%;
        top: 65%;
        transform: translate(-50%, -50%);
        text-align: center;
    }

    .ghost-card.left,
    .ghost-card.right {
        margin-left: 5%;
        margin-right: 5%;
        flex-direction: column;
        text-align: center;
    }

    .ghost-card.right {
        flex-direction: column;
    }
}
