.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(220, 38, 38, 0.1);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: var(--primary-color);
    transform: scale(1.1);
    background: var(--bg-light);
    border-radius: 50%;
}

.modal-content h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 700;
}

.modal-content img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.modal-description,
.modal-tech {
    margin-bottom: 24px;
}

.modal-description h4,
.modal-tech h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-color);
    font-weight: 600;
}

.modal-description p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 16px;
}

.modal-links {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 5% auto;
        padding: 24px;
        width: 95%;
    }
    
    .modal-links {
        flex-direction: column;
    }
    
    .modal-links .btn {
        text-align: center;
    }
}
.nav-link { 
    padding: 10px; 
    background: var(--bg-light);
    text-decoration: none;
    color: var(--text-color);
    border: 2px solid transparent;
    display: block;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.nav-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-link.active,
.nav-link[aria-current="page"] {
    background: var(--primary-color);
    color: white;
}

nav ul {
    display: flex; 
    gap: 20px; 
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    margin: 0;
}

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

:root {
--primary-color: #dc2626; /* насыщенный красный вместо фиолетового */
--secondary-color: #b91c1c; /* более тёмный красный */
--accent-color: #d97706; /* тёплый оранжевый для акцентов */
--text-color: #1c1917; /* глубокий тёмно-коричневый текст */
--text-light: #78716c; /* нейтральный серо-коричневый */
--bg-color: #fef7ed; /* тёплый кремовый фон /
--bg-light: #fffbeb; / светлый янтарный фон блоков */
--border-color: #e7e5e4; /* светлая граница */
--success-color: #059669; /* зелёный для успешных индикаторов */
--error-color: #dc2626; /* красный для ошибок */
--shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
--shadow-lg: 0 8px 24px rgba(220, 38, 38, 0.12);
--gradient: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
}

body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
background-image:
radial-gradient(at 10% 20%, rgba(220, 38, 38, 0.03) 0px, transparent 50%),
radial-gradient(at 90% 80%, rgba(217, 119, 6, 0.03) 0px, transparent 50%);
}

.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}

a {
text-decoration: none;
color: inherit;
transition: all 0.3s ease;
}

img {
max-width: 100%;
height: auto;
display: block;
}

/* ===== КНОПКИ ===== */
.btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 24px;
background: var(--gradient);
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
font-weight: 600;
transition: all 0.3s ease;
box-shadow: var(--shadow);
position: relative;
overflow: hidden;
}

.btn::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.5s ease;
}

.btn:hover::before {
left: 100%;
}

.btn:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-lg);
}

.btn-small {
padding: 8px 16px;
font-size: 14px;
}

.btn-secondary {
background: var(--bg-light);
color: var(--text-color);
border: 2px solid var(--border-color);
}

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

/* ===== HEADER ===== */
header {
background-color: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
box-shadow: var(--shadow);
position: sticky;
top: 0;
z-index: 100;
border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

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

.logo {
display: flex;
align-items: center;
gap: 12px;
}

.logo-img {
width: 40px;
height: 40px;
filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.2));
}

.logo h1 {
font-size: 24px;
color: var(--text-color);
font-weight: 700;
background: var(--gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

nav ul {
display: flex;
list-style: none;
gap: 32px;
}

nav a {
color: var(--text-light);
font-weight: 500;
transition: all 0.3s ease;
padding: 8px 0;
position: relative;
}

nav a::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: var(--gradient);
transition: width 0.3s ease;
}

nav a:hover,
nav a.active {
color: var(--primary-color);
}

nav a:hover::after,
nav a.active::after {
width: 100%;
}

/* ===== FOOTER ===== */
footer {
background: linear-gradient(135deg, var(--text-color) 0%, #451a03 100%);
color: white;
padding: 32px 0;
margin-top: 64px;
position: relative;
overflow: hidden;
}

footer::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

footer .container {
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
z-index: 1;
}

.footer-contacts {
display: flex;
gap: 24px;
}

.footer-contacts a {
color: white;
opacity: 0.8;
transition: all 0.3s ease;
padding: 8px 0;
}

.footer-contacts a:hover {
opacity: 1;
transform: translateY(-2px);
}

/* ===== HERO SECTION ===== */
.hero {
padding: 64px 0;
background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
color: white;
position: relative;
overflow: hidden;
}

.hero::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background:
radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(217, 119, 6, 0.1) 0%, transparent 50%);
}

.hero-content {
display: flex;
align-items: center;
gap: 48px;
position: relative;
z-index: 1;
}

.hero-image img {
width: 250px;
height: 250px;
border-radius: 50%;
object-fit: cover;
border: 4px solid rgba(255, 255, 255, 0.2);
box-shadow:
var(--shadow-lg),
inset 0 0 0 4px rgba(255, 255, 255, 0.1);
transition: all 0.3s ease;
}

.hero-image img:hover {
transform: scale(1.05);
border-color: rgba(255, 255, 255, 0.4);
}

