/* ============================================================
   Традиција — design tokens
   Palette drawn from the ensemble's own costume: madder red,
   charcoal, ivory linen, aged gold thread.
   ============================================================ */

:root {
  --ivory: #efe4cb;
  --ivory-light: #faf5e8;
  --ink: #241b16;
  --red: #9c2b2b;
  --red-deep: #6f1f1f;
  --gold: #b8862e;

  --font-display: "Yeseva One", "PT Serif", serif;
  --font-body: "PT Sans", system-ui, sans-serif;

  --wrap: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--ivory-light);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--red-deep);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.12; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; color: var(--ink); }

p { margin: 0 0 1em; max-width: 62ch; }

a { color: var(--red-deep); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- signature motif: embroidered sawtooth strip ---------- */

.stitch-strip {
  height: 16px;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16'%3E%3Cpolygon points='0,16 8,0 16,16' fill='%239c2b2b'/%3E%3Cpolygon points='16,16 24,0 32,16' fill='%23241b16'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 32px 16px;
}

/* ---------- header ---------- */

.site-header {
  background: var(--ivory-light);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(36, 27, 22, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 20px;
  height: 20px;
  background: var(--red);
  transform: rotate(45deg);
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--red-deep);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.97rem;
}

.main-nav a:hover { color: var(--red-deep); }

/* nav dropdown ("ЗА НАС") */

.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
  font-family: var(--font-body);
  font-size: 0.97rem;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-dropdown-toggle:hover { color: var(--red-deep); }

.nav-dropdown-toggle .caret {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 160ms ease;
}

.nav-dropdown-toggle[aria-expanded="true"] .caret { transform: rotate(225deg); margin-top: 3px; }

.nav-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: calc(100% + 14px);
  left: -14px;
  min-width: 230px;
  background: var(--ivory-light);
  border: 1px solid rgba(36, 27, 22, 0.14);
  box-shadow: 6px 6px 0 rgba(156, 43, 43, 0.12);
  display: none;
  z-index: 30;
}

.nav-dropdown-menu.open { display: block; }

.nav-dropdown-menu li a {
  display: block;
  padding: 9px 18px;
  font-size: 0.93rem;
  white-space: nowrap;
}

.nav-dropdown-menu li a:hover { background: var(--ivory); }

.nav-cta {
  background: var(--red);
  color: var(--ivory-light) !important;
  padding: 8px 16px;
  border-radius: 2px;
}

.nav-cta:hover { background: var(--red-deep); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  height: 2px;
  background: var(--ink);
  width: 100%;
}

/* ---------- hero ---------- */

.hero {
  padding: 64px 0 56px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-kicker {
  font-size: 0.95rem;
  color: var(--red);
  margin-bottom: 0.6em;
}

.hero-lede {
  font-size: 1.1rem;
  max-width: 46ch;
}

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

.hero-figure {
  margin: 0;
  justify-self: center;
}

.hero-figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 10px solid var(--ivory-light);
  outline: 1px solid rgba(36, 27, 22, 0.15);
  box-shadow: 10px 10px 0 rgba(156, 43, 43, 0.15);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  text-decoration: none;
  font-size: 1rem;
  border-radius: 2px;
  border: 2px solid transparent;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn-primary {
  background: var(--red);
  color: var(--ivory-light);
  border-color: var(--red);
}

.btn-primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--red-deep);
  border-color: var(--red-deep);
}

.btn-ghost:hover {
  background: var(--red-deep);
  color: var(--ivory-light);
}

/* ---------- about ---------- */

.about { padding: 56px 0; }

.about-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  align-items: start;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 3.4rem;
  color: var(--gold);
  margin: 0;
  line-height: 1;
}

.stat-label {
  margin: 0.4em 0 0;
  max-width: 24ch;
}

.about-tagline {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--red-deep);
  margin-top: 1.4em;
}

/* ---------- mission / vision / goal ---------- */

.values { padding: 0 0 64px; }

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.value-card {
  background: var(--ivory);
  padding: 26px 22px 24px;
  position: relative;
  border: 1px solid rgba(36, 27, 22, 0.14);
}

.value-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpolygon points='0,10 5,0 10,10' fill='%239c2b2b'/%3E%3Cpolygon points='10,10 15,0 20,10' fill='%23b8862e'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 20px 10px;
}

.value-card h3 { margin-top: 0.8em; }

/* ---------- what we develop ---------- */

