/* Masterpoint — Enterprise Tech Minimalism */

:root {
  --primary: #0057FF;
  --primary-dark: #0037A6;
  --primary-mid: #2563EB;
  --primary-deep: #1E3A8A;

  --bg: #FFFFFF;
  --bg-alt: #F5F7FA;
  --footer-bg: #0F172A;

  --text: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-on-primary: #FFFFFF;
  --text-footer: #94A3B8;
  --text-footer-muted: #64748B;

  --border: #E5E7EB;
  --border-light: #F3F4F6;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 24px rgba(17, 24, 39, 0.06);
  --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.08);

  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 5.5rem;
  --space-3xl: 7rem;

  --header-h: 80px;
  --logo-size: 48px;
  --logo-text-size: 1.375rem;
  --logo-gap: 0.75rem;
  --container: min(1200px, calc(100% - 3rem));
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-font-smoothing: antialiased;
}

html.is-scroll-locked {
  overflow: hidden;
}

body.is-scroll-locked {
  overflow: hidden;
  touch-action: none;
  padding-right: var(--scrollbar-width, 0px);
}

body.is-scroll-locked .header {
  padding-right: var(--scrollbar-width, 0px);
}

body.is-scroll-locked .scroll-top {
  right: calc(max(1.25rem, env(safe-area-inset-right, 0px)) + var(--scrollbar-width, 0px));
}

body {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  max-width: 100%;
}

.mono {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.text-muted { color: var(--text-secondary); font-weight: 500; }

.container {
  width: var(--container);
  margin-inline: auto;
}

.section {
  padding-block: var(--space-3xl);
  position: relative;
}

.hero.section {
  padding-block: 0;
  padding-top: calc(var(--header-h) + var(--space-xl));
  padding-bottom: var(--space-2xl);
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border-light);
}

/* ---- Cards ---- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

@media (hover: hover) {
  .card:hover {
    border-color: #D1D5DB;
    box-shadow: var(--shadow-md);
  }
}

/* ---- Typography ---- */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-md);
}

.eyebrow__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 0.5rem;
  vertical-align: middle;
}

.eyebrow--light {
  color: rgba(255, 255, 255, 0.85);
}

.section-head {
  margin-bottom: var(--space-2xl);
  max-width: 560px;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), filter 0.2s;
}

.btn--sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn--lg { padding: 0.8125rem 1.5rem; }

.btn--primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  filter: brightness(1.05);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--white {
  color: var(--primary);
  background: #fff;
  border-color: #fff;
}

.btn--white:hover {
  filter: brightness(0.97);
  background: #f8fafc;
}

.btn--ghost {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: #D1D5DB;
  background: var(--bg-alt);
}

