/* КофеРем — базовые стили */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-espresso);
  color: var(--ink-milk);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--brass); color: #16120E; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-pad); }
.section--paper { background: var(--paper); color: var(--ink-paper); }
.section--steel { background: var(--bg-steel); }

/* ---------- Заголовки секций ---------- */
.sec-head { max-width: 720px; margin-bottom: clamp(28px, 5vw, 48px); }
.kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.kicker::before { content: ""; width: 28px; height: 1px; background: var(--brass); }
.section--paper .kicker { color: #9A7430; }
.section--paper .kicker::before { background: #9A7430; }

.sec-head h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.section--paper .sec-head h2 { color: var(--ink-paper); }

.sec-sub { margin-top: 14px; color: var(--ink-steam); max-width: 60ch; }
.section--paper .sec-sub { color: var(--ink-paper-dim); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--brass);
  color: #16120E;
}
.btn--primary:hover { background: var(--brass-bright); }

.btn--ghost {
  border-color: var(--line);
  color: var(--ink-milk);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--brass); color: var(--brass-bright); }

.section--paper .btn--ghost { border-color: rgba(36, 28, 18, 0.25); color: var(--ink-paper); }
.section--paper .btn--ghost:hover { border-color: #9A7430; color: #9A7430; }

.btn--sm { padding: 10px 18px; font-size: 0.875rem; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(22, 18, 14, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
}
.logo img { height: 26px; width: auto; }

.nav { margin-left: auto; }
.nav ul { display: flex; gap: 26px; }
.nav a {
  font-size: 0.9rem;
  color: var(--ink-steam);
  transition: color var(--dur-fast);
}
.nav a:hover { color: var(--brass-bright); }

.header__phone {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: nowrap;
  color: var(--ink-milk);
}
.header__phone small { display: block; font-size: 0.68rem; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }

.burger {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
}
.burger span, .burger span::before, .burger span::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 20px; height: 2px; background: var(--ink-milk);
  transform: translate(-50%, -50%);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.burger span::before { transform: translate(-50%, -8px); }
.burger span::after { transform: translate(-50%, 8px); }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translate(-50%, -50%) rotate(45deg); }
.burger[aria-expanded="true"] span::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 88px) var(--section-pad); position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: -40% -20% auto auto;
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(201, 160, 91, 0.13), transparent 65%);
  pointer-events: none;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  position: relative;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.hero h1 em { font-style: normal; color: var(--brass-bright); }

.hero__lead { margin-top: 20px; color: var(--ink-steam); max-width: 52ch; font-size: 1.06rem; }
.hero__price {
  display: inline-flex; align-items: baseline; gap: 8px;
  margin-top: 22px;
  font-family: var(--font-mono);
}
.hero__price b { font-size: 1.5rem; color: var(--brass-bright); font-weight: 600; }
.hero__price span { color: var(--ink-steam); font-size: 0.875rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.hero__badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-steam);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}
.badge b { color: var(--brass-bright); font-weight: 500; }

/* ---------- LCD-панель (сигнатура) ---------- */
.lcd {
  background: var(--lcd-bg);
  border: 1px solid rgba(159, 232, 112, 0.22);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift), 0 0 60px -30px rgba(159, 232, 112, 0.4) inset;
  overflow: hidden;
}
.lcd__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(159, 232, 112, 0.14);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lcd-dim);
}
.lcd__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lcd-green); box-shadow: 0 0 8px rgba(159, 232, 112, 0.8); }
.lcd__body { padding: 18px 16px 22px; min-height: 240px; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.9; color: var(--lcd-green); text-shadow: 0 0 8px rgba(159, 232, 112, 0.45); }
.lcd__line { white-space: pre-wrap; word-break: break-word; min-height: 1.9em; }
.lcd__line--ok::after { content: " ✓"; color: var(--lcd-dim); text-shadow: none; }
.lcd__cursor { display: inline-block; width: 8px; height: 14px; background: var(--lcd-green); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Сетка типов машин ---------- */
.types-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.type-card {
  background: var(--bg-steel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 22px 20px;
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-fast);
}
.type-card:hover { transform: translateY(-4px); border-color: rgba(201, 160, 91, 0.45); }
.type-card__code { font-family: var(--font-mono); font-size: 0.7rem; color: var(--brass); letter-spacing: 0.1em; }
.type-card h3 { margin-top: 10px; font-size: var(--fs-h3); font-weight: 600; line-height: 1.3; }
.type-card p { margin-top: 8px; color: var(--ink-steam); font-size: var(--fs-small); }

/* ---------- Преимущества ---------- */
.benefits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.benefit {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  background: linear-gradient(180deg, rgba(239, 233, 223, 0.025), transparent 60%);
}
.benefit__num { font-family: var(--font-mono); color: var(--brass); font-size: 0.75rem; letter-spacing: 0.1em; }
.benefit h3 { margin-top: 12px; font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; }
.benefit p { margin-top: 8px; color: var(--ink-steam); font-size: var(--fs-small); }

/* ---------- Бренды ---------- */
.brands-block { border-block: 1px solid var(--line-soft); background: var(--bg-inset); }
.brands-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.brands-group h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 16px; font-weight: 500;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-steam);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.chip:hover { color: var(--brass-bright); border-color: rgba(201, 160, 91, 0.5); }

