* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --fg: #111111;
    --fgo: rgba(20, 20, 20, 0.8);
    --border: #222222;
    --dark-gray: #6b7280;
    --gray: #9ca3af;
    --pg: #e5e5e5;
    --grid-color: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.03);
}

body.light {
    --bg: #f5f5f5;
    --fg: #ffffff;
    --fgo: rgba(240, 240, 240, 0.9);
    --border: #e5e7eb;
    --dark-gray: #6b7280;
    --gray: #6b7280;
    --pg: #1f2937;
    --grid-color: rgba(0, 0, 0, 0.04);
    --card-hover: rgba(0, 0, 0, 0.02);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--pg);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

::selection {
    background: rgba(255, 255, 255, 0.08);
}

::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 10px;
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    -webkit-mask-image: linear-gradient(to bottom, white 0%, white 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, white 0%, white 70%, transparent 100%);
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    filter: blur(1px);
    opacity: 0.12;
}

body.light #bgCanvas {
    opacity: 0.06;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

/* ========================================
   HERO
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 0 80px;
    position: relative;
}

.hero-content {
    max-width: 820px;
    padding: 0 16px;
}

.hero-title {
    font-size: 140px;
    font-weight: 900;
    line-height: 0.92;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.hero-name {
    display: block;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.08);
    font-size: 52px;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.hero-highlight {
    display: block;
    background: linear-gradient(135deg, var(--pg) 0%, var(--gray) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 140px;
}

.hero-typed {
    font-family: 'JetBrains Mono', monospace;
    font-size: 26px;
    color: rgba(255, 255, 255, 0.25);
    margin: 8px 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.typed-prefix {
    color: var(--gray);
    font-size: 22px;
}

.typed-text {
    min-width: 160px;
    color: rgba(255, 255, 255, 0.3);
}

.typed-text::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--gray);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 34px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--pg);
    color: var(--bg);
    padding: 14px 38px;
}

.btn-primary:hover {
    transform: translateY(-4px);
    filter: brightness(0.92);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--gray);
    border: 1.5px solid var(--border);
    padding: 14px 34px;
}

.btn-outline:hover {
    background: var(--fgo);
    color: var(--pg);
    transform: translateY(-4px);
    border-color: var(--pg);
}

.hero-social {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.hero-social a {
    color: rgba(255, 255, 255, 0.15);
    font-size: 28px;
    transition: all 0.3s ease;
}

.hero-social a:hover {
    color: var(--pg);
    transform: translateY(-5px) scale(1.15);
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.03);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

.hero-scroll i {
    font-size: 16px;
}


@media (max-width: 1024px) {
    .hero-title { font-size: 100px; }
    .hero-highlight { font-size: 100px; }
    .hero-name { font-size: 38px; }
    .hero-typed { font-size: 22px; }
    .hero-social a { font-size: 26px; }
}

@media (max-width: 820px) {
    .hero {
        min-height: auto;
        padding: 70px 0 50px;
        align-items: flex-start;
        text-align: left;
    }
    .hero-content {
        max-width: 100%;
        padding: 0;
        width: 100%;
    }
    .hero-title {
        font-size: 82px;
        line-height: 0.9;
        margin-bottom: 8px;
    }
    .hero-name {
        font-size: 34px;
        color: rgba(255, 255, 255, 0.1);
        margin-bottom: 0;
        letter-spacing: 0.06em;
    }
    .hero-highlight { font-size: 82px; }
    .hero-typed {
        font-size: 24px;
        justify-content: flex-start;
        color: rgba(255, 255, 255, 0.3);
        margin: 10px 0 14px;
        gap: 8px;
    }
    .typed-prefix {
        font-size: 20px;
        color: var(--gray);
    }
    .typed-text {
        min-width: 140px;
        color: rgba(255, 255, 255, 0.35);
    }
    .hero-actions {
        justify-content: flex-start;
        gap: 14px;
        margin-bottom: 36px;
        width: 100%;
    }
    .btn {
        padding: 16px 34px;
        font-size: 17px;
        border-radius: 50px;
        flex: 0 1 auto;
        min-width: 160px;
        justify-content: center;
    }
    .btn-primary { padding: 16px 36px; }
    .btn-outline { padding: 16px 34px; }
    .hero-social {
        gap: 30px;
        justify-content: flex-start;
    }
    .hero-social a {
        font-size: 30px;
        color: rgba(255, 255, 255, 0.15);
    }
    .hero-scroll { display: none; }

    body.light .hero-name { color: rgba(0, 0, 0, 0.08); }
    body.light .hero-social a { color: rgba(0, 0, 0, 0.12); }
    body.light .hero-typed { color: rgba(0, 0, 0, 0.2); }
    body.light .typed-text { color: rgba(0, 0, 0, 0.25); }
    body.light .hero-highlight {
        background: linear-gradient(135deg, #1a1a1a 0%, #6b7280 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

@media (max-width: 600px) {
    .hero { padding: 50px 0 32px; }
    .hero-title { font-size: 64px; }
    .hero-name { font-size: 28px; letter-spacing: 0.08em; }
    .hero-highlight { font-size: 64px; }
    .hero-typed { font-size: 20px; gap: 6px; }
    .typed-prefix { font-size: 17px; }
    .typed-text { min-width: 120px; }
    .hero-actions { gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
    .btn {
        font-size: 16px;
        padding: 14px 26px;
        min-width: 140px;
        flex: 1;
        max-width: 190px;
    }
    .btn-primary { padding: 14px 28px; }
    .btn-outline { padding: 14px 26px; }
    .hero-social { gap: 26px; }
    .hero-social a { font-size: 26px; }
}

@media (max-width: 430px) {
    .hero {
        padding: 40px 0 24px;
        min-height: 100vh;
        justify-content: center;
    }
    .hero-title { font-size: 52px; }
    .hero-name {
        font-size: 22px;
        letter-spacing: 0.1em;
        color: rgba(255, 255, 255, 0.12);
    }
    .hero-highlight { font-size: 52px; }
    .hero-typed {
        font-size: 18px;
        gap: 6px;
        margin: 8px 0 12px;
        color: rgba(255, 255, 255, 0.3);
    }
    .typed-prefix {
        font-size: 15px;
        color: var(--gray);
    }
    .typed-text {
        min-width: 100px;
        color: rgba(255, 255, 255, 0.35);
    }
    .hero-actions { gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
    .btn {
        font-size: 15px;
        padding: 12px 20px;
        min-width: 120px;
        max-width: 170px;
        flex: 1;
    }
    .btn-primary { padding: 12px 22px; }
    .btn-outline { padding: 12px 20px; }
    .hero-social { gap: 22px; }
    .hero-social a {
        font-size: 24px;
        color: rgba(255, 255, 255, 0.15);
    }
}

@media (max-width: 360px) {
    .hero { padding: 32px 0 20px; }
    .hero-title { font-size: 44px; }
    .hero-name { font-size: 19px; }
    .hero-highlight { font-size: 44px; }
    .hero-typed { font-size: 16px; color: rgba(255, 255, 255, 0.3); }
    .typed-prefix { font-size: 14px; }
    .typed-text { min-width: 90px; color: rgba(255, 255, 255, 0.35); }
    .btn {
        font-size: 14px;
        padding: 10px 16px;
        min-width: 100px;
        max-width: 150px;
    }
    .hero-social a {
        font-size: 20px;
        color: rgba(255, 255, 255, 0.15);
    }
}

/* ========================================
   ОБЩИЕ СЕКЦИИ
   ======================================== */
