:root {
    --bg-color: #0d0d0d;
    --card-bg-color: rgba(255, 255, 255, 0.05);
    --card-border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent-blue: #00aaff;
    --accent-purple: #8A2BE2;
    --accent-pink: #FF007F;
    --accent-orange: #F59E0B;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem;
    overflow-y: auto;
    cursor: none;
}

.custom-cursor {
    width: 25px;
    height: 25px;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    width: 40px;
    height: 40px;
    background-color: var(--text-primary);
}

.background-aurora {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    overflow: hidden;
    z-index: -1;
    transition: transform 0.5s ease-out;
}

.aurora-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: var(--accent-blue);
    top: -10%;
    left: -10%;
    animation: move 10s infinite alternate;
}

.shape2 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    bottom: -15%;
    right: -15%;
    animation: move 13s infinite alternate-reverse;
}

.shape3 {
    width: 300px;
    height: 300px;
    background: var(--accent-pink);
    bottom: 20%;
    left: 20%;
    animation: move 8s infinite alternate;
}

@keyframes move {
    from { transform: translate(0, 0) rotate(0deg) scale(1); }
    to { transform: translate(100px, 50px) rotate(180deg) scale(1.2); }
}

/* Language Selector Modal */
.language-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.language-selector-overlay.show {
    opacity: 1;
}

.language-selector-overlay.fade-out {
    opacity: 0;
}

.language-selector-modal {
    background: var(--card-bg-color);
    border: 2px solid var(--card-border-color);
    border-radius: 2rem;
    padding: 3rem 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.8) translateY(50px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.language-selector-overlay.show .language-selector-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.language-selector-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

.language-options {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.language-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--card-border-color);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.language-option:hover::before {
    left: 100%;
}

.language-option:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 170, 255, 0.3);
}

