/* Crypto Junkie Portal — brand motion layer.
 *
 * The backdrop art is drawn by brand/motion-canvas.js (original canvas
 * animation); this file only owns the layers, the graffiti edge and the
 * brand micro-interactions.
 */

:root {
  --cj-green: #97be30;
  --cj-green-bright: #b6dc3f;
  --cj-green-deep: #4f6b12;
  --cj-green-dark: #1d2410;
  --cj-flare: #ff5a1f;
  --cj-ink: 7 8 5;

  /* The app ships a violet accent + "magic" ramp. Everything is repainted in
     Crypto Junkie green so no menu, badge, icon or button stays purple. */
  --t-accent: var(--cj-green) !important;
  --t-accent-soft: rgb(151 190 48 / 0.16) !important;
  --t-accent-text: #0b0e05 !important;

  --t-bg: #070805 !important;
  --t-bg-secondary: #0c0f07 !important;
  --t-bg-tertiary: #12160a !important;
  --t-border: #26301a !important;
  --t-border-soft: #1a2112 !important;
  --t-text: #f2f6e6 !important;
  --t-text-secondary: #a7b48d !important;
  --t-text-tertiary: #76825f !important;
  --t-hover: #1a2110 !important;

  --background-magic-color-bg-magic: 151 190 48 !important;
  --background-magic-color-bg-magic-hover: 182 220 63 !important;
  --background-magic-color-bg-magic-active: 130 168 32 !important;
  --background-magic-color-bg-magic-muted: 31 40 15 !important;
  --background-magic-color-bg-magic-muted-hover: 46 58 20 !important;
  --background-magic-color-bg-magic-muted-active: 60 76 26 !important;
  --border-color-border-magic: 151 190 48 !important;
  --border-color-border-magic-muted: 108 132 34 !important;
  --text-color-text-magic: 182 220 63 !important;
  --text-color-text-magic-strong: 236 250 204 !important;
  --icon-color-icon-magic: 151 190 48 !important;
  --icon-color-icon-magic-strong: 212 238 148 !important;

  --color-background-magic-color-bg-magic: rgb(151 190 48) !important;
  --color-background-magic-color-bg-magic-hover: rgb(182 220 63) !important;
  --color-background-magic-color-bg-magic-active: rgb(130 168 32) !important;
  --color-background-magic-color-bg-magic-muted: rgb(31 40 15) !important;
  --color-background-magic-color-bg-magic-muted-hover: rgb(46 58 20) !important;
  --color-background-magic-color-bg-magic-muted-active: rgb(60 76 26) !important;
  --color-border-color-border-magic: rgb(151 190 48) !important;
  --color-border-color-border-magic-muted: rgb(108 132 34) !important;
  --color-text-color-text-magic: rgb(182 220 63) !important;
  --color-text-color-text-magic-strong: rgb(236 250 204) !important;
  --color-icon-color-icon-magic: rgb(151 190 48) !important;
  --color-icon-color-icon-magic-strong: rgb(212 238 148) !important;

  --background-default-color-bg: 7 8 5 !important;
  --background-default-color-bg-surface: 14 17 9 !important;
  --background-default-color-bg-elevated: 19 23 12 !important;
  --background-default-color-bg-subtle: 26 32 18 !important;
  --background-default-color-bg-strong: 34 42 22 !important;
}

html,
body,
#root {
  background-color: transparent !important;
}

#cj-goo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 80% 0%, rgb(151 190 48 / 0.22), transparent 62%),
    radial-gradient(90% 70% at 0% 100%, rgb(255 90 31 / 0.1), transparent 65%),
    radial-gradient(70% 50% at 50% 50%, rgb(8 10 9 / 0), rgb(8 10 9 / 0.65)),
    rgb(var(--background-default-color-bg, var(--cj-ink)));
}

