/* ============================================================
   Изнанка — общие блоки страниц: шапка, первый экран, квиз,
   линейка сроков, ведомость работ, FAQ, подвал.
   Подключать после theme.css. Только токены темы.
   ============================================================ */

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--c-paper); color: var(--c-ink); padding: var(--s-2) var(--s-3);
  z-index: 100;
}
.skip:focus { left: var(--s-3); top: var(--s-3); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

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

.header { background: var(--c-byaz); border-bottom: var(--stitch-chalk); }
.header__row {
  display: flex; align-items: center; gap: var(--s-5);
  min-height: 72px;
}
.logo { display: inline-flex; color: var(--c-ink); text-decoration: none; }
.logo:hover { color: var(--c-ink); }
.logo__svg { width: 136px; height: 36px; display: block; }
.footer .logo__svg { width: 120px; height: 32px; }

.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s-4); }
.nav a {
  color: var(--c-ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 500;
  padding: var(--s-1) 0; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--c-chalk); border-bottom-color: var(--c-chalk); }
.nav a { position: relative; }
.nav a[aria-current="page"] { border-bottom-color: var(--c-ink); }
/* узелок нити под активным пунктом */
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 6px; height: 6px; margin-left: -3px; background: var(--c-thread); border-radius: 50%; }
.nav__cta { display: none; }

.header .btn { flex-shrink: 0; }

.nav-toggle {
  display: none; margin-left: auto;
  min-width: 48px; min-height: 48px;
  background: none; border: 1px solid var(--c-line); border-radius: var(--r-btn);
  color: var(--c-ink); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}

/* ---------- Первый экран ---------- */

.hero { padding-block: var(--s-7); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s-7); align-items: start;
}
.hero h1 { max-width: 19ch; margin-bottom: var(--s-4); }
/* второе предложение — меньше, прямым, с меловой строчкой слева, как поле на лекале (вариант 3) */
.h1__accent { display: block; font-style: normal; font-size: clamp(1.375rem, 2.2vw, 1.75rem); line-height: 1.25; letter-spacing: -0.01em; margin-top: .5em; padding-left: var(--s-3); border-left: var(--stitch-chalk); }
.hero .lead { max-width: 52ch; margin-bottom: var(--s-5); }
.hero .figures { margin-bottom: var(--s-4); gap: var(--s-3) var(--s-4); }
.hero .figures b { font-size: var(--fs-xl); }
.hero__note { font-size: var(--fs-sm); color: var(--c-muted); max-width: 52ch; }
.hero__note a { color: var(--c-chalk); }

/* Первый экран: клетка лекальной бумаги проявляется мелом вокруг курсора (вариант 2) */
.hero { position: relative; overflow: hidden; }
.hero > .container { position: relative; }
.chalk-glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 300ms ease;
  background-image:
    repeating-linear-gradient(0deg,  transparent 0 calc(var(--grid-step) - 1px), var(--c-chalk) calc(var(--grid-step) - 1px) var(--grid-step)),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--grid-step) - 1px), var(--c-chalk) calc(var(--grid-step) - 1px) var(--grid-step));
  -webkit-mask: radial-gradient(180px 180px at var(--mx, -999px) var(--my, -999px), rgba(0,0,0,.35), transparent 70%);
          mask: radial-gradient(180px 180px at var(--mx, -999px) var(--my, -999px), rgba(0,0,0,.35), transparent 70%);
}
.chalk-glow.is-on { opacity: 1; }
@media (hover: none), (prefers-reduced-motion: reduce) { .chalk-glow { display: none; } }

/* ---------- Квиз ---------- */

.quiz { padding: var(--s-5); }
.quiz__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.quiz__head h2 { font-size: var(--fs-lg); font-family: var(--f-text); font-weight: 600; letter-spacing: 0; margin: 0; }
.quiz__step { font-size: var(--fs-xs); color: var(--c-muted); white-space: nowrap; }

/* полоса шагов — пять стежков */
.quiz__progress { display: flex; gap: 4px; margin-bottom: var(--s-4); }
.quiz__progress i { flex: 1; height: 2px; background: var(--c-line); }
.quiz__progress i.is-done { background: var(--c-chalk); }

.quiz fieldset { border: 0; padding: 0; margin: 0 0 var(--s-4); min-width: 0; }
.quiz legend {
  font-family: var(--f-display); font-weight: 500; font-size: var(--fs-xl); line-height: var(--lh-snug);
  letter-spacing: -0.015em; color: var(--c-ink); margin-bottom: var(--s-3); padding: 0;
}
.quiz__hint { font-size: var(--fs-sm); color: var(--c-muted); margin: calc(-1 * var(--s-2)) 0 var(--s-3); }

.choices { display: grid; gap: var(--s-2); }
.choices--icons { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; }
.choice--icon { text-align: center; padding: var(--s-3) var(--s-1); }
.choice--icon svg { width: 28px; height: 28px; color: var(--c-chalk); margin: 0 auto var(--s-1); display: block; }
.choice--icon .choice__title { font-weight: 500; font-size: var(--fs-sm); }

