:root {
    --sepia-dark: #3e2b14;
    --sepia-light: #f4e8d3;
    --sepia-mid: #c7a77b;
    --border-color: #8b6e4e;
    --bg-paper: #e4d5b7;
    --text-classic: #2c1e0f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Judson', serif;
    background:
        linear-gradient(rgba(228, 213, 183, 0.74), rgba(228, 213, 183, 0.86)),
        url('assets/bg.png') center/cover fixed no-repeat;
    color: var(--text-classic);
    overflow-x: hidden;
    min-height: 100vh;
}

.arabic-font { font-family: 'El Messiri', sans-serif; }
h1, h2, h3 { font-family: 'Playfair Display', serif; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.text-muted { color: #6d5843; }
.font-style-italic { font-style: italic; }
.w-100 { width: 100%; }

/* Film Grain Overlay */
.film-grain {
    position: fixed; inset: 0; pointer-events: none; z-index: 9998;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/d/d4/Film_grain_overlay.png');
    opacity: 0.15; mix-blend-mode: multiply; animation: grain 0.5s step-end infinite;
}
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-2%, 2%); } }

/* Entrance Overlay */
#entrance-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background:
        linear-gradient(rgba(26, 17, 7, 0.62), rgba(26, 17, 7, 0.8)),
        url('assets/bg.png') center/cover no-repeat;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 2s ease;
}

.vintage-frame {
    border: 8px solid var(--border-color); padding: 4px; border-radius: 4px;
    background: var(--bg-paper); box-shadow: 0 0 30px rgba(0,0,0,0.8);
    position: relative;
}
.vintage-frame::before {
    content: ''; position: absolute; inset: 0; border: 2px solid var(--sepia-dark); pointer-events: none;
}

.classic-content { padding: 3rem; text-align: center; }
.classic-icon { font-size: 3rem; color: var(--border-color); margin-bottom: 1rem; animation: flicker 2s infinite; }
.text-sepia { color: var(--sepia-dark); }
.door-text { font-size: 2.5rem; margin-bottom: 2rem; border-bottom: 2px solid var(--sepia-mid); padding-bottom: 10px; }

.vintage-btn {
    background: var(--sepia-dark); color: var(--sepia-light); border: 2px solid var(--border-color);
    padding: 0.8rem 2rem; font-family: 'Judson', serif; font-size: 1.2rem; cursor: pointer;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3); transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.vintage-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0px rgba(0,0,0,0.3); }

.hidden { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

/* Main Content Layout */
#main-content {
    padding: 2rem; max-width: 600px; margin: 0 auto;
    position: relative; z-index: 10; transition: opacity 3s ease;
}

.background-elements {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        linear-gradient(rgba(228, 213, 183, 0.58), rgba(209, 188, 151, 0.72)),
        url('assets/bg.png') center/cover no-repeat;
}

.classic-panel {
    background: rgba(244, 232, 211, 0.9);
    border: 2px solid var(--border-color);
    padding: 2.5rem 2rem;
    margin-bottom: 3rem;
    position: relative;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
    opacity: 0; /* JS will fade in */
}

/* Vintage Ornaments */
.vintage-border {
    position: relative;
}
.corner-ornament {
    position: absolute; width: 30px; height: 30px; border-top: 3px solid var(--border-color); border-left: 3px solid var(--border-color);
}
.top-left { top: 10px; left: 10px; }
.top-right { top: 10px; right: 10px; transform: rotate(90deg); }
.bottom-left { bottom: 10px; left: 10px; transform: rotate(-90deg); }
.bottom-right { bottom: 10px; right: 10px; transform: rotate(180deg); }

.vintage-divider {
    height: 2px; background: var(--sepia-mid); margin: 1.5rem auto; width: 60%;
    position: relative;
}
.vintage-divider::before {
    content: '◈'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    background: var(--bg-paper); padding: 0 10px; color: var(--sepia-dark);
}

