/* --- FONTS --- */
/* font-family: 'Zhi Mang Xing', cursive; (Handwriting) */
/* Microsoft JhengHei will be used for body text */

:root {
    --paper-color: #fdfaf2;
    --handwriting-font: 'Zhi Mang Xing', cursive;
    --body-font: "Microsoft JhengHei", "微軟正黑體", sans-serif;
    --wood-texture: url('https://www.transparenttextures.com/patterns/wood-pattern.png');
    --paper-texture: url('https://www.transparenttextures.com/patterns/paper.png');
    --post-it-yellow: #fefabc;
    --note-paper-blue: #e8f5fd;
    --tape-yellow: rgba(255, 204, 77, 0.6);
    --tape-blue: rgba(135, 206, 250, 0.6);
    --tape-red: rgba(229, 115, 115, 0.6);
    --tape-green: rgba(129, 199, 132, 0.6);
}

body {
    background-color: #6d5a3a;
    background-image: var(--wood-texture);
    font-family: var(--body-font); /* Default to readable font */
    padding: 2em;
    min-height: 100vh;
}

.no-scroll {
    overflow: hidden;
}

.diary-page {
    position: relative;
    background-color: var(--paper-color);
    background-image: var(--paper-texture), url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.1'%3E%3Cpath d='M0 40L40 0H20L0 20V40ZM40 40V20L20 40H40Z'/%3E%3C/g%3E%3C/svg%3E");
    width: 95%; /* Expanded width */
    max-width: 1600px; /* Increased max-width */
    margin: 2em auto;
    padding: 5em;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    border-radius: 5px;
    overflow: visible;
    border: 1px solid #ccc;
}

/* Full-page Washi Tape Border */
.tape-side { position: absolute; box-shadow: 0 1px 3px rgba(0,0,0,0.2); z-index: 20; }
.tape-top { top: -20px; left: 10%; width: 80%; height: 40px; background: var(--tape-red); transform: rotate(0.5deg); }
.tape-right { top: 10%; right: -20px; height: 80%; width: 40px; background: var(--tape-yellow); transform: rotate(-1deg); }
.tape-bottom { bottom: -20px; left: 5%; width: 90%; height: 40px; background: var(--tape-green); transform: rotate(-0.5deg); }
.tape-left { top: 5%; left: -20px; height: 90%; width: 40px; background: var(--tape-blue); transform: rotate(1.5deg); }