#cj-goo-bg .cj-bg-mark,
#cj-goo-bg .cj-bg-particles {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* The wordmark breathes and drifts instead of looping blob shapes. */
#cj-goo-bg .cj-bg-mark {
  opacity: 1;
  transform-origin: 50% 50%;
  animation: cj-mark-drift 48s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

#cj-goo-bg .cj-bg-particles {
  opacity: 0.85;
}

@keyframes cj-mark-drift {
  0% {
    transform: translate3d(-1.2%, 0.8%, 0) scale(1);
    opacity: 0.82;
  }
  50% {
    transform: translate3d(0.6%, -0.6%, 0) scale(1.03);
    opacity: 0.96;
  }
  100% {
    transform: translate3d(1.4%, 1%, 0) scale(1.01);
    opacity: 0.86;
  }
}

.dark #cj-goo-bg .cj-bg-mark {
  opacity: 1;
}

/* Hero artwork: the canvas replaces the stock hero video. On phones the app
   collapses the media wrapper, so the canvas mounts on the card itself. */
.cj-hero-art {
  position: relative;
  isolation: isolate;
}

.cj-hero-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
}

.cj-hero-art::before {
  content: "";
  position: absolute;
  inset: 6% -4% -2% 4%;
  z-index: -1;
  border-radius: 48% 52% 44% 56% / 52% 46% 54% 48%;
  background:
    radial-gradient(60% 60% at 40% 40%, rgb(151 190 48 / 0.35), transparent 70%),
    radial-gradient(50% 50% at 70% 60%, rgb(255 90 31 / 0.16), transparent 70%);
  filter: blur(26px);
  animation: cj-hero-halo 11s ease-in-out infinite alternate;
}

@keyframes cj-hero-halo {
  0% {
    transform: translate3d(0, 0, 0) scale(1) rotate(-2deg);
    opacity: 0.75;
  }
  50% {
    transform: translate3d(-2%, 2%, 0) scale(1.08) rotate(3deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(2%, -1%, 0) scale(0.98) rotate(-1deg);
    opacity: 0.8;
  }
}

#root {
  position: relative;
  z-index: 1;
}

/* Gooey brand edge — liquid line with drips along the top of the viewport */

#cj-goo-edge {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  z-index: 9997;
  pointer-events: none;
  filter: url(#cj-goo-filter);
  opacity: 0.9;
}

#cj-goo-edge .cj-edge-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--cj-green-deep), var(--cj-green) 30%, var(--cj-green-bright) 55%, var(--cj-green) 80%, var(--cj-green-deep));
}

#cj-goo-edge .cj-edge-blob {
  position: absolute;
  top: -11px;
  width: 26px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--cj-green-bright), var(--cj-green) 60%, var(--cj-green-deep));
}

#cj-goo-edge .cj-edge-blob:nth-child(1) {
  left: 4%;
  animation: cj-edge-slide 19s linear infinite;
}

#cj-goo-edge .cj-edge-blob:nth-child(2) {
  left: 34%;
  width: 18px;
  height: 16px;
  animation: cj-edge-slide 27s linear infinite;
}

#cj-goo-edge .cj-edge-blob:nth-child(3) {
  left: 62%;
  width: 32px;
  height: 26px;
  animation: cj-edge-slide 33s linear infinite;
}

#cj-goo-edge .cj-edge-blob:nth-child(4) {
  left: 82%;
  width: 16px;
  height: 15px;
  animation: cj-edge-slide 23s linear infinite;
}

@keyframes cj-edge-slide {
  0% {
    transform: translate3d(-12vw, 0, 0) scale(0.7, 0.6);
  }
  40% {
    transform: translate3d(22vw, 3px, 0) scale(1, 1.15);
  }
  70% {
    transform: translate3d(58vw, -2px, 0) scale(0.9, 0.8);
  }
  100% {
    transform: translate3d(112vw, 0, 0) scale(0.7, 0.6);
  }
}

/* Brand mark motion */

