        @font-face {
            font-family: 'RU Cyrillic Fallback';
            src: local('JetBrains Mono');
            unicode-range:
                U+0400-04FF,
                U+0500-052F,
                U+2DE0-2DFF,
                U+A640-A69F,
                U+1C80-1C8F;
            font-display: swap;
        }

        :root {
            /* Palette: Dark cyberpunk with near-black structure */
            --bg-base: #050507;        /* Main background */
            --bg-panel: #0b0b0f;       /* Box background */
            --bg-hover: #121015;       /* Box hover */
            
            --grid-line: #161217;      /* 1px borders */
            --grid-line-hover: #231a20;
            
            /* Accents: Cyberpunk neon */
            --accent-primary: #ff2b4f;   /* Neon red */
            --accent-secondary: #ffe600; /* Electric yellow */
            --accent-muted: #3a3034;     /* Dimmed graphite accent */
            
            /* Typography Colors */
            --text-high: #F8FAFC;
            --text-main: #CBD5E1;
            --text-dim:  #4e474c;

            /* Spacing System */
            --pad-sm: 1.5rem;
            --pad-md: 2.5rem;
            --pad-lg: 3.5rem;
            --picker-height: 1.55rem;
            --picker-inner-height: calc(var(--picker-height) - 2px);
            --font-main-en: 'Space Grotesk', sans-serif;
            --font-main-ru: 'RU Cyrillic Fallback', 'Space Grotesk', sans-serif;
        }

        html[data-theme="original"] {
            --bg-base: #060608;
            --bg-panel: #0d0e12;
            --bg-hover: #14151a;
            --grid-line: #1f2128;
            --grid-line-hover: #2e313c;
            --accent-primary: #ff5722;
            --accent-secondary: #00e5ff;
            --accent-muted: #565a6b;
            --text-dim: #64748b;
            --theme-switcher-panel: #0d1218;
            --theme-switcher-active: rgba(255, 87, 34, 0.16);
            --theme-switcher-glow: rgba(0, 229, 255, 0.38);
            --theme-switcher-active-bg: #0b1920;
            --indicator-glow: rgba(0, 229, 255, 0.65);
            --indicator-ring: rgba(0, 229, 255, 0.55);
            --indicator-inset: #021419;
        }

        html[data-theme="signal"] {
            --bg-base: #050507;
            --bg-panel: #0b0b0f;
            --bg-hover: #121015;
            --grid-line: #161217;
            --grid-line-hover: #231a20;
            --accent-primary: #ff2b4f;
            --accent-secondary: #ffe600;
            --accent-muted: #3a3034;
            --text-dim: #4e474c;
            --theme-switcher-panel: #120d12;
            --theme-switcher-active: rgba(255, 43, 79, 0.16);
            --theme-switcher-glow: rgba(255, 43, 79, 0.45);
            --theme-switcher-active-bg: #171109;
            --indicator-glow: rgba(255, 43, 79, 0.75);
            --indicator-ring: rgba(255, 43, 79, 0.58);
            --indicator-inset: #17040a;
        }

        html[data-theme="voltage"] {
            --bg-base: #05060a;
            --bg-panel: #0b0e14;
            --bg-hover: #11151d;
            --grid-line: #141923;
            --grid-line-hover: #1f2633;
            --accent-primary: #ff304f;
            --accent-secondary: #38a4ff;
            --accent-muted: #4a5160;
            --text-dim: #5a6472;
            --theme-switcher-panel: #0c1119;
            --theme-switcher-active: rgba(255, 48, 79, 0.16);
            --theme-switcher-glow: rgba(56, 164, 255, 0.42);
            --theme-switcher-active-bg: #0b1523;
            --indicator-glow: rgba(56, 164, 255, 0.7);
            --indicator-ring: rgba(56, 164, 255, 0.55);
            --indicator-inset: #051220;
        }

        html[data-theme="dusk"] {
            --bg-base: #0b0c10;
            --bg-panel: #12141a;
            --bg-hover: #181b21;
            --grid-line: #1b1e24;
            --grid-line-hover: #2a2e35;
            --accent-primary: #c88aa6;
            --accent-secondary: #8faf9d;
            --accent-muted: #5d5563;
            --text-dim: #7c7580;
            --theme-switcher-panel: #171921;
            --theme-switcher-active: rgba(200, 138, 166, 0.12);
            --theme-switcher-glow: rgba(200, 138, 166, 0.28);
            --theme-switcher-active-bg: #182018;
            --indicator-glow: rgba(200, 138, 166, 0.55);
            --indicator-ring: rgba(200, 138, 166, 0.42);
            --indicator-inset: #24161d;
        }

        html[data-theme="soot"] {
            --bg-base: #0b0c10;
            --bg-panel: #12141a;
            --bg-hover: #181b21;
            --grid-line: #1b1e24;
            --grid-line-hover: #2a2e35;
            --accent-primary: #b697c7;
            --accent-secondary: #aab593;
            --accent-muted: #5a5864;
            --text-dim: #777783;
            --theme-switcher-panel: #171921;
            --theme-switcher-active: rgba(182, 151, 199, 0.12);
            --theme-switcher-glow: rgba(182, 151, 199, 0.26);
            --theme-switcher-active-bg: #1a1d1a;
            --indicator-glow: rgba(182, 151, 199, 0.52);
            --indicator-ring: rgba(182, 151, 199, 0.4);
            --indicator-inset: #1f1b27;
        }

        /* STRICTLY SQUARE RULE */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            border-radius: 0 !important; 
            font-family: var(--font-main-en);
            -webkit-font-smoothing: antialiased;
        }

        html.ru-font-fallback * {
            font-family: var(--font-main-ru);
        }

        html.ru-font-fallback .mono {
            font-family: 'RU Cyrillic Fallback', 'JetBrains Mono', monospace;
        }

        body {
            background-color: var(--bg-base);
            color: var(--text-main);
            line-height: 1.5;
            padding: 2vw;
            display: flex;
            justify-content: center;
        }

        ::selection {
            background: var(--accent-secondary);
            color: #000;
        }

        /* --- TYPOGRAPHY --- */
        .mono {
            font-family: 'JetBrains Mono', monospace;
        }

        h1 {
            font-size: clamp(3rem, 6vw, 5.5rem);
            font-weight: 700;
            line-height: 1.05;
            letter-spacing: -0.04em;
            color: var(--text-high);
            margin-bottom: 0.5rem;
        }

        h2 {
            font-size: clamp(1.8rem, 3vw, 2.5rem);
            font-weight: 500;
            letter-spacing: -0.03em;
            color: var(--text-high);
            margin-bottom: var(--pad-sm);
        }

        h3 {
            font-size: 1.25rem;
            font-weight: 500;
            color: var(--text-high);
            letter-spacing: -0.01em;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        p {
            font-size: 1.05rem;
            color: var(--text-dim);
            font-weight: 400;
        }

        .meta-label {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.75rem;
            text-transform: uppercase;
            color: var(--accent-muted);
            letter-spacing: 0.1em;
            margin-bottom: var(--pad-sm);
            display: block;
        }

        /* --- BENTO GRID SYSTEM --- */
        .grid-container {
            max-width: 1400px;
            width: 100%;
            background-color: var(--grid-line);
            display: grid;
            grid-template-columns: repeat(12, 1fr);
            gap: 1px; /* The soul of the design: perfect 1px inner borders */
            border: 1px solid var(--grid-line);
        }

        .box {
            background-color: var(--bg-panel);
            padding: var(--pad-md);
            position: relative;
            transition: background-color 0.3s ease, box-shadow 0.3s ease;
            display: flex;
            flex-direction: column;
        }

        .box:hover {
            background-color: var(--bg-hover);
        }

        /* Specific spans */
        .span-12 { grid-column: span 12; }
        .span-8  { grid-column: span 8; }
        .span-7  { grid-column: span 7; }
        .span-5  { grid-column: span 5; }
        .span-4  { grid-column: span 4; }

        /* --- COMPONENT STYLES --- */

        /* Hero / Header */
        .hero-subtitle {
            font-size: 1.5rem;
            color: var(--accent-primary);
            font-weight: 400;
            margin-bottom: 2rem;
            letter-spacing: -0.02em;
        }

        /* Status Block */
        .status-block {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            height: 100%;
        }
        .status-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--grid-line);
            padding-bottom: 1rem;
            margin-bottom: 1rem;
        }
        .status-item:last-child {
            border-bottom: none; margin-bottom: 0; padding-bottom: 0;
        }
        .blinking-square {
            width: 10px;
            height: 10px;
            position: relative;
            display: inline-block;
            background-color: var(--accent-primary);
            box-shadow: 0 0 0 1px var(--indicator-inset) inset, 0 0 14px var(--indicator-glow);
            animation: indicatorPulse 1.6s ease-in-out infinite;
        }
        .blinking-square::after {
            content: "";
            position: absolute;
            inset: -4px;
            border: 1px solid var(--indicator-ring);
            animation: indicatorPing 1.6s ease-out infinite;
        }
