/* =====================================================================
   enhance.css — visual + animation layer on top of global.css
   Safe by design: no layout changes; anything hidden for an entrance
   animation is only hidden once enhance.js has loaded (html.fx-ready).
   To roll back: remove the <link> to this file and the enhance.js <script>.
   ===================================================================== */

:root {
  --fx-accent-1: var(--theme-first-color, #70558a);
  --fx-accent-2: var(--theme-second-color, #694efd);
  --fx-accent-3: #b388ff;
  --fx-glass: rgba(24, 22, 44, 0.55);
  --fx-glass-border: rgba(255, 255, 255, 0.08);
  --fx-ease: cubic-bezier(.22, 1, .36, 1);
  --fx-ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Animated aurora background + film grain ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    radial-gradient(40vmax 40vmax at 15% 10%, rgba(105, 78, 253, .22), transparent 60%),
    radial-gradient(35vmax 35vmax at 85% 20%, rgba(179, 136, 255, .14), transparent 60%),
    radial-gradient(45vmax 45vmax at 50% 110%, rgba(112, 85, 138, .22), transparent 60%);
  filter: saturate(120%);
  animation: fx-aurora 22s ease-in-out infinite alternate;
}
body::after {
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes fx-aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.04); }
}

/* Existing glow blobs: slow breathing */
.glow { animation: fx-breathe 9s ease-in-out infinite; }
@keyframes fx-breathe {
  0%, 100% { opacity: .45; transform: scale(1); }
  50%      { opacity: .65; transform: scale(1.08); }
}

/* ---------- Scroll progress bar (element added by enhance.js) ---------- */
.fx-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--fx-accent-1), var(--fx-accent-2), var(--fx-accent-3));
  box-shadow: 0 0 12px rgba(105, 78, 253, .8);
  z-index: 10000;
  pointer-events: none;
}

/* ---------- Animated gradient text ---------- */
.theme_text_gradient {
  background-image: linear-gradient(90deg, var(--fx-accent-1), var(--fx-accent-2), var(--fx-accent-3), var(--fx-accent-2), var(--fx-accent-1));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fx-gradient-text 8s linear infinite;
}
@keyframes fx-gradient-text {
  to { background-position: 300% 0; }
}

/* ---------- Navigation links: animated underline ---------- */
header .navigation a {
  position: relative;
  transition: color .25s var(--fx-ease);
}
header .navigation a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--fx-accent-2), var(--fx-accent-3));
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform .35s var(--fx-ease);
}
header .navigation a:hover::after,
header .navigation a:focus-visible::after { transform: scaleX(1); }

header .logo img { transition: transform .5s var(--fx-ease-bounce), filter .4s; }
header .logo:hover img { transform: scale(1.06) rotate(-2deg); filter: drop-shadow(0 0 14px rgba(105, 78, 253, .7)); }

/* ---------- Buttons: lift, glow and light sweep ---------- */
a.button_solid, button.button_solid, input.button_solid, .button.button_solid {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-size: 200% 100%;
  transition: transform .3s var(--fx-ease), box-shadow .3s var(--fx-ease), background-position .6s var(--fx-ease), opacity .2s;
}
a.button_solid::after, button.button_solid::after, .button.button_solid::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -75%;
  width: 50%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 1;
}
a.button_solid:not(.no_hover):hover, button.button_solid:not(.no_hover):hover, .button.button_solid:not(.no_hover):hover {
  opacity: 1;
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 10px 30px -8px rgba(105, 78, 253, .75), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}
a.button_solid:hover::after, button.button_solid:hover::after, .button.button_solid:hover::after {
  animation: fx-sweep .9s var(--fx-ease);
}
a.button_solid:active, button.button_solid:active { transform: translateY(0) scale(.98); }
@keyframes fx-sweep { to { left: 125%; } }

/* Click ripple (span added by enhance.js) */
.fx-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, .35);
  pointer-events: none;
  animation: fx-ripple .6s ease-out forwards;
  z-index: 2;
}
@keyframes fx-ripple { to { transform: scale(4); opacity: 0; } }

/* Outlined / category pills */
.border_full_2x.radius_large,
.button_outlined {
  transition: transform .3s var(--fx-ease), box-shadow .3s var(--fx-ease), border-color .3s;
}
.border_full_2x.radius_large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -10px rgba(105, 78, 253, .7);
  border-color: var(--fx-accent-2) !important;
}

