/* ===== Оформление и анимации — школа № 42 ===== */
:root {
  --primary: #1f5c8b;
  --primary-2: #2a72a8;
  --accent: #e76f51;
  --accent-2: #f4a261;
  --green: #2a9d8f;
  --text: #2d3a45;
  --muted: #6b7a86;
  --bg: #eef4f9;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(31, 92, 139, 0.12);
  --ease: cubic-bezier(.2,.7,.3,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- Шапка ---------- */
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  padding: 14px 24px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  animation: slideDown .7s var(--ease) both;
}
.nav { max-width: 1150px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 12px; background: #fff;
  display: grid; place-items: center; font-size: 22px;
  animation: logoPop 4s ease-in-out infinite;
}
@keyframes logoPop { 0%,100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.12) rotate(-6deg); } 50% { transform: scale(1); } }
nav.menu { display: flex; gap: 6px; flex-wrap: wrap; }
nav.menu a {
  color: #fff; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  position: relative; transition: background .25s, color .25s;
}
nav.menu a::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 0; height: 2px;
  background: var(--accent-2); transition: all .3s var(--ease); transform: translateX(-50%);
}
nav.menu a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
nav.menu a:hover::after { width: 60%; }
nav.menu a.active { background: var(--accent); }
nav.menu a.active::after { display: none; }

/* ---------- Герой ---------- */
.hero { position: relative; overflow: hidden; }
.hero img { width: 100%; height: auto; display: block; }
.shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.shapes span {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,.18);
  animation: floatY var(--d,7s) ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-28px) translateX(10px); } }

/* ---------- Общие секции ---------- */
.container { max-width: 1150px; margin: 0 auto; padding: 0 20px; }
section { padding: 52px 0; }
section h2 { font-size: 32px; color: var(--primary); margin-bottom: 10px; }
section .lead { color: var(--muted); margin-bottom: 30px; max-width: 660px; }
.section-head { text-align: center; }
.section-head .lead { margin: 0 auto 34px; }

/* Появление при скролле */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

