body 
{ margin: 0; padding: 0; 
text-align: center; transition: background-color 0.3s ease, color 0.3s ease; }
/* Базовый шрифт для английской версии */
body {
  font-family: 'Bradley Hand ITC', cursive;
}

/* Русский шрифт */
body.ru {
  font-family: 'Marmelad', sans-serif;
}

/* Гарантированное применение Marmelad при любой теме */
body.light {
  background-color: #f5f0e6;
  color: #000;
}
body.ru.dark {
  font-family: 'Marmelad', sans-serif;
}

body.ru #tagline {
  font-size: 1.2em;
}
body.dark { background-color: #000; color: #fff; font-family: 'Bradley Hand ITC', cursive; }
body.ru {
  font-family: 'Marmelad', sans-serif;
}

.top-controls { position: absolute; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; }
.top-controls button { padding: 6px 10px; font-size: 0.9em; border: none; border-radius: 5px; cursor: pointer; }

header { padding: 60px 20px 40px; }
h1 { font-size: 4em; margin-bottom: 10px; }
h2 { font-size: 2.5em; margin-bottom: 20px; }
p { font-size: 1.5em; margin: 0 auto; max-width: 600px; }
#about-text p {
  font-size: 0.9em !important;
  line-height: 1.4;
  margin-bottom: 0.8em;
  max-width: none;
}
section { padding: 60px 20px; }
#gallery { padding-top: 40px; }

.grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-top: 30px; }
.card { width: 300px; transition: transform 0.3s ease; }
.card img { width: 100%; border-radius: 8px; cursor: zoom-in; transition: transform 0.3s ease; }
.card img:hover { transform: scale(1.05); }
.card { opacity: 0; transform: translateY(30px); animation: fadeInCard 1s ease-out forwards; }
.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }
/* Добавь больше при необходимости */
@keyframes fadeInCard { to { opacity: 1; transform: translateY(0); } }

footer { padding: 40px 20px; font-size: 0.9em; }

.main-nav {
  position: fixed;
  top: 120px; /* отступ от верхнего края */
  left: 20px; /* прижата к левому краю */
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 1.3em;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 10px;
  opacity: 0;
  animation: fadeInNav 1s ease-out forwards;
  animation-delay: 0.5s;
}

.main-nav a {
  color: inherit;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  background-color: rgba(255,255,255,0.05);
}

@keyframes fadeInNav { to { opacity: 1; } }

body.dark .main-nav a:hover { background-color: #222; }
body.light .main-nav a:hover { background-color: #ddd; }

/* Модальное окно */

@keyframes zoomInFade {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.modal-wrapper.animate {
  animation: zoomInFade 0.6s ease-out forwards;
}
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  text-align: center;
  padding-top: 60px;
}

@keyframes zoomIn { to { transform: scale(1); } }

.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

@keyframes slideInLeft { to { left: 0; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; height: 0; } }

/* Текст */
.banner-text { margin-top: 40px; z-index: 1; }
.banner-text p {
  font-size: 1.5em;
  color: #fff;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

/* Баннер */
.banner {
  position: relative;
  height: 400px;
  overflow: hidden;
  animation: shrinkBanner 2s ease-in forwards;
  animation-delay: 3s, 4s;
}

.banner img {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: slideInLeft 1.5s ease-out forwards;
}

@keyframes shrinkBanner { to { height: 80px; } }

/* Фраза вдохновения */
.inspiration-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: fadeInText 2s ease-out forwards;
  animation-delay: 4.2s;
  z-index: 2;
  text-align: center;
}

@keyframes fadeInText { to { opacity: 1; } }

.header-text {
  margin: 40px auto 20px;
  text-align: center;
  max-width: 800px;
}

.top-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.control-btn {
  width: 40px;
  height: 40px;
  background-color: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.control-btn:hover {
  background-color: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

.control-btn span {
  font-size: 1.2em;
  color: #fff;
}

body.flip {
  animation: flipCanvas 0.8s ease-in-out forwards;
  transform-style: preserve-3d;
}

/* Адаптивные стили текста */
.banner-text h1,
.banner-text p,
.header-text h1,
.header-text p {
  color: inherit;
  text-shadow: none;
}

body.dark .banner-text h1,
body.dark .banner-text p,
body.dark .header-text h1,
body.dark .header-text p {
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

@keyframes flipCanvas {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); opacity: 0.5; }
  100% { transform: rotateY(180deg); opacity: 1; }
}

body {
  transition: transform 0.8s ease-in-out;
  transform-origin: center;
  backface-visibility: hidden;
}

.inspiration-text p {
  font-family: 'Dancing Script', cursive;
  font-style: italic;
  font-size: 1.5em;
  color: inherit;
}

body.light .inspiration-text p {
  text-shadow: none;
}
body.ru #site-title {
  font-size: 2.6em;
}
body.ru #about-text,
body.ru #contact-text {
  font-size: 1.2em;
}
body.ru #footer-text {
  font-size: 0.75em;
}
#footer-text {
  font-size: 1em;
  opacity: 0.8;
}
body.ru h2 {
  font-size: 1.6em;
}

