/* =========================================
   1. FONTS & VARIABLES
   ========================================= */
@font-face {
    font-family: 'New Spirit';
    src: local('New Spirit'), url(fonts/NewSpirit.woff2) format('woff2');
    font-weight: 400;
}
@font-face {
    font-family: 'Cousine';
    src: local('Cousine'), url(fonts/Cousine-Regular.woff2) format('woff2');
    font-weight: 400;
}

:root {
    /* Theme Colors */
    --theme-bg: #f1e9e0; 
    --theme-text: #753a0e;
    --theme-accent: #f6cd7b; 
    --theme-secondary: #5A3111;

    --bg-color: var(--theme-bg);
    --text-color: var(--theme-text);
    --accent-color: var(--theme-accent);
    --secondary-text-color: var(--theme-secondary);

    --bounce: cubic-bezier(0.4, 2.2, 0.5, 1); 
    --smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    --trans-dur: 0.5s; 
}

/* =========================================
   2. GLOBAL STYLES
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--bg-color);
    transition: background-color var(--trans-dur) var(--smooth);
    min-height: 100vh;
    scroll-behavior: smooth; 
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 100%;
    overflow-x: hidden;
    transition: background-color var(--trans-dur) var(--smooth), 
                color var(--trans-dur) var(--smooth);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--trans-dur) var(--smooth);
}

svg path, svg line, svg polyline {
    stroke: var(--secondary-text-color);
    transition: stroke var(--trans-dur) var(--smooth), fill var(--trans-dur) var(--smooth);
}

/* =========================================
   3. NAVIGATION & SHARED UI ELEMENTS
   ========================================= */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; 
    top: 0; left: 0; width: 100%;
    z-index: 1000; 
    background-color: var(--bg-color);
    min-height: 100px; 
    padding: max(30px, env(safe-area-inset-top)) clamp(12px, 5vw, 60px) 30px;
    transition: background-color var(--trans-dur) var(--smooth);
}

.nav-left, .nav-right { flex: 1; display: flex; align-items: center; }
.nav-left { gap: clamp(10px, 2.5vw, 31px); justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

.nav-center {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex; align-items: center; justify-content: center;
}

/* --- Shared Pill Style --- */
.pill-button, .hero-title, .title-pill, .filter-pill, .social-link, .overlay-pill {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--accent-color); 
    border: none;
    color: var(--text-color);
    border-radius: 20px; 
    height: 40px; 
    padding: 0 24px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.4s var(--bounce), 
                background-color var(--trans-dur) var(--smooth), 
                color var(--trans-dur) var(--smooth);
}

/* Font Variations for Pills */
.pill-button, .hero-title, .title-pill, .overlay-pill {
    font-family: 'New Spirit', serif;
    font-size: 20px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.filter-pill {
    font-family: 'Cousine', monospace;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 110px;
}

.social-link {
    font-family: 'Cousine', monospace;
    font-size: 14px;
    letter-spacing: -0.02em;
}

/* Shared Hover Effects */
.pill-button:hover, .hero-title:hover, .title-pill:hover, 
.filter-pill:hover, .social-link:hover, .overlay-pill:hover {
    transform: translateY(-4px) scale(1.05); 
    background-color: var(--text-color);
    color: var(--bg-color);                    
}                     

.pill-button:active, .hero-title:active, .title-pill:active, 
.filter-pill:active, .social-link:active, .overlay-pill:active {
    transform: translateY(-1px) scale(0.95); 
    background-color: var(--text-color);
    color: var(--bg-color);
}

/* --- Emoji Bar (Desktop/Global) --- */
.emoji-bar { display: flex; gap: 14px; cursor: default; }
.pill-button.emoji-bar:hover {
    transform: none; box-shadow: none;
    background-color: var(--accent-color); color: var(--text-color);        
}
.emoji-bar span {
    cursor: pointer; display: inline-block; 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.emoji-bar span:hover { transform: scale(1.6) rotate(15deg); }
.emoji-bar span:active { transform: scale(0.9) rotate(0deg); }

/* --- Mobile Menu Button --- */
.mobile-menu-btn { display: none; }
@media screen and (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
        position: fixed; top: 35px; right: 31px;
        width: 30px; height: 30px;
        z-index: 2147483647;
        background: transparent; border: none;
        cursor: pointer; padding: 0; pointer-events: auto; 
    }
    .mobile-menu-btn span {
        display: block; position: absolute;
        height: 3px; width: 100%;
        background: var(--text-color);
        border-radius: 9px; left: 0;
        transition: transform .25s ease-in-out, background-color var(--trans-dur) var(--smooth);
    }
    .mobile-menu-btn span:nth-child(1) { top: 4px; }
    .mobile-menu-btn span:nth-child(2), .mobile-menu-btn span:nth-child(3) { top: 12px; }
    .mobile-menu-btn span:nth-child(4) { top: 20px; }

    .mobile-menu-btn.open span:nth-child(1), .mobile-menu-btn.open span:nth-child(4) {
        top: 18px; width: 0%; left: 50%;
    }
    .mobile-menu-btn.open span:nth-child(2) { transform: rotate(45deg); }
    .mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg); }
}

