/* ===== CSS Variables ===== */
:root {
    --primary: #2a2826;
    --accent: #c86850;
    --accent-sage: #7a8c6a;
    --accent-blue: #6a8494;
    --accent-pink: #c8a098;
    --accent-green: #4a6050;
    --bg: #f8f5f0;
    --bg-warm: #f0ebe4;
    --text: #2a2826;
    --text-light: #5a5856;
    --card-shadow: 0 4px 18px rgba(42, 40, 38, 0.08);
    --transition: 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #f7f4ee;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Collage background - soft blended textures */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        /* Soft crinkled texture - top left, fading out */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='fade1' cx='0%25' cy='0%25' r='100%25'%3E%3Cstop offset='0%25' stop-color='white' stop-opacity='1'/%3E%3Cstop offset='70%25' stop-color='white' stop-opacity='0.3'/%3E%3Cstop offset='100%25' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3Cfilter id='crinkle1'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.015' numOctaves='3' result='noise'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23ebe6dc' surfaceScale='2.5'%3E%3CfeDistantLight azimuth='135' elevation='45'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Cmask id='m1'%3E%3Crect width='100%25' height='100%25' fill='url(%23fade1)'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='100%25' height='100%25' filter='url(%23crinkle1)' mask='url(%23m1)' opacity='0.5'/%3E%3C/svg%3E") no-repeat 0% 0% / 400px 350px,
        /* Soft texture - bottom right */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='fade2' cx='100%25' cy='100%25' r='100%25'%3E%3Cstop offset='0%25' stop-color='white' stop-opacity='1'/%3E%3Cstop offset='60%25' stop-color='white' stop-opacity='0.4'/%3E%3Cstop offset='100%25' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3Cfilter id='crinkle2'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.018' numOctaves='3' result='noise'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23e6e2d8' surfaceScale='2'%3E%3CfeDistantLight azimuth='45' elevation='40'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Cmask id='m2'%3E%3Crect width='100%25' height='100%25' fill='url(%23fade2)'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='100%25' height='100%25' filter='url(%23crinkle2)' mask='url(%23m2)' opacity='0.45'/%3E%3C/svg%3E") no-repeat 100% 100% / 450px 400px,
        /* Soft color washes using radial gradients */
        radial-gradient(ellipse at 5% 10%, rgba(235,228,215,0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 12% 25%, rgba(180,195,170,0.15) 0%, transparent 45%),
        radial-gradient(ellipse at 40% 5%, rgba(175,190,200,0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 92% 18%, rgba(215,200,180,0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 88% 45%, rgba(210,190,185,0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 80%, rgba(240,235,225,0.2) 0%, transparent 45%);
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        /* Soft texture - left side */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='fade3' cx='0%25' cy='50%25' r='80%25'%3E%3Cstop offset='0%25' stop-color='white' stop-opacity='1'/%3E%3Cstop offset='50%25' stop-color='white' stop-opacity='0.3'/%3E%3Cstop offset='100%25' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3Cfilter id='crinkle3'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.016' numOctaves='3' result='noise'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23e8e3d9' surfaceScale='2.2'%3E%3CfeDistantLight azimuth='90' elevation='50'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Cmask id='m3'%3E%3Crect width='100%25' height='100%25' fill='url(%23fade3)'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='100%25' height='100%25' filter='url(%23crinkle3)' mask='url(%23m3)' opacity='0.38'/%3E%3C/svg%3E") no-repeat 0% 50% / 350px 450px,
        /* More soft color washes */
        radial-gradient(ellipse at 55% 92%, rgba(185,195,175,0.14) 0%, transparent 45%),
        radial-gradient(ellipse at 15% 85%, rgba(195,190,200,0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 5% 50%, rgba(230,222,210,0.16) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 8%, rgba(185,195,205,0.1) 0%, transparent 35%),
        radial-gradient(ellipse at 22% 45%, rgba(245,240,232,0.18) 0%, transparent 45%),
        radial-gradient(ellipse at 95% 55%, rgba(190,200,180,0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 45% 88%, rgba(215,198,192,0.14) 0%, transparent 42%);
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* ===== Intro Overlay Animation ===== */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f7f4ee;
    background-image:
        /* Soft faded texture */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3CradialGradient id='fadeIntro' cx='0%25' cy='100%25' r='90%25'%3E%3Cstop offset='0%25' stop-color='white' stop-opacity='1'/%3E%3Cstop offset='50%25' stop-color='white' stop-opacity='0.4'/%3E%3Cstop offset='100%25' stop-color='white' stop-opacity='0'/%3E%3C/radialGradient%3E%3Cfilter id='crinkleIntro'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.018' numOctaves='3' result='noise'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23ebe6dc' surfaceScale='2'%3E%3CfeDistantLight azimuth='120' elevation='45'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Cmask id='mIntro'%3E%3Crect width='100%25' height='100%25' fill='url(%23fadeIntro)'/%3E%3C/mask%3E%3C/defs%3E%3Crect width='100%25' height='100%25' filter='url(%23crinkleIntro)' mask='url(%23mIntro)' opacity='0.4'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 95% 10%, rgba(185,195,175,0.12) 0%, transparent 45%);
    background-size: 55% 60%, 40% 35%;
    background-position: 0% 100%, 100% 0%;
    background-repeat: no-repeat;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#photo-scatter {
    position: absolute;
    width: 100%;
    height: 100%;
}

.scatter-photo {
    position: absolute;
    width: 100px;
    height: 130px;
    background: linear-gradient(135deg, #e8e4dc 0%, #d8d4cc 100%);
    border: 3px solid #fffdf9;
    box-shadow: 0 4px 15px rgba(42, 40, 38, 0.12);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.4, 0, 0.9, 0.4);
}

.scatter-photo::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    width: 40px;
    height: 12px;
    background: rgba(122, 140, 106, 0.6);
    z-index: 10;
}

.scatter-photo:nth-child(3n)::before { background: rgba(106, 132, 148, 0.6); }
.scatter-photo:nth-child(3n+1)::before { background: rgba(200, 160, 152, 0.6); }
.scatter-photo:nth-child(5n)::before { background: rgba(200, 104, 80, 0.5); }

.scatter-photo.visible {
    opacity: 1;
}

/* Different scatter directions for organic blown effect */
.scatter-photo.blown {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.9, 0.4);
}

.scatter-photo.blown.scatter-left {
    transform: translateX(-120vw) translateY(10vh) rotate(-540deg) scale(0.3) !important;
}

.scatter-photo.blown.scatter-right {
    transform: translateX(120vw) translateY(-5vh) rotate(480deg) scale(0.25) !important;
}

.scatter-photo.blown.scatter-up {
    transform: translateX(5vw) translateY(-120vh) rotate(360deg) scale(0.2) !important;
}

.scatter-photo.blown.scatter-down {
    transform: translateX(-8vw) translateY(120vh) rotate(-420deg) scale(0.3) !important;
}

.scatter-photo.blown.scatter-up-left {
    transform: translateX(-100vw) translateY(-80vh) rotate(-600deg) scale(0.2) !important;
}

.scatter-photo.blown.scatter-up-right {
    transform: translateX(100vw) translateY(-70vh) rotate(520deg) scale(0.25) !important;
}

.scatter-photo.blown.scatter-down-left {
    transform: translateX(-90vw) translateY(90vh) rotate(-450deg) scale(0.3) !important;
}

.scatter-photo.blown.scatter-down-right {
    transform: translateX(95vw) translateY(85vh) rotate(580deg) scale(0.2) !important;
}

#tagline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-style: italic;
    font-weight: 400;
    color: var(--primary);
    z-index: 10;
    opacity: 0;
    animation: fadeInTagline 1s ease 2s forwards;
    text-align: center;
    padding: 0 20px;
    letter-spacing: 0.03em;
}

@keyframes fadeInTagline {
    to { opacity: 1; }
}

/* ===== Corner Photos (Faded Background) ===== */
.corner-photo {
    position: fixed;
    z-index: 0;
    border-radius: 1px;
    pointer-events: none;
    border: 2px solid rgba(255, 253, 249, 0.5);
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.corner-photo.top-left {
    width: 120px;
    height: 85px;
    top: 60px;
    left: -15px;
    transform: rotate(-6deg);
    background: linear-gradient(140deg, #e8e2d8 0%, #ddd8cc 100%);
    opacity: 0.18;
}

.corner-photo.top-right {
    width: 85px;
    height: 110px;
    top: 100px;
    right: 25px;
    transform: rotate(4deg);
    background: linear-gradient(135deg, #dce4dc 0%, #d0d8d0 100%);
    opacity: 0.14;
}

.corner-photo.bottom-left {
    width: 100px;
    height: 130px;
    bottom: 120px;
    left: 20px;
    transform: rotate(2deg);
    background: linear-gradient(145deg, #e4dcd8 0%, #d8d0cc 100%);
    opacity: 0.15;
}

.corner-photo.bottom-right {
    width: 130px;
    height: 90px;
    bottom: 80px;
    right: -20px;
    transform: rotate(-5deg);
    background: linear-gradient(138deg, #e0e4e0 0%, #d4d8d4 100%);
    opacity: 0.16;
}

.corner-photo.mid-left {
    width: 75px;
    height: 100px;
    top: 48%;
    left: -20px;
    transform: rotate(-10deg);
    background: linear-gradient(142deg, #e6e0d6 0%, #dad4ca 100%);
    opacity: 0.12;
}

.corner-photo.mid-right {
    width: 95px;
    height: 70px;
    top: 38%;
    right: -10px;
    transform: rotate(8deg);
    background: linear-gradient(136deg, #dce0dc 0%, #d0d4d0 100%);
    opacity: 0.13;
}

/* ===== Main Content ===== */
#main-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#main-content.visible {
    opacity: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

header::after {
    content: '~';
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    color: var(--accent-sage);
    margin-top: 15px;
    opacity: 0.6;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

.profile-pic {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.profile-pic:hover {
    transform: scale(1.1) rotate(-5deg);
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 3.8rem;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
    font-weight: 400;
}

.subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--text-light);
    font-style: italic;
    font-weight: 300;
}

/* ===== Main Category Buttons ===== */
#main-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px;
}

.category-btn {
    padding: 10px 22px;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    border: 1.5px solid var(--primary);
    background: #fffdf9;
    color: var(--primary);
    border-radius: 3px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    box-shadow: 2px 2px 0 rgba(42, 40, 38, 0.1);
}

.category-btn:hover {
    background: var(--primary);
    color: #fffdf9;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 rgba(42, 40, 38, 0.15);
}

.category-btn:nth-child(2) { border-color: var(--accent-sage); }
.category-btn:nth-child(3) { border-color: var(--accent-blue); }
.category-btn:nth-child(4) { border-color: var(--accent-pink); }
.category-btn:nth-child(5) { border-color: var(--accent-green); }

.category-btn:nth-child(2):hover { background: var(--accent-sage); border-color: var(--accent-sage); }
.category-btn:nth-child(3):hover { background: var(--accent-blue); border-color: var(--accent-blue); }
.category-btn:nth-child(4):hover { background: var(--accent-pink); border-color: var(--accent-pink); }
.category-btn:nth-child(5):hover { background: var(--accent-green); border-color: var(--accent-green); }

.category-btn.whimsical {
    border-color: var(--accent);
    color: var(--accent);
    background: linear-gradient(135deg, #fff9f7 0%, #fff5f2 100%);
}

.category-btn.whimsical:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fffdf9;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ===== The Wall (Drop Zone) ===== */
#the-wall {
    margin-bottom: 60px;
}

#drop-zone {
    min-height: 380px;
    border: none;
    border-radius: 4px;
    background-color: #e8e0d4;
    background-image:
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='cork'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.8' numOctaves='4' result='noise'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23e0d4c4' surfaceScale='1.5'%3E%3CfeDistantLight azimuth='45' elevation='50'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23cork)'/%3E%3C/svg%3E");
    position: relative;
    overflow: visible;
    transition: all var(--transition);
    box-shadow:
        inset 0 1px 8px rgba(0,0,0,0.12),
        inset 0 0 0 1px rgba(0,0,0,0.05),
        0 2px 12px rgba(0,0,0,0.06);
}

#drop-zone::before {
    content: 'drag & drop to pin';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(120, 100, 80, 0.7);
    pointer-events: none;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

#drop-zone.has-cards::before {
    opacity: 0;
}

#drop-zone.drag-over {
    background-color: #e4d8c8;
    box-shadow:
        inset 0 1px 12px rgba(0,0,0,0.15),
        inset 0 0 0 2px rgba(200, 104, 80, 0.3),
        0 2px 12px rgba(0,0,0,0.06);
}


/* ===== Card Deck ===== */
#card-deck {
    margin-bottom: 60px;
}

.deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.deck-header > div {
    text-align: left;
}

#card-deck h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.deck-hint {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

#shuffle-btn {
    padding: 8px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid var(--text-light);
    color: var(--text-light);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#shuffle-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fffdf9;
}

#cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    perspective: 1000px;
    padding: 20px 10px;
}

/* ===== Card Styles ===== */
.card {
    background: #fffdf9;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(42, 40, 38, 0.1);
    cursor: grab;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: visible;
    border: 1px solid rgba(42, 40, 38, 0.04);
}

/* Washi tape decoration */
.card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(var(--tape-rotation, -1deg));
    width: 50px;
    height: 12px;
    background: var(--tape-color, rgba(122, 140, 106, 0.6));
    z-index: 10;
}

