/* High-Craft 60fps Overdrive Visual Layer (Dual-Theme: Cosmic White-Label + Standalone Editorial Lux)
   Zero third-party dependencies, GPU-composited transforms/opacity, strict prefers-reduced-motion safety */

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

@keyframes odSpinAngle {
  to { --od-angle: 360deg; }
}

@keyframes odShimmer {
  0% { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(220%) skewX(-18deg); }
}

@keyframes odFloatSlow {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

/* Shared ambient canvas */
.od-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
}

/* =========================================================================
   THEME 1: COSMIC OVERDRIVE (White-Label Self-Service & Free Local Tools)
   ========================================================================= */
body.od-cosmic .gp-orb-1 {
  animation: odFloatSlow 11s ease-in-out infinite;
}
body.od-cosmic .gp-orb-2 {
  animation: odFloatSlow 14s ease-in-out infinite reverse;
}

body.od-cosmic .gp-card,
body.od-cosmic .gp-feat,
body.od-cosmic .gp-tel-stat,
body.od-cosmic .gp-stat,
body.od-cosmic .gp-pf-item {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.28s ease,
    box-shadow 0.32s ease,
    background 0.28s ease;
}

body.od-cosmic .gp-card::after,
body.od-cosmic .gp-feat::after,
body.od-cosmic .gp-pf-item::after,
body.od-cosmic .gp-tel-stat::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(139, 92, 246, 0.14),
    rgba(34, 211, 238, 0.06) 40%,
    transparent 70%
  );
  transition: opacity 0.28s ease;
}

body.od-cosmic .gp-card:hover::after,
body.od-cosmic .gp-feat:hover::after,
body.od-cosmic .gp-pf-item:hover::after,
body.od-cosmic .gp-tel-stat:hover::after {
  opacity: 1;
}

body.od-cosmic .gp-card:hover {
  border-color: rgba(167, 139, 250, 0.34);
  box-shadow: 0 24px 60px -24px rgba(124, 58, 237, 0.32), 0 0 0 1px rgba(167, 139, 250, 0.12) inset;
}

body.od-cosmic .gp-feat:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.42);
}

/* Prismatic animated border on hero title badge */
body.od-cosmic .gp-badge-title {
  position: relative;
  background:
    linear-gradient(135deg, rgba(22, 16, 44, 0.92), rgba(14, 22, 42, 0.92)) padding-box,
    conic-gradient(from var(--od-angle), #8b5cf6, #22d3ee, #34d399, #a855f7, #8b5cf6) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 0 28px -8px rgba(139, 92, 246, 0.55);
  animation: odSpinAngle 7s linear infinite;
}

/* Luminous primary CTA with metallic sheen sweep */
body.od-cosmic .gp-primary-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, filter 0.2s ease;
}
body.od-cosmic .gp-primary-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 48%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-140%) skewX(-18deg);
  pointer-events: none;
}
body.od-cosmic .gp-primary-btn:hover:not(:disabled)::before {
  animation: odShimmer 0.78s cubic-bezier(0.22, 1, 0.36, 1);
}
body.od-cosmic .gp-primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -10px rgba(124, 58, 237, 0.9), 0 0 18px -4px rgba(34, 211, 238, 0.45);
}
body.od-cosmic .gp-primary-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

/* White-Label Free Tools Tab Bar (.wt-tabs) */
.wt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(168, 140, 255, 0.22);
  background: rgba(15, 11, 28, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 34px -20px rgba(0, 0, 0, 0.85);
}

