/* ==========================================================================
   LAYOUT: everything around the page content
   Background, loader, header and footer
   ========================================================================== */

/* ---------- 3D background canvas ---------- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* CSS fallback when WebGL / JS does not run */
.orb {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  /* no blur filter: the radial gradient is already soft, and a moving blur is costly to redraw */
  opacity: .55;
  pointer-events: none;
  animation: float 14s ease-in-out infinite;
}

.orb--purple {
  width: 520px;
  height: 520px;
  right: -120px;
  top: 60px;
  background: radial-gradient(circle, var(--purple), transparent 70%);
}

.orb--cyan {
  width: 420px;
  height: 420px;
  left: -140px;
  top: 520px;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
  animation-delay: -5s;
}

/* with the 3D scene running the orbs stay still: it already brings the motion */
body.webgl .orb {
  opacity: .32;
  animation: none;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-40px, 40px) scale(1.08); }
}

/* ---------- loader (pure CSS failsafe: hides itself after 4s) ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-items: center;
  animation: fadeOut .6s ease 4s forwards;
}

#loader.is-done {
  animation: fadeOut .5s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* the Zerix mark puts itself together: top drops in, bottom rises, the blue band sweeps across */
.loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

#loader .loader-mark {
  width: 64px;
  height: auto;
  overflow: visible;
}

.loader-mark path {
  transform-box: fill-box;
}

.loader-mark .logo-top {
  animation: markTop .7s cubic-bezier(.2, .8, .2, 1) both;
}

.loader-mark .logo-bottom {
  animation: markBottom .7s cubic-bezier(.2, .8, .2, 1) both;
}

.loader-mark .logo-slash,
.loader-mark .logo-slash-end {
  transform-origin: left center;
  animation: markSlash .55s cubic-bezier(.65, 0, .35, 1) .35s both;
}

.loader-word {
  animation: loaderWord .6s ease .6s both;
}

.loader-word img {
  height: 29px;
}

.loader-word small {
  font-size: 11px;
}

@keyframes markTop {
  from { opacity: 0; transform: translateY(-40%); }
}

@keyframes markBottom {
  from { opacity: 0; transform: translateY(40%); }
}

@keyframes markSlash {
  from { transform: scaleX(0); }
}

@keyframes loaderWord {
  from { opacity: 0; transform: translateY(8px); letter-spacing: .2em; }
}

/* ---------- header / nav ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: .3s;
}

/* a solid tint instead of a backdrop blur: a blur is redrawn on every scroll frame */
header.is-solid {
  background: rgba(7, 11, 22, .92);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

/* ---------- logo: Zerix mark (inline SVG) + wordmark ---------- */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 30px;
  height: auto;
  overflow: visible;
}

.logo-mark path {
  transform-box: fill-box;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), fill .3s;
}

.logo-top,
.logo-bottom {
  fill: #fff;
}

.logo-slash {
  fill: var(--purple);
}

.logo-slash-end {
  fill: var(--deep);
}

/* ZERIX from the logo file, DIGITAL as spaced text (it is too small to read inside the file) */
.brand-word {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.brand-word img {
  height: 21px;
  width: auto;
}

.brand-word small {
  font: 500 8.5px/1 Inter, system-ui, sans-serif;
  letter-spacing: 1.05em;
  margin-right: -1.05em;
  text-transform: uppercase;
  color: var(--grey);
  text-align: justify;
  text-align-last: justify;
}

/* on hover the mark opens up a little and the blue band glows */
.logo:hover .logo-top {
  transform: translateY(-14%);
}

.logo:hover .logo-bottom {
  transform: translateY(14%);
}

.logo:hover .logo-slash {
  fill: #4d6bff;
  filter: drop-shadow(0 0 6px rgba(51, 85, 255, .9));
}

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 15px;
  color: var(--muted);
}

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

/* ---------- services dropdown ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nav-dropdown-button:hover,
.nav-dropdown.is-open .nav-dropdown-button {
  color: var(--text);
}

/* small chevron */
.nav-dropdown-button i {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s;
}

.nav-dropdown.is-open .nav-dropdown-button i {
  margin-top: 3px;
  transform: rotate(225deg);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 18px);
  left: -24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 500px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d1426;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: .2s;
}

/* keeps the menu open while the mouse crosses the gap below the button */
.nav-menu:before {
  content: "";
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
}

.nav-dropdown.is-open .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
}

.nav-menu a:hover {
  background: rgba(51, 85, 255, .16);
}

.nav-menu a span {
  width: 22px;
  text-align: center;
}

.nav-menu .nav-menu-all {
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  color: var(--cyan);
}

.nav-toggle {
  display: none;
}

.burger {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  /* extra room at the bottom so the WhatsApp and chat buttons never cover the links */
  padding: 40px 0 110px;
  color: var(--muted);
  font-size: 14px;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* the logo file has its own padding, so it is pulled in a little */
.footer-brand p {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

footer nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

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