/* =========================================================
   Qubix Smart Solutions
   ========================================================= */

:root {
  --ink: #0b0d12;
  --muted: #5b6272;
  --faint: #a3a9b6;
  --line: #e7e9ef;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --blue: #004cff;          /* sampled from the logo */
  --blue-600: #003cd0;
  --blue-50: #eef3ff;
  --blue-light: #7ea3ff;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(11, 13, 18, 0.04), 0 8px 24px rgba(11, 13, 18, 0.07);
  --font-head: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1160px;
  --gutter: 24px;
  --header-h: 72px;
  --hex: polygon(50% 0, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(0, 76, 255, 0.65);
}
.btn-primary:hover { background: var(--blue-600); }

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-sm { padding: 9px 18px; font-size: 0.9rem; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-sub {
  margin-top: 4px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a:not(.btn) {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease;
}
.nav-links a:not(.btn):hover { color: var(--ink); }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 72px 0 96px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(#d9dde7 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 65% 70% at 72% 45%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 65% 70% at 72% 45%, #000 25%, transparent 75%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-50);
}

.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(2.5rem, 4vw + 1rem, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.hero h1 .accent { color: var(--blue); }

.lead {
  max-width: 34em;
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 36px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points svg { width: 18px; height: 18px; color: var(--blue); }

/* Hero visual */
.hero-visual {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  justify-self: end;
}
.hero-visual .glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 76, 255, 0.2), transparent 70%);
  filter: blur(12px);
}
.rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.rings polygon {
  fill: none;
  stroke: #dfe3eb;
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.rings .ring-outer {
  stroke: var(--blue);
  stroke-opacity: 0.35;
  stroke-dasharray: 4 9;
  animation: dash 40s linear infinite;
}
.rings .node { fill: var(--blue); }
.rings .node-hollow { fill: #fff; stroke: var(--blue); stroke-width: 2; }

.hero-logo {
  position: absolute;
  top: 29%;
  left: 29%;
  width: 42%;
  filter: drop-shadow(0 22px 36px rgba(0, 76, 255, 0.22));
  animation: float 6s ease-in-out infinite;
}

.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  animation: float 7s ease-in-out infinite;
}
.chip::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--blue);
  clip-path: var(--hex);
}
.chip-1 { top: 10%; left: 0; }
.chip-2 { top: 30%; right: -2%; animation-delay: -2s; }
.chip-3 { bottom: 24%; left: -3%; animation-delay: -4s; }
.chip-4 { bottom: 6%; right: 8%; animation-delay: -1s; }

/* ---------- Expertise strip ---------- */
.stack {
  border-block: 1px solid var(--line);
  background: var(--bg-soft);
}
.stack-inner {
  display: flex;
  align-items: center;
  gap: 16px 32px;
  padding-block: 22px;
}
.stack-label {
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.stack ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.stack li {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: #3a4050;
}
.stack li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #c3c9d6;
  clip-path: var(--hex);
}

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-soft { background: var(--bg-soft); }

.section-head { max-width: 640px; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.kicker::before {
  content: "";
  width: 10px;
  height: 10px;
  background: currentColor;
  clip-path: var(--hex);
}
.kicker-light { color: var(--blue-light); }

.section-head h2 {
  margin: 14px 0 16px;
  font-size: clamp(2rem, 2.4vw + 1rem, 2.9rem);
}
.section-head p {
  font-size: 1.08rem;
  color: var(--muted);
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #d5dbea;
  box-shadow: 0 20px 40px -20px rgba(11, 13, 18, 0.2);
}
.card:hover::after { transform: scaleX(1); }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: var(--blue-50);
  color: var(--blue);
  clip-path: var(--hex);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.icon svg { width: 26px; height: 26px; }
.card:hover .icon { background: var(--blue); color: #fff; }

.num {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--faint);
}
.card h3 { margin-bottom: 10px; font-size: 1.25rem; }
.card p { font-size: 0.98rem; color: var(--muted); }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 56px;
}
.step {
  position: relative;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 44px;
  right: -14px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #c3c9d6;
  border-right: 2px solid #c3c9d6;
  transform: rotate(45deg);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
}
.step:last-child .step-num { background: var(--blue); }
.step h3 { margin-bottom: 8px; font-size: 1.15rem; }
.step p { font-size: 0.95rem; color: var(--muted); }

/* ---------- CTA ---------- */
.cta-section { padding: 104px 0; }

.cta-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 64px;
  border-radius: 28px;
  background: var(--ink);
  color: #fff;
}
.cta-card::before {
  content: "";
  position: absolute;
  right: -15%;
  bottom: -70%;
  z-index: -1;
  width: 75%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 76, 255, 0.55), transparent 65%);
}
.cta-mark {
  position: absolute;
  top: -60px;
  right: -50px;
  z-index: -1;
  width: 300px;
  opacity: 0.08;
}
.cta-card h2 {
  margin: 14px 0;
  font-size: clamp(1.9rem, 2.4vw + 1rem, 2.8rem);
}
.cta-card p {
  max-width: 32em;
  font-size: 1.08rem;
  color: #b9bfcc;
}
.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  justify-self: end;
}
.cta-email {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 500;
  color: #fff;
  transition: border-color 0.15s ease;
}
.cta-email:hover { border-bottom-color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 48px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px 48px;
}
.footer-brand p {
  margin-top: 14px;
  font-size: 0.95rem;
  color: var(--muted);
}
.footer-brand .brand img { width: 36px; height: 36px; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding-top: 8px;
}
.footer-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: 40px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Motion ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes dash {
  to { stroke-dashoffset: -260; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Elements fade up as they scroll into view (only when JS is running) */
.js [data-reveal]:not(.is-visible) { opacity: 0; }
.js [data-reveal].is-visible {
  animation: reveal 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(var(--d, 0) * 80ms);
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:not(:last-child)::after { display: none; }
  .cta-card { grid-template-columns: 1fr; padding: 48px; }
  .cta-actions { justify-self: start; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 16px 32px -16px rgba(11, 13, 18, 0.18);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a:not(.btn) {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    color: var(--ink);
  }
  .nav-links .btn { width: 100%; margin-top: 16px; padding-block: 13px; }

  .hero { padding: 48px 0 72px; }
  .hero::before {
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 70%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 60% at 50% 70%, #000 20%, transparent 75%);
  }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { justify-self: center; max-width: 400px; }

  .stack-inner { flex-direction: column; align-items: flex-start; }
  .stack ul { gap: 8px; }
  .stack li {
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 0.88rem;
  }
  .stack li + li::before { display: none; }

  .section, .cta-section { padding: 72px 0; }
  .services-grid, .steps { margin-top: 40px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }

  .brand-name { font-size: 1.15rem; }
  .lead { font-size: 1.05rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero-logo { top: 30%; left: 30%; width: 40%; }
  .chip { padding: 6px 12px; font-size: 0.8rem; }

  .services-grid, .steps { grid-template-columns: 1fr; }
  .card { padding: 24px; }

  .cta-card { padding: 40px 24px; border-radius: 22px; }
  .cta-actions, .cta-actions .btn { width: 100%; }
  .cta-actions { align-items: stretch; }
  .cta-email { align-self: flex-start; }
  .cta-mark { width: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
