/*
  PRISRA PATCH 1.1 — CUSTOM CSS
  Tilda: Site Settings → More → Custom CSS
  -----------------------------------------
  Цели: Performance 46→85+, A11y 75→95+, SEO 92→100
  LCP: 10.8s→<2.5s, CLS: 0.175→<0.1
*/


/* ==============================================
   F4: CLS FIXES — Layout shift prevention
   ============================================== */

/* Hero form container — фиксированная высота чтобы не прыгала */
.t-cover__carrier {
  contain: layout style;
}

/* Любые изображения без явных размеров */
img:not([width]):not([height]) {
  aspect-ratio: auto;
}

/* Placeholder контент при загрузке */
.t-cover img,
.t-records__col img,
.t-card__img,
.t-tile__img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  height: auto;
}

/* Video containers */
.t-video,
.t-video__iframe-wrapper,
iframe[src*="youtube"],
iframe[src*="vimeo"] {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}
.t-video__iframe-wrapper iframe,
.t-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Sticky header — prevent reflow */
.t-header {
  contain: layout;
}


/* ==============================================
   F3: IMAGE OPTIMIZATION HELPERS
   ============================================== */

/* Lazy load images below fold — визуальный hint */
.t-records__col img[loading="lazy"],
.t-card__img[loading="lazy"],
.t-tile__img[loading="lazy"] {
  background: #111;
}

/* Prevent service card images from causing reflow */
.t-cards__col .t-card__img-wrapper,
.t-tile__col .t-tile__img-wrapper {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}


/* ==============================================
   F1: RENDER-BLOCKING — non-critical deferral
   NOTE: Tilda's own CSS/JS cannot be deferred
   (platform limitation). Tilda CDN delivers
   resources from edge — cache fix in F2.
   Для кастомных шрифтов через @import:
   ============================================== */

/* Если используется Google Fonts через @import — замените на  в head.html */
/* Этот блок предотвращает FOUT для кириллицы */
:root {
  --font-loaded: 0;
}
html {
  text-rendering: optimizeSpeed;
}


/* ==============================================
   A3: CONTRAST FIXES
   ============================================== */

/* Brass gold: #C9A961 на #000 = 8.1:1 — OK
   Но мелкий/тонкий текст (<14px, weight<400): поднимаем */
.t-descr,
.t-text,
p,
li,
td {
  color: rgba(255, 255, 255, 0.87); /* 13.8:1 contrast on #000 */
}

/* Плейсхолдеры форм — мин. 4.5:1 */
input::placeholder,
textarea::placeholder,
select::placeholder {
  color: rgba(255, 255, 255, 0.55) !important;
}

/* Мелкий декоративный текст — не падать ниже 3:1 (large text exception) */
.t-name,
.t-uptitle,
.case-disclaimer {
  color: rgba(255, 255, 255, 0.55);
}

/* Brass на тёмном фоне — усиленный вариант для мелкого текста */
.faq-item summary,
[style*="color:#CDA03C"],
[style*="color: #CDA03C"] {
  color: #D4B570; /* поднять яркость для мелкого текста */
}


/* ==============================================
   A4: FORM LABELS — screen reader accessible
   ============================================== */

/* Visually hidden labels (sr-only pattern) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Увеличить кликабельную область label */
label {
  display: block;
  cursor: pointer;
}


/* ==============================================
   A5: FOCUS STATES
   ============================================== */

/* Global focus-visible для всех интерактивных элементов */
*:focus {
  outline: none; /* убрать дефолтный синий */
}

*:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Кнопки */
button:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.25);
}

/* Input fields */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 0;
  border-color: #C9A961 !important;
}

/* Ссылки */
a:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Tilda-specific nav links */
.t-menu__link:focus-visible,
.t-menu__list-item a:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
}

/* Details/summary (FAQ) */
.faq-item summary:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 4px;
  border-radius: 4px;
}


/* ==============================================
   SEO2: TAP TARGETS — минимум 48×48px
   ============================================== */

