/* ==========================================================================
   itpetrov.ru — landing
   ========================================================================== */

:root {
  --bg: #08090b;
  --bg-soft: #0d0f12;
  --surface: #101318;
  --surface-2: #151920;
  --text: #f3f4f6;
  --text-soft: #d6dae1;
  --muted: #9aa1ac;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #ff7a2f;
  --accent-soft: rgba(255, 122, 47, 0.12);
  --accent-line: rgba(255, 122, 47, 0.38);
  --ink: #170c05;

  --wrap: 1120px;
  --pad: clamp(20px, 5vw, 40px);
  --radius: 18px;

  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SFMono-Regular", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 700px at 100% 105%, rgba(84, 118, 200, 0.06), transparent 62%),
    radial-gradient(700px 500px at -5% 60%, rgba(255, 122, 47, 0.05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("noise.png");
  background-size: 64px 64px;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  top: -320px;
  left: 50%;
  z-index: -2;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 122, 47, 0.16), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}

p { margin: 0; }

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

img, svg { display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--pad) * 2);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible { transform: translateY(0); }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(8, 9, 11, 0.78);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 6px 22px rgba(255, 122, 47, 0.28);
}

.brand-dot { color: var(--muted); }
.brand:hover .brand-dot { color: var(--accent); }

.nav {
  display: flex;
  gap: 26px;
  font-size: 0.93rem;
  color: var(--muted);
}

.nav a {
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav a:hover,
.nav a.is-active { color: var(--text); }
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s ease,
              border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 10px 30px -10px rgba(255, 122, 47, 0.55);
}

.btn-primary:hover {
  background: #ff8b49;
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px rgba(255, 122, 47, 0.7);
}

.btn-primary:active { transform: translateY(0); }

.btn-quiet {
  border-color: var(--line-strong);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.02);
}

.btn-quiet:hover {
  border-color: var(--accent-line);
  color: var(--text);
  transform: translateY(-2px);
}

.btn-ghost { color: var(--text-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--text); }

.btn-sm { padding: 10px 15px; border-radius: 10px; font-size: 0.9rem; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { padding: 17px 28px; font-size: 1.02rem; }

.header-cta .icon { transition: transform 0.25s var(--ease); }
.header-cta:hover .icon { transform: rotate(-8deg) scale(1.06); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(56px, 11vh, 116px) 0 clamp(56px, 9vw, 104px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(22px, 3vw, 30px);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 122, 47, 0.55);
  animation: pulse 2.6s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 47, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(255, 122, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 47, 0); }
}

.hero h1 {
  font-size: clamp(2.35rem, 6.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero h1 .line { display: block; }

.mark {
  color: var(--accent);
  white-space: nowrap;
}

.lead {
  max-width: 60ch;
  margin-top: clamp(20px, 3vw, 30px);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.7;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 3.6vw, 38px);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 40px);
  margin-top: clamp(44px, 7vw, 76px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--line);
}

.facts li {
  display: grid;
  gap: 7px;
  align-content: start;
}

.fact-key {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.fact-val {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: clamp(60px, 9vw, 110px) 0; }
.section + .section { padding-top: 0; }

section[id] { scroll-margin-top: 92px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: clamp(32px, 5vw, 52px);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker span { color: var(--accent); }

.section-head h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.7rem);
  letter-spacing: -0.04em;
}

.section-note {
  max-width: 44ch;
  padding-bottom: 4px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.after-note {
  margin-top: 22px;
  font-size: 0.95rem;
  color: var(--muted);
}

.after-note a {
  color: var(--text);
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.after-note a:hover { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------------------
   Service cards
   -------------------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 45%),
    var(--bg-soft);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s ease,
              background 0.3s ease, box-shadow 0.3s ease;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card-icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #6e7681;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color 0.3s ease, stroke 0.3s ease, transform 0.3s var(--ease);
}

.card:hover .card-icon {
  stroke: var(--accent);
  transform: translateY(-2px);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 122, 47, 0.32);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.9);
}

.card:hover::before { opacity: 1; }

.card-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.card h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.42rem);
  letter-spacing: -0.025em;
}

.card p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 12px;
}

.tags li {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #b9c0ca;
  background: rgba(255, 255, 255, 0.02);
}

/* --------------------------------------------------------------------------
   Process
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.step {
  position: relative;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.step::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 34px;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}

.step:hover::after { width: 100%; }

.step-num {
  display: block;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.step h3 {
  margin-bottom: 9px;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.step p {
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Stack
   -------------------------------------------------------------------------- */

.stack { border-top: 1px solid var(--line); }

.stack-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.stack-label {
  padding-top: 5px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.chips li:hover {
  border-color: var(--accent-line);
  color: var(--text);
  background: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  position: relative;
  padding: clamp(30px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 122, 47, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--bg-soft);
  overflow: hidden;
}

.contact::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 122, 47, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.contact h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  letter-spacing: -0.045em;
}

.contact-lead {
  max-width: 54ch;
  margin-top: 20px;
  font-size: clamp(0.98rem, 1.2vw, 1.06rem);
  line-height: 1.7;
  color: var(--muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 3.4vw, 36px);
}

.contact-note {
  margin-top: 20px;
  font-size: 0.86rem;
  color: #8a919c;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 38px;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 32px;
}

.footer-links {
  display: flex;
  gap: 22px;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  padding: 11px 18px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: #16120f;
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Reveal animation
   -------------------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Error page
   -------------------------------------------------------------------------- */

.error-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  max-width: 640px;
  padding: clamp(40px, 10vh, 100px) var(--pad);
}

.error-main h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
}

.error-text {
  margin: 20px 0 30px;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .nav { display: none; }

  .facts {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .facts li {
    grid-template-columns: 150px 1fr;
    gap: 16px;
    align-items: baseline;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .section-note { max-width: 56ch; }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .hero h1 .line { display: inline; }

  .cards { grid-template-columns: 1fr; }

  .stack-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stack-label { padding-top: 0; }
}

@media (max-width: 560px) {
  .header-inner { min-height: 64px; }
  .header-cta span { display: none; }
  .header-cta { padding: 9px 11px; min-width: 44px; min-height: 44px; }

  .facts li {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .steps { grid-template-columns: 1fr; gap: 26px; }

  .actions .btn,
  .contact-actions .btn {
    flex: 1 1 100%;
  }

  .brand-text { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal { opacity: 1; transform: none; }
}
