/* ========================================
   badge.bar - Skeuomorphic Badge Workshop
   ======================================== */

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

html, body {
    height: 100%;
    overflow: hidden;
    background: #2B2520;
    color: #F5F0E8;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.7;
}

/* --- Typography --- */
h1, h2, h3, .section-heading, .stamp-name, .badge-label, .db-label, .quality-label, .engraved-label {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.engraved-text, .stamp-instruction, .quality-desc, .display-caption {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
}

.embossed-subtitle, .badge-face, .felt-badge {
    font-family: 'Cutive Mono', monospace;
}

/* --- Scroll Container --- */
#scroll-container {
    display: flex;
    height: 100vh;
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* --- Panel Base --- */
.panel {
    position: relative;
    min-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    position: relative;
    z-index: 2;
    width: 80%;
    max-width: 900px;
    text-align: center;
}

/* --- Bokeh Backgrounds --- */
.bokeh-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    animation: drift 20s ease-in-out alternate infinite;
}

.bokeh-warm {
    background:
        radial-gradient(circle 80px at 15% 25%, rgba(200, 150, 62, 0.14), transparent 70%),
        radial-gradient(circle 60px at 70% 60%, rgba(200, 150, 62, 0.10), transparent 70%),
        radial-gradient(circle 100px at 40% 80%, rgba(200, 150, 62, 0.12), transparent 70%),
        radial-gradient(circle 50px at 85% 20%, rgba(200, 150, 62, 0.08), transparent 70%),
        radial-gradient(circle 120px at 25% 65%, rgba(200, 150, 62, 0.11), transparent 70%),
        radial-gradient(circle 70px at 60% 15%, rgba(62, 122, 140, 0.06), transparent 70%),
        radial-gradient(circle 90px at 50% 45%, rgba(200, 150, 62, 0.13), transparent 70%),
        radial-gradient(circle 45px at 90% 75%, rgba(200, 150, 62, 0.09), transparent 70%),
        radial-gradient(circle 110px at 10% 50%, rgba(212, 135, 75, 0.10), transparent 70%),
        radial-gradient(circle 65px at 75% 40%, rgba(200, 150, 62, 0.07), transparent 70%);
}

.bokeh-mixed {
    background:
        radial-gradient(circle 90px at 20% 30%, rgba(200, 150, 62, 0.12), transparent 70%),
        radial-gradient(circle 70px at 65% 70%, rgba(62, 122, 140, 0.11), transparent 70%),
        radial-gradient(circle 110px at 45% 20%, rgba(200, 150, 62, 0.09), transparent 70%),
        radial-gradient(circle 55px at 80% 45%, rgba(62, 122, 140, 0.13), transparent 70%),
        radial-gradient(circle 85px at 30% 75%, rgba(212, 135, 75, 0.10), transparent 70%),
        radial-gradient(circle 100px at 55% 55%, rgba(62, 122, 140, 0.08), transparent 70%),
        radial-gradient(circle 60px at 10% 60%, rgba(200, 150, 62, 0.11), transparent 70%),
        radial-gradient(circle 75px at 90% 25%, rgba(62, 122, 140, 0.10), transparent 70%),
        radial-gradient(circle 40px at 50% 85%, rgba(200, 150, 62, 0.07), transparent 70%),
        radial-gradient(circle 95px at 70% 15%, rgba(212, 135, 75, 0.09), transparent 70%);
}

.bokeh-cool {
    background:
        radial-gradient(circle 100px at 25% 35%, rgba(62, 122, 140, 0.15), transparent 70%),
        radial-gradient(circle 70px at 60% 65%, rgba(62, 122, 140, 0.12), transparent 70%),
        radial-gradient(circle 80px at 80% 25%, rgba(62, 122, 140, 0.10), transparent 70%),
        radial-gradient(circle 120px at 40% 75%, rgba(62, 122, 140, 0.13), transparent 70%),
        radial-gradient(circle 50px at 15% 80%, rgba(200, 150, 62, 0.07), transparent 70%),
        radial-gradient(circle 90px at 70% 40%, rgba(62, 122, 140, 0.11), transparent 70%),
        radial-gradient(circle 60px at 50% 15%, rgba(62, 122, 140, 0.09), transparent 70%),
        radial-gradient(circle 110px at 90% 60%, rgba(62, 122, 140, 0.14), transparent 70%),
        radial-gradient(circle 45px at 35% 50%, rgba(200, 150, 62, 0.06), transparent 70%),
        radial-gradient(circle 75px at 10% 20%, rgba(62, 122, 140, 0.08), transparent 70%);
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(15px, -10px); }
}