#about-text p {
  font-size: 0.85em !important;
  line-height: 1.4;
  margin: 0 auto 0.8em;
  max-width: 600px;
}
body.ru .main-nav {
  font-size: 1.1em; /* или 1em, если нужно ещё меньше */
}
@media (max-width: 768px) {
  .grid {
    flex-direction: column;
    align-items: center;
  }

  .card {
    width: 90%;
    margin-bottom: 20px;
  }

  .main-nav {
    font-size: 1em;
    flex-direction: column;
    align-items: center;
  }

  .main-nav a {
    padding: 10px;
    display: block;
    text-align: center;
  }

  #about-text, #contact-text {
    font-size: 1em;
    line-height: 1.6;
    padding: 0 10px;
  }

  footer {
    text-align: center;
    font-size: 0.9em;
  }
}
img {
  max-width: 100%;
  height: auto;
}
.sidebar-toggle {
  display: none;
  font-size: 2em;
  padding: 10px;
  cursor: pointer;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  color: #333;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -240px;
  width: 220px;
  height: 100%;
  background-color: rgba(245, 245, 245, 0.85); /* полупрозрачный фон */
  backdrop-filter: blur(6px); /* эффект стекла */
  box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  padding-top: 60px;
  transition: left 0.3s ease;
  z-index: 1000;
}

.sidebar a {
  padding: 15px 20px;
  text-decoration: none;
  color: #333;
  font-size: 1.1em;
}

.sidebar.show {
  left: 0;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }

  .main-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  html[lang="en"] #tagline {
    font-size: 1.5em;
    line-height: 1.7;
  }

  html[lang="en"] .main-nav {
    font-size: 1.2em;
  }

  html[lang="en"] .main-nav a,
  html[lang="en"] .sidebar a {
    font-size: 1.2em;
    padding: 12px 20px;
  }

  html[lang="en"] #about-text,
  html[lang="en"] #about-text p {
    font-size: 1.2em !important;
    line-height: 1.8;
  }

  html[lang="en"] #contact-text {
    font-size: 1.2em;
    line-height: 1.6;
  }

  html[lang="en"] .card .description {
    font-size: 1.2em;
    line-height: 1.6;
  }
}
body.light .card .description {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
#site-title {
  font-size: 3em;
}
.card {
  position: relative;
  overflow: hidden;
}

.card .description {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 10px;
  font-size: 0.9em;
  display: none;
  transition: opacity 0.5s ease;
  opacity: 0;
}
@media (min-width: 769px) {
  .modal-wrapper {
    position: relative;
    display: inline-block;
  }
.modal-content,
#modal-img {
  max-width: 98%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
  cursor: zoom-out;
  transform: scale(1.05);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
  .close {
    position: absolute;
    top: -20px;
    right: -30px;
    font-size: 2em;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    background: none;
    padding: 0;
  }
}


