/* ==========================================================================
   KIYIZGROUP — общий слой публичных лендингов
   Токены, типографика, навигация, форма и подвал. Всё, что должно совпадать
   на каждой странице сайта, живёт здесь и подключается первым (ADR-036).
   Страничные компоненты — в page.css рядом с документом.
   ========================================================================== */

:root {
  --bg: #f1ebdf;
  --bg-sand: #e7dece;
  --bg-card: #fbf8f1;
  --ink: #211e19;
  --ink-soft: #5c5346;
  --ink-mute: #9a8d72;
  --red: #b14533;
  --gold: #9c7a3e;
  --gold-l: #c99a5e;
  --dark: #1c1a17;
  --dark-2: #23201b;
  --cream: #efe7d7;
  --line: rgba(33, 30, 25, 0.14);
  --line-d: rgba(239, 231, 215, 0.18);

  /* Playfair и Manrope не содержат иероглифов и арабицы. Без запасных
     семейств браузер подставлял бы глифы по одному из случайных шрифтов,
     и китайская строка выглядела бы набранной вразнобой.
     Веб-шрифт для CJK сюда не грузим: это несколько мегабайт ради языков,
     системный шрифт для которых есть на каждой платформе. */
  --cjk: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC';
  --arabic: 'SF Arabic', 'Geeza Pro', 'Segoe UI', 'Noto Naskh Arabic', 'Noto Sans Arabic';
  --serif: 'Playfair Display', Georgia, 'Noto Serif', var(--cjk), var(--arabic), serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', var(--cjk),
    var(--arabic), sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, var(--cjk), monospace;

  --wrap: 1320px;
  --pad: clamp(20px, 5vw, 48px);
  --sec: clamp(84px, 12vh, 160px);
  --nav-h: 74px;
  --r: 4px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}
html.is-locked {
  overflow: hidden;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
::selection {
  background: var(--red);
  color: #f4efe6;
}
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 30px;
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 12px;
}

/* ---------- примитивы ---------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.section {
  padding: var(--sec) 0;
}
.section--sand {
  background: var(--bg-sand);
}
.section--dark {
  background: var(--dark);
  color: var(--cream);
}
.section--dark .lead,
.section--dark .card__text {
  color: rgba(239, 231, 215, 0.72);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.section--dark .eyebrow {
  color: var(--gold-l);
}
.eyebrow__rule {
  flex: 0 0 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  line-height: 1.04;
}
.h1 em {
  font-style: italic;
  color: var(--red);
}
.section--dark .h1 em {
  color: var(--gold-l);
}
.h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.7vw, 3.1rem);
  line-height: 1.12;
}
.h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.25;
}
.lead {
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.66;
  color: var(--ink-soft);
  margin: 0;
}

.secthead {
  max-width: 760px;
  margin-bottom: clamp(38px, 5vw, 64px);
}
.secthead--split {
  max-width: none;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}
/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 40px;
  border: 1px solid transparent;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn--solid {
  background: var(--ink);
  color: var(--bg);
}
.btn--solid:hover {
  background: var(--red);
}
.btn--line {
  border-color: var(--line);
  color: var(--ink);
}
.btn--line:hover {
  border-color: var(--ink);
}
.btn--light {
  background: var(--cream);
  color: var(--ink);
}
.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
  padding: 11px 20px;
  font-size: 0.86rem;
}
.btn--ghost:hover {
  border-color: var(--ink);
}
.btn--onDark {
  border: 1px solid var(--line-d);
  color: var(--cream);
}
.btn--onDark:hover {
  border-color: var(--gold-l);
  color: var(--gold-l);
}
/* ---------- навигация ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(241, 235, 223, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.is-stuck {
  border-bottom-color: var(--line);
}
.nav__inner {
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
}
.brand__logo {
  width: 126px;
  height: auto;
}
.nav__links {
  display: flex;
  gap: 26px;
  font-size: 0.9rem;
}
.nav__links a {
  position: relative;
  padding: 4px 0;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.nav__links a:hover {
  color: var(--ink);
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.3s ease;
}
.nav__links a:hover::after {
  width: 100%;
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang {
  position: relative;
}
.lang__btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: none;
  cursor: pointer;
  font-size: 0.82rem;
}
.lang__globe {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 44px -28px rgba(33, 30, 25, 0.5);
}
.lang__menu button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-size: 0.86rem;
  text-align: left;
}
.lang__menu button:hover {
  background: var(--bg-sand);
}
.lang__menu button[aria-selected='true'] {
  color: var(--red);
  font-weight: 600;
}
.lang__code {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.burger span {
  width: 15px;
  height: 1.4px;
  background: var(--ink);
}

.mmenu {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  padding: 22px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow-y: auto;
}
/* Атрибут hidden гасится авторским display:flex — UA-стиль слабее.
   Без этой строки мобильное меню раскрыто на десктопе. */