img[src="/brand/logo-mark.svg"] {
  animation: cj-mark-pulse 5.5s ease-in-out infinite alternate;
  transition: filter 260ms ease;
}

a:hover img[src="/brand/logo-mark.svg"],
a:focus-visible img[src="/brand/logo-mark.svg"] {
  filter: url(#cj-goo-filter) drop-shadow(0 0 7px rgba(151, 190, 48, 0.55));
  animation: cj-mark-goo 1.6s ease-in-out infinite alternate;
}

@keyframes cj-mark-pulse {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-1.5px) scale(1.04);
  }
}

@keyframes cj-mark-goo {
  0% {
    transform: translateY(0) scale(1) rotate(-2deg);
  }
  100% {
    transform: translateY(-2px) scale(1.1) rotate(3deg);
  }
}

/* Feature animation: the floating Crypto Junkie orb */

button:has(> img[src="/brand/logo-mark.svg"]) img[src="/brand/logo-mark.svg"] {
  animation: cj-orb-float 6s ease-in-out infinite alternate;
}

button:has(> img[src="/brand/logo-mark.svg"]):hover img[src="/brand/logo-mark.svg"] {
  filter: url(#cj-goo-filter) drop-shadow(0 0 10px rgba(151, 190, 48, 0.6));
}

@keyframes cj-orb-float {
  0% {
    transform: translateY(0) rotate(-3deg) scale(1);
  }
  50% {
    transform: translateY(-3px) rotate(2deg) scale(1.06);
  }
  100% {
    transform: translateY(1px) rotate(4deg) scale(1.02);
  }
}

/* Brand mark sizing. The artwork is the existing Crypto Junkie mark, just
 * placed as a compact icon everywhere instead of a banner. */

img[src="/brand/logo-mark.svg"] {
  object-fit: contain;
}

/* Sidebar workspace switcher */
img[src="/brand/logo-mark.svg"].h-8.w-8 {
  width: 22px !important;
  height: 22px !important;
}

/* Sidebar footer */
img[src="/brand/logo-mark.svg"].h-9 {
  width: auto !important;
  height: 26px !important;
}

/* Landing hero mark */
img[src="/brand/logo-mark.svg"][class*="h-[57px]"] {
  width: auto !important;
  height: 38px !important;
}

/* Floating chat orb */
img[src="/brand/logo-mark.svg"].size-12 {
  width: 34px !important;
  height: 34px !important;
}

/* Chat avatar (spray-can speech bubble) replaces the shrunk illustration in
 * the launcher and in the chat empty state. */
img.cj-chat-avatar {
  border-radius: 16px;
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.45));
  transition: transform 220ms ease, filter 220ms ease;
}

button[class*="size-[72px]"] img.cj-chat-avatar {
  width: 40px !important;
  height: 40px !important;
}

button[class*="size-[72px]"]:hover img.cj-chat-avatar {
  transform: translateY(-1px) scale(1.06) rotate(-3deg);
  filter: drop-shadow(0 8px 18px rgb(255 90 31 / 0.35));
}

img.cj-chat-avatar[class*="h-[57px]"] {
  width: 68px !important;
  height: 68px !important;
  border-radius: 20px;
}

button[class*="size-[72px]"]:has(> img[src="/brand/logo-mark.svg"]) {
  width: 56px !important;
  height: 56px !important;
}

/* The app theme classes redeclare the palette on their own subtree, so the
   green ramp has to be repeated where the violet one originally lived. */
