@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #FDFBF7;           /* Мягкий тёплый кремовый для фона */
    --panel: #F8F5F0;        /* Чуть темнее для блоков */
    --panel2: #F2EEE8;       /* Для границ */
    --text: #2C2C2C;         /* Глубокий графитовый для текста */
    --muted: #77736C;        /* Приглушённый для цитат */
    --accent: #8B6B54;       /* Глубокий тёплый кофе с молоком (акцент) */
    --accent-glow: rgba(139, 107, 84, 0.08);
    --line: rgba(0, 0, 0, 0.06);
    --card-bg: rgba(0, 0, 0, 0.02);
}

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

html, body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--bg);
}

body {
    font-family: 'Inter', Arial, sans-serif;
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    font-size: 18px;
    padding-top: 70px !important; 
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

/* ===== ШАПКА ===== */
header {
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    background: rgba(253, 251, 247, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    height: 70px; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
}

.header-inner {
    width: 100%;
    max-width: 1120px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 19px;
    transition: 0.3s;
    position: relative;
    padding: 6px 0;
    margin: 0;
    display: inline-block;
    line-height: 1.2;
}

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

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

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

h1 span,
.accent {
    color: var(--accent);
}

/* ===== ГЕРОЙ ===== */
.hero {
    text-align: center;
    padding: 25px 0 50px;
}

.hero-avatar {
    display: inline-block;
    padding: 8px;
    border-radius: 24px;
    background: var(--bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.03);
    margin-bottom: 16px;
}

.hero-avatar img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 16px;
    display: block;
    margin: 0 auto;
    background: var(--bg);
}

h1 {
    font-size: clamp(42px, 6vw, 72px);
    line-height: 1.05;
    margin: 16px 0 12px;
    letter-spacing: -0.5px;
    font-weight: 700;
    color: var(--text);
}

.hero-lead {
    color: var(--muted);
    font-size: 20px;
    max-width: 600px;
    margin: 0 auto 24px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.hero-quote {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 40px;
    background: var(--panel);
    border: 1px solid var(--line);
    font-size: 18px;
    color: var(--muted);
    font-style: italic;
    max-width: 100%;
    word-break: break-word;
    margin-top: 6px;
}

/* ===== СТАТИСТИКА ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 20px;
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.stat-number {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
}

.stat-label {
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.9;
}

.stat-desc {
    color: var(--muted);
    font-size: 14px;
    opacity: 0.6;
    margin-top: 2px;
}

/* ===== СЕКЦИИ ===== */
.section {
    padding: 70px 0;
}

.section-title {
    text-align: center;
    font-size: clamp(32px, 4vw, 46px);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -1px;
    color: var(--text);
}

.section-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 19px;
    max-width: 640px;
    margin: 0 auto 40px;
    opacity: 0.8;
    font-style: italic;
}

.section-text {
    color: var(--muted);
    font-size: 19px;
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.9;
}

.section-text .accent-text {
    color: var(--text);
    font-weight: 500;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 32px 28px;
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.card .emoji {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 22px;
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--text);
}

.card p {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
    opacity: 0.9;
}

/* ===== СЕТКИ ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

/* ===== ПРОЕКТЫ ===== */
.project-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 32px 28px;
    transition: 0.3s;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.project-card h3 {
    font-size: 22px;
    margin: 0 0 8px;
    color: var(--text);
}

.project-card p {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
    opacity: 0.9;
}

.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--panel);
    color: var(--accent);
    border: 1px solid var(--line);
    margin-right: 6px;
    margin-top: 10px;
}

