/* Палитра взята с фото: потолок, стены, круги, полоски */
:root {
  --choc: #3a2b22;
  --cream: #f4eadb;
  --blue: #a8c5df;
  --mustard: #e0a73a;
  --terra: #b94d24;
  --olive: #7f8b4f;
  --navy: #3f4a6e;
  --sage: #9bb0b6;
  --beige: #e3d3b8;
  --ink: #2e231c;
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.125rem/1.65 Nunito, system-ui, sans-serif;
}
h1, h2, h3 { font-family: Comfortaa, Nunito, sans-serif; line-height: 1.2; margin: 0; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); text-align: center; margin-bottom: 2.5rem; }

:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Кнопка ---------- */
.btn {
  font: 800 1.05rem Nunito, sans-serif;
  background: var(--terra);
  color: #fff7ec;
  border: 0;
  border-radius: 999px;
  padding: .9rem 2rem;
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.btn:hover { background: #a2411c; transform: translateY(-2px); }

/* ---------- Шапка: «потолок» с фонариками ---------- */
.hero {
  background: var(--choc);
  color: var(--cream);
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
}
.lanterns { position: relative; height: clamp(190px, 30vw, 360px); }
.lantern {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--s);
  transform: translateX(-50%);
}
.lantern::before {
  content: "";
  display: block;
  width: 1px;
  height: var(--drop);
  margin: 0 auto;
  background: #cdbba0;
}
.lantern i {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    repeating-linear-gradient(180deg, transparent 0 11px, rgba(160, 110, 50, .14) 11px 12px),
    radial-gradient(circle at 50% 60%, #fffaf0 0, #fbe7b8 55%, #ecc984 100%);
  box-shadow: 0 0 70px 12px rgba(255, 205, 120, .28);
}
.hero-text { text-align: center; max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); margin-bottom: 1rem; }
.hero-text p { font-size: 1.25rem; margin: 0 0 2rem; opacity: .9; }

/* ---------- О центре ---------- */
.about { position: relative; overflow: hidden; padding: clamp(3.5rem, 8vw, 6rem) 1.25rem; }
.about-text { position: relative; z-index: 1; max-width: 40rem; margin: 0 auto; font-size: clamp(1.15rem, 2.2vw, 1.35rem); }
.about-text p { margin: 0 0 1.25rem; }
.dots span { position: absolute; border-radius: 50%; }
.dots span:nth-child(1) { background: var(--mustard); width: 150px; height: 150px; left: -60px; top: 12%; }
.dots span:nth-child(2) { background: var(--terra); width: 280px; height: 280px; right: -130px; top: 8%; }
.dots span:nth-child(3) { background: var(--olive); width: 110px; height: 110px; right: 7%; bottom: 4%; }
.dots span:nth-child(4) { background: var(--navy); width: 90px; height: 90px; left: 7%; bottom: 6%; }
@media (max-width: 700px) {
  .dots span:nth-child(3), .dots span:nth-child(4) { display: none; }
}

/* ---------- Педагоги ---------- */
.teachers, .gallery { padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem; }
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 3rem 2rem;
  max-width: 50rem;
  margin: 0 auto;
}
.teacher { text-align: center; }
.teacher:nth-child(4n+1) { --c: var(--mustard); }
.teacher:nth-child(4n+2) { --c: var(--sage); }
.teacher:nth-child(4n+3) { --c: var(--terra); }
.teacher:nth-child(4n+4) { --c: var(--olive); }
.photo { position: relative; width: min(240px, 70%); aspect-ratio: 1; margin: 0 auto 1.5rem; }
.photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c);
  transform: translate(14px, 14px);
}
.photo img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.photo.missing::after {
  content: attr(data-path);
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 1rem;
  border-radius: 50%;
  background: var(--beige);
  font-size: .85rem;
  word-break: break-all;
}
.teacher h3 { font-size: 1.3rem; margin-bottom: .25rem; }
.teacher .role { margin: 0 0 .75rem; color: var(--terra); font-weight: 800; }
.teacher p { margin: 0; }

/* ---------- Карусель ---------- */
.carousel { position: relative; max-width: 70rem; margin: 0 auto; }
.track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .5rem 1rem 1rem;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 min(80%, 520px);
  aspect-ratio: 4 / 3;
  margin: 0;
  scroll-snap-align: center;
  overflow: hidden;
  position: relative;
  background: var(--beige);
  border-radius: var(--radius);
}
.slide:nth-child(even) { border-radius: 50% 50% var(--radius) var(--radius) / 40% 40% var(--radius) var(--radius); }
.slide:nth-child(5n+1) { --c: var(--mustard); }
.slide:nth-child(5n+2) { --c: var(--sage); }
.slide:nth-child(5n+3) { --c: var(--terra); }
.slide:nth-child(5n+4) { --c: var(--olive); }
.slide:nth-child(5n+5) { --c: var(--blue); }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide.missing { background: var(--c); }
.slide.missing::after {
  content: attr(data-path);
  display: grid;
  place-items: center;
  height: 100%;
  padding: 1rem;
  font-weight: 600;
}
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cream);
  font: 400 1.8rem/1 Nunito, sans-serif;
  cursor: pointer;
}
.nav.prev { left: .5rem; }
.nav.next { right: .5rem; }

/* ---------- Контакты: «стена в полоску» ---------- */
.contacts {
  background: repeating-linear-gradient(90deg, var(--blue) 0 18px, var(--cream) 18px 36px);
  padding: clamp(3rem, 7vw, 5rem) 1.25rem 1.5rem;
}
.card {
  max-width: 64rem;
  margin: 0 auto;
  background: var(--cream);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.card h2 { text-align: left; margin-bottom: 1.5rem; }
@media (max-width: 760px) { .card { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: .9rem; }
.contact-list span { display: block; font-size: .9rem; color: #6b5a4c; }
.contact-list a { color: inherit; font-weight: 600; text-decoration-color: var(--terra); text-underline-offset: 3px; }
.map { min-height: 300px; border-radius: 20px; overflow: hidden; background: var(--beige); }
.map iframe { width: 100%; height: 100%; min-height: 300px; border: 0; display: block; }
.map .empty { display: grid; height: 100%; min-height: 300px; place-items: center; padding: 1rem; text-align: center; }
.copy {
  width: fit-content;
  margin: 1.5rem auto 0;
  padding: .3rem 1rem;
  border-radius: 999px;
  background: var(--cream);
  font-size: .9rem;
}

/* ---------- Окно «Перезвоните мне» ---------- */
dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: 100%;
  max-width: min(26rem, calc(100% - 2rem));
  background: var(--cream);
  color: var(--ink);
}
dialog::backdrop { background: rgba(58, 43, 34, .6); }
.dialog-body { position: relative; padding: 2rem 1.75rem 1.75rem; }
.dialog-body h2 { font-size: 1.4rem; text-align: left; margin: 0 2.5rem 1.25rem 0; }
.close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--beige);
  font-size: 1.4rem;
  cursor: pointer;
}
label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 1rem; }
input, textarea {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .7rem .9rem;
  font: inherit;
  border: 2px solid var(--beige);
  border-radius: 14px;
  background: #fffaf2;
}
input:focus, textarea:focus { border-color: var(--navy); outline: none; }
input.invalid { border-color: var(--terra); }
.status { min-height: 1.5em; margin: .75rem 0 0; font-size: 1rem; }
