/* Сброс стилей и базовые настройки */
:root {
    /* Пастельная/классическая цветовая палитра (Светлая тема по умолчанию) */
    --bg-color: #FAFAFA;
    --bg-alt: #F3EFE9;
    --text-main: #333333;
    --text-muted: #666666;
    --accent: #B99D87;
    --accent-hover: #A3856D;
    --border-color: #EAEAEA;
    --header-bg: rgba(250, 250, 250, 0.95);
    /* Яркая и контрастная палитра (South Italian vibe) */
    --bg-color: #FFFCF7;          /* Теплый солнечный белый */
    --bg-alt: #F4F7F6;            /* Легкий средиземноморский бриз (светло-голубовато-серый) */
    --text-main: #0B3948;         /* Глубокий синий (Deep Mediterranean Blue) */
    --text-muted: #5A7684;
    --accent: #E55934;            /* Яркий томатный/терракотовый (Vibrant Tomato/Orange) */
    --accent-hover: #C44525;
    --border-color: #DCE3E6;
    --header-bg: rgba(255, 252, 247, 0.95);
    
    /* Шрифты */
    --font-heading: 'Lora', serif;
    --font-text: 'Montserrat', sans-serif;
}

/* Темная тема */
/* Темная тема (Italian Night) */
[data-theme="dark"] {
    --bg-color: #121212;
    --bg-alt: #1E1E1E;
    --text-main: #E0E0E0;
    --text-muted: #A0A0A0;
    --accent: #D4B8A3;
    --accent-hover: #E8CCB7;
    --border-color: #333333;
    --header-bg: rgba(18, 18, 18, 0.95);
    --bg-color: #0B1C24;          /* Очень темный синий */
    --bg-alt: #122833;            
    --text-main: #F4F1EA;         /* Теплый светлый текст */
    --text-muted: #8AA4B0;
    --accent: #FF7B54;            /* Светящийся коралловый/апельсиновый */
    --accent-hover: #E5633D;
    --border-color: #1F3B4A;
    --header-bg: rgba(11, 28, 36, 0.95);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    font-weight: 300;
    font-weight: 400; /* Чуть плотнее, чем 300, для лучшего контраста */
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-weight: 500; /* Более контрастные и выразительные заголовки */
    margin-bottom: 1rem;
    color: var(--text-main);
    transition: color 0.4s ease;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

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

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

ul {
    list-style: none;
}

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

.section {
    padding: 120px 0;
}

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

.text-muted {
    color: var(--text-muted);
}

.bg-light {
    background-color: var(--bg-alt);
    transition: background-color 0.4s ease;
}

/* Анимации при скролле */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--accent);
    color: #fff;
    font-family: var(--font-text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.btn:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

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

.btn-outline:hover {
    background-color: var(--text-main);
    color: var(--bg-color);
}

/* Шапка (Header) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    backdrop-filter: blur(5px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    transition: padding 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

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

.logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    font-style: italic;
    letter-spacing: 1px;
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-list a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}
.theme-toggle:hover {
    color: var(--accent);
}

/* Бургер меню */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-main);
    transition: 0.3s;
}

/* Главный экран (Hero) */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://picsum.photos/1920/1080?random=10');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding-top: 60px;
}

.hero h1 {
    color: #fff;
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: 300;
}

/* Обо мне (About) */
.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 2px;
    box-shadow: 10px 10px 0 var(--bg-alt);
    transition: box-shadow 0.4s ease;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 1.5rem;
}

/* Фото дня и Календарь */
.pod-container {
    display: flex;
    gap: 40px;
    align-items: stretch;
    background: var(--bg-color);
    padding: 30px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.pod-image-wrapper {
    flex: 1.5;
    position: relative;
    overflow: hidden;
}

.pod-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: transform 0.4s ease;
}
.pod-image-wrapper img:hover {
    transform: scale(1.02);
}

.pod-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 8px 15px;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
    border-radius: 2px;
}

.pod-calendar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.calendar-header {
    text-align: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.cal-day-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 10px;
}

.cal-day {
    padding: 10px 5px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.cal-day:hover:not(.empty) {
    background-color: var(--bg-alt);
    border-color: var(--accent);
}

.cal-day.active {
    background-color: var(--accent);
    color: #fff;
    font-weight: 500;
}

.cal-day.empty {
    cursor: default;
}

/* Истории (Stories) */
.stories {
    overflow: hidden;
}

.story-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 60px;
}
.story-block:last-child {
    margin-bottom: 0;
}

.story-text {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.story-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin; /* Firefox */
}
.story-gallery::-webkit-scrollbar {
    height: 6px;
}
.story-gallery::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.story-img {
    flex: 0 0 auto;
    width: 300px; /* Фиксированная ширина для скролла */
    height: 400px;
    border-radius: 2px;
    overflow: hidden;
}
.story-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.4s ease;
}
.story-img img:hover {
    transform: scale(1.05);
}