.mmenu[hidden] {
  display: none;
}
/* Та же причина у ловушки формы и у скрываемых пунктов контактов */
.hp[hidden],
[hidden] {
  display: none;
}
.mmenu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mmenu__logo {
  width: 118px;
}
.iconbtn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.mmenu__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mmenu__links a {
  font-family: var(--serif);
  font-size: 1.7rem;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.mmenu__langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mmenu__langs button {
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
}
.mmenu__langs button[aria-selected='true'] {
  background: var(--ink);
  color: var(--bg);
}
/* ---------- контакты ---------- */
.contact {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(30px, 5vw, 72px);
}
.contact__list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 16px;
  font-size: 0.95rem;
}
.contact__list li {
  display: grid;
  gap: 3px;
}
.contact__k {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-l);
}
.contact__list a:hover {
  color: var(--gold-l);
}

.form {
  display: grid;
  gap: 16px;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
}
.field__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(239, 231, 215, 0.6);
}
.input {
  width: 100%;
  padding: 13px 15px;
  background: rgba(239, 231, 215, 0.06);
  border: 1px solid var(--line-d);
  border-radius: 3px;
  color: var(--cream);
  transition: border-color 0.2s ease;
}
.input:focus {
  outline: none;
  border-color: var(--gold-l);
}
.input[aria-invalid='true'] {
  border-color: var(--red);
}
.form__submit {
  justify-self: start;
  margin-top: 6px;
}
.form__note {
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(239, 231, 215, 0.45);
  margin: 0;
}
.form__status {
  min-height: 20px;
  font-size: 0.87rem;
  margin: 0;
}
.form__status.is-ok {
  color: #8fbf8f;
}
.form__status.is-err {
  color: #e08a7b;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* ---------- подвал ---------- */
.footer {
  padding: 52px 0 40px;
  background: var(--dark);
  color: rgba(239, 231, 215, 0.6);
  border-top: 1px solid var(--line-d);
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 34px;
}
.footer__logo {
  width: 132px;
  filter: invert(1) brightness(1.9);
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.88rem;
}
.footer__nav a:hover {
  color: var(--cream);
}
.footer__bot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid var(--line-d);
  font-size: 0.8rem;
}
/* ---------- появление ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.reveal--d1 {
  transition-delay: 0.09s;
}
.reveal--d2 {
  transition-delay: 0.18s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover,
  .path:hover {
    transform: none;
  }
}

/* ---------- адаптив общего слоя ---------- */
@media (max-width: 1080px) {
  .secthead--split {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .contact {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 820px) {
  .nav__links {
    display: none;
  }
  .burger {
    display: flex;
  }
  .nav__cta {
    display: none;
  }
}
@media (max-width: 680px) {
  .form__row {
    grid-template-columns: 1fr;
  }
}
@media print {
  .nav,
  .mmenu,
  .burger {
    display: none !important;
  }
}

/* ==========================================================================
   Письмо справа налево (арабский)
   Зеркалятся только правила, где направление задано явно. Остальное
   разворачивает сам браузер по dir="rtl" на <html> — его ставит site.js.
   ========================================================================== */

[dir='rtl'] body {
  text-align: right;
}

/* Логотип уводит навигацию влево, в RTL — вправо */
[dir='rtl'] .brand {
  margin-right: 0;
  margin-left: auto;
}

/* Выпадающий список языков открывается от своего края */
[dir='rtl'] .lang__menu {
  right: auto;
  left: 0;
}
[dir='rtl'] .lang__menu button {
  text-align: right;
}

/* Служебные элементы прячутся за противоположный край */
[dir='rtl'] .skip-link {
  left: auto;
  right: -9999px;
}
[dir='rtl'] .skip-link:focus {
  right: 12px;
}
[dir='rtl'] .hp {
  left: auto;
  right: -9999px;
}

/* Подчёркивание пункта меню растёт от правого края */
[dir='rtl'] .nav__links a::after {
  left: auto;
  right: 0;
}

[dir='rtl'] .eyebrow {
  flex-direction: row-reverse;
}
[dir='rtl'] .contact__list li,
[dir='rtl'] .field,
[dir='rtl'] .input {
  text-align: right;
}

/* Числа, даты, почта и телефон остаются слева направо внутри арабского
   текста: иначе +996 555 … читается задом наперёд */
[dir='rtl'] input[type='tel'],
[dir='rtl'] input[type='date'],
[dir='rtl'] input[type='number'],
[dir='rtl'] input[type='email'] {
  direction: ltr;
  text-align: right;
}

[dir='rtl'] .footer__top,
[dir='rtl'] .footer__bot {
  flex-direction: row-reverse;
}
[dir='rtl'] .form__submit {
  justify-self: end;
}
