/* ============================================================
   АРТ-мастерская «Потешки» — светлая тема
   Палитра из плаката/лого: крем, дерево, терракота, петроль
   ============================================================ */

:root {
  --bg: #faf6ee;
  --bg-alt: #f2ebdd;
  --card: #ffffff;
  --ink: #2e2a26;
  --muted: #5f564a;
  --terra: #a5613f;
  --terra-dark: #8a4c2e;
  --terra-soft: #f3e2d7;
  --petrol: #17505e;
  --petrol-soft: #e0ebee;
  --wood: #8b5a2b;
  --line: #e8ddca;
  --shadow: 0 10px 30px rgba(93, 66, 37, 0.10);
  --shadow-lg: 0 18px 50px rgba(93, 66, 37, 0.16);
  --radius: 20px;
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Montserrat", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 600; }

a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.pre-line { white-space: pre-line; }

/* Боковые деревянные акценты (деликатная память о рамке плаката) */
.side-accent {
  position: fixed; top: 0; bottom: 0; width: 10px; z-index: 5;
  background:
    repeating-linear-gradient(180deg,
      rgba(139, 90, 43, 0.16) 0 140px,
      rgba(139, 90, 43, 0.05) 140px 144px,
      rgba(165, 97, 63, 0.16) 144px 290px,
      rgba(139, 90, 43, 0.05) 290px 294px);
}
.side-accent.left { left: 0; border-right: 1px solid rgba(139, 90, 43, 0.18); }
.side-accent.right { right: 0; border-left: 1px solid rgba(139, 90, 43, 0.18); }
@media (max-width: 1100px) { .side-accent { display: none; } }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--petrol); color: #fff; padding: 8px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Шапка ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex; align-items: center; gap: 24px;
  padding-top: 10px; padding-bottom: 10px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 52px; height: 52px; }
.brand-name {
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; line-height: 1.1;
}
.brand-name small {
  display: block; font-family: var(--font-body); font-weight: 500;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--terra);
}

.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: nowrap; }
.nav a {
  color: var(--ink); font-size: 0.92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { background: var(--terra-soft); text-decoration: none; }

@media (max-width: 1320px) {
  .nav a { font-size: 0.84rem; padding: 7px 9px; }
}
@media (max-width: 1180px) {
  .brand-name { font-size: 1rem; }
  .brand-logo { width: 44px; height: 44px; }
  .nav a { font-size: 0.8rem; padding: 6px 8px; }
  .topbar-actions .btn { font-size: 0.8rem; padding: 8px 14px; }
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.burger {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  background: var(--card); border-radius: 12px; cursor: pointer; position: relative;
}
.burger span, .burger span::before, .burger span::after {
  content: ""; position: absolute; left: 11px; width: 20px; height: 2px;
  background: var(--ink); border-radius: 2px; transition: 0.2s;
}
.burger span { top: 20px; }
.burger span::before { left: 0; top: -6px; }
.burger span::after { left: 0; top: 6px; }

/* Полное меню (6 длинных пунктов + кнопка) помещается только от ~1230px:
   уже — бургер, иначе бренд наезжает на первый пункт в Safari/при иных шрифтах */
@media (max-width: 1220px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 12px 24px 16px; margin: 0;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 1rem; padding: 10px 12px; }
  .topbar-actions .btn { display: none; }
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  padding: 12px 24px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: 0.18s ease; text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); }

.btn-ghost { background: transparent; color: var(--petrol); border-color: var(--petrol); }
.btn-ghost:hover { background: var(--petrol); color: #fff; }

.btn-outline { background: transparent; color: var(--wood); border-color: var(--wood); }
.btn-outline:hover { background: var(--wood); color: #fff; }

.btn-small { padding: 8px 18px; font-size: 0.86rem; }
.btn-wide { width: 100%; }

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 24px;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(23, 80, 94, 0.06), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(165, 97, 63, 0.08), transparent 60%);
}

.hero-grid {
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 40px; align-items: center;
}
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-emblem { display: flex; justify-content: center; }
.hero-emblem img {
  width: min(320px, 70vw); filter: drop-shadow(0 16px 30px rgba(93, 66, 37, 0.22));
  transition: transform 0.6s ease;
}
.hero-emblem:hover img { transform: rotate(8deg) scale(1.02); }

.kicker {
  margin: 0 0 10px; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--terra);
}
.hero .kicker { color: var(--petrol); }

.hero-lead { font-size: 1.12rem; color: var(--muted); max-width: 560px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* Контакты */
.contacts-card {
  margin-top: 44px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; box-shadow: var(--shadow);
}
@media (max-width: 860px) { .contacts-card { grid-template-columns: 1fr; } }

.contact-item { display: flex; gap: 14px; align-items: flex-start; }
.contact-item strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
.contact-item a { font-size: 1.08rem; font-weight: 600; }
.contact-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--terra-soft); color: var(--terra);
  display: flex; align-items: center; justify-content: center;
}
.contact-icon svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- Секции ---------- */