/* =========================================
   4. LAYOUT SECTIONS
   ========================================= */
.hero-wrapper {
    position: relative;
    z-index: 1001; 
    display: flex; flex-direction: column;
    padding: 140px clamp(12px, 5vw, 60px) 0px; 
    overflow-x: hidden;
}
.hero-wrapper .hero-title { display: none !important; }

.content-area {
    display: flex; flex-direction: column;
    align-items: center; width: 100%;
    margin: 0 auto;
    justify-content: flex-start; 
    flex-grow: 0; flex-shrink: 0;
    text-align: center;
}

.explore-wrapper {
    width: 100%;
    padding: 0 clamp(20px, 5vw, 60px); 
    display: flex; flex-direction: column; align-items: center;
}

.dotted-divider {
    width: 100%; max-width: 500px; height: 2px;
    background-image: radial-gradient(circle, var(--text-color) 1px, transparent 1px);
    background-position: center; background-size: 10px 2px; background-repeat: repeat-x;
    margin: 0 auto;
    transition: opacity var(--trans-dur) var(--smooth);
}
.dotted-divider.profile-divider { margin-top: 20px; margin-bottom: 45px; }
.dotted-divider.cards-divider { margin-bottom: 45px; }

.hero-subtitle {
    font-family: 'Cousine', monospace;
    font-size: clamp(18px, 2vw, 20px);
    line-height: 1.4; letter-spacing: -0.02em;
    color: var(--text-color);
    width: 100%; max-width: 1319px;
    margin-top: 0px; margin-bottom: 45px !important; 
    text-align: left;
    transition: color var(--trans-dur) var(--smooth);
    opacity: 0; 
    animation: slideInUp 1.4s var(--bounce) forwards 0.3s;
}

/* =========================================
   5. FILTER & UI COMPONENTS
   ========================================= */
.filter-wrapper {
    width: 100%; padding: 0 clamp(12px, 5vw, 60px); 
    margin-bottom: 40px; position: relative; z-index: 100;
    opacity: 0;
    animation: fadeInOnly 1.4s var(--bounce) forwards 0.3s;
}

.filter-content {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; 
    gap: 20px; margin-bottom: 0px; min-height: 46px; 
}

.filter-group-left, .filter-group-right { display: flex; align-items: center; gap: 18px; }

.filter-text-label {
    font-family: 'Cousine', monospace; font-size: 16px;
    text-transform: uppercase; color: var(--text-color);
    letter-spacing: 0.05em; transition: color var(--trans-dur) var(--smooth);
}

.columns-control { display: none !important; }

/* Filter Popup */
.filter-popup {
    position: absolute; top: 130%; left: 0;
    width: 320px;
    background-color: var(--bg-color); 
    border-radius: 8px; padding: 24px;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    opacity: 0; visibility: hidden;
    transform: translateY(-10px);
    transition: transform 0.3s var(--bounce), 
                opacity 0.3s var(--bounce), 
                background-color var(--trans-dur) var(--smooth);
}
.filter-popup.active { opacity: 1; visibility: visible; transform: translateY(0); }

/* Dotted Border Mask for Popup */
.filter-popup::before {
    content: ''; position: absolute; inset: -2px;
    border-radius: 8px; padding: 2px;
    background: 
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 0 / 10px 2px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 100% / 10px 2px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 0 / 2px 10px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 100% 0 / 2px 10px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1; pointer-events: none;
}

.popup-header {
    font-family: 'Cousine', monospace; font-weight: 700;
    text-transform: uppercase; color: var(--text-color);
    display: block; margin-bottom: 20px;
    transition: color var(--trans-dur) var(--smooth);
}

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 25px; }