.dark,
.terminal-theme,
[data-theme="dark"] {
  --t-accent: #97be30 !important;
  --t-accent-soft: rgb(151 190 48 / 0.16) !important;
  --t-accent-text: #0b0e05 !important;

  --t-bg: #070805 !important;
  --t-bg-secondary: #0c0f07 !important;
  --t-bg-tertiary: #12160a !important;
  --t-border: #26301a !important;
  --t-border-soft: #1a2112 !important;
  --t-text: #f2f6e6 !important;
  --t-text-secondary: #a7b48d !important;
  --t-text-tertiary: #76825f !important;
  --t-hover: #1a2110 !important;

  --background-magic-color-bg-magic: 151 190 48 !important;
  --background-magic-color-bg-magic-hover: 182 220 63 !important;
  --background-magic-color-bg-magic-active: 130 168 32 !important;
  --background-magic-color-bg-magic-muted: 31 40 15 !important;
  --background-magic-color-bg-magic-muted-hover: 46 58 20 !important;
  --background-magic-color-bg-magic-muted-active: 60 76 26 !important;
  --border-color-border-magic: 151 190 48 !important;
  --border-color-border-magic-muted: 108 132 34 !important;
  --text-color-text-magic: 182 220 63 !important;
  --text-color-text-magic-strong: 236 250 204 !important;
  --icon-color-icon-magic: 151 190 48 !important;
  --icon-color-icon-magic-strong: 212 238 148 !important;

  --color-background-magic-color-bg-magic: rgb(151 190 48) !important;
  --color-background-magic-color-bg-magic-hover: rgb(182 220 63) !important;
  --color-background-magic-color-bg-magic-active: rgb(130 168 32) !important;
  --color-background-magic-color-bg-magic-muted: rgb(31 40 15) !important;
  --color-background-magic-color-bg-magic-muted-hover: rgb(46 58 20) !important;
  --color-background-magic-color-bg-magic-muted-active: rgb(60 76 26) !important;
  --color-border-color-border-magic: rgb(151 190 48) !important;
  --color-border-color-border-magic-muted: rgb(108 132 34) !important;
  --color-text-color-text-magic: rgb(182 220 63) !important;
  --color-text-color-text-magic-strong: rgb(236 250 204) !important;
  --color-icon-color-icon-magic: rgb(151 190 48) !important;
  --color-icon-color-icon-magic-strong: rgb(212 238 148) !important;

  --background-default-color-bg: 7 8 5 !important;
  --background-default-color-bg-surface: 14 17 9 !important;
  --background-default-color-bg-elevated: 19 23 12 !important;
  --background-default-color-bg-subtle: 26 32 18 !important;
  --background-default-color-bg-strong: 34 42 22 !important;
}

/* ------------------------------------------------------------------ */
/* Crypto Junkie menus                                               */
/* ------------------------------------------------------------------ */

/* Sidebar: green-lit glass instead of a flat violet-ish panel. */
nav[class*="border-r"] {
  background-color: var(--t-bg-secondary) !important;
  background-image:
    linear-gradient(180deg, rgb(151 190 48 / 0.1), transparent 32%, transparent 72%, rgb(151 190 48 / 0.06)),
    radial-gradient(120% 50% at 0% 0%, rgb(151 190 48 / 0.09), transparent 62%);
  border-right-color: rgb(151 190 48 / 0.2) !important;
}

/* Section toggles (Agent / Explore / Build / Platform / Resources) */
nav button[class*="opacity-70"] {
  color: var(--cj-green-bright) !important;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 11px;
  font-weight: 600;
  opacity: 1;
}

nav button[class*="opacity-70"]:hover {
  color: #dcf59a !important;
  background-color: rgb(151 190 48 / 0.08) !important;
}

/* Active menu row gets the brand rail. */
nav button[class*="bg-background-magic-color-bg-magic-muted-hover"] {
  color: #eaf7cd !important;
  box-shadow: inset 2px 0 0 0 var(--cj-green-bright);
}

nav button[class*="bg-background-magic-color-bg-magic-muted-hover"]:hover {
  background-color: rgb(151 190 48 / 0.16) !important;
}

/* Badges stay readable now that "magic" is a light green. */
[class*="bg-background-magic-color-bg-magic"][class*="text-white"] {
  color: #0b0e05 !important;
}

