dialog { 
    padding: 1.25rem; 
    border: none; 
    border-radius: 12px; 
}
dialog::backdrop { 
    background: rgba(0,0,0,.5); 
}
.form-actions { 
    display: flex; 
    gap: .5rem; 
    margin-top: 1rem; 
}

/* Базовые стили и сброс */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Светлая тема (по умолчанию) */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --accent-color: #4a6cf7;
    --border-color: #e0e0e0;
    --nav-bg: #f8f9fa;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Темная тема */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --accent-color: #6c8fff;
    --border-color: #444444;
    --nav-bg: #2d2d2d;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Стили шапки */
.site-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow);
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
    margin-right: auto;
}

/* Навигация */
nav ul {
    margin-top: 5px;
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: var(--nav-bg);
}

/* Переключатель темы */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: var(--nav-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-icon {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
}

/* Основное содержимое */
main {
    flex: 1;
}

/* Мобильное меню */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    position: relative;
    transition: background-color 0.3s;
    display: block;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    left: 0;
    transition: transform 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .site-header {
        padding: 1rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        display: none;
    }
    
    nav.active {
        max-height: 300px;
        display: block;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }
    
    nav li {
        width: 100%;
    }
    
    nav a {
        display: block;
        padding: 0.8rem 1rem;
    }
    
    .menu-toggle.active .hamburger {
        background-color: transparent;
    }
    
    .menu-toggle.active .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    
    .menu-toggle.active .hamburger::after {
        transform: rotate(-45deg);
        bottom: 0;
    }
}

/* Стили для галереи */
.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.portfolio-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.portfolio-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Подвал */
.site-footer {
    background-color: #c0c0c1;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #333;
    margin-top: auto; /* Прижимает к низу */
    border-radius: 8px;
}

/* Стили для iframe */
.portfolio-item iframe {
    width: 100%;
    height: 305px;
    border: none;
    border-radius: 12px;
}