/* KarmaBadge — Neomorphic Chrome Design System */
/* Fonts: Outfit (headlines), Inter (body), DM Mono (data) */

:root {
    --gunmetal-void: #1a1d23;
    --titanium-slab: #2a2d35;
    --aluminum-rise: #363a44;
    --brushed-silver: #6b7080;
    --polished-steel: #e8eaed;
    --oxidized-mint: #6ee7b7;
    --mint-halo: #34d399;
    --carbon-depth: #12141a;
    --chrome-flash: #ffffff;
    --panel-gradient-start: #2a2d35;
    --panel-gradient-end: #22252b;
    --mid-chrome-gray: #a0a4ad;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    background: var(--gunmetal-void);
    color: var(--polished-steel);
    overflow-x: hidden;
    line-height: 1.65;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ========== NAVIGATION ========== */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(38, 41, 48, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-48px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#main-nav.visible {
    opacity: 1;
    transform: translateY(0);
}

.nav-inner {
    display: flex;
    gap: 1rem;
}

.nav-pill {
    font-family: 'Outfit', sans-serif;
    font-variation-settings: 'wght' 500;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: var(--brushed-silver);
    text-decoration: none;
    padding: 6px 18px;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--aluminum-rise), var(--titanium-slab));
    box-shadow: -4px -4px 8px rgba(255, 255, 255, 0.05), 4px 4px 8px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-pill:hover {
    color: var(--polished-steel);
}

.nav-pill.active {
    color: var(--oxidized-mint);
    border-bottom-color: var(--oxidized-mint);
}

/* ========== PANEL BASE ========== */
.panel {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--panel-gradient-start), var(--panel-gradient-end));
    box-shadow: -12px -12px 24px rgba(255, 255, 255, 0.07), 12px 12px 24px rgba(0, 0, 0, 0.35);
}

.panel-content {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 6rem);
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-variation-settings: 'wght' 700;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: -0.02em;
    color: var(--polished-steel);
    text-align: center;
    margin-bottom: 3rem;
}

/* Chrome accent dividers */
.chrome-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--brushed-silver) 20%, var(--brushed-silver) 80%, transparent 100%);
    margin: 2rem 0;
}

/* ========== PANEL 1: THE VAULT DOOR ========== */
.vault-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.badge-container {
    position: relative;
    perspective: 800px;
}

.badge-container.badge-large {
    width: 400px;
    height: 400px;
    margin-bottom: 3rem;
}

.badge-outer {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 3px solid var(--brushed-silver);
    background: radial-gradient(circle, var(--aluminum-rise) 0%, var(--titanium-slab) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        -8px -8px 16px rgba(255, 255, 255, 0.05),
        8px 8px 16px rgba(0, 0, 0, 0.35);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    animation: badgeSpin 20s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-inner {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    box-shadow:
        inset 6px 6px 12px rgba(0, 0, 0, 0.3),
        inset -6px -6px 12px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--titanium-slab);
}

.badge-glyph {
    font-family: 'DM Mono', monospace;
    font-size: 48px;
    color: var(--oxidized-mint);
    filter: drop-shadow(0 0 8px rgba(110, 231, 183, 0.4));
}

.karma-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.karma-ring-track {
    fill: none;
    stroke: var(--aluminum-rise);
    stroke-width: 3;
}

.karma-ring-progress {
    fill: none;
    stroke: var(--oxidized-mint);
    stroke-width: 3;
    stroke-dasharray: 879.6;
    stroke-dashoffset: 220;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(110, 231, 183, 0.4));
    transform-origin: center;
    transform: rotate(-90deg);
}

@keyframes badgeSpin {
    from { transform: translate(-50%, -50%) rotateY(0deg); }
    to { transform: translate(-50%, -50%) rotateY(360deg); }
}