.page-header { text-align: center; margin-bottom: 4em; position: relative; z-index: 5; }
.logo-polaroid { background: white; padding: 15px 15px 40px 15px; box-shadow: 5px 5px 12px rgba(0,0,0,0.3); transform: rotate(-8deg); max-width: 220px; margin-bottom: 0.5em; border: 1px solid #eee; transition: transform 0.2s ease-in-out; }
.logo-polaroid:hover { transform: rotate(0deg) scale(1.1); z-index: 30; }

h1, .subtitle, .arrow-decorated, .arrow-decorated-small, .diary-text p, .polaroid p, .small-note p { font-family: var(--handwriting-font); }
h1 { font-size: 5em; color: #333; margin: 0.2em 0 0.1em; position: relative; z-index: 5; }
.subtitle { font-size: 2.5em; color: #666; margin-top: 0.5em; transform: rotate(2deg); }

/* Arrow Decoration */
.arrow-decorated { position: relative; display: inline-block; font-size: 3.5em; color: #444; margin-bottom: 0.8em; z-index: 5; }
.arrow-decorated::before, .arrow-decorated::after { position: absolute; top: 50%; font-size: 1.5em; z-index: -1; }
.arrow-decorated::before { content: '->'; left: -80px; transform: translateY(-50%) rotate(-15deg); color: #e57373; }
.arrow-decorated::after { content: '<-'; right: -80px; transform: translateY(-50%) rotate(10deg); color: #81c784; }

.arrow-decorated-small { font-size: 2.5em; color: #555; position: relative; display: block; margin: 1em 0; }
.arrow-decorated-small::before { content: '->>'; font-family: var(--handwriting-font); color: #64b5f6; position: absolute; left: -80px; top: 50%; transform: translateY(-50%) rotate(-10deg); font-size: 1.2em; }


/* --- Scrapbook Sections & Elements --- */
.scrapbook-section { position: relative; margin-bottom: 2em; }

/* Services Section - Note Paper */
.note-paper { position: relative; background: var(--note-paper-blue); padding: 2.5em 2.5em 2.5em 5em; box-shadow: 3px 3px 8px rgba(0,0,0,0.2); background-image: repeating-linear-gradient(var(--note-paper-blue) 0px, var(--note-paper-blue) 24px, #9acced 25px, #9acced 26px); border-left: 4px solid #f08080; max-width: 450px; transform: rotate(-5deg) translateX(30px); z-index: 8; }
.note-paper h2 { margin-left: -25px; font-family: var(--handwriting-font); }
.note-paper ul { list-style: none; padding-left: 0; }
.note-paper li { font-size: 1.2em; color: #333; line-height: 1.6; }

/* Paperclip */
.paperclip { position: absolute; width: 45px; height: 110px; background: #bbb; border: 4px solid #888; border-radius: 22px; top: -50px; left: 45%; transform: translateX(-50%) rotate(25deg); z-index: 10; }
.paperclip::before { content: ''; position: absolute; width: 22px; height: 70px; background: var(--note-paper-blue); border: 4px solid #888; border-radius: 11px; left: 8px; top: 25px; }

.diary-text { position: absolute; top: 50px; left: 50%; width: 400px; transform: rotate(8deg); z-index: 9; }
.diary-text p { font-size: 1.8em; color: #555; line-height: 1.7; text-shadow: 1px 1px 0 white; }

.extra-arrows { margin: 6em 0; }

/* Portfolio Section - Polaroids */
.portfolio-section { text-align: center; margin-top: -2em; z-index: 1; }
.portfolio-section h2 { margin-bottom: 1em; }
.photo-spread { position: relative; height: 900px; /* Increased height to fit more photos */ max-width: 100%; margin: 0 auto; }

.polaroid { position: absolute; background: white; padding: 12px 12px 35px 12px; box-shadow: 6px 6px 15px rgba(0,0,0,0.35); border: 1px solid #ddd; transition: all 0.2s ease-in-out; }
.polaroid img { max-width: 100%; display: block; background: #f0f0f0; min-height: 150px; object-fit: cover; cursor: pointer; }
.polaroid p { font-size: 1.6em; text-align: center; margin: 12px 0 0 0; color: #333; }
.polaroid:hover { transform: scale(1.1) rotate(0) !important; z-index: 30; box-shadow: 8px 8px 20px rgba(0,0,0,0.4); }

/* Absolute chaos positioning for polaroids */
/* Existing (re-verified) */
.photo-1 { width: 280px; top: 50px; left: 5%; transform: rotate(-12deg); z-index: 5; }
.photo-2 { width: 300px; top: 0; left: 37%; transform: rotate(8deg); z-index: 4; }
.photo-3 { width: 260px; top: 250px; left: 20%; transform: rotate(15deg); z-index: 6; }
.photo-4 { width: 270px; top: 350px; right: 8%; transform: rotate(-7deg); z-index: 7; }
.photo-5 { width: 290px; top: 100px; right: 1%; transform: rotate(2deg); z-index: 3; left: auto; }
.photo-6 { width: 220px; bottom: 0; left: 0%; transform: rotate(10deg); z-index: 8; }
.photo-7 { width: 240px; bottom: 50px; left: 45%; transform: rotate(5deg); z-index: 9; }

/* NEW Polaroids */
.photo-8 { width: 250px; top: 20px; right: 30%; transform: rotate(-5deg); z-index: 10; }
.photo-9 { width: 280px; top: 180px; left: 0; transform: rotate(10deg); z-index: 11; }
.photo-10 { width: 270px; top: 380px; right: 25%; transform: rotate(-15deg); z-index: 12; }
.photo-11 { width: 260px; bottom: 0; left: 20%; transform: rotate(5deg); z-index: 13; }
.photo-12 { width: 290px; top: 450px; left: 5%; transform: rotate(-8deg); z-index: 14; }

.torn-edge { padding-bottom: 30px; position: relative; border-bottom: 2px dashed rgba(0,0,0,0.1); }
.torn-edge::after { content: ''; position: absolute; bottom: 10px; left: 10px; right: 10px; height: 20px; background: #fff; mask-image: radial-gradient(circle at 50% -5px, transparent 20px, black 21px); }

/* Contact Section - Post-it */
.contact-section { margin-top: 0; z-index: 5; }
.post-it { position: relative; background: var(--post-it-yellow); padding: 2.2em; max-width: 380px; box-shadow: 6px 6px 15px rgba(0,0,0,0.3); transform: rotate(6deg) translate(80px, 0); text-align: center; margin: 0 auto; z-index: 9; transition: transform 0.2s ease-in-out; }
.post-it:hover { transform: rotate(0deg) scale(1.05) translate(0, 0); z-index: 30; }
.post-it p { font-size: 1.3em; color: #444; }
.post-it h2 { font-size: 3em; }
.post-it::before { content: ''; position: absolute; top: -15px; left: 50%; width: 120px; height: 30px; background: rgba(255, 255, 255, 0.5); transform: translateX(-50%) rotate(-5deg); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }

.small-note { background: #e0f7fa; max-width: 200px; padding: 1em; transform: rotate(-10deg) translate(-250px, -50px); z-index: 10; box-shadow: 4px 4px 10px rgba(0,0,0,0.25); }
.small-note p { font-family: var(--handwriting-font); font-size: 1.5em; }
.small-note::before { background: rgba(255, 255, 255, 0.6); top: -10px; height: 20px; width: 80px; transform: translateX(-50%) rotate(5deg); }

/* Decorative Doodles & Stains */
.coffee-stain { position: absolute; width: 180px; height: 180px; bottom: 50px; right: 80px; border: 15px solid rgba(94, 66, 42, 0.2); border-radius: 50%; opacity: 0.8; z-index: 0; transform: rotate(-20deg); }
.coffee-stain::before { content: ''; position: absolute; width: 60px; height: 60px; bottom: -40px; right: 70px; border: 10px solid rgba(94, 66, 42, 0.2); border-radius: 50%; }

.doodle { position: absolute; z-index: 2; opacity: 0.8; }
.doodle-1 { top: 20%; left: 5%; width: 60px; height: 130px; border: 9px solid #ffc107; border-right: none; border-radius: 65px 0 0 65px; transform: rotate(-30deg); opacity: 0.7; }
.doodle-2 { top: 85%; left: 10%; transform: rotate(-20deg); font-family: var(--handwriting-font); font-size: 2.5em; color: #03a9f4; opacity: 0.8; }
.doodle-2::after { content: ' ✨ ✨ ✨'; }

/* Stickers */
.sticker { position: absolute; background-size: cover; background-position: center; z-index: 12; transition: transform 0.2s ease-in-out; }
.sticker:hover { transform: scale(1.1) rotate(0) !important; z-index: 30; }

.sticker-star { width: 100px; height: 100px; top: 60px; right: 60px; background: gold; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transform: rotate(18deg); }
.sticker-arrow-long { display: none; }
.stamp-confidential { font-family: 'Arial Black', sans-serif; font-size: 1.5em; color: red; border: 4px solid red; padding: 10px; transform: rotate(12deg); top: 30%; right: 10%; opacity: 0.8; }
.postage-stamp { width: 100px; height: 120px; background-color: #f0e6d6; border: 1px dashed #a89f91; top: 55%; left: 2%; transform: rotate(-15deg); }
.postage-stamp::after { content: ''; width: 80px; height: 80px; background: #c5bba9; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); clip-path: circle(50%); }

/* --- Lightbox Styles --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    animation-name: zoom;
    animation-duration: 0.4s;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .diary-page { width: 98%; padding: 3em 2em; }
    .doodle, .sticker, .coffee-stain, .diary-text, .tape-side { display: none; }
    .photo-spread { position: static; height: auto; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
    .polaroid { position: static; transform: rotate(0) !important; margin: 1em; }
    .note-paper, .post-it, .small-note { transform: rotate(0) translateX(0) !important; margin: 2em auto; max-width: 90%; }
}

@media (max-width: 768px) {
    .diary-page { padding: 1.5em; border: none; }
}