.hero-text h2 {
font-size: 42px;
margin-bottom: 16px;
font-weight: 700;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-text p {
font-size: 18px;
margin-bottom: 12px;
opacity: 0.95;
font-weight: 400;
}

.hero-text .btn {
margin-top: 24px;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
}

.hero-text .btn:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
}

/* ===== SKILLS SECTION ===== */
.skills {
padding: 64px 0;
background-color: var(--bg-light);
position: relative;
}

.skills::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.skills h2 {
text-align: center;
font-size: 36px;
margin-bottom: 48px;
font-weight: 700;
color: var(--text-color);
}

.skills-list {
max-width: 800px;
margin: 0 auto;
}

.skill-item {
margin-bottom: 32px;
}

.skill-header {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
}

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

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

.progress-bar {
height: 12px;
background-color: rgba(220, 38, 38, 0.1);
border-radius: 10px;
overflow: hidden;
position: relative;
}

.progress {
height: 100%;
background: var(--gradient);
border-radius: 10px;
transition: width 1s ease;
position: relative;
overflow: hidden;
}

.progress::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
animation: shimmer 2s infinite;
}

@keyframes shimmer {
0% { left: -100%; }
100% { left: 100%; }
}

/* ===== PROJECTS SECTION ===== */
.projects-preview,
.projects-page {
padding: 64px 0;
position: relative;
}

.projects-preview h2,
.projects-page h2 {
text-align: center;
font-size: 36px;
margin-bottom: 48px;
font-weight: 700;
}

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

.project-card {
background: white;
border-radius: 16px;
overflow: hidden;
box-shadow: var(--shadow);
transition: all 0.3s ease;
border: 1px solid rgba(220, 38, 38, 0.1);
position: relative;
}

.project-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: var(--gradient);
transform: scaleX(0);
transition: transform 0.3s ease;
}

.project-card:hover::before {
transform: scaleX(1);
}

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

.project-card img {
width: 100%;
height: 200px;
object-fit: cover;
transition: transform 0.3s ease;
}

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

.project-card h3 {
margin: 16px 20px 8px;
color: var(--text-color);
font-weight: 600;
}

.project-card p {
margin: 0 20px 16px;
color: var(--text-light);
font-size: 14px;
line-height: 1.5;
}

.project-content {
padding: 20px;
}

.tech-tags {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 16px 20px;
}

.tag {
padding: 6px 12px;
background: var(--bg-light);
color: var(--primary-color);
border-radius: 20px;
font-size: 12px;
font-weight: 600;
border: 1px solid rgba(220, 38, 38, 0.1);
transition: all 0.3s ease;
}

.tag:hover {
background: var(--primary-color);
color: white;
transform: translateY(-1px);
}

.project-links {
display: flex;
gap: 12px;
margin-top: 16px;
}

/* ===== FILTER BUTTONS ===== */
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 48px;
}

.filter-buttons {
display: flex;
gap: 12px;
}

.filter-btn {
padding: 10px 20px;
background: var(--bg-light);
border: 2px solid var(--border-color);
border-radius: 25px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
color: var(--text-color);
transition: all 0.3s ease;
}

.filter-btn:hover {
border-color: var(--primary-color);
color: var(--primary-color);
transform: translateY(-2px);
}

.filter-btn.active {
background: var(--gradient);
border-color: transparent;
color: white;
box-shadow: var(--shadow);
}

/* ===== DIARY PAGE ===== */
.diary-page {
padding: 64px 0;
}

.diary-page h2 {
font-size: 36px;
margin-bottom: 48px;
font-weight: 700;
}

.diary-entries {
margin-bottom: 64px;
}

.diary-entry {
background: white;
border-left: 4px solid var(--primary-color);
border-radius: 12px;
padding: 24px;
margin-bottom: 24px;
box-shadow: var(--shadow);
transition: all 0.3s ease;
border: 1px solid rgba(220, 38, 38, 0.1);
}

.diary-entry:hover {
transform: translateX(8px);
box-shadow: var(--shadow-lg);
}

.diary-entry.completed {
border-left-color: var(--success-color);
}

.diary-entry.in-progress {
border-left-color: var(--accent-color);
}

.entry-date {
font-size: 14px;
color: var(--text-light);
margin-bottom: 8px;
font-weight: 500;
}

.entry-content h3 {
font-size: 20px;
margin-bottom: 12px;
color: var(--text-color);
font-weight: 600;
}

.entry-content p {
color: var(--text-light);
margin-bottom: 16px;
line-height: 1.6;
}

.entry-tags {
display: flex;
flex-wrap: wrap;
gap: 8px;
}

/* ===== COURSES PROGRESS ===== */
.courses-progress {
background: var(--bg-light);
padding: 48px;
border-radius: 16px;
margin-bottom: 64px;
border: 1px solid rgba(220, 38, 38, 0.1);
position: relative;
}

.courses-progress::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.courses-progress h2 {
font-size: 28px;
margin-bottom: 32px;
font-weight: 700;
}

.course-item {
margin-bottom: 32px;
}

.course-header {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
}

.course-name {
font-weight: 600;
color: var(--text-color);
font-size: 18px;
}