.custom-checkbox {
    display: flex; align-items: center; gap: 8px;
    font-family: 'Cousine', monospace; font-size: 14px;
    color: var(--text-color); cursor: pointer; user-select: none;
    transition: color var(--trans-dur) var(--smooth); 
}
.custom-checkbox input { display: none; }
.checkmark {
    height: 16px; width: 16px;
    border: 1px solid var(--text-color);
    border-radius: 2px; display: inline-block; position: relative;
    transition: background var(--trans-dur) var(--smooth), 
                border-color var(--trans-dur) var(--smooth),
                transform 0.4s var(--bounce);
}
.custom-checkbox:hover .checkmark { transform: scale(1.3) rotate(10deg); border-width: 1px; }
.custom-checkbox:active .checkmark { transform: scale(0.9) rotate(0deg); }
.custom-checkbox input:checked ~ .checkmark { background-color: var(--text-color); }

#clearFiltersBtn {
    background: var(--accent-color); border: transparent;
    border-radius: 16px; padding: 10px 16px;
    font-family: 'Cousine', monospace; font-size: 12px;
    color: var(--text-color); cursor: pointer;
    transition: transform 0.2s ease, 
                background-color var(--trans-dur) var(--smooth), 
                color var(--trans-dur) var(--smooth);
}
#clearFiltersBtn:hover {
    background-color: var(--text-color); color: var(--bg-color);
    transform: translateY(-4px);
}

/* =========================================
   6. PEOPLE ARCHIVE (SCROLL & GRID)
   ========================================= */
.people-section {
    width: 100%; padding: 0 clamp(12px, 5vw, 60px) 60px;
    overflow: hidden; opacity: 0;
    animation: slideInUp 1.4s var(--bounce) forwards 0.3s;
}

.horizontal-track {
    display: flex; gap: 30px; width: 100%;
    padding: 40px 20px; overflow-x: auto; 
    overflow-y: visible; scrollbar-width: none;
}
.horizontal-track::-webkit-scrollbar { display: none; }

.person-card-wrapper { flex: 0 0 auto; width: 280px; min-width: 280px; transition: opacity 0.3s ease; }
.person-card-wrapper.hidden { display: none !important; }

/* Grid View Toggle Styles */
.people-section.is-grid-view { height: auto !important; padding-bottom: 60px; }
.people-section.is-grid-view .horizontal-track {
    display: grid; grid-template-columns: repeat(4, 280px); 
    justify-content: center; gap: 30px; 
    width: 100%; overflow-x: visible; 
    transform: none !important; padding: 40px 0; 
}
.people-section.is-grid-view .person-card-wrapper {
    width: 100% !important; min-width: 280px; 
    margin: 0 auto; flex: none;
}
.people-section.is-grid-view .is-clone { display: none !important; }

.person-card {
    position: relative; overflow: hidden;
    width: 100%; height: 400px;
    background: transparent; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-radius: 4px;
    cursor: pointer; transition: transform 0.5s var(--bounce), box-shadow 0.4s ease;
    transform-origin: center center; will-change: transform;
}
.person-card-wrapper:hover .person-card {
    transform: rotate(3deg) scale(1.02) translateY(-5px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.2); 
}
.person-card-wrapper:active .person-card {
    transform: rotate(3deg) scale(0.98) translateY(0);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1); 
    transition: transform 0.1s ease;
}

.person-card-link { display: block; text-decoration: none; color: inherit; }
.person-card-link .person-card { transform: none; } 

/* =========================================
   7. PROFILE & CONTENT STYLES
   ========================================= */
.profile-container {
    display: flex; justify-content: center;
    width: 100%; padding: 30px 0 40px;
    position: relative; overflow: hidden;
}
.profile-main {
    width: 100%; max-width: 680px; 
    padding: 0 24px; display: flex; flex-direction: column; z-index: 10;
}

.profile-name {
    font-family: 'New Spirit', serif; 
    font-size: clamp(48px, 9vw, 68px); 
    line-height: 1.05; letter-spacing: -0.04em;
    font-weight: 300; 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-color); margin-bottom: 15px;
    transition: color var(--trans-dur) var(--smooth);
}