.language-option:nth-child(2):hover {
    border-color: var(--accent-orange);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.language-option:nth-child(3):hover {
    border-color: var(--accent-pink);
    box-shadow: 0 10px 30px rgba(255, 0, 127, 0.3);
}

.language-flag {
    font-size: 4rem;
    line-height: 1;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.language-option:hover .language-flag {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.language-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: 1fr;
    column-gap: 1rem;
    row-gap: 0.5rem;
    width: 100%;
    max-width: 1400px;
    padding: 1rem;
}

.bento-item {
    background: var(--card-bg-color);
    border: 1px solid var(--card-border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.bento-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.bento-column.column-left {
    grid-column: 1 / 4;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.bento-column.column-right {
    grid-column: 4 / 7;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.bento-column.column-tools {
    grid-column: 7 / 10;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 90vh;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.bento-column.column-tools::-webkit-scrollbar { width: 8px; }
.bento-column.column-tools::-webkit-scrollbar-track { background: transparent; }
.bento-column.column-tools::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.2); border-radius: 10px; border: 2px solid transparent; background-clip: content-box;}
.bento-column.column-tools::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.4); }

.card-tool {
    padding: 1rem;
    overflow: hidden;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.card-tool-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    overflow: hidden;
}

.card-tool-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.card-tool:hover .card-tool-image img {
    transform: scale(1.1);
}

.card-tool:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 0 4px 0px var(--accent-orange);
}

.card-tool-content {
    padding: 0;
    flex-grow: 1;
}

.card-tool-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.card-tool-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

.card-tool-button {
    text-decoration: none;
    color: var(--text-primary);
    background: var(--accent-blue);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-tool-button:hover {
    background: #0090d8;
    transform: scale(1.03);
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-main-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-picture { width: 70px; height: 70px; border-radius: 50%; border: 2px solid var(--text-primary); object-fit: cover; flex-shrink: 0; }
.profile-name { font-size: 1.5rem; font-weight: 600; }
.profile-handle { color: var(--text-secondary); font-size: 1rem; }
.profile-bio { font-size: 0.9rem; color: var(--text-secondary); min-height: 54px; }
#typing-bio::after { content: '|'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

.card-social-links { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; padding: 1rem; }
.social-link {
    color: var(--text-primary); background-color: rgba(255,255,255,0.1); text-decoration: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0.75rem 0; border-radius: 0.75rem; transition: background-color 0.2s, transform 0.2s; font-size: 0.8rem;
}
.social-link:hover { transform: scale(1.05); }
.social-link i { font-size: 1.2rem; margin-bottom: 0.5rem; }
.social-link .social-icon-svg {
    width: 1.2rem;
    height: 1.2rem;
    margin-bottom: 0.5rem;
    filter: brightness(0) invert(1);
}
.social-link.github:hover { background-color: #333; }
.social-link.facebook:hover { background-color: #1877F2; }
.social-link.youtube:hover { background-color: #FF0000; }
.social-link.twitter:hover { background-color: #1DA1F2; }
.social-link.telegram:hover { background-color: #2AABEE; }
.social-link.phone:hover { background-color: #4CAF50; }
.social-link.linkedin:hover { background-color: #0A66C2; }
.social-link.farcaster:hover { background-color: #855DCD; }
.social-link.email:hover { background-color: #EA4335; }
.social-link.discord:hover { background-color: #5865F2; }

.now-title, .skills-title, .coffee-title { font-size: 1.2rem; margin-bottom: 1rem; flex-shrink: 0; }
.now-content { font-size: 0.9rem; color: var(--text-secondary); }
.now-content h4 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-primary);}

.skills-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills-list span { background: rgba(255, 255, 255, 0.1); padding: 0.3rem 0.8rem; border-radius: 2rem; font-size: 0.8rem; }

.journey-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.journey-title i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

.journey-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.journey-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    border-left: 3px solid var(--accent-blue);
    transition: background-color 0.3s ease;
}

.journey-step:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.journey-date {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    min-width: 80px;
    text-align: center;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.journey-role {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.journey-step.current {
    border-left-color: var(--accent-pink);
}

.journey-step.current .journey-date {
    color: var(--text-primary);
    background-color: rgba(255, 0, 127, 0.2);
}

.card-coffee {
    padding: 1rem 1.5rem !important;
}

.coffee-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.coffee-content {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
}

.coffee-button {
    text-decoration: none;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 200px;
    font-size: 0.85rem;
}

.coffee-button:hover {
    transform: scale(1.03);
    box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.1);
}

.coffee-button.paypal {
    background-color: #FFC439;
    color: #00457C;
    font-weight: 600;
}

.coffee-button.paypal:hover {
    background-color: #f0b93a;
}

.coffee-button.usdt {
    background-color: #26A17B;
    color: #ffffff;
    font-weight: 600;
    border: none;
    font-family: 'Poppins', sans-serif;
    cursor: none;
}

.coffee-button.usdt:hover {
    background-color: #1E8061;
}

.coffee-button.usdt.copied {
    background-color: var(--accent-blue);
    color: #fff;
}

.coffee-button i {
    margin-right: 0.5rem;
}

.profile-cta {
    background: rgba(255,255,255,0.9);
    color: #000;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.profile-cta:hover {
    transform: scale(1.05);
}

a:focus-visible,
button:focus-visible,
.social-link:focus-visible,
.profile-cta:focus-visible,
.project-link:focus-visible,
.coffee-button:focus-visible {
    outline: 3px solid var(--accent-blue);
    outline-offset: 3px;
    border-radius: 8px;
}

.social-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--bg-color), 0 0 0 5px var(--accent-blue);
}

/* ── Pendulum crystal ──────────────────────────────────────────────────────────── */
#pendulum-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

#crystal-pendant {
    position: fixed;
    z-index: 51;
    transform: translate(-50%, -50%);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

#crystal-pendant:active {
    cursor: grabbing;
}

#crystal-pendant img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    pointer-events: none;
    display: block;
    filter: drop-shadow(0 4px 14px rgba(160, 100, 255, 0.55))
            drop-shadow(0 0 6px rgba(200, 150, 255, 0.3));
    transition: filter 0.3s ease;
}

#crystal-pendant:hover img {
    filter: drop-shadow(0 4px 20px rgba(160, 100, 255, 0.9))
            drop-shadow(0 0 12px rgba(200, 150, 255, 0.6));
}

@media (max-width: 900px) {
    body {
        padding: 1rem;
        align-items: flex-start;
        overflow-y: auto;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding-right: 0.5rem;
        padding-left: 0.5rem;
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    .bento-item,
    .card-profile, .card-social-links, .card-now, .card-skills, .card-journey, .card-cta,
    .bento-column.column-left,
    .bento-column.column-right,
    .bento-column.column-tools {
        grid-column: span 1 !important;
        grid-row: auto !important;
        height: auto;
        max-height: none;
        overflow-y: visible;
        padding: 1.5rem;
    }

    .card-coffee {
        padding: 1rem 1.5rem !important;
    }

    .card-profile { flex-direction: column; align-items: center; }
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .profile-main-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .coffee-content {
        flex-direction: column;
        width: 100%;
    }

    .coffee-button {
        max-width: 100%;
        width: 100%;
    }

    .profile-bio { min-height: 80px; text-align: center; }
    .card-social-links { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .custom-cursor { display: none; }
    body { cursor: auto; }

    /* Hide pendulum on mobile */
    #pendulum-canvas,
    #crystal-pendant {
        display: none;
    }

    .language-selector-modal {
        padding: 2rem 1.5rem;
    }

    .language-selector-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .language-options {
        flex-direction: column;
        gap: 1rem;
    }

    .language-option {
        width: 100%;
        padding: 1.5rem 1rem;
    }
}