/* ==========================================================================
   «Без Хаоса» — all.bezhaosa.ru
   Минималистичный одноэкранный лендинг с живой кинетической сеткой
   По спецификации дизайн-системы bezhaosa.ru и стандарту Impeccable
   ========================================================================== */

@font-face {
  font-family: "Onest Variable";
  src: url("/public/fonts/onest-variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Onest;
  src: url("/public/fonts/onest-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Onest;
  src: url("/public/fonts/onest-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: Onest;
  src: url("/public/fonts/onest-800.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --paper-subtle: #faf9f7;
  --ink: #101112;
  --stone: #6f6258;
  --stone-hover: #544941;
  --stone-light: #c4b8ad;
  --muted: #5e6565;
  --placeholder: #5e6565;
  --line: #d7dddd;
  --pad: clamp(1.25rem, 3.5vw, 4rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: "Onest Variable", Onest, Arial, sans-serif;
}

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

/* --------------------------------------------------------------------------
   Браузерные поверхности (Craft Floor)
   -------------------------------------------------------------------------- */
::selection {
  background: var(--stone);
  color: #ffffff;
}

::-moz-selection {
  background: var(--stone);
  color: #ffffff;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.35;
  caret-color: var(--stone);
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Кастомный тонкий скроллбар */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--stone);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font: inherit;
}

/* Фокус клавиатуры */
:focus-visible {
  outline: 3px solid var(--stone);
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   0. Интерактивная архитектурная сетка и световой ореол
   -------------------------------------------------------------------------- */
.bg-grid-aura {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(16, 17, 18, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 17, 18, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 95% 90% at 50% 50%, #000 50%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 95% 90% at 50% 50%, #000 50%, transparent 100%);
  opacity: 0.9;
}

.bg-ambient-light {
  position: absolute;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(111, 98, 88, 0.14) 0%, rgba(111, 98, 88, 0.05) 45%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  will-change: transform;
  animation: ambient-idle 12s ease-in-out infinite alternate;
}

@keyframes ambient-idle {
  0% {
    opacity: 0.85;
    scale: 0.95;
  }
  50% {
    opacity: 1;
    scale: 1.05;
  }
  100% {
    opacity: 0.9;
    scale: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-ambient-light {
    animation: none;
    top: 40%;
    left: 55%;
    transform: translate(-50%, -50%);
  }
}

/* Page Shell */
.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  width: 100%;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   1. Шапка (Header)
   -------------------------------------------------------------------------- */
.site-header {
  position: static;
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.wordmark {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  align-items: center;
  font-size: 0.9rem;
  letter-spacing: -0.015em;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 180ms var(--ease);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--stone);
}

.site-nav .nav-mobile {
  color: var(--stone);
}

.nav-arrow {
  display: inline-block;
  transition: transform 180ms var(--ease);
}

.site-nav a:hover .nav-arrow {
  transform: translate(2px, -2px);
}

.site-nav .nav-action {
  color: var(--stone);
  border-bottom: 1px solid var(--stone);
  padding-bottom: 0.15rem;
}

.site-nav .nav-action:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

@media (max-width: 800px) {
  .site-header {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .site-nav {
    gap: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   2. Основная рабочая область (Main Viewport)
   -------------------------------------------------------------------------- */
.main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1.5rem, 3vh, 3rem) var(--pad);
  box-sizing: border-box;
  width: 100%;
  position: relative;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(2rem, 4vw, 5.5rem);
  align-items: center;
  width: 100%;
  max-width: 1360px;
  margin: auto 0;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   3. Левая колонка: Типографический стейтмент и форма
   -------------------------------------------------------------------------- */
.lead-panel {
  display: flex;
  flex-direction: column;
}

/* Фирменная кинетическая анимация появления строк заголовка как на bezhaosa.ru */
@keyframes hero-line-arrive {
  from {
    opacity: 0;
    transform: translateY(0.75em);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: inset(-0.2em -4em);
  }
}

.headline {
  margin: 0 0 1.25rem;
  font-size: clamp(2.3rem, 3.8vw, 4.1rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.055em;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.headline span {
  display: block;
  animation: hero-line-arrive 680ms both var(--ease);
}

.headline span:nth-child(1) { animation-delay: 40ms; }
.headline span:nth-child(2) { animation-delay: 130ms; }
.headline span:nth-child(3) { animation-delay: 220ms; }

.headline-accent {
  color: var(--stone);
}

@media (prefers-reduced-motion: reduce) {
  .headline span {
    animation: none;
  }
}

.description {
  margin: 0 0 1.75rem;
  font-size: clamp(0.98rem, 1.1vw, 1.12rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 32rem;
}

/* --------------------------------------------------------------------------
   4. Форма заявки
   -------------------------------------------------------------------------- */
.lead-form {
  display: grid;
  gap: 1.25rem;
  max-width: 32rem;
  width: 100%;
}

.request-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.request-field {
  display: grid;
  gap: 0.4rem;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.request-field input,
.request-field textarea {
  min-width: 0;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.5rem 0 0.6rem;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  outline: none;
  transition: border-bottom-color 160ms var(--ease);
}

.request-field textarea {
  resize: none;
  min-height: 3.5rem;
  line-height: 1.4;
}

.request-field input:focus,
.request-field textarea:focus {
  border-bottom: 2px solid var(--stone);
}

.request-field input::placeholder,
.request-field textarea::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.field-label-split {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.char-counter {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

/* Кнопка отправки */
.request-submit {
  margin-top: 0.25rem;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 1.05rem 1.4rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  transition: background 200ms var(--ease);
}

.submit-arrow {
  display: inline-block;
  transition: transform 180ms var(--ease);
}

.request-submit:hover,
.request-submit:focus-visible {
  background: var(--stone);
}

.request-submit:hover .submit-arrow {
  transform: translateX(4px);
}

.request-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Мета-блок под кнопкой */
.form-footer-meta {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.consent-field {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
}

.consent-field input {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  accent-color: var(--ink);
  margin: 0;
  border-radius: 0;
}

.consent-field a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  transition: color 150ms var(--ease), border-bottom-color 150ms var(--ease);
}

.consent-field a:hover {
  color: var(--stone);
  border-bottom-color: var(--stone);
}

.trust-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.trust-icon {
  display: inline-flex;
  color: var(--stone);
}

.form-note {
  min-height: 1.3em;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.35;
}

.form-note.is-success {
  color: #1a6f3b;
  font-weight: 600;
}

.form-note.is-error {
  color: #a52525;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. Правая колонка: Редакционная сетка 2x2 «Что мы создаём»
   -------------------------------------------------------------------------- */
.editorial-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.scope-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--ink);
}

.scope-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-transform: uppercase;
}

.scope-meta {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--stone);
  text-transform: uppercase;
}

.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin-top: 1.15rem;
}

.scope-item {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: clamp(1.25rem, 1.8vw, 1.65rem);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}

.scope-item:hover {
  background: var(--paper-subtle);
  border-color: var(--ink);
}

.scope-item-head {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.scope-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.scope-item h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.scope-item p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.scope-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.85rem;
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.scope-sla-dot {
  width: 6px;
  height: 6px;
  background: var(--stone);
  border-radius: 50%;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   6. Тонкая адаптивность под MacBook, ноутбуки и компактные экраны
   -------------------------------------------------------------------------- */
@media (max-height: 840px) {
  .main {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
  }
  .headline {
    font-size: clamp(1.9rem, 2.9vw, 2.85rem);
    margin-bottom: 0.8rem;
    line-height: 0.95;
  }
  .description {
    font-size: 0.94rem;
    margin-bottom: 1.15rem;
    line-height: 1.4;
  }
  .lead-form {
    gap: 0.95rem;
  }
  .request-field input,
  .request-field textarea {
    padding: 0.4rem 0 0.5rem;
    font-size: 0.95rem;
  }
  .request-field textarea {
    min-height: 3rem;
  }
  .request-submit {
    padding: 0.9rem 1.25rem;
  }
  .scope-grid {
    gap: 0.85rem;
    margin-top: 0.85rem;
  }
  .scope-item {
    padding: 0.95rem 1.1rem;
    gap: 0.4rem;
  }
  .scope-item h3 {
    font-size: 0.92rem;
  }
  .scope-item p {
    font-size: 0.8rem;
    line-height: 1.35;
  }
}

@media (max-width: 1040px) {
  .main {
    align-items: flex-start;
    padding-top: 2rem;
    padding-bottom: 3.5rem;
  }
  .content-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    margin: 0 auto;
  }
  .lead-panel, .lead-form {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .headline {
    font-size: clamp(2rem, 8vw, 2.75rem);
  }
  .scope-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .scope-item {
    padding: 1.15rem;
  }
}
