/* Reset Dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Tema Kertas Digeser x Tulisan Muncul Perlahan */
:root {
    --wood-dark: #8B4513;
    --wood-light: #D2B48C;
    /* Warna Kertas */
    --note-yellow: #FFD93D;
    --note-pink: #FF92C2;
    --note-green: #6BCB77;
    --note-blue: #4EA8DE;
    --note-orange: #FF8A3C;
    --note-purple: #9D65C9;
    --text-dark: #2D3142;
}

/* Responsif Setup */
body {
    background-color: var(--wood-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
    font-family: 'Poppins', sans-serif;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Background Papan Kayu */
.wood-board-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("https://via.placeholder.com/200x200/8B4513/D2B48C?text=Kayu"),
        linear-gradient(rgba(139, 69, 19, 0.3) 1px, transparent 1px);
    background-size: 200px 200px, 20px 20px;
    z-index: 0;
    pointer-events: none;
}

/* Container Utama */
.notes-container {
    max-width: 700px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    z-index: 1;
    margin-bottom: 4rem;
}

/* Style Umum Kertas */
.note-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    cursor: grab;
    user-select: none;
}

/* Efek Geser Saat Diklik & Ditarik */
.note-item:active {
    cursor: grabbing;
    transform: scale(1.02);
    z-index: 5;
    transition: transform 0.2s ease;
}

/* Pinggiran Kertas Bergelombang */
.paper-edge {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px 4px 0 0;
    z-index: 2;
}

/* Bayangan Kertas */
.paper-shadow {
    position: absolute;
    bottom: -10px;
    left: 10px;
    width: 90%;
    height: 15px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    filter: blur(8px);
    z-index: 0;
}

/* Badan Kertas */
.note-body {
    width: 220px;
    background-color: var(--note-yellow);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Indie Flower', cursive;
    position: relative;
    z-index: 1;
}

/* Warna Kertas */
.note-yellow .note-body { background-color: var(--note-yellow); }
.note-pink .note-body { background-color: var(--note-pink); }
.note-green .note-body { background-color: var(--note-green); }
.note-blue .note-body { background-color: var(--note-blue); }
.note-orange .note-body { background-color: var(--note-orange); }
.note-purple .note-body { background-color: var(--note-purple); }

/* Animasi Geser Masuk */
.slide-in-left {
    transform: translateX(-100vw) rotate(-2deg);
    animation: slideLeft 1.2s ease-out forwards;
}
.slide-in-right {
    transform: translateX(100vw) rotate(2deg);
    animation: slideRight 1.2s ease-out forwards;
}
.slide-in-bottom {
    transform: translateY(100vh) rotate(1deg);
    animation: slideBottom 1.2s ease-out forwards;
}

@keyframes slideLeft {
    to {
        opacity: 1;
        transform: translateX(0) rotate(-0.5deg);
    }
}
@keyframes slideRight {
    to {
        opacity: 1;
        transform: translateX(0) rotate(0.8deg);
    }
}
@keyframes slideBottom {
    to {
        opacity: 1;
        transform: translateY(0) rotate(-0.8deg);
    }
}

/* Animasi Muncul Perlahan (Fade In) */
.fade-in-element {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Animasi Tulisan Seperti Ditulis (Typewriter) */
.typewriter-text {
    overflow: hidden;
    border-right: 2px solid var(--text-dark);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.5px;
    opacity: 0;
    animation: 
        typing 2s steps(30, end) forwards,
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; opacity: 0; }
    to { width: 100%; opacity: 1; }
}
@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--text-dark); }
}

/* Kertas Profil Besar */
.profile-note {
    transform: translateX(-100vw) rotate(-2deg);
    animation: slideLeft 1.5s ease-out forwards;
}
.profile-note .note-body {
    width: 280px;
    background-color: var(--note-purple);
    padding: 2rem 1.5rem;
}
.profile-note img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid white;
    margin-bottom: 1rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}
.profile-note h1 {
    font-size: 2.8rem;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    border-right-color: white;
}
.profile-note .tag, .profile-note .place {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    border-right-color: white;
}
.profile-note .tag { font-size: 1.1rem; margin-bottom: 0.5rem; }
.profile-note .place { font-size: 1rem; }

/* Grid Kertas Tautan Responsif */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.link-note {
    text-decoration: none;
    color: var(--text-dark);
}
.link-note i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}
.link-note span {
    font-size: 1.3rem;
    font-weight: 500;
}

/* Efek Hover Kertas */
.link-note:hover .note-body {
    transform: translateY(-5px);
    box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Kertas Footer */
.footer-note .note-body {
    width: 250px;
    background-color: var(--note-yellow);
}
.footer-note p {
    font-size: 1.3rem;
    color: var(--text-dark);
}

/* Animasi Pena Menulis */
.pen-write-animate {
    position: absolute;
    top: 25%;
    left: 10%;
    font-size: 2rem;
    color: var(--text-dark);
    opacity: 0;
    z-index: 3;
    animation: penWrite 10s ease-in-out infinite;
}
@keyframes penWrite {
    0%, 10%, 90%, 100% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: translate(20px, 5px) rotate(-15deg);
    }
    30% {
        opacity: 1;
        transform: translate(80px, 15px) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: translate(150px, 25px) rotate(-5deg);
    }
    70% {
        opacity: 1;
        transform: translate(200px, 20px) rotate(-10deg);
    }
    85% {
        opacity: 1;
        transform: translate(220px, 15px) rotate(-15deg);
    }
}

/* Responsif Desktop */
@media screen and (min-width: 768px) {
    .notes-container { max-width: 800px; }
    .notes-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-note h1 { font-size: 3.2rem; }
}

/* Responsif Mobile Kecil */
@media screen and (max-width: 480px) {
    .notes-container { gap: 1.5rem; }
    .profile-note .note-body { width: 250px; padding: 1.5rem 1rem; }
    .profile-note img { width: 120px; height: 120px; }
    .profile-note h1 { font-size: 2.2rem; }
    .notes-grid { grid-template-columns: 1fr; }
    .link-note .note-body { width: 250px; }
    .pen-write-animate { font-size: 1.5rem; left: 5%; }
}