.vault-title {
    font-family: 'Outfit', sans-serif;
    font-variation-settings: 'wght' 700;
    font-size: clamp(2.8rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    color: var(--polished-steel);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.vault-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--mid-chrome-gray);
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.5s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.panel.in-view .vault-title,
.panel.in-view .vault-tagline {
    opacity: 1;
    transform: translateY(0);
}

.badge-large .badge-outer {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel.in-view .badge-large .badge-outer {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: badgeSpin 20s linear infinite;
}

/* Particles */
.particles,
.particles-outer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--oxidized-mint);
    top: 50%;
    left: 50%;
    animation: particlePulse 2s ease-in-out infinite alternate;
}

@keyframes particlePulse {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

/* ========== PANEL 2: THE TAXONOMY ========== */
.taxonomy-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.taxonomy-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.taxonomy-card {
    width: 320px;
    height: 400px;
    border-radius: 24px;
    box-shadow:
        inset 6px 6px 12px rgba(0, 0, 0, 0.3),
        inset -6px -6px 12px rgba(255, 255, 255, 0.05);
    background: var(--titanium-slab);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.taxonomy-card[data-stagger="1"] { transition-delay: 0.15s; }
.taxonomy-card[data-stagger="2"] { transition-delay: 0.3s; }

.panel.in-view .taxonomy-card {
    opacity: 1;
    transform: translateY(0);
}

.badge-container.badge-small {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
}

.badge-outer.small {
    width: 100px;
    height: 100px;
    border-width: 2px;
}

.badge-inner.small {
    width: 65px;
    height: 65px;
}

.badge-glyph.small {
    font-size: 28px;
}

.badge-outer.small {
    animation: badgeSpinSlow 15s linear infinite;
}

@keyframes badgeSpinSlow {
    from { transform: translate(-50%, -50%) rotateY(0deg); }
    to { transform: translate(-50%, -50%) rotateY(360deg); }
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-variation-settings: 'wght' 600;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    letter-spacing: -0.01em;
    color: var(--polished-steel);
    margin-bottom: 0.75rem;
}

.card-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--mid-chrome-gray);
    line-height: 1.6;
}

/* ========== PANEL 3: THE FORGE ========== */
.forge-panel {
    min-height: 200vh;
    align-items: flex-start;
}

.forge-scroll-container {
    width: 100%;
    min-height: 200vh;
    position: relative;
}

.forge-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forge-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.forge-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: var(--mid-chrome-gray);
    text-align: center;
    margin-top: -2rem;
    margin-bottom: 3rem;
}

.forge-layers {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}

.forge-layer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.1s linear;
}

.layer-chip {
    width: 200px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--aluminum-rise), var(--titanium-slab));
    box-shadow:
        -6px -6px 12px rgba(255, 255, 255, 0.05),
        6px 6px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.layer-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.outer-ring-layer {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--brushed-silver);
    background: radial-gradient(circle, var(--aluminum-rise) 0%, var(--titanium-slab) 100%);
}

.icon-core-layer {
    font-family: 'DM Mono', monospace;
    font-size: 28px;
    color: var(--oxidized-mint);
}

.karma-indicator-layer {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--oxidized-mint);
    border-top-color: transparent;
    animation: indicatorSpin 2s linear infinite;
}

@keyframes indicatorSpin {
    to { transform: rotate(360deg); }
}

.score-layer {
    font-family: 'DM Mono', monospace;
    font-size: 24px;
    color: var(--oxidized-mint);
    letter-spacing: 0.06em;
}

.hash-layer {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    color: var(--brushed-silver);
    letter-spacing: 0.06em;
}

.layer-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.8rem;
    color: var(--brushed-silver);
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* ========== PANEL 4: THE LEDGER ========== */
.ledger-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ledger-column {
    position: relative;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 2rem;
}

.chrome-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, var(--brushed-silver) 15%, var(--brushed-silver) 85%, transparent 100%);
}

.chrome-line-left { left: 0; }
.chrome-line-right { right: 0; }

