:root {
    --honey-cream: #f5e6c8;
    --warm-linen: #ede0cc;
    --biscuit: #d4b896;
    --espresso: #3d2c1e;
    --dusty-rose: #d4a5a5;
    --seafoam: #8fcaca;
    --peach-sorbet: #e8a87c;
    --mustard-pop: #d4a843;
    --slate-shadow: #6b5e50;
    --craft-wood: #f0dfc0;
}

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

body {
    font-family: 'Karla', sans-serif;
    color: var(--espresso);
    background-color: var(--honey-cream);
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            var(--craft-wood) 40px,
            rgba(240, 223, 192, 0.4) 42px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(212, 184, 150, 0.15) 80px,
            rgba(212, 184, 150, 0.15) 81px
        );
    overflow-x: hidden;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* ============================================
   NAVIGATION: Sticky-note tabs
   ============================================ */
.nav-tabs {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-tab {
    width: 44px;
    height: 36px;
    border-radius: 2px 6px 6px 2px;
    cursor: pointer;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    padding-left: 10px;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.nav-tab:hover {
    width: 130px;
    transform: translateX(-8px) rotate(2deg);
    box-shadow: 4px 4px 0 var(--biscuit);
}

.tab-label {
    font-family: 'Architects Daughter', cursive;
    font-size: 0.9rem;
    color: var(--espresso);
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
    pointer-events: none;
}

.nav-tab:hover .tab-label {
    opacity: 1;
}

.tab-peach { background-color: var(--peach-sorbet); }
.tab-rose { background-color: var(--dusty-rose); }
.tab-seafoam { background-color: var(--seafoam); }

/* Mobile nav button */
.mobile-nav-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--espresso);
    background: var(--peach-sorbet);
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--biscuit);
    transition: transform 0.2s ease;
}

.mobile-nav-btn:hover {
    transform: scale(1.08);
}

.mobile-nav-icon {
    font-size: 24px;
    color: var(--espresso);
}

/* Mobile nav overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(61, 44, 30, 0.7);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.mobile-nav-overlay.active {
    display: flex;
}

.notebook-page {
    background: var(--warm-linen);
    border: 2px solid var(--biscuit);
    border-radius: 4px;
    padding: 48px 40px;
    width: 80%;
    max-width: 320px;
    position: relative;
    box-shadow: 6px 6px 0 var(--biscuit);
    background-image: repeating-linear-gradient(
        transparent,
        transparent 31px,
        var(--dusty-rose) 31px,
        var(--dusty-rose) 32px
    );
}

.mobile-nav-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--espresso);
    cursor: pointer;
    font-family: 'Architects Daughter', cursive;
}

.notebook-link {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--espresso);
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.notebook-link:hover {
    color: var(--peach-sorbet);
}

/* ============================================
   HERO SECTION: Craft Table
   ============================================ */
.hero-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    overflow: hidden;
}

.craft-table {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 400px;
}

.letter-card {
    position: absolute;
    background: var(--warm-linen);
    border: 2px solid var(--biscuit);
    border-radius: 4px;
    padding: 12px 8px;
    transform: rotate(var(--base-rotation));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    box-shadow: 3px 3px 0 rgba(107, 94, 80, 0.2);
    cursor: default;
}

.letter-card:hover {
    transform: translateY(-4px) rotate(calc(var(--base-rotation) + 1deg));
    box-shadow: 5px 5px 0 rgba(107, 94, 80, 0.3);
}

.letter-inner {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.02em;
    display: block;
    width: 1.2em;
    height: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--espresso);
}

/* Letter card decorative styles */
.letter-polka {
    background-image: radial-gradient(var(--dusty-rose) 2px, transparent 2px);
    background-size: 10px 10px;
}

.letter-stripe {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        var(--seafoam) 4px,
        var(--seafoam) 6px
    );
}

.letter-floral {
    background-image: radial-gradient(circle at 30% 30%, var(--peach-sorbet) 3px, transparent 3px),
                       radial-gradient(circle at 70% 70%, var(--dusty-rose) 2px, transparent 2px),
                       radial-gradient(circle at 50% 50%, var(--mustard-pop) 1.5px, transparent 1.5px);
    background-size: 16px 16px;
}

