/* badge.bar - Design System Styles */
/* Colors: #A0522D (Rust Iron), #DAA520 (Goldenrod), #F5E6C8 (Worn Canvas), #D2B48C (Kraft Paper), #2C1810 (Ink Black), #556B2F (Forest Patch), #4A5D7A (Denim Blue), #B22222 (Cherry Enamel), #8B7355 */
/* Fonts: Permanent Marker, Cabin, Stint Ultra Expanded, Overpass Mono */

:root {
    --rust-iron: #A0522D;
    --goldenrod: #DAA520;
    --worn-canvas: #F5E6C8;
    --kraft-paper: #D2B48C;
    --ink-black: #2C1810;
    --forest-patch: #556B2F;
    --denim-blue: #4A5D7A;
    --cherry-enamel: #B22222;
    --warm-brown: #8B7355;
    --elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --elastic-out: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cabin', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--ink-black);
    background-color: var(--worn-canvas);
    overflow-x: hidden;
    position: relative;
}

/* Canvas Particle Background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Halftone Overlay */
.halftone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, var(--ink-black) 1px, transparent 1px);
    background-size: 6px 6px;
    opacity: 0.06;
    pointer-events: none;
    z-index: 1;
}

/* ==================== SECTION 1: STAMP PRESS HERO ==================== */
.section-hero {
    position: relative;
    min-height: 120vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--worn-canvas);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.stamp-badge {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(3) translateY(-100px);
    animation: stampDown 800ms var(--elastic) 500ms forwards;
}

@keyframes stampDown {
    0% { opacity: 0; transform: scale(3) translateY(-100px); }
    30% { opacity: 1; transform: scale(0.85) translateY(0); }
    50% { transform: scale(1.08) translateY(-5px); }
    70% { transform: scale(0.97) translateY(2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.badge-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid;
}

.badge-ring-outer {
    width: 280px;
    height: 280px;
    border-color: var(--rust-iron);
}

.badge-ring-inner {
    width: 250px;
    height: 250px;
    border-color: var(--goldenrod);
}

.badge-face {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: repeating-conic-gradient(var(--kraft-paper) 0% 25%, var(--worn-canvas) 25% 50%);
    background-size: 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2), 0 4px 0 var(--ink-black);
}

.badge-icon {
    width: 100px;
    height: 100px;
}

.badge-label {
    font-family: 'Stint Ultra Expanded', sans-serif;
    font-size: 24px;
    letter-spacing: 0.15em;
    color: var(--rust-iron);
    text-transform: uppercase;
    margin-top: 5px;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5), -1px -1px 0 rgba(0,0,0,0.1);
}

.hero-title {
    font-family: 'Permanent Marker', cursive;
    font-size: 96px;
    color: var(--rust-iron);
    text-shadow: 3px 3px 0 var(--ink-black), 1px -1px 0 rgba(255,255,255,0.3);
    transform: rotate(-1deg);
    opacity: 0;
    animation: stampFadeIn 600ms var(--elastic) 1200ms forwards;
}

.hero-subtitle {
    font-family: 'Cabin', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--warm-brown);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    animation: stampFadeIn 600ms var(--elastic) 1500ms forwards;
}

@keyframes stampFadeIn {
    0% { opacity: 0; transform: scale(1.5); }
    60% { opacity: 1; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.stamp-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 3;
    pointer-events: none;
}

/* ==================== SECTION 2: COLLECTION RIBBON ==================== */
.section-ribbon {
    position: relative;
    height: 15vh;
    min-height: 140px;
    background: var(--kraft-paper);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-top: 3px solid var(--rust-iron);
    border-bottom: 3px solid var(--rust-iron);
}

.ribbon-track {
    display: flex;
    gap: 40px;
    padding: 0 40px;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.ribbon-track::-webkit-scrollbar {
    display: none;
}

.ribbon-item {
    flex-shrink: 0;
    scroll-snap-align: center;
    cursor: pointer;
    transition: transform 300ms var(--elastic);
}

.ribbon-item:hover {
    transform: scale(1.12) rotate(3deg);
}

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

.ribbon-badge svg {
    width: 70px;
    height: 70px;
    filter: drop-shadow(3px 3px 0 var(--ink-black));
    transition: filter 300ms var(--elastic);
}

.ribbon-item:hover .ribbon-badge svg {
    filter: drop-shadow(5px 5px 0 var(--ink-black));
}

.ribbon-label {
    font-family: 'Stint Ultra Expanded', sans-serif;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--ink-black);
    text-transform: uppercase;
}

.stitching-border {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background-image: repeating-linear-gradient(90deg, var(--rust-iron) 0, var(--rust-iron) 8px, transparent 8px, transparent 14px);
}

/* ==================== SECTION 3: WORKSHOP FLOOR ==================== */
.section-workshop {
    position: relative;
    min-height: 100vh;
    padding: 80px 40px;
    background: var(--worn-canvas);
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(160,82,45,0.06) 49px, rgba(160,82,45,0.06) 50px),
        repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(160,82,45,0.06) 49px, rgba(160,82,45,0.06) 50px);
}

