/* ============================================================
   mobile.css — мобильный слой лендинга (< 1024px)
   Подключается ПОСЛЕ tailwind.min.css. Десктоп не затрагивается:
   всё завёрнуто в @media (max-width: 1023.98px).
   Система форм (применяется в секциях ниже по мере добавления):
   карточки radius 12px, кнопки без скругления.
   ============================================================ */

/* details-аккордеон «Обо мне»: маркер скрыт на всех ширинах */
.about-acc summary {
  list-style: none;
}
.about-acc summary::-webkit-details-marker {
  display: none;
}
/* На десктопе аккордеон всегда раскрыт и без стрелок */
@media (min-width: 1024px) {
  .about-acc summary {
    pointer-events: none;
  }
  .about-acc summary::after {
    display: none;
  }
  .about-acc + .about-acc {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
  }
}

@media (max-width: 1023.98px) {

  /* --- Форс-видимость десктопных анимационных начальных состояний --- */
  html.anim [data-reveal]:not([data-m-reveal]),
  html.anim .js-words .w,
  html.anim .reveal-line > span,
  html.anim .photo-frame:not([data-m-reveal]),
  html.anim .hero-bg {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  /* Фото с data-m-reveal анимируется через m-reveal; clip-path глушим отдельно,
     чтобы не было двойной анимации поверх fade-up */
  html.m-js .photo-frame[data-m-reveal] {
    clip-path: none !important;
  }
  html.anim .photo-parallax {
    transform: none !important;
  }

  /* --- Reveal-система (замена GSAP на мобильных) --- */
  html.m-js [data-m-reveal]:not([data-m-reveal="stagger"]) {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  html.m-js [data-m-reveal="fade"]:not([data-m-reveal="stagger"]) {
    transform: none;
  }
  html.m-js [data-m-reveal].m-is-in {
    opacity: 1;
    transform: none;
  }
  html.m-js [data-m-reveal="stagger"] > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  html.m-js [data-m-reveal="stagger"].m-is-in > * {
    opacity: 1;
    transform: none;
  }

  /* --- grain: статичный, без постоянного repaint --- */
  .grain {
    animation: none !important;
  }

  /* --- Плавный скролл к якорям (Lenis на мобильных выключен) --- */
  html {
    scroll-behavior: smooth;
  }

  /* --- Hero mobile --- */
  .m-hero-media {
    position: relative;
    aspect-ratio: 4 / 5;
    max-height: 58svh;
    overflow: hidden;
  }
  .m-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
  }
  .m-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
      rgba(16, 15, 13, 0.30) 0%,
      rgba(16, 15, 13, 0) 30%,
      rgba(16, 15, 13, 0) 55%,
      #100F0D 99%);
  }
  .m-hero-title {
    display: block;
    font-size: clamp(2.75rem, 12vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: #ECE7DE;
  }
  .m-hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    background: #C9A24B;
    color: #14120F;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.875rem;
    transition: transform 0.2s ease, background 0.2s ease;
  }
  .m-hero-cta:active {
    transform: translateY(1px);
    background: #8F7331;
  }
  .m-hero-tel {
    color: #9C968C;
    font-size: 0.9375rem;
    letter-spacing: 0.04em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .m-hero-tel:active {
    color: #C9A24B;
  }

  /* --- Бургер --- */
  .m-menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  .m-menu-btn-line {
    display: block;
    width: 24px;
    height: 1.5px;
    background: #ECE7DE;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .m-menu-btn.is-active .m-menu-btn-line:first-child {
    transform: translateY(4.25px) rotate(45deg);
  }
  .m-menu-btn.is-active .m-menu-btn-line:last-child {
    transform: translateY(-4.25px) rotate(-45deg);
  }

  /* --- Оверлей меню --- */
  .m-menu {
    position: fixed;
    inset: 0;
    /* z-index 35: ниже шапки (40), выше faq-nav-mobile (30) — бургер кликабелен, faq-бар не перекрывает меню */
    z-index: 35;
    background: #100F0D;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: calc(72px + 2rem) 1.5rem calc(2rem + env(safe-area-inset-bottom));
    opacity: 0;
    transition: opacity 0.35s ease;
  }
  .m-menu.is-open {
    opacity: 1;
  }
  .m-menu:not(.is-open) {
    pointer-events: none;
  }
  .m-menu[hidden] {
    display: none;
  }
  .m-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .m-menu-link {
    font-family: "Tenor Sans", serif;
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.15;
    color: #ECE7DE;
    padding: 0.35rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s ease;
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .m-menu.is-open .m-menu-link {
    opacity: 1;
    transform: none;
  }
  .m-menu-link:active {
    color: #C9A24B;
  }
  .m-menu-foot {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .m-menu-contact {
    color: #9C968C;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .m-menu-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin-top: 0.5rem;
    background: #C9A24B;
    color: #14120F;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.875rem;
  }
  .m-menu-cta:active {
    background: #8F7331;
  }

  /* --- Sticky CTA --- */
  .m-sticky-cta {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    background: #C9A24B;
    color: #14120F;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.875rem;
    box-shadow: 0 8px 30px rgba(201, 162, 75, 0.28);
    opacity: 0;
    transform: translateY(140%);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .m-sticky-cta.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .m-sticky-cta:active {
    background: #8F7331;
  }

  /* --- Манифест --- */
  #metod .js-words {
    font-size: clamp(1.6rem, 5.5vw, 2.2rem) !important;
    line-height: 1.35 !important;
  }

  /* --- Запросы: карточки вместо полос --- */
  .requests-accordion {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .request-strip {
    height: auto !important;
    flex: none !important;
    display: flex;
    flex-direction: column;
    background: #171512;
    border-radius: 12px;
    overflow: hidden;
    cursor: default !important;
  }
  .request-strip:nth-child(odd) {
    margin-right: 1.5rem;
  }
  .request-strip:nth-child(even) {
    margin-left: 1.5rem;
  }
  .request-strip picture {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    flex: none;
  }
  .request-strip picture img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none !important;
    transform: none !important;
  }
  .request-strip .strip-scrim,
  .request-strip .strip-label,
  .request-strip .strip-dash {
    display: none !important;
  }
  .request-strip .strip-body {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    padding: 1.25rem 1.25rem 1.5rem;
  }
  .request-strip .strip-body h3 {
    font-family: "Tenor Sans", Georgia, serif;
    font-size: 1.375rem;
    line-height: 1.2;
    color: #ECE7DE;
    margin-bottom: 0.5rem;
  }
  .request-strip .strip-desc {
    color: #9C968C;
    font-size: 0.9375rem;
    line-height: 1.55;
    max-width: none !important;
  }

  /* --- Сессия: timeline-лента, статичный фон --- */
  #sessiya {
    background:
      radial-gradient(120% 60% at 50% 0%, rgba(201, 162, 75, 0.07) 0%, transparent 55%),
      linear-gradient(to bottom, #14120F 0%, #100F0D 30%, #100F0D 100%);
  }
  .scenes-bg-wrap {
    display: none !important;
  }
  .scene-progress {
    display: none !important;
  }
  .scenes {
    padding-bottom: 4rem;
  }
  .scene {
    position: relative;
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    padding: 2.25rem 1.5rem 2.25rem 3rem !important;
  }
  .scene::before {
    content: "";
    position: absolute;
    left: 1.5rem;
    top: 3rem;
    bottom: -2.25rem;
    width: 1px;
    background: linear-gradient(to bottom, rgba(201, 162, 75, 0.5), rgba(201, 162, 75, 0.06));
  }
  .scene:last-child::before {
    display: none;
  }
  .scene .scene-num {
    position: static !important;
    top: auto !important;
    right: auto !important;
    font-size: 3.5rem !important;
    line-height: 1 !important;
    margin-bottom: 1rem;
  }
  .scene .scene-content {
    padding: 0 !important;
    position: static !important;
    transform: none !important;
  }
  .scene .scene-title {
    font-size: clamp(2rem, 8.5vw, 2.75rem) !important;
    margin-bottom: 0.75rem !important;
  }
  .scene .scene-title-fill {
    display: none !important;
  }
  .scene .scene-title-text {
    color: #ECE7DE !important;
    -webkit-text-stroke: 0 !important;
    opacity: 1 !important;
  }
  .scene .scene-desc {
    font-size: 1.0625rem !important;
    line-height: 1.6 !important;
    color: rgba(236, 231, 222, 0.8) !important;
  }

  /* --- Техники --- */
  /* Десктопное тире скрыто: с новым шевроном — двойной индикатор,
     а sticky-:hover на iOS удлиняет тире и сдвигает текст */
  #tekhniki .technique-dash {
    display: none !important;
  }
  /* Дети stagger-списка имеют десктопный data-reveal — снимаем с них
     форс-видимость, чтобы сработал мобильный stagger */
  html.m-js #tekhniki [data-m-reveal="stagger"] > .technique-item {
    opacity: 0 !important;
    transform: translateY(24px) !important;
  }
  html.m-js #tekhniki [data-m-reveal="stagger"].m-is-in > .technique-item {
    opacity: 1 !important;
    transform: none !important;
  }
  #tekhniki .technique-item {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    padding-right: 2.75rem !important;
    position: relative;
    min-height: 56px;
  }
  #tekhniki .technique-item::after {
    content: "";
    position: absolute;
    right: 0.5rem;
    top: 50%;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 1.5px solid #C9A24B;
    border-bottom: 1.5px solid #C9A24B;
    transform: translateY(-50%) rotate(-45deg);
  }
  #tekhniki .technique-item:active {
    background: rgba(201, 162, 75, 0.06);
  }

  /* --- Обо мне --- */
  #obo-mne .photo-frame {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    aspect-ratio: 4 / 5 !important;
  }
  .about-acc summary {
    cursor: pointer;
    position: relative;
    padding-right: 2.5rem;
    min-height: 44px;
  }
  .about-acc summary::after {
    content: "";
    position: absolute;
    right: 0.25rem;
    top: 0.55rem;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 1.5px solid #C9A24B;
    border-bottom: 1.5px solid #C9A24B;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
  }
  .about-acc[open] summary::after {
    transform: rotate(225deg);
  }
  .about-acc + .about-acc {
    border-top: 1px solid #27231E;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
  }

  /* --- Отзывы --- */
  .quote-stage {
    min-height: 0 !important;
  }
  .quote {
    position: static !important;
    inset: auto !important;
    display: none !important; /* !important: инлайн-<style> идёт после mobile.css, его .quote { display: flex } иначе побеждает */
    opacity: 1 !important;
    transform: none !important;
    touch-action: pan-y;
  }
  .quote.is-active {
    display: block !important;
    animation: m-quote-in 0.4s ease;
  }
  .quote blockquote {
    font-size: clamp(1.4rem, 5.8vw, 1.9rem) !important;
  }
  .quote-dots {
    display: flex !important;
  }
  @keyframes m-quote-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* --- Цены: карточки --- */
  /* Дети stagger-списка имеют десктопный data-reveal — снимаем с них
     форс-видимость, чтобы сработал мобильный stagger (паттерн «Техники») */
  html.m-js #ceny [data-m-reveal="stagger"] > .format-row {
    opacity: 0 !important;
    transform: translateY(24px) !important;
  }
  html.m-js #ceny [data-m-reveal="stagger"].m-is-in > .format-row {
    opacity: 1 !important;
    transform: none !important;
  }
  #ceny ul {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
  }
  #ceny .format-row {
    border: none !important;
    background: #171512;
    border-radius: 12px;
    padding: 1.25rem !important;
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title duration"
      "desc desc"
      "price more";
    column-gap: 1rem;
    row-gap: 0.5rem;
    align-items: baseline;
    transition: background 0.2s ease;
  }
  #ceny .format-row h3 {
    grid-area: title;
    font-size: 1.25rem !important;
  }
  #ceny .format-row p {
    grid-area: desc;
    font-size: 0.9375rem;
  }
  #ceny .format-row > span:first-of-type {
    grid-area: duration;
    white-space: nowrap;
  }
  #ceny .format-price {
    grid-area: price;
    font-size: 1.75rem !important;
    white-space: nowrap;
  }
  #ceny .format-row::after {
    content: "Подробнее";
    grid-area: more;
    color: #C9A24B;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  #ceny .format-row:active {
    background: #1D1A16;
  }
  /* Курс (последняя карточка) выделен акцентной рамкой — перебивает
     десктопные Tailwind-классы border-t/border-b */
  #ceny li.format-row:last-child {
    border: 1px solid rgba(201, 162, 75, 0.4) !important;
  }

  /* --- FAQ --- */
  .faq-question {
    font-size: 1.35rem !important;
    min-height: 56px;
  }
  .faq-nav-mobile {
    top: 72px !important;
  }

  /* --- Запись --- */
  #zapis > a:active {
    background: #C9A24B !important;
    color: #14120F !important;
  }
  .m-zapis-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    background: #C9A24B;
    color: #14120F;
    font-family: "Tenor Sans", Georgia, serif;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 36px rgba(201, 162, 75, 0.30);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  }
  .m-zapis-btn:active {
    transform: translateY(1px);
    background: #8F7331;
    box-shadow: 0 4px 16px rgba(201, 162, 75, 0.22);
  }
  .m-zapis-alt {
    color: #9C968C;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .m-zapis-alt:active {
    color: #C9A24B;
  }

  /* --- Контакты --- */
  #kontakty address a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .contacts-map-frame {
    min-height: 0 !important;
  }
  .contacts-map-iframe {
    aspect-ratio: 4 / 3;
    height: auto !important;
    min-height: 0 !important;
  }

  /* --- Отзывы: стрелки скрыты (навигация — точки и свайп) --- */
  .quote-btn {
    display: none !important;
  }

  /* --- Страховка от горизонтального скролла --- */
  html,
  body {
    overflow-x: clip;
  }
}

@media (max-width: 1023.98px) and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html.m-js [data-m-reveal],
  html.m-js [data-m-reveal="stagger"] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  /* Перекрытие секционного правила #tekhniki (у него выше специфичность) */
  html.m-js #tekhniki [data-m-reveal="stagger"] > .technique-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  /* Зеркало для #ceny — та же причина (секционное правило выше специфичностью) */
  html.m-js #ceny [data-m-reveal="stagger"] > .format-row {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .m-menu-link {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .m-sticky-cta {
    transition: none !important;
  }
  .quote.is-active {
    animation: none;
  }
}