.top-decorations { position: absolute; width: 100%; top: 0; left: 0; height: 100px; z-index: 5; pointer-events: none;}
.swinging-ketupat {
    position: absolute; width: 45px; transform-origin: top center;
    animation: swing-k 4s ease-in-out infinite alternate; filter: sepia(0.8) contrast(1.2);
}
@keyframes swing-k { 0% { transform: rotate(-10deg); } 100% { transform: rotate(10deg); } }
.k1 { left: 15%; top: -10px; }
.k2 { right: 15%; top: -15px; animation-delay: 1.5s; width: 40px; }

/* Hero Section */
.hero { text-align: center; margin-top: 5vh; }
.title-sepia { color: var(--sepia-dark); font-size: 2.5rem; margin-bottom: 0.5rem; }
.subtitle { font-size: 1.4rem; color: #5c4328; margin-bottom: 0.5rem; }
.from-text { font-style: italic; font-size: 1.1rem; }

/* Gallery Section */
.memory-section { text-align: center; }
.title-sepia-small { color: var(--sepia-dark); font-size: 1.8rem; margin-bottom: 1.5rem; }
.polaroid-container { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.polaroid {
    background: #fdfaf3; padding: 10px 10px 25px 10px; border: 1px solid #ccc;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1); width: 150px; transform: rotate(-3deg); transition: transform 0.3s;
}
.polaroid.sepia { filter: sepia(0.8) contrast(1.1); }
.polaroid:nth-child(2) { transform: rotate(5deg); }
.polaroid:hover { transform: scale(1.05) rotate(0deg); z-index: 2; filter: sepia(0.2); }
.polaroid img { width: 100%; height: 130px; object-fit: cover; }
.polaroid p { margin-top: 10px; font-family: 'Judson', serif; font-size: 1rem; color: var(--sepia-dark); }

/* Quote Section */
.quote-section { text-align: center; }
.quote-text { font-size: 1.3rem; font-style: italic; line-height: 1.7; color: var(--sepia-dark); }

/* Ucapan Section */
.ucapan-section { text-align: center; }
.message-text { line-height: 1.8; font-size: 1.15rem; color: #44311e; }

/* Interaction Section */
.interaction-section { text-align: center; }
.quick-replies { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.reply-btn {
    background: transparent; border: 1px solid var(--border-color); color: var(--sepia-dark);
    padding: 0.5rem 1rem; cursor: pointer; transition: all 0.2s; font-family: 'Judson', serif; font-size: 1rem;
}
.reply-btn:hover { background: var(--sepia-dark); color: var(--sepia-light); }
textarea {
    width: 100%; background: #fcf8ee; border: 1px solid var(--border-color);
    padding: 1rem; color: var(--sepia-dark); font-family: 'Judson', serif; min-height: 100px;
    margin-bottom: 1rem; resize: vertical; font-size: 1.1rem;
}
textarea:focus { outline: none; border-width: 2px; }
.form-status { margin-top: 0.75rem; color: var(--sepia-dark); }
.form-status.is-error { color: #991b1b; }
.form-status.is-success { color: #166534; }

/* Share Section */
.share-section { text-align: center; margin-bottom: 2rem; }
.share-buttons { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.share-btn {
    width: 45px; height: 45px; border-radius: 50%; border: 1px solid var(--border-color); background: #fdfaf3;
    color: var(--sepia-dark); font-size: 1.2rem; cursor: pointer; transition: all 0.3s;
}
.share-btn:hover { background: var(--sepia-dark); color: var(--sepia-light); transform: scale(1.1); }

/* Music Control */
.music-control { position: fixed; bottom: 20px; right: 20px; z-index: 100; }
.vintage-music-btn {
    width: 60px; height: 60px; border-radius: 50%; background: var(--sepia-dark);
    color: var(--sepia-light); font-size: 2rem; cursor: pointer; display: flex;
    justify-content: center; align-items: center; border: 2px solid var(--border-color);
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3); transition: transform 0.2s;
}
.spin-icon { transition: transform 0.5s; }
.spinning { animation: spin 3s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

@media (max-width: 600px) {
    .title-sepia { font-size: 2rem; }
    .door-text { font-size: 2rem; }
}