/* ---------- Product cards: glass, spotlight, tilt, image zoom ---------- */
.product {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  border: 1px solid var(--fx-glass-border);
  background-color: var(--fx-glass) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform .45s var(--fx-ease), box-shadow .45s var(--fx-ease), border-color .45s;
  will-change: transform;
}
/* cursor spotlight (position set by enhance.js via --mx / --my) */
.product::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(149, 104, 255, .22), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  z-index: 0;
}
/* gradient border that lights up on hover */
.product::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--fx-angle, 0deg), transparent 0 60%, var(--fx-accent-2), var(--fx-accent-3), transparent 85%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  animation: fx-spin-border 4s linear infinite;
  z-index: 2;
}
@property --fx-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes fx-spin-border { to { --fx-angle: 360deg; } }

.product > * { position: relative; z-index: 1; }
.product:hover {
  border-color: rgba(149, 104, 255, .35);
  box-shadow: 0 25px 50px -20px rgba(105, 78, 253, .55), 0 0 0 1px rgba(149, 104, 255, .15);
}
.product:hover::before,
.product:hover::after { opacity: 1; }

.product .product_image {
  transition: transform .7s var(--fx-ease), filter .7s var(--fx-ease);
  transform-origin: 50% 60%;
}
.product:hover .product_image { transform: scale(1.06); filter: saturate(1.15) brightness(1.05); }

.product .product_label {
  animation: fx-label-pulse 2.4s ease-in-out infinite;
}
@keyframes fx-label-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .25); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}
.product .product_info {
  transition: background-color .4s, transform .4s var(--fx-ease);
}
.product:hover .product_info { transform: translateY(-2px); }

/* Feature blocks under the hero */
.flex_rows_3.bg_transparent {
  border: 1px solid transparent;
  transition: transform .45s var(--fx-ease), background-color .45s, border-color .45s;
}
.flex_rows_3.bg_transparent:hover {
  transform: translateY(-4px);
  background-color: rgba(255, 255, 255, .03) !important;
  border-color: var(--fx-glass-border);
}

/* Hero: floating icon ring + glowing logo */
.ring .item img {
  transition: transform .4s var(--fx-ease-bounce), box-shadow .4s;
}
.ring .item img:hover {
  transform: scale(1.18);
  box-shadow: 0 0 24px rgba(149, 104, 255, .9);
}
.ring_logo { animation: fx-float 6s ease-in-out infinite; }
@keyframes fx-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.hero .color_theme.text_2xlarge { font-variant-numeric: tabular-nums; }

/* ---------- Inputs ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--fx-accent-2) !important;
  box-shadow: 0 0 0 3px rgba(105, 78, 253, .25), 0 0 20px -4px rgba(105, 78, 253, .6);
}

/* ---------- Dropdown menus & search: pop in when shown ---------- */
.dropdown_menu:not(.none),
#search_menu:not(.none) {
  animation: fx-pop .28s var(--fx-ease);
  transform-origin: top right;
}
.dropdown_menu {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .7), 0 0 0 1px var(--fx-glass-border);
}
@keyframes fx-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Scroll reveal (only active once enhance.js runs) ---------- */
html.fx-ready .fx-reveal {
  opacity: 0;
  transform: translateY(28px) scale(.98);
  filter: blur(6px);
  transition:
    opacity .8s var(--fx-ease) var(--fx-delay, 0ms),
    transform .8s var(--fx-ease) var(--fx-delay, 0ms),
    filter .8s var(--fx-ease) var(--fx-delay, 0ms);
}
html.fx-ready .fx-reveal.fx-in {
  opacity: 1;
  transform: none;
  filter: none;
}
/* once revealed, hand transforms back to hover/tilt effects */
html.fx-ready .product.fx-reveal.fx-done {
  transition: transform .45s var(--fx-ease), box-shadow .45s var(--fx-ease), border-color .45s;
}

/* Page enter / leave */
html.fx-ready body { animation: fx-page-in .6s var(--fx-ease) both; }
html.fx-leaving body { opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease; }
@keyframes fx-page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Images fade in when loaded ---------- */
html.fx-ready img.fx-img { opacity: 0; transition: opacity .6s var(--fx-ease); }
html.fx-ready img.fx-img.fx-loaded { opacity: 1; }

/* ---------- Focus visibility (keyboard users) ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--fx-accent-3);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Respect "reduce motion" & touch devices ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html.fx-ready .fx-reveal { opacity: 1; transform: none; filter: none; }
}
@media (hover: none) {
  .product::after { display: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .product { background-color: var(--bg-secondary) !important; }
}