.tags-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px; }
.tag-pill {
    background-color: var(--accent-color); 
    color: var(--text-color); border-radius: 20px; 
    height: 40px; padding: 0 24px;
    font-size: 14px; font-family: 'Cousine', monospace;
    display: flex; align-items: center; justify-content: center;
    cursor: default; 
    transition: transform 0.4s cubic-bezier(0.4, 2.5, 0.5, 1), 
                background-color var(--trans-dur) var(--smooth), color var(--trans-dur) var(--smooth);
}
.tag-pill:hover { transform: translateY(-5px) scale(1.05); }

.meta-row { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.meta-date {
    font-family: 'Cousine', monospace; font-size: 11px; 
    letter-spacing: 0.05em; text-transform: uppercase; 
    color: var(--secondary-text-color); opacity: 0.8;
}
.meta-icons { display: flex; gap: 16px; margin-bottom: 2px; }

/* Shared Profile Animations */
.profile-name, .tags-row, .meta-row, .connect-body, .about-body {
    opacity: 0; 
    animation: slideInUp 1.5s cubic-bezier(0.4, 2.5, 0.5, 1) forwards 0.2s;
}

.intro-image-container {
    display: flex; flex-direction: column; 
    align-items: center; width: 100%; margin-bottom: 40px;
}
.intro-image-container img { display: block; max-width: 100%; height: auto; }

.image-caption {
    font-family: 'Cousine', monospace; font-size: 11px;
    color: var(--secondary-text-color); opacity: 0.8;
    margin-top: 12px; letter-spacing: 0.02em; max-width: 630px;
    text-align: center;
}

.profile-bio, .body-1, .body-2, .body-3, .body-4, .body-5 {
    font-family: 'Cousine', monospace; font-size: 14px; line-height: 1.7; 
    color: var(--text-color); margin-bottom: 40px; max-width: 700px;
    transition: color var(--trans-dur) var(--smooth);
}
.h1-custom, .h2-custom, .h3-custom, .h4-custom, .h5-custom {
    font-family: 'Cousine', monospace; font-weight: 700; 
    text-transform: uppercase; letter-spacing: 1px; font-size: 18px; 
    color: var(--text-color); margin: 40px 0 30px; 
    transition: color var(--trans-dur) var(--smooth);
}

.scroll-tracker-track {
    position: fixed; top: 94px; left: 0;
    width: 100%; height: 12px; z-index: 9999;
    background-image: radial-gradient(circle, #ddd 1.5px, transparent 1.5px);
    background-size: 14px 100%;
    pointer-events: none;
}

.scroll-tracker-bar {
    height: 100%; width: 0%;
    background-image: radial-gradient(circle, var(--accent-color) 2.5px, transparent 2.5px);
    background-size: 14px 100%;
    transition: width 0.1s ease-out;
}

.tpik-container {
    position: relative;
    top: -25px;
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    
    opacity: 0;
    animation: slideInUp 1.5s cubic-bezier(0.4, 2.5, 0.5, 1) forwards 0.3s;
}

@keyframes slideInUp {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Action Icons */
button.icon-circle {
    appearance: none; font-family: inherit;
    width: 36px; height: 36px;
    border: 1px solid var(--text-color); border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    background: transparent; color: var(--text-color);
    cursor: pointer; position: relative; 
    transition: transform 0.4s cubic-bezier(0.4, 2.5, 0.5, 1), 
                background-color var(--trans-dur) var(--smooth), 
                color var(--trans-dur) var(--smooth), 
                border-color var(--trans-dur) var(--smooth);
}
button.icon-circle:hover {
    background-color: var(--text-color); color: var(--bg-color); 
    transform: translateY(-4px) rotate(15deg); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
button.icon-circle:active { transform: translateY(1px) rotate(15deg) scale(0.9); }

/* SVG Stroke Fix: Ensure no fill on hover */
button.icon-circle:hover svg path, 
button.icon-circle:hover svg line, 
button.icon-circle:hover svg polyline,
button.icon-circle:hover svg circle,
button.icon-circle:hover svg rect { 
    stroke: var(--bg-color); 
    fill: none !important;
    transition: stroke var(--trans-dur) var(--smooth);
}

.tooltip-text {
    visibility: hidden; opacity: 0; width: 80px;
    background-color: var(--text-color); color: var(--bg-color);
    text-align: center; border-radius: 4px; padding: 6px 0;
    position: absolute; z-index: 10; bottom: 135%; left: 50%; margin-left: -40px; 
    font-family: 'Cousine', monospace; font-size: 10px;
    letter-spacing: 0.05em; text-transform: uppercase;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 2.5, 0.5, 1);
    transform: translateY(5px); pointer-events: none;
}
.tooltip-text::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid;
    border-color: var(--text-color) transparent transparent transparent;
}
.tooltip-visible .tooltip-text { visibility: visible; opacity: 1; transform: translateY(0); }
.content-area.connect-layout, .content-area.about-layout {
    justify-content: flex-start !important; padding-top: 5vh; padding-bottom: 0; min-height: auto;
}
.connect-body, .about-body {
    font-family: 'Cousine', monospace; font-size: 20px;
    line-height: 1.5; letter-spacing: -0.02em;
    color: var(--text-color); width: 100%; max-width: 1287px;
    text-align: left; transition: color var(--trans-dur) var(--smooth);
}

/* =========================================
   8. STICKERS, MODALS & GAMES
   ========================================= */
.draggable-sticker {
    position: absolute; z-index: 20; cursor: grab; width: 230px; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
}
.draggable-sticker:hover { transform: scale(1.15) rotate(0deg) !important; z-index: 25; }
.draggable-sticker.is-dragging { opacity: 0.8; cursor: grabbing; z-index: 100; transform: scale(1.1) !important; transition: none; }
.draggable-sticker img {
    width: 100%; border-radius: 15px; border: 5px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); pointer-events: none; 
}
.sticker-caption { display: none; }
#sticker1 { top: 50px; right: 5%; transform: rotate(5deg); }
#sticker2 { top: 150px; left: 2%; transform: rotate(-5deg); }
#sticker3 { top: 600px; right: 2%; transform: rotate(3deg); }
#sticker4 { top: 900px; left: 5%; transform: rotate(-2deg); }

@media only screen and (max-width: 768px) { .draggable-sticker { display: none !important; } }

/* --- Modals (Common) --- */
.modal {
    display: none; position: fixed; z-index: 9999; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: var(--bg-color); 
    justify-content: center; align-items: center; flex-direction: column;
    transition: background-color var(--trans-dur) var(--smooth);
}

/* --- Image Modal Content (Dotted Border Mask) --- */
/* Note: Wrap <img> in a <div> with this class for mask to work */
.modal-content {
    display: block; position: relative;
    max-width: 80%; max-height: 80vh; 
    width: auto; height: auto;
    border-radius: 10px; border: none; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: zoom 0.3s;
    object-fit: contain; 
}

.modal-content::before {
    content: ''; position: absolute; inset: -2px;
    border-radius: 10px; padding: 2px;
    background: 
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 0 / 10px 2px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 100% / 10px 2px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 0 / 2px 10px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 100% 0 / 2px 10px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1; pointer-events: none;
}

#modalCaption {
    margin-top: 15px; color: var(--text-color);
    font-family: 'Cousine', monospace; font-size: 16px;
    text-align: center; max-width: 80%;
    animation: fadeCaption 0.5s 0.2s forwards; opacity: 0;
}

