/* ==========================================================================
   Reddy Team - главная
   Тема зафиксирована тёмной как брендовое решение (одна тема на всю страницу).
   Радиусы: кнопки и поля 10px, карточки 16px, пилюли - полный.
   Акцент один на всю страницу: --accent.
   ========================================================================== */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg:        #0a0b0d;
  --surface:   #101217;
  --surface-2: #161a20;
  --line:      rgba(255, 255, 255, .085);
  --line-2:    rgba(255, 255, 255, .16);
  --fg:        #f3f4f7;
  --fg-2:      #c3c8d2;
  --muted:     #878e9d;
  /* --accent: только текст и иконки на тёмном (5.04:1 к --bg).
     Для заливок под белый текст нужен более тёмный тон: белое на #e0503a даёт 3.90 и валит AA. */
  --accent:      #e0503a;
  --accent-2:    #f26a53;  /* focus-ring и акцентный текст, 6.53:1 к --bg */
  --accent-fill: #c7422c;  /* фон кнопки, белый текст 4.95:1 */
  --accent-fill-h: #b83a26;/* hover: контраст растёт до 5.72:1, а не падает */
  --accent-bg:   rgba(224, 80, 58, .12);

  --r-input: 10px;
  --r-card: 16px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --shell: min(100% - 2.5rem, 78rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

/* viewport-fit=cover: в ландшафте на телефонах с вырезом контент не должен уезжать под него */
.shell {
  width: var(--shell);
  margin-inline: auto;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}
.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* ссылка «к содержимому»: скрыта, пока на неё не встал фокус с клавиатуры */
.skip:focus {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 100;
  width: auto;
  height: auto;
  clip: auto;
  padding: .625rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-input);
  font-size: .875rem;
}
main:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------- типографика --------------------------- */

h1, h2, h3 { font-weight: 500; letter-spacing: -.035em; text-wrap: balance; }

h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.1;
}
h3 { font-size: 1.0625rem; line-height: 1.35; }

.lead { color: var(--fg-2); font-size: clamp(1rem, 1.7vw, 1.1875rem); max-width: 34rem; text-wrap: pretty; }
.body { color: var(--muted); font-size: .9375rem; text-wrap: pretty; }

.eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  white-space: nowrap;
  padding: .8125rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--r-input);
  font: inherit;
  font-size: .9375rem;
  font-weight: 450;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { pointer-events: none; opacity: .7; }

.btn--primary { background: var(--accent-fill); color: #fff; }
.btn--primary:hover { background: var(--accent-fill-h); }

.btn--ghost { background: rgba(255, 255, 255, .04); border-color: var(--line-2); color: var(--fg); }
.btn--ghost:hover { background: rgba(255, 255, 255, .09); }

.btn--sm { padding: .5625rem .9375rem; font-size: .875rem; }

/* ------------------------------- шапка ---------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  display: flex;
  align-items: center;
  background: rgba(10, 11, 13, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; gap: 2rem; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.0625rem;
  font-weight: 550;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}
.logo__mark { width: 1.375rem; height: 1.375rem; }

.nav__links { display: flex; gap: 1.75rem; list-style: none; }
.nav__links a {
  font-size: .9063rem;
  color: var(--fg-2);
  text-decoration: none;
  transition: color .18s var(--ease);
}
.nav__links a:hover { color: var(--fg); }

@media (max-width: 900px) { .nav__links { display: none; } }
/* на узких экранах у кнопки в шапке короткий лейбл, чтобы логотип не переносился */
@media (max-width: 560px) {
  .nav .btn__long { display: none; }
  .nav .btn { padding-inline: .75rem; }
}
@media (min-width: 561px) { .btn__short { display: none; } }

/* ------------------------------- hero ----------------------------------- */

.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 7vw, 5.5rem);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  width: 90rem;
  height: 45rem;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(224, 80, 58, .13), transparent 70%);
  pointer-events: none;
}
.hero__in {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero__copy > * + * { margin-top: 1.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero__media {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3.2;
  background: var(--surface);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08) brightness(.72); }
/* дуотон: снимок уводится в брендовый красный, чтобы любой кадр читался как фирменный */
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(200deg, rgba(224, 80, 58, .42), rgba(10, 11, 13, .2) 55%),
    linear-gradient(0deg, rgba(10, 11, 13, .75), transparent 55%);
  mix-blend-mode: hard-light;
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; }
  .hero__media { aspect-ratio: 16 / 11; order: -1; }
}