/* Connect wallet CTA */
nav button[data-cj-reown="connect"] {
  background: linear-gradient(96deg, #b6dc3f, #8dbb28) !important;
  color: #0b0e05 !important;
  font-weight: 600;
  box-shadow:
    0 10px 24px rgb(151 190 48 / 0.22),
    inset 0 1px 0 rgb(255 255 255 / 0.3);
}

nav button[data-cj-reown="connect"]:hover {
  background: linear-gradient(96deg, #cded5f, #9ccb30) !important;
}

/* Floating Crypto Junkie orb in brand green. */
button[class*="size-[72px]"]:has(> img[src="/brand/logo-mark.svg"]) {
  background: linear-gradient(150deg, #b6dc3f, #97be30 55%, #4f6b12) !important;
  box-shadow:
    0 14px 30px rgb(151 190 48 / 0.28),
    inset 0 1px 0 rgb(255 255 255 / 0.28);
}

/* Cards and banners ship violet/blue SVG blobs; repaint them in brand tones. */
svg path[fill="#8B5CF6"],
svg path[fill="#8b5cf6"] {
  fill: var(--cj-green);
}

svg path[fill="#0433FF"],
svg path[fill="#0433ff"] {
  fill: #2f4710;
}

svg path[fill="#FF5D38"],
svg path[fill="#ff5d38"] {
  fill: #ff6a2f;
}

svg [fill="#8B5CF6"],
svg [fill="#A78BFA"] {
  fill: var(--cj-green-bright);
}

/* Coinbase banner keeps its split layout but in flare + brand green. */
div.absolute.inset-0[style*="234, 106, 69"] {
  background: linear-gradient(96deg, #ff6a2f 0%, #ff6a2f 13%, #2f4710 58%, #97be30 100%) !important;
}

/* Promo-card brand stickers (painted from --cj-icon set in motion.js) */
div.h-24[style*="--cj-icon"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 54px;
  height: 54px;
  margin-top: -27px;
  border-radius: 17px;
  border: 1.5px solid rgba(151, 190, 48, 0.55);
  background-color: #0b0f06;
  background-image: var(--cj-icon), radial-gradient(120% 120% at 18% 0%, #202c12 0%, #0b0f06 68%);
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: 74% 74%, cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), inset 0 0 16px rgba(151, 190, 48, 0.18);
  transform: rotate(-3deg);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  pointer-events: none;
}

/* The scraped Coinbase logo came through as a blank placeholder. */
div.h-24 img[alt="Coinbase" i] {
  display: none !important;
}

/* ...so its separator had nothing left to divide. */
div.h-24 div.h-10.w-px {
  display: none !important;
}

div.h-24[style*="--cj-icon"]:hover::after {
  transform: rotate(0deg) translateY(-2px);
  border-color: rgba(182, 220, 63, 0.85);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), inset 0 0 18px rgba(182, 220, 63, 0.28);
}

@media (max-width: 640px) {
  div.h-24[style*="--cj-icon"]::after {
    right: 10px;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    border-radius: 14px;
  }
}

/* Feature animation: CTA glow */

.cj-cta {
  position: relative;
  isolation: isolate;
}

.cj-cta::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  z-index: -1;
  background: linear-gradient(120deg, var(--cj-green), var(--cj-green-bright) 55%, var(--cj-flare));
  opacity: 0;
  filter: blur(9px);
  transition: opacity 220ms ease;
  pointer-events: none;
}

.cj-cta:hover::after {
  opacity: 0.75;
}

@media (max-width: 640px) {
  #cj-goo-bg .cj-bg-particles {
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  #cj-goo-bg .cj-bg-mark,
  #cj-goo-edge .cj-edge-blob,
  .cj-hero-art::before,
  img[src="/brand/logo-mark.svg"],
  a:hover img[src="/brand/logo-mark.svg"],
  button:has(> img[src="/brand/logo-mark.svg"]) img[src="/brand/logo-mark.svg"] {
    animation: none !important;
  }
}
