:root {
    --bg: #0a0a0a;
    --card-bg: rgba(17, 17, 17, 0.6);
    --accent: #a855f7;
    --accent2: #7c3aed;
    --dim: #1a1a1a;
    --font-en: 'Space Mono', monospace;
    --font-ru: 'Exo 2', sans-serif;
}

html,
body,
* {
    cursor: none !important;
}

@media (hover: none) and (pointer: coarse) {
    html,
    body,
    * {
        cursor: auto !important;
    }

    .cursor,
    .cursor-ring {
        display: none !important;
    }
}

body {
    background-color: var(--bg);
    color: #ececec;
    font-family: var(--font-ru);
    overflow-x: hidden;
    min-height: 100vh;
}

body.lang-en {
    font-family: var(--font-en);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.75;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.012) 2px,
            rgba(255, 255, 255, 0.012) 4px);
    pointer-events: none;
    z-index: 9990;
}

.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(168, 85, 247, 0.65);
    transform: translate(-50%, -50%);
    transition: width 0.15s ease, height 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease, transform 0.1s ease;
    opacity: 0;
    visibility: hidden;
    will-change: left, top, width, height, transform;
}

.cursor.cursor-visible {
    opacity: 1;
    visibility: visible;
}

.cursor.cursor-hover {
    width: 14px;
    height: 14px;
    box-shadow: 0 0 14px var(--accent), 0 0 26px rgba(168, 85, 247, 0.85);
}

.cursor.cursor-active {
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%) scale(0.8);
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(168, 85, 247, 0.45);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, opacity 0.25s ease;
    opacity: 0;
    visibility: hidden;
    will-change: left, top, width, height;
}

.cursor-ring.cursor-visible {
    opacity: 1;
    visibility: visible;
}

.cursor-ring.cursor-hover {
    width: 48px;
    height: 48px;
    border-color: rgba(168, 85, 247, 0.7);
    background: rgba(168, 85, 247, 0.08);
}

.wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.8rem 1rem 2.5rem;
}

.container {
    width: 100%;
    max-width: 480px;
}

.site-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 1.2rem;
    margin-bottom: 1.8rem;
    opacity: 0;
    animation: slideDown 0.6s 0.1s ease-out forwards;
}

.logo-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.globe-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 380px;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.95;
    transition: opacity 0.5s ease;
}

.globe-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    outline: none;
    pointer-events: auto;
}

@media (max-width: 480px) {
    .wrapper {
        padding: 2.8rem 1rem 2rem;
    }

    .globe-wrapper {
        width: 300px;
        height: 300px;
    }
}

.logo {
    position: relative;
    z-index: 2;
    font-family: 'Russo One', sans-serif;
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #fff;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
}

.lang-btns {
    position: relative;
    z-index: 2;
}

.logo span {
    color: var(--accent);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.4s ease;
}

.logo:hover::after {
    width: 100%;
}

.logo.glitching {
    animation: glitch 0.35s steps(1) forwards;
}

@keyframes glitch {
    0% {
        text-shadow: none;
        transform: none;
    }

    10% {
        text-shadow: -3px 0 #ff00cc, 3px 0 #00ffff;
        transform: skewX(-4deg);
    }

    20% {
        text-shadow: 3px 0 #ff00cc, -3px 0 #00ffff;
        transform: skewX(3deg) translateX(2px);
    }

    30% {
        text-shadow: -2px 0 #a855f7, 2px 0 #00ffff;
        transform: none;
        clip-path: inset(30% 0 40% 0);
    }

    40% {
        text-shadow: none;
        clip-path: none;
        transform: translateX(-2px);
    }

    50% {
        text-shadow: 4px 0 #ff00cc, -4px 0 #a855f7;
        transform: skewX(2deg);
    }

    60% {
        text-shadow: none;
        transform: none;
    }

    70% {
        text-shadow: -2px 0 #00ffff;
        transform: translateX(1px) skewX(-2deg);
    }

    85% {
        text-shadow: none;
        transform: none;
    }

    100% {
        text-shadow: none;
        transform: none;
    }
}

.scanline-sweep {
    position: fixed;
    top: -6px;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(transparent, rgba(168, 85, 247, 0.18), transparent);
    pointer-events: none;
    z-index: 9989;
    opacity: 0;
}

.scanline-sweep.running {
    animation: scanSweep 4s linear forwards;
}