/* ------------------------------- полоса-факты --------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
/* в разметке dt идёт перед dd (так требует html), визуально значение сверху.
   order вместо column-reverse: иначе колонки прижимаются к низу и значения разъезжаются. */
.facts div { padding: 1.5rem 1.75rem; display: flex; flex-direction: column; }
.facts dd { order: -1; }
.facts div + div { border-left: 1px solid var(--line); }
.facts dt { font-size: .8125rem; color: var(--muted); }
.facts dd {
  font-family: 'Geist Mono', monospace;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -.03em;
  margin-bottom: .25rem;
}

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts div:nth-child(3) { border-left: none; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 460px) {
  .facts { grid-template-columns: 1fr; }
  .facts div + div { border-left: none; border-top: 1px solid var(--line); }
}

/* ------------------------------- секции --------------------------------- */

.sec { padding: clamp(4rem, 9vw, 7rem) 0; }
/* якоря не должны уезжать под липкую шапку */
[id] { scroll-margin-top: 88px; }
.sec__head { max-width: 42rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.sec__head > * + * { margin-top: .875rem; }

/* ------------------------------- бенто ---------------------------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}
.tile__ico {
  font-size: 1.375rem;
  color: var(--accent);
  margin-bottom: .375rem;
}
.tile--wide { grid-column: span 2; }

/* ячейка с фотографией */
.tile--media { padding: 0; min-height: 17rem; justify-content: flex-end; }
.tile--media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.5) contrast(1.1); }
.tile--media .tile__body {
  position: relative;
  padding: 2.5rem 1.75rem 1.75rem;
  background: linear-gradient(0deg, rgba(8, 9, 11, .97) 32%, rgba(8, 9, 11, .82) 62%, transparent);
}
.tile--media .tile__body .body { color: var(--fg-2); }

/* ячейка с брендовой заливкой */
.tile--accent {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(224, 80, 58, .22), transparent 62%),
    var(--surface-2);
}
/* ячейка с сеткой-паттерном */
.tile--grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(90% 80% at 85% 15%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(90% 80% at 85% 15%, #000, transparent 72%);
  pointer-events: none;
}
.tile--grid > * { position: relative; }

@media (max-width: 1000px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .tile--wide { grid-column: span 1; }
}

/* ------------------------------- безопасность --------------------------- */

.guard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.guard__list { list-style: none; display: grid; gap: 1.5rem; }
.guard__list li { display: grid; grid-template-columns: auto 1fr; gap: .875rem 1rem; align-items: start; }
.guard__list .icon { font-size: 1.25rem; color: var(--accent); margin-top: .1875rem; }
.guard__list h3 { grid-column: 2; }
.guard__list p { grid-column: 2; }

@media (max-width: 860px) { .guard { grid-template-columns: 1fr; } }

/* ------------------------------- развёртывание -------------------------- */

.deploy { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.deploy__card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.deploy__card--pick { border-color: rgba(224, 80, 58, .38); background: var(--surface-2); }
.deploy__top { display: flex; align-items: center; gap: .75rem; }
.deploy__top .icon { font-size: 1.5rem; color: var(--accent); }
.pill {
  margin-left: auto;
  padding: .1875rem .625rem;
  border-radius: 100px;
  background: var(--accent-bg);
  color: var(--accent-2);
  font-size: .6875rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: 'Geist Mono', monospace;
}
.deploy__list { list-style: none; display: grid; gap: .75rem; font-size: .9375rem; color: var(--fg-2); }
.deploy__list li { display: grid; grid-template-columns: auto 1fr; gap: .625rem; align-items: start; }
.deploy__list .icon { font-size: 1.0625rem; color: var(--accent); margin-top: .1875rem; }

@media (max-width: 800px) { .deploy { grid-template-columns: 1fr; } }

/* ------------------------------- внедрение ------------------------------ */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.steps__item { padding: 2rem 2rem 0 0; }
.steps__item + .steps__item { padding-left: 2rem; border-left: 1px solid var(--line); }
.steps__item h3 { margin-bottom: .625rem; }
.steps__when {
  font-family: 'Geist Mono', monospace;
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .06em;
  display: block;
  margin-bottom: 1rem;
}
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; }
  .steps__item { padding: 1.75rem 0; }
  .steps__item + .steps__item { padding-left: 0; border-left: none; border-top: 1px solid var(--line); }
}

