/* ==========================================================================
   Qaznex — site stylesheet
   All presentation lives here; the HTML carries no inline styles, so pages
   stay small, cacheable and crawlable.
   ========================================================================== */

/* ── Fonts ────────────────────────────────────────────────────────────────
   Subset to Latin + Cyrillic + Kazakh-specific glyphs (ә ғ қ ң ө ұ ү һ і),
   woff2, ~25 KB per weight. font-display:swap so text paints immediately. */
@font-face {
  font-family: 'SF Pro Display';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/sf-pro-display-400.woff2') format('woff2');
}
@font-face {
  font-family: 'SF Pro Display';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/sf-pro-display-500.woff2') format('woff2');
}
@font-face {
  font-family: 'SF Pro Display';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/sf-pro-display-600.woff2') format('woff2');
}
@font-face {
  font-family: 'SF Pro Display';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/sf-pro-display-700.woff2') format('woff2');
}
@font-face {
  font-family: 'SF Pro Display';
  font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/sf-pro-display-800.woff2') format('woff2');
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --qx-accent: #0BAEA7;
  --qx-a44: #0BAEA744;   /* pre-mixed alphas: no color-mix() support needed */
  --qx-a1f: #0BAEA71F;
  --qx-a12: #0BAEA712;
  --qx-ink: #111111;
  --qx-muted: #4b5563;
  --qx-dim: #6b7280;
  --qx-line: #E4E7E7;
  --qx-surface: #F4F6F6;
  --qx-font: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: #ffffff;
  color: var(--qx-ink);
  font-family: var(--qx-font);
  overflow-x: clip;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }
:focus-visible { outline: 2px solid var(--qx-accent); outline-offset: 2px; border-radius: 4px; }

/* Skip link — visible only when focused */
.qx-skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 12px 20px; background: var(--qx-ink); color: #fff;
  font-weight: 700; font-size: 14px; border-radius: 0 0 8px 0;
}
.qx-skip:focus { left: 0; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.qx-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--qx-line);
  flex-wrap: wrap;
}
.qx-logo { display: flex; align-items: center; }
.qx-logo img { height: 28px; width: auto; display: block; }
.qx-nav { display: flex; align-items: center; gap: 28px; flex-wrap: nowrap; white-space: nowrap; }
.qx-nav a { font-weight: 600; font-size: 15px; color: var(--qx-ink); }
.qx-header-actions { display: flex; align-items: center; gap: 16px; }
.qx-lang {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid var(--qx-line); border-radius: 20px;
}
.qx-lang a {
  padding: 6px 12px; border-radius: 16px;
  font-size: 13px; font-weight: 700; color: var(--qx-dim);
}
.qx-lang a[aria-current="true"] { background: var(--qx-ink); color: #ffffff; }
.qx-cta {
  display: inline-flex; align-items: center;
  padding: 10px 22px; border-radius: 8px;
  font-weight: 700; font-size: 14px;
  background: var(--qx-accent); color: #ffffff; white-space: nowrap;
}

@media (max-width: 900px) {
  .qx-nav {
    order: 3; width: 100%; justify-content: center;
    flex-wrap: wrap; white-space: normal; gap: 12px 20px;
  }
  .qx-nav a { font-size: 14px; }
}
@media (max-width: 620px) {
  .qx-header { gap: 8px 10px; padding-top: 12px; padding-bottom: 12px; }
  .qx-logo img { height: 24px; }
  .qx-header-actions { gap: 8px; }
  .qx-lang a { padding: 4px 7px; font-size: 12px; }
  .qx-cta { padding: 8px 12px; font-size: 13px; }
  .qx-nav { gap: 10px 14px; }
  .qx-nav a { font-size: 13px; }
}

/* ── Section scaffolding ────────────────────────────────────────────────── */
.qx-section { padding: clamp(64px, 9vw, 120px) clamp(20px, 4vw, 48px); background: #ffffff; }
.qx-section--alt { background: var(--qx-surface); }
.qx-wrap { max-width: 1200px; margin: 0 auto; }
.qx-head { max-width: 640px; margin: 0 0 clamp(36px, 6vw, 64px); }
.qx-eyebrow {
  font-weight: 700; font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--qx-accent); margin: 0 0 14px;
}
.qx-h2 { font-weight: 800; font-size: clamp(26px, 4.4vw, 38px); color: var(--qx-ink); margin: 0; }
.qx-h2 + .qx-lead { margin-top: 18px; }
.qx-lead { font-size: 16px; line-height: 1.7; color: var(--qx-muted); margin: 0; }

.qx-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.qx-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 1000px) { .qx-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px)  { .qx-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 1080px) { .qx-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .qx-grid-4 { grid-template-columns: 1fr; } }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.qx-card { background: #ffffff; border-radius: 16px; padding: clamp(22px, 3vw, 32px); }
.qx-card--outline { background: transparent; border: 1px solid var(--qx-line); }
.qx-card--center { text-align: center; }
.qx-card-title { font-weight: 700; font-size: 19px; color: var(--qx-ink); margin: 0 0 10px; }
.qx-card--center .qx-card-title { font-size: 18px; }
.qx-card-text { font-size: 14px; line-height: 1.6; color: var(--qx-muted); margin: 0; }

.qx-icon-badge {
  width: 44px; height: 44px; border-radius: 12px; background: var(--qx-accent);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.qx-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}

/* ── Process steps ──────────────────────────────────────────────────────── */
.qx-step { border-top: 2px solid var(--qx-accent); padding-top: 24px; }
.qx-step-label {
  font-weight: 800; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--qx-accent); margin: 0 0 12px;
}

