/* ============================================
   diplomatic.boo - Goblincore Earthy Chaos
   Spooky-cute diplomatic experience
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --pumpkin-patch: #2d1b0e;
    --ectoplasm-green: #7fff00;
    --candy-corn: #ffb833;
    --bone-white: #f5f0e0;
    --blood-plum: #6b2d5b;
    --cobweb-gray: #8a8a7a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--pumpkin-patch);
    color: var(--bone-white);
    font-family: 'Patrick Hand', cursive;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* --- Cobweb SVG Decorations --- */
.cobweb {
    position: fixed;
    width: 200px;
    height: 200px;
    z-index: 1;
    pointer-events: none;
}

.cobweb-top-left {
    top: 0;
    left: 0;
}

.cobweb-bottom-right {
    bottom: 0;
    right: 0;
    position: absolute;
}

/* --- Bat Silhouettes --- */
.bat {
    position: fixed;
    width: 30px;
    height: 16px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
}

.bat::before,
.bat::after {
    content: '';
    position: absolute;
    top: 0;
    width: 14px;
    height: 16px;
    background: #1a0f08;
    clip-path: polygon(50% 100%, 0% 30%, 10% 0%, 40% 20%, 60% 0%, 100% 30%, 90% 50%, 70% 40%);
}

.bat::before {
    left: 0;
}

.bat::after {
    right: 0;
    transform: scaleX(-1);
}

.bat-1 {
    animation: batFly 12s linear 2s infinite;
}

.bat-2 {
    animation: batFly 15s linear 6s infinite;
    width: 22px;
    height: 12px;
}

.bat-3 {
    animation: batFly 18s linear 10s infinite;
    width: 26px;
    height: 14px;
}

@keyframes batFly {
    0% {
        left: -40px;
        top: 15vh;
        opacity: 0;
        transform: scaleX(1) rotate(-5deg);
    }
    5% {
        opacity: 0.7;
    }
    25% {
        top: 8vh;
        transform: scaleX(1) rotate(3deg);
    }
    49% {
        transform: scaleX(1) rotate(-2deg);
    }
    50% {
        top: 20vh;
        transform: scaleX(-1) rotate(2deg);
    }
    75% {
        top: 12vh;
        transform: scaleX(-1) rotate(-4deg);
    }
    95% {
        opacity: 0.7;
    }
    100% {
        left: calc(100vw + 40px);
        top: 18vh;
        opacity: 0;
        transform: scaleX(-1) rotate(0deg);
    }
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-noise {
    position: absolute;
    inset: 0;
    background-image:
        repeating-radial-gradient(circle at 17% 32%, rgba(245, 240, 224, 0.015) 0px, transparent 1px),
        repeating-radial-gradient(circle at 62% 78%, rgba(245, 240, 224, 0.012) 0px, transparent 1px),
        repeating-radial-gradient(circle at 85% 15%, rgba(245, 240, 224, 0.01) 0px, transparent 1px);
    background-size: 3px 3px, 5px 5px, 7px 7px;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* --- CSS Ghost Ambassador (Hero) --- */
.ghost-ambassador {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.ghost-body {
    width: 120px;
    height: 140px;
    background: var(--bone-white);
    border-radius: 50% 50% 45% 45%;
    position: relative;
    margin: 0 auto;
    box-shadow:
        0 0 40px rgba(127, 255, 0, 0.2),
        0 0 80px rgba(127, 255, 0, 0.1);
    animation: ghostFloat 3s ease-in-out infinite;
}

.ghost-eye {
    position: absolute;
    width: 16px;
    height: 20px;
    background: var(--pumpkin-patch);
    border-radius: 50%;
    top: 45px;
}

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

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

.ghost-mouth {
    position: absolute;
    width: 20px;
    height: 12px;
    border-bottom: 3px solid var(--pumpkin-patch);
    border-radius: 0 0 50% 50%;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
}

.ghost-tail {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 20px;
    background: var(--bone-white);
    clip-path: polygon(0% 0%, 15% 100%, 30% 0%, 45% 100%, 60% 0%, 75% 100%, 90% 0%, 100% 50%, 100% 0%);
}

/* Ghost's flag */
.ghost-flag {
    position: absolute;
    right: -35px;
    top: 20px;
}

.flag-pole {
    width: 3px;
    height: 50px;
    background: var(--cobweb-gray);
    border-radius: 1px;
}

.flag-cloth {
    position: absolute;
    top: 0;
    left: 3px;
    width: 28px;
    height: 18px;
    background: var(--ectoplasm-green);
    clip-path: polygon(0 0, 100% 10%, 90% 50%, 100% 90%, 0 100%);
    animation: flagWave 2s ease-in-out infinite;
}

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

@keyframes flagWave {
    0%, 100% { transform: skewY(0deg); }
    50% { transform: skewY(3deg); }
}

/* --- Hero Typography --- */
.site-title {
    font-family: 'Indie Flower', cursive;
    font-weight: 400;
    line-height: 1.2;
}

.title-boo {
    display: block;
    font-family: 'Creepster', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--ectoplasm-green);
    text-shadow:
        0 0 20px rgba(127, 255, 0, 0.4),
        0 0 40px rgba(127, 255, 0, 0.2);
    letter-spacing: 0.3em;
    animation: booFlicker 4s ease-in-out infinite;
}

.title-main {
    display: block;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--candy-corn);
    margin-top: 0.5rem;
}

@keyframes booFlicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.6; }
    94% { opacity: 1; }
    96% { opacity: 0.8; }
    97% { opacity: 1; }
}