.quiz__fields { display: grid; gap: var(--s-3); margin-top: var(--s-2); }
.quiz__sub { font-size: var(--fs-sm); font-weight: 500; color: var(--c-ink); margin: 0 0 var(--s-1); }
.choices--row { grid-template-columns: repeat(3, 1fr); gap: var(--s-1); }
.choice--pill { padding: var(--s-2) var(--s-1); text-align: center; }
.choice--pill .choice__title { font-weight: 500; font-size: var(--fs-sm); }
.quiz__consent { font-size: var(--fs-xs); color: var(--c-muted); margin: var(--s-3) 0 0; max-width: none; }
.quiz__consent a { color: var(--c-muted); }
.quiz__actions { display: flex; gap: var(--s-2); align-items: center; }
.quiz__actions .btn--ghost { min-height: 44px; padding-inline: var(--s-3); }

.quiz__panel[hidden], .quiz__progress[hidden], .quiz .btn[hidden] { display: none; }

.quiz__done { text-align: center; padding: var(--s-4) 0; }
.quiz__done svg { width: 40px; height: 40px; color: var(--c-ok); margin: 0 auto var(--s-3); display: block; }
.quiz__done h3 { margin-bottom: var(--s-2); }
.quiz__done p { margin-inline: auto; }

.quiz__summary {
  list-style: none; margin: 0 0 var(--s-4); padding: var(--s-3) 0;
  border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line);
  font-size: var(--fs-sm); color: var(--c-ink-2);
}
.quiz__summary li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 2px 0; }
.quiz__summary li span:first-child { color: var(--c-muted); }

/* ---------- Отдельный экран квиза после FAQ ---------- */
.quiz-screen { border-top: var(--stitch-chalk); }
.quiz-screen__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--s-7); align-items: start; }
.quiz-screen h2 { max-width: 16ch; }
.quiz-screen .lead { max-width: 44ch; }
.quiz-screen .facts { max-width: 44ch; }
@media (max-width: 1024px) { .quiz-screen__grid { grid-template-columns: 1fr; gap: var(--s-5); } }

/* ---------- Заголовок секции ---------- */

.section__head { max-width: 62ch; margin-bottom: var(--s-6); }
.section__head h2 { margin-bottom: var(--s-2); }
.section__head p { margin: 0; }

/* ---------- Линейка сроков ---------- */

.ruler { position: relative; padding-top: 32px; }
.ruler__line {
  position: absolute; left: 0; right: 0; top: 0; height: 32px;
  border-bottom: 1px solid var(--c-ink);
  background-image: repeating-linear-gradient(90deg, var(--c-line) 0 1px, transparent 1px 20px);
  background-size: 20px 12px; background-position: 0 100%; background-repeat: repeat-x;
}
.ruler__line::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 20px;
  background-image: repeating-linear-gradient(90deg, var(--c-ink) 0 1px, transparent 1px 100px);
}
.ruler__steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5);
}
.ruler__steps li { position: relative; padding-top: var(--s-4); }
.ruler__steps li::before {
  content: ""; position: absolute; left: 0; top: 0; width: 10px; height: 10px;
  background: var(--c-chalk); border-radius: 50%;
  transform: translateY(-5px);
}
.ruler__day {
  font-family: var(--f-display); font-weight: 500; font-size: var(--fs-2xl); line-height: 1;
  color: var(--c-ink); margin-bottom: var(--s-2);
}
.ruler__day small { font-family: var(--f-text); font-size: var(--fs-sm); color: var(--c-muted); margin-left: 4px; }
.ruler__steps h3 { font-family: var(--f-text); font-weight: 600; font-size: var(--fs-lg); letter-spacing: 0; margin-bottom: var(--s-1); }
.ruler__steps p { font-size: var(--fs-sm); margin: 0; }