.course-percent {
font-weight: 600;
color: var(--primary-color);
}

.course-description {
margin-top: 8px;
color: var(--text-light);
font-size: 14px;
line-height: 1.5;
}

/* ===== FORMS ===== */
.add-entry-section,
.contact-form-section {
background: white;
padding: 32px;
border-radius: 16px;
box-shadow: var(--shadow);
border: 1px solid rgba(220, 38, 38, 0.1);
}

.add-entry-section h3,
.contact-form-section h3 {
font-size: 24px;
margin-bottom: 24px;
font-weight: 700;
}

.diary-form,
.contact-form {
max-width: 600px;
}

.form-group {
margin-bottom: 20px;
}

.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
width: 100%;
padding: 12px 16px;
border: 2px solid var(--border-color);
border-radius: 8px;
font-size: 16px;
font-family: inherit;
transition: all 0.3s ease;
background: var(--bg-light);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
outline: none;
border-color: var(--primary-color);
background: white;
box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-message {
display: block;
color: var(--error-color);
font-size: 14px;
margin-top: 4px;
font-weight: 500;
}

.success-message {
color: var(--success-color);
font-size: 14px;
margin-top: 12px;
font-weight: 500;
}

/* ===== CONTACTS PAGE ===== */
.contacts-page {
padding: 64px 0;
}

.contacts-page h2 {
font-size: 36px;
margin-bottom: 48px;
text-align: center;
font-weight: 700;
}

.contacts-wrapper {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 48px;
margin-bottom: 64px;
}

.contact-info-section {
background: var(--bg-light);
padding: 32px;
border-radius: 16px;
border: 1px solid rgba(220, 38, 38, 0.1);
}

.contact-info-section h3 {
font-size: 24px;
margin-bottom: 24px;
font-weight: 700;
}

.contact-item {
display: flex;
align-items: flex-start;
gap: 16px;
margin-bottom: 24px;
}

.contact-icon {
width: 32px;
height: 32px;
flex-shrink: 0;
color: var(--primary-color);
}

.contact-details h4 {
font-size: 16px;
margin-bottom: 4px;
color: var(--text-color);
font-weight: 600;
}

.contact-details p,
.contact-details a {
color: var(--text-light);
font-size: 14px;
line-height: 1.5;
}

.contact-details a:hover {
color: var(--primary-color);
transform: translateX(2px);
}

.social-links {
display: flex;
gap: 12px;
flex-wrap: wrap;
}

.social-link {
padding: 8px 16px;
background: white;
border-radius: 20px;
font-size: 14px;
font-weight: 600;
transition: all 0.3s ease;
border: 1px solid var(--border-color);
}

.social-link:hover {
background: var(--primary-color);
color: white;
transform: translateY(-2px);
border-color: var(--primary-color);
}

.availability {
margin-top: 32px;
padding-top: 24px;
border-top: 2px solid var(--border-color);
}

.availability h4 {
margin-bottom: 8px;
font-weight: 600;
}

.availability p {
color: var(--text-light);
font-size: 14px;
}

.map-section {
text-align: center;
}

.map-section h3 {
font-size: 24px;
margin-bottom: 24px;
font-weight: 700;
}

.map-placeholder {
background: var(--bg-light);
padding: 64px 32px;
border-radius: 16px;
border: 2px dashed var(--border-color);
transition: all 0.3s ease;
}

.map-placeholder:hover {
border-color: var(--primary-color);
background: rgba(220, 38, 38, 0.05);
}

.map-placeholder p {
color: var(--text-light);
font-size: 18px;
line-height: 1.8;
}

/* ===== MODAL ===== */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
}

.modal-content {
background: white;
margin: 5% auto;
padding: 32px;
border-radius: 16px;
width: 90%;
max-width: 600px;
position: relative;
box-shadow: var(--shadow-lg);
border: 1px solid rgba(220, 38, 38, 0.1);
animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
from {
opacity: 0;
transform: scale(0.9) translateY(-20px);
}
to {
opacity: 1;
transform: scale(1) translateY(0);
}
}

.close {
position: absolute;
right: 20px;
top: 20px;
font-size: 28px;
font-weight: bold;
cursor: pointer;
color: var(--text-light);
transition: all 0.3s ease;
}

.close:hover {
color: var(--primary-color);
transform: scale(1.1);
}

.modal-content h3 {
margin-bottom: 16px;
font-weight: 700;
}

.modal-content img {
width: 100%;
border-radius: 12px;
margin-bottom: 16px;
box-shadow: var(--shadow);
}

.modal-links {
display: flex;
gap: 12px;
margin-top: 24px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
header .container {
flex-direction: column;
gap: 16px;
}

text
nav ul {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-content {
    flex-direction: column;
    text-align: center;
}

.hero-text h2 {
    font-size: 32px;
}

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

.page-header {
    flex-direction: column;
    gap: 24px;
}

.filter-buttons {
    flex-wrap: wrap;
    justify-content: center;
}

.contacts-wrapper {
    grid-template-columns: 1fr;
}

footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
}
}