.card.placed::before {
    width: 40px;
    height: 10px;
    top: -4px;
}

/* Vary tape colors and rotations */
.card:nth-child(3n) { --tape-color: rgba(106, 132, 148, 0.55); --tape-rotation: 2deg; }
.card:nth-child(3n+1) { --tape-color: rgba(200, 160, 152, 0.55); --tape-rotation: -2deg; }
.card:nth-child(3n+2) { --tape-color: rgba(122, 140, 106, 0.55); --tape-rotation: 1deg; }
.card:nth-child(5n) { --tape-color: rgba(200, 104, 80, 0.5); --tape-rotation: -1deg; }

/* Some cards get pins instead */
.card:nth-child(4n)::before {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #d87860, #a84838);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    top: -5px;
    transform: translateX(-50%);
}

.card:nth-child(7n)::before {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #7a94a4, #5a7484);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    top: -5px;
    transform: translateX(-50%);
}

/* Variable card sizes */
.card.size-small {
    width: 140px;
    height: 180px;
}

.card.size-small .card-image {
    height: 100px;
    font-size: 2rem;
}

.card.size-medium {
    width: 170px;
    height: 220px;
}

.card.size-medium .card-image {
    height: 130px;
    font-size: 2.5rem;
}

.card.size-large {
    width: 200px;
    height: 260px;
}

