:root {
    color-scheme: light dark;
    /* Light Theme */
    --primary-color: #4f46e5;
    --primary-light: #6366f1;
    --secondary-color: #ec4899;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: #1e293b;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #ffffff;

    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --border-radius: 12px;
    --border-radius-sm: 8px;

    --skill-bar-bg: #f1f5f9;
    --skill-progress-html: linear-gradient(90deg, #4f46e5, #6366f1);
    --skill-progress-js: linear-gradient(90deg, #10b981, #34d399);
    --skill-progress-c: linear-gradient(90deg, #06b6d4, #22d3ee);
    --skill-progress-python: linear-gradient(90deg, #b4437f, #b4437f);
}

.dark-theme {
    --primary-color: #818cf8;
    --primary-light: #6366f1;
    --secondary-color: #f472b6;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-nav: #0f172a;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #ffffff;

    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);

    --skill-bar-bg: #334155;
    --skill-progress-html: linear-gradient(90deg, #4f46e5, #6366f1);
    --skill-progress-js: linear-gradient(90deg, #10b981, #34d399);
    --skill-progress-c: linear-gradient(90deg, #06b6d4, #22d3ee);
    --skill-progress-python: linear-gradient(90deg, #b4437f, #b4437f);
}

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

html, body {
    height: 100%;
}

body {
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.page-container {
    min-height: 100vh; /* фолбэк для старых браузеров */
    min-height: 100svh; /* стабильный минимум: высота экрана с панелями */
    min-height: 100dvh; /* на новых браузерах - актуальная видимая высота */
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

.container {
    max-width: 72rem;
    margin: 0 auto;
    padding-inline: clamp(1rem, calc(0.5rem + 1vw), 2rem);
}

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--text-light);
    padding: 1rem 0;
    padding-top: calc(1rem + env(safe-area-inset-top, 0));
    box-shadow: var(--shadow);
    /* Компенсация для safe-area */
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-name {
    display: flex;
}
.header-title-container {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid red;
}

.header-logo {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
    margin-right: 4px;
}

/* Адаптивные изображения - Техника 1: Базовое адаптивное изображение */
.responsive-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

/* Техника 2: Picture element */
picture {
    display: block;
}

/* Техника 4: Retina display поддержка */
.retina-image {
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    margin-top: 20px;
}

/* Техника 5: Object-fit свойства */
.object-fit-cover {
    object-fit: cover;
}

.object-fit-contain {
    object-fit: contain;
    background: var(--bg-secondary);
}

.object-fit-fill {
    object-fit: fill;
}

.header-logo:hover {
    transform: scale(1.1);
}

/* Skip-link для доступности */
.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    inset-block-start: -100%;
    z-index: 10000;
    padding: 0.5rem 0.75rem;
    background: #111;
    color: #fff;
    border-radius: 0.5rem;
    text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
    inset-block-start: 1rem;
}

/* Видимый фокус */
:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

a, button, input, textarea, select {
    outline-offset: 2px;
}

/* Крупные цели на устройствах с pointer:coarse */
@media (pointer: coarse) {
    a, button, .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
}

.header-title {
    font-size: clamp(1.5rem, calc(1rem + 3vw), 2.5rem);
    font-weight: 700;
    margin: 0;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.navigation {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-nav);
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    /* Компенсация для safe-area (вырезы на iOS) */
    padding-top: env(safe-area-inset-top, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 1rem 2rem;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.main-content {
    padding: 2rem 0;
    background: var(--bg-primary);
}

.profile-section {
    margin-bottom: 3rem;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.profile-card:hover {
    box-shadow: var(--shadow-lg);
}

.profile-image-container {
    flex: 0 0 250px;
}

.profile-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.02);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.profile-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: clamp(1.25rem, calc(1rem + 2vw), 1.75rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.about-text {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.download-btn {
    background: var(--primary-color);
    color: white;
    padding-inline: 1.5rem;
    padding-block: max(0.75rem, calc((44px - 1em) / 2));
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-height: 44px;
}

.download-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.skills-section {
    margin-bottom: 3rem;
}

.skills-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.skill-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateX(5px);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skill-name {
    font-weight: 600;
    color: var(--text-primary);
}

.skill-percent {
    font-weight: 700;
    color: var(--primary-color);
}

.skill-bar {
    height: 8px;
    background: var(--skill-bar-bg);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.html-css-progress {
    width: 25%;
    background: var(--skill-progress-html);
}

.js-progress {
    width: 10%;
    background: var(--skill-progress-js);
}

.c-progress {
    width: 30%;
    background: var(--skill-progress-c);
}

.python-progress {
    width: 70%;
    background: var(--skill-progress-python);
}

.projects-section {
    margin-bottom: 3rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 200px;
    overflow: hidden;
}

.project-image img,
.project-image picture {
    width: 100%;
    height: 100%;
    display: block;
}

.project-image img {
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.project-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.footer {
    background: var(--bg-nav);
    color: var(--text-secondary);
    padding: 2rem 0;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0));
    text-align: center;
    border-top: 1px solid var(--border-color);
    /* Компенсация для safe-area */
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

@media (max-width: 768px) {
    .header-title {
        font-size: 1.4rem;
    }

    .header-title-container {
        gap: 6px;
    }

    .header-logo {
        width: 24px;
        height: 24px;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        text-align: center;
    }

    .profile-card {
        flex-direction: column;
        text-align: center;
    }

    .profile-image-container {
        flex: none;
        width: 200px;
        margin: 0 auto;
    }

    .profile-image {
        height: 250px;
    }

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

    .theme-toggle .theme-text {
        display: none;
    }

    .theme-toggle {
        padding: 0.5rem;
    }

    .retina-image {
        margin-top: 5px;
    }

    /* Адаптивные формы на мобильных */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Предотвращает зум на iOS */
    }

    /* Адаптивные таблицы на мобильных - преобразование в карточки */
    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        margin-bottom: 1rem;
        border: 2px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 1rem;
        background: var(--bg-card);
    }

    .responsive-table td {
        border: none;
        padding: 0.5rem 0;
        text-align: right;
        position: relative;
        padding-left: 50%;
    }

    .responsive-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--text-primary);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .profile-card {
        padding: 1.5rem;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .header-title-container {
        gap: 4px;
    }

    .header-logo {
        width: 20px;
        height: 20px;
    }

    .header-title {
        font-size: 1.2rem;
    }

    /* Дополнительная адаптивность форм на очень маленьких экранах */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.6rem 0.8rem;
        font-size: 16px;
    }

    /* Адаптивные таблицы на очень маленьких экранах */
    .table-wrapper {
        margin: 1rem 0;
    }
}

/* Масштабирование элементов - Техника масштабирования */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    .profile-image {
        height: 350px;
    }

    .project-image {
        height: 250px;
    }
}

/* Поддержка высоких экранов */
@media (min-height: 800px) and (min-width: 1200px) {
    .project-image {
        height: 280px;
    }
}

/* Темная тема для адаптивных элементов */
@media (prefers-color-scheme: dark) {
    .object-fit-contain {
        background: #334155;
    }

    .responsive-table tbody tr:hover {
        background: #334155;
    }
}

/* Адаптивность для печати */
@media print {
    .responsive-image {
        max-width: 100%;
        page-break-inside: avoid;
    }

    .responsive-table {
        page-break-inside: avoid;
    }

    .form-input,
    .form-textarea,
    .form-select {
        border: 1px solid #ccc;
    }
}

/* PROJECTS */
.projects-filter {
    margin-bottom: 2rem;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.filter-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.projects-section {
    margin-bottom: 3rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.project-image img,
.project-image picture {
    width: 100%;
    height: 100%;
    display: block;
}

.project-image img {
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: auto;
}

.project-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.progress-section {
    margin: 2rem 0;
    text-align: center;
}

.progress-info {
    display: inline-block;
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.progress-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.project-card {
    transition: all 0.3s ease;
}

.project-card.hidden {
    display: none;
}

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .filter-buttons {
        justify-content: center;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .project-card {
        margin: 0 auto;
        max-width: 400px;
    }

    .project-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .progress-info {
        padding: 0.75rem 1.5rem;
    }

    .progress-text {
        font-size: 1.25rem;
    }

    .project-content {
        padding: 1rem;
    }

    .project-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .project-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

/* diary */
.record-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-buttons .download-btn,
.form-buttons .cancel-btn {
    flex: 1;
}

.cancel-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.cancel-btn:hover {
    background: var(--text-secondary);
    color: white;
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.progress-record {
    position: relative;
    transition: all 0.3s ease;
}

.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.progress-record:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: #db2777;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .form-buttons {
        flex-direction: column;
    }
    
    .delete-btn {
        opacity: 1; 
    }
}

/*contacts*/
.contacts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-form-section,
.contact-info-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.contact-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231e293b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.25rem;
}

.contact-submit {
    width: 100%;
    margin-top: 1rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
}

.contact-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.contact-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.contact-link,
.contact-text {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.success-message {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    text-align: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .contacts-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form-section,
    .contact-info-section {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .contacts-layout {
        gap: 1.5rem;
    }
    
    .contact-item {
        padding: 0.75rem;
    }
    
    .contact-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .contact-form-section,
    .contact-info-section {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .contact-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .contact-icon {
        margin-top: 0;
    }

    /* Дополнительная адаптивность форм на очень маленьких экранах */
    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.6rem 0.8rem;
        font-size: 16px;
    }
}

/* Адаптивные таблицы */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.responsive-table thead {
    background: var(--primary-color);
    color: var(--text-light);
}

.responsive-table th,
.responsive-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.responsive-table tbody tr {
    transition: background-color 0.3s ease;
}

.responsive-table tbody tr:hover {
    background: var(--bg-secondary);
}

.responsive-table tbody tr:last-child td {
    border-bottom: none;
}

/* Обертка для горизонтальной прокрутки таблиц на мобильных */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
}

/* Масштабирование элементов - Техника масштабирования */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    .profile-image {
        height: 350px;
    }

    .project-image {
        height: 250px;
    }
}

/* Поддержка высоких экранов */
@media (min-height: 800px) and (min-width: 1200px) {
    .project-image {
        height: 280px;
    }
}

/* Темная тема для адаптивных элементов */
@media (prefers-color-scheme: dark) {
    .object-fit-contain {
        background: #334155;
    }

    .responsive-table tbody tr:hover {
        background: #334155;
    }
}

/* Адаптивность для печати */
@media print {
    .responsive-image {
        max-width: 100%;
        page-break-inside: avoid;
    }

    .responsive-table {
        page-break-inside: avoid;
    }

    .form-input,
    .form-textarea,
    .form-select {
        border: 1px solid #ccc;
    }
}

.status-completed {
    color: #10b981 !important;
    font-weight: 600;
}

.status-in-progress {
    color: #f59e0b !important;
    font-weight: 600;
}

.skill-percent[data-id] {
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    user-select: none;
}

.skill-percent[data-id]:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.status-completed:hover {
    background: rgba(16, 185, 129, 0.1) !important;
}

.status-in-progress:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}

@media (max-width: 768px) {
    .skill-percent[data-id] {
        font-size: 0.9rem;
        padding: 0.2rem 0.4rem;
    }
}