/* ---------- Карточки ---------- */
.grid { display: grid; gap: 22px; }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); }
.card {
  background: var(--card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); border: 1px solid #e6eef4;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-8px); box-shadow: 0 18px 40px rgba(31,92,139,.18); border-color: var(--primary-2); }
.card .icon { font-size: 38px; display: inline-block; transition: transform .35s var(--ease); }
.card:hover .icon { transform: scale(1.2) rotate(-6deg); }
.card h3 { font-size: 19px; color: var(--primary); margin: 12px 0 6px; }
.card p, .card a { color: var(--text); }
.card small { display: block; color: var(--muted); margin-top: 8px; }
.card .badge {
  position: absolute; top: -6px; right: 18px; background: var(--accent); color: #fff;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff; padding: 12px 24px;
  border-radius: 999px; font-weight: 700; transition: transform .2s, background .2s, box-shadow .3s;
  box-shadow: 0 6px 16px rgba(231,111,81,.35);
}
.btn:hover { background: #d95f43; transform: translateY(-2px); text-decoration: none; box-shadow: 0 10px 22px rgba(231,111,81,.42); }
.btn.green { background: var(--green); box-shadow: 0 6px 16px rgba(42,157,143,.35); }
.btn.green:hover { background: #23867a; }

/* ---------- Учителя ---------- */
.teacher {
  text-align: center;
}
.avatar {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 4px solid #fff; box-shadow: 0 6px 16px rgba(31,92,139,.25);
  transition: transform .35s var(--ease);
}
.teacher:hover .avatar { transform: scale(1.1) rotate(6deg); }
.teacher .subj { color: var(--accent); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; }
.teacher p.bio { color: var(--muted); font-size: 14.5px; margin-top: 8px; }

/* ---------- Адрес/карта ---------- */
.address-box {
  background: var(--card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); border: 1px solid #e6eef4;
  display: flex; gap: 20px; align-items: flex-start;
}
.address-box .big { font-size: 23px; color: var(--primary); font-weight: 800; }
.map { margin-top: 22px; border: 1px solid #e6eef4; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map iframe { width: 100%; height: 340px; border: 0; display: block; }

/* ---------- Гимн / музыка ---------- */
.anthem { background: linear-gradient(120deg, #fff, #f0f8ff); }
.lyrics { max-width: 560px; margin: 0 auto 24px; padding: 26px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border-left: 6px solid var(--accent); font-style: italic; }
.lyrics p { margin-bottom: 10px; color: #3c4a56; }
.song-player { display: flex; align-items: center; gap: 18px; justify-content: center; flex-wrap: wrap; }
.big-play {
  width: 74px; height: 74px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 28px;
  box-shadow: 0 8px 22px rgba(231,111,81,.5);
  transition: transform .25s, box-shadow .3s; animation: pulseBtn 2.2s infinite;
}
.big-play:hover { transform: scale(1.1); }
.big-play.playing { animation: none; background: var(--green); }
@keyframes pulseBtn { 0%,100% { box-shadow: 0 8px 22px rgba(231,111,81,.5); } 50% { box-shadow: 0 8px 30px rgba(231,111,81,.8); } }

/* эквалайзер */
.eq { display: flex; align-items: flex-end; gap: 5px; height: 46px; }
.eq span { width: 7px; height: 8px; border-radius: 4px; background: var(--accent); }
.eq.playing span { animation: eqbar 0.9s ease-in-out infinite; }
.eq span:nth-child(1){animation-delay:0s} .eq span:nth-child(2){animation-delay:.15s}
.eq span:nth-child(3){animation-delay:.3s} .eq span:nth-child(4){animation-delay:.1s}
.eq span:nth-child(5){animation-delay:.24s}
@keyframes eqbar { 0%,100% { height: 8px; } 50% { height: 46px; } }
.eq:not(.playing) span { height: 14px; }

/* плавающая кнопка музыки */
#musicFab {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 24px;
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
  display: grid; place-items: center;
  transition: transform .25s var(--ease), background .25s;
}
#musicFab:hover { transform: scale(1.12); }
#musicFab.playing { background: var(--green); }
#musicFab .fab-eq { display: flex; align-items: flex-end; gap: 2px; height: 18px; }
#musicFab .fab-eq span { width: 3px; height: 5px; background: #fff; border-radius: 2px; }
#musicFab.playing .fab-eq span { animation: eqbar2 .8s ease-in-out infinite; }
@keyframes eqbar2 { 0%,100% { height: 5px; } 50% { height: 18px; } }

/* ---------- Форма заявки ---------- */
.apply-section { background: linear-gradient(120deg, #fff, #f0f6fb); }
.apply-form {
  max-width: 760px; margin: 0 auto; background: #fff;
  border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow); border: 1px solid #e6eef4;
  display: flex; flex-wrap: wrap; gap: 16px;
}
.apply-form .field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 100%; }
.apply-form .field.w50 { flex: 1 1 calc(50% - 8px); }
.apply-form label { font-weight: 600; color: var(--primary); font-size: 14px; }
.apply-form input, .apply-form select, .apply-form textarea {
  padding: 12px 14px; border: 1.5px solid #d6e3ee; border-radius: 12px;
  font-family: inherit; font-size: 15px; color: var(--text); background: #fafdff;
  transition: border-color .2s, box-shadow .2s;
}
.apply-form input:focus, .apply-form select:focus, .apply-form textarea:focus {
  outline: none; border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(42,114,168,.15);
}
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-green { background: var(--green); box-shadow: 0 6px 16px rgba(42,157,143,.35); }
.btn-green:hover { background: #23867a; }
.form-status { font-weight: 600; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--accent); }
@media (max-width: 620px) { .apply-form .field.w50 { flex-basis: 100%; } }

/* ---------- Подвал ---------- */
footer { background: #1d3347; color: #cdd9e4; padding: 30px 0; text-align: center; font-size: 14px; }
footer a { color: #9fd0f0; }
footer .foot-nav { margin-bottom: 10px; }
footer .foot-nav a { margin: 0 10px; color: #cdd9e4; }

/* ---------- Адаптив ---------- */
@media (max-width: 720px) {
  section h2 { font-size: 26px; }
  .grid.auto { grid-template-columns: 1fr; }
  .shapes { display: none; }
}