.hero-subtitle {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.4rem;
    color: var(--cobweb-gray);
    margin-top: 1rem;
    letter-spacing: 0.05em;
}

/* --- Scroll Hint --- */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: hintBob 2s ease-in-out infinite;
}

.scroll-ghost-mini {
    display: block;
    width: 20px;
    height: 24px;
    background: var(--bone-white);
    border-radius: 50% 50% 45% 45%;
    opacity: 0.5;
}

.scroll-text {
    font-family: 'Indie Flower', cursive;
    font-size: 0.9rem;
    color: var(--cobweb-gray);
    opacity: 0.6;
}

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

/* --- Peek-a-Boo Ghosts (Sticky) --- */
.peek-ghost {
    position: sticky;
    z-index: 10;
    pointer-events: none;
    height: 0;
    overflow: visible;
}

.peek-ghost-1 {
    top: 30vh;
    margin-left: 5vw;
}

.peek-ghost-2 {
    top: 50vh;
    margin-left: 85vw;
}

.peek-ghost-3 {
    top: 70vh;
    margin-left: 8vw;
}

.peek-ghost-4 {
    top: 40vh;
    margin-left: 90vw;
}

/* --- Mini Ghost Shapes --- */
.mini-ghost {
    width: 50px;
    height: 60px;
    background: var(--bone-white);
    border-radius: 50% 50% 45% 45%;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.4s ease;
    animation: miniFloat 4s ease-in-out infinite;
}

.mini-ghost::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--bone-white);
    clip-path: polygon(0% 0%, 20% 100%, 40% 0%, 60% 100%, 80% 0%, 100% 50%);
}

.mg-eye {
    position: absolute;
    width: 8px;
    height: 10px;
    background: var(--pumpkin-patch);
    border-radius: 50%;
    top: 22px;
}

.mg-eye-l { left: 12px; }
.mg-eye-r { right: 12px; }

/* Expression variants */
.mini-ghost.happy .mg-eye {
    height: 8px;
    top: 24px;
}

.mini-ghost.scared .mg-eye {
    width: 10px;
    height: 12px;
    top: 20px;
}

.mg-mouth-o {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--pumpkin-patch);
    border-radius: 50%;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
}

.mini-ghost.stern .mg-eye {
    height: 6px;
    top: 25px;
}

.mg-frown {
    position: absolute;
    width: 14px;
    height: 6px;
    border-top: 2px solid var(--pumpkin-patch);
    border-radius: 0;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes miniFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-6px) rotate(3deg); }
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    padding: 6rem 2rem;
    z-index: 5;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.content-section:nth-child(odd) {
    background: rgba(45, 27, 14, 0.6);
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Indie Flower', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--candy-corn);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.creepy-title::after {
    content: 'BOO';
    font-family: 'Creepster', cursive;
    font-size: 0.5em;
    color: var(--ectoplasm-green);
    opacity: 0.3;
    position: absolute;
    top: -0.6em;
    right: 10%;
    transform: rotate(12deg);
}