.section { padding: 84px 0; scroll-margin-top: 84px; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-lead { color: var(--muted); font-size: 1.05rem; }
.section-head-actions { margin-top: 22px; }

/* ---------- Карточки ---------- */

.cards-grid { display: grid; gap: 22px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .cards-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .cards-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.card-text { color: var(--muted); margin: 0 0 14px; }

.course-params {
  margin: 0 0 12px; font-size: 0.82rem; font-weight: 600;
  color: var(--wood); text-transform: uppercase; letter-spacing: 0.06em;
}

.price {
  margin: auto 0 14px; font-family: var(--font-head);
  font-size: 1.45rem; font-weight: 700; color: var(--terra);
}

.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card-actions .btn { flex: 1 1 140px; padding: 11px 16px; font-size: 0.9rem; }

.wide-card {
  flex-direction: row; gap: 26px; align-items: center; margin-top: 26px; padding: 30px;
}
.wide-card-text { flex: 1.15; display: flex; flex-direction: column; }
.wide-card .mini-carousel { flex: 1; }
.wide-card.center { flex-direction: column; text-align: center; margin-top: 0; }
@media (max-width: 860px) { .wide-card { flex-direction: column; } }

.xmas { border-left: 6px solid var(--terra); background: linear-gradient(135deg, #fff 60%, #f6ede3); }

.mc-dt {
  display: inline-block; margin: 0 0 10px; padding: 5px 14px; border-radius: 999px;
  background: var(--petrol-soft); color: var(--petrol);
  font-size: 0.85rem; font-weight: 600;
}

.note {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0 0; padding: 16px 20px;
  background: var(--petrol-soft); border-radius: 14px;
  color: var(--petrol); font-weight: 500;
}
.note svg { flex: 0 0 26px; width: 26px; height: 26px; fill: currentColor; }

.cta-line { margin-top: 22px; text-align: center; }
.cta-line .btn { padding: 14px 28px; }

/* ---------- Карусель ---------- */

.carousel { position: relative; margin-top: 40px; }
.carousel-viewport { overflow: hidden; border-radius: var(--radius); }
.carousel-track { display: flex; transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.3, 1); }
.carousel-slide { flex: 0 0 100%; margin: 0; }
.carousel-slide img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius);
}

.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  border: 1px solid var(--line); font-size: 1.5rem; line-height: 1;
  cursor: pointer; box-shadow: var(--shadow); transition: 0.15s;
  display: flex; align-items: center; justify-content: center; padding-bottom: 4px;
}
.carousel-btn:hover { background: var(--terra); color: #fff; }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.carousel-dots button {
  width: 9px; height: 9px; border-radius: 50%; padding: 0;
  border: none; background: rgba(139, 90, 43, 0.25); cursor: pointer; transition: 0.2s;
}
.carousel-dots button.active { background: var(--terra); transform: scale(1.25); }

/* Отзывы */
.reviews-carousel { max-width: 760px; margin-left: auto; margin-right: auto; }
.review-slide { text-align: center; padding: 20px 48px; }
.review-slide blockquote {
  margin: 0 0 14px; font-family: var(--font-head); font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.5; color: var(--ink);
}
.review-slide blockquote::before { content: "« "; color: var(--terra); }
.review-slide blockquote::after { content: " »"; color: var(--terra); }
.review-slide figcaption { color: var(--muted); font-weight: 600; font-size: 0.95rem; }

/* ---------- Split (текст + карусель) ---------- */

.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 34px; align-items: center; }
.split .carousel { margin-top: 0; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- Футер ---------- */

.footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 48px 0 26px; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 16px; max-width: 460px; }
.footer-brand strong { font-family: var(--font-head); font-size: 1.1rem; }
.footer-brand span { display: block; color: var(--muted); font-size: 0.92rem; }
.footer-logo { width: 64px; height: 64px; }
.footer-nav { display: flex; flex-direction: column; gap: 6px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--terra); }

.footer-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.86rem;
}
.footer-bottom .dev b { color: var(--wood); font-weight: 700; letter-spacing: 0.04em; }

/* ---------- Политика конфиденциальности ---------- */

.legal { max-width: 820px; margin: 0 auto; padding: 48px 24px 80px; }
.legal h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.legal h2 { font-size: 1.25rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 22px; }
.legal .back { display: inline-block; margin-bottom: 18px; }

/* ---------- Модальная форма ---------- */

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(46, 42, 38, 0.5); backdrop-filter: blur(3px); }

.modal-card {
  position: relative; width: 100%; max-width: 470px;
  background: var(--card); border-radius: var(--radius); padding: 30px 30px 26px;
  box-shadow: var(--shadow-lg); max-height: 92vh; overflow: auto;
  animation: modal-in 0.25s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.modal-close {
  position: absolute; top: 12px; right: 14px; width: 36px; height: 36px;
  border: none; background: transparent; font-size: 1.7rem; line-height: 1;
  color: var(--muted); cursor: pointer; border-radius: 50%;
}
.modal-close:hover { background: var(--terra-soft); color: var(--terra); }

.modal-context {
  margin: -2px 0 18px; padding: 8px 14px; border-radius: 10px;
  background: var(--terra-soft); color: var(--terra-dark);
  font-size: 0.88rem; font-weight: 600;
}

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; }
.field span em { color: var(--terra); font-style: normal; }
.field span small { color: var(--muted); font-weight: 400; }
.field input {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
  transition: border-color 0.15s;
}
.field input:focus { outline: none; border-color: var(--terra); background: #fff; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 0.84rem; color: var(--muted); }
.check input { margin-top: 3px; accent-color: var(--terra); width: 16px; height: 16px; }

.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; }

.form-status { min-height: 1.4em; margin: 12px 0 0; font-size: 0.9rem; text-align: center; }
.form-status.ok { color: #2e7d46; font-weight: 600; }
.form-status.err { color: #b3402e; }

/* ---------- Мелочи ---------- */

::selection { background: var(--terra-soft); }

@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .hero { padding-top: 48px; }
  .card { padding: 22px; }
  .carousel-btn { width: 38px; height: 38px; }
  .review-slide { padding: 10px 20px; }
}

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