/* --- VARIABLES --- */
:root {
    --paper-color: #fdfbf7;
    --ink-color: #2c2c2c;
    --watercolor-green: rgba(107, 142, 35, 0.4);
    --watercolor-blue: rgba(70, 130, 180, 0.4);
    --watercolor-red: rgba(205, 92, 92, 0.4);
    --font-typewriter: 'Zilla Slab', monospace;
    --font-handwriting: 'Special Elite', cursive;
}

body {
    margin: 0;
    padding: 0;

    background-color: var(--paper-color);
    background-image: url('../img/bg.png');

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    font-family: var(--font-typewriter);
    color: var(--ink-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    cursor: default;
}

#scrapbook {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

/* --- THE SCATTERED ITEMS --- */
.item {
    position: absolute;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.3s ease, z-index 0s;
}

.item::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 70%;
    border-radius: 25%;
    background: var(--watercolor-green);
    filter: blur(30px);
    opacity: 0.9;
    transition: opacity 5s ease;
    z-index: -1;
    transform: scale(0.8);
}

.item:hover {
    transform: scale(1.2) rotate(0deg) !important;
    z-index: 50;
}

.item:hover::before {
    opacity: 1;
    transform: scale(2);
}

.visual {
    font-size: 3.5rem;
    filter: sepia(0.8) contrast(1.1);
    transition: filter 0.3s;
}

.label {
    font-family: var(--font-typewriter);
    font-size: 1rem;
    border-radius: 100% 22% 12% 75% / 24% 220px 30% 20px;

    padding: 5px 12px;
    border: 1px solid #d8d8d8;
    box-shadow: 2px 5px 10px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    opacity: 0;
    transform: translateY(-10px) rotate(-2deg);
    transition: all 0.3s ease;
    pointer-events: none;
    display: inline-block;
}

.item:hover .label {
    opacity: 1;
    background-color: var(--paper-color);
}


#scrapbook.about-mode .item {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) !important;
}

/* --- SPECIFIC POSITIONS --- */
#games {
    top: 48%;
    right: 58%;
    transform: rotate(-5deg);
}


#matcha {
    top: 38%;
    right: 32%;
    transform: rotate(10deg);

}

#beer {
    top: 25%;
    right: 20%;
    transform: rotate(5deg);
}


#work {
    bottom: 29%;
    left: 70.5%;
    transform: rotate(2deg);
}


#patio {
    top: 28%;
    right: 82%;
    transform: rotate(-8deg);
}

#cat {
    bottom: 15%;
    right: 68%;
    transform: rotate(3deg);
}


#origami {
    bottom: 10%;
    right: 30%;
    transform: rotate(12deg);
}

#origami::before {
    background: var(--watercolor-red);
}

#cat::before {
    background: var(--watercolor-red);
}

#work::before {
    background: var(--watercolor-blue);
}

#beer::before {
    background: var(--watercolor-blue);
}

#matcha::before {
    background: var(--watercolor-green);
}

#games::before {
    background: var(--watercolor-blue);
}


.visual img {
    width: 95px;
    height: 90px;
    object-fit: contain;
    filter: sepia(0.2) contrast(1.1);
    display: block;
}

.visual img {
    border-radius: 8px;
    clip-path: polygon(2% 0%, 98% 3%, 100% 95%, 5% 100%);
}


/* --- THE PAPER NOTES (About, Menu, Location) --- */
#about-note,
.scrap-note {
    overflow: visible !important;
    /* This stops the chopping */
    position: absolute;
    width: 320px;
    background: #fff;
    padding: 25px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 5;
    border: 1px solid #e0e0e0;
}

/* The Pin sitting half-above the border */
#about-note::after,
.scrap-note::after {
    content: '📍';
    position: absolute;
    top: -20px;
    /* Moves it half-way up */
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    z-index: 10;
}

#about-note,
.scrap-note {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 320px;
    background: #fff;
    padding: 25px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
    border: 1px solid #e0e0e0;

    /* HIDING LOGIC */
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(10deg) translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-content {
    max-height: 70vh;
    /* Limits height for long menus */
    overflow-y: auto;
    overflow-x: hidden;
}

#about-note.show,
.scrap-note.show {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) rotate(2deg) translateY(0);
}

/* Shared Pin Graphic for all Notes */

#about-note h1,
.scrap-note h1 {
    font-family: var(--font-handwriting);
    font-size: 1.8rem;
    margin-top: 0;
    color: #4a4a4a;
}

#about-note p,
.scrap-note p {
    line-height: 1.6;
    font-size: 0.95rem;
}

#footer {
    position: absolute;
    bottom: 30px;
    left: 30px;
    font-family: var(--font-handwriting);
    color: #666;
    transform: rotate(-1deg);
    z-index: 60;
}

.footer-nav {
    margin-bottom: 10px;
}

