/* ============================================================
   diplomacy.boo — Cream Tea Diplomatic Salon
   Palette: #FFF8F0 #FEF0E1 #F2A7B3 #C3B1E1 #B8E0C8 #F9E08E
            #4A3728 #7D6B5D #F4C28F
   Fonts:   Nunito (display 800) · Quicksand (body 500)
            Patrick Hand (annotation)
   ============================================================ */

:root {
    --cream: #FFF8F0;
    --meringue: #FEF0E1;
    --blush: #F2A7B3;
    --lavender: #C3B1E1;
    --mint: #B8E0C8;
    --butter: #F9E08E;
    --apricot: #F4C28F;
    --cocoa: #4A3728;
    --mocha: #7D6B5D;

    --spring-in: cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring-out: cubic-bezier(0.55, 0, 1, 0.45);
    --spring-hover: cubic-bezier(0.18, 1.2, 0.4, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    color: var(--cocoa);
    background: var(--cream);
    background-image:
        radial-gradient(ellipse at 20% 10%, rgba(242,167,179,0.08), transparent 55%),
        radial-gradient(ellipse at 80% 30%, rgba(195,177,225,0.08), transparent 55%),
        radial-gradient(ellipse at 50% 70%, rgba(184,224,200,0.08), transparent 60%),
        linear-gradient(180deg, var(--cream), var(--meringue));
    line-height: 1.7;
    overflow-x: hidden;
}

/* ============================================================
   Background bubble field (JS-spawned, drifting)
   ============================================================ */
.bubble-field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.bubble-field .bubble { pointer-events: auto; }

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.65), transparent 60%),
                var(--bcolor, var(--blush));
    opacity: var(--bop, 0.4);
    cursor: pointer;
    transition: transform 0.15s var(--spring-hover);
    animation: float var(--bdur, 14s) ease-in-out infinite;
    animation-delay: var(--bdelay, 0s);
}

.bubble.popping {
    animation: pop 0.5s forwards;
}

.bubble .spark {
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--bcolor, var(--blush));
    opacity: 0;
}
.bubble.popping .spark {
    animation: spark 0.5s forwards ease-out;
}

@keyframes float {
    0%   { transform: translate(0,0); }
    25%  { transform: translate(12px, -40px); }
    50%  { transform: translate(-10px, -80px); }
    75%  { transform: translate(8px, -120px); }
    100% { transform: translate(0, -160px); opacity: 0; }
}

@keyframes pop {
    0%   { transform: scale(1); opacity: var(--bop, 0.4); }
    40%  { transform: scale(1.3); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0; }
}

@keyframes spark {
    0%   { transform: translate(-50%,-50%) rotate(var(--sa,0deg)) translateX(0); opacity: 1; }
    100% { transform: translate(-50%,-50%) rotate(var(--sa,0deg)) translateX(30px); opacity: 0; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 6rem;
    z-index: 1;
}

.hero-table {
    position: relative;
    width: min(900px, 96vw);
    text-align: center;
}

.round-table {
    width: 100%;
    height: auto;
    max-height: 60vh;
    filter: drop-shadow(0 20px 30px rgba(74,55,40,0.10));
    animation: tableSway 9s ease-in-out infinite;
}
.round-table .chairs circle { transform-origin: center; }
.round-table .tea circle { animation: pulse 4s ease-in-out infinite; }

@keyframes tableSway {
    0%,100% { transform: translateY(0) rotate(0deg); }
    50%     { transform: translateY(-6px) rotate(0.5deg); }
}
@keyframes pulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.05); }
}

.hero-title {
    position: relative;
    margin-top: -2.5rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 1.05;
    color: var(--cocoa);
    letter-spacing: -0.02em;
    transform: rotate(-1.5deg);
    text-shadow: 3px 4px 0 rgba(242,167,179,0.35);
}
.hero-word { color: var(--cocoa); }
.hero-dot {
    color: var(--blush);
    display: inline-block;
    animation: dotBounce 2.4s var(--spring-in) infinite;
}
.hero-boo {
    color: var(--lavender);
    display: inline-block;
    animation: booPeek 4s ease-in-out infinite;
}
@keyframes dotBounce {
    0%,100% { transform: translateY(0) scale(1); }
    50%     { transform: translateY(-10px) scale(1.15); }
}
@keyframes booPeek {
    0%,100% { transform: rotate(-3deg) translateY(0); }
    50%     { transform: rotate(3deg) translateY(-4px); }
}

.hero-tag {
    margin-top: 1.5rem;
    font-family: 'Patrick Hand', cursive;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--mocha);
}

.scroll-bubble {
    position: absolute;
    bottom: -3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.scroll-bubble-inner {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.7), transparent 60%), var(--blush);
    box-shadow: 0 6px 14px rgba(242,167,179,0.45);
    animation: scrollPulse 2s var(--spring-in) infinite;
}
.scroll-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.95rem;
    color: var(--mocha);
}
@keyframes scrollPulse {
    0%,100% { transform: scale(1) translateY(0); }
    50%     { transform: scale(1.12) translateY(8px); }
}