.develop { padding: 56px 0; }

.develop-inner p { max-width: 74ch; }

/* ---------- leader ---------- */

.leader { padding: 0 0 64px; }

.leader-card {
  background: var(--ivory);
  border: 1px solid rgba(36, 27, 22, 0.14);
  padding: 26px 30px;
  position: relative;
  max-width: 560px;
}

.leader-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpolygon points='0,10 5,0 10,10' fill='%239c2b2b'/%3E%3Cpolygon points='10,10 15,0 20,10' fill='%23b8862e'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 20px 10px;
}

.leader-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--red-deep);
  margin: 8px 0 0.4em;
}

.leader-bio { margin: 0; }

/* ---------- groups ---------- */

.groups { padding: 56px 0 64px; }

.group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.group-card {
  background: var(--ivory);
  padding: 26px 22px 24px;
  position: relative;
  border: 1px solid rgba(36, 27, 22, 0.14);
}

.group-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpolygon points='0,10 5,0 10,10' fill='%239c2b2b'/%3E%3Cpolygon points='10,10 15,0 20,10' fill='%23b8862e'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 20px 10px;
}

.group-meta {
  margin: 1em 0 0;
  padding: 0;
}

.group-meta > div {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(36, 27, 22, 0.12);
}

.group-meta dt {
  font-weight: 700;
  min-width: 4.2em;
  color: var(--red-deep);
}

.group-meta dd { margin: 0; }

/* ---------- costume gallery ---------- */

.gallery { padding: 56px 0 64px; }

.gallery-lede { max-width: 68ch; }

.gallery-slider {
  position: relative;
  max-width: 420px;
  margin: 32px auto 0;
}

.gallery-viewport {
  overflow: hidden;
  border: 10px solid var(--ivory-light);
  outline: 1px solid rgba(36, 27, 22, 0.15);
  box-shadow: 10px 10px 0 rgba(156, 43, 43, 0.15);
  background: var(--ivory);
}

.gallery-track {
  display: flex;
  transition: transform 420ms ease;
}

.gallery-slide {
  flex: 0 0 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ivory);
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--red-deep);
  background: var(--ivory-light);
  color: var(--red-deep);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.gallery-btn:hover { background: var(--red-deep); color: var(--ivory-light); }

.gallery-prev { left: -21px; }
.gallery-next { right: -21px; }

.gallery-counter {
  text-align: center;
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: #6b5f54;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.gallery-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(36, 27, 22, 0.25);
  padding: 0;
  cursor: pointer;
}

.gallery-dot.active { background: var(--red); }

/* ---------- pricing ---------- */

.pricing {
  background: var(--red-deep);
  color: var(--ivory-light);
  padding: 40px 0;
}

.pricing-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  text-align: center;
}

.price-amount {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin: 0;
}

.price-label { margin: 0.2em 0 0; }

.price-divider {
  width: 1px;
  height: 44px;
  background: rgba(250, 245, 232, 0.35);
}

/* ---------- signup ---------- */

.signup { padding: 64px 0; }

.signup-inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
}

.signup-intro { align-self: start; position: sticky; top: 90px; }

.signup-form {
  background: var(--ivory-light);
  border: 1px solid var(--ink);
  outline: 4px solid var(--ivory);
  outline-offset: -10px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.form-row { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.form-row-half { grid-column: span 1; }

.form-row label { font-size: 0.92rem; font-weight: 700; }

.optional { font-weight: 400; color: #6b5f54; }

.required-star { color: var(--red); }

.form-row input,
.form-row select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid rgba(36, 27, 22, 0.35);
  background: #fff;
  color: var(--ink);
}

.form-row-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  grid-column: 1 / -1;
}

.form-row-check input { margin-top: 4px; }
.form-row-check label { font-weight: 400; font-size: 0.9rem; }

.signup-form .btn { grid-column: 1 / -1; justify-self: start; border: none; cursor: pointer; }

.form-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.92rem;
}

.form-status.ok { color: #3c5a2f; }
.form-status.err { color: var(--red); }

/* ---------- storybook / coloring book ---------- */

.book { padding: 64px 0; }

.book-inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: center;
}

.book-cover {
  margin: 0;
  justify-self: center;
}

.book-cover img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 10px solid var(--ivory-light);
  outline: 1px solid rgba(36, 27, 22, 0.15);
  box-shadow: 10px 10px 0 rgba(156, 43, 43, 0.15);
}

