:root {
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f6;

    --text-primary: #1a1d23;
    --text-secondary: #5a616c;
    --text-tertiary: #8a92a0;

    --accent-primary: #2c3e8a;
    --accent-secondary: #3b4db8;
    --accent-light: #e8ecfc;

    --success: #2d6a4f;
    --success-light: #e8f5ed;

    --danger: #b85c5c;
    --danger-light: #fbeded;

    --border: #e2e6ed;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --container-width: 1100px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 249, 251, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    transition: all 0.3s ease;
}

.header-content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
}

.header-links-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.header-toggle-btn {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(44, 62, 138, 0.3);
    transition: all 0.3s ease;
    z-index: 101;
}

.header-toggle-btn:hover {
    background: var(--accent-secondary);
    transform: translate(-50%, -50%) scale(1.1);
}

.header-toggle-btn svg {
    transition: transform 0.3s ease;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.header-link:hover {
    color: var(--accent-primary);
}

.btn-mail-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-mail-modal:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 29, 35, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    box-shadow: var(--shadow-md);
    animation: modalSlide 0.3s ease;
}

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

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-form {
    padding: 24px;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal-form input,
.modal-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-form input:focus,
.modal-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.modal-form textarea {
    resize: vertical;
    min-height: 100px;
}

.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.hero-content {
    text-align: center;
    max-width: 680px;
}

.name {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.title {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 24px;
}

.bio {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-primary);
    transition: all 0.2s ease;
}

.tag:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 32px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.projects {
    padding: 60px 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.project-card {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-card:hover .project-title {
    color: var(--accent-primary);
}

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.project-status {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.project-status.active {
    background: var(--success-light);
    color: var(--success);
}

.project-status.completed {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.project-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tech-badge {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.meta-item svg {
    flex-shrink: 0;
}

.link-indicator {
    color: var(--accent-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.project-card:hover .link-indicator {
    color: var(--accent-secondary);
    transform: translateX(2px);
}

.modal-form .btn-submit {
    width: 100%;
    padding: 12px 20px;
    margin-top: 8px;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-form .btn-submit:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.modal-form .btn-submit:active {
    transform: translateY(0);
}

.modal-form .alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.modal-form .alert.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.modal-form .alert.error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.project-card {
    animation: fadeIn 0.4s ease backwards;
}

.project-card:nth-child(1) {
    animation-delay: 0.05s;
}

.project-card:nth-child(2) {
    animation-delay: 0.1s;
}

.project-card:nth-child(3) {
    animation-delay: 0.15s;
}

.project-card:nth-child(4) {
    animation-delay: 0.2s;
}

.project-card:nth-child(5) {
    animation-delay: 0.25s;
}

.project-card:nth-child(6) {
    animation-delay: 0.3s;
}

@media (max-width: 768px) {
    .main-header {
        transition: transform 0.3s ease;
    }

    .main-header.header-hidden {
        transform: translateY(-100%);
    }

    .header-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 16px;
        right: 16px;
        background: var(--accent-primary);
        color: white;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(44, 62, 138, 0.3);
        z-index: 101;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .header-toggle-btn.show {
        opacity: 1;
        visibility: visible;
    }

    .header-toggle-btn:hover {
        background: var(--accent-secondary);
        transform: scale(1.1);
    }

    .hero {
        min-height: 50vh;
        padding: 60px 0;
    }

    .name {
        font-size: 2rem;
    }

    .bio {
        font-size: 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        gap: 12px;
        flex-direction: column;
    }

    .header-links-wrapper {
        gap: 12px;
        width: 100%;
        justify-content: center;
        transition: all 0.3s ease;
    }

    .header-link,
    .btn-mail-modal {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
}