@keyframes scanSweep {
    0% {
        top: -6px;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    95% {
        opacity: 1;
    }

    100% {
        top: 100vh;
        opacity: 0;
    }
}

.lang-btns {
    display: flex;
    gap: 6px;
}

.lang-btn.active {
    color: #fff !important;
    border-color: var(--accent) !important;
    background: var(--accent) !important;
}

.lang-btn {
    font-family: var(--font-en);
    font-size: 9px;
    border: 1px solid #333;
    padding: 4px 8px;
    background: transparent;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: skewX(-25deg);
    z-index: -1;
    transition: none;
}

.lang-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.lang-btn:hover::before {
    left: 150%;
    transition: left 0.5s ease;
}

.card {
    background: var(--card-bg);
    border: 1px solid #1e1e1e;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: slideUp 0.6s 0.25s ease-out forwards;
}

.card-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), var(--accent2), transparent);
    animation: barFlow 3s ease-in-out infinite alternate;
}

@keyframes barFlow {
    from {
        opacity: 0.5;
        filter: none;
    }

    to {
        opacity: 1;
        filter: drop-shadow(0 0 10px var(--accent)) brightness(1.4);
    }
}

.card {
    transition: border-color 0.4s;
}

.card:hover {
    border-color: #2a2a2a;
}

.card:hover .section-text,
.card:hover .meta-val {
    color: #e0e0e0;
    transition: color 0.4s ease;
}

.card:hover .bio-text {
    color: #e0e0e0;
}

.card:hover .meta-key {
    color: #777;
    transition: color 0.4s ease;
}

.card:hover .section-title {
    color: #666;
    transition: color 0.4s ease;
}

.meta {
    margin-bottom: 1.5rem;
}

.meta-row {
    display: flex;
    align-items: center;
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #181818;
}

.meta-row,
.section {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.btn-grid .btn-link {
    opacity: 0;
    transform: translateX(-8px);
}

.meta-row.visible,
.section.visible,
.btn-grid .btn-link.visible {
    opacity: 1;
    transform: translateX(0);
}

.meta-key {
    color: #555;
    width: 80px;
    flex-shrink: 0;
}

.meta-val {
    color: #ddd;
}

.cv-link {
    position: relative;
    overflow: hidden;
}

.cv-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.35), transparent);
    animation: shimmer 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

.section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #444;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #222, transparent);
}

.section-text {
    font-size: 12px;
    color: #bbb;
    line-height: 1.7;
}

.lang-row {
    display: flex;
    gap: 0.75rem;
}

.lang-pill {
    font-family: var(--font-en);
    font-size: 10px;
    padding: 3px 10px;
    border: 1px solid #2a2a2a;
    color: #666;
    transition: color 0.3s ease, border-color 0.3s ease, text-shadow 0.3s ease;
    position: relative;
    background: var(--bg);
    z-index: 0;
}

/* Flag gradient sits behind as the "border" layer */
.lang-pill::before {
    content: '';
    position: absolute;
    inset: -1px;
    opacity: 0;
    transition: opacity 0.35s ease 0.2s;
    pointer-events: none;
    z-index: -2;
}

/* Dark fill covers interior, leaving only 1px border visible */
.lang-pill::after {
    content: '';
    position: absolute;
    inset: 0px;
    background: var(--bg);
    opacity: 0;
    transition: opacity 0.35s ease 0.2s;
    pointer-events: none;
    z-index: -1;
}