.btn--outline-light {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn--glass {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn--glass:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
}

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.header--transparent {
  background: transparent;
}

.header--on-hero .logo,
.header--on-hero .nav__link {
  color: #fff;
}

.header--on-hero .logo__mark { color: #fff; }

.header--on-hero .burger span { background: #fff; }

.header--scrolled {
  background: var(--bg);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header--scrolled .logo,
.header--scrolled .nav__link {
  color: var(--text);
}

.header--scrolled .logo__mark { color: var(--primary); }

.header--scrolled .burger span { background: var(--text); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--logo-gap);
  text-decoration: none;
  color: var(--text);
}

.logo__mark {
  position: relative;
  display: flex;
  width: var(--logo-size);
  height: var(--logo-size);
  flex-shrink: 0;
}

.logo__img {
  width: var(--logo-size);
  height: var(--logo-size);
  display: block;
  position: absolute;
  inset: 0;
  transition: opacity 0.25s var(--ease);
}

.logo__img--light {
  opacity: 0;
}

.header--scrolled .logo__img--hero {
  opacity: 0;
}

.header--scrolled .logo__img--light {
  opacity: 1;
}

.header--on-hero .logo__img--hero {
  opacity: 1;
}

.header--on-hero .logo__img--light {
  opacity: 0;
}

.logo__text {
  font-weight: 700;
  font-size: var(--logo-text-size);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}

.nav__link:hover { color: var(--text); }

.header:not(.header--on-hero) .nav__link:hover {
  color: var(--primary);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.mobile-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--bg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  box-shadow: var(--shadow-md);
}

.mobile-nav[hidden] { display: none; }
.mobile-nav:not([hidden]) { display: flex; }

.mobile-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}

.mobile-nav a:hover { color: var(--text); }

/* ---- Hero ---- */
.hero {
  --hero-min-h: 85vh;
  position: relative;
  min-height: var(--hero-min-h);
  background: linear-gradient(165deg, #0a2d6e 0%, var(--primary-deep) 45%, #0f3278 100%);
  color: var(--text-on-primary);
  overflow: hidden;
}

/* Размытый движущийся градиент */
.hero::before {
  content: '';
  position: absolute;
  inset: -30%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    150deg,
    rgba(60, 140, 255, 0.7) 0%,
    rgba(8, 32, 85, 0.55) 18%,
    rgba(0, 87, 255, 0.75) 38%,
    rgba(12, 38, 95, 0.5) 55%,
    rgba(91, 158, 255, 0.65) 72%,
    rgba(0, 55, 166, 0.6) 88%,
    rgba(40, 120, 255, 0.7) 100%
  );
  background-size: 260% 260%;
  background-position: 30% 45%;
  filter: blur(42px);
  opacity: 0.92;
  animation: hero-gradient-flow 22s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 48% at 20% 28%, rgba(255, 255, 255, 0.14) 0%, transparent 58%),
    radial-gradient(ellipse 50% 42% at 80% 72%, rgba(100, 160, 255, 0.22) 0%, transparent 55%);
  filter: blur(36px);
  animation: hero-glow-drift 26s ease-in-out infinite alternate;
}

@keyframes hero-gradient-flow {
  0%, 100% { background-position: 22% 38%; }
  50% { background-position: 78% 62%; }
}

@keyframes hero-glow-drift {
  from {
    transform: translate(-2%, 1%) scale(1);
    opacity: 0.65;
  }
  to {
    transform: translate(3%, -2.5%) scale(1.06);
    opacity: 1;
  }
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .hero::before,
  .hero::after {
    animation: none;
  }

  .hero::before {
    filter: blur(28px);
    background-size: 200% 200%;
  }

  .hero::after {
    filter: blur(22px);
    transform: none;
    opacity: 0.85;
  }

  .hero-glass__link--flow,
  .hero-node--accent {
    animation: none;
  }
}

.hero__waves {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero__wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
}

.hero__wave--2 { opacity: 0.7; bottom: -5%; }

.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "content visual";
  gap: var(--space-2xl);
  align-items: center;
  min-height: calc(var(--hero-min-h) - var(--header-h) - var(--space-xl) - var(--space-2xl));
  padding-block: var(--space-lg);
}

.hero__content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.hero__visual {
  grid-area: visual;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__copy.section-head {
  margin-bottom: 0;
}

.hero__title.section-title {
  color: #fff;
}

.hero__subtitle {
  margin-top: var(--space-md);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
  max-width: 520px;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

.hero__directions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
}

.hero__directions li {
  position: relative;
  padding-left: 1.125rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.88);
}

.hero__directions li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

/* Hero visual */
.hero-viz {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 0.88;
  margin-inline: auto;
  flex-shrink: 0;
}

/* Glass panels */
.hero-glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 4px 24px rgba(0, 20, 60, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-glass--main {
  position: absolute;
  inset: 8% 4% 12% 8%;
  overflow: hidden;
}

.hero-glass__mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, black 15%, transparent 72%);
}

.hero-glass__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-glass__link--flow {
  stroke-dasharray: 5 4;
  animation: heroLinkFlow 2.4s linear infinite;
}

@keyframes heroLinkFlow {
  to { stroke-dashoffset: -18; }
}

.hero-glass__nodes {
  position: absolute;
  inset: 0;
}

.hero-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.hero-node--lg {
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.45);
}

.hero-node--accent {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
  animation: heroNodePulse 2.8s ease-in-out infinite;
}

@keyframes heroNodePulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.65; transform: translate(-50%, -50%) scale(0.92); }
}

.hero-glass--float {
  position: absolute;
  z-index: 2;
}

.hero-glass--code {
  top: 0;
  right: 0;
  width: 42%;
  padding: 14px 16px;
}