.card.size-large .card-image {
    height: 160px;
    font-size: 3rem;
}

.card.size-wide {
    width: 220px;
    height: 180px;
}

.card.size-wide .card-image {
    height: 100px;
    font-size: 2.5rem;
}

.card.size-tall {
    width: 150px;
    height: 280px;
}

.card.size-tall .card-image {
    height: 180px;
    font-size: 3rem;
}

.card:active {
    cursor: grabbing;
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 28px rgba(42, 40, 38, 0.14);
    z-index: 10;
}

.card-image {
    width: 100%;
    background: linear-gradient(135deg, #e0dcd4 0%, #d0ccc4 100%);
    background-size: cover;
    background-position: center;
    filter: grayscale(60%) sepia(10%);
    transition: filter 0.5s ease, background 0.5s ease, transform 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    overflow: hidden;
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card.interacted .card-image,
.card.placed .card-image {
    filter: grayscale(0%);
}

.card-content {
    padding: 12px 14px;
}

.card-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.card-category {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: lowercase;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* Card rotation variations - subtle scattered look */
.card:nth-child(1) { transform: rotate(-2deg); }
.card:nth-child(2) { transform: rotate(1.5deg); }
.card:nth-child(3) { transform: rotate(-1deg); }
.card:nth-child(4) { transform: rotate(2.5deg); }
.card:nth-child(5) { transform: rotate(-1.5deg); }
.card:nth-child(6) { transform: rotate(1deg); }
.card:nth-child(7) { transform: rotate(-2.5deg); }
.card:nth-child(8) { transform: rotate(2deg); }
.card:nth-child(9) { transform: rotate(-0.5deg); }
.card:nth-child(10) { transform: rotate(1.5deg); }
.card:nth-child(11) { transform: rotate(-2deg); }
.card:nth-child(12) { transform: rotate(0.5deg); }
.card:nth-child(13) { transform: rotate(-1.5deg); }
.card:nth-child(14) { transform: rotate(2deg); }
.card:nth-child(15) { transform: rotate(-1deg); }
.card:nth-child(16) { transform: rotate(1deg); }

/* Dragging state */
.card.dragging {
    opacity: 0.8;
    transform: scale(1.05) rotate(5deg) !important;
    z-index: 100;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

/* Placed on wall - slight size variation */
.card.placed {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
    cursor: grab;
    transition: box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card.placed.placed-small {
    width: 120px !important;
    height: 90px !important;
}

.card.placed.placed-medium {
    width: 140px !important;
    height: 105px !important;
}

.card.placed.placed-large {
    width: 160px !important;
    height: 120px !important;
}

.card.placed .card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 2px;
    z-index: 1;
}

.card.placed .card-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    padding: 8px 10px;
    background: rgba(255,253,249,0.94);
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    z-index: 2;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card.placed:hover .card-content {
    opacity: 1;
}

.card.placed .card-title {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.card.placed .card-category {
    font-size: 0.55rem;
}

.card.placed:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.1);
}

.card.placed.wall-dragging {
    box-shadow: 0 12px 28px rgba(0,0,0,0.18), 0 4px 10px rgba(0,0,0,0.12);
    cursor: grabbing;
}

.card.placed.wall-dragging .card-content {
    opacity: 0;
}

/* ===== Modal ===== */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: opacity var(--transition), visibility var(--transition);
}

#modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#modal-content {
    background: #fffdf9;
    border-radius: 16px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    border: 1px solid rgba(92, 74, 61, 0.1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: color var(--transition);
}

#modal-close:hover {
    color: var(--accent);
}

#modal-body h3 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.modal-category {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: lowercase;
    font-style: italic;
    letter-spacing: 0.03em;
}