@keyframes zoom { from {transform:scale(0.8); opacity: 0;} to {transform:scale(1); opacity: 1;} }
@keyframes fadeCaption { to { opacity: 1; } }

/* --- Game Modal (Dotted Border Mask) --- */
.game-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(85%, 400px);
    background: var(--bg-color);
    border-radius: 16px; padding: 40px 30px;
    text-align: center; z-index: 10005;
    display: none; flex-direction: column; align-items: center;
    border: none; /* Mask handles border */
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: popIn 0.5s var(--bounce) forwards;
    transition: background-color var(--trans-dur) var(--smooth);
}
.game-modal.active { display: flex !important; }

.game-modal::before {
    content: ''; position: absolute; inset: -2px;
    border-radius: 16px; padding: 2px;
    background: 
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 0 / 10px 2px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 100% / 10px 2px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 0 0 / 2px 10px,
        radial-gradient(circle, var(--text-color) 1px, transparent 1px) 100% 0 / 2px 10px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    z-index: -1; pointer-events: none;
}

/* Vintage Library Card */
.library-flip-container {
    background: transparent; width: 350px; height: 500px;
    margin: 60px auto 90px; perspective: 1000px; cursor: pointer;
}
.library-flip-inner {
    position: relative; width: 100%; height: 100%;
    text-align: left; transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.15, 0.55, 0.55, 1); 
}
.library-flip-container:hover .library-flip-inner { transform: rotateY(180deg); }
.library-card-face {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    border-radius: 4px; box-shadow: 2px 3px 8px rgba(0,0,0,0.15); overflow: hidden;
}
.library-front { z-index: 2; transform: rotateY(0deg); background-size: cover; background-position: center; }
.library-back {
    transform: rotateY(180deg); background-color:#fff9f5; 
    color: #502407; font-family: 'Cousine', monospace; 
    display: flex; padding: 20px 15px; gap: 12px;
}
.lib-left-col {
    width: 30px; flex-shrink: 0; font-weight: bold; font-size: 10px; 
    padding-top: 4px; opacity: 0.8; border-right: 1px solid rgba(80, 36, 7, 0.15); 
    display: flex; flex-direction: column; gap: 5px;
}
.lib-content { flex-grow: 1; display: flex; flex-direction: column; }
.lib-header {
    font-weight: bold; margin-bottom: 12px; font-size: 16px;
    letter-spacing: 0.05em; text-transform: uppercase;
    border-bottom: 2px dotted var(--text-color); padding-bottom: 5px;
    display: inline-block;
}
.lib-subjects { font-size: 12px; line-height: 1.5; margin-bottom: 20px; overflow-y: auto; }
.lib-footer-row {
    display: flex; flex-direction: column; gap: 5px; font-size: 8px; 
    opacity: 0.6; margin-top: auto; text-transform: uppercase;
    border-top: 1px solid rgba(80, 36, 7, 0.15); padding-top: 8px;
}