.hero-code {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hero-code__line {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
}

.hero-code__line--w40 { width: 40%; }
.hero-code__line--w55 { width: 55%; }
.hero-code__line--w70 { width: 70%; }
.hero-code__line--w80 { width: 80%; }
.hero-code__line--w90 { width: 90%; }
.hero-code__line--w100 { width: 100%; }

.hero-code__line:nth-child(2) { opacity: 0.7; }
.hero-code__line:nth-child(4) { opacity: 0.55; }
.hero-code__line:nth-child(6) { opacity: 0.45; }

.hero-glass--chart {
  bottom: 4%;
  right: 6%;
  width: 38%;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-glass--chart svg {
  width: 100%;
  height: 40px;
}

.hero-chart__line {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: heroChartDraw 3s ease-out forwards;
}

@keyframes heroChartDraw {
  to { stroke-dashoffset: 0; }
}

.hero-chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 28px;
}

.hero-chart__bars span {
  flex: 1;
  height: var(--h);
  border-radius: 2px 2px 0 0;
  background: rgba(255, 255, 255, 0.35);
}

/* ---- About ---- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.about__desc {
  margin-top: var(--space-md);
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
}

.about__metrics {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.about-metric.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  text-align: center;
  min-height: 6.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.about-metric__value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
  transition: color 0.2s var(--ease);
}

.about-metric__label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ---- Services ---- */
.services.section {
  padding-block: calc(var(--space-3xl) + var(--space-lg));
}

.services__note-wrap {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.services__note {
  margin: 0;
  text-align: center;
  max-width: 42rem;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  min-width: 0;
}

.services__grid > * {
  min-width: 0;
}

.service-card.card {
  padding: var(--space-lg);
  position: relative;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.service-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.625rem;
  color: var(--text);
  transition: color 0.2s var(--ease);
}

.service-card__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 400px;
  overflow-wrap: anywhere;
}

.services__note.service-card__desc {
  max-width: 42rem;
}

/* ---- Tech ---- */
.tech__intro {
  margin-bottom: var(--space-xl);
}

.tech__desc {
  margin-top: var(--space-md);
  max-width: 36rem;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.tech-stack__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
}

.tech-stack__tab {
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.5625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tech-stack__tab:hover {
  color: var(--primary);
}

.tech-stack__tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tech-stack__tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.tech-stack__panel {
  animation: tech-panel-in 0.35s var(--ease);
}

.tech-stack__panel[hidden] {
  display: none;
}

@keyframes tech-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tech-stack__grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: var(--space-sm);
  min-width: 0;
}

.tech-stack__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 8.5rem;
  padding: var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.tech-stack__logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.tech-stack__name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.2s var(--ease);
}

/* ---- Principles ---- */
.principles__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.principle-card.card {
  padding: var(--space-lg);
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.principle-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
  transition: color 0.2s var(--ease);
}

.principle-card__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (hover: hover) {
  .about-metric.card:hover,
  .service-card.card:hover,
  .principle-card.card:hover,
  .tech-stack__item:hover {
    border-color: rgba(0, 87, 255, 0.35);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }

  .about-metric.card:hover .about-metric__value,
  .service-card.card:hover .service-card__title,
  .principle-card.card:hover .principle-card__title,
  .tech-stack__item:hover .tech-stack__name {
    color: var(--primary);
  }
}

.about-metric.card:active,
.about-metric.card.is-pressed,
.service-card.card:active,
.service-card.card.is-pressed,
.principle-card.card:active,
.principle-card.card.is-pressed,
.tech-stack__item:active,
.tech-stack__item.is-pressed {
  border-color: rgba(0, 87, 255, 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.about-metric.card:active .about-metric__value,
.about-metric.card.is-pressed .about-metric__value,
.service-card.card:active .service-card__title,
.service-card.card.is-pressed .service-card__title,
.principle-card.card:active .principle-card__title,
.principle-card.card.is-pressed .principle-card__title,
.tech-stack__item:active .tech-stack__name,
.tech-stack__item.is-pressed .tech-stack__name {
  color: var(--primary);
}

/* ---- Career ---- */
.career__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.career__desc {
  margin: var(--space-md) 0 var(--space-lg);
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
}

.career__advantages {
  list-style: none;
  margin-bottom: var(--space-lg);
}

.career__advantages li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.career__advantages li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--primary);
}