/* ── Contacts ───────────────────────────────────────────────────────────── */
.qx-contacts-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: clamp(32px, 5vw, 64px);
}
@media (max-width: 920px) { .qx-contacts-grid { grid-template-columns: 1fr; } }
.qx-h2--contacts { margin-top: 14px; margin-bottom: 18px; }
.qx-contact-list { display: flex; flex-direction: column; gap: 24px; margin-top: 40px; }
.qx-contact-label {
  font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--qx-dim); margin: 0 0 4px;
}
.qx-contact-value { font-size: 16px; font-weight: 600; color: var(--qx-ink); margin: 0; font-style: normal; }

/* ── Form ───────────────────────────────────────────────────────────────── */
.qx-form-card { background: #ffffff; border-radius: clamp(16px, 2.5vw, 24px); padding: clamp(24px, 4vw, 40px); }
.qx-form { display: flex; flex-direction: column; gap: 16px; }
.qx-label { display: block; font-weight: 600; font-size: 13px; color: var(--qx-ink); margin-bottom: 6px; }
.qx-input, .qx-textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--qx-line); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--qx-ink);
}
.qx-textarea { resize: vertical; }
.qx-input:focus, .qx-textarea:focus { border-color: var(--qx-accent); outline: none; box-shadow: 0 0 0 3px var(--qx-a1f); }
.qx-form-submit {
  margin-top: 8px; padding: 14px 28px; border: none; border-radius: 8px;
  font-family: inherit; font-weight: 700; font-size: 15px;
  background: var(--qx-accent); color: #ffffff; cursor: pointer;
}
.qx-form-submit[disabled] { opacity: 0.6; cursor: progress; }
.qx-form-status { margin: 0; font-size: 14px; line-height: 1.6; }
/* the form is a flex column with a gap, so an empty status line would still
   push the button down by one gap — collapse it until it has something to say */