/* --- Grid Overlay --- */
.grid-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='none' stroke='%236B6158' stroke-width='0.5' opacity='0.07'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Crect width='200' height='200' fill='none' stroke='%236B6158' stroke-width='1' opacity='0.12'/%3E%3C/svg%3E");
    background-size: 40px 40px, 200px 200px;
}

/* --- Rivets --- */
.rivet {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #D4C8B8, #8A8078 60%, #5A534C);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
    z-index: 5;
}
.rivet-tl { top: 12px; left: 12px; }
.rivet-tr { top: 12px; right: 12px; }
.rivet-bl { bottom: 12px; left: 12px; }
.rivet-br { bottom: 12px; right: 12px; }

/* --- Brushed Metal Texture --- */
.metal-plate,
.workbench-surface,
.stamp-face,
.engraving-surface,
.display-case {
    background:
        repeating-linear-gradient(
            90deg,
            rgba(196, 192, 182, 0.03) 0px,
            rgba(184, 180, 170, 0.05) 1px,
            transparent 1px,
            transparent 3px
        ),
        linear-gradient(180deg, #C4C0B6 0%, #B8B4AA 100%);
}

/* --- Embossed Text --- */
.embossed-title,
.embossed-subtitle,
.engraved-label,
.engraved-text {
    text-shadow:
        1px 1px 0 rgba(255,255,255,0.4),
        -1px -1px 0 rgba(0,0,0,0.3);
    color: #1A1714;
}

/* --- Underline Draw Animation --- */
.underline-draw {
    position: relative;
    display: inline-block;
}
.underline-draw::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: #C8963E;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.underline-draw.emphasis::after {
    height: 3px;
    background: #D4874B;
    transition-duration: 0.8s;
}
.underline-draw.visible::after {
    width: 100%;
}

/* --- Section Heading --- */
.section-heading {
    font-size: 32px;
    color: #F5F0E8;
    margin-bottom: 40px;
    letter-spacing: 0.08em;
}

/* ================================================
   PANEL 1: The Workbench (Hero)
   ================================================ */
#panel-workbench {
    background: #2B2520;
}

