/* habar.net — high-tech motion layer */

@property --fx-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --fx-hue {
  syntax: "<number>";
  initial-value: 0;
  inherits: false;
}

.fx-site {
  --fx-cyan: #00e5ff;
  --fx-violet: #7c4dff;
  --fx-magenta: #ff2d95;
  --fx-glow: rgba(0, 229, 255, 0.35);
  position: relative;
  isolation: isolate;
}

.fx-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 229, 255, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 77, 255, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(255, 45, 149, 0.05), transparent 45%),
    var(--bg);
}

.fx-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(600px) rotateX(58deg) translateY(-12%);
  transform-origin: center top;
  animation: fx-grid-drift 24s linear infinite;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, transparent 72%);
}

.fx-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.018) 2px,
    rgba(0, 0, 0, 0.018) 4px
  );
  opacity: 0.5;
  animation: fx-scan-flicker 8s steps(2) infinite;
}

.fx-spotlight {
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.12) 0%, transparent 68%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: multiply;
}

.fx-site.fx-pointer .fx-spotlight {
  opacity: 1;
}

.fx-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: fx-noise-shift 0.5s steps(2) infinite;
}

/* --- Header --- */

.fx-site .site-header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 rgba(0, 229, 255, 0.12);
}

.fx-site .site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--fx-cyan),
    var(--fx-violet),
    var(--fx-magenta),
    transparent
  );
  background-size: 200% 100%;
  animation: fx-border-flow 6s linear infinite;
  opacity: 0.85;
}

.fx-site .site-header.is-scrolled {
  box-shadow:
    0 1px 0 rgba(0, 229, 255, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.04);
}

.fx-site .brand {
  position: relative;
  background: linear-gradient(
    120deg,
    var(--ink) 0%,
    #333 40%,
    var(--fx-cyan) 55%,
    var(--ink) 70%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fx-brand-shine 8s ease-in-out infinite;
}

.fx-site .desktop-nav a,
.fx-site .header-link,
.fx-site .cart-chip {
  position: relative;
  overflow: hidden;
}

.fx-site .desktop-nav a::after,
.fx-site .header-link:not(.header-link-btn)::after,
.fx-site .cart-chip::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--fx-cyan), var(--fx-violet));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.fx-site .desktop-nav a:hover::after,
.fx-site .header-link:not(.header-link-btn):hover::after,
.fx-site .cart-chip:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --- Hero --- */

.fx-site .hero-tech {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
}

.fx-site .hero-tech::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 229, 255, 0.04) 0%,
    transparent 45%,
    rgba(124, 77, 255, 0.03) 100%
  );
  pointer-events: none;
}

.fx-site .hero-tech .hero-inner {
  position: relative;
  z-index: 1;
}

.fx-site .hero-tech h1 {
  position: relative;
  text-shadow: 0 0 40px rgba(0, 229, 255, 0.15);
}

.fx-site .hero-tech h1::after {
  content: "";
  display: block;
  width: 4rem;
  height: 2px;
  margin: 1.2rem auto 0;
  background: linear-gradient(90deg, var(--fx-cyan), var(--fx-magenta));
  animation: fx-pulse-width 3s ease-in-out infinite;
}

.fx-site .hero-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--fx-cyan), transparent);
  box-shadow: 0 0 20px var(--fx-glow);
  animation: fx-hero-scan 5s ease-in-out infinite;
  opacity: 0.7;
  pointer-events: none;
}

/* --- Buttons --- */

.fx-site .button {
  position: relative;
  overflow: hidden;
  z-index: 0;
  border-color: rgba(0, 0, 0, 0.12);
}

.fx-site .button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(0, 229, 255, 0.2) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
}

.fx-site .button:hover::before {
  transform: translateX(120%);
}

.fx-site .button:hover {
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.12),
    0 8px 28px rgba(0, 229, 255, 0.12);
}

.fx-site .button-primary,
.fx-site .hero-actions .button:first-child {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  color: #fff;
  border-color: rgba(0, 229, 255, 0.35);
}

.fx-site .button-primary:hover,
.fx-site .hero-actions .button:first-child:hover {
  box-shadow:
    0 0 24px rgba(0, 229, 255, 0.25),
    0 0 48px rgba(124, 77, 255, 0.12);
}

/* --- Product cards --- */

.fx-site .product-card {
  position: relative;
  --reveal-delay: 0ms;
}

