/* МАСТЕХ — лендинг. Палитра и типографика из брендбука v1.0 */

:root {
  --graphite: #0A0A0D;
  --dark: #0C0D10;
  --panel: #0F1013;
  --panel-2: #15171B;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --gray: #8A8F98;
  --body: #C7CBD1;
  --white: #FFFFFF;
  --blue: #0A57FF;
  --blue-hover: #3D79FF;
  --blue-pressed: #0846CC;
  --font-main: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--graphite);
  color: var(--white);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue); color: #fff; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

img { max-width: 100%; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Логотип ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 0.9;
  color: var(--white);
}
.wordmark:hover { color: var(--white); }
.wordmark span { display: inline-block; transform: translateY(0.01em); }
.wordmark-x {
  width: 0.8em;
  height: 0.88em;
  object-fit: contain;
  margin-left: 0.06em;
  transform: translateY(-0.02em);
}
.wordmark--sm { font-size: 1.3rem; }
.wordmark--hero { font-size: clamp(56px, 10vw, 118px); margin: 0; }
.wordmark--footer { font-size: 2rem; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-hover); color: #fff; }
.btn--primary:active { background: var(--blue-pressed); }
.btn--ghost {
  background: transparent;
  color: var(--body);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn--sm { padding: 10px 18px; font-size: 13.5px; }
.btn--wide { width: 100%; }

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 10, 13, 0.72);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-nav { display: flex; gap: 26px; }
.site-nav a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray);
}
.site-nav a:hover { color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: transform 0.2s ease;
}

/* ---------- Секции ---------- */

.section { border-top: 1px solid var(--line); padding: 104px 0; }
.section--alt { background: var(--dark); }

.kicker {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 600;
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 52px;
}
.section-lead {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 600;
  line-height: 1.5;
  color: var(--body);
  margin: -28px 0 56px;
  max-width: 640px;
}
.section-lead--left { margin: 0 0 40px; font-weight: 400; font-size: 18px; }

.grid { display: grid; gap: 28px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }

/* ---------- Рукописные заметки ---------- */

.note {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--gray);
  font-weight: 500;
}
.note--hero { margin-top: 6px; text-align: center; }
.note--inline {
  position: absolute;
  left: 100%;
  top: -1.4em;
  margin-left: 18px;
  white-space: nowrap;
  color: var(--blue);
  font-size: 21px;
  transform: rotate(-4deg);
}
.approach-note-anchor { position: relative; white-space: nowrap; }

/* ---------- Первый экран ---------- */

.hero { padding: 96px 0 110px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 56px;
  align-items: center;
}
.hero-rule {
  height: 1px;
  width: 340px;
  max-width: 100%;
  background: linear-gradient(90deg, var(--blue), transparent);
  margin: 40px 0 28px;
}
.hero-tagline {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 24px;
}
.hero-tagline .accent { color: var(--blue); }
.hero-sub {
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  max-width: 440px;
  margin: 0 0 36px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* мазок-подчёркивание */
.brush-underline { position: relative; white-space: nowrap; }
.brush-underline::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -4%;
  bottom: 0.04em;
  height: 0.26em;
  background: var(--blue);
  border-radius: 60% 40% 50% 50% / 70% 60% 40% 30%;
  z-index: -1;
  opacity: 0.9;
  clip-path: inset(0 100% 0 0);
}
.in-view .brush-underline::after,
.hero .brush-underline::after {
  animation: underline-draw 0.9s ease-out 0.9s forwards;
}
@keyframes underline-draw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* большой Х: белая диагональ + синий мазок, дорисовывается при загрузке */
.hero-mark { margin: 0; justify-self: center; }
.xdraw { position: relative; width: min(340px, 70vw); aspect-ratio: 1; }
.xdraw-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 83%;
  height: 4.6%;
  transform: translate(-50%, -50%) rotate(48deg) scaleX(0);
  transform-origin: center;
  background: var(--white);
  clip-path: polygon(13px 0, 100% 0, calc(100% - 13px) 100%, 0 100%);
  animation: xline-draw 0.5s ease-out 0.25s forwards;
}
.xdraw-brush {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: contain;
  clip-path: circle(0% at 8% 92%);
  animation: xdraw-draw 0.8s ease-out 0.75s forwards;
}
@keyframes xline-draw {
  to { transform: translate(-50%, -50%) rotate(48deg) scaleX(1); }
}
@keyframes xdraw-draw {
  to { clip-path: circle(145% at 8% 92%); }
}

/* ---------- Карточки ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px;
}
.card h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.card p { font-size: 15px; color: var(--gray); margin: 0; }
.card-tick {
  width: 26px;
  height: 4px;
  background: var(--blue);
  border-radius: 2px;
  transform: skewX(-16deg);
  margin-bottom: 22px;
}

/* ---------- Принципы ---------- */