/* --- Blob Cards --- */
.blob-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
}

.blob-card {
    position: relative;
    flex: 1 1 280px;
    max-width: 360px;
    padding: 2.5rem 2rem;
    background: rgba(107, 45, 91, 0.25);
    border: 2px solid var(--blood-plum);
    border-radius: var(--br);
    transform: rotate(var(--rot));
    transition: border-radius 0.6s ease, transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.blob-card::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed var(--cobweb-gray);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0.3;
}

.blob-card:hover {
    border-radius: var(--br-hover);
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 0 30px rgba(127, 255, 0, 0.15);
}

.blob-card h3 {
    font-family: 'Indie Flower', cursive;
    font-size: 1.5rem;
    color: var(--ectoplasm-green);
    margin-bottom: 0.8rem;
}

.blob-card p {
    color: var(--bone-white);
    margin-bottom: 1rem;
}

/* --- Card Drip Effect --- */
.card-drip {
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
}

.card-drip::before,
.card-drip::after {
    content: '';
    position: absolute;
    background: var(--blood-plum);
    border-radius: 0 0 50% 50%;
}

.card-drip::before {
    left: 20%;
    top: 0;
    width: 8px;
    height: 16px;
}

.card-drip::after {
    left: 60%;
    top: 0;
    width: 6px;
    height: 12px;
}

/* --- Pumpkin List Bullets --- */
.pumpkin-list {
    list-style: none;
    padding-left: 1.5rem;
}

.pumpkin-list li {
    position: relative;
    padding-left: 0.5rem;
    margin-bottom: 0.4rem;
    color: var(--bone-white);
}

.pumpkin-list li::before {
    content: '';
    position: absolute;
    left: -1.2rem;
    top: 0.45em;
    width: 14px;
    height: 14px;
    background: var(--candy-corn);
    border-radius: 50%;
    clip-path: polygon(50% 0%, 40% 10%, 20% 15%, 10% 40%, 15% 70%, 30% 90%, 50% 100%, 70% 90%, 85% 70%, 90% 40%, 80% 15%, 60% 10%);
}

/* --- Ambassador Gallery --- */
.ambassador-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
}

