/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    color: #F0EDE5;
    background: #0F0F12;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h2, h3, h4, .badge-name, .section-title {
    font-family: 'Bebas Neue', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.serial, .spec-value, .spec-label, .badge-serial, .stage-label {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
}

/* ===== NAVIGATION STRIP ===== */
#nav-strip {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 10px;
    background: rgba(15, 15, 18, 0.7);
    border-right: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 0 8px 8px 0;
}

.nav-badge {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
}

.nav-badge:hover {
    opacity: 1;
    transform: scale(1.15);
}

.nav-badge.active {
    opacity: 1;
}

.nav-badge.visited::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 209, 102, 0.5);
    pointer-events: none;
}

/* ===== SECTIONS ===== */
.section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.section-title {
    font-size: clamp(2.5rem, 6vw, 7rem);
    color: #C9A84C;
    text-align: center;
}

/* ===== SECTION 1: THE PINBOARD ===== */
#pinboard {
    background: #1B4332;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.felt-surface {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Canvas weave texture */
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(27, 67, 50, 0.8) 0px,
            rgba(22, 56, 42, 0.9) 1px,
            transparent 1px,
            transparent 2px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(27, 67, 50, 0.8) 0px,
            rgba(22, 56, 42, 0.9) 1px,
            transparent 1px,
            transparent 2px
        );
    background-size: 3px 3px;
    background-attachment: local;
}

/* Spotlight overlay */
.spotlight-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, transparent 8%, rgba(15, 15, 18, 0.97) 25%);
    z-index: 10;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

.spotlight-overlay.expanded {
    opacity: 0;
}

/* Light sweep effect */
.light-sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        transparent 40%,
        rgba(232, 212, 139, 0.08) 45%,
        rgba(232, 212, 139, 0.15) 50%,
        rgba(232, 212, 139, 0.08) 55%,
        transparent 60%,
        transparent 100%
    );
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-120%);
}

.light-sweep.animate {
    animation: sweepLight 3s ease-in-out forwards;
}

@keyframes sweepLight {
    0% { transform: translateX(-120%); opacity: 1; }
    100% { transform: translateX(120%); opacity: 0; }
}

/* Featured badge */
.badge-slot.featured {
    z-index: 8;
    margin-bottom: 30px;
}

.badge-slot.featured .badge-svg {
    width: 200px;
    height: 200px;
}

.badge-slot.featured .badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.badge-slot.featured .badge-item.visible {
    opacity: 1;
    transform: scale(1);
}

.badge-serial {
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: #C9A84C;
    margin-top: 12px;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
}

.badge-serial.typing {
    animation: typewriter 1.5s steps(24) forwards;
    opacity: 1;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

.badge-serial.typing {
    display: inline-block;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 1.5s steps(24) forwards;
    opacity: 1;
}

/* Honeycomb Grid */
.honeycomb-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 700px;
    padding: 20px;
    z-index: 6;
    position: relative;
}

.hex-cell {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    will-change: transform;
    contain: layout;
}

.hex-cell:nth-child(even) {
    margin-top: 30px;
}

.hex-cell .badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(-60px) rotate(15deg);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.hex-cell .badge-item.landed {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

.hex-cell .badge-svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(2px 3px 4px rgba(0,0,0,0.35));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.hex-cell .badge-item:hover .badge-svg {
    transform: translateY(-8px);
    filter: drop-shadow(4px 8px 12px rgba(0,0,0,0.4));
}

.hex-cell .badge-item:hover .badge-name {
    opacity: 1;
    transform: translateY(0);
}

/* Badge shimmer on hover */
.hex-cell .badge-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(232, 212, 139, 0.2) 50%,
        transparent 70%
    );
    transition: left 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.hex-cell .badge-item:hover::after {
    left: 100%;
}

.badge-name {
    font-size: 0.7rem;
    color: #E8D48B;
    letter-spacing: 0.12em;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.featured .badge-name {
    font-size: 1.2rem;
    opacity: 0;
    color: #C9A84C;
    margin-top: 4px;
}

.featured .badge-name.visible {
    opacity: 1;
}

/* Achievement burst particles */
.achievement-burst {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFD166;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
}

.achievement-burst.active {
    animation: burstOut 0.8s ease-out forwards;
}

@keyframes burstOut {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--burst-x), var(--burst-y)) scale(0); opacity: 0; }
}

/* Earned badge glow */
.badge-item.earned {
    box-shadow: 0 0 20px rgba(255, 209, 102, 0.3);
    border-radius: 50%;
}

/* ===== SECTION 2: THE SASH ===== */
#sash {
    background: #0F0F12;
    min-height: 200vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10vh;
    position: relative;
}

.sash-title {
    position: relative;
    z-index: 5;
    margin-bottom: 40px;
}

.sash-background {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 160vh;
}