/* ---------- Форма-квиз ---------- */
.quiz-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.quiz-note { margin-top: 18px; color: var(--ink-steam); font-size: var(--fs-small); max-width: 40ch; }

.form-card {
  background: var(--bg-steel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow-card);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-steam); margin-bottom: 8px;
}
.field input, .field select {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-milk);
  padding: 13px 14px;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--dur-fast);
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus, .field select:focus { outline: none; border-color: var(--brass); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-steam) 50%), linear-gradient(135deg, var(--ink-steam) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.field--error input, .field--error select { border-color: var(--err); }

.form-consent { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; font-size: 0.8rem; color: var(--ink-faint); }
.form-consent input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--brass); }

.form-status { display: none; border-radius: 10px; padding: 14px 16px; font-size: 0.9rem; margin-bottom: 16px; overflow-wrap: anywhere; word-break: break-word; }
.form-status--ok { display: block; background: rgba(111, 191, 115, 0.12); border: 1px solid rgba(111, 191, 115, 0.4); color: var(--ok); }
.form-status--err { display: block; background: rgba(224, 101, 79, 0.12); border: 1px solid rgba(224, 101, 79, 0.4); color: var(--err); }
.form-status--info { display: block; background: rgba(201, 160, 91, 0.1); border: 1px solid rgba(201, 160, 91, 0.35); color: var(--brass-bright); }

.form-hint { margin-top: 14px; font-size: 0.75rem; color: var(--ink-faint); font-family: var(--font-mono); }

/* ---------- Порядок работы ---------- */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step {
  border: 1px solid rgba(36, 28, 18, 0.14);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  background: #FBF7EF;
}
.step__num { font-family: var(--font-mono); color: #9A7430; font-size: 0.8rem; letter-spacing: 0.1em; }
.step h3 { margin-top: 12px; font-size: var(--fs-h3); font-weight: 600; color: var(--ink-paper); line-height: 1.35; }
.step p { margin-top: 8px; color: var(--ink-paper-dim); font-size: var(--fs-small); }

/* ---------- Неисправности ---------- */
.faults-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.fault {
  background: var(--bg-steel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 24px 22px;
}
.fault h3 { font-size: var(--fs-h3); font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.fault h3 .code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--brass); letter-spacing: 0.08em; white-space: nowrap; }
.fault p { margin-top: 10px; color: var(--ink-steam); font-size: var(--fs-small); }
.fault p b { color: var(--ink-milk); font-weight: 500; }

/* ---------- Прайс (paper) ---------- */
.price-table-wrap { overflow-x: auto; border-radius: var(--radius-card); border: 1px solid rgba(36, 28, 18, 0.14); background: #FBF7EF; box-shadow: var(--shadow-card); }
table.price { width: 100%; border-collapse: collapse; min-width: 560px; }
.price th, .price td { padding: 13px 20px; text-align: left; font-size: 0.92rem; }
.price thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-paper-dim);
  border-bottom: 1px solid rgba(36, 28, 18, 0.18);
}
.price tbody tr { border-bottom: 1px solid rgba(36, 28, 18, 0.07); }
.price tbody tr:last-child { border-bottom: none; }
.price td:last-child { font-family: var(--font-mono); white-space: nowrap; color: var(--ink-paper); font-weight: 500; }
.price .free { color: #4C8A50; }
.price-note { margin-top: 16px; font-size: 0.82rem; color: var(--ink-paper-dim); max-width: 75ch; }

/* ---------- Фото мастерской ---------- */
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.photo {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-inset);
}
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.photo:hover img { transform: scale(1.04); }
.photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 16px 12px;
  background: linear-gradient(transparent, rgba(13, 10, 7, 0.85));
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-steam);
}