.wt-tab {
  position: relative;
  flex: 1 1 auto;
  border: 1px solid transparent;
  background: transparent;
  color: var(--gp-muted, #a49bc2);
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.22s ease, border-color 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

.wt-tab:hover {
  color: #f8fafc;
  background: rgba(139, 92, 246, 0.14);
  transform: translateY(-1px);
}

.wt-tab.is-active {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.36), rgba(8, 145, 178, 0.28)) padding-box,
    conic-gradient(from var(--od-angle), #8b5cf6, #22d3ee, #34d399, #8b5cf6) border-box;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px -10px rgba(124, 58, 237, 0.65);
  animation: odSpinAngle 8s linear infinite;
}

/* =========================================================================
   THEME 2: STANDALONE TOOL PAGES (/tools/* ONLY — Keeps Main Site Clean!)
   ========================================================================= */
body.od-standalone {
  position: relative;
}

body.od-standalone > header,
body.od-standalone > main,
body.od-standalone > footer {
  position: relative;
  z-index: 1;
}

body.od-standalone .tb-breadcrumb {
  background: color-mix(in srgb, var(--tb-surface) 84%, transparent);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid var(--tb-border);
  box-shadow: var(--tb-shadow);
  margin-bottom: 18px;
}

body.od-standalone .tb-switcher a {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
body.od-standalone .tb-switcher a:hover {
  transform: translateY(-1.5px);
}
body.od-standalone .tb-switcher a[aria-current="page"] {
  background:
    linear-gradient(135deg, var(--tb-accent), #c04863) padding-box,
    conic-gradient(from var(--od-angle), #e58399, #f59e0b, #98394e, #e58399) border-box;
  border: 1.5px solid transparent;
  color: #ffffff;
  box-shadow: 0 8px 20px -8px rgba(152, 57, 78, 0.58);
  animation: odSpinAngle 7s linear infinite;
}

/* Elevated luminous stage container on standalone tool pages */
body.od-standalone .tb-stage {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tb-surface) 94%, transparent), var(--tb-surface)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--tb-accent) 42%, var(--tb-border)), var(--tb-border) 48%, color-mix(in srgb, #f59e0b 32%, var(--tb-border))) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(16px);
  box-shadow:
    0 24px 54px -32px rgba(152, 57, 78, 0.26),
    0 2px 10px rgba(0, 0, 0, 0.03);
}

:root[data-theme="dark"] body.od-standalone .tb-stage {
  box-shadow:
    0 28px 64px -26px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(229, 131, 153, 0.14) inset;
}

/* Subtle prismatic top hairline bar */
body.od-standalone .tb-stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--tb-accent), #f59e0b, #22d3ee, var(--tb-accent), transparent);
  background-size: 200% 100%;
  opacity: 0.78;
  pointer-events: none;
}

/* Cursor spotlight on standalone cards & KPI tiles */
body.od-standalone .tb-kpi,
body.od-standalone .tb-check-item {
  position: relative;
  overflow: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.24s ease, box-shadow 0.26s ease;
}

body.od-standalone .tb-kpi::after,
body.od-standalone .tb-check-item::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--tb-accent) 14%, transparent),
    transparent 70%
  );
  transition: opacity 0.24s ease;
}

body.od-standalone .tb-kpi:hover::after,
body.od-standalone .tb-check-item:hover::after {
  opacity: 1;
}

body.od-standalone .tb-kpi:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tb-accent) 46%, var(--tb-border));
  box-shadow: 0 12px 28px -18px rgba(152, 57, 78, 0.35);
}

/* Springy sheen primary buttons on standalone tools */
body.od-standalone .tb-btn-primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, filter 0.2s ease;
}
body.od-standalone .tb-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-140%) skewX(-18deg);
  pointer-events: none;
}
body.od-standalone .tb-btn-primary:hover:not(:disabled)::before {
  animation: odShimmer 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}
body.od-standalone .tb-btn-primary:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 12px 24px -10px rgba(152, 57, 78, 0.55);
}
body.od-standalone .tb-btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

/* =========================================================================
   SCROLL / ENTRANCE MOTION & REDUCED-MOTION ACCESSIBILITY
   ========================================================================= */
.od-reveal,
body.od-cosmic .gp-card,
body.od-cosmic .gp-feat,
body.od-standalone .tb-stage {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .od-reveal:not(.is-in) {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1) var(--od-delay, 0ms), transform 0.52s cubic-bezier(0.22, 1, 0.36, 1) var(--od-delay, 0ms);
  }
  .od-reveal.is-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1) var(--od-delay, 0ms), transform 0.52s cubic-bezier(0.22, 1, 0.36, 1) var(--od-delay, 0ms);
  }
}

@media (prefers-reduced-motion: reduce) {
  .od-canvas { display: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 720px) {
  .wt-tabs { gap: 6px; padding: 5px; }
  .wt-tab { padding: 8px 10px; font-size: 12px; }
}
