/* ═══════════════════════════════════════════════════════════
   STYLE C: MIX MODE — Flagship
   Glass base + vibrant multicolor gradient backgrounds +
   animated mesh + colored card fills + maximum motion.

   This is the hero style. The "wow" factor.
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────── */

.style-mix {
  /* Glass materials — between liquid and classic */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.14);
  --glass-bg-active: rgba(255, 255, 255, 0.05);
  --glass-bg-strong: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.20);
  --glass-border-strong: rgba(255, 255, 255, 0.28);

  /* Blur — between liquid and classic */
  --blur-card: 30px;
  --blur-modal: 50px;
  --blur-nav: 60px;
  --blur-input: 20px;

  /* Saturation — highest, vivid colors */
  --saturation: saturate(200%);

  /* Shine — diagonal like liquid, but with color tint */
  --shine: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.06) 35%,
    transparent 55%
  );

  /* Gradient overlays on cards — uses theme accent colors */
  --card-gradient: linear-gradient(
    135deg,
    rgba(var(--accent-primary-rgb), 0.08) 0%,
    rgba(var(--accent-secondary-rgb), 0.04) 100%
  );

  /* Edge highlight */
  --edge-light: inset 0 0.5px 0 0 rgba(255, 255, 255, 0.16);

  /* Animated background mesh — 3 color blobs using theme accents */
  --mesh-bg:
    radial-gradient(ellipse 600px 400px at 20% 30%,
      rgba(var(--accent-primary-rgb), 0.15) 0%,
      transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 70%,
      rgba(var(--accent-secondary-rgb), 0.12) 0%,
      transparent 70%),
    radial-gradient(ellipse 400px 300px at 50% 90%,
      rgba(var(--accent-tertiary-rgb), 0.08) 0%,
      transparent 70%);

  /* Radii — pill-forward like liquid */
  --r-card: 24px;
  --r-button: 999px;
  --r-input: 18px;
  --r-chip: 999px;
  --r-modal: 32px;
  --r-small: 12px;

  /* Shadows — layered for depth + colored ambient */
  --shadow-card:
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.14),
    0 0 0 0.5px rgba(var(--accent-primary-rgb), 0.06);
  --shadow-card-hover:
    0 4px 8px rgba(0, 0, 0, 0.06),
    0 14px 40px rgba(0, 0, 0, 0.18),
    0 0 40px -8px rgba(var(--accent-primary-rgb), 0.12);
  --shadow-modal:
    0 8px 16px rgba(0, 0, 0, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.32);
  --shadow-nav: 0 -8px 32px rgba(0, 0, 0, 0.18);
  --shadow-button:
    0 2px 12px rgba(0, 0, 0, 0.10),
    0 0 20px -4px rgba(var(--accent-primary-rgb), 0.20);
  --shadow-glow: 0 0 28px -4px;

  /* Typography — Satoshi, geometric modern */
  --font-display: 'Satoshi', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: 'Satoshi', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}


/* ── Animated Mesh Background ──────────────────────────── */

.style-mix body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--mesh-bg);
  pointer-events: none;
  z-index: 0;
  animation: meshDrift 25s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes meshDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(15px, -20px) scale(1.03);
  }
  66% {
    transform: translate(-10px, 10px) scale(1.06);
  }
  100% {
    transform: translate(-5px, 25px) scale(0.98);
  }
}

/* Ensure body content sits above the mesh */
.style-mix body > * {
  position: relative;
  z-index: 1;
}


/* ── Card ──────────────────────────────────────────────── */

.style-mix .card {
  position: relative;
  overflow: hidden;
  /* Glass base + colored gradient overlay */
  background: var(--card-gradient), var(--glass-bg);
  backdrop-filter: blur(var(--blur-card)) var(--saturation);
  -webkit-backdrop-filter: blur(var(--blur-card)) var(--saturation);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card), var(--edge-light);
  transition:
    transform var(--dur-normal) var(--ease-spring),
    box-shadow var(--dur-normal) ease;
}

/* Shine overlay with subtle color */
.style-mix .card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--shine);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

/* Animated gradient border effect — subtle color shift at edge */
.style-mix .card::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-primary-rgb), 0.12) 0%,
    transparent 40%,
    transparent 60%,
    rgba(var(--accent-secondary-rgb), 0.08) 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
}

/* Interactive cards — springier than other styles */
.style-mix .card.tappable:active {
  transform: scale(0.96);
}

@media (hover: hover) {
  .style-mix .card.tappable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover), var(--edge-light);
  }
}


/* ── Buttons ───────────────────────────────────────────── */

/* Primary — gradient + glow + glass sheen */
.style-mix .btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-24);
  border-radius: var(--r-button);
  background: var(--gradient-primary);
  color: #fff;
  font-weight: var(--fw-semibold);
  font-size: var(--text-body);
  box-shadow: var(--shadow-button);
  transition:
    transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur-normal) ease;
  overflow: hidden;
}

