/* Header / Hero */

header.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(1rem, 4vw, 2rem) 0 0;
    background: linear-gradient(135deg, #889868 0%, #5F7A6A 60%, #4a6358 100%);
    isolation: isolate;
    color: #fff;
    border-bottom: 48px solid #16222E;
}

@media (max-width: 640px) {
    header.hero {
        padding-bottom: 35vh;
        /* Space for Planet */
    }
}

/* The Ground Element */
.header-ground {
    position: absolute;
    bottom: -48px;
    left: 0;
    width: 100%;
    height: 48px;
    background: transparent;
    z-index: 5;
    pointer-events: none;
    /* Only collider, not clickable */
}

/* Global Pogo Canvas Overlays everything but lets clicks through */
#global-pogo-container {
    pointer-events: none;
}

#global-pogo-canvas {
    pointer-events: none;
}

#global-pogo-hud {
    pointer-events: auto;
    /* Buttons in HUD should work */
}

/* Globe & UI Sink Animation */
.planet,
.hero-cta {
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease;
}

/* Default Camera Translation for all static header elements */
header.hero> :not(#global-pogo-container):not(.header-ground) {
    transform: translateX(calc(-1 * var(--camera-x, 0px)));
}

/* Special Case: Sun parallax */
.sun {
    transform: translateX(calc(-0.2 * var(--camera-x, 0px))) !important;
}

body.pogo-mode-active .planet,
body.pogo-mode-active .hero-cta {
    /* Combine horizontal camera movement with vertical floor sink & dissolve */
    transform: translateX(calc(-1 * var(--camera-x, 0px))) translateY(250px);
    opacity: 0;
    pointer-events: none;
}

.sun {
    position: absolute;
    top: 20%;
    right: 10%;
    width: clamp(60px, 8vw, 120px);
    aspect-ratio: 1;
    background: #daba5c;
    border-radius: 50%;
    box-shadow: 0 0 60px 20px rgba(235, 210, 99, 0.25);
    opacity: 0.9;
    z-index: -2;
    pointer-events: none;
}

body.pogo-mode-active .hero .jumper-img,
body.pogo-mode-active .hero .jumper-wrapper {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Trees Layer Removed per user request */

/* Particles Canvas */
#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.2;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: clamp(1rem, 3vw, 2rem);
    color: #fff;
    padding: .75rem 0;
    padding-top: max(.75rem, env(safe-area-inset-top));
    transition: background-color .2s ease, backdrop-filter .2s ease, box-shadow .2s ease, padding .2s ease;
}

.topbar.is-sticky {
    backdrop-filter: saturate(140%) blur(10px);
    background: color-mix(in srgb, var(--brand-dark) 80%, transparent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-weight: 400;
    color: #fff;
    font-family: 'Bungee', cursive;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 1rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    /* Square with slight radius like game icons */
    background: var(--brand-red);
    /* Matches game icons */
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .2);
    /* Chunky shadow */
    overflow: hidden;
    flex: none;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar nav {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Burger Menu Trigger */
#menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
    padding: 0.5rem;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: white;
    border-radius: 99px;
}

@media (max-width: 640px) {

    /* FIX: Ensure Topbar stays fixed (no parallax) on mobile so menu works */
    header.hero .topbar {
        transform: none !important;
    }

    #menu-toggle {
        display: block;
    }

    #menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }

    #menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    #menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    #main-nav {
        position: fixed;
        inset: 0;
        background: rgba(22, 34, 46, 0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        z-index: 90;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 2rem;
        overflow-y: auto;
    }

    #main-nav.is-active {
        transform: translateX(0);
    }

    #main-nav .btn {
        font-size: 1.5rem;
        padding: 1rem 2rem;
        width: 100%;
        text-align: center;
        max-width: 300px;
    }
}

.topbar .btn--ghost {
    background: #BE3144;
    border-color: #AC1E31;
    color: #fff;
}

.topbar .btn--ghost:hover {
    background: #ac2c3e;
    /* darker shade for hover */
}

.hero-title {
    text-align: center;
    font-family: 'Bungee', cursive;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    color: #26283B;
}

.hero-title p {
    margin-bottom: 0;
    font-family: system-ui;
    /* Reset for body text */
}

.hero-spacer {
    height: clamp(2rem, 4vw, 4rem);
}

.hero-cta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: -12rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    position: relative;
    z-index: 10;
}

/* Floating Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes float-delayed {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.planet-img {
    animation: float 6s ease-in-out infinite;
    will-change: transform;
}

.jumper-img {
    /* Animation handled in home.css via pogoParabola */
    will-change: transform;
}

/* Hero Bottom Decorations (Triangles) */
.hero-trees {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 15vh;
    min-height: 120px;
    max-height: 200px;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: -2vw;
    overflow: hidden;
}

.tree {
    width: clamp(60px, 10vw, 100px);
    height: 100%;
    background: currentColor;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    position: absolute;
    bottom: 0;
}

.tree.t-1 {
    color: #246D55;
    height: 80%;
    left: 10%;
    width: 80px;
}

.tree.t-2 {
    color: #288163;
    height: 100%;
    left: 25%;
    width: 110px;
    z-index: 2;
}

.tree.t-3 {
    color: #2C9673;
    height: 60%;
    left: 20%;
    width: 70px;
    z-index: 3;
}

.tree.t-4 {
    color: #246D55;
    height: 90%;
    right: 15%;
    width: 90px;
}

.tree.t-5 {
    color: #288163;
    height: 70%;
    right: 8%;
    width: 70px;
    z-index: 2;
}

/* Add more random trees for fullness */
.tree:nth-child(1) {
    left: 3%;
    height: 60%;
    width: 50px;
    color: #246D55;
}

.tree:nth-child(2) {
    left: 12%;
    height: 90%;
    width: 90px;
    color: #266f57;
    z-index: 2;
}

.tree:nth-child(3) {
    left: 9%;
    height: 70%;
    width: 60px;
    color: #288163;
    z-index: 3;
}

.tree:nth-child(4) {
    right: 3%;
    left: auto;
    height: 50%;
    width: 50px;
    color: #438b73;
}

.tree:nth-child(5) {
    right: 9%;
    left: auto;
    height: 85%;
    width: 80px;
    color: #487f65;
}