/* ====== Переменные ====== */
:root {
  --bg: #fdf8f2;
  --ink: #333;
  --muted: #6a6a7a;
  --primary: #ff8c42;
  --primary-2: #ff9f66;
  --accent: #6a994e;
  --accent-2: #7ab05e;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(51, 51, 51, .1);
}

/* ====== База ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Nunito', sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; }
img { max-width: 100%; display: block; }
.container { width: min(1200px, 92%); margin: 0 auto; }

/* ====== Вспомогательные классы ====== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ====== Hero ====== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 60px 0 90px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  filter: blur(8px) saturate(1.1);
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
}
.hero-content {
  text-align: center;
}
h1.hero-title {
  font-family: 'Amatic SC', cursive;
  font-size: clamp(60px, 12vw, 120px);
  color: var(--primary);
  margin: 0 0 12px;
  text-shadow: 0 3px 10px rgba(255,140,66,.4);
}
.hero-subtitle {
  font-size: 22px;
  color: var(--muted);
}

/* ====== Masonry Grid ====== */
.masonry-section { padding: 60px 0; }
.masonry-grid {
  column-count: 1; column-gap: 20px;
}
@media (min-width: 640px) { .masonry-grid { column-count: 2; } }
@media (min-width: 1024px) { .masonry-grid { column-count: 3; } }

.masonry-tile {
  break-inside: avoid; margin-bottom: 20px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: white; transition: transform .3s, box-shadow .3s;
}
.masonry-tile:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(51,51,51,.15); }

.tile-content { padding: 28px; text-align: center; }
.tile-content h3 { font-family: 'Amatic SC', cursive; font-size: 28px; color: var(--primary); margin-bottom: 12px; }
.tile-content p { font-size: 16px; color: var(--ink); }