/* ------------------------------- форма ---------------------------------- */

.cta {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(224, 80, 58, .16), transparent 60%),
    var(--surface);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } }

.form { display: grid; gap: 1.125rem; }
.field { display: grid; gap: .5rem; }
.field label { font-size: .875rem; color: var(--fg-2); }
.field input, .field select {
  font: inherit;
  font-size: .9375rem;
  color: var(--fg);
  background: #0c0e11;
  /* граница поля это элемент интерфейса: WCAG 1.4.11 требует 3:1, .38 даёт 3.47 */
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: var(--r-input);
  padding: .75rem .875rem;
  width: 100%;
  transition: border-color .18s var(--ease);
}
.field input::placeholder { color: #7b8291; }
.field input:hover, .field select:hover { border-color: rgba(255, 255, 255, .52); }
.field__hint { font-size: .8125rem; color: var(--muted); }
.field__err { font-size: .8125rem; color: var(--accent-2); display: none; }
.field[data-invalid] input { border-color: var(--accent-2); }
.field[data-invalid] .field__err { display: block; }

.form__note { font-size: .8125rem; color: var(--muted); }
.form__note a { color: var(--fg-2); }

.form__ok {
  display: none;
  gap: .75rem;
  align-items: flex-start;
  padding: 1.125rem 1.25rem;
  border: 1px solid rgba(224, 80, 58, .35);
  border-radius: var(--r-input);
  background: var(--accent-bg);
  font-size: .9375rem;
}
.form__ok .icon { font-size: 1.25rem; color: var(--accent-2); margin-top: .125rem; }
.form[data-sent] .form__ok { display: flex; }
.form[data-sent] .form__rows { display: none; }

/* ошибка отправки: отдельно от ошибок конкретных полей */
.form__alert {
  display: none;
  padding: .875rem 1rem;
  border: 1px solid rgba(242, 106, 83, .45);
  border-radius: var(--r-input);
  background: rgba(242, 106, 83, .1);
  font-size: .875rem;
  color: var(--fg-2);
}
.form__alert:not(:empty) { display: block; }
.form__alert a { color: var(--accent-2); }
.form__rows { display: grid; gap: 1.125rem; }

.btn[aria-busy='true'] { pointer-events: none; opacity: .72; }

/* ------------------------------- подвал --------------------------------- */

.foot { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; }
.foot__in { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; align-items: center; justify-content: space-between; }
.foot__links { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; font-size: .875rem; }
.foot__links a { color: var(--muted); text-decoration: none; }
.foot__links a:hover { color: var(--fg); }
.foot__legal { font-size: .8125rem; color: var(--muted); }

/* ------------------------------- появление при скролле ------------------ */

/* прячем только если JS точно есть: без него страница остаётся читаемой */
@media (prefers-reduced-motion: no-preference) {
  .js .rise { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .rise.is-in { opacity: 1; transform: none; }
}
