:root {
  --dark-bg: #121212;
  --dark-surface: #1a1a1c;
  --paper-white: #f1f1f3;
  --paper-tint: #e3e3e6;
  --text-light: #ffffff;
  --text-dark: #111113;
  --muted: #8a8a8e;
  --muted-dark: #5a5a5e;
  --line-dark: rgba(255, 255, 255, 0.08);
  --line-light: rgba(18, 18, 22, 0.08);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--dark-bg);
  color: var(--text-light);
}

body {
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

.mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.muted {
  color: var(--muted);
}

/* Фоновая архитектурная сетка */
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-line {
  border-left: 1px solid rgba(138, 138, 142, 0.1);
  height: 100%;
}

.grid-line:last-child {
  border-right: 1px solid rgba(138, 138, 142, 0.1);
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* Секции */
.section-dark {
  background-color: var(--dark-bg);
  color: var(--text-light);
  position: relative;
}

.section-light {
  background-color: var(--paper-white);
  color: var(--text-dark);
  position: relative;
}

.section-label {
  color: var(--muted);
  margin-bottom: 32px;
}

/* Перекрестия + */
.crosshair {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}

.crosshair.tl { top: -7px; left: -5px; }
.crosshair.tr { top: -7px; right: -5px; }
.crosshair.bl { bottom: -7px; left: -5px; }
.crosshair.br { bottom: -7px; right: -5px; }

/* Кнопки с угловыми скобками */
.bracket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  background-color: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  background-image:
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor),
    linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size:
    8px 1px, 1px 8px,
    8px 1px, 1px 8px,
    8px 1px, 1px 8px,
    8px 1px, 1px 8px;
  background-position:
    top left, top left,
    top right, top right,
    bottom left, bottom left,
    bottom right, bottom right;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.bracket-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.section-light .bracket-btn:hover {
  background-color: rgba(17, 17, 19, 0.06);
}

.bracket-btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 0.7rem;
}

.bracket-btn--ghost {
  color: var(--muted);
}

.bracket-btn--ghost:hover {
  color: var(--text-light);
}

.text-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

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

/* Шапка */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(18, 18, 18, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-dark);
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  color: var(--text-light);
  text-decoration: none;
}

.logo-dot {
  color: var(--muted);
}

.header-tagline {
  color: var(--muted);
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--line-dark);
  cursor: pointer;
  padding: 0 8px;
}

.burger-btn span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--text-light);
  transition: transform 0.25s var(--ease);
}

.burger-btn.is-open span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.burger-btn.is-open span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* Мобильное меню */
.mobile-menu {
  position: fixed;
  inset: 0;
  top: 65px;
  background: var(--dark-bg);
  z-index: 45;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.mobile-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mobile-link {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 1px solid var(--line-dark);
  padding-bottom: 16px;
}

.mobile-menu-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--muted);
}

/* 1. HERO */
.hero {
  padding: 136px 0 64px;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 48px;
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 5.25rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 1120px;
  margin-bottom: 64px;
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: end;
}

.hero-lead p {
  font-size: 1.125rem;
  color: #d0d0d4;
  max-width: 540px;
  margin-bottom: 28px;
  font-weight: 300;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.telemetry-card {
  position: relative;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-dark);
  padding-bottom: 8px;
}

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

.scroll-indicator {
  margin-top: 56px;
  color: var(--muted);
  text-align: right;
}

/* 2. ABOUT & STATS */
.about {
  padding: 112px 0;
}

.manifesto {
  font-size: clamp(1.5rem, 3.2vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 400;
  max-width: 980px;
  margin-bottom: 72px;
  color: var(--text-dark);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line-light);
  border-left: 1px solid var(--line-light);
}

.stat-box {
  position: relative;
  padding: 36px 28px;
  border-right: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
  background: var(--paper-white);
}

.stat-num {
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 16px;
}

.stat-desc {
  color: var(--muted-dark);
}

