/* ============================================================
   components.css — кнопки, шапка, навигация, форма, ссылки
   ============================================================ */

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(29, 27, 23, 0.04);
}

.btn-wide {
  width: 100%;
}

.btn-nav {
  padding: 10px 20px;
  font-size: 0.85rem;
}

/* ---------- Текстовая ссылка ---------- */

.text-link {
  display: inline-block;
  margin-top: 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
  transition: color 0.2s var(--ease);
}

.text-link:hover {
  color: var(--accent);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(244, 241, 234, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px -18px rgba(29, 27, 23, 0.28);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.05rem;
  border-radius: 2px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-family: var(--font-display);
  font-size: 1.12rem;
}

.brand-text em {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Навигация ---------- */

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.5vw, 40px);
}

.site-nav ul {
  display: flex;
  gap: clamp(18px, 2.2vw, 34px);
}

.site-nav ul a {
  position: relative;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding-block: 6px;
  transition: color 0.2s var(--ease);
}

.site-nav ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

.site-nav ul a:hover {
  color: var(--ink);
}

.site-nav ul a:hover::after {
  transform: scaleX(1);
}

/* ---------- Бургер (мобильное меню) ---------- */

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius);
}

.burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition:
    transform 0.3s var(--ease),
    opacity 0.2s var(--ease);
}

.burger[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.burger[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ---------- Поле формы ---------- */

.field {
  margin-bottom: 22px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 13px 2px;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  transition: border-color 0.25s var(--ease);
}

.field input::placeholder {
  color: rgba(29, 27, 23, 0.34);
}

.field input:hover {
  border-color: var(--ink);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.field.has-error input {
  border-color: #A32D22;
}

.field-error {
  margin-top: 7px;
  font-size: 0.8rem;
  color: #A32D22;
}

/* ---------- Успешная отправка (DEMO) ---------- */

.form-success {
  padding-block: 14px;
  text-align: center;
}

.form-success h3 {
  margin-bottom: 10px;
}

.form-success p {
  color: var(--ink-soft);
  max-width: 40ch;
  margin-inline: auto;
}

.success-note {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
}

.success-icon circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.success-icon path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Вспомогательное ---------- */

.is-hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .site-nav ul a,
  .site-nav ul a::after,
  .burger span,
  .field input {
    transition: none;
  }
}