:root {
    --bg-main: #0f0f0f;
    --card-bg: rgba(20, 20, 23, 0.82);
    --card-border: rgba(255, 255, 255, 0.08);
    --btn-bg: rgba(255, 255, 255, 0.04);
    --btn-border: rgba(255, 255, 255, 0.08);
    --text-bright: #f4f4f5;
    --text-muted: #a1a1aa;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-bright);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    position: relative;
    overflow-x: hidden;
}

/* --- Background Framework --- */
.bg-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.card-backlight {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.16) 0%, rgba(15, 15, 15, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseBacklight 8s ease-in-out infinite alternate;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.65;
    transition: transform 0.2s ease-out;
}

.orb-1 {
    width: 420px;
    height: 420px;
    background: rgba(56, 189, 248, 0.3);
    top: 15%;
    left: 15%;
    animation: floatOrb1 12s ease-in-out infinite alternate;
}

.orb-2 {
    width: 480px;
    height: 480px;
    background: rgba(168, 85, 247, 0.25);
    bottom: 15%;
    right: 15%;
    animation: floatOrb2 16s ease-in-out infinite alternate;
}

.dust-cloud {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(200, 215, 255, 0.035) 0%, transparent 65%);
    filter: blur(50px);
    animation: pulseDustCloud 14s ease-in-out infinite alternate;
}

.bg-grid {
    position: absolute;
    inset: -100px;
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    animation: driftGrid 25s linear infinite;
}

.particles-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

@keyframes pulseBacklight {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

@keyframes floatOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(120px, 90px) scale(1.15); }
    100% { transform: translate(-70px, 110px) scale(0.9); }
}

@keyframes floatOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-130px, -90px) scale(1.2); }
    100% { transform: translate(90px, -70px) scale(0.85); }
}

@keyframes pulseDustCloud {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.1); opacity: 0.9; }
}

@keyframes driftGrid {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* --- Main Card Container --- */
.card-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* --- Header --- */
.header {
    text-align: center;
}

.name {
    font-size: 2.05rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.role {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-weight: 400;
}

/* --- Skills Section --- */
.skills {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1.25rem;
}

.section-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

/* Uniform Stacked Layout for Skill Rows (Desktop & Mobile) */
.skill-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.skill-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
}

.skill-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.badge-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

/* --- Skill Legend Grid (Desktop: 5 columns) --- */
.skill-legend {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
    margin-top: 0.4rem;
    padding-top: 0.85rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    width: 100%;
}

.skill-legend .badge {
    font-size: 0.5rem;
    padding: 0.25rem 0.02rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* --- Base Badge Colors --- */
.badge {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: 6px;
    text-transform: uppercase;
}

.skill-row .badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
}

.badge.beginner {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.badge.intermediate {
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.2);
}

.badge.proficient {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge.advanced {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.badge.expert {
    background: rgba(192, 132, 252, 0.1);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.2);
}

/* --- Action Buttons Grid --- */
.links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 10px;
    padding: 0.9rem;
    color: var(--text-bright);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.span-full {
    grid-column: span 2;
}

.icon {
    opacity: 0.85;
}

/* --- Mobile Responsive Fixes (< 480px) --- */
@media (max-width: 480px) {
    body {
        padding: 0.75rem;
        align-items: flex-start;
        overflow-y: auto;
    }

    .card-container {
        padding: 1.5rem 1.15rem;
        gap: 1.25rem;
        margin: auto 0;
    }

    .name {
        font-size: 1.75rem;
    }

    .role {
        font-size: 0.95rem;
    }

    .skill-row .badge {
        font-size: 0.68rem;
        padding: 0.15rem 0.5rem;
    }

    /* 2-Column Grid Layout for Skill Legend on Mobile:
       Row 1: Beginner | Intermediate
       Row 2: Proficient | Advanced
       Row 3: Expert (Centered) */
    .skill-legend {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .skill-legend .badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.4rem;
        width: 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .skill-legend .badge:nth-child(5) {
        grid-column: span 2;
        max-width: 60%;
        margin: 0 auto;
    }
}