@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap');

/* ========== CSS VARIABLES ========== */
:root {
  --max-content-width: 1000px;
  --icon-flower-url: url('i/flower.png');
  --icon-duck-url: url('i/duck.png');
  --icon-house-url: url('i/house.png');
  --icon-house-straw: url('i/straw.png');
  --banner-image-url: url('i/header_2.jpg');
  --sun-image-url: url('i/sun.png');
  --icon-size: min(80px, 20vw);
  
  --s: 51px; /* control the size*/
  --c1: #ebf5e6;
  --c2: #fefae0;
  --_l: #0000 34%, var(--c1) 0 41%, #0000 0 59%, var(--c1) 0 66%, #0000 0;
}

/* ========== GLOBAL STYLES ========== */
html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Open Sans', 'Helvetica Neue', sans-serif;
  background: #fffdf7;
  color: #2b3e5e;
  overflow-x: hidden;
}

h1 {
  font-size: clamp(1.8em, 4vw, 3em);
  margin: 0.5em 0 0;
  font-weight: bold;
}

/* ========== MAIN MENU ========== */
.main-menu {
  width: 100%;
  background: linear-gradient(90deg, #e3f2fd 0%, #fffde4 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px 0 rgba(44,62,80,0.10);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5em 0;
}

.main-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2em;
}

.main-menu a {
  text-decoration: none;
  color: #2b3e5e;
  font-weight: 700;
  font-size: 1.1em;
  padding: 0.1em 0.7em;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.main-menu a:hover,
.main-menu a:focus {
  background: #b3e5fc;
  color: #a9743a;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2em;
  margin-right: 1em;
  cursor: pointer;
}

/* ========== ANIMATIONS ========== */
@keyframes cloud-float {
  from { transform: translateY(0); }
  to { transform: translateY(-16px); }
}

.floating-cloud {
  will-change: transform;
}

/* ========== FONTS ========== */
.baloo-2-font {
  font-family: "Baloo 2", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
}

/* ========== LAYOUT ========== */
.center-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70vw;
  max-width: 1100px;
  min-width: 320px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 8px 32px 0 rgba(44, 62, 80, 0.20), 0 1.5px 8px 0 rgba(255, 140, 0, 0.18);
  background: #fefae0;
}

/* ========== BANNER ========== */
.banner {
  width: 100%;
  margin: 0;
  padding: 0;
  background: #fffdf7;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  min-height: auto;
}

.banner-image {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; /* Match banner's content height */
  object-fit: cover;
  z-index: 0;
}

.banner .header,
.banner .main-menu {
  position: relative;
  z-index: 2;
}

/* ========== HEADER ========== */
.header {
  position: relative;
  width: 100%;
  background: #7bbffa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  text-shadow:
    -1px 1px 0 rgba(255, 255, 255, 0.3),
    -0.5px 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.banner .header {
  min-height: 64px;
  padding: 16px 0 12px 0;
  color: #2b3e5e;
  box-shadow: 0 4px 24px 0 rgba(44,62,80,0.3);
  flex-direction: column;
}

.banner .header-text {
  display: flex;
  align-items: flex-end;
  gap: 0.3em;
  width: 100%;
  justify-content: flex-start; /* Align content to the left */
  position: relative;
  text-align: left;            /* Ensure text is left-aligned */
}

.banner .header-text h1 {
  margin: 0;
  font-size: clamp(1.2em, 1.6vw, 2em);
  align-self: flex-end;
  position: relative;
  bottom: 0.8em;       /* Move header text 10px higher */
  margin-left: -0.2em;
}

.header-text {
  font-size: clamp(1.2em, 3vw, 2.5em);
  padding-left: 15%;
}

.header-text h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  margin: 0;
  font-size: clamp(1.2em, 3vw, 2em);
  position: relative;
}