.sash-fabric {
    position: relative;
    width: 320px;
    min-height: 150vh;
    /* Diagonal sash band */
    background: #1B4332;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(27, 67, 50, 0.85) 0px,
            rgba(20, 50, 38, 0.9) 1px,
            transparent 1px,
            transparent 3px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(27, 67, 50, 0.85) 0px,
            rgba(20, 50, 38, 0.9) 1px,
            transparent 1px,
            transparent 3px
        );
    background-size: 4px 4px;
    transform: rotate(-8deg);
    transform-origin: top center;
    border-left: 4px solid #C9A84C;
    border-right: 4px solid #C9A84C;
    box-shadow: 8px 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.sash-badges {
    display: flex;
    flex-direction: column;
    gap: 80px;
    align-items: center;
    transform: rotate(8deg);
}

.sash-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    cursor: pointer;
}

.sash-badge-item:nth-child(even) {
    transform: translateX(40px);
}

.sash-badge-item.revealed {
    opacity: 1;
    transform: translateX(0);
}

.sash-badge-item .badge-svg {
    width: 110px;
    height: 110px;
    filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.4));
    transition: transform 0.3s ease;
}

.sash-badge-item:hover .badge-svg {
    transform: translateY(-8px) scale(1.05);
}

.sash-badge-item .badge-name {
    opacity: 1;
    transform: none;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #E8D48B;
}

.stitch-line {
    width: 80px;
    height: 20px;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.stitch-line path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1s ease;
}

.sash-badge-item.revealed .stitch-line path {
    stroke-dashoffset: 0;
}

/* ===== SECTION 3: THE VITRINE ===== */
#vitrine {
    background: #0F0F12;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    position: relative;
}

.vitrine-title {
    margin-bottom: 50px;
}

.vitrine-case {
    position: relative;
    max-width: 1000px;
    width: 100%;
    padding: 60px 40px;
    background:
        linear-gradient(145deg, rgba(27, 67, 50, 0.15), rgba(15, 15, 18, 0.9));
    border: 2px solid rgba(184, 192, 204, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.glass-surface {
    position: absolute;
    inset: 0;
    background: rgba(184, 192, 204, 0.03);
    backdrop-filter: blur(1px);
    pointer-events: none;
    z-index: 3;
    border-radius: 12px;
}

.glass-reflection {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255, 255, 255, 0.02) 100%
    );
    pointer-events: none;
    z-index: 4;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.5s ease;
}

.glass-reflection.shimmer {
    opacity: 1;
    animation: glassShimmer 2s ease-in-out;
}

@keyframes glassShimmer {
    0% { background-position: -200% 0; opacity: 0; }
    30% { opacity: 1; }
    100% { background-position: 200% 0; opacity: 0; }
}

.vitrine-interior {
    position: relative;
    z-index: 2;
}

.vitrine-badge-row {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.vitrine-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.vitrine-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.badge-display {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.badge-display:hover {
    transform: translateY(-8px);
}

.badge-display .badge-svg {
    width: 140px;
    height: 140px;
    filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.35));
}

.vitrine-plaque {
    background: linear-gradient(135deg, #C9A84C 0%, #E8D48B 50%, #A07C35 100%);
    padding: 16px 24px;
    border-radius: 4px;
    text-align: center;
    max-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.vitrine-plaque h3 {
    font-size: 1.1rem;
    color: #0F0F12;
    margin-bottom: 6px;
}

.vitrine-plaque p {
    font-size: 0.8rem;
    color: #0F0F12;
    line-height: 1.4;
    margin-bottom: 8px;
}

.vitrine-plaque .serial {
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: #6B4226;
    display: block;
}

/* ===== SECTION 4: THE WORKSHOP ===== */
#workshop {
    background: #0F0F12;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    position: relative;
    transform-origin: top center;
}

.workshop-title {
    margin-bottom: 10px;
}

.workshop-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    font-weight: 400;
    color: #B8C0CC;
    margin-bottom: 50px;
    text-align: center;
}

.workshop-bench {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 80px;
    max-width: 900px;
}

/* Card flip */
.workshop-card {
    width: 180px;
    height: 240px;
    perspective: 800px;
    cursor: pointer;
}

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

.workshop-card[data-flip="true"] .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-front {
    background: linear-gradient(145deg, rgba(27, 67, 50, 0.3), rgba(15, 15, 18, 0.95));
    border: 2px solid rgba(201, 168, 76, 0.4);
}

.card-front .badge-svg {
    width: 140px;
    height: 140px;
    filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.35));
}