/* Glass sheen + shimmer effect */
.style-mix .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.20) 45%,
    rgba(255, 255, 255, 0.20) 55%,
    transparent 65%
  );
  border-radius: inherit;
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-smooth);
}

.style-mix .btn-primary:active {
  transform: scale(0.96);
}

@media (hover: hover) {
  .style-mix .btn-primary:hover {
    box-shadow:
      var(--shadow-glow) var(--accent-primary),
      0 2px 12px rgba(0, 0, 0, 0.10);
  }

  .style-mix .btn-primary:hover::before {
    transform: translateX(100%);
  }
}

.style-mix .btn-primary:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Secondary — glass with gradient border accent */
.style-mix .btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-24);
  border-radius: var(--r-button);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-input)) var(--saturation);
  -webkit-backdrop-filter: blur(var(--blur-input)) var(--saturation);
  border: 1px solid var(--glass-border);
  color: var(--accent-primary);
  font-weight: var(--fw-medium);
  font-size: var(--text-body);
  transition:
    transform var(--dur-fast) var(--ease-spring),
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-normal) ease;
}

.style-mix .btn-secondary:active {
  transform: scale(0.96);
  background: var(--glass-bg-active);
}

@media (hover: hover) {
  .style-mix .btn-secondary:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent-primary);
    box-shadow: 0 0 16px -4px rgba(var(--accent-primary-rgb), 0.20);
  }
}

.style-mix .btn-secondary:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Ghost */
.style-mix .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-10) var(--sp-16);
  border-radius: var(--r-button);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
  font-size: var(--text-body);
  transition:
    transform var(--dur-fast) var(--ease-spring),
    color var(--dur-fast) ease,
    background var(--dur-fast) ease;
}

.style-mix .btn-ghost:active {
  transform: scale(0.96);
}

@media (hover: hover) {
  .style-mix .btn-ghost:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
  }
}

.style-mix .btn-ghost:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}


/* ── Input ─────────────────────────────────────────────── */

.style-mix .input {
  display: block;
  width: 100%;
  padding: var(--sp-12) var(--sp-16);
  border-radius: var(--r-input);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-input)) var(--saturation);
  -webkit-backdrop-filter: blur(var(--blur-input)) var(--saturation);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: var(--text-body);
  transition:
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-normal) ease;
}

.style-mix .input::placeholder {
  color: var(--text-muted);
}

.style-mix .input:focus {
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 3px rgba(var(--accent-primary-rgb), 0.15),
    0 0 20px -4px rgba(var(--accent-primary-rgb), 0.10);
}


/* ── Chips ─────────────────────────────────────────────── */

.style-mix .chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-6) var(--sp-12);
  border-radius: var(--r-chip);
  background: var(--glass-bg);
  backdrop-filter: blur(12px) var(--saturation);
  -webkit-backdrop-filter: blur(12px) var(--saturation);
  border: 1px solid var(--glass-border);
  font-size: var(--text-caption);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  transition:
    transform var(--dur-fast) var(--ease-spring),
    box-shadow var(--dur-fast) ease;
}

.style-mix .chip:active {
  transform: scale(0.94);
}

@media (hover: hover) {
  .style-mix .chip:hover {
    box-shadow: 0 0 12px -2px rgba(var(--accent-primary-rgb), 0.15);
  }
}

.style-mix .chip.success {
  color: var(--success);
  background: var(--success-bg);
  border-color: transparent;
}
.style-mix .chip.warning {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: transparent;
}
.style-mix .chip.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: transparent;
}
.style-mix .chip.info {
  color: var(--info);
  background: var(--info-bg);
  border-color: transparent;
}


/* ── Glass Utility ─────────────────────────────────────── */

.style-mix .glass {
  background: var(--card-gradient), var(--glass-bg);
  backdrop-filter: blur(var(--blur-card)) var(--saturation);
  -webkit-backdrop-filter: blur(var(--blur-card)) var(--saturation);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
}


/* ── Reduced Motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .style-mix body::before {
    animation: none;
  }

  .style-mix .btn-primary::before {
    transition: none;
  }
}


/* ── Backdrop-filter Fallback ──────────────────────────── */

@supports not (backdrop-filter: blur(1px)) {
  .style-mix body::before {
    /* Mesh still shows as static colored background */
    opacity: 0.8;
  }

  .style-mix .card,
  .style-mix .glass {
    background: var(--card-gradient), var(--bg-elevated);
    border-color: var(--glass-border-strong);
  }

  .style-mix .btn-secondary,
  .style-mix .input,
  .style-mix .chip {
    background: var(--bg-elevated);
  }
}