#modal-body h4 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 8px;
}

#modal-body p {
    line-height: 1.8;
    margin-bottom: 15px;
}

#modal-body ul {
    list-style: none;
    padding: 0;
}

#modal-body li {
    padding: 10px 0;
    border-bottom: 1px solid #e8e0d8;
}

#modal-body a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
    border-bottom: 1px dotted var(--accent);
}

#modal-body a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.modal-card-content {
    margin: 20px 0;
    line-height: 1.8;
}

.modal-card-content ul {
    list-style: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.modal-card-content li {
    padding: 5px 0;
    border-bottom: none;
}

.modal-card-content blockquote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text);
    border-left: 3px solid var(--accent-sage);
    padding-left: 20px;
    margin: 15px 0;
}

.modal-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 20px;
    border: none !important;
    transition: background 0.2s ease;
}

.modal-link:hover {
    background: var(--accent);
    color: #fff !important;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #e0d5c9;
    margin-top: 40px;
}

.socials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
}

.social-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.social-link:hover {
    color: var(--accent);
}

.calendly-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--primary);
    color: #fffdf9;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 20px;
    transition: all var(--transition);
}

.calendly-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header h1 {
        font-size: 3rem;
    }

    .category-btn {
        padding: 12px 22px;
        font-size: 1.1rem;
    }

    .card.size-small,
    .card.size-medium,
    .card.size-large,
    .card.size-wide,
    .card.size-tall {
        width: 140px;
        height: 180px;
    }

    .card .card-image {
        height: 100px;
        font-size: 2rem;
    }

    #tagline {
        font-size: 2rem;
    }

    .corner-photo {
        width: 120px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2.5rem;
    }

    #main-categories {
        flex-direction: column;
        align-items: center;
    }

    .category-btn {
        width: 80%;
    }
}

