/* --- SYSTEM VARS --- */
:root {
    /* DARK THEME (DEFAULT) */
    --bg-color: #0d0d0d;
    --card-bg: rgba(20, 20, 20, 0.8);
    --text-main: #e0e0e0;
    --text-muted: #6b7280;
    --accent: #00ff41; 
    --accent-glow: rgba(0, 255, 65, 0.3);
    --border: #333;
    --scanline-opacity: 0.2;
    --font-stack: 'JetBrains Mono', monospace;
    --toggle-bg: #222;
}

/* LIGHT THEME OVERRIDES */
[data-theme="light"] {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #059669; 
    --accent-glow: rgba(5, 150, 105, 0.15);
    --border: #e5e7eb;
    --scanline-opacity: 0.03;
    --toggle-bg: #e5e7eb;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s, color 0.3s;
}

/* CRT EFFECT */
body::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    opacity: var(--scanline-opacity);
    transition: opacity 0.3s;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 20px;
    position: relative;
    z-index: 1;
}

h1, h2, h3 { margin: 0; font-weight: 700; }

/* КУРСОР (ИСПРАВЛЕННЫЙ) */
.cursor {
    display: inline-block;
    width: 0.5em;       /* Ширина зависит от шрифта */
    height: 1.1em;      /* Чуть выше буквы */
    background-color: var(--accent);
    animation: blink 1s step-end infinite;
    vertical-align: middle; /* Выравнивание по центру строки */
    margin-bottom: 4px;     /* Микро-подгонка вверх */
    margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ANIMATIONS */
.fade-in { opacity: 0; transform: translateY(20px); animation: fadeInUp 0.6s ease forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* HEADER */
.header-layout {
    display: flex;
    flex-wrap: wrap-reverse;
    gap: 32px;
    align-items: center;
    margin-bottom: 60px;
}

.hero-info { flex: 1; min-width: 280px; }

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    filter: grayscale(100%) contrast(1.2);
    border: 2px solid var(--border);
    transition: 0.3s;
}

.avatar-container:hover .avatar {
    filter: grayscale(0%) contrast(1);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

h1 { font-size: 28px; margin-bottom: 8px; color: var(--text-main); min-height: 36px; display: flex; align-items: center;} /* Flex для выравнивания курсора */
.hero-role { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; display: block; font-family: monospace; }

.btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    margin-top: 16px;
    margin-right: 12px;
    background: var(--card-bg);
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}
.btn:hover {
    border-color: var(--accent);
    color: var(--bg-color);
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

section { margin-bottom: 60px; }

.cmd-line {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-size: 12px;
}
.cmd-line::before { content: "root@cv:~$ "; color: var(--accent); }

/* JOBS & CASES */
.job-item {
    padding: 20px;
    border-left: 2px solid var(--border);
    background: linear-gradient(90deg, transparent, transparent);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.job-item:hover {
    border-left-color: var(--accent);
    background: var(--card-bg);
    transform: translateX(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.case-item { border-left: 2px dashed var(--text-muted); }
.case-item:hover { border-left: 2px dashed var(--accent); }

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.company { font-size: 18px; color: var(--text-main); font-weight: 700; }
.role { color: var(--accent); font-size: 13px; margin-left: 10px; }
.date { font-size: 12px; color: var(--text-muted); margin-left: auto; }

ul { padding-left: 16px; margin: 8px 0 0 0; color: var(--text-muted); }
li { margin-bottom: 6px; }

/* SKILLS GRID */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.skill-box {
    border: 1px solid var(--border);
    padding: 16px;
    transition: 0.3s;
    background: var(--card-bg);
}
.skill-box:hover {
    border-color: var(--accent);
    box-shadow: 4px 4px 0px var(--accent-glow);
}
.skill-head { color: var(--accent); font-size: 12px; margin-bottom: 8px; display: block; letter-spacing: 1px; }

/* RECOMMENDATIONS GRID */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.recommendation-item {
    border: 1px solid var(--border);
    padding: 16px;
    transition: 0.3s;
    background: var(--card-bg);
}

.recommendation-item:hover {
    border-color: var(--accent);
    box-shadow: 4px 4px 0px var(--accent-glow);
    transform: translateY(-2px);
}

.recommendation-name {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.recommendation-role {
    color: var(--accent);
    font-size: 12px;
    margin-bottom: 4px;
}

.recommendation-company {
    color: var(--text-muted);
    font-size: 11px;
}

/* BOOT SCREEN */
#boot-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 999;
    color: var(--accent);
    padding: 40px;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

#boot-screen > div {
    opacity: 0;
    line-height: 1.8;
    margin-bottom: 12px;
    white-space: nowrap;
    display: block;
    min-height: 1.8em;
    transition: opacity 0.4s ease-in;
}

/* --- FLOATING TOGGLE SWITCH --- */
.theme-switch-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease 0.8s forwards;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: var(--toggle-bg);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border: 2px solid var(--border);
}

/* Квадратный ползунок (Тумблер стайл) */
.slider:before {
    background-color: var(--text-muted);
    bottom: 4px;
    content: "";
    height: 22px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 22px;
}

/* Состояние ВКЛ (Светлая тема) */
input:checked + .slider {
    background-color: var(--card-bg);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: var(--accent);
}

/* Текст рядом с тумблером */
.switch-label {
    margin-right: 10px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

/* MOBILE ADAPTIVE */
@media (max-width: 600px) {
    .header-layout { justify-content: center; text-align: center; }
    .hero-info { text-align: left; }
    .job-header { flex-direction: column; }
    .role, .date { margin-left: 0; }
    .skills-grid { grid-template-columns: 1fr; }
    /* Тумблер чуть выше на мобилке, чтобы пальцем было удобно */
    .theme-switch-wrapper { bottom: 20px; right: 20px; }
}