section {
    padding: 64px 0;
    border-top: 1px solid var(--border);
}

section:first-of-type {
    border-top: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.section-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    color: var(--gray);
    font-weight: 700;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: lowercase;
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

section {
    border-top: none;
    padding: 64px 0;
}

section:first-of-type {
    border-top: none;
}




/* ========================================
   ОБО МНЕ
   ======================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.about-text p {
    font-size: 17px;
    color: var(--gray);
    margin-bottom: 14px;
    line-height: 1.8;
}

.about-text strong {
    color: var(--pg);
    font-weight: 600;
}

.about-greeting {
    font-size: 22px !important;
    font-weight: 600 !important;
    color: var(--pg) !important;
    margin-bottom: 20px !important;
}

.about-blog-link {
    color: var(--gray);
    text-decoration: none;
    border-bottom: 1px dashed var(--gray);
    transition: all 0.2s;
}

.about-blog-link:hover {
    color: var(--pg);
    border-bottom-color: var(--pg);
}

/* ========================================
   НАВЫКИ
   ======================================== */
.skills-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 6px 20px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--gray);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--pg);
    color: var(--pg);
}

.tab-btn.active {
    background: var(--pg);
    color: var(--bg);
    border-color: var(--pg);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.skill-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--fgo);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.skill-card:hover {
    background: var(--card-hover);
    border-color: var(--pg);
    transform: translateX(4px);
}

.skill-card i {
    font-size: 18px;
    color: var(--gray);
    width: 28px;
    text-align: center;
}

.skill-card span {
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   ПРОЕКТЫ
   ======================================== */
.projects-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 18px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--gray);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--pg);
    color: var(--pg);
}

.filter-btn.active {
    background: var(--pg);
    color: var(--bg);
    border-color: var(--pg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--fgo);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
    backdrop-filter: blur(4px);
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--pg);
    background: var(--card-hover);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
}