/* ---------- Оплата и гарантия ---------- */
.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pay-card { border: 1px solid var(--line-soft); border-radius: var(--radius-card); padding: 24px 22px; background: linear-gradient(180deg, rgba(239, 233, 223, 0.025), transparent 60%); }
.pay-card h3 { font-size: var(--fs-h3); font-weight: 600; }
.pay-card p { margin-top: 8px; color: var(--ink-steam); font-size: var(--fs-small); }

/* ---------- Отзывы (заглушка) ---------- */
.reviews-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  color: var(--ink-steam);
}
.reviews-empty h3 { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink-milk); margin-bottom: 10px; }
.reviews-empty p { max-width: 52ch; margin-inline: auto; font-size: var(--fs-small); }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; max-width: 860px; }
.faq-item { border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg-steel); overflow: hidden; }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 52px 18px 20px;
  font-weight: 600;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); color: var(--brass); font-size: 1.2rem;
  transition: transform var(--dur-fast) var(--ease-out);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item .faq-a { padding: 0 20px 18px; color: var(--ink-steam); font-size: var(--fs-small); max-width: 70ch; }

/* ---------- Финальный CTA ---------- */
.cta-final { text-align: center; }
.cta-final h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.25; }
.cta-final p { margin-top: 14px; color: var(--ink-steam); }
.cta-final .btn-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-soft); background: #120E0A; padding-block: clamp(40px, 6vw, 64px) 96px; font-size: var(--fs-small); color: var(--ink-steam); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 32px; }
.footer .logo img { height: 22px; margin-bottom: 16px; }
.footer h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px; font-weight: 500; }
.footer ul li { margin-bottom: 9px; }
.footer a:hover { color: var(--brass-bright); }
.footer__req { margin-top: 18px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); line-height: 1.8; }
.footer__bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-faint); }

/* ---------- Мобильная панель связи ---------- */
.contact-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(18, 14, 10, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-soft);
}
.contact-bar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 6px;
  border-radius: 10px;
  font-size: 0.85rem; font-weight: 600;
  background: var(--bg-steel);
  border: 1px solid var(--line-soft);
}
.contact-bar a--call { background: var(--brass); color: #16120E; border-color: transparent; }

/* ---------- Reveal-анимации ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .types-grid { grid-template-columns: repeat(2, 1fr); }
  .benefits-grid, .steps-grid, .pay-grid, .brands-groups { grid-template-columns: repeat(2, 1fr); }
  .hero__grid { grid-template-columns: 1fr; }
  .lcd { max-width: 560px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav, .header__phone { display: none; }
  .burger { display: block; }
  .contact-bar { display: grid; }
  body { padding-bottom: 0; }

  .nav--mobile-open {
    display: flex;
    position: fixed; inset: 72px 0 auto 0; z-index: 59;
    background: #120E0A;
    border-bottom: 1px solid var(--line);
    padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  }
  .nav--mobile-open ul { flex-direction: column; gap: 4px; }
  .nav--mobile-open a { display: block; padding: 12px 0; font-size: 1.05rem; color: var(--ink-milk); border-bottom: 1px solid var(--line-soft); }
  .nav--mobile-open .nav__cta { margin-top: 16px; display: block; text-align: center; }

  .quiz-grid, .form-row { grid-template-columns: 1fr; }
  .faults-grid, .photos-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .types-grid, .benefits-grid, .steps-grid, .pay-grid, .brands-groups, .faults-grid, .footer-grid { grid-template-columns: 1fr; }
  .photos-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hero__cta .btn { width: 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
