: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;
}

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

@media (hover: none) and (pointer: coarse) {
    * { 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;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, width 0.2s, height 0.2s, opacity 0.2s;
    mix-blend-mode: screen;
    visibility: hidden;
}
.cursor-ring {
    position: fixed;
    width: 30px; height: 30px;
    border: 1px solid rgba(168,85,247,0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, width 0.25s, height 0.25s;
    visibility: hidden;
}

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

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

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

.logo {
    font-family: 'Russo One', sans-serif;
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #fff;
    position: relative;
}
.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-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: all 0.25s;
    position: relative;
    overflow: hidden;
}
.lang-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    z-index: -1;
}
.lang-btn:hover { color: #fff; border-color: var(--accent); }
.lang-btn:hover::before { transform: scaleX(1); }

.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:hover {
    border-color: #2a2a2a;
    transition: border-color 0.4s;
}

.meta { margin-bottom: 1.5rem; }
.meta-row {
    display: flex;
    align-items: center;
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #181818;
    opacity: 0;
    transform: translateX(-8px);
}
.meta-row.visible { animation: rowIn 0.4s ease-out forwards; }
@keyframes rowIn { to { 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: all 0.2s;
}
.lang-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px rgba(168,85,247,0.2);
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2rem;
}
.btn-grid a:last-child { 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;
}
.btn-link::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 0;
    background: var(--accent);
    transition: height 0.3s ease;
    z-index: 0;
}
.btn-link span { position: relative; z-index: 1; }
.btn-link:hover { color: #fff; border-color: var(--accent); }
.btn-link:hover::before { height: 100%; }

.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: 72px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.6s ease;
    white-space: pre-line;
}
.bio-text.expanded { max-height: 600px; }
.bio-fade {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 36px;
    background: linear-gradient(transparent, var(--card-bg));
    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;
}