.letter-zigzag {
    background-image: linear-gradient(135deg, var(--mustard-pop) 25%, transparent 25%),
                       linear-gradient(225deg, var(--mustard-pop) 25%, transparent 25%),
                       linear-gradient(45deg, var(--mustard-pop) 25%, transparent 25%),
                       linear-gradient(315deg, var(--mustard-pop) 25%, transparent 25%);
    background-size: 12px 6px;
    background-position: 0 0, 0 0, 6px 3px, 6px 3px;
}

.letter-dots {
    background-image: radial-gradient(var(--seafoam) 3px, transparent 3px);
    background-size: 14px 14px;
}

.letter-wave {
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 5px,
        var(--peach-sorbet) 5px,
        var(--peach-sorbet) 7px
    );
}

.letter-check {
    background-image:
        linear-gradient(45deg, var(--dusty-rose) 25%, transparent 25%, transparent 75%, var(--dusty-rose) 75%),
        linear-gradient(45deg, var(--dusty-rose) 25%, transparent 25%, transparent 75%, var(--dusty-rose) 75%);
    background-size: 12px 12px;
    background-position: 0 0, 6px 6px;
}

/* Letter-card positioning */
.lc-1 { top: 15%; left: 5%; }
.lc-2 { top: 8%; left: 20%; }
.lc-3 { top: 22%; left: 34%; }
.lc-4 { top: 10%; left: 48%; }
.lc-5 { top: 25%; left: 64%; }
.lc-6 { top: 12%; left: 74%; }
.lc-7 { top: 28%; left: 86%; }

/* ============================================
   STAMPS: Postage stamp motif
   ============================================ */
.stamp {
    width: 56px;
    height: 64px;
    background: var(--warm-linen);
    border: 2px solid var(--biscuit);
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transform: rotate(var(--base-rotation));
    transition: transform 0.2s ease;
    background-image: radial-gradient(circle, var(--honey-cream) 2px, transparent 2px);
    background-size: 8px 8px;
    background-position: -4px -4px;
    box-shadow:
        inset 0 0 0 4px var(--warm-linen),
        0 0 0 2px var(--biscuit);
}

.stamp:hover {
    transform: rotate(var(--base-rotation)) scale(1.08);
}

.stamp-icon {
    width: 28px;
    height: 28px;
}

.stamp-text {
    font-family: 'Gaegu', cursive;
    font-size: 10px;
    color: var(--slate-shadow);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stamp-korean {
    font-family: 'Gaegu', cursive;
    font-size: 11px;
    color: var(--espresso);
    text-align: center;
    line-height: 1.3;
}

.stamp-hero { top: 60%; left: 12%; }
.stamp-scissors { top: 10%; right: 8%; }
.stamp-crane { top: 4%; right: 15%; }
.stamp-thread { bottom: 8%; left: 6%; }

/* ============================================
   WASHI TAPE
   ============================================ */
.washi-tape {
    height: 24px;
    width: 65%;
    position: absolute;
    opacity: 0.7;
    clip-path: polygon(1% 0%, 99% 2%, 100% 98%, 0% 100%);
}

.washi-hero {
    background: repeating-linear-gradient(
        45deg,
        var(--dusty-rose),
        var(--dusty-rose) 4px,
        transparent 4px,
        transparent 8px
    );
    bottom: 18%;
    left: 10%;
    transform: rotate(-1deg);
}

.washi-about {
    background: repeating-linear-gradient(
        45deg,
        var(--seafoam),
        var(--seafoam) 4px,
        transparent 4px,
        transparent 8px
    );
    bottom: -12px;
    left: 15%;
    transform: rotate(1deg);
}

/* ============================================
   VINTAGE BUTTONS
   ============================================ */
.vintage-btn {
    position: absolute;
    transition: transform 0.2s ease;
}

.vintage-btn:hover {
    transform: scale(1.1);
}

.btn-pin-1 { top: 72%; left: 80%; }
.btn-pin-2 { top: 55%; left: 42%; }

/* ============================================
   ZIGZAG & SQUIGGLY DECORATIONS
   ============================================ */
.zigzag, .squiggly {
    position: absolute;
    pointer-events: none;
}

.zigzag-hero { bottom: 10%; right: 5%; }
.zigzag-gallery { top: 60px; left: 5%; }
.squiggly-about { bottom: 40px; right: 10%; }

/* ============================================
   ABOUT SECTION: Postcard
   ============================================ */
.about-section {
    min-height: 80vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    overflow: hidden;
}

.postcard {
    background: var(--warm-linen);
    border: 2px solid var(--biscuit);
    border-radius: 4px;
    width: 90%;
    max-width: 720px;
    padding: 40px;
    transform: rotate(var(--base-rotation));
    position: relative;
    box-shadow: 5px 5px 0 rgba(107, 94, 80, 0.15);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
}

.postcard-stamp {
    grid-column: 2;
    grid-row: 1;
    width: 56px;
    height: 64px;
    background: var(--honey-cream);
    border: 2px solid var(--biscuit);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(circle, var(--warm-linen) 2px, transparent 2px);
    background-size: 8px 8px;
    background-position: -4px -4px;
    box-shadow:
        inset 0 0 0 4px var(--honey-cream),
        0 0 0 2px var(--biscuit);
}

.postcard-divider {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
}

.postcard-body {
    grid-column: 1 / -1;
    grid-row: 2;
}

.postcard-title {
    font-family: 'Architects Daughter', cursive;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--espresso);
}