.project-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.04);
}

.project-placeholder {
    font-size: 3rem;
    color: var(--gray);
}

.project-info {
    padding: 16px 20px 20px;
}

.project-info h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.project-info p {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.5;
}

.project-tag {
    display: inline-block;
    margin-top: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--gray);
}

.no-projects {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    font-size: 15px;
    grid-column: 1 / -1;
}

/* ========================================
   ТАЙМЛАЙН
   ======================================== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 28px;
    padding-left: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -24px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--pg);
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 4px var(--border);
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-marker {
    background: var(--gray);
    transform: scale(1.15);
}

.timeline-content {
    background: var(--fgo);
    padding: 16px 20px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.timeline-content:hover {
    border-color: var(--pg);
    transform: translateX(6px);
}

.timeline-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--gray);
    font-weight: 700;
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    margin-bottom: 6px;
}

.timeline-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 15px;
    color: var(--gray);
    margin-bottom: 10px;
    line-height: 1.5;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 11px;
    padding: 3px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--gray);
    font-weight: 500;
}

/* ========================================
   ФУТЕР
   ======================================== */
.footer {
    padding: 40px 0 32px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.06);
}

.footer-brand {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.12);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.03);
}

.footer-made {
    color: rgba(255, 255, 255, 0.04);
}

/* ========================================
   КНОПКА ТЕМЫ
   ======================================== */
.floating {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--fgo);
    color: var(--gray);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating:hover {
    border-color: var(--pg);
    color: var(--pg);
    transform: scale(1.05);
}

/* ========================================
   LIGHT THEME
   ======================================== */
body.light .about-text p {
    color: rgba(0, 0, 0, 0.4);
}
body.light .about-text strong {
    color: #000;
}
body.light .about-greeting {
    color: #000 !important;
}
body.light .about-blog-link {
    color: rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(0, 0, 0, 0.2);
}
body.light .about-blog-link:hover {
    color: #000;
    border-bottom-color: #000;
}
body.light .skill-card {
    background: rgba(0, 0, 0, 0.02);
}
body.light .skill-card:hover {
    background: rgba(0, 0, 0, 0.04);
}
body.light .tab-btn.active {
    background: #000;
    color: #fff;
}
body.light .filter-btn.active {
    background: #000;
    color: #fff;
}
body.light .project-card p {
    color: rgba(0, 0, 0, 0.4);
}
body.light .timeline-content {
    background: rgba(0, 0, 0, 0.02);
}
body.light .timeline-content p {
    color: rgba(0, 0, 0, 0.4);
}
body.light .timeline-marker {
    border-color: var(--bg);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}
body.light .footer-brand {
    color: rgba(0, 0, 0, 0.1);
}
body.light .footer-content {
    color: rgba(0, 0, 0, 0.04);
}
body.light .section-line {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.06), transparent);
}
body.light .floating {
    border-color: rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
    color: rgba(0, 0, 0, 0.15);
}
body.light .floating:hover {
    border-color: rgba(0, 0, 0, 0.1);
    color: #000;
}
body.light .tag {
    background: rgba(0, 0, 0, 0.02);
}

/* ========================================
   АДАПТИВ
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    section {
        padding: 40px 0;
    }
    .section-title {
        font-size: 20px;
    }
    .section-number {
        font-size: 14px;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .skills-grid {
        grid-template-columns: 1fr;
    }
    .timeline {
        padding-left: 20px;
    }
    .timeline-marker {
        left: -20px;
        width: 12px;
        height: 12px;
    }
    .timeline-content {
        padding: 14px 16px 16px;
    }
    .timeline-content h3 {
        font-size: 16px;
    }
    .timeline-content p {
        font-size: 14px;
    }
    .floating {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    .section-header {
        gap: 10px;
        margin-bottom: 20px;
    }
    .section-number {
        font-size: 13px;
    }
    .section-title {
        font-size: 18px;
    }
    .about-text p {
        font-size: 15px;
    }
    .about-greeting {
        font-size: 19px !important;
    }
    .skill-card {
        padding: 10px 14px;
    }
    .skill-card span {
        font-size: 13px;
    }
    .projects-filter {
        gap: 4px;
    }
    .filter-btn {
        font-size: 12px;
        padding: 4px 14px;
    }
    .timeline {
        padding-left: 16px;
    }
    .timeline-marker {
        left: -16px;
        width: 10px;
        height: 10px;
    }
    .timeline-content {
        padding: 12px 14px 14px;
    }
    .timeline-content h3 {
        font-size: 15px;
    }
    .timeline-content p {
        font-size: 13px;
    }
    .timeline-year {
        font-size: 11px;
    }
    .tag {
        font-size: 10px;
        padding: 2px 10px;
    }
}