@keyframes indicatorPulse {
            0%, 100% { transform: scale(1); opacity: 0.95; }
            50% { transform: scale(0.8); opacity: 1; }
        }
@keyframes indicatorPing {
            0% { transform: scale(0.75); opacity: 0.85; }
            70%, 100% { transform: scale(1.25); opacity: 0; }
        }

        /* Geometric markers */
        .geo-square {
            display: inline-block;
            width: 8px;
            height: 8px;
            background-color: var(--grid-line-hover);
            transition: background-color 0.3s;
        }

        .box:hover .geo-square {
            background-color: var(--accent-primary);
        }

        /* Categorized Skills */
        .skills-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 2rem;
        }
        .skill-group h4 {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            color: var(--accent-secondary);
            margin-bottom: 1rem;
            text-transform: uppercase;
            border-bottom: 1px solid var(--grid-line);
            padding-bottom: 0.5rem;
        }
        .skill-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .skill-list li {
            color: var(--text-dim);
            transition: color 0.2s, padding-left 0.2s;
        }
        .skill-list li:hover {
            color: var(--text-high);
            padding-left: 5px;
            cursor: default;
        }

        /* Experience Timeline */
        .timeline-item {
            position: relative;
            padding-left: 2rem;
            margin-bottom: var(--pad-md);
        }
        .timeline-item:last-child {
            margin-bottom: 0;
        }
        /* Strict vertical line */
        .timeline-item::before {
            content: '';
            position: absolute;
            left: 0;
            top: 5px;
            bottom: -var(--pad-md);
            width: 1px;
            background-color: var(--grid-line);
        }
        .timeline-item:last-child::before {
            display: none;
        }
        /* Strict square bullet */
        .timeline-item::after {
            content: '';
            position: absolute;
            left: -4px;
            top: 8px;
            width: 9px;
            height: 9px;
            background-color: var(--bg-panel);
            border: 1px solid var(--accent-primary);
            transition: 0.3s;
        }
        .timeline-item:hover::after {
            background-color: var(--accent-primary);
        }
        
        .timeline-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        .date {
            color: var(--accent-muted);
            font-size: 0.9rem;
        }
        .timeline-item ul {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .timeline-item ul li {
            position: relative;
            padding-left: 1rem;
            color: var(--text-dim);
        }
        .timeline-item ul li::before {
            content: '-';
            position: absolute;
            left: 0;
            color: var(--accent-muted);
        }

        /* Project Cards */
        .project-card {
            cursor: pointer;
            text-decoration: none;
            border-top: 2px solid transparent;
        }
        .project-card:hover {
            box-shadow: inset 0 2px 0 var(--accent-secondary);
        }
        .project-card:hover h3 {
            color: var(--accent-secondary);
        }
        .project-top {
            display: flex;
            justify-content: space-between;
            margin-bottom: var(--pad-sm);
            font-size: 0.8rem;
            color: var(--accent-muted);
        }
        .nda-fake-barcode {
            display: inline-flex;
            align-items: stretch;
            gap: 2px;
            height: 16px;
            flex-shrink: 0;
            color: color-mix(in srgb, var(--accent-muted) 70%, #000 30%);
            opacity: 1;
        }
        .nda-fake-bar {
            display: block;
            height: 100%;
            background: currentColor;
        }
        .project-tech {
            font-size: 0.85rem;
            margin-top: auto;
            padding-top: var(--pad-sm);
            color: var(--text-high);
        }

        /* NDA Cards */
        .nda-card {
            position: relative;
            overflow: hidden;
            background-color: var(--bg-panel);
        }
        .nda-corner {
            position: absolute;
            width: 10px;
            height: 10px;
            background: var(--accent-primary);
            pointer-events: none;
            opacity: 0;
            transition: transform 0.22s ease, opacity 0.22s ease;
            z-index: 2;
        }
        .nda-corner--tl {
            left: 0;
            top: 0;
            transform: translate(-12px, -12px);
        }
        .nda-corner--tr {
            right: 0;
            top: 0;
            transform: translate(12px, -12px);
        }
        .nda-corner--bl {
            left: 0;
            bottom: 0;
            transform: translate(-12px, 12px);
        }
        .nda-corner--br {
            right: 0;
            bottom: 0;
            transform: translate(12px, 12px);
        }

        .nda-card:hover .nda-corner {
            opacity: 1;
        }
        .nda-card:hover .nda-corner--tl {
            transform: translate(6px, 6px);
        }
        .nda-card:hover .nda-corner--tr {
            transform: translate(-6px, 6px);
        }
        .nda-card:hover .nda-corner--bl {
            transform: translate(6px, -6px);
        }
        .nda-card:hover .nda-corner--br {
            transform: translate(-6px, -6px);
        }
        .nda-card:hover h3 {
            color: var(--accent-primary);
        }

        /* Links / Contacts */
        .contact-link {
            display: flex;
            justify-content: space-between;
            align-items: center;
            text-decoration: none;
            color: var(--text-main);
            padding: 1rem 0;
            border-bottom: 1px solid var(--grid-line);
            transition: 0.3s;
        }
        .contact-link:last-child { border-bottom: none; padding-bottom: 0; }
        .contact-link:first-child { padding-top: 0; }
        .contact-link:hover {
            color: var(--accent-primary);
        }
        .arrow {
            font-family: 'JetBrains Mono', monospace;
            opacity: 0;
            transform: translateX(-10px);
            transition: 0.3s;
        }
        .contact-link:hover .arrow {
            opacity: 1;
            transform: translateX(0);
        }

        /* Stats List */
        .stat-row {
            display: flex;
            justify-content: space-between;
            padding: 0.8rem 0;
            border-bottom: 1px dashed var(--grid-line);
            font-size: 0.95rem;
        }
        .stat-row:hover { color: var(--text-high); }

        /* Responsive Breakpoints */
        @media (max-width: 1100px) {
            .span-4, .span-5, .span-7, .span-8 {
                grid-column: span 6;
            }
        }

        @media (max-width: 768px) {
            body { padding: 0; }
            .grid-container { border: none; gap: 1px; background-color: var(--grid-line); }
            .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 {
                grid-column: span 12;
            }
            .box { padding: 2rem 1.5rem; }
            h1 { font-size: 2.5rem; }
        }

.screen-state {
    width: 100%;
    max-width: 1400px;
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-dim);
}

.profile-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: var(--pad-sm);
}