.footer-nav span {
    margin-right: 20px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--watercolor-red);
    color: var(--ink-color);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.footer-nav span:hover {
    color: var(--watercolor-red);
}

.footer-credit {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* --- MODAL (POPUP) --- */
#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 251, 247, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 100;
}

#modal-img {
    max-height: 250px;
    object-fit: cover;
    border: 10px solid #fff;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    display: block;
    margin: 0 auto 20px auto;
}

#modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    max-width: 500px;
    width: 80%;
    text-align: center;
    padding: 40px;
    border: 2px dashed #333;
    background: white;
    transform: rotate(-1deg);
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.1);
}

#close-btn {
    margin-top: 20px;
    background: none;
    border: none;
    font-family: var(--font-handwriting);
    font-size: 2.2rem;
    text-decoration: none;
    color: #d9534f;
    cursor: pointer;
}

/* --- MENU SPECIFIC --- */
.scrap-note {
    max-height: 80vh;
    overflow-y: auto;
}

.menu-section {
    margin-bottom: 20px;
}

.menu-section h3 {
    font-family: var(--font-handwriting);
    border-bottom: 1px dashed #ccc;
    margin-bottom: 10px;
    color: var(--watercolor-red);
}

.menu-section p {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin: 5px 0;
}

.signature-note {
    font-size: 0.75rem !important;
    color: #888;
    margin-top: -5px !important;
}

.anti-bar-note {
    font-size: 0.85rem !important;
    line-height: 1.4;
    margin-top: 15px !important;
    padding: 10px;
    background: #fffbe6;
    border-left: 3px solid #f39c12;
    font-family: var(--font-handwriting);
    color: #5d4037;
    display: block !important;
    transform: rotate(-1deg);
}

/* Scrollbar styling */
.scrap-note::-webkit-scrollbar {
    width: 4px;
}

.scrap-note::-webkit-scrollbar-thumb {
    background: #ddd;
}

/* --- TEXT KEYWORDS (replaces emoji/image visuals) --- */
.visual.text-item {
    font-family: 'Gloria Hallelujah', cursive;
    font-size: 1.1rem;
    font-weight: normal;
    line-height: 1.4;
    text-align: center;
    color: var(--ink-color);
    filter: none;
    padding: 8px 4px;
    opacity: 0.75;
}

.item:hover .visual.text-item {
    opacity: 1;
}

/* Make label always visible for text items — no need to hover to discover */
.item .label {
    opacity: 0.45;
    transform: translateY(0) rotate(-2deg);
}

.item:hover .label {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
    background-color: var(--paper-color);
}

/* --- READABILITY TWEAK --- */
/* Text keywords: slightly stronger so they read over illustration */
.visual.text-item {
    opacity: 0.85;
    text-shadow:
        1px 1px 0 rgba(253, 251, 247, 0.8),
        -1px -1px 0 rgba(253, 251, 247, 0.8),
        1px -1px 0 rgba(253, 251, 247, 0.8),
        -1px 1px 0 rgba(253, 251, 247, 0.8);
}

/* Label tags: more visible background tint, not fully solid */
.label {
    background-color: rgba(253, 251, 247, 0.82) !important;
    opacity: 0.75 !important;
    border-color: rgba(180, 170, 155, 0.6) !important;
}

.item:hover .label {
    background-color: rgba(253, 251, 247, 0.96) !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {

    /* Spread items across the full viewport without overlap.
       Two columns: left ~10–15%, right ~55–60%.
       Rows spread across top 10% → bottom 20% (above footer). */

    #patio {
        top: 18%;
        left: 25%;
        right: auto;
        bottom: auto;
        transform: rotate(-6deg);
    }

    #beer {
        top: 11%;
        left: auto;
        right: 4%;
        bottom: auto;
        transform: rotate(4deg);
    }

    #games {
        top: 30%;
        left: 6%;
        right: auto;
        bottom: auto;
        transform: rotate(-4deg);
    }

    #matcha {
        top: 28%;
        left: auto;
        right: 5%;
        bottom: auto;
        transform: rotate(8deg);
    }

    #cat {
        top: 62%;
        left: 15%;
        right: auto;
        bottom: auto;
        transform: rotate(3deg);
    }

    #work {
        top: 54%;
        left: auto;
        right: 25%;
        bottom: auto;
        transform: rotate(2deg);
    }

    #origami {
        bottom: 22%;
        left: auto;
        right: 8%;
        top: auto;
        transform: rotate(10deg);
    }

    /* Notes take more width on mobile */
    #about-note,
    .scrap-note {
        width: calc(100vw - 60px);
        max-width: 340px;
        padding: 20px;
        box-sizing: border-box;
    }

    .scroll-content {
        max-height: 65vh;
    }

    .visual.text-item {
        font-size: 0.95rem;
    }

    .label {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}