/* mybadge.id - Corporate Constellation Vault */

:root {
    --deep-vault: #0d0b1e;
    --midnight-indigo: #161233;
    --cosmic-plum: #1a0a3e;
    --emerald-depth: #0a2e1e;
    --violet-primary: #8b5cf6;
    --lavender-mist: #a78bfa;
    --amber-accent: #fbbf24;
    --crimson-accent: #e11d48;
    --silver-frost: #e2e0ef;
    --emerald-glow: #10B981;
    --muted-lavender: #8B85A8;
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-ui: 'Space Grotesk', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-vault);
    color: var(--silver-frost);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   Section 1: The Vault Door (Hero)
   ============================================ */

.section-vault {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--midnight-indigo) 0%, var(--deep-vault) 70%);
    overflow: hidden;
}

.particle-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.particle-field .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--lavender-mist);
    border-radius: 50%;
    opacity: 0;
    animation: particleDrift 6s ease-in-out infinite;
}

@keyframes particleDrift {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    50% { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(-80px) scale(1.2); }
}

/* Identity Ring */
.identity-ring {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    animation: ringFadeIn 1.2s ease-out 0.3s forwards;
}

@keyframes ringFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.ring-border {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--violet-primary);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2), inset 0 0 30px rgba(139, 92, 246, 0.1);
    animation: ringPulse 4s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.2), inset 0 0 30px rgba(139, 92, 246, 0.1); }
    50% { box-shadow: 0 0 50px rgba(139, 92, 246, 0.35), inset 0 0 50px rgba(139, 92, 246, 0.15); }
}

.ring-content {
    text-align: center;
    z-index: 1;
}

.identity-name {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--silver-frost);
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.identity-tagline {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--lavender-mist);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 8px;
    opacity: 0;
    animation: taglineFade 1s ease-out 1.5s forwards;
}

@keyframes taglineFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 0.8; transform: translateY(0); }
}

/* Orbital Hex Badges */
.orbital-badges {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hex-badge {
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: auto;
    opacity: 0;
    animation: hexAppear 0.6s ease-out forwards;
}

.hex-badge:nth-child(1) { top: 10%; left: 50%; transform: translateX(-50%); animation-delay: 0.8s; }
.hex-badge:nth-child(2) { top: 25%; right: 12%; animation-delay: 1.0s; }
.hex-badge:nth-child(3) { bottom: 25%; right: 12%; animation-delay: 1.2s; }
.hex-badge:nth-child(4) { bottom: 10%; left: 50%; transform: translateX(-50%); animation-delay: 1.4s; }
.hex-badge:nth-child(5) { bottom: 25%; left: 12%; animation-delay: 1.6s; }
.hex-badge:nth-child(6) { top: 25%; left: 12%; animation-delay: 1.8s; }

@keyframes hexAppear {
    from { opacity: 0; transform: scale(0.5) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.hex-badge:nth-child(1) {
    animation-name: hexAppear1;
}
@keyframes hexAppear1 {
    from { opacity: 0; transform: translateX(-50%) scale(0.5); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}
.hex-badge:nth-child(4) {
    animation-name: hexAppear4;
}
@keyframes hexAppear4 {
    from { opacity: 0; transform: translateX(-50%) scale(0.5); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}

.hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.hex-inner:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: var(--violet-primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.badge-icon {
    width: 36px;
    height: 36px;
    color: var(--lavender-mist);
    margin-bottom: 4px;
}

.hex-inner:hover .badge-icon {
    color: var(--violet-primary);
}

.badge-label {
    font-family: var(--font-ui);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-lavender);
    opacity: 0.7;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 3;
    opacity: 0;
    animation: scrollFade 1s ease-out 2.5s forwards;
}

@keyframes scrollFade {
    from { opacity: 0; }
    to { opacity: 0.6; }
}

.scroll-indicator span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--lavender-mist);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 16px;
    height: 16px;
    border-right: 1.5px solid var(--lavender-mist);
    border-bottom: 1.5px solid var(--lavender-mist);
    transform: rotate(45deg);
    animation: arrowBounce 2s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(6px); }
}

/* ============================================
   Section 2: Credential Gallery
   ============================================ */

.section-gallery {
    min-height: 100vh;
    padding: 80px 5%;
    background: linear-gradient(180deg, var(--deep-vault) 0%, var(--midnight-indigo) 50%, var(--cosmic-plum) 100%);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--silver-frost);
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: 0.05em;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Credential Panel */
.credential-panel {
    background: rgba(22, 18, 51, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.credential-panel:hover {
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 4px 30px rgba(139, 92, 246, 0.1);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.panel-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.panel-icon svg {
    width: 100%;
    height: 100%;
    color: var(--violet-primary);
}

.panel-title {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    color: var(--silver-frost);
    flex: 1;
    letter-spacing: 0.03em;
}

.panel-toggle {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.toggle-line {
    display: block;
    width: 12px;
    height: 2px;
    background: var(--lavender-mist);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease;
}

.toggle-line::after {
    content: '';
    display: block;
    width: 12px;
    height: 2px;
    background: var(--lavender-mist);
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
}

.credential-panel.expanded .toggle-line::after {
    transform: rotate(0deg);
}

/* Panel Content */
.panel-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 24px;
}

.credential-panel.expanded .panel-content {
    max-height: 600px;
    padding: 16px 24px 24px;
}

/* Credential Items */
.credential-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.06);
}

.credential-item:last-child {
    border-bottom: none;
}

.cred-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--violet-primary);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
    flex-shrink: 0;
}

.cred-dot.achievement {
    background: var(--amber-accent);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.cred-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cred-name {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--silver-frost);
    font-weight: 400;
}

.cred-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--lavender-mist);
    opacity: 0.6;
}

