body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: black;
}

/* Base Fade-In Animation */
@keyframes globalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    opacity: 0;
    animation: globalFadeIn 1s ease-out forwards;
}

/* Map container */
#mapcon {
    width: 100%;
    height: 100vh;
    filter: sepia(0.2) contrast(1.1) brightness(0.8) saturate(0.9) grayscale(0.2);
}

#map {
    width: 100%;
    height: 100%;
}

/* UI Overlay */
#overlay {
    position: fixed;
    top: 1rem; /* 1rem margin from top */
    left: 0;
    width: 100%;
    height: 15vh;
    z-index: 9998;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    font-family: 'CaslonAntique', serif;
    pointer-events: none;
    transition: filter 0.3s ease;
    box-sizing: border-box;
}

#overlay>* {
    pointer-events: auto;
}

#filter-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
    transform: scale(0.8);
    transform-origin: top center;
    margin-top: 1vh;
    animation-delay: 1s; /* Second in sequence */
}

#pinchk {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.3rem;
    place-items: center;
}

#levels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 0.4rem;
    place-items: center;
    color: white;
    font-size: 0.9rem;
}

.icons {
    width: 1.8rem;
    height: auto;
}

input[type="checkbox"] {
    cursor: pointer;
    width: 0.9rem;
    height: 0.9rem;
    background-color: black;
    border: 1px solid rgba(255, 255, 255, 0.4);
    appearance: none;
    -webkit-appearance: none;
    border-radius: 2px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

input[type="checkbox"]:checked::after {
    content: '';
    width: 60%;
    height: 60%;
    background-color: white;
    clip-path: polygon(14% 44%, 0 58%, 50% 100%, 100% 16%, 80% 0%, 43% 72%);
}

#logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    animation-delay: 0.5s; /* First in sequence */
}

#logo-link:hover {
    transform: scale(1.05);
}

#logo {
    height: 9vh;
    width: auto;
    opacity: 0.95;
}

#links-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem;
    max-width: 30vw;
    flex-shrink: 1;
    animation-delay: 1.5s; /* Third in sequence */
}

.vis-link-box {
    text-decoration: none;
    color: white;
    font-size: 0.72rem;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-align: right;
    line-height: 1.1;
    width: 100%;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 15px rgba(255, 255, 255, 0.3);
}

.vis-link-box:hover {
    opacity: 1;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.4);
}

#email-link {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 10000;
    transition: transform 0.3s ease;
}

#email-link:hover {
    transform: scale(1.15);
}

#email-img {
    height: 3.5vh;
    width: auto;
}

#zoom-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2.2rem;
    height: 7vh;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.1);
}

.zoom-btn {
    width: 100%;
    height: 3.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: inherit;
    transition: background 0.3s;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.zoom-btn:first-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#pinbox {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 320px;
    background-color: rgba(5, 5, 5, 0.9);
    color: white;
    font-family: 'CaslonAntique', serif;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    z-index: 10001;
    transition: bottom 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#pinbox.show {
    bottom: 12vh;
}

#pinbox-close {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 2.2rem;
    cursor: pointer;
    opacity: 0.5;
}

#pinbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#pinbox-content a {
    color: white;
    font-size: 1.3rem;
    text-decoration: none;
}

#running-count-badge {
    position: fixed;
    bottom: 2.5rem;
    left: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-family: 'CaslonAntique', serif;
    color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.7);
    line-height: 1.2;
    pointer-events: none;
}

#rc-label {
    font-size: 0.75rem;
    letter-spacing: 0.12rem;
    opacity: 0.6;
    text-transform: uppercase;
}

#rc-num {
    font-size: 2rem;
    opacity: 0.9;
    letter-spacing: 0.05rem;
}

/* Video Pin Styling */
.pin-vid {
    height: 6.3vh; /* Increased by 5% from 6vh */
    width: auto;
    object-fit: contain; /* Ensure uniform scaling */
    display: block;
    animation: filterVidGlow 15s infinite ease-in-out;
}

@keyframes filterVidGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.7));
    }
}

/* Map Marker Container (for pulsing effect) */
.pin-container {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: globalFadeIn 2s ease-out forwards; 
}

.pin-img {
    height: auto;
    width: 32px; /* Set fixed width, let height scale naturally */
    max-height: 48px; /* Safety cap */
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    object-fit: contain;
}

.pin-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 75%); /* Fuzzy/Feathered */
    border-radius: 50%;
    z-index: 1;
    animation: pinPulse 4s infinite ease-out; /* 2x slower (4s) */
    opacity: 0.6; /* Reduced opacity by 0.2 (from 0.8) */
}

@keyframes pinPulse {
    0% { 
        transform: scale(0.8); 
        opacity: 0.6;
        filter: saturate(0.3) blur(2px) hue-rotate(0deg);
    }
    100% { 
        transform: scale(3.5); /* Larger and more faded */
        opacity: 0;
        filter: saturate(0.3) blur(10px) hue-rotate(360deg);
    }
}