/* ===== Music Modal =====  */
.music-modal-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    padding: 20px 0;
    margin-top: 20px;
}

.spotify-embed-container {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
}

.spotify-embed-container iframe {
    display: block;
}

.spotify-profile-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #1DB954;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.spotify-profile-link:hover {
    opacity: 0.8;
}

.cd-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cd-item:hover {
    transform: translateY(-5px);
}

.cd-case {
    width: 90px;
    height: 90px;
    position: relative;
}

.cd-disc {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 50%, #1a1a1a 100%);
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: spin 8s linear infinite;
    animation-play-state: paused;
}

.cd-item:hover .cd-disc {
    animation-play-state: running;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cd-disc::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #f7f4ee;
    border: 2px solid #ddd;
}

.cd-disc::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    mask: radial-gradient(circle, transparent 12px, black 13px);
    -webkit-mask: radial-gradient(circle, transparent 12px, black 13px);
}

.cd-album-art {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    mask: radial-gradient(circle, transparent 12px, black 13px);
    -webkit-mask: radial-gradient(circle, transparent 12px, black 13px);
}

/* CD grooves effect */
.cd-disc .grooves {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        rgba(255,255,255,0.03) 1px,
        transparent 2px
    );
    pointer-events: none;
}

.cd-info {
    text-align: center;
    max-width: 100px;
}

