/* ============================================================
   style.css — Стилизация, анимации, адаптивность
   Проект: Поздравительная страница «С рождением сына!»
   ============================================================ */

/* ======= 1. СБРОС СТИЛЕЙ (RESET) ======= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    display: block;
    max-width: 100%;
}

input,
textarea,
button {
    font: inherit;
    color: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: normal;
    line-height: 1.2;
}

/* ======= 2. CSS-ПЕРЕМЕННЫЕ (ПАЛИТРА) ======= */
:root {
    /* Основные цвета */
    --color-gold: #FFD700;
    --color-gold-light: #FFF3A0;
    --color-light-blue: #87CEEB;
    --color-light-blue-light: #B0E0F6;
    --color-dark-blue: #2C3E50;
    --color-white: #FFFFFF;
    --color-cream: #FFF8F0;
    --color-soft-gray: #F0F4F8;

    /* Шрифты */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Размеры */
    --container-max-width: 1200px;
    --container-padding: 20px;

    /* Анимации */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
    --transition-slow: 0.8s ease;

    /* Тени */
    --shadow-soft: 0 4px 20px rgba(44, 62, 80, 0.1);
    --shadow-medium: 0 8px 30px rgba(44, 62, 80, 0.15);
    --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
}

/* ======= 3. БАЗОВЫЕ СТИЛИ ======= */
body {
    font-family: var(--font-body);
    color: var(--color-dark-blue);
    background: linear-gradient(170deg, #E8F4FD 0%, #F5F9FF 30%, var(--color-white) 60%, #FEFCF5 100%);
    background-attachment: fixed;
    opacity: 0;
    animation: fadeInPage 1.2s ease forwards;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gold);
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

/* ======= 4. АНИМАЦИИ (KEYFRAMES) ======= */

/* 4.1. Плавное появление страницы при загрузке */
@keyframes fadeInPage {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* 4.2. Эффект сияния (glow) */
@keyframes glow {
    0% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3), 0 0 10px rgba(255, 215, 0, 0.1);
    }
    25% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3), 0 0 30px rgba(135, 206, 235, 0.2);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4), 0 0 50px rgba(135, 206, 235, 0.3);
    }
    75% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3), 0 0 30px rgba(135, 206, 235, 0.2);
    }
    100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3), 0 0 10px rgba(255, 215, 0, 0.1);
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* 4.3. Появление блоков при скролле (fade-in + slide-up) */
@keyframes fadeInSlideUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInSlideLeft {
    0% {
        opacity: 0;
        transform: translateX(-40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInSlideRight {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 4.4. Классы для анимации при скролле */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-animate--visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate--left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-animate--left.scroll-animate--visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate--right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.scroll-animate--right.scroll-animate--visible {
    opacity: 1;
    transform: translateX(0);
}

/* 4.5. Сердечки падающие */
@keyframes heartFall {
    0% {
        transform: translateY(-10vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg) scale(1);
        opacity: 0;
    }
}

/* 4.6. Пульсация для кнопки */
@keyframes btnPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.5);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* ======= 5. СТИЛИ БЛОКОВ ======= */

/* 5.1. Hero / Шапка */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(135, 206, 235, 0.15) 0%, transparent 70%);
}

.hero__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 4rem 1.5rem;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    color: var(--color-gold);
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
    animation: glow 3s ease-in-out infinite;
    letter-spacing: 2px;
}

.hero__subtitle {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 1.3rem;
    color: var(--color-dark-blue);
}

.hero__parents {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark-blue);
    animation: glow 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.hero__date {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-dark-blue);
    opacity: 0.85;
    animation: glow 3s ease-in-out infinite;
    animation-delay: 1s;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(135, 206, 235, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* 5.2. Поздравительный блок */
.congrats {
    padding: 5rem 0;
    background: linear-gradient(180deg, rgba(135, 206, 235, 0.08) 0%, transparent 100%);
}

.congrats__content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.congrats__text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--color-dark-blue);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 215, 0, 0.15);
}

/* 5.3. Таймер */
.timer {
    padding: 5rem 0;
    text-align: center;
}

.timer__display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.timer__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    min-width: 130px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.timer__item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.timer__value {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-gold);
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    line-height: 1;
}

.timer__label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-dark-blue);
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* 5.4. Кнопка салюта */
.firework-section {
    padding: 3rem 0 5rem;
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn--firework {
    background: linear-gradient(135deg, var(--color-gold), #FFC700);
    color: var(--color-dark-blue);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: btnPulse 2s ease-in-out infinite;
}

.btn--firework:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

.btn--firework:active {
    transform: translateY(0) scale(0.98);
}

.btn--submit {
    background: linear-gradient(135deg, var(--color-light-blue), #6BB5D9);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.4);
}

.btn--submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.6);
}

.btn--submit:active {
    transform: translateY(0);
}

/* 5.5. Гостевая книга */
.guestbook {
    padding: 5rem 0;
    background: linear-gradient(0deg, rgba(135, 206, 235, 0.08) 0%, transparent 100%);
}

.guestbook__form {
    max-width: 600px;
    margin: 0 auto 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(135, 206, 235, 0.2);
}

.guestbook__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guestbook__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-dark-blue);
    opacity: 0.8;
}