.tile-story { background: linear-gradient(135deg, #fff9f0, #fef3e6); }
.tile-mission { background: linear-gradient(135deg, #f0fff4, #e6f7ed); }
.tile-goals { background: linear-gradient(135deg, #fff0f8, #fce8f5); }
.tile-ach { background: linear-gradient(135deg, #f0f4ff, #e6eefd); }
.tile-partners { background: linear-gradient(135deg, #fffbe6, #fef9d6); }
.tile-social { background: linear-gradient(135deg, #f0e6ff, #ece0f7); }
.tile-cta { background: linear-gradient(135deg, #ff8c42, #ff6b35); }

.mission-big { font-family: 'Amatic SC', cursive; font-size: 36px; color: var(--accent); margin: 0; }
.goals-list { list-style: none; font-size: 17px; font-weight: 700; color: var(--ink); }
.goals-list li { margin: 8px 0; }
.fairy-cta {
  font-family: 'Amatic SC', cursive !important;
  font-size: clamp(38px, 6vw, 56px) !important;
  color: white !important;
  text-shadow: 0 3px 12px rgba(0,0,0,.3);
  margin: 0 !important;
  line-height: 1.2;
}

/* CTA layout (кнопки берут стиль из global styles) */
.cta-section { padding: 40px 0 80px; text-align: center; }
.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ====== Info Sections ====== */
.info-section { padding: 80px 0; }
.section-serials { background: linear-gradient(135deg, #fff9f0, #fef3e6); }
.section-domik { background: linear-gradient(135deg, #f0fff4, #e6f7ed); }
.section-slovlo { background: linear-gradient(135deg, #fff0f8, #fce8f5); }
.section-book-club { background: linear-gradient(135deg, #fffbe6, #fef9d6); }
.section-quiz { background: linear-gradient(135deg, #f0e6ff, #ece0f7); }

.info-content-row { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.info-content-row.reverse-row { flex-wrap: wrap-reverse; }
.info-image-col { flex: 1; min-width: 300px; }
.info-text-col { flex: 1.3; min-width: 300px; }
.info-image { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.info-title { font-family: 'Amatic SC', cursive; font-size: 52px; margin: 0 0 20px; line-height: 1.1; }
.primary-color { color: #ff8c42; }
.accent-color { color: #6a994e; }
.purple-color { color: #d946ef; }
.yellow-color { color: #f59e0b; }
.violet-color { color: #8b5cf6; }
.info-text { font-size: 19px; line-height: 1.7; margin-bottom: 30px; }
.info-button { font-size: 20px; padding: 16px 36px; }

/* ====== ОБНОВЛЕННАЯ СЕКЦИЯ БЛАГОДАРНОСТЕЙ ====== */
.thanks-section {
    padding: 100px 0;
    /* Убран паттерн, оставлен легкий градиент, близкий к фону сайта */
    background: linear-gradient(180deg, #ffffff 0%, #fdf8f2 100%);
    overflow: hidden;
}

.thanks-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.thanks-title {
    font-family: 'Amatic SC', cursive;
    font-size: clamp(48px, 8vw, 72px);
    color: #ff6b9d;
    margin: 0 0 16px;
    text-shadow: 2px 2px 0px #fff;
}

.thanks-subtitle {
    font-size: 19px;
    color: #555;
    max-width: 800px;
    margin: 0 auto 50px;
    line-height: 1.6;
}

/* Карточки с текстом */
.thanks-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 70px;
    text-align: left;
}

.thanks-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 8px 20px rgba(168, 140, 255, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.thanks-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(168, 140, 255, 0.25);
    border-color: #ffb7c5;
}

.card-icon {
    font-size: 32px;
    line-height: 1;
    min-width: 40px;
    text-align: center;
}

.card-text {
    font-size: 17px;
    color: #444;
    line-height: 1.5;
}

/* Галерея Polaroid */
.gallery-title {
    font-family: 'Amatic SC', cursive;
    font-size: 42px;
    color: var(--muted);
    margin-bottom: 40px;
}

.polaroid-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.polaroid-item {
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0s;
    position: relative;
    z-index: 1;
}

.polaroid-frame {
    background: white;
    padding: 12px 12px 45px 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transform: rotate(0deg);
    transition: box-shadow 0.3s;
    width: 260px;
}

.polaroid-frame img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    filter: sepia(10%);
}

.polaroid-item:nth-child(odd) { transform: rotate(-3deg); }
.polaroid-item:nth-child(even) { transform: rotate(2deg); }
.polaroid-item:nth-child(3n) { transform: rotate(-1.5deg) translateY(10px); }

.polaroid-item:hover {
    transform: scale(1.1) rotate(0deg);
    z-index: 10;
}
.polaroid-item:hover .polaroid-frame {
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.thanks-quote {
    margin-top: 80px;
    font-size: 22px;
    color: #ff6b9d;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
}

/* Лайтбокс (Модальное окно) */
.lightbox-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 4px;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.lightbox-close:hover { color: var(--primary); }

/* ====== Футер ====== */
.footer { background: #333; color: #f2efff; margin-top: 40px; border-top-left-radius: 24px; border-top-right-radius: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 22px; padding: 30px 0; }
.footer h3 { margin: 0 0 10px; font-size: 18px; }
.socials { display: flex; gap: 10px; margin-top: 10px; }
.socials img { width: 28px; height: 28px; opacity: .92; transition: .15s; }
.socials img:hover { transform: translateY(-2px); opacity: 1; }
.map-card { border-radius: 16px; overflow: hidden; box-shadow: 0 6px 22px rgba(0,0,0,.25); }
.map-card iframe { width: 100%; height: 220px; border: 0; }
.subscribe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.subscribe input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid #4a4a4a; background: #3c3c3c; color: #fff;
  outline: none; min-width: 220px; font-size: 15px;
}
.subscribe input::placeholder { color: #bdb7d9; }
.subscribe .btn-primary { background: var(--primary); padding: 12px 20px; font-size: 15px; }
.copyright { border-top: 1px solid #4a4a4a; padding: 14px 0; text-align: center; color: #cfcbe6; font-size: 14px; }

/* ====== Адаптив ====== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .masonry-grid { column-count: 1 !important; }
  .info-content-row { gap: 30px; }

  /* Адаптив для благодарностей */
  .polaroid-frame { width: 100%; height: auto; padding: 8px 8px 30px 8px; }
  .polaroid-frame img { height: auto; aspect-ratio: 3/4; }
  .polaroid-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
  .thanks-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .info-title { font-size: 40px; }
}

@media (max-width: 480px) {
    /* Адаптив для благодарностей */
    .polaroid-gallery { grid-template-columns: 1fr; padding: 0 20px; }
    .polaroid-item:nth-child(n) { transform: rotate(0); margin-bottom: 20px; }
}