.career-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%),
    url("https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800&q=80&auto=format&fit=crop") center / cover no-repeat;
}

.career-photo__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.5) 100%);
}

/* ---- Contacts ---- */
.contacts__head {
  margin-bottom: var(--space-xl);
}

.contacts__desc {
  margin-top: var(--space-sm);
  font-size: 1.0625rem;
  color: var(--text-secondary);
}

.contacts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.contact-card {
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.contact-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.contact-card__type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.contact-card__value {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

/* ---- Footer ---- */
.footer {
  background: var(--footer-bg);
  color: var(--text-footer);
  padding: var(--space-2xl) 0 var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr) minmax(0, 1.25fr);
  grid-template-rows: auto auto;
  gap: var(--space-xl);
}

.footer .logo { color: #fff; }

.footer__tagline {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-footer-muted);
  max-width: 240px;
}

.footer__nav,
.footer__contacts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__nav a,
.footer__contacts a {
  font-size: 0.875rem;
  color: var(--text-footer);
  text-decoration: none;
  transition: color 0.2s;
}

.footer__nav a:hover,
.footer__contacts a:hover { color: #fff; }

.footer__company {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 28rem;
}

.footer__company p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-footer-muted);
}

.footer__company-name {
  color: var(--text-footer);
}

.footer__legal {
  grid-column: 1 / -1;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.footer__legal p {
  font-size: 0.75rem;
  color: var(--text-footer-muted);
}

.footer__legal-links {
  display: flex;
  gap: var(--space-md);
}

.footer__legal-links a {
  font-size: 0.75rem;
  color: var(--text-footer-muted);
  text-decoration: none;
}

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

.footer__copy { width: 100%; }

.logo--footer .logo__text {
  color: #fff;
}

/* ---- Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.reveal--delay { transition-delay: 0.06s; }

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Отложенный рендер секций ниже первого экрана */
.about,
.services,
.tech,
.principles {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .hero__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "visual"
      "content";
    align-items: stretch;
    align-content: start;
    min-height: auto;
    gap: var(--space-lg);
  }

  .hero-viz {
    max-width: 360px;
  }

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

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

  .services__grid,
  .principles__grid { grid-template-columns: repeat(2, 1fr); }

  .tech-stack__grid {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__contacts { grid-column: 1 / -1; }
  .footer__company { max-width: none; }
}

@media (max-width: 768px) {
  :root {
    --header-h: 72px;
    --container: calc(100% - 2rem);
    --space-3xl: 4.5rem;
  }

  .section {
    padding-block: var(--space-2xl);
  }

  .services__grid,
  .principles__grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    padding: var(--space-md);
  }

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

  .tech-stack__item {
    min-height: 7.25rem;
    gap: 0.625rem;
  }

  .tech-stack__logo {
    width: 40px;
    height: 40px;
  }

  .tech-stack__name {
    font-size: 0.875rem;
  }

  .service-card__desc {
    max-width: none;
  }

  .hero.section {
    --hero-min-h: auto;
    min-height: auto;
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + var(--space-md));
    padding-bottom: var(--space-lg);
  }

  .hero__grid {
    padding-block: 0;
    gap: var(--space-md);
  }

  .hero__visual {
    margin: 0;
  }

  .hero-viz {
    width: min(100%, 320px);
    max-width: 320px;
    height: clamp(168px, 34svh, 240px);
    aspect-ratio: unset;
  }

  .hero-viz::before {
    display: none;
  }

  .hero-glass--float {
    display: block;
  }

  .hero-glass--main {
    inset: 8% 4% 12% 8%;
    border-radius: 12px;
  }

  .hero-glass--code {
    top: 0;
    right: 0;
    width: 40%;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .hero-code {
    gap: 4px;
  }

  .hero-code__line {
    height: 3px;
  }

  .hero-glass--chart {
    bottom: 4%;
    right: 6%;
    width: 38%;
    padding: 8px 10px 6px;
    gap: 6px;
    border-radius: 10px;
  }

  .hero-glass--chart svg {
    height: 28px;
  }

  .hero-chart__bars {
    height: 20px;
    gap: 4px;
  }

  .hero-glass__mesh {
    background-size: 22px 22px;
  }

  .hero-node {
    width: 8px;
    height: 8px;
  }

  .hero-node--lg {
    width: 11px;
    height: 11px;
  }

  .hero__content {
    gap: var(--space-md);
  }

  .hero__copy.section-head {
    margin-bottom: 0;
  }

  .hero__title.section-title {
    font-size: clamp(1.625rem, 7vw, 2rem);
    line-height: 1.2;
  }

  .hero__subtitle {
    margin-top: var(--space-sm);
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .hero__directions {
    gap: 0.375rem;
    padding-top: var(--space-sm);
    font-size: 0.9375rem;
  }
}

@media (max-width: 600px) {
  .about__metrics { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__legal { flex-direction: column; align-items: flex-start; }
}

/* ---- Legal page ---- */
.page-legal {
  background: var(--bg-alt);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-legal .header {
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.page-legal .legal {
  flex: 1 0 auto;
}

.page-legal .footer {
  flex-shrink: 0;
  margin-top: auto;
}

.legal {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.legal__container {
  max-width: 48rem;
}

.legal__content {
  padding: var(--space-2xl) var(--space-xl);
}

.legal__title {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: var(--space-xl);
}

.legal__content h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin: var(--space-xl) 0 var(--space-md);
}

.legal__content h2:first-of-type {
  margin-top: 0;
}

.legal__content p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.legal__content ul {
  margin: 0 0 var(--space-md);
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.legal__content li {
  margin-bottom: var(--space-sm);
}

.legal__content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal__content a:hover {
  color: var(--primary-dark);
}

.legal__lead {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin: calc(-1 * var(--space-sm)) 0 var(--space-xl);
}

.legal__details {
  margin: 0;
  padding: 0;
}

.legal__details-row {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: var(--space-sm) var(--space-lg);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}

.legal__details-row:first-child {
  padding-top: 0;
}

.legal__details-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.legal__details dt {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.legal__details dd {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
}

@media (max-width: 600px) {
  .legal__details-row {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }
}

.legal__footer-note {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.legal__back {
  flex-shrink: 0;
}

.footer--compact {
  padding: var(--space-lg) 0;
}

.footer__legal--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  border-top: none;
  padding-top: 0;
}

.legal__back-link {
  font-size: 0.875rem;
  color: var(--text-footer-muted);
  text-decoration: none;
}

.legal__back-link:hover {
  color: var(--text-footer);
}

/* ---- Modal & form ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  width: min(100%, 28rem);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: var(--space-md);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 769px) {
  .modal__dialog {
    max-height: none;
    overflow: visible;
  }
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.modal__close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.modal__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
  padding-right: 2rem;
}

.request-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-required {
  color: var(--primary);
}

.form-input {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
}

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

.form-consent__box {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.form-consent__input:checked + .form-consent__box {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6l2.5 2.5 4.5-5' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.75rem;
}

.form-consent__input:focus-visible + .form-consent__box {
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}

.form-consent__text {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.form-consent__text a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-consent__text a:hover {
  color: var(--primary-dark);
}

.request-form__submit {
  width: 100%;
  margin-top: 0.125rem;
}

.modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-sm);
  min-height: 14rem;
}

.modal__success[hidden] {
  display: none;
}

.modal__success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 87, 255, 0.28);
  animation: modal-success-pop 0.45s var(--ease);
}

.modal__success-text {
  margin: 0;
  max-width: 20rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

@keyframes modal-success-pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- Scroll to top ---- */
.scroll-top {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 87, 255, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.25s var(--ease),
    visibility 0.25s var(--ease),
    transform 0.25s var(--ease),
    background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.scroll-top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 24px rgba(0, 87, 255, 0.45);
}

.scroll-top:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.scroll-top__icon {
  display: block;
}

@media (max-width: 768px) {
  .scroll-top {
    width: 44px;
    height: 44px;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  body.is-scroll-locked .scroll-top {
    right: calc(max(1rem, env(safe-area-inset-right, 0px)) + var(--scrollbar-width, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