/* =========================================
   9. FOOTER & SOCIAL
   ========================================= */
.site-footer {
    width: 100%; padding: 40px 0; text-align: center;
    background-color: var(--bg-color); transition: background-color var(--trans-dur) var(--smooth);
    opacity: 0; animation: slideInUp 1.4s var(--bounce) forwards 0.3s;
    font-family: 'New Spirit', serif;
}
.social-section { width: 100%; display: flex; flex-direction: column; align-items: center; }
.social-icons-row {
    display: flex; flex-wrap: wrap; justify-content: center; 
    gap: 14px; width: 100%; max-width: 650px; padding: 0 24px;
}
.social-link { width: auto; height: 40px; padding: 0 24px; text-decoration: none; }

/* =========================================
   10. MOBILE OVERLAY
   ========================================= */
.mobile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-color); z-index: 19999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color var(--trans-dur) var(--smooth);
}
.mobile-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

.close-btn {
    position: absolute; top: 35px; right: 31px; width: 35px; height: 35px;
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    color: var(--text-color); z-index: 10000;
    transition: transform 0.3s var(--bounce), color var(--trans-dur) var(--smooth);
}
.close-btn:hover { transform: scale(1.2) rotate(90deg); }
.close-btn:active { transform: scale(0.9) rotate(90deg); }
.close-btn svg path { stroke: var(--text-color); }



/* =========================================
   MOBILE OVERLAY & EMOJI FIX
   ========================================= */

.overlay-content {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 20px; 
    margin-top: -50px;
}

.overlay-pill { 
    padding: 10px 30px; 
    min-width: 160px; 
    font-size: 24px; 
}

/* FIX: Explicitly style the emoji bar inside the overlay */
.overlay-content .emoji-bar {
    display: flex !important; /* Force visibility */
    justify-content: center;
    align-items: center;
    gap: 28px;
    margin-top: 6px;
    background-color: var(--accent-color);
    border: none;
    border-radius: 20px;
    padding: 10px 30px;
    cursor: default;
    pointer-events: auto;
}

/* Ensure the hover effect works on the pill container if needed */
.overlay-content .emoji-bar:hover {
    background-color: var(--accent-color); /* Keep accent color on hover */
    color: var(--text-color);
    box-shadow: none;
    transform: none;
}