.section-heading {
    font-family: 'Permanent Marker', cursive;
    font-size: 64px;
    color: var(--rust-iron);
    text-align: center;
    margin-bottom: 60px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2), 1px -1px 0 rgba(255,255,255,0.5);
}

.stamp-heading {
    transform: rotate(-2deg);
}

.workbench {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 800px;
}

.badge-card {
    position: absolute;
    left: var(--x, 0);
    top: var(--y, 0);
    transform: rotate(var(--rotate, 0deg));
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: transform 300ms var(--elastic);
}

.badge-card.stamped {
    opacity: 1;
    animation: badgeStamp 600ms var(--elastic) forwards;
}

@keyframes badgeStamp {
    0% { opacity: 0; transform: rotate(var(--rotate, 0deg)) scale(3); }
    25% { opacity: 1; transform: rotate(var(--rotate, 0deg)) scale(0.85); }
    50% { transform: rotate(var(--rotate, 0deg)) scale(1.05); }
    100% { opacity: 1; transform: rotate(var(--rotate, 0deg)) scale(1); }
}

.badge-card:hover {
    transform: rotate(var(--rotate, 0deg)) scale(1.08) rotate(3deg) !important;
    z-index: 10;
}

.badge-shape-circle {
    width: 200px;
    height: 200px;
    clip-path: circle(50%);
}

.badge-shape-hexagon {
    width: 200px;
    height: 200px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.badge-shape-shield {
    width: 180px;
    height: 220px;
    clip-path: polygon(50% 0%, 100% 20%, 100% 65%, 50% 100%, 0% 65%, 0% 20%);
}

.badge-shape-star {
    width: 200px;
    height: 200px;
}

.badge-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.badge-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(4px 4px 0 var(--ink-black));
}

.badge-text {
    position: absolute;
    bottom: 15%;
    text-align: center;
    pointer-events: none;
}

.badge-name {
    display: block;
    font-family: 'Permanent Marker', cursive;
    font-size: 16px;
    color: var(--worn-canvas);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.badge-serial {
    display: block;
    font-family: 'Overpass Mono', monospace;
    font-size: 10px;
    color: var(--warm-brown);
    letter-spacing: 0.05em;
}

/* ==================== SECTION 4: PIN BOARD ==================== */
.section-pinboard {
    position: relative;
    min-height: 100vh;
    padding: 80px 40px;
    background: var(--kraft-paper);
    background-image:
        radial-gradient(circle, rgba(139,115,85,0.3) 1px, transparent 1px),
        radial-gradient(circle, rgba(139,115,85,0.2) 1px, transparent 1px);
    background-size: 20px 20px, 33px 33px;
    background-position: 0 0, 11px 11px;
}

.corkboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.pin-card {
    position: relative;
    background: var(--worn-canvas);
    padding: 30px 25px 25px;
    transform: rotate(var(--tilt, 0deg));
    box-shadow: 3px 3px 0 var(--ink-black), 6px 6px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: transform 300ms var(--elastic), box-shadow 300ms ease;
}

.pin-card.stamped {
    opacity: 1;
    animation: badgeStamp 600ms var(--elastic) forwards;
}

.pin-card:hover {
    transform: rotate(var(--tilt, 0deg)) scale(1.05);
    box-shadow: 5px 5px 0 var(--ink-black), 8px 8px 16px rgba(0,0,0,0.2);
    z-index: 5;
}

.pin-card.featured {
    border: 3px dashed var(--goldenrod);
    background: linear-gradient(135deg, var(--worn-canvas) 0%, rgba(218,165,32,0.1) 100%);
}

.pushpin {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 40% 40%, #e84040, var(--cherry-enamel));
    border-radius: 50%;
    box-shadow: 0 3px 4px rgba(0,0,0,0.4), inset 0 -2px 3px rgba(0,0,0,0.2);
    z-index: 3;
}

.pushpin-gold {
    background: radial-gradient(circle at 40% 40%, #f0d060, var(--goldenrod));
}

.pin-content {
    position: relative;
    z-index: 2;
}

.featured-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
}

.featured-badge svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 2px 0 var(--ink-black));
}