.card-back {
    background: linear-gradient(135deg, #C9A84C 0%, #E8D48B 40%, #A07C35 100%);
    border: 2px solid #6B4226;
    transform: rotateY(180deg);
    padding: 20px;
}

.back-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.manufacturer-mark {
    margin-bottom: 4px;
}

.back-content h4 {
    font-size: 1rem;
    color: #0F0F12;
    letter-spacing: 0.1em;
}

.spec-line {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.65rem;
    color: #0F0F12;
    border-bottom: 1px solid rgba(107, 66, 38, 0.2);
    padding-bottom: 3px;
}

.spec-label {
    color: #6B4226;
    font-size: 0.6rem;
}

.spec-value {
    color: #0F0F12;
    font-size: 0.6rem;
}

/* Workshop stages */
.workshop-stages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.stage-disc {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #C9A84C;
    transition: transform 0.3s ease;
}

.stage-disc:hover {
    transform: scale(1.1);
}

.stage-disc.blank {
    background: linear-gradient(135deg, #B8C0CC 0%, #D8DCE3 50%, #9BA3B0 100%);
}

.stage-disc.stamped {
    background: linear-gradient(135deg, #B8C0CC 0%, #D8DCE3 50%, #9BA3B0 100%);
    box-shadow: inset 0 0 0 8px rgba(15, 15, 18, 0.15);
}

.stage-disc.filled {
    background: linear-gradient(135deg, #B8C0CC 0%, #D8DCE3 50%, #9BA3B0 100%);
    box-shadow: inset 0 0 0 8px #1D3461;
}

.stage-disc.polished {
    background: linear-gradient(135deg, #C9A84C 0%, #E8D48B 50%, #A07C35 100%);
    box-shadow: inset 0 0 0 8px #1D3461, 0 0 15px rgba(255, 209, 102, 0.3);
}

.stage-label {
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: #C9A84C;
    letter-spacing: 0.1em;
}

.stage-arrow {
    font-size: 1.8rem;
    color: #C9A84C;
    margin-top: -20px;
}

/* ===== ENAMEL COLORS ===== */
.enamel-red { color: #C1292E; }
.enamel-blue { color: #1D3461; }

/* ===== METAL TEXTURE SYSTEM ===== */

/* Polished brass gradient */
.metal-brass {
    background: linear-gradient(135deg, #C9A84C 0%, #E8D48B 50%, #A07C35 100%);
}

/* Brushed silver */
.metal-silver {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(184, 192, 204, 0.1) 0px,
            transparent 1px,
            transparent 2px
        ),
        linear-gradient(135deg, #B8C0CC 0%, #D8DCE3 50%, #9BA3B0 100%);
}

/* Antique bronze */
.metal-bronze {
    background: radial-gradient(circle at center, #6B4226 0%, #8B6914 100%);
}

/* ===== SVG PATH DRAWING ===== */
.badge-border {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.badge-border.draw {
    animation: drawBorder 1.5s ease-out forwards;
}

@keyframes drawBorder {
    to { stroke-dashoffset: 0; }
}

.badge-enamel {
    opacity: 0;
    transform-origin: center;
}

.badge-enamel.fill {
    animation: enamelfill 0.8s ease-out 1.5s forwards;
}

@keyframes enamelfill {
    0% { opacity: 0; transform: scale(0.3); }
    100% { opacity: 1; transform: scale(1); }
}

.badge-inner-detail {
    opacity: 0;
}

.badge-inner-detail.fill {
    animation: enamelfill 0.6s ease-out 1.8s forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #nav-strip {
        left: auto;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid rgba(201, 168, 76, 0.3);
        border-radius: 8px 8px 0 0;
        width: 100%;
        justify-content: center;
        padding: 8px 16px;
    }

    .honeycomb-grid {
        max-width: 360px;
        gap: 4px;
    }

    .hex-cell {
        width: 85px;
        height: 85px;
    }

    .hex-cell .badge-svg {
        width: 60px;
        height: 60px;
    }

    .badge-slot.featured .badge-svg {
        width: 140px;
        height: 140px;
    }

    .sash-fabric {
        width: 220px;
    }

    .sash-badge-item .badge-svg {
        width: 80px;
        height: 80px;
    }

    .vitrine-badge-row {
        gap: 30px;
    }

    .badge-display .badge-svg {
        width: 100px;
        height: 100px;
    }

    .vitrine-plaque {
        max-width: 160px;
        padding: 10px 14px;
    }

    .workshop-bench {
        gap: 20px;
    }

    .workshop-card {
        width: 150px;
        height: 200px;
    }

    .card-front .badge-svg {
        width: 110px;
        height: 110px;
    }

    .workshop-stages {
        gap: 12px;
    }

    .stage-disc {
        width: 50px;
        height: 50px;
    }

    .stage-arrow {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hex-cell {
        width: 70px;
        height: 70px;
    }

    .hex-cell .badge-svg {
        width: 50px;
        height: 50px;
    }

    .vitrine-badge-row {
        flex-direction: column;
        align-items: center;
    }

    .workshop-bench {
        flex-direction: column;
        align-items: center;
    }

    .workshop-card {
        width: 180px;
        height: 240px;
    }
}
