/* Общие стили для внутренних страниц К{о}т.Строй.
   Редакционная эстетика: светлый бумажный фон, Instrument Serif + Geist + JetBrains Mono,
   единственный акцент #3454d1. Имена классов совместимы со старой разметкой. */

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

:root {
  --accent:       #3454d1;
  --accent-hover: #2a44b8;
  --paper:        #FAF8F3;
  --paper-2:      #F3F0E8;
  --ink:          #0E0E0C;
  --ink-2:        #2A2A28;
  --muted:        #7A776E;
  --hair:         rgba(14,14,12,.08);
  --hair-strong:  rgba(14,14,12,.18);
  --rule:         #1C1C1A;

  /* legacy-алиасы, чтобы старые sub-страницы продолжали собираться */
  --bg:         var(--paper);
  --bg-card:    var(--paper-2);
  --bg-pill:    var(--paper-2);
  --accent-2:   var(--accent);
  --text:       var(--ink);
  --text-dim:   var(--ink-2);
  --text-muted: var(--muted);
  --border:     var(--hair);

  --display: "Instrument Serif", "Times New Roman", serif;
  --sans:    "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;
  --font:    var(--sans);
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01","cv11";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

/* ───── NAV ───── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hair);
  transition: border-color 0.3s, background 0.3s;
}

.nav.scrolled {
  border-bottom-color: var(--hair-strong);
}

/* Бренд «К{о}т.Строй» в навигации */
.nav-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 4px;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 0;
}

.nav-pill:hover {
  color: var(--ink);
}

.nav-pill .logo-cat {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}
.nav-pill .logo-cat svg {
  width: 22px;
  height: 20px;
  display: block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-pill:hover .logo-cat svg {
  transform: rotate(-8deg) scale(1.08);
}

.nav-center {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 10px 24px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nav-center a {
  color: var(--ink-2);
  transition: color 0.2s;
}
.nav-center a.active,
.nav-center a:hover { color: var(--accent); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: url('/assets/img/paw-cursor.svg') 8 8, pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.nav-cta:hover {
  transform: translateY(-1px);
  background: var(--ink-2);
}

.burger {
  display: none;
  width: 36px;
  height: 36px;
  background: var(--paper-2);
  border: 1px solid var(--hair-strong);
  border-radius: 50%;
  cursor: pointer;
  padding: 10px;
  color: var(--ink);
}
.burger svg { width: 100%; height: 100%; }

main { flex: 1; }

/* ───── FOOTER ───── */
.foot {
  background: var(--paper);
  border-top: 1px solid var(--hair);
  padding: 48px 32px 28px;
  margin-top: 80px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
}
.foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.foot-brand {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: none;
}
.foot-brand .brace { color: var(--accent); font-family: var(--mono); font-size: 20px; }
.foot-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--ink-2);
  flex-wrap: wrap;
  letter-spacing: 0;
  font-family: var(--sans);
}
.foot-links a:hover { color: var(--accent); }
.foot-copy {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .06em;
}

/* ───── Пасхалки: курсор-лапка + stretch ───── */
.btn, .btn-primary, .btn-ghost, .btn-accent,
.nav-cta, .media-cta-btn, .speakers-btn,
.mx-submit, .mx-close {
  cursor: url('/assets/img/paw-cursor.svg') 8 8, pointer;
}

@keyframes cat-stretch {
  0%   { transform: scaleX(1)   scaleY(1);   }
  35%  { transform: scaleX(1.05) scaleY(0.9); }
  65%  { transform: scaleX(0.96) scaleY(1.04);}
  100% { transform: scaleX(1)   scaleY(1);   }
}

/* ───── Адаптив nav ───── */
@media (max-width: 860px) {
  .nav { padding: 14px 16px; gap: 10px; }
  .nav-center {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--hair);
    padding: 18px 16px;
    gap: 14px;
  }
  .nav.open .nav-center { display: flex; }
  .burger { display: block; }
}

/* ───── Hero-шапка для внутренних страниц ───── */
.page-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 32px 40px;
  text-align: left;
}
.page-hero .crumb,
.page-hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.page-hero .crumb a,
.page-hero .kicker a { color: var(--ink-2); }
.page-hero .crumb a:hover,
.page-hero .kicker a:hover { color: var(--accent); }