/* Style the emojis inside */
.overlay-content .emoji-bar span {
    font-size: 24px; 
    line-height: 1; 
    cursor: pointer; 
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay-content .emoji-bar span:hover { 
    transform: scale(1.6) rotate(10deg); 
}

.overlay-content .emoji-bar span:active { 
    transform: scale(0.9); 
}

/* Match the profile page emoji-pill style just in case */
.emoji-pill { 
    margin-top: 6px; 
    display: flex; 
    gap: 28px; 
    cursor: default; 
    background-color: var(--accent-color);
    border: none;
    border-radius: 20px;
    padding: 10px 30px;
    justify-content: center;
    align-items: center;
}
.emoji-pill span {
    font-size: 24px; line-height: 1; cursor: pointer; display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.emoji-pill span:hover { transform: scale(1.6) rotate(10deg); }
.emoji-pill span:active { transform: scale(0.9); }

.overlay-footer {
    position: absolute; bottom: 40px; width: 100%; text-align: center;
    font-family: 'New Spirit', serif; font-size: 24px; letter-spacing: -0.05em;
    color: var(--secondary-text-color); opacity: 0.8;
}

/* =========================================
   11. SHRIMP GAME ASSETS
   ========================================= */
.floating-shrimp {
    position: fixed; top: 0; left: 0; font-size: 40px; z-index: 9999;  
    pointer-events: none; will-change: transform;
}
.whale-cursor {
    position: fixed; top: 0; left: 0; font-size: 60px; z-index: 10000;
    pointer-events: none; transform: translate(-50%, -50%); display: none;
}
.game-timer {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--text-color); color: var(--bg-color);
    font-family: 'New Spirit', serif; font-size: 24px;
    padding: 10px 24px; border-radius: 50px; z-index: 10002; display: none; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); white-space: nowrap;
    transition: background-color var(--trans-dur) var(--smooth), color var(--trans-dur) var(--smooth);
}
.game-timer.urgent { background: #ff000099; animation: pulseRedCentered 0.5s infinite; }

.golden-key {
    display: inline-block;
    filter: sepia(100%) saturate(300%) hue-rotate(5deg) brightness(1.2);
    animation: goldenFloat 3s ease-in-out infinite;
}
.modal-icon { font-size: 50px; margin-bottom: 20px; }
.modal-title {
    font-family: 'New Spirit', serif; font-size: 32px; line-height: 1.1; 
    margin-bottom: 16px; color: var(--text-color);
    transition: color var(--trans-dur) var(--smooth);
}
.modal-text {
    font-family: 'Cousine', monospace; font-size: 14px; line-height: 1.6;
    color: var(--text-color); margin-bottom: 30px;
}
.modal-btn {
    background: var(--text-color); color: var(--bg-color); border: none;
    padding: 12px 28px; border-radius: 50px;
    font-family: 'Cousine', monospace; font-size: 14px; font-weight: 700;
    cursor: pointer; text-transform: uppercase;
    transition: transform 0.3s var(--bounce), background-color var(--trans-dur) var(--smooth);
}
.modal-btn:hover { transform: scale(1.1); background: var(--secondary-text-color); }
.modal-btn:active { transform: scale(0.95); }

/* door animation */
.key-cursor {
    position: fixed; top: 0; left: 0; font-size: 40px; pointer-events: none; 
    z-index: 9999; transform: translate(-50%, -50%); 
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3)); display: none; 
}

.person-card-wrapper.unlockable {
    animation: floatAggressive 1.2s ease-in-out infinite alternate;
    cursor: none !important;
}

@keyframes floatAggressive {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-30px);
    }
}


body.has-key-cursor { cursor: none; }

@keyframes pulseRedCentered {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}
@keyframes popIn {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes goldenFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(10deg); }
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); transform: scale(1); }
    100% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.8); transform: scale(1.02); }
}
@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInOnly { 0% { opacity: 0; } 100% { opacity: 1; } }

/* =========================================
   12. MEDIA QUERIES
   ========================================= */
@media screen and (max-width: 1100px) {
    .people-section.is-grid-view .horizontal-track { grid-template-columns: repeat(3, 1fr); }
}
@media screen and (max-width: 900px) {
    .filter-content { justify-content: center; }
    .filter-group-left, .filter-group-right { flex-wrap: wrap; justify-content: center; }
}
@media screen and (max-width: 768px) {
    .nav-left, .nav-right { display: none; }
    .people-section {
        margin-top: 80px; height: auto !important; padding-top: 40px; padding-bottom: 40px;
    }
    .horizontal-track { transform: none !important; gap: 20px; padding-right: 20px; }
    .person-card-wrapper { width: 280px; min-width: 280px; }
    
    .people-section.is-grid-view .horizontal-track {
        grid-template-columns: repeat(2, 1fr) !important; gap: 20px;
    }
    .people-section.is-grid-view .person-card-wrapper { width: 280px !important; }
    .people-section.is-grid-view .person-card { width: 100% !important; height: 400px !important; }
}
@media screen and (max-width: 630px) {
    .people-section.is-grid-view .horizontal-track { grid-template-columns: 1fr !important; place-items: center; }
}

.preload, .preload * { transition: none !important; }