.cd-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-artist {
    font-size: 0.65rem;
    color: var(--text-light);
}

/* ===== Sticky Notes ===== */
#add-note-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(200, 104, 80, 0.3);
    transition: all 0.2s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#add-note-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(200, 104, 80, 0.4);
}

.sticky-note {
    position: absolute;
    width: 120px;
    min-height: 100px;
    padding: 12px;
    border-radius: 2px;
    box-shadow: 2px 3px 8px rgba(0,0,0,0.12);
    cursor: grab;
    z-index: 60;
    transition: box-shadow 0.2s ease;
}

.sticky-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background: inherit;
    filter: brightness(0.95);
    border-radius: 2px 2px 0 0;
}

.sticky-note:hover {
    box-shadow: 4px 6px 15px rgba(0,0,0,0.18);
}

.sticky-note.dragging {
    cursor: grabbing;
    box-shadow: 6px 8px 20px rgba(0,0,0,0.2);
}

.sticky-note-content {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    line-height: 1.4;
    color: #333;
    background: transparent;
    border: none;
    width: 100%;
    min-height: 60px;
    resize: none;
    outline: none;
    margin-top: 15px;
}

.sticky-note-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    border: none;
    color: #666;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-note:hover .sticky-note-delete {
    opacity: 1;
}

.sticky-note-delete:hover {
    background: rgba(200, 104, 80, 0.8);
    color: #fff;
}

/* ===== Scrapbook Decorations ===== */
.scrapbook-decor {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: multiply;
    border-radius: 2px;
}