.book-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--red-deep);
  margin: 0.3em 0 1em;
}

/* ---------- contact ---------- */

.contact { padding: 56px 0 72px; text-align: center; }

.contact-card {
  display: inline-block;
  background: var(--ivory);
  border: 1px solid rgba(36, 27, 22, 0.14);
  padding: 30px 44px 26px;
  margin-top: 12px;
  position: relative;
}

.contact-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpolygon points='0,10 5,0 10,10' fill='%239c2b2b'/%3E%3Cpolygon points='10,10 15,0 20,10' fill='%23b8862e'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 20px 10px;
}

.contact-name {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--gold);
  margin: 6px 0 14px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.contact-links .contact-link:not(:last-child) { margin-bottom: 6px; }

.contact-link {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--red-deep);
  text-decoration: none;
}

.contact-link:hover { color: var(--red); }

@media (min-width: 480px) {
  .contact-links { flex-direction: row; gap: 34px; }
  .contact-links .contact-link:not(:last-child) { margin-bottom: 0; margin-right: 34px; }
}

/* ---------- promo popup ---------- */

.promo-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(36, 27, 22, 0.55);
  z-index: 90;
}

.promo-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--ivory-light);
  border: 1px solid var(--ink);
  outline: 4px solid var(--ivory);
  outline-offset: -10px;
  padding: 40px 34px 32px;
  max-width: 380px;
  width: calc(100% - 40px);
  z-index: 95;
  text-align: center;
}

.promo-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10'%3E%3Cpolygon points='0,10 5,0 10,10' fill='%239c2b2b'/%3E%3Cpolygon points='10,10 15,0 20,10' fill='%23b8862e'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 20px 10px;
}

.promo-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  padding: 4px;
}

.promo-close:hover { color: var(--red); }

.promo-kicker {
  color: var(--red);
  font-size: 0.9rem;
  margin: 10px 0 2px;
}

.promo-modal h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--red-deep);
  font-size: 1.5rem;
  margin: 0 0 0.5em;
}

.promo-modal p:not(.promo-kicker) { margin: 0 auto 1em; }

.promo-form {
  text-align: left;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.promo-form .form-row { grid-column: auto; }

.promo-form .btn {
  align-self: center;
  margin-top: 4px;
  border: none;
  cursor: pointer;
}

.promo-form .form-status {
  text-align: center;
  margin: 0;
  font-size: 0.88rem;
}

.promo-cta { margin-top: 6px; }

.promo-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--red);
  color: var(--ivory-light);
  border: none;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  z-index: 80;
  box-shadow: 4px 4px 0 rgba(36, 27, 22, 0.25);
  animation: promo-float 2.6s ease-in-out infinite;
}

.promo-fab:hover { background: var(--red-deep); }

@keyframes promo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .promo-fab { animation: none; }
}

@media (max-width: 480px) {
  .promo-fab { padding: 12px 16px; font-size: 0.85rem; bottom: 16px; right: 16px; }
}

/* ---------- footer ---------- */

.site-footer { background: var(--ink); color: var(--ivory); }

.footer-inner {
  padding: 30px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-brand { font-family: var(--font-display); font-size: 1.2rem; margin: 0; color: var(--ivory); }

.footer-tag { margin: 0; color: rgba(239, 228, 203, 0.7); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 340px; margin: 0 auto; }
  .about-inner { grid-template-columns: 1fr; }
  .group-grid { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: 1fr; }
  .book-inner { grid-template-columns: 1fr; }
  .book-cover { order: -1; max-width: 320px; margin: 0 auto; }
  .signup-inner { grid-template-columns: 1fr; }
  .signup-intro { position: static; }
  .gallery-slider { max-width: 360px; }
}

@media (max-width: 640px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory-light);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid rgba(36, 27, 22, 0.12);
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 24px; width: 100%; }
  .nav-cta { margin: 10px 24px; text-align: center; }
  .nav-toggle { display: flex; }
  .form-row-half { grid-column: 1 / -1; }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-top: 1px solid rgba(36, 27, 22, 0.12);
    background: rgba(36, 27, 22, 0.03);
    min-width: 0;
    padding: 0;
  }
  .nav-dropdown-menu li a { padding: 12px 24px 12px 40px; }
  .gallery-slider { max-width: 300px; }
  .gallery-prev { left: 6px; }
  .gallery-next { right: 6px; }
}