.postcard-text {
    font-family: 'Karla', sans-serif;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.7;
    color: var(--espresso);
    margin-bottom: 12px;
}

.postcard-address-lines {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}

.address-line {
    width: 100px;
    height: 1px;
    background: var(--biscuit);
}

/* ============================================
   GALLERY SECTION: Broken-grid card flip
   ============================================ */
.gallery-section {
    min-height: 100vh;
    position: relative;
    padding: 80px 20px;
    overflow: hidden;
}

.gallery-title {
    font-family: 'Architects Daughter', cursive;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    margin-bottom: 48px;
    color: var(--espresso);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 960px;
    margin: 0 auto;
    position: relative;
}

.flip-card {
    perspective: 800px;
    cursor: pointer;
    position: relative;
    transform: rotate(var(--base-rotation));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card:hover {
    transform: translateY(-4px) rotate(calc(var(--base-rotation) + 1deg));
}

.flip-card:nth-child(even) {
    margin-top: 24px;
}

.flip-card:nth-child(3n+2) {
    margin-left: -8px;
}

.card-size-lg {
    min-height: 380px;
}

.card-size-md {
    min-height: 300px;
}

.card-size-sm {
    min-height: 240px;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card.flipped .flip-inner {
    transform: rotateY(180deg);
}

.flip-card:nth-child(even).flipped .flip-inner {
    transform: rotateX(180deg);
}

.flip-front, .flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 2px solid var(--biscuit);
    border-radius: 4px;
    overflow: hidden;
}

.flip-front {
    background: var(--warm-linen);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
}

.flip-back {
    background: var(--honey-cream);
    transform: rotateY(180deg);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flip-card:nth-child(even) .flip-back {
    transform: rotateX(180deg);
}

.flip-back h3 {
    font-family: 'Architects Daughter', cursive;
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--espresso);
}

.flip-back p {
    font-family: 'Karla', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--espresso);
}

/* Card patterns */
.card-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
}

.pattern-circles {
    background-image: radial-gradient(circle, var(--card-accent) 4px, transparent 4px);
    background-size: 20px 20px;
}

.pattern-triangles {
    background-image:
        linear-gradient(60deg, var(--card-accent) 25%, transparent 25.5%),
        linear-gradient(-60deg, var(--card-accent) 25%, transparent 25.5%);
    background-size: 20px 24px;
}

.pattern-zigzag {
    background-image:
        linear-gradient(135deg, var(--card-accent) 25%, transparent 25%),
        linear-gradient(225deg, var(--card-accent) 25%, transparent 25%),
        linear-gradient(315deg, var(--card-accent) 25%, transparent 25%),
        linear-gradient(45deg, var(--card-accent) 25%, transparent 25%);
    background-size: 16px 8px;
    background-position: 0 0, 0 0, 8px 4px, 8px 4px;
}

.pattern-dots {
    background-image: radial-gradient(circle, var(--card-accent) 2px, transparent 2px);
    background-size: 12px 12px;
}

.pattern-stripes {
    background-image: repeating-linear-gradient(
        0deg,
        var(--card-accent),
        var(--card-accent) 2px,
        transparent 2px,
        transparent 8px
    );
}