.ambassador-card {
    flex: 0 1 280px;
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(45, 27, 14, 0.5);
    border: 2px dashed var(--cobweb-gray);
    border-radius: 20px;
    transform: rotate(var(--rot));
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.ambassador-card:hover {
    transform: rotate(0deg) translateY(-5px);
    border-color: var(--candy-corn);
}

/* --- Ambassador Ghost Characters --- */
.amb-ghost-body {
    width: 80px;
    height: 95px;
    background: var(--bone-white);
    border-radius: 50% 50% 45% 45%;
    position: relative;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 20px rgba(127, 255, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.ambassador-card:hover .amb-ghost-body {
    box-shadow: 0 0 30px rgba(127, 255, 0, 0.3);
}

.amb-eye {
    position: absolute;
    width: 12px;
    height: 14px;
    background: var(--pumpkin-patch);
    border-radius: 50%;
    top: 35px;
}

.amb-eye-l { left: 18px; }
.amb-eye-r { right: 18px; }

.amb-smile {
    position: absolute;
    width: 20px;
    height: 10px;
    border-bottom: 3px solid var(--pumpkin-patch);
    border-radius: 0 0 50% 50%;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
}

/* Stern ghost */
.stern-eye {
    height: 8px;
    top: 38px;
}

.amb-frown {
    position: absolute;
    width: 18px;
    height: 3px;
    background: var(--pumpkin-patch);
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
}

/* Scared ghost */
.big-eye {
    width: 14px;
    height: 18px;
    top: 30px;
}

.amb-gasp {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 3px solid var(--pumpkin-patch);
    border-radius: 50%;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
}

.amb-name {
    font-family: 'Indie Flower', cursive;
    font-size: 1.4rem;
    color: var(--candy-corn);
    margin-bottom: 0.3rem;
}

.amb-title {
    font-family: 'Patrick Hand', cursive;
    font-size: 1rem;
    color: var(--ectoplasm-green);
    margin-bottom: 0.8rem;
}

.amb-quote {
    font-family: 'Patrick Hand', cursive;
    font-style: italic;
    color: var(--cobweb-gray);
    font-size: 1rem;
}

/* --- Services Scatter --- */
.services-scatter {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.service-note {
    flex: 1 1 240px;
    max-width: 320px;
    padding: 2rem 1.5rem;
    background: rgba(138, 138, 122, 0.1);
    border-left: 4px solid var(--candy-corn);
    transform: rotate(var(--rot)) translate(var(--x-off, 0), var(--y-off, 0));
    transition: transform 0.3s ease, background 0.3s ease;
    position: relative;
}

.service-note::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: var(--ectoplasm-green);
    border-radius: 50%;
    opacity: 0.4;
}

.service-note:hover {
    transform: rotate(0deg) translate(0, 0) scale(1.03);
    background: rgba(138, 138, 122, 0.2);
}

.service-note h3 {
    font-family: 'Indie Flower', cursive;
    font-size: 1.3rem;
    color: var(--ectoplasm-green);
    margin-bottom: 0.6rem;
}

.service-note p {
    color: var(--bone-white);
}

/* --- Chronicle Entries --- */
.chronicle-entries {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.chronicle-entry {
    padding: 2rem;
    background: rgba(107, 45, 91, 0.15);
    border: 1px solid rgba(107, 45, 91, 0.4);
    border-radius: 12px;
    transform: rotate(var(--rot));
    transition: transform 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.chronicle-entry:hover {
    transform: rotate(0deg);
    border-color: var(--candy-corn);
}

.chronicle-entry::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--ectoplasm-green);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(127, 255, 0, 0.3);
}

.chronicle-date {
    font-family: 'Creepster', cursive;
    font-size: 1.1rem;
    color: var(--ectoplasm-green);
    display: block;
    margin-bottom: 0.4rem;
}

.chronicle-entry h3 {
    font-family: 'Indie Flower', cursive;
    font-size: 1.4rem;
    color: var(--candy-corn);
    margin-bottom: 0.5rem;
}

.chronicle-entry p {
    color: var(--bone-white);
}

/* --- Footer --- */
.site-footer {
    position: relative;
    padding: 4rem 2rem;
    text-align: center;
    border-top: 2px dashed var(--cobweb-gray);
    overflow: hidden;
}

.footer-ghost {
    margin-bottom: 1.5rem;
}

.footer-ghost .mini-ghost {
    margin: 0 auto;
    opacity: 0.4;
}

.footer-text {
    font-family: 'Indie Flower', cursive;
    font-size: 1.2rem;
    color: var(--candy-corn);
    margin-bottom: 0.5rem;
}

.footer-sub {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.9rem;
    color: var(--cobweb-gray);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .blob-cards {
        flex-direction: column;
        align-items: center;
    }

    .blob-card {
        max-width: 100%;
    }

    .ambassador-gallery {
        flex-direction: column;
        align-items: center;
    }

    .services-scatter {
        flex-direction: column;
        align-items: center;
    }

    .service-note {
        max-width: 100%;
    }

    .peek-ghost-2,
    .peek-ghost-4 {
        margin-left: 75vw;
    }

    .cobweb {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .ghost-body {
        width: 80px;
        height: 95px;
    }

    .ghost-eye {
        width: 12px;
        height: 14px;
        top: 30px;
    }

    .ghost-eye-left { left: 18px; }
    .ghost-eye-right { right: 18px; }

    .ghost-mouth {
        bottom: 35px;
    }

    .ghost-tail {
        width: 80px;
    }

    .ghost-flag {
        right: -25px;
        top: 15px;
    }

    .flag-pole {
        height: 35px;
    }

    .flag-cloth {
        width: 20px;
        height: 14px;
    }
}