/* ===== КОНТАКТЫ ===== */
.contacts {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.contacts a {
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 14px 32px;
    border: 1px solid var(--line);
    border-radius: 40px;
    transition: 0.3s;
    background: var(--bg);
}

.contacts a:hover {
    background: var(--panel);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ===== ДОСТИЖЕНИЯ ===== */
.achievement-list {
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.achievement-list li {
    padding: 16px 22px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
    transition: 0.3s;
}

.achievement-list li:hover {
    border-color: var(--accent);
}

.achievement-list li strong {
    color: var(--text);
}

/* ===== ТАЙМЛАЙН ===== */
.timeline {
    max-width: 760px;
    margin: 0 auto;
}

.timeline-item {
    display: flex;
    gap: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-year {
    min-width: 80px;
    font-weight: 700;
    font-size: 20px;
    color: var(--accent);
}

.timeline-text {
    color: var(--muted);
    font-size: 17px;
    opacity: 0.9;
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: 0.3s;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg);
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-item:hover {
    border-color: var(--accent);
}

.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px;
    background: linear-gradient(transparent, rgba(253, 251, 247, 0.9));
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    text-align: center;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* ===== ЛАЙТБОКС ===== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 251, 247, 0.96);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 98vw;
    max-height: 98vh;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrapper {
    width: 100%;
    height: calc(100% - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.1s ease;
    user-select: none;
    cursor: zoom-in;
}

.lightbox-content .caption {
    margin-top: 8px;
    text-align: center;
    color: var(--text);
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
    padding: 8px 20px;
    background: rgba(253, 251, 247, 0.5);
    border-radius: 8px;
    max-width: 90%;
    backdrop-filter: blur(4px);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 3rem;
    color: var(--text);
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
    z-index: 10;
    line-height: 1;
    font-weight: 300;
}

.close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lightbox-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.04);
    padding: 8px 20px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
}

.nav-btn {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.9);
}

.counter {
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
    min-width: 60px;
    text-align: center;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 40px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    text-decoration: none;
    border: none;
    transition: 0.3s;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
    background: #785a46;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--line);
}

.btn-outline:hover {
    background: var(--panel);
    border-color: var(--accent);
    box-shadow: none;
}

/* ===== ПОДВАЛ ===== */
footer {
    padding: 36px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

footer .stardust {
    font-size: 17px;
    font-style: italic;
    opacity: 0.5;
    margin-bottom: 8px;
}

footer p {
    font-size: 16px;
    opacity: 0.6;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 760px) {
    header { height: auto !important; min-height: 64px; padding: 10px 0; }
    body { padding-top: 64px !important; }
    .nav { gap: 12px 20px; }
    .nav a { font-size: 17px; padding: 4px 0; }
    
    .section { padding: 50px 0; }
    body { font-size: 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; gap: 14px; }
    .timeline-item { flex-direction: column; gap: 4px; }
    .contacts { gap: 12px; }
    .contacts a { padding: 12px 22px; font-size: 16px; }
    .gallery { grid-template-columns: 1fr 1fr; }
    
    .hero-avatar img { max-height: 60vh; }
    .section-text { font-size: 17px; }
    .card p, .project-card p { font-size: 16px; }
}

@media (max-width: 480px) {
    header { height: auto !important; min-height: 58px; padding: 8px 0; }
    body { padding-top: 58px !important; }
    .nav { gap: 8px 14px; }
    .nav a { font-size: 15px; padding: 4px 0; }
    .stats { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: 1fr 1fr; gap: 12px; }
    .gallery-item { aspect-ratio: 1 / 1; }
    
    .hero-avatar img { max-height: 50vh; }
    .hero-quote { font-size: 16px; padding: 10px 16px; }
    .section-title { font-size: 28px; }
    .section-subtitle { font-size: 17px; }
    .hero-lead { font-size: 17px; }
    h1 { font-size: 34px; }
    .lightbox-content img { max-height: 75vh; max-width: 98%; }
    .close-btn { top: 5px; right: 10px; font-size: 2.4rem; }
    .lightbox-nav { gap: 12px; padding: 6px 14px; }
    .nav-btn { width: 38px; height: 38px; font-size: 22px; }
    .counter { font-size: 14px; min-width: 50px; }
    .lightbox-content .caption { font-size: 15px; padding: 6px 14px; margin-top: 4px; }
    .contacts a { font-size: 15px; padding: 10px 18px; }
}