/* 3. SERVICES */
.services {
  padding: 112px 0;
  border-top: 1px solid var(--line-dark);
}

.services-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}

.services-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.services-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-dark);
}

.service-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-dark);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.service-item:hover,
.service-item.active {
  color: var(--text-light);
  background-color: rgba(255, 255, 255, 0.03);
}

.service-item.active .service-num {
  color: var(--text-light);
}

.service-detail-panel {
  position: relative;
  border: 1px solid var(--line-dark);
  background: var(--dark-surface);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.service-detail-tag {
  color: var(--muted);
}

.service-detail-title {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.service-detail-desc {
  color: #c8c8cc;
  font-weight: 300;
  line-height: 1.6;
}

.service-detail-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line-dark);
  padding-top: 20px;
}

/* 4. CASES (Светлая секция) */
.cases {
  padding: 112px 0;
  border-top: 1px solid var(--line-light);
}

.cases-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 56px;
}

.cases-title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 720px;
}

.cases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.case-card {
  position: relative;
  border: 1px solid var(--line-light);
  background: var(--paper-tint);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease);
}

.case-card:hover {
  transform: translateY(-2px);
  background: #dcdce0;
}

.case-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-dark);
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 12px;
}

.case-card h3 {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.case-card p {
  font-size: 0.95rem;
  color: #2c2c30;
  font-weight: 300;
  line-height: 1.6;
}

.case-metrics {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dark);
}

/* 5. PROCESS / SECURITY */
.process {
  padding: 112px 0;
  border-top: 1px solid var(--line-dark);
  overflow: hidden;
}

#constellationCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.45;
}

.process-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 780px;
  margin-bottom: 56px;
}

.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.process-step {
  border: 1px solid var(--line-dark);
  background: rgba(18, 18, 18, 0.78);
  padding: 28px;
}

.step-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-dark);
}

.process-step h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.process-step p {
  color: #b8b8be;
  font-size: 0.95rem;
  font-weight: 300;
}

/* 5. CREDENTIALS */
.credentials {
  padding: 112px 0;
}

.credentials-title {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 48px;
}

.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.cert-card {
  position: relative;
  border: 1px solid var(--line-light);
  background: var(--paper-tint);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cert-card--dark {
  background: var(--dark-bg);
  color: var(--text-light);
  border-color: var(--dark-bg);
}

.cert-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.cert-card h3 {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.cert-card p {
  font-size: 0.95rem;
  opacity: 0.85;
  font-weight: 300;
}

.cert-id {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(138, 138, 142, 0.25);
  color: var(--muted);
  word-break: break-all;
}

/* 6. FOOTER */
.site-footer {
  padding: 112px 0 48px;
  border-top: 1px solid var(--line-dark);
  overflow: hidden;
}

#footer3dCanvas {
  position: absolute;
  top: 0;
  right: -5%;
  width: 560px;
  height: 560px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
}

.cta-block {
  padding-bottom: 80px;
  border-bottom: 1px solid var(--line-dark);
  margin-bottom: 56px;
}

.cta-title {
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 820px;
  margin-bottom: 20px;
}

.cta-sub {
  color: #b8b8be;
  max-width: 520px;
  margin-bottom: 32px;
  font-weight: 300;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  margin-bottom: 6px;
}

.footer-col a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.footer-col a:hover {
  color: var(--muted);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line-dark);
  padding-top: 24px;
}

.reveal-word {
  color: rgba(17, 17, 19, 0.22);
  transition: color 0.35s var(--ease);
}

.reveal-word.is-active {
  color: var(--text-dark);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* Desktop Breakpoints */
@media (min-width: 768px) {
  .header-tagline {
    display: block;
  }

  .hero-bottom {
    grid-template-columns: 1.3fr 0.7fr;
  }

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

  .services-layout {
    grid-template-columns: 1fr 1.15fr;
    gap: 48px;
  }

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

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

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

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .process-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