/* ============================================================
   ACT shared
   ============================================================ */
.act {
    position: relative;
    padding: 6rem 1.5rem;
    z-index: 1;
}

.act-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 4rem;
}
.act-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--cocoa);
    letter-spacing: -0.01em;
    transform: rotate(-1deg);
    display: inline-block;
}
.act-sub {
    margin-top: 1rem;
    font-family: 'Patrick Hand', cursive;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    color: var(--mocha);
}
.ribbon {
    display: block;
    width: 100px;
    margin: 0 auto 0.75rem;
}

.wavy-divider {
    display: block;
    width: 100%;
    height: 40px;
    margin-top: 5rem;
}
.wavy-divider.flip { transform: scaleY(-1); }

/* ============================================================
   ACT I — Pod trail (organic S-curve)
   ============================================================ */
.pod-trail {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.pod {
    position: relative;
    background: var(--meringue);
    border-radius: 32px;
    padding: 2rem;
    width: min(480px, 92%);
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.5rem;
    align-items: center;
    box-shadow: 0 12px 30px rgba(74,55,40,0.10), 0 2px 0 rgba(74,55,40,0.05);
    border: 2px dashed transparent;
    opacity: 0;
    transform: translateY(40px) rotate(0deg);
    transition: opacity 0.6s var(--spring-in), transform 0.6s var(--spring-in);
}
.pod.visible { opacity: 1; }

.pod[data-side="left"] {
    align-self: flex-start;
    margin-left: clamp(1rem, 6vw, 6rem);
    --tilt: -2.5deg;
}
.pod[data-side="right"] {
    align-self: flex-end;
    margin-right: clamp(1rem, 6vw, 6rem);
    --tilt: 2deg;
}
.pod.visible { transform: translateY(0) rotate(var(--tilt, 0deg)); }

.pod-blush    { border-color: var(--blush); }
.pod-lavender { border-color: var(--lavender); }
.pod-mint     { border-color: var(--mint); }
.pod-butter   { border-color: var(--butter); }
.pod-apricot  { border-color: var(--apricot); }

.pod:hover {
    transform: translateY(-6px) rotate(0deg) scale(1.02);
    transition: transform 0.4s var(--spring-hover);
}

.pod-illustration {
    width: 140px; height: 140px;
    display: flex;
    align-items: center; justify-content: center;
}
.delegate {
    width: 100%; height: 100%;
    filter: drop-shadow(0 6px 8px rgba(74,55,40,0.12));
}
.pod-blush    .delegate { animation: swayBlush 3s ease-in-out infinite; }
.pod-lavender .delegate { animation: bobLavender 4s ease-in-out infinite; }
.pod-mint     .delegate { animation: wobbleMint 2.5s ease-in-out infinite; }
.pod-butter   .delegate { animation: pulseButter 3.5s ease-in-out infinite; }
.pod-apricot  .delegate { animation: tiltApricot 2s ease-in-out infinite; }

@keyframes swayBlush    { 0%,100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@keyframes bobLavender  { 0%,100% { transform: translateY(-2px); } 50% { transform: translateY(2px); } }
@keyframes wobbleMint   { 0%,100% { transform: rotate(-2deg); }    50% { transform: rotate(2deg); } }
@keyframes pulseButter  { 0%,100% { transform: scale(1); }         50% { transform: scale(1.03); } }
@keyframes tiltApricot  { 0%,100% { transform: rotate(0deg); }     50% { transform: rotate(3deg); } }

.pod-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--cocoa);
    line-height: 1.1;
}
.pod-country {
    font-family: 'Patrick Hand', cursive;
    color: var(--mocha);
    margin-top: 0.15rem;
    font-size: 0.95rem;
}
.pod-text {
    margin-top: 0.75rem;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    color: var(--cocoa);
}
.annotation {
    display: inline-block;
    margin-top: 1rem;
    font-family: 'Patrick Hand', cursive;
    color: var(--blush);
    background: var(--cream);
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    transform: rotate(-2deg);
}
.pod-lavender .annotation { color: var(--lavender); }
.pod-mint     .annotation { color: #4f8a6c; }
.pod-butter   .annotation { color: #b08a18; }
.pod-apricot  .annotation { color: #b9743a; }

/* ============================================================
   ACT II — Orbit
   ============================================================ */
.orbit-stage {
    position: relative;
    width: min(720px, 96vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

.orbit-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.big-seal {
    width: 36%;
    filter: drop-shadow(2px 4px 0 rgba(74,55,40,0.18));
}
.seal-spinner {
    transform-origin: 120px 120px;
    animation: sealSpin 60s linear infinite;
}
@keyframes sealSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

.orbit-ring {
    position: absolute;
    inset: 0;
    transform: rotate(var(--ring-rot, 0deg));
    transition: transform 0.1s linear;
}

.orbit-pod {
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    transform: rotate(var(--angle)) translateY(calc(-1 * min(40vw, 320px)));
}

.orbit-card {
    transform: translate(-50%, -50%) rotate(calc(-1 * (var(--angle) + var(--ring-rot, 0deg))));
    width: clamp(150px, 18vw, 200px);
    background: var(--meringue);
    padding: 1rem 1.1rem;
    border-radius: 24px;
    border-top: 6px solid var(--blush);
    box-shadow: 0 10px 22px rgba(74,55,40,0.12);
    text-align: center;
}
.orbit-card[data-color="#F2A7B3"] { border-top-color: var(--blush); }
.orbit-card[data-color="#C3B1E1"] { border-top-color: var(--lavender); }
.orbit-card[data-color="#B8E0C8"] { border-top-color: var(--mint); }
.orbit-card[data-color="#F9E08E"] { border-top-color: var(--butter); }
.orbit-card[data-color="#F4C28F"] { border-top-color: var(--apricot); }

.orbit-card h4 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: var(--cocoa);
    font-size: 1.1rem;
}
.orbit-card p {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--mocha);
}

/* ============================================================
   ACT III — Treaty
   ============================================================ */
.treaty-scroll {
    max-width: 900px;
    margin: 0 auto;
    transition: max-width 0.4s var(--spring-in);
}
.treaty-scroll.narrow { max-width: 500px; }

.treaty-paper {
    position: relative;
    background:
        repeating-linear-gradient(180deg, transparent 0 32px, rgba(125,107,93,0.05) 32px 33px),
        linear-gradient(180deg, var(--meringue), #FAE6CE);
    border-radius: 28px;
    padding: 4rem 3rem;
    box-shadow:
        0 20px 40px rgba(74,55,40,0.18),
        inset 0 0 0 2px rgba(244,194,143,0.5);
}
.treaty-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--cocoa);
    text-align: center;
    margin-bottom: 1.5rem;
}
.treaty-line {
    margin: 1rem 0;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--cocoa);
}
.treaty-final {
    font-family: 'Patrick Hand', cursive;
    text-align: center;
    color: var(--blush);
    margin-top: 2rem;
    font-size: 1.3rem;
}
.signatures {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    justify-content: center;
}
.sig {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.4rem;
    color: var(--sigc, var(--cocoa));
    transform: rotate(-3deg);
}
.sig:nth-child(even) { transform: rotate(3deg); }

.wax-seal {
    position: absolute;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #F8C4CB, var(--blush) 70%);
    box-shadow: 2px 3px 0 rgba(74,55,40,0.18);
    clip-path: polygon(
        50% 0%, 60% 8%, 71% 4%, 78% 14%, 88% 14%, 91% 24%, 100% 30%,
        96% 41%, 100% 50%, 96% 59%, 100% 70%, 91% 76%, 88% 86%,
        78% 86%, 71% 96%, 60% 92%, 50% 100%, 40% 92%, 29% 96%,
        22% 86%, 12% 86%, 9% 76%, 0% 70%, 4% 59%, 0% 50%,
        4% 41%, 0% 30%, 9% 24%, 12% 14%, 22% 14%, 29% 4%, 40% 8%
    );
}
.corner-tl { top: 12px; left: 12px; }
.corner-tr { top: 12px; right: 12px; background: radial-gradient(circle at 30% 30%, #DCCAF1, var(--lavender) 70%); }
.corner-bl { bottom: 12px; left: 12px; background: radial-gradient(circle at 30% 30%, #CFEBDA, var(--mint) 70%); }
.corner-br { bottom: 12px; right: 12px; background: radial-gradient(circle at 30% 30%, #FCEDB0, var(--butter) 70%); }

.final-seal-stage {
    margin-top: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.final-seal {
    width: clamp(220px, 36vw, 360px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #F8C4CB, var(--blush) 70%);
    box-shadow: 4px 6px 0 rgba(74,55,40,0.2), 0 30px 60px rgba(242,167,179,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--cream);
    text-align: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    animation: finalPulse 4s var(--spring-in) infinite;
    border: 6px dashed var(--meringue);
    padding: 2rem;
}
.final-seal-name {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    line-height: 1;
}
.final-seal-name .dot { color: var(--butter); }
.final-seal-sub {
    margin-top: 0.75rem;
    font-family: 'Patrick Hand', cursive;
    font-weight: 400;
    font-size: 1rem;
    color: var(--meringue);
}
@keyframes finalPulse {
    0%,100% { transform: scale(1) rotate(-2deg); }
    50%     { transform: scale(1.04) rotate(2deg); }
}

.foot {
    text-align: center;
    margin-top: 5rem;
    color: var(--mocha);
    font-family: 'Patrick Hand', cursive;
    font-size: 1rem;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    .pod {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem;
    }
    .pod-illustration { margin: 0 auto; width: 120px; height: 120px; }
    .orbit-pod { transform: rotate(var(--angle)) translateY(calc(-1 * 38vw)); }
    .orbit-card { width: 130px; padding: 0.6rem 0.7rem; }
    .orbit-card h4 { font-size: 0.95rem; }
    .orbit-card p { font-size: 0.78rem; }
    .treaty-paper { padding: 2.5rem 1.5rem; }
}