.fx-site .product-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 2px;
  padding: 1px;
  background: linear-gradient(
    var(--fx-angle),
    rgba(0, 229, 255, 0.55),
    rgba(124, 77, 255, 0.35),
    rgba(255, 45, 149, 0.45),
    rgba(0, 229, 255, 0.55)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  animation: fx-angle-spin 4s linear infinite;
  z-index: 2;
}

.fx-site .product-card:hover::before {
  opacity: 1;
}

.fx-site .product-card:hover {
  transform: translateY(-4px);
}

.fx-site .product-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 60%,
    rgba(0, 229, 255, 0.08) 100%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.fx-site .product-card:hover .product-image::after {
  opacity: 1;
}

.fx-site .product-card:hover .product-image img {
  transform: scale(1.06);
  filter: contrast(1.04) saturate(1.08);
}

.fx-site .product-overlay {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  letter-spacing: 0.22em;
  font-weight: 500;
  border: 1px solid rgba(0, 229, 255, 0.2);
  box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.06);
}

.fx-site .product-badge {
  animation: fx-badge-pulse 2.5s ease-in-out infinite;
}

/* --- Category nav --- */

.fx-site .category-link.active {
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
}

.fx-site .category-link.active::before {
  content: "◆ ";
  font-size: 0.55em;
  color: var(--fx-cyan);
  vertical-align: middle;
}

/* --- Page chrome --- */

.fx-site .page-main {
  animation: fx-page-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fx-site .section-heading h2 {
  position: relative;
  display: inline-block;
}

.fx-site .section-heading h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.45rem;
  width: 2.5rem;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--fx-cyan), transparent);
}

.fx-site .site-footer {
  position: relative;
}

.fx-site .site-footer::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.35), transparent);
  animation: fx-border-flow 8s linear infinite;
  background-size: 200% 100%;
}

/* --- Scroll reveal --- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  filter: blur(6px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  filter: none;
}

/* --- Keyframes --- */

@keyframes fx-grid-drift {
  0% { transform: perspective(600px) rotateX(58deg) translateY(-12%) translateX(0); }
  100% { transform: perspective(600px) rotateX(58deg) translateY(-12%) translateX(48px); }
}

@keyframes fx-scan-flicker {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.55; }
}

@keyframes fx-noise-shift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-2%, -1%); }
}

@keyframes fx-border-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes fx-brand-shine {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

@keyframes fx-pulse-width {
  0%, 100% { width: 3rem; opacity: 0.7; }
  50% { width: 5.5rem; opacity: 1; }
}

@keyframes fx-hero-scan {
  0% { top: 15%; opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { top: 85%; opacity: 0; }
}

@keyframes fx-angle-spin {
  to { --fx-angle: 360deg; }
}

@keyframes fx-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
  50% { box-shadow: 0 0 14px rgba(0, 229, 255, 0.35); }
}

@keyframes fx-page-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fx-site .menu-toggle.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.fx-site .menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.fx-site .menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.fx-site input:focus,
.fx-site textarea:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.25),
    0 0 20px rgba(0, 229, 255, 0.12);
}

.fx-site .header-search input:focus {
  animation: fx-input-pulse 2s ease-in-out infinite;
}

@keyframes fx-input-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.2), 0 0 12px rgba(0, 229, 255, 0.08); }
  50% { box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.4), 0 0 22px rgba(0, 229, 255, 0.16); }
}

.fx-site .mobile-drawer-panel {
  animation: fx-drawer-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border-right-color: rgba(0, 229, 255, 0.2);
  box-shadow:
    8px 0 32px rgba(0, 0, 0, 0.06),
    0 0 40px rgba(0, 229, 255, 0.06);
}

@keyframes fx-drawer-in {
  from {
    transform: translateX(-100%);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}


@media (max-width: 860px) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .fx-site .product-card::before {
    display: none;
  }

  .fx-site .product-card:hover {
    transform: none;
  }

  .fx-site .product-image::after {
    display: none;
  }

  .fx-site .product-card:hover .product-image img {
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-grid,
  .fx-scanlines,
  .fx-noise,
  .fx-site .brand,
  .fx-site .site-header::after,
  .fx-site .site-footer::before,
  .fx-site .hero-scan,
  .fx-site .product-card::before,
  .fx-site .product-badge,
  [data-reveal] {
    animation: none !important;
    transition: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .fx-site .page-main {
    animation: none;
  }
}