.lang-pill[data-flag="RU"]::before {
    background: linear-gradient(180deg, #fff 33.3%, #003DA5 33.3% 66.6%, #CC0000 66.6%);
}

.lang-pill[data-flag="EN"]::before {
    background:
        linear-gradient(#3c3b6e, #3c3b6e) left top / 40% 53.846% no-repeat,
        repeating-linear-gradient(
            #b22234 0 7.6923%,
            #fff 7.6923% 15.3846%
        );
}

.lang-pill[data-flag="UA"]::before {
    background: linear-gradient(180deg, #005BBB 50%, #FFD500 50%);
}

.lang-pill[data-flag="UZ"]::before {
    background: linear-gradient(180deg,
            #009FCA 0 31%,
            #CE1126 31% 35%,
            #fff 35% 65%,
            #CE1126 65% 69%,
            #1EB53A 69% 100%);
}

.lang-pill:hover::before,
.lang-pill:hover::after {
    opacity: 1;
    transition-delay: 0s;
}

.lang-pill:hover {
    color: #ddd;
    border-color: transparent;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

.lang-hint {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-bottom: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease,
                margin-bottom 0.35s ease;
}

.lang-hint.visible {
    max-height: 100px;
    opacity: 1;
    margin-bottom: 0.75rem;
}

.lang-hint-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(18, 18, 22, 0.9);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-left: 3px solid var(--accent);
    padding: 7px 12px;
    font-size: 11px;
    line-height: 1.4;
    color: #d8d8dc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(168, 85, 247, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lang-hint-icon {
    color: var(--accent);
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    animation: hintArrowBounce 0.8s ease-in-out infinite alternate;
}

@keyframes hintArrowBounce {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(2px, -2px);
    }
}

.lang-btns.highlight-hint .lang-btn {
    animation: btnPulse 0.9s ease 3;
}

@keyframes btnPulse {
    0%, 100% {
        box-shadow: 0 0 0 rgba(168, 85, 247, 0);
        border-color: #333;
    }
    50% {
        box-shadow: 0 0 14px rgba(168, 85, 247, 0.8), 0 0 22px rgba(168, 85, 247, 0.4);
        border-color: var(--accent);
    }
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2rem;
}

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

.btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid #222;
    background: transparent;
    color: #888;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    position: relative;
    overflow: hidden;
    transition: color 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s, opacity 0.4s ease-out;
}


.btn-link span {
    position: relative;
    z-index: 1;
}

.btn-link:hover,
.btn-grid .btn-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.sweep-btn {
    position: relative;
    overflow: hidden;
}

.sweep-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(115deg, transparent, var(--accent), transparent);
    transform: translateX(0);
    z-index: 0;
    transition: none;
    will-change: transform;
}

.sweep-btn:hover::before {
    transform: translateX(200%);
    transition: transform 0.5s ease;
}


.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    color: #333;
    letter-spacing: 0.2em;
    opacity: 0;
    animation: fadeIn 0.5s 1s ease-out forwards;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

.bio-text {
    font-size: 12px;
    color: #999;
    line-height: 1.75;
    max-height: 85px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.6s ease, color 0.4s ease;
    white-space: pre-line;
    -webkit-mask-image: linear-gradient(to bottom, black 50px, transparent 85px);
    mask-image: linear-gradient(to bottom, black 50px, transparent 85px);
}

.bio-text.expanded {
    max-height: 600px;
    -webkit-mask-image: none;
    mask-image: none;
}

.bio-fade {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, rgba(17, 17, 17, 0.8) 50%, rgba(17, 17, 17, 0.98));
    pointer-events: none;
    transition: opacity 0.3s;
}

.bio-text.expanded+.bio-fade {
    opacity: 0;
}

.bio-toggle {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--font-en);
    font-size: 10px;
    padding: 4px 0;
    margin-top: 4px;
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
}

.bio-toggle:hover {
    opacity: 0.7;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

::selection {
    background: rgba(168, 85, 247, 0.35);
    color: #fff;
}

.banner-btn {
    padding: 0 !important;
    border: 1px solid #222 !important;
    height: 85px !important;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: color 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.banner-btn:hover {
    background-color: transparent !important;
    border-color: rgba(168, 85, 247, 0.6) !important;
    box-shadow: none !important;
}

.banner-btn .banner-img {
    height: 43px;
    width: auto;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 2;
    transition: transform 0.3s, filter 0.3s;
}

.banner-btn:hover .banner-img {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.6));
}

.banner-btn .banner-shadow {
    position: absolute;
    left: 50%;
    top: 50%;
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s;
    z-index: 1;
}

.banner-btn:hover .banner-shadow {
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.4));
}

.banner-shadow.shadow-top {
    transform: translate(-50%, -50%) translateY(-51px);
}

.banner-shadow.shadow-bottom {
    transform: translate(-50%, -50%) translateY(51px);
}

.banner-btn:hover .shadow-top {
    transform: translate(-50%, -50%) translateY(51px);
}

.banner-btn:hover .shadow-bottom {
    transform: translate(-50%, -50%) translateY(-51px);
}

.age-digit {
    transition: color 0.15s ease;
    display: inline-block;
}

.age-digit.flash-purple {
    color: var(--accent) !important;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
    transition: none !important;
}

.btn-link,
.lang-btn,
.bio-toggle,
.nav-back,
.hire-btn,
.banner-btn,
.skill-tag {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}