.guestbook__input,
.guestbook__textarea {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border: 2px solid rgba(44, 62, 80, 0.12);
    border-radius: 12px;
    background: var(--color-white);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.guestbook__input:focus,
.guestbook__textarea:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.12);
}

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

.guestbook__list {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Пожелание (карточка) */
.wish-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 215, 0, 0.12);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.wish-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.wish-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.wish-card__name {
    font-weight: 700;
    color: var(--color-gold);
    font-size: 1.05rem;
}

.wish-card__date {
    font-size: 0.8rem;
    color: var(--color-dark-blue);
    opacity: 0.5;
}

.wish-card__text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-dark-blue);
}

.wish-card__empty {
    text-align: center;
    color: var(--color-dark-blue);
    opacity: 0.5;
    padding: 2rem;
    font-style: italic;
}

/* 5.6. Подвал */
.footer {
    padding: 2rem 0;
    text-align: center;
    background: var(--color-dark-blue);
    color: rgba(255, 255, 255, 0.7);
}

.footer__text {
    font-size: 0.9rem;
}

/* ======= 6. ФЕЙЕРВЕРК И СЕРДЕЧКИ (контейнеры) ======= */

.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Частица фейерверка */
.firework-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: fireworkExplode 1.5s ease-out forwards;
}

@keyframes fireworkExplode {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0);
    }
}

/* Падающее сердечко */
.heart-particle {
    position: absolute;
    font-size: 1.5rem;
    animation: heartFall linear infinite;
    opacity: 0;
}

/* ======= 7. АДАПТИВНОСТЬ (MEDIA QUERIES) ======= */

/* Десктопы большие: 1200px+ */
@media (min-width: 1200px) {
    .hero__title {
        font-size: 5rem;
    }

    .hero__parents {
        font-size: 2.2rem;
    }

    .container {
        padding: 0 30px;
    }
}

/* Планшеты: 768px - 1199px */
@media (max-width: 1199px) and (min-width: 768px) {
    .hero__title {
        font-size: 3.5rem;
    }

    .hero__parents {
        font-size: 1.8rem;
    }

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

    .timer__item {
        min-width: 110px;
        padding: 1.2rem 1.5rem;
    }

    .timer__value {
        font-size: 2.5rem;
    }

    .congrats__text {
        padding: 2rem;
        font-size: 1.05rem;
    }
}

/* Мобильные устройства: 480px - 767px */
@media (max-width: 767px) {
    .hero {
        min-height: 80vh;
    }

    .hero__title {
        font-size: 2.5rem;
    }

    .hero__parents {
        font-size: 1.4rem;
    }

    .hero__subtitle {
        font-size: 1.1rem;
    }

    .hero__container {
        padding: 3rem 1rem;
    }

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

    .congrats {
        padding: 3rem 0;
    }

    .congrats__text {
        padding: 1.5rem;
        font-size: 1rem;
        border-radius: 16px;
    }

    .timer {
        padding: 3rem 0;
    }

    .timer__display {
        gap: 1rem;
    }

    .timer__item {
        min-width: 80px;
        padding: 1rem;
        border-radius: 12px;
    }

    .timer__value {
        font-size: 2rem;
    }

    .timer__label {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    .firework-section {
        padding: 2rem 0 3rem;
    }

    .btn {
        padding: 0.85rem 2rem;
        font-size: 1rem;
    }

    .guestbook {
        padding: 3rem 0;
    }

    .guestbook__form {
        padding: 1.5rem;
        gap: 1.2rem;
    }

    .guestbook__input,
    .guestbook__textarea {
        padding: 0.7rem 1rem;
    }
}

/* Маленькие мобильные: до 479px */
@media (max-width: 479px) {
    .hero__title {
        font-size: 2rem;
    }

    .hero__parents {
        font-size: 1.2rem;
    }

    .hero__date {
        font-size: 1rem;
    }

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

    .timer__display {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .timer__item {
        min-width: auto;
        padding: 0.85rem;
    }

    .timer__value {
        font-size: 1.8rem;
    }

    .congrats__text {
        padding: 1.2rem;
        border-radius: 12px;
    }

    .guestbook__form {
        padding: 1.2rem;
    }

    .wish-card {
        padding: 1rem;
    }
}