/* ========== SPRITE LAYER ========== */
.sprite-layer {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sprite-layer img {
  position: absolute;
  width: 48px;
  height: auto;
  user-select: none;
}

/* ========== IMAGES ========== */
.label-img {
  width: 5em;
  height: 5em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(160, 207, 111, 0.9);
  padding: 0.2em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  object-fit: contain;
  flex-shrink: 0;
  top: 30px;
  margin: 0;
}

.kids-img {
  position: static;
  display: inline;
  width: 1.2em;
  height: auto;
  vertical-align: middle;
  margin-left: -0.1em;
  margin-top: -0.3em;
}

.icon-img {
  width: var(--icon-size);
  height: auto;
  position: absolute;
  right: 15px;
  bottom: 15px;
}

.banner .icon-img {
  display: none;
}

/* ========== LANGUAGE SWITCH ========== */
.lang-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lang-flags {
  display: flex;
  justify-content: center;
  gap: 0.5em;
}

.lang-labels {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 2px;
  font-size: 0.8em;
  color: #2b3e5e;
  font-family: 'Segoe UI', 'Open Sans', sans-serif;
  opacity: 0.85;
}

.lang-label-en,
.lang-label-ru {
  display: none;
}

.lang-switch.lang-en .lang-label-en {
  display: inline;
}

.lang-switch.lang-ru .lang-label-ru {
  display: inline;
}

.banner .lang-switch {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0;
  overflow: visible;
}

.lang-img {
  width: 32px;
  height: auto;
  display: block;
  transition: width 0.2s, filter 0.2s;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.lang-img:hover,
.lang-img:focus {
  filter: brightness(1.3);
}

/* ========== SUN IMAGE ========== */
.sun-img {
  position: absolute;
  top: -45px;
  left: -55px;
  width: 120px;
  height: auto;
  z-index: 9;
  pointer-events: none;
}

/* ========== PATTERNS ========== */
.pattern-schoolbook {
  background: linear-gradient(45deg, transparent 34%, #ebf5e680 35%, #ebf5e680 40%, transparent 41%, transparent 59%, #ebf5e680 60%, #ebf5e680 65%, transparent 66%), 
              linear-gradient(135deg, transparent 34%, #ebf5e680 35%, #ebf5e680 40%, transparent 41%, transparent 59%, #ebf5e680 60%, #ebf5e680 65%, transparent 66%);
  background-size: 6em 6em;
  background-color: #fefae0;
  opacity: 1;
}

/* ========== CLIPPING ========== */
.diagonal-bottom {
  clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
  position: relative;
  z-index: 1;
}

.diagonal-bottom-2 {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 90%);
  position: relative;
  z-index: 1;
}

.diagonal-top {
  clip-path: polygon(0 10%, 100% 0, 100% 100%, 0 100%);
  position: relative;
  z-index: 1;
}

.diagonal-left {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10% 100%);
  position: relative;
  z-index: 1;
}

.diagonal-right {
  clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%);
  position: relative;
  z-index: 1;
}

.inverse-half-oval-bottom {
  clip-path: path('M0,0 H100% V80% Q50% 100% 0 80% Z');
}

/* ========== SECTIONS ========== */
.section,
.section.media,
.video-section,
.carousel,
.footer {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}

.section {
  flex: unset;
  max-width: unset;
  padding: 30px 30px;
  position: relative;
  margin-bottom: 0;
}

.section h2 {
  color: #2b3e5e;
  font-size: clamp(1.2em, 3vw, 1.8em);
  margin-bottom: 10px;
}

.section p {
  font-size: clamp(0.95em, 2vw, 1em);
  color: #444;
}

.section.media {
  padding: 0;
  box-shadow: 0 8px 16px -6px rgba(44,62,80,0.3);
  z-index: 2;
  position: relative;
}

.section.features {
  background-color: #f0f8ff;
  background-image: var(--icon-flower-url);
  background-repeat: no-repeat;
  background-position: right 15px bottom 15px;
  background-size: min(90px, 20vw);
}

.section.about {
  background-color: #ddefff;
  background-image: var(--icon-duck-url);
  background-repeat: no-repeat;
  background-position: right 15px bottom 15px;
  background-size: min(90px, 20vw);
}

.section.welcome {
  background-color: #ebf5e6;
  background-image: var(--icon-house-url);
  background-repeat: no-repeat;
  background-position: right 15px bottom 15px;
  background-size: min(90px, 20vw);
}

.section.welcome p {
  margin-top: 8px;
  margin-bottom: 8px;
}

.section.contact {
  background-image: var(--icon-house-straw);
  background-repeat: no-repeat;
  background-position: right 15px bottom 15px;
  background-size: min(90px, 20vw);
  padding-bottom: 20px;
}

.section.contact p {
  margin-top: 8px;
  margin-bottom: 8px;
}

.section.group-play {
  margin-bottom: 20px;
}

.section.image {
  padding: 0;
  width: 100%;
}

.section.image img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.section > *:not(img):not(.icon-img):not(.video-section):not(.carousel) {
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* ========== SECTION ROWS ========== */
.section-row {
  display: flex;
  gap: 32px;
  width: 100%;
  justify-content: stretch;
  align-items: flex-start;
  margin-top: -31px !important;
}

.section-row .section {
  flex: 1 1 0;
  max-width: none;
  min-width: 0;
}

.section + .section,
.section-row + .section,
.section + .section-row {
  margin-top: 0;
}

.section:last-child,
.section.media:last-child,
.video-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* ========== SECTION TABLE ========== */
.section-table {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  background: radial-gradient(circle at center, #ffffff 60%, rgba(255, 255, 255, 0));
  padding: 40px 0;
  box-sizing: border-box;
}

/* ========== CAROUSEL ========== */
.carousel {
  width: 100%;
  max-width: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #fffdf7;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}

.carousel-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.carousel-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(32px) brightness(0.9);
  opacity: 0.85;
  transform: scale(1.15);
  transition: background-image 0.4s;
  pointer-events: none;
}

.carousel-slide img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* ========== LISTS ========== */
ul.arrow-list {
  list-style: none;
  padding-left: 0;
}

ul.arrow-list li {
  position: relative;
  padding-left: 1.3em;
  margin-bottom: 0.6em;
  font-size: 1.0em;
}

ul.arrow-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #3498db;
  font-size: 1.2em;
  line-height: 1;
}

/* ========== VIDEO SECTION ========== */
.video-section {
  width: 100%;
  margin: 0 auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.video-section > div {
  position: relative;
  width: 100%;
}

.video-section video {
  width: 100%;
  background: #000;
  display: block;
}

#muteBtn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.7);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

#muteBtn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* ========== BUTTONS ========== */
.btn-row {
  margin-top: 15px;
}

.btn {
  font-size: 1em;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  margin: 0 10px;
  cursor: pointer;
}

.btn.orange {
  background-color: #f9a825;
  color: white;
}

.btn.teal {
  background-color: #4db6ac;
  color: white;
}

/* ========== FOOTER ========== */
.footer {
  margin-top: 0;
  padding-top: 0;
  text-align: center;
  color: #444;
  font-size: 0.8em;
  padding: 24px 0 12px 0;
  background: rgba(249, 199, 79, 0.7);
  margin-bottom: 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: left;
  padding-right: 30px;
}

.footer-content p {
  margin: 4px 0;
  padding: 0;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 900px) {
  .center-block {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    padding: 0;
  }

  .sun-img {
    width: 70px;
    top: -25px;
    left: -25px;
  }

  .banner {
    position: relative;
    min-height: auto;
    z-index: 10; /* Ensure stacking context for menu */
  }

  .banner-image {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; /* Match banner's content height */
    object-fit: cover;
    z-index: 0;
  }

  .section {
    padding: 18px 0;
  }

  .section > *:not(img):not(.icon-img):not(.video-section):not(.carousel) {
    padding-left: 24px;
    padding-right: 24px;
  }

  .banner .lang-switch {
    top: 4px;
    right: 6px;
  }

  .lang-img {
    width: 24px;
  }

  .lang-labels {
    font-size: 0.6em;
  }

  .banner .header {
    padding: 8px 0;
    min-height: 44px;
  }

  .banner .header-text p {
    font-size: 0.95em;
    margin-bottom: 0;
  }

  .section-row {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }

  .section-row .section {
    max-width: unset;
  }

  .diagonal-top {
    clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
  }

  .kids-img {
    margin-bottom: -0.2em;
  }

  /* Mobile Menu */
  .main-menu {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.2em 0.5em;
    z-index: 200;
    position: absolute; /* Overlay menu on top of banner */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 30; /* Higher than carousel and banner */
  }

  .main-menu ul {
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fffdf7ee;
    box-shadow: 0 4px 16px 0 rgba(44,62,80,0.08);
    gap: 1.5em;
    display: none;
    align-items: flex-start;
    padding-top: 2em;
    padding-bottom: 2em;
    padding-left: 10%;
    padding-right: 0;
    z-index: 200;
  }

  .main-menu ul li {
    width: 100%;
    text-align: left;
    
    -webkit-box-shadow: 0 4px 6px -6px #20202033;
    -moz-box-shadow: 0 4px 6px -6px #20202033;
    box-shadow: 0 4px 6px -6px #20202033;


  }

  .main-menu.open ul {
    display: flex;
  }

  .main-menu a {
    padding: 1.2em 1.5em;
    font-size: 1.1em;
    border-radius: 0;
    width: 100%;
    text-align: left;
  }

  .menu-toggle {
    display: block;
    z-index: 203;
  }

  .carousel {
    position: relative;
    z-index: 1;         /* Lower than menu */
  }
}