.cred-status {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.cred-status.verified {
    background: rgba(16, 185, 129, 0.12);
    color: var(--emerald-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.cred-status.achievement {
    background: rgba(251, 191, 36, 0.12);
    color: var(--amber-accent);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Reputation Meters */
.reputation-meter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.meter-label {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--silver-frost);
    width: 130px;
    flex-shrink: 0;
}

.meter-bar {
    flex: 1;
    height: 6px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--violet-primary), var(--lavender-mist));
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.meter-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--lavender-mist);
    width: 55px;
    text-align: right;
    flex-shrink: 0;
}

/* Timeline */
.timeline-track {
    position: relative;
    padding-left: 20px;
}

.timeline-track::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(139, 92, 246, 0.2);
}

.timeline-event {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 0;
    position: relative;
}

.event-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--crimson-accent);
    border: 2px solid var(--deep-vault);
    position: absolute;
    left: -20px;
    top: 14px;
    box-shadow: 0 0 8px rgba(225, 29, 72, 0.3);
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.event-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--crimson-accent);
    letter-spacing: 0.05em;
}

.event-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--silver-frost);
    opacity: 0.85;
}

/* ============================================
   Section 3: Constellation Map
   ============================================ */

.section-constellation {
    min-height: 60vh;
    padding: 80px 5% 40px;
    background: linear-gradient(180deg, var(--cosmic-plum) 0%, var(--deep-vault) 100%);
}

.constellation-viewport {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.constellation-svg {
    width: 100%;
    height: auto;
    display: block;
}

.constellation-svg .star {
    transition: r 0.3s ease;
    cursor: pointer;
}

.constellation-svg .star:hover {
    filter: url(#glow);
}

.constellation-svg .line {
    stroke: rgba(139, 92, 246, 0.15);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.constellation-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--silver-frost);
    opacity: 0.7;
    letter-spacing: 0.05em;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Footer */
.site-footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--violet-primary);
    letter-spacing: 0.05em;
}

.footer-divider {
    color: rgba(139, 92, 246, 0.3);
}

.footer-tagline {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--lavender-mist);
    opacity: 0.6;
}

/* ============================================
   Starburst effect on badge hover
   ============================================ */
.starburst {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.starburst-line {
    position: absolute;
    width: 1px;
    height: 6px;
    background: var(--violet-primary);
    top: 50%;
    left: 50%;
    opacity: 0;
    animation: starburstFire 300ms ease-out forwards;
}

@keyframes starburstFire {
    0% { opacity: 0.8; transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0); }
    100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-12px); }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .identity-ring {
        width: 240px;
        height: 240px;
    }

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

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

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

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

    .section-gallery {
        padding: 60px 4%;
    }

    .constellation-legend {
        gap: 16px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .hex-badge:nth-child(2),
    .hex-badge:nth-child(3),
    .hex-badge:nth-child(5),
    .hex-badge:nth-child(6) {
        display: none;
    }

    .identity-ring {
        width: 200px;
        height: 200px;
    }
}