.qx-form-status:empty { display: none; }
.qx-form-status--error { color: #b91c1c; }
.qx-form-done {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  height: 100%; justify-content: center;
}
.qx-form-tick {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--qx-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}
.qx-form-done-text { font-weight: 700; font-size: 18px; color: var(--qx-ink); }
[hidden] { display: none !important; }

@media (hover: none) { .qx-cta, .qx-form-submit { min-height: 44px; } }
@media (max-width: 768px) {
  .qx-input, .qx-textarea { font-size: 16px; } /* stops iOS Safari zooming on focus */
  .qx-form-submit { width: 100%; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.qx-footer { background: var(--qx-ink); padding: clamp(44px, 7vw, 64px) clamp(20px, 4vw, 48px) 32px; }
.qx-footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(32px, 5vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width: 900px) { .qx-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .qx-footer-grid { grid-template-columns: 1fr; } }
.qx-footer img { height: 28px; width: auto; display: block; }
.qx-footer-title { font-weight: 700; font-size: 13px; color: #ffffff; margin: 0 0 16px; }
/* the original's third column had an empty heading element: zero height, but
   its 16px bottom margin still applied */
.qx-footer-links--offset { margin-top: 16px; }
.qx-footer-links { display: flex; flex-direction: column; gap: 12px; }
.qx-footer-links a, .qx-footer-links span { font-size: 14px; color: #9CA3AF; }
.qx-copyright { display: flex; justify-content: center; align-items: center; padding-top: 24px; }
.qx-copyright span { font-size: 13px; color: var(--qx-dim); }

/* ==========================================================================
   Hero — brand gradient, grid texture and the integration-hub visual
   ========================================================================== */
.qx-hero {
  position: relative;
  padding: clamp(88px, 12vw, 140px) clamp(20px, 4vw, 48px) clamp(72px, 10vw, 120px);
  overflow: hidden;
  background-color: #0B0F10;
  background-image:
    radial-gradient(1100px 640px at 84% -14%, var(--qx-a44) 0%, transparent 62%),
    radial-gradient(760px 470px at 2% 112%, var(--qx-a1f) 0%, transparent 60%),
    linear-gradient(165deg, #10191A 0%, #0B0F10 46%, #070E0D 100%);
}
/* technical grid, faded out so it never competes with the text */
.qx-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(78% 70% at 18% 22%, #000 0%, transparent 76%);
          mask-image: radial-gradient(78% 70% at 18% 22%, #000 0%, transparent 76%);
}
/* brand hairline closing the section */
.qx-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: 3;
  background: linear-gradient(90deg, transparent, var(--qx-accent), transparent);
  opacity: 0.55;
}
.qx-hero-orb {
  position: absolute; top: -140px; right: -100px;
  width: clamp(300px, 58vw, 620px); height: clamp(300px, 58vw, 620px);
  border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle, var(--qx-a44) 0%, var(--qx-a12) 45%, transparent 70%);
  filter: blur(40px);
}
@media (max-width: 660px) {
  .qx-hero::before { background-size: 44px 44px; }
  .qx-hero-orb { top: -90px; right: -120px; filter: blur(30px); }
}

.qx-hero-grid {
  position: relative; z-index: 2;
  max-width: 1104px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 570px);
  gap: clamp(28px, 4vw, 52px);
  align-items: center;
}
.qx-hero-inner { max-width: 640px; }
/* The 20px top margin stands in for the original's empty eyebrow element,
   which contributed its margin-bottom above the headline. */
.qx-h1 {
  margin: 20px 0 24px; text-wrap: pretty;
  font-weight: 800; font-size: clamp(32px, 7vw, 56px); line-height: 1.08; color: #ffffff;
}
.qx-hero-sub { font-size: clamp(16px, 2.2vw, 19px); line-height: 1.6; color: #B7BBBA; max-width: 560px; margin: 0; }

.qx-hero-viz { width: 100%; max-width: 570px; margin-left: auto; }
.qx-hero-viz svg { display: block; width: 100%; height: auto; }
@media (max-width: 1000px) {
  .qx-hero-grid { grid-template-columns: 1fr; }
  .qx-hero-inner { max-width: 100%; }
  .qx-hero-viz { max-width: 500px; margin: 4px auto 0; }
}
@media (max-width: 620px) { .qx-hero-viz { max-width: 360px; } }

/* gradient stops (kept in CSS so they can read the brand variable) */
.qx-vs-glow0 { stop-color: var(--qx-accent); stop-opacity: 0.16; }
.qx-vs-glow1 { stop-color: var(--qx-accent); stop-opacity: 0; }
.qx-viz-orbit { fill: none; stroke: rgba(255,255,255,0.085); stroke-width: 1; }
.qx-viz-orbit2 { stroke: rgba(255,255,255,0.05); stroke-dasharray: 3 8; animation: qxOrbit 44s linear infinite; }

/* bright arc running the inner orbit — the "system is live" cue */
.qx-viz-scan {
  fill: none; stroke: var(--qx-accent); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 26 819; animation: qxScan 6.5s linear infinite;
}
/* counter-sweeping arc on the outer orbit (perimeter ~1163) */
.qx-viz-scan2 {
  fill: none; stroke: var(--qx-accent); stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: 20 1143; opacity: 0.6; animation: qxScan2 11s linear infinite;
}
.qx-viz-links-sm line {
  stroke: var(--qx-accent); stroke-width: 1; opacity: 0.3;
  stroke-dasharray: 3 9; animation: qxFlow 3.4s linear infinite;
}
.qx-viz-tiles-sm rect { fill: rgba(255,255,255,0.035); stroke: rgba(255,255,255,0.10); stroke-width: 1; }
.qx-viz-glyph-sm {
  fill: none; stroke: var(--qx-accent); stroke-width: 1.2;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0.75;
}
.qx-viz-hud path { fill: none; stroke: rgba(255,255,255,0.13); stroke-width: 1.4; stroke-linecap: round; }
.qx-viz-stars circle { fill: #ffffff; opacity: 0.25; animation: qxTwinkle 4.5s ease-in-out infinite; }
.qx-viz-stars circle:nth-of-type(2n) { animation-delay: -1.5s; }
.qx-viz-stars circle:nth-of-type(3n) { animation-delay: -2.8s; }
.qx-viz-stars circle:nth-of-type(5n) { animation-delay: -3.7s; }

/* Packets sit at the hub and are pushed out to their node at 0%, then
   travel back in. Negative delays stagger them from the first frame. */
.qx-viz-packets circle, .qx-viz-packets-sm circle { fill: var(--qx-accent); opacity: 0; }
.qx-pk1 { animation: qxPk1 2.6s linear infinite; }
.qx-pk2 { animation: qxPk2 2.6s linear -0.5s infinite; }
.qx-pk3 { animation: qxPk3 2.6s linear -1s infinite; }
.qx-pk4 { animation: qxPk4 2.6s linear -1.5s infinite; }
.qx-pk5 { animation: qxPk5 2.6s linear -2s infinite; }
.qx-pk6 { animation: qxPk6 3.4s linear -0.3s infinite; }
.qx-pk7 { animation: qxPk7 3.4s linear -1.4s infinite; }
.qx-pk8 { animation: qxPk8 3.4s linear -2.5s infinite; }

.qx-viz-pings circle {
  transform-box: view-box; transform-origin: 260px 215px; opacity: 0;
  fill: none; stroke: var(--qx-accent); stroke-width: 1.4;
}
.qx-ping1 { animation: qxPing 3.6s ease-out infinite; }
.qx-ping2 { animation: qxPing 3.6s ease-out -1.2s infinite; }
.qx-ping3 { animation: qxPing 3.6s ease-out -2.4s infinite; }

/* each system lights up in turn, as if reporting in */
.qx-viz-tiles rect {
  fill: rgba(255,255,255,0.045); stroke: rgba(255,255,255,0.12); stroke-width: 1;
  animation: qxNode 7s ease-in-out infinite;
}
.qx-viz-tiles rect:nth-of-type(2) { animation-delay: 1.4s; }
.qx-viz-tiles rect:nth-of-type(3) { animation-delay: 2.8s; }
.qx-viz-tiles rect:nth-of-type(4) { animation-delay: 4.2s; }
.qx-viz-tiles rect:nth-of-type(5) { animation-delay: 5.6s; }

/* data flowing from the satellite systems into the hub */
.qx-viz-links line {
  stroke: var(--qx-accent); stroke-width: 1.3; opacity: 0.55;
  stroke-dasharray: 5 10; animation: qxFlow 2.4s linear infinite;
}
.qx-viz-glyph {
  fill: none; stroke: var(--qx-accent); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0.9;
}
.qx-viz-hub { fill: rgba(255,255,255,0.06); stroke: var(--qx-accent); stroke-width: 1.6; }
.qx-viz-mark { fill: none; stroke: #ffffff; stroke-width: 2.2; stroke-linecap: round; }
.qx-viz-mark path { stroke: var(--qx-accent); }

@keyframes qxFlow    { to { stroke-dashoffset: -30; } }
@keyframes qxOrbit   { to { stroke-dashoffset: -220; } }
@keyframes qxScan    { to { stroke-dashoffset: -845; } }
@keyframes qxScan2   { to { stroke-dashoffset: 1163; } }
@keyframes qxTwinkle { 0%, 100% { opacity: 0.14; } 50% { opacity: 0.5; } }

/* one block per link — offsets are node minus hub(260,215) */
@keyframes qxPk1 { 0% { transform: translate(0px, -118px); opacity: 0; } 18% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPk2 { 0% { transform: translate(115px, -76px); opacity: 0; } 18% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPk3 { 0% { transform: translate(115px, 68px);  opacity: 0; } 18% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPk4 { 0% { transform: translate(-115px, 76px); opacity: 0; } 18% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPk5 { 0% { transform: translate(-115px, -76px);opacity: 0; } 18% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPk6 { 0% { transform: translate(-158px, -105px); opacity: 0; } 18% { opacity: 0.9; } 78% { opacity: 0.9; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPk7 { 0% { transform: translate(158px, -105px);  opacity: 0; } 18% { opacity: 0.9; } 78% { opacity: 0.9; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPk8 { 0% { transform: translate(-18px, 162px);   opacity: 0; } 18% { opacity: 0.9; } 78% { opacity: 0.9; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes qxPing { 0% { transform: scale(1); opacity: 0.45; } 100% { transform: scale(2.23); opacity: 0; } }
@keyframes qxNode {
  0%, 16%, 100% { stroke: rgba(255,255,255,0.12); fill: rgba(255,255,255,0.045); }
  6% { stroke: var(--qx-accent); fill: var(--qx-a1f); }
}

@media (prefers-reduced-motion: reduce) {
  .qx-viz-links line, .qx-viz-links-sm line, .qx-viz-orbit2, .qx-viz-scan,
  .qx-viz-scan2, .qx-viz-tiles rect, .qx-viz-stars circle { animation: none; }
  .qx-viz-packets, .qx-viz-packets-sm, .qx-viz-pings { display: none; }
}