.workbench-surface {
    position: relative;
    width: 520px;
    max-width: 90vw;
    padding: 60px 40px;
    border-radius: 4px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.metal-plate {
    padding: 40px 30px;
    border-radius: 2px;
    box-shadow:
        inset 0 2px 4px rgba(0,0,0,0.2),
        0 1px 0 rgba(255,255,255,0.1);
}

.embossed-title {
    font-size: 48px;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    color: #1A1714;
}

.embossed-subtitle {
    font-size: 16px;
    letter-spacing: 0.15em;
    color: #6B6158;
    text-shadow:
        1px 1px 0 rgba(255,255,255,0.3),
        -1px -1px 0 rgba(0,0,0,0.2);
}

.workbench-tools {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.tool-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #D4874B, #C8963E 60%, #8A7340);
    box-shadow:
        0 3px 8px rgba(0,0,0,0.4),
        inset 0 1px 2px rgba(255,255,255,0.3);
}

.tool-stamp {
    border-radius: 4px;
    background: radial-gradient(circle at 40% 35%, #C4C0B6, #9A958D 60%, #6B6158);
}

.tool-press {
    border-radius: 2px;
    width: 50px;
    height: 35px;
    background: linear-gradient(180deg, #C4C0B6, #8A8078);
}

/* ================================================
   PANEL 2: The Lightbox
   ================================================ */
#panel-lightbox {
    background: #1A1714;
}

.lightbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.lightbox-cell {
    aspect-ratio: 1;
    background: rgba(245, 240, 232, 0.06);
    border: 1px solid rgba(245, 240, 232, 0.08);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px rgba(245, 240, 232, 0.03) inset;
    transition: background 0.3s ease;
}

.lightbox-cell:hover {
    background: rgba(245, 240, 232, 0.10);
}

.badge-silhouette {
    width: 70%;
    height: 70%;
    border: 2px solid rgba(200, 150, 62, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease;
}

.lightbox-cell:hover .badge-silhouette {
    border-color: rgba(200, 150, 62, 0.7);
}

.badge-circle { border-radius: 50%; }
.badge-shield {
    border-radius: 4px 4px 50% 50%;
    clip-path: polygon(50% 0%, 100% 15%, 100% 70%, 50% 100%, 0% 70%, 0% 15%);
    border: none;
    background: rgba(200, 150, 62, 0.15);
}
.badge-hex {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: none;
    background: rgba(200, 150, 62, 0.15);
}
.badge-star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border: none;
    background: rgba(200, 150, 62, 0.15);
}
.badge-oval {
    border-radius: 50%;
    width: 80%;
    height: 55%;
}
.badge-rect {
    border-radius: 3px;
    width: 75%;
    height: 50%;
}

.badge-label {
    font-size: 10px;
    letter-spacing: 0.15em;
    color: #C8963E;
    opacity: 0.7;
}

/* ================================================
   PANEL 3: The Stamp Press
   ================================================ */
#panel-stamp {
    background: #2B2520;
}

.stamp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.stamp-item {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stamp-face {
    padding: 30px 20px;
    border-radius: 4px;
    text-align: center;
    box-shadow:
        2px 2px 6px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transition: box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stamp-item:hover .stamp-face {
    box-shadow:
        inset 2px 2px 6px rgba(0,0,0,0.4),
        inset 0 -1px 0 rgba(255,255,255,0.1);
    transform: translateY(2px);
}

.stamp-item:active .stamp-face {
    box-shadow:
        inset 3px 3px 8px rgba(0,0,0,0.5),
        inset 0 -1px 0 rgba(255,255,255,0.05);
    transform: translateY(3px);
}

.stamp-icon {
    font-size: 36px;
    color: #1A1714;
    margin-bottom: 10px;
    text-shadow:
        1px 1px 0 rgba(255,255,255,0.4),
        -1px -1px 0 rgba(0,0,0,0.2);
}

.stamp-name {
    font-size: 12px;
    color: #6B6158;
    display: block;
}

.stamp-instruction {
    color: #6B6158;
    font-size: 13px;
    letter-spacing: 0.05em;
}

/* ================================================
   PANEL 4: The Felt Tray
   ================================================ */
#panel-felt {
    background: #1E3A2C;
}

.felt-surface {
    position: relative;
    width: 100%;
    height: 60vh;
    background: #2D4A3A;
    border-radius: 4px;
    box-shadow:
        inset 0 2px 8px rgba(0,0,0,0.4),
        0 4px 16px rgba(0,0,0,0.3);
    overflow: hidden;
    filter: url(#felt-noise);
}

.felt-badge {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: rotate(var(--rotate));
    transition: transform 0.3s ease;
}

.felt-badge:hover {
    transform: rotate(0deg) scale(1.1);
    z-index: 10;
}

.pin-shadow {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(2px);
}

.badge-face {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow:
        0 3px 8px rgba(0,0,0,0.4),
        inset 0 1px 2px rgba(255,255,255,0.3);
    letter-spacing: 0.05em;
}

.badge-gold {
    background: radial-gradient(circle at 40% 35%, #D4B064, #C8963E 60%, #8A7340);
    color: #1A1714;
}

.badge-blue {
    background: radial-gradient(circle at 40% 35%, #5A9AAC, #3E7A8C 60%, #2A5A6A);
    color: #F5F0E8;
}

.badge-red {
    background: radial-gradient(circle at 40% 35%, #D06050, #B8453A 60%, #8A3028);
    color: #F5F0E8;
}

.badge-silver {
    background: radial-gradient(circle at 40% 35%, #D4D0C6, #C4C0B6 60%, #9A958D);
    color: #1A1714;
}

/* ================================================
   PANEL 5: The Engraving Station
   ================================================ */
#panel-engraving {
    background: #2B2520;
}

.engraving-surface {
    padding: 50px 40px;
    border-radius: 4px;
    text-align: left;
}

.engraved-block {
    margin-bottom: 36px;
}

.engraved-block:last-child {
    margin-bottom: 0;
}

.engraved-label {
    font-size: 18px;
    margin-bottom: 12px;
    color: #1A1714;
}

.engraved-text {
    color: #6B6158;
    text-shadow:
        1px 1px 0 rgba(255,255,255,0.3),
        -1px -1px 0 rgba(0,0,0,0.15);
    max-width: 600px;
}

/* ================================================
   PANEL 6: The Quality Check
   ================================================ */
#panel-quality {
    background: #2B2520;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.quality-item {
    padding: 30px 20px;
    background: rgba(196, 192, 182, 0.06);
    border: 1px solid rgba(196, 192, 182, 0.1);
    border-radius: 4px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.quality-item:hover {
    transform: scale(1.15);
    background: rgba(196, 192, 182, 0.12);
    z-index: 5;
    position: relative;
}

.quality-icon {
    font-size: 32px;
    color: #C8963E;
    margin-bottom: 12px;
}

.quality-label {
    font-size: 14px;
    color: #F5F0E8;
    margin-bottom: 8px;
}

.quality-desc {
    font-size: 12px;
    color: #6B6158;
    line-height: 1.5;
}

/* ================================================
   PANEL 7: The Display Case
   ================================================ */
#panel-display {
    background: #1A1714;
}

.display-case {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 40px;
    background: #2B2520;
    border: 2px solid rgba(196, 192, 182, 0.15);
    border-radius: 4px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.5),
        inset 0 0 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

.glass-reflection {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        30deg,
        rgba(255,255,255,0.08) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255,255,255,0.04) 100%
    );
    z-index: 3;
    pointer-events: none;
}

.case-interior {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.display-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 12px rgba(0,0,0,0.4),
        inset 0 1px 3px rgba(255,255,255,0.2),
        0 0 0 3px rgba(196, 192, 182, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.display-badge:hover {
    transform: scale(1.08);
    box-shadow:
        0 6px 20px rgba(0,0,0,0.5),
        inset 0 1px 3px rgba(255,255,255,0.3),
        0 0 0 3px rgba(200, 150, 62, 0.3);
}

.db-1 {
    background: radial-gradient(circle at 40% 35%, #D4B064, #C8963E 60%, #8A7340);
}
.db-2 {
    background: radial-gradient(circle at 40% 35%, #5A9AAC, #3E7A8C 60%, #2A5A6A);
}
.db-3 {
    background: radial-gradient(circle at 40% 35%, #D4D0C6, #C4C0B6 60%, #9A958D);
}
.db-4 {
    background: radial-gradient(circle at 40% 35%, #D06050, #B8453A 60%, #8A3028);
}
.db-5 {
    background: radial-gradient(circle at 40% 35%, #E8C070, #D4874B 60%, #A06030);
}

.db-label {
    font-size: 10px;
    letter-spacing: 0.15em;
    color: #F5F0E8;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.db-1 .db-label,
.db-3 .db-label {
    color: #1A1714;
    text-shadow: 0 1px 1px rgba(255,255,255,0.3);
}

.display-caption {
    margin-top: 30px;
    color: #6B6158;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-align: center;
}

/* ================================================
   Progress Rail
   ================================================ */
#progress-rail {
    position: fixed;
    bottom: 24px;
    left: 10vw;
    right: 10vw;
    z-index: 100;
}

.rail-track {
    position: relative;
    height: 4px;
    background: #6B6158;
    border-radius: 2px;
    display: flex;
    align-items: center;
}

.rail-indicator {
    position: absolute;
    width: 16px;
    height: 8px;
    background: #C8963E;
    border-radius: 2px;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    transition: left 0.3s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    z-index: 2;
}

.rail-anchor {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #C4C0B6;
    border: none;
    cursor: pointer;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.rail-anchor:hover {
    background: #D4874B;
    transform: translateY(-50%) scale(1.5);
}

/* Position anchors evenly */
.rail-anchor[data-panel="0"] { left: 0%; }
.rail-anchor[data-panel="1"] { left: 16.666%; }
.rail-anchor[data-panel="2"] { left: 33.333%; }
.rail-anchor[data-panel="3"] { left: 50%; }
.rail-anchor[data-panel="4"] { left: 66.666%; }
.rail-anchor[data-panel="5"] { left: 83.333%; }
.rail-anchor[data-panel="6"] { left: 100%; }

/* ================================================
   Responsive
   ================================================ */
@media (max-width: 768px) {
    .embossed-title {
        font-size: 32px;
    }

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

    .lightbox-grid,
    .stamp-grid,
    .quality-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .workbench-surface {
        width: 90vw;
        padding: 40px 24px;
    }

    .engraving-surface {
        padding: 30px 20px;
    }

    .case-interior {
        gap: 16px;
    }

    .display-badge {
        width: 60px;
        height: 60px;
    }

    .panel-content {
        width: 90%;
    }

    .felt-badge .badge-face {
        width: 48px;
        height: 48px;
        font-size: 11px;
    }
}