.ledger-event {
    display: flex;
    align-items: center;
    height: 56px;
    border-radius: 9999px;
    box-shadow:
        inset 4px 4px 8px rgba(0, 0, 0, 0.3),
        inset -4px -4px 8px rgba(255, 255, 255, 0.04);
    background: var(--titanium-slab);
    padding: 0 1.5rem;
    gap: 1rem;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ledger-event[data-stagger="1"] { transition-delay: 0.1s; }
.ledger-event[data-stagger="2"] { transition-delay: 0.2s; }
.ledger-event[data-stagger="3"] { transition-delay: 0.3s; }
.ledger-event[data-stagger="4"] { transition-delay: 0.4s; }
.ledger-event[data-stagger="5"] { transition-delay: 0.5s; }
.ledger-event[data-stagger="6"] { transition-delay: 0.6s; }

.panel.in-view .ledger-event {
    opacity: 1;
    transform: translateX(0);
}

.event-date {
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    color: var(--brushed-silver);
    letter-spacing: 0.06em;
    flex-shrink: 0;
    min-width: 85px;
}

.event-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    color: var(--polished-steel);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-karma {
    font-family: 'DM Mono', monospace;
    font-size: clamp(0.8rem, 0.95vw, 1rem);
    color: var(--oxidized-mint);
    letter-spacing: 0.06em;
    flex-shrink: 0;
    min-width: 40px;
    text-align: right;
}

/* ========== PANEL 5: THE SEAL ========== */
.seal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.badge-container.badge-hero {
    width: min(60vw, 500px);
    height: min(60vw, 500px);
    margin-bottom: 3rem;
}

.badge-outer.hero {
    width: min(50vw, 400px);
    height: min(50vw, 400px);
    border-width: 4px;
}

.badge-inner.hero {
    width: min(32vw, 260px);
    height: min(32vw, 260px);
}

.badge-glyph.hero {
    font-size: clamp(48px, 8vw, 80px);
}

.karma-ring.hero {
    width: min(55vw, 440px);
    height: min(55vw, 440px);
}

.karma-ring-progress.hero {
    stroke-dashoffset: 132;
}

.seal-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.neo-input {
    width: 400px;
    max-width: 90vw;
    height: 52px;
    border-radius: 26px;
    border: none;
    outline: none;
    padding: 0 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--polished-steel);
    background: var(--titanium-slab);
    box-shadow:
        inset 6px 6px 12px rgba(0, 0, 0, 0.3),
        inset -6px -6px 12px rgba(255, 255, 255, 0.05);
    transition: box-shadow 0.3s ease;
}

.neo-input::placeholder {
    color: var(--brushed-silver);
}

.neo-input:focus {
    box-shadow:
        inset 6px 6px 12px rgba(0, 0, 0, 0.3),
        inset -6px -6px 12px rgba(255, 255, 255, 0.05),
        0 0 0 2px var(--mint-halo);
}

.neo-button {
    width: 220px;
    height: 52px;
    border-radius: 26px;
    border: none;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-variation-settings: 'wght' 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--polished-steel);
    background: linear-gradient(145deg, var(--aluminum-rise), var(--titanium-slab));
    box-shadow:
        -6px -6px 12px rgba(255, 255, 255, 0.05),
        6px 6px 12px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease, color 0.3s ease;
}

.neo-button:hover {
    color: var(--oxidized-mint);
    box-shadow:
        -8px -8px 16px rgba(255, 255, 255, 0.08),
        8px 8px 16px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(110, 231, 183, 0.15);
}

.neo-button:active {
    box-shadow:
        inset 4px 4px 8px rgba(0, 0, 0, 0.3),
        inset -4px -4px 8px rgba(255, 255, 255, 0.04);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .taxonomy-row {
        flex-direction: column;
        align-items: center;
    }

    .taxonomy-card {
        width: 100%;
        max-width: 320px;
        height: auto;
        min-height: 300px;
    }

    .ledger-event {
        height: auto;
        min-height: 48px;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .event-desc {
        white-space: normal;
        order: 3;
        flex-basis: 100%;
        font-size: 0.8rem;
    }

    .badge-container.badge-large {
        width: 280px;
        height: 280px;
    }

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

    .badge-inner {
        width: 130px;
        height: 130px;
    }

    .karma-ring {
        width: 220px;
        height: 220px;
    }
}