/* Портфолио (Portfolio) */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: none;
    font-family: var(--font-text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 5px 10px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.filter-btn.active, .filter-btn:hover {
    color: var(--text-main);
    border-bottom-color: var(--accent);
}

.portfolio-grid {
    column-count: 3;
    column-gap: 20px;
}

.portfolio-item {
    overflow: hidden;
    position: relative;
    border-radius: 2px;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
    cursor: pointer;
}

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

.portfolio-item.hide {
    display: none;
}

/* Контакты (Contact) */
.contact-container {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
}

.contact-details {
    margin: 20px 0;
}

.contact-details p {
    margin-bottom: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

.contact-form {
    flex: 1;
    background: var(--bg-color);
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-family: var(--font-text);
    font-size: 0.95rem;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: border-color 0.3s, background-color 0.4s ease, color 0.4s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-success {
    margin-top: 15px;
    color: #4F8A10;
    background-color: #DFF2BF;
    padding: 10px;
    border-radius: 2px;
    font-size: 0.9rem;
}
[data-theme="dark"] .form-success {
    color: #a4ebb4;
    background-color: #2e4d35;
}

/* Подвал (Footer) */
.footer {
    background-color: #000;
    color: #888;
    text-align: center;
    padding: 30px 0;
    font-size: 0.85rem;
}

/* Лайтбокс */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 20px;
    z-index: 2001;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--accent);
}

.lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 4rem;
    line-height: 1;
}

.lightbox-prev {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Прелоадер */
.preloader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}
.preloader-content {
    text-align: center;
}
.preloader-logo {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 20px;
    letter-spacing: 2px;
}
.preloader-line {
    width: 0;
    height: 2px;
    background-color: var(--accent);
    animation: loadLine 1.5s ease forwards;
}
@keyframes loadLine {
    to { width: 100%; }
}

/* Кастомный курсор */
@media (pointer: fine) {
    body, a, button, .lightbox-trigger {
        cursor: none !important;
    }
    .custom-cursor {
        position: fixed;
        top: 0; left: 0;
        width: 20px; height: 20px;
        border-radius: 50%;
        background-color: rgba(185, 157, 135, 0.6); /* accent color with opacity */
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: transform 0.2s ease, width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
        backdrop-filter: invert(20%);
    }
    .custom-cursor.hover {
        width: 50px; height: 50px;
        background-color: rgba(185, 157, 135, 0.2);
        border: 1px solid var(--accent);
    }
}

/* Слайдер и Параллакс на главном экране (Hero) */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding-top: 60px;
    position: relative;
    overflow: hidden;
}

.hero-slider {
    position: absolute;
    top: -10%; left: 0; right: 0; bottom: -10%; /* Extra height for parallax */
    z-index: 1;
    will-change: transform;
}

.hero-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Пленочное зерно (Film Grain) */
.film-grain {
    position: fixed;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    width: 200%; height: 200%;
    /* baseFrequency увеличен до 2.5 (зерно мельче), opacity снижен до 0.04 (менее заметное) */
    background: transparent url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="2.5" numOctaves="2" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.04"/%3E%3C/svg%3E');
    pointer-events: none;
    z-index: 9998;
    /* Анимация замедлена */
    animation: grain 4s steps(10) infinite;
}
@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* Раскиданные полароиды */
.polaroids-section {
    position: relative;
}
.polaroid-desk {
    position: relative;
    height: 500px;
    margin-top: 40px;
}
.polaroid {
    position: absolute;
    background: #fff;
    padding: 15px 15px 50px 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    cursor: grab;
    transition: box-shadow 0.3s, transform 0.1s;
    user-select: none;
}
.polaroid:active {
    cursor: grabbing;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}
.polaroid img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    pointer-events: none;
}
.polaroid-caption {
    position: absolute;
    bottom: 15px; left: 0; right: 0;
    text-align: center;
    font-family: 'Shadows Into Light', cursive, var(--font-heading);
    font-size: 1.1rem;
    color: #333;
    pointer-events: none;
}
/* Скроем полароиды на мобильных, так как drag'n'drop сложен на тачах */
@media (max-width: 768px) {
    .polaroids-section { display: none; }
}

/* Магнитные элементы */
.magnetic {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Текст внутри курсора */
.cursor-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: bold;
    color: #000;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.custom-cursor.hover-img {
    width: 80px; height: 80px;
    background-color: rgba(255,255,255,0.9);
    backdrop-filter: none;
    border: none;
}
.custom-cursor.hover-img .cursor-text {
    opacity: 1;
}

/* Адаптивность (Mobile) */
@media (max-width: 992px) {
    .pod-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    h2 {
        font-size: 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }

    .about-container,
    .contact-container {
        flex-direction: column;
        gap: 30px;
    }

    .about-image {
        order: -1;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-bg);
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .portfolio-grid {
        column-count: 1;
    }
    
    .lightbox-prev, .lightbox-next {
        font-size: 2rem;
        padding: 10px;
    }
}