.profile-meta-row .meta-label {
    margin-bottom: 0;
}

.profile-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.theme-switcher,
.lang-switcher {
    display: inline-flex;
    align-items: stretch;
    box-sizing: border-box;
    border: 1px solid var(--grid-line);
    min-block-size: var(--picker-height);
    block-size: var(--picker-height);
    background: var(--theme-switcher-panel);
    overflow: hidden;
}

.theme-switcher {
    padding: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22), 0 0 18px -14px var(--theme-switcher-glow);
}

.theme-btn,
.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-block-size: var(--picker-inner-height);
    block-size: var(--picker-inner-height);
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.theme-btn {
    width: 2rem;
    padding: 0 0.4rem;
    flex: 0 0 auto;
}

.theme-btn + .theme-btn {
    border-left: 1px solid var(--grid-line);
}

.theme-btn:hover {
    background: color-mix(in srgb, var(--theme-switcher-panel) 58%, var(--accent-primary) 42%);
}

.theme-btn.active {
    background: var(--theme-switcher-active);
    box-shadow: inset 0 0 0 1px var(--theme-switcher-glow);
}

.theme-swatch {
    display: inline-grid;
    grid-template-columns: repeat(2, 0.48rem);
    gap: 0.18rem;
}

.theme-chip {
    width: 0.48rem;
    height: 0.48rem;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 0 10px -4px currentColor;
}

.lang-btn {
    padding: 0 0.6rem;
    letter-spacing: 0.08em;
}

.lang-btn + .lang-btn {
    border-left: 1px solid var(--grid-line);
}

.lang-btn:hover {
    color: var(--text-high);
    background: var(--bg-hover);
}

.lang-btn.active {
    color: var(--accent-secondary);
    background: var(--theme-switcher-active-bg);
}

@media (max-width: 768px) {
    .profile-controls {
        justify-content: flex-start;
        gap: 0.6rem;
    }

    .profile-meta-row {
        align-items: flex-start;
        flex-direction: column;
    }
}
