/* ============================================================
   ialex.ru — dark engineering minimalism
   ============================================================ */

:root {
  --bg: #080A0C;
  --card: #101317;
  --text: #F1F3F5;
  --sec: #8A919B;
  --sec-dim: #5C646E;
  --line: #252A31;
  --accent: #B8F35A;
  --accent-soft: rgba(184, 243, 90, .14);
  --error: #E08D7D;

  --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-s: 8px;
  --r-m: 12px;

  --ease: cubic-bezier(.2, .7, .25, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 clamp(16.5px, 1.32vw, 19px) / 1.55 var(--font-sans);
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }

::selection { background: var(--accent-soft); color: var(--text); }

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

.container {
  max-width: calc(1280px + 8rem);
  margin-inline: auto;
  padding-inline: clamp(20px, 4.5vw, 64px);
}

/* ---------- shared bits ---------- */

.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--accent);
  color: #0B0D08;
  font: 600 14px/1 var(--font-sans);
  padding: 12px 16px;
  border-radius: var(--r-s);
  text-decoration: none;
}
.skip:focus-visible { top: 16px; }

.kicker {
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sec);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.kicker__num { color: var(--accent); }

h2 {
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.022em;
  margin-top: 22px;
}

.lead {
  margin-top: 18px;
  max-width: 620px;
  color: var(--sec);
}

.arr {
  display: inline-block;
  font-weight: 500;
  transition: transform .2s var(--ease);
}
.btn:hover .arr { transform: translate(2px, -2px); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #0C0E06;
  font: 600 15px/1 var(--font-sans);
  padding: 15px 22px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease;
}
.btn:hover { background: #C9FA79; }
.btn:active { transform: scale(.97); transition: transform .1s ease-out; }

.btn--sm { padding: 10px 16px; font-size: 13.5px; border-radius: var(--r-s); }

/* ---------- header ---------- */

.header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}
.header.scrolled {
  background: rgba(8, 10, 12, .7);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: rgba(37, 42, 49, .8);
}

.header__in {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 68px;
}

.brand {
  font: 600 13px/1 var(--font-mono);
  letter-spacing: .14em;
  text-decoration: none;
  white-space: nowrap;
}
.brand__slash { color: var(--accent); margin: 0 6px; }

.nav { display: flex; gap: 30px; }
.nav a {
  font-size: 14.5px;
  color: var(--sec);
  text-decoration: none;
  padding-block: 8px;
  transition: color .15s ease;
}
.nav a:hover { color: var(--text); }

.header .btn--sm { margin-left: auto; }

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

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: 140px 150px;
}

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  -webkit-mask-image: linear-gradient(97deg, transparent 4%, rgba(0,0,0,.16) 30%, #000 58%);
  mask-image: linear-gradient(97deg, transparent 4%, rgba(0,0,0,.16) 30%, #000 58%);
}

.hero__in { position: relative; z-index: 1; width: 100%; }

.hero__kicker { margin-bottom: 26px; }

.hero__title {
  font-size: clamp(44px, 7.2vw, 104px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -.028em;
  max-width: 8.4em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .07em; margin-bottom: -.07em; }
.hero__title .line > span { display: block; }

.hero__desc {
  margin-top: 30px;
  max-width: 560px;
  color: var(--sec);
}

.hero__cta {
  margin-top: 42px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.link-more {
  font-size: 15.5px;
  color: var(--sec);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .15s ease;
}
.link-more:hover { color: var(--text); }
.link-more__down { color: var(--accent); font-weight: 500; animation: nudge 2.6s ease-in-out .9s infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(3px); } }

.hero__sys {
  position: absolute;
  inset-inline: 0;
  bottom: 30px;
  z-index: 1;
  font: 500 12px/1.6 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sec-dim);
}

/* ---------- sections ---------- */

.section { padding-block: clamp(72px, 9.5vw, 148px); }

/* cards */

.cards {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 32px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .25s ease;
}
.card:hover { border-color: #3B434E; }

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.card__num {
  font: 600 22px/1 var(--font-mono);
  color: #4E5660;
  transition: color .25s ease;
}
.card__icon { width: 42px; height: 42px; color: #525A65; transition: color .25s ease; }
.card__icon [stroke], .card__icon path, .card__icon rect, .card__icon circle {
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card:hover .card__num, .card:hover .card__icon { color: var(--accent); }
.card:hover .icon-accent { color: var(--accent); stroke: var(--accent); }
.icon-accent { color: inherit; }

.card h3 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.card p { font-size: 16.5px; line-height: 1.55; color: var(--sec); }

/* scenario rows */

.rows { margin-top: 52px; border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 52px 1fr 1.3fr 140px;
  gap: 36px;
  align-items: center;
  padding-block: 30px;
  border-bottom: 1px solid var(--line);
  transition: padding .3s var(--ease), background .3s ease;
}
.row:hover { padding-block: 36px; background: rgba(255, 255, 255, .02); }

.row__num { font: 500 13px/1 var(--font-mono); color: var(--sec-dim); letter-spacing: .1em; }
.row__title { font-size: clamp(19px, 1.8vw, 23px); font-weight: 650; letter-spacing: -.01em; }
.row__desc { color: var(--sec); font-size: 16.5px; }

.row__viz { width: 120px; height: 48px; justify-self: end; color: #454D58; opacity: .5; transition: opacity .3s ease, transform .3s var(--ease), color .3s ease; transform: translateX(6px); }
.row__viz path, .row__viz rect, .row__viz circle { stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.row__viz .icon-accent { color: #454D58; fill: none; }
.row:hover .row__viz { opacity: 1; transform: none; color: #7D8794; }
.row:hover .row__viz .icon-accent { color: var(--accent); }

.note { margin-top: 44px; max-width: 580px; color: var(--sec); font-size: 15.5px; }

/* approach steps */

.steps {
  margin-top: 64px;
  padding-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  position: relative;
  counter-reset: step;
}
.steps::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.step { position: relative; }
.step::before {
  content: '';
  position: absolute;
  top: calc(-40px - 4px);
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid #4A525E;
}
.step__num { font: 500 13px/1 var(--font-mono); color: var(--sec-dim); letter-spacing: .1em; }
.step h3 { font-size: 21px; font-weight: 650; margin-top: 14px; letter-spacing: -.01em; }
.step p { color: var(--sec); font-size: 16.5px; margin-top: 8px; }

.principles {
  margin-top: 72px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font: 500 12.5px/1.7 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #767E89;
}

/* ---------- contact ---------- */

.contact {
  position: relative;
  background: linear-gradient(180deg, #0A0D10 0%, var(--bg) 100%);
}
.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(620px 420px at 16% 0%, rgba(184, 243, 90, .07), transparent 70%);
  pointer-events: none;
}

.contact__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 6vw, 88px);
  align-items: start;
}

.contact__text { margin-top: 18px; color: var(--sec); max-width: 480px; }

.contact__tags {
  margin-top: 26px;
  font: 500 12.5px/1.6 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #767E89;
}


.contact__hint { margin-top: 18px; color: var(--sec); font-size: 15px; }

/* form */

.form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 30px;
  display: grid;
  gap: 18px;
}
.form__title {
  font: 600 12px/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sec-dim);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--sec);
  margin-bottom: 8px;
  font-weight: 500;
}
.field input, .field textarea {
  width: 100%;
  background: #0C0F13;
  border: 1px solid #232932;
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--text);
  font: 400 15.5px/1.5 var(--font-sans);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: #5A6270; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 243, 90, .12);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--sec);
  cursor: pointer;
  user-select: none;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1.5px solid #39414C;
  border-radius: 5px;
  background: #0C0F13;
  cursor: pointer;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #0C0E06;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check a { color: var(--sec); text-underline-offset: 3px; }
.check a:hover { color: var(--text); }

.form .btn { justify-self: start; }
.form__status { min-height: 1.2em; font-size: 14.5px; }
.form__status.ok { color: var(--accent); }
.form__status.err { color: var(--error); }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--line); padding-block: 32px; }
.footer__in {
  display: flex;
  align-items: center;
  gap: 16px 32px;
  flex-wrap: wrap;
}
.footer__copy { color: #79818C; font-size: 14px; }
.footer__links { margin-left: auto; display: flex; gap: 28px; align-items: center; }
.footer__links a { font-size: 14px; color: var(--sec); text-decoration: none; transition: color .15s ease; }
.footer__links a:hover { color: var(--text); }
.arr-up { color: var(--accent); margin-left: 6px; display: inline-block; }
.totop:hover .arr-up { transform: translateY(-2px); }

/* ---------- motion ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@keyframes rise { from { transform: translateY(112%); } to { transform: none; } }

.js .hero__title .line > span {
  transform: translateY(112%);
  animation: rise .7s var(--ease) forwards;
}
.js .hero__title .line:nth-child(1) > span { animation-delay: .1s; }
.js .hero__title .line:nth-child(2) > span { animation-delay: .22s; }
.js .hero__title .line:nth-child(3) > span { animation-delay: .34s; }

/* ---------- breakpoints ---------- */

@media (max-width: 1100px) {
  .row { grid-template-columns: 40px 1fr 1.3fr 110px; gap: 24px; }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 48px 32px; }
  .step::before { top: calc(-40px - 4px); }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .row { grid-template-columns: 36px 1fr; grid-template-rows: auto auto; row-gap: 8px; }
  .row__title { grid-column: 2; }
  .row__desc { grid-column: 2; grid-row: 2; }
  .row__viz { display: none; }
  .hero { padding-block: 120px 120px; }
  .hero__cta { gap: 20px; }
}

@media (max-width: 560px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 0;
    padding-left: 28px;
  }
  .steps::before {
    top: 6px;
    bottom: 6px;
    left: 3px;
    right: auto;
    width: 1px;
    height: auto;
  }
  .step::before { top: 6px; left: calc(-28px + 0px); }
  .form { padding: 22px; }
}

/* ---------- reduced motion / accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .js .hero__title .line > span { transform: none; animation: none; }
  .link-more__down { animation: none; }
  .arr, .arr-up { transition: none; }
  .row, .row__viz, .card, .btn { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .header.scrolled { background: rgba(8, 10, 12, .96); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media print {
  .header, .hero__sys, #field, .form, .btn { display: none; }
  body { background: #fff; color: #000; }
}