.page-hero h1,
.page-hero .hero-title {
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 96px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--ink);
}
.page-hero .accent,
.page-hero h1 .accent,
.page-hero .hero-title .accent { font-style: italic; color: var(--accent); font-weight: 400; }

.page-hero .hero-sub,
.page-hero p {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
}

@media (max-width: 600px) {
  .page-hero { padding: 48px 20px 28px; }
}

/* ───── Универсальные кнопки (btn/btn-primary/btn-ghost) ───── */
.btn, .btn-primary, .btn-ghost, .btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:hover, .btn-primary:hover, .btn-accent:hover { transform: translateY(-1px); background: var(--ink-2); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hair-strong);
}
.btn-ghost:hover { background: var(--paper-2); transform: translateY(-1px); }

/* ───── Компактная модалка для sub-страниц ───── */
.mx-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 14, 12, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mx-overlay.active { display: flex; opacity: 1; }
body.mx-open { overflow: hidden; }

.mx {
  background: var(--paper);
  border: 1px solid var(--hair-strong);
  border-radius: 4px;
  width: 100%;
  max-width: 520px;
  padding: 32px 36px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 30px 80px rgba(14, 14, 12, 0.15);
}
.mx-overlay.active .mx { transform: translateY(0); }

.mx-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: var(--paper-2);
  border: 1px solid var(--hair-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  cursor: url('/assets/img/paw-cursor.svg') 8 8, pointer;
  transition: all 0.2s;
}
.mx-close:hover { color: var(--accent); transform: rotate(90deg); border-color: var(--accent); }

.mx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  border: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.mx-chip:before {
  content: "§";
  color: var(--accent);
  margin-right: 4px;
}

.mx-title {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin-bottom: 10px;
  color: var(--ink);
}
.mx-title em, .mx-title .accent { font-style: italic; color: var(--accent); }

.mx-sub {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 20px;
  max-width: 48ch;
}

.mx-form { display: flex; flex-direction: column; gap: 12px; }
.mx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.mx-form input,
.mx-form textarea,
.mx-form select {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--hair-strong);
  border-radius: 0;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.mx-form input:focus,
.mx-form textarea:focus,
.mx-form select:focus {
  border-color: var(--accent);
  background: var(--paper);
}
.mx-form textarea { resize: vertical; min-height: 90px; }

.mx-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  padding: 4px 0;
  letter-spacing: 0.02em;
}
.mx-consent input { width: 14px; height: 14px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.mx-consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.mx-submit {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.mx-submit:hover:not([disabled]) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.mx-submit.stretching { animation: cat-stretch 0.55s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none; }
.mx-submit[disabled] { opacity: 0.7; cursor: wait; }

.mx-error {
  color: #c0392b;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.mx-success { display: none; text-align: center; padding: 24px 0 8px; }
.mx-overlay.success .mx-form,
.mx-overlay.success .mx-chip,
.mx-overlay.success .mx-title,
.mx-overlay.success .mx-sub { display: none; }
.mx-overlay.success .mx-success { display: block; }
.mx-success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent) 12%, var(--paper));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-family: var(--display);
  font-size: 32px;
}
.mx-success h3 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  color: var(--ink);
}
.mx-success p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 42ch;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .mx { padding: 26px 22px; }
  .mx-row { grid-template-columns: 1fr; }
  .mx-title { font-size: 24px; }
}

/* ───── CTA duo + ссылка в бот ───── */
.cta-duo { display: inline-flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cta-bot-link {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.cta-bot-link:hover { color: var(--accent); }
@media (max-width: 900px) { .cta-duo { align-items: stretch; } }

/* ───── Универсальные заголовки секций ───── */
.section-title,
.block-title {
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 12px;
}
.section-title em, .block-title em,
.section-title .accent { font-style: italic; color: var(--accent); font-weight: 400; }

.block-sub,
.section-sub {
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 56ch;
  margin: 0 0 32px;
}

/* ───── Общий bg-grid / bg-glow (для старой разметки отключаем, фон уже бумажный) ───── */
.bg-grid, .bg-glow { display: none !important; }

/* ───── Page sections используют bg-card → paper-2 ───── */
.card, .section-card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 28px;
}
.card:hover, .section-card:hover {
  border-color: var(--hair-strong);
}