.pin-quote {
    font-family: 'Cabin', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--ink-black);
    margin-bottom: 12px;
    font-style: italic;
}

.pin-author {
    font-family: 'Stint Ultra Expanded', sans-serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--warm-brown);
    text-transform: uppercase;
}

/* ==================== SECTION 5: CLOSING STAMP ==================== */
.section-footer {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--worn-canvas);
    overflow: hidden;
}

.parchment-surface {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 60px;
}

.closing-stamp {
    width: 250px;
    height: 250px;
    opacity: 0;
}

.closing-stamp.stamped {
    animation: rubberStamp 900ms var(--elastic) forwards;
}

@keyframes rubberStamp {
    0% { opacity: 0; transform: scale(2.5) rotate(-15deg); }
    20% { opacity: 0.7; }
    35% { opacity: 1; transform: scale(0.9) rotate(2deg); }
    55% { transform: scale(1.06) rotate(-1deg); }
    75% { transform: scale(0.98) rotate(0.5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.stamp-impression svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.1));
}

.footer-tagline {
    font-family: 'Permanent Marker', cursive;
    font-size: 28px;
    color: var(--rust-iron);
    transform: rotate(1deg);
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.footer-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.meta-item {
    font-family: 'Overpass Mono', monospace;
    font-size: 13px;
    color: var(--warm-brown);
}

.meta-divider {
    color: var(--goldenrod);
}

/* ==================== FLOATING NAV ==================== */
.nav-compass {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    transition: transform 300ms var(--elastic);
    filter: drop-shadow(3px 3px 0 var(--ink-black));
}

.nav-compass:hover {
    transform: scale(1.1) rotate(15deg);
}

.nav-compass.active {
    transform: rotate(45deg);
}

.radial-menu {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    z-index: 999;
    pointer-events: none;
}

.radial-item {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transform: scale(0);
    transition: transform 400ms var(--elastic), opacity 300ms ease;
    pointer-events: none;
    filter: drop-shadow(2px 2px 0 var(--ink-black));
}

.radial-item svg {
    width: 36px;
    height: 36px;
}

.radial-item span {
    font-family: 'Stint Ultra Expanded', sans-serif;
    font-size: 8px;
    color: var(--ink-black);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    margin-top: 2px;
}

.radial-menu.open .radial-item {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
    cursor: pointer;
}

.radial-menu.open .radial-item:hover {
    transform: scale(1.15);
}

.radial-menu.open .radial-item[data-index='0'] {
    bottom: 80px; right: 4px;
    transition-delay: 0ms;
}
.radial-menu.open .radial-item[data-index='1'] {
    bottom: 65px; right: 60px;
    transition-delay: 60ms;
}
.radial-menu.open .radial-item[data-index='2'] {
    bottom: 25px; right: 85px;
    transition-delay: 120ms;
}
.radial-menu.open .radial-item[data-index='3'] {
    bottom: -20px; right: 70px;
    transition-delay: 180ms;
}
.radial-menu.open .radial-item[data-index='4'] {
    bottom: -35px; right: 15px;
    transition-delay: 240ms;
}

/* ==================== SPARKLE CONTAINER ==================== */
#sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.sparkle {
    position: absolute;
    pointer-events: none;
    animation: sparkleFade 800ms ease-out forwards;
}

@keyframes sparkleFade {
    0% { opacity: 1; transform: scale(1) rotate(0deg); }
    100% { opacity: 0; transform: scale(0) rotate(180deg); }
}

/* ==================== CONFETTI PARTICLES ==================== */
.confetti-particle {
    position: absolute;
    pointer-events: none;
    z-index: 100;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 56px;
    }

    .stamp-badge {
        width: 200px;
        height: 200px;
    }

    .badge-ring-outer {
        width: 200px;
        height: 200px;
    }

    .badge-ring-inner {
        width: 175px;
        height: 175px;
    }

    .badge-face {
        width: 155px;
        height: 155px;
    }

    .badge-icon {
        width: 70px;
        height: 70px;
    }

    .badge-label {
        font-size: 18px;
    }

    .section-heading {
        font-size: 42px;
    }

    .workbench {
        min-height: 1200px;
    }

    .badge-card {
        position: relative;
        left: auto !important;
        top: auto !important;
        display: inline-block;
        margin: 20px;
    }

    .workbench {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        min-height: auto;
    }

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

    .closing-stamp {
        width: 180px;
        height: 180px;
    }

    .footer-tagline {
        font-size: 22px;
    }
}

/* Embossed text effect mixin */
.embossed {
    text-shadow: 1px 1px 0 rgba(255,255,255,0.5), -1px -1px 0 rgba(0,0,0,0.4);
}