/* Соцсети в шапке */
.t-sociallinks__item,
.t-header .t-sociallinks a,
header [href*="instagram"],
header [href*="facebook"],
header [href*="linkedin"],
header [href*="telegram"] {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Dropdown стрелки в меню */
.t-menu__list-item,
.t-menu__link {
  min-height: 48px;
  display: flex;
  align-items: center;
}

/* Кнопки CTA */
.t-btn,
button[type="submit"],
.btn-primary,
.btn-ghost {
  min-height: 48px;
  min-width: 48px;
}

/* Мобильные иконки */
@media (max-width: 768px) {
  .t-sociallinks__item,
  .t-header a {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
  }

  /* FAQ — tap targets */
  .faq-item summary {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
}


/* ==============================================
   PATCH 1 CARRY-OVER: Service cards hover
   (уточнённые Tilda-specific селекторы)
   ============================================== */

.t-cards__col .t-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
}

.t-cards__col .t-card:hover {
  transform: translateY(-4px);
  border-color: #CDA03C;
  box-shadow: 0 12px 40px rgba(205, 160, 60, 0.12);
}


/* ==============================================
   MOBILE: Responsive fixes
   ============================================== */

@media (max-width: 480px) {
  /* Hero CTA buttons stack vertically */
  .hero-ctas {
    flex-direction: column;
  }
  .hero-ctas .btn-primary,
  .hero-ctas .btn-ghost {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Capabilities band — 2 columns on mobile */
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* FAQ items */
  .faq-item summary {
    font-size: 0.95rem;
  }
}







/* ==============================================
   F4: CLS FIXES — Layout shift prevention
   ============================================== */

/* Hero form container — фиксированная высота чтобы не прыгала */
.t-cover__carrier {
  contain: layout style;
}

/* Любые изображения без явных размеров */
img:not([width]):not([height]) {
  aspect-ratio: auto;
}

/* Placeholder контент при загрузке */
.t-cover img,
.t-records__col img,
.t-card__img,
.t-tile__img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  height: auto;
}

/* Video containers */
.t-video,
.t-video__iframe-wrapper,
iframe[src*="youtube"],
iframe[src*="vimeo"] {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}
.t-video__iframe-wrapper iframe,
.t-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Sticky header — prevent reflow */
.t-header {
  contain: layout;
}


/* ==============================================
   F3: IMAGE OPTIMIZATION HELPERS
   ============================================== */

/* Lazy load images below fold — визуальный hint */
.t-records__col img[loading="lazy"],
.t-card__img[loading="lazy"],
.t-tile__img[loading="lazy"] {
  background: #111;
}

/* Prevent service card images from causing reflow */
.t-cards__col .t-card__img-wrapper,
.t-tile__col .t-tile__img-wrapper {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}


/* ==============================================
   F1: RENDER-BLOCKING — non-critical deferral
   NOTE: Tilda's own CSS/JS cannot be deferred
   (platform limitation). Tilda CDN delivers
   resources from edge — cache fix in F2.
   Для кастомных шрифтов через @import:
   ============================================== */

/* Если используется Google Fonts через @import — замените на  в head.html */
/* Этот блок предотвращает FOUT для кириллицы */
:root {
  --font-loaded: 0;
}
html {
  text-rendering: optimizeSpeed;
}


/* ==============================================
   A3: CONTRAST FIXES
   ============================================== */

/* Brass gold: #C9A961 на #000 = 8.1:1 — OK
   Но мелкий/тонкий текст (<14px, weight<400): поднимаем */
.t-descr,
.t-text,
p,
li,
td {
  color: rgba(255, 255, 255, 0.87); /* 13.8:1 contrast on #000 */
}

/* Плейсхолдеры форм — мин. 4.5:1 */
input::placeholder,
textarea::placeholder,
select::placeholder {
  color: rgba(255, 255, 255, 0.55) !important;
}

/* Мелкий декоративный текст — не падать ниже 3:1 (large text exception) */
.t-name,
.t-uptitle,
.case-disclaimer {
  color: rgba(255, 255, 255, 0.55);
}

/* Brass на тёмном фоне — усиленный вариант для мелкого текста */
.faq-item summary,
[style*="color:#CDA03C"],
[style*="color: #CDA03C"] {
  color: #D4B570; /* поднять яркость для мелкого текста */
}


/* ==============================================
   A4: FORM LABELS — screen reader accessible
   ============================================== */

/* Visually hidden labels (sr-only pattern) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Увеличить кликабельную область label */
label {
  display: block;
  cursor: pointer;
}


/* ==============================================
   A5: FOCUS STATES
   ============================================== */

/* Global focus-visible для всех интерактивных элементов */
*:focus {
  outline: none; /* убрать дефолтный синий */
}

*:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Кнопки */
button:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.25);
}

/* Input fields */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 0;
  border-color: #C9A961 !important;
}

/* Ссылки */
a:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Tilda-specific nav links */
.t-menu__link:focus-visible,
.t-menu__list-item a:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 3px;
}

/* Details/summary (FAQ) */
.faq-item summary:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 4px;
  border-radius: 4px;
}


/* ==============================================
   SEO2: TAP TARGETS — минимум 48×48px
   ============================================== */

/* Соцсети в шапке */
.t-sociallinks__item,
.t-header .t-sociallinks a,
header [href*="instagram"],
header [href*="facebook"],
header [href*="linkedin"],
header [href*="telegram"] {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Dropdown стрелки в меню */
.t-menu__list-item,
.t-menu__link {
  min-height: 48px;
  display: flex;
  align-items: center;
}

/* Кнопки CTA */
.t-btn,
button[type="submit"],
.btn-primary,
.btn-ghost {
  min-height: 48px;
  min-width: 48px;
}

/* Мобильные иконки */
@media (max-width: 768px) {
  .t-sociallinks__item,
  .t-header a {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
  }

  /* FAQ — tap targets */
  .faq-item summary {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
}


/* ==============================================
   PATCH 1 CARRY-OVER: Service cards hover
   (уточнённые Tilda-specific селекторы)
   ============================================== */

.t-cards__col .t-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
}

.t-cards__col .t-card:hover {
  transform: translateY(-4px);
  border-color: #CDA03C;
  box-shadow: 0 12px 40px rgba(205, 160, 60, 0.12);
}


/* ==============================================
   MOBILE: Responsive fixes
   ============================================== */

@media (max-width: 480px) {
  /* Hero CTA buttons stack vertically */
  .hero-ctas {
    flex-direction: column;
  }
  .hero-ctas .btn-primary,
  .hero-ctas .btn-ghost {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Capabilities band — 2 columns on mobile */
  .capabilities-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* FAQ items */
  .faq-item summary {
    font-size: 0.95rem;
  }
}