/* Photo 1 - top left */
.scrapbook-decor.photo-1 {
    top: 5%;
    left: 1%;
    width: 80px;
    height: 105px;
    opacity: 0.28;
    transform: rotate(-12deg);
    filter: sepia(20%) contrast(95%) brightness(105%);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.1);
}

/* Photo 2 - top right */
.scrapbook-decor.photo-2 {
    top: 8%;
    right: 2%;
    width: 70px;
    height: 90px;
    opacity: 0.25;
    transform: rotate(7deg);
    filter: sepia(15%) contrast(90%) brightness(108%);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.1);
}

/* Photo 3 - left middle */
.scrapbook-decor.photo-3 {
    top: 40%;
    left: 0;
    width: 75px;
    height: 100px;
    opacity: 0.22;
    transform: rotate(-5deg);
    filter: sepia(25%) contrast(88%) brightness(110%);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.1);
}

/* Photo 4 - right middle */
.scrapbook-decor.photo-4 {
    top: 52%;
    right: 1%;
    width: 65px;
    height: 85px;
    opacity: 0.2;
    transform: rotate(6deg);
    filter: sepia(18%) contrast(92%) brightness(106%);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.1);
}

/* Photo 5 - bottom left */
.scrapbook-decor.photo-5 {
    bottom: 20%;
    left: 1%;
    width: 72px;
    height: 95px;
    opacity: 0.24;
    transform: rotate(-8deg);
    filter: sepia(22%) contrast(90%) brightness(108%);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.1);
}

/* Photo 6 - bottom right */
.scrapbook-decor.photo-6 {
    bottom: 12%;
    right: 2%;
    width: 68px;
    height: 88px;
    opacity: 0.22;
    transform: rotate(4deg);
    filter: sepia(20%) contrast(92%) brightness(107%);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.1);
}

/* Washi tape strip - right */
.scrapbook-decor.tape-1 {
    top: 28%;
    right: -5px;
    width: 65px;
    height: 20px;
    background: linear-gradient(90deg,
        rgba(200,160,152,0.35) 0%,
        rgba(200,160,152,0.25) 50%,
        rgba(200,160,152,0.35) 100%);
    transform: rotate(-2deg);
    border-radius: 1px;
    mix-blend-mode: normal;
    box-shadow: none;
}

/* Washi tape strip - left */
.scrapbook-decor.tape-2 {
    top: 72%;
    left: -8px;
    width: 60px;
    height: 18px;
    background: linear-gradient(90deg,
        rgba(122,140,106,0.3) 0%,
        rgba(122,140,106,0.2) 50%,
        rgba(122,140,106,0.3) 100%);
    transform: rotate(3deg);
    border-radius: 1px;
    mix-blend-mode: normal;
    box-shadow: none;
}

/* ===== Communities Grid ===== */
.section-intro {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 25px;
}

.communities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.community-badge {
    background: #fffdf9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e8e0d8;
}

.community-badge .badge-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e0d8;
}

.community-badge.stanford .badge-label { color: var(--accent); }
.community-badge.fellowships .badge-label { color: var(--accent-sage); }
.community-badge.previously .badge-label { color: var(--accent-blue); }

.badge-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-items span {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: #f5f2ec;
    border-radius: 12px;
    color: var(--text);
}

.awards-line {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* ===== Sub-page Modal ===== */
#subpage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: opacity var(--transition), visibility var(--transition);
}

#subpage-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#subpage-content {
    width: 95%;
    height: 90%;
    max-width: 1200px;
    background: #f7f4ee;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

#subpage-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    color: var(--text-light);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

#subpage-close:hover {
    background: var(--accent);
    color: #fff;
}

#subpage-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== Responsive additions ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .header-text {
        text-align: center;
    }

    .profile-pic {
        width: 70px;
        height: 70px;
    }

    #cd-container {
        gap: 20px;
    }

    .cd-case, .cd-disc {
        width: 70px;
        height: 70px;
    }

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

    .scrapbook-decor {
        display: none;
    }
}