/* ---------- Два в ряд: текст + картинка ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: center; }
.split--rev > :first-child { order: 2; }
.split h2 { margin-bottom: var(--s-3); }

.facts { list-style: none; margin: var(--s-4) 0 0; padding: 0; }
.facts li {
  padding: var(--s-2) 0; border-top: 1px solid var(--c-line);
  display: grid; grid-template-columns: 28px 1fr; gap: var(--s-2); align-items: start;
  color: var(--c-ink-2);
}
.facts li:last-child { border-bottom: 1px solid var(--c-line); }
.facts svg { width: 22px; height: 22px; color: var(--c-chalk); margin-top: 3px; }

/* Место под фото клиента — до присылки кадров */
.photo {
  margin: 0; position: relative; background: var(--c-byaz-2);
  border: 1px solid var(--c-line); aspect-ratio: 4 / 3; overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo--tall { aspect-ratio: 4 / 5; }
.photo--wide { aspect-ratio: 3 / 2; }
.photo__note {
  position: absolute; left: var(--s-3); bottom: var(--s-3); right: var(--s-3);
  font-size: var(--fs-xs); color: var(--c-muted);
}
.photo__note b { color: var(--c-ink-2); font-weight: 500; }

.lekalo { border: 1px solid var(--c-line); background: var(--c-byaz); width: 100%; max-width: 440px; justify-self: center; }
.lekalo img { width: 100%; height: auto; }

/* ---------- Ведомость работ ---------- */

.works { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-ink); }
.works li {
  display: grid; grid-template-columns: 136px minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: var(--s-4); align-items: center;
  padding: var(--s-3) 0; border-bottom: 1px solid var(--c-line);
}
.works .photo { aspect-ratio: 1; }
.works .photo__note { left: 6px; right: 6px; bottom: 4px; }
.works h3 { font-family: var(--f-text); font-weight: 600; font-size: var(--fs-lg); letter-spacing: 0; margin: 0 0 2px; }
.works h3 a { color: var(--c-ink); text-decoration: none; }
.works h3 a:hover { color: var(--c-chalk); }
.works__cat { font-size: var(--fs-sm); color: var(--c-muted); }
.works__tags { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.works__link { white-space: nowrap; }
.works-more { margin-top: var(--s-4); }

/* ---------- Категории ---------- */

.cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); }
.cats li { background: var(--c-paper); }
.cats a {
  display: grid; grid-template-columns: 28px 1fr; gap: var(--s-2); align-items: start;
  padding: var(--s-3) var(--s-3); color: var(--c-ink); text-decoration: none; min-height: 100%;
  transition: background var(--t-fast);
}
.cats a:hover { background: var(--c-byaz); color: var(--c-ink); }
.cats svg { width: 24px; height: 24px; color: var(--c-chalk); margin-top: 2px; }
.cats b { display: block; font-weight: 600; }
.cats span { display: block; font-size: var(--fs-sm); color: var(--c-muted); }

.not-sew { margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--c-muted); max-width: 66ch; }

/* ---------- FAQ ---------- */

.faq { max-width: 760px; border-top: 1px solid var(--c-ink); }
.faq details { border-bottom: 1px solid var(--c-line); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) 0; font-weight: 600; color: var(--c-ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--f-display); font-size: var(--fs-xl); line-height: 1; color: var(--c-chalk);
  flex-shrink: 0; width: 24px; text-align: center; transition: transform var(--t-fast);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--c-chalk); }
.faq details p { padding-bottom: var(--s-3); margin: 0; }
.faq details p + p { margin-top: calc(-1 * var(--s-2)); }

/* ---------- Подвал ---------- */

.footer { border-top: 1px solid var(--c-ink); padding-block: var(--s-6); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-5); align-items: start; }
.footer p { font-size: var(--fs-sm); margin-bottom: var(--s-2); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: var(--s-1); font-size: var(--fs-sm); }
.footer a { color: var(--c-ink); text-decoration: none; }
.footer a:hover { color: var(--c-chalk); }
.footer__tg { display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 600; color: var(--c-chalk) !important; }
.footer__tg svg { width: 18px; height: 18px; }
.footer__bottom { margin-top: var(--s-5); padding-top: var(--s-3); border-top: 1px solid var(--c-line); font-size: var(--fs-xs); color: var(--c-muted); display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; }

/* ---------- Мобильные ---------- */

@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .hero h1 { max-width: 20ch; }
  .ruler__steps { grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-4); }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .nav.is-open {
    display: block; position: absolute; left: 0; right: 0; top: 72px;
    background: var(--c-paper); border-bottom: 1px solid var(--c-line); padding: var(--s-3) var(--gutter);
    z-index: 20;
  }
  .nav.is-open ul { flex-direction: column; gap: 0; }
  .nav.is-open a { display: block; padding: var(--s-2) 0; font-size: var(--fs-base); border-bottom: 1px solid var(--c-line); }
  .nav.is-open a[aria-current="page"]::after { left: auto; right: 0; bottom: auto; top: 50%; margin: -3px 0 0; }
  .nav.is-open .nav__cta { display: block; }
  .nav.is-open .nav__cta a { color: var(--c-chalk); font-weight: 600; border-bottom: 0; }
  .header { position: relative; }
  .header .btn { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .header__row { gap: var(--s-3); }

  .hero { padding-block: var(--s-6) var(--s-7); }
  .quiz { padding: var(--s-4); }
  .split, .split--rev { grid-template-columns: 1fr; gap: var(--s-5); }
  .split--rev > :first-child { order: 0; }
  .works li { grid-template-columns: 88px 1fr; grid-template-rows: auto auto; }
  .works .photo { grid-row: 1 / 3; }
  .works__tags { grid-column: 2; }
  .works__link { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .choices--icons { grid-template-columns: repeat(2, 1fr); }
  .ruler__steps { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr; }
}