.pattern-waves {
    background-image: repeating-linear-gradient(
        45deg,
        var(--card-accent),
        var(--card-accent) 1px,
        transparent 1px,
        transparent 6px
    );
}

.card-deco {
    position: relative;
    z-index: 1;
}

.card-label {
    font-family: 'Gaegu', cursive;
    font-size: 16px;
    color: var(--slate-shadow);
    position: relative;
    z-index: 1;
}

.card-pin {
    position: absolute;
    top: -6px;
    right: 12px;
    z-index: 2;
}

/* ============================================
   FOOTER: Drawer
   ============================================ */
.footer-drawer {
    background: var(--biscuit);
    border-top: 3px solid var(--espresso);
    padding: 20px 20px 40px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(60px);
}

.footer-drawer:hover {
    transform: translateY(0);
}

.drawer-handle {
    display: flex;
    justify-content: center;
    padding: 8px 0 20px;
}

.handle-bar {
    width: 60px;
    height: 6px;
    background: var(--espresso);
    border-radius: 3px;
    opacity: 0.4;
}

.drawer-content {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    padding: 16px 0;
}

.desk-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.desk-label {
    font-family: 'Gaegu', cursive;
    font-size: 14px;
    color: var(--espresso);
}

.footer-tagline {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.4rem;
    text-align: center;
    color: var(--espresso);
    margin-top: 20px;
    opacity: 0.8;
}

/* ============================================
   SCATTER ANIMATION
   ============================================ */
@keyframes scatter {
    0% {
        opacity: 0;
        transform: translate(calc(50vw - 100%), calc(50vh - 100%)) scale(0.3);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

.scatter-el {
    animation: scatter 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.scatter-el:nth-child(1) { animation-delay: 0ms; }
.scatter-el:nth-child(2) { animation-delay: 40ms; }
.scatter-el:nth-child(3) { animation-delay: 80ms; }
.scatter-el:nth-child(4) { animation-delay: 120ms; }
.scatter-el:nth-child(5) { animation-delay: 160ms; }
.scatter-el:nth-child(6) { animation-delay: 200ms; }
.scatter-el:nth-child(7) { animation-delay: 240ms; }
.scatter-el:nth-child(8) { animation-delay: 280ms; }
.scatter-el:nth-child(9) { animation-delay: 320ms; }
.scatter-el:nth-child(10) { animation-delay: 360ms; }
.scatter-el:nth-child(11) { animation-delay: 400ms; }
.scatter-el:nth-child(12) { animation-delay: 440ms; }

/* ============================================
   CONFETTI DOTS (generated by JS)
   ============================================ */
.confetti-dot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: scatter 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .nav-tabs {
        display: none;
    }

    .mobile-nav-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .craft-table {
        height: 300px;
    }

    .letter-card {
        transform: rotate(calc(var(--base-rotation) * 0.5));
    }

    .letter-inner {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .lc-1 { top: 5%; left: 2%; }
    .lc-2 { top: 0%; left: 16%; }
    .lc-3 { top: 12%; left: 30%; }
    .lc-4 { top: 2%; left: 44%; }
    .lc-5 { top: 15%; left: 58%; }
    .lc-6 { top: 4%; left: 70%; }
    .lc-7 { top: 18%; left: 82%; }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .flip-card {
        transform: rotate(calc(var(--base-rotation) * 0.4));
    }

    .flip-card:nth-child(even) {
        margin-top: -16px;
    }

    .flip-card:nth-child(3n+2) {
        margin-left: 0;
    }

    .card-size-lg,
    .card-size-md,
    .card-size-sm {
        min-height: 260px;
    }

    .postcard {
        padding: 24px;
        transform: rotate(calc(var(--base-rotation) * 0.5));
    }

    .drawer-content {
        gap: 24px;
    }

    .stamp-hero { top: 70%; left: 5%; }
    .stamp-scissors { top: 5%; right: 3%; }

    .washi-tape {
        width: 80%;
    }

    .footer-drawer {
        transform: translateY(30px);
    }
}

@media (max-width: 480px) {
    .craft-table {
        height: 250px;
    }

    .postcard {
        grid-template-columns: 1fr;
    }

    .postcard-stamp {
        grid-column: 1;
        justify-self: end;
    }

    .postcard-address-lines {
        grid-column: 1;
        grid-row: auto;
    }
}