.principle {
  border-top: 2px solid var(--line-strong);
  padding-top: 26px;
}
.principle:first-child { border-top-color: var(--blue); }
.principle svg { margin-bottom: 20px; color: #fff; }
.principle h3 { font-size: 20px; font-weight: 700; margin: 0 0 12px; }
.principle p { font-size: 15px; color: var(--gray); margin: 0; }

/* ---------- Манифест ---------- */

.manifesto {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 150px 0;
  text-align: center;
}
.manifesto-text {
  font-size: clamp(30px, 4.6vw, 58px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}
.manifesto-hand {
  font-family: var(--font-hand);
  font-weight: 600;
  color: var(--blue);
  font-size: 1.18em;
  letter-spacing: 0;
}

/* ---------- Процесс ---------- */

.process-line { margin: 8px 0 34px; }
.process-line svg { width: 100%; height: 60px; display: block; overflow: visible; }
.process-path {
  stroke-dasharray: 1160;
  stroke-dashoffset: 1160;
}
.process-line.in-view .process-path {
  animation: path-draw 1.6s ease-out forwards;
}
@keyframes path-draw { to { stroke-dashoffset: 0; } }

.steps { list-style: none; margin: 0; padding: 0; }
.step-num {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.step h3 { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.step p { font-size: 14.5px; color: var(--gray); margin: 0; }

/* ---------- Кейсы ---------- */

.case { display: flex; flex-direction: column; }
.case-industry {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 600;
  margin-bottom: 18px;
}
.case h3 { font-size: 20px; margin-bottom: 16px; }
.case p { font-size: 14.5px; line-height: 1.6; margin: 0 0 12px; }
.case-task span, .case-done span { color: var(--body); font-weight: 700; }
.case-result {
  border-left: 2px solid var(--blue);
  padding-left: 16px;
  color: var(--body) !important;
  font-weight: 600;
  margin-top: 6px !important;
}
.case-stack {
  margin-top: auto;
  padding-top: 18px;
  font-size: 12.5px;
  color: #6a6f78;
}

/* ---------- Почему с нами ---------- */

.why-grid { gap: 40px 56px; }
.why h3 { font-size: 21px; font-weight: 700; margin: 0 0 10px; }
.why h3::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 5px;
  background: var(--blue);
  border-radius: 3px;
  transform: skewX(-16deg) translateY(-4px);
  margin-right: 14px;
}
.why p { font-size: 15.5px; color: var(--gray); margin: 0; max-width: 460px; }

/* ---------- Команда ---------- */

.team-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 72px;
  align-items: center;
}
.ceo {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 22px 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 440px;
}
.ceo-x { flex: none; width: 40px; height: 40px; }
.ceo-name { font-weight: 700; font-size: 16px; }
.ceo-role { font-size: 13.5px; color: var(--gray); margin-top: 2px; }

.team-mark {
  margin: 0;
  min-height: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
}
.team-x {
  width: 62%;
  max-width: 220px;
  transform: rotate(-6deg);
}

/* ---------- Финальный CTA и контакты ---------- */

.final { padding-bottom: 120px; }
.final-head { text-align: center; margin-bottom: 88px; }
.final-title {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.final-sub {
  font-size: clamp(19px, 2.4vw, 26px);
  font-weight: 600;
  color: var(--body);
  margin: 0 0 18px;
}
.final-hand {
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--gray);
  margin: 0;
  transform: rotate(-2deg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 72px;
  align-items: start;
}
.contact-link {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}
.contact-link:hover { color: var(--blue-hover); }
.contact-note { font-size: 14.5px; color: var(--gray); max-width: 320px; margin-top: 26px; }

.contact-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px;
}
.form-row { margin-bottom: 22px; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 8px;
}
.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--graphite);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 15px;
  padding: 13px 16px;
  transition: border-color 0.15s ease;
  resize: vertical;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--blue);
}
.form-row input.invalid,
.form-row textarea.invalid { border-color: #d24a43; }

.form-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}
.form-status {
  min-height: 1.4em;
  margin: 16px 0 0;
  font-size: 14.5px;
  color: var(--gray);
}
.form-status.ok { color: #6fcf8e; }
.form-status.error { color: #d24a43; }

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

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  padding-top: 64px;
  padding-bottom: 72px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-tagline { font-size: 15px; color: var(--gray); margin: 18px 0 0; max-width: 360px; }
.footer-meta { text-align: right; font-size: 13px; color: var(--gray); line-height: 1.9; }

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

/* скрываем только при включённом JS — иначе контент виден сразу */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .xdraw-line { transform: translate(-50%, -50%) rotate(48deg) scaleX(1); animation: none; }
  .xdraw-brush { clip-path: none; animation: none; }
  .brush-underline::after,
  .in-view .brush-underline::after,
  .hero .brush-underline::after { clip-path: none; animation: none; }
  .process-path { stroke-dashoffset: 0; animation: none !important; }
}

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--5 { grid-template-columns: repeat(3, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { justify-self: start; }
  .xdraw { width: min(260px, 60vw); }
  .team-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .note--inline { display: none; }
  .process-line { display: none; }
}

@media (max-width: 720px) {
  .container { padding-left: 22px; padding-right: 22px; }
  .section { padding: 72px 0; }
  .hero { padding: 64px 0 80px; }
  .grid { gap: 18px; }
  .grid--2, .grid--3, .grid--4, .grid--5 { grid-template-columns: 1fr; }
  .why-grid { gap: 32px; }
  .manifesto { padding: 100px 0; }
  .final-head { margin-bottom: 60px; }
  .contact-form { padding: 28px 22px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--graphite);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
    padding: 10px 22px 18px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
  .header-inner .btn--primary { display: none; }
  .nav-toggle { display: flex; }
}
