/* ============================================================
 * ZEXO banner — paste this whole file into your Ghost theme
 * e.g. content/themes/<your-theme>/assets/css/zexo-banner.css
 *
 * Then include once in default.hbs (above </head>):
 *   <link rel="stylesheet" href="{{asset "css/zexo-banner.css"}}">
 *
 * After that, post HTML cards only need the <div class="zx-banner">
 * markup — no <style> tag.
 *
 * All rules are scoped to .zx-banner / .zx-* so nothing leaks.
 * ============================================================ */

/* Reset Ghost/theme link styling inside our banner */
.zx-banner a,
.zx-banner a:link,
.zx-banner a:visited,
.zx-banner a:hover,
.zx-banner a:focus,
.zx-banner a:active {
  text-decoration: none !important;
  color: inherit !important;
  border-bottom: 0 !important;
  background-image: none !important;
}
.zx-banner, .zx-banner *, .zx-banner *::before, .zx-banner *::after { box-sizing: border-box; }

.zx-banner {
  --zx-bg: #020205;
  --zx-mask: #07080b;
  --zx-border: rgba(250,250,250,0.10);
  --zx-accent: #4509d6;

  position: relative !important;
  width: 100%;
  max-width: 100%;
  margin: 28px 0;
  padding: 28px 28px 64px;
  border-radius: 16px;
  background: var(--zx-bg);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  color: #f4f4f6;
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 30px 80px -30px rgba(0,0,0,0.9);
}

/* ---- Header bar (logo left, social right) ---- */
.zx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  min-height: 28px;
}
.zx-social-bar {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.zx-banner a.zx-social-link {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  color: rgba(255,255,255,0.55) !important;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.zx-banner a.zx-social-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
.zx-banner a.zx-social-link svg {
  width: 16px; height: 16px;
  fill: currentColor;
}

/* ---- Animated wave background ---- */
.zx-bg {
  position: absolute; inset: -12%;
  z-index: -1;
  pointer-events: none;
  filter: blur(44px) saturate(110%);
}
.zx-blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0.9;
  will-change: transform;
}
.zx-b1 {
  width: 70%; height: 130%; left: -10%; top: -30%;
  background: radial-gradient(circle, #1b2d36 0%, #0d1820 35%, transparent 65%);
  animation: zx-wave1 24s ease-in-out infinite;
}
.zx-b2 {
  width: 60%; height: 110%; right: -15%; top: -10%;
  background: radial-gradient(circle, #243843 0%, #111e25 40%, transparent 70%);
  animation: zx-wave2 30s ease-in-out infinite;
}
.zx-b3 {
  width: 80%; height: 90%; left: 10%; bottom: -30%;
  background: radial-gradient(circle, #18262e 0%, #0a1218 40%, transparent 70%);
  animation: zx-wave3 20s ease-in-out infinite;
}
.zx-b4 {
  width: 38%; height: 70%; left: -8%; bottom: -15%;
  background: radial-gradient(circle, rgba(69,9,214,0.45) 0%, rgba(69,9,214,0.18) 35%, transparent 65%);
  animation: zx-wave4 28s ease-in-out infinite;
}
.zx-b5 {
  width: 30%; height: 55%; right: -5%; bottom: -10%;
  background: radial-gradient(circle, rgba(69,9,214,0.32) 0%, transparent 60%);
  animation: zx-wave3 22s ease-in-out infinite reverse;
}
@keyframes zx-wave1 {
  0%,100% { transform: translate(0,0) scale(1) rotate(0deg); }
  33%     { transform: translate(10%,8%) scale(1.18) rotate(22deg); }
  66%     { transform: translate(-6%,12%) scale(.94) rotate(-18deg); }
}
@keyframes zx-wave2 {
  0%,100% { transform: translate(0,0) scale(1) rotate(0deg); }
  40%     { transform: translate(-12%,10%) scale(1.22) rotate(-28deg); }
  75%     { transform: translate(6%,-8%) scale(.88) rotate(18deg); }
}
@keyframes zx-wave3 {
  0%,100% { transform: translate(0,0) scale(1) rotate(0deg); }
  50%     { transform: translate(8%,-14%) scale(1.12) rotate(34deg); }
}
@keyframes zx-wave4 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(14%,-10%) scale(1.3); }
}

/* Soft top sheen + bottom vignette */
.zx-banner::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(120% 100% at 50% 110%, rgba(0,0,0,0.7), transparent 60%);
}
.zx-banner > *:not(.zx-bg):not(.zx-tags) { position: relative; z-index: 1; }
.zx-banner > .zx-tags { position: absolute; z-index: 1; }

/* ---- Logo (now in header bar, left-aligned) ---- */
.zx-banner img.zx-logo,
.zx-banner figure img.zx-logo {
  display: block !important;
  margin: 0 !important;
  height: 26px !important;
  width: auto !important;
  max-width: 140px !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  filter: brightness(0) invert(1)
          drop-shadow(0 0 12px rgba(255,255,255,0.28))
          drop-shadow(0 0 16px rgba(69,9,214,0.4));
}

/* ---- Footer tag row — absolutely pinned to banner bottom edge ---- */
.zx-banner .zx-tags {
  position: absolute !important;
  left: 28px !important;
  right: 28px !important;
  bottom: 14px !important;
  top: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 !important;
  padding: 0;
  font-family: ui-monospace, "JetBrains Mono", "Fira Code", "Roboto Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.zx-tag { white-space: nowrap; }
.zx-tag-sep { display: none; }
@keyframes zx-pulse { 50% { opacity: 0.3; } }

.zx-title {
  margin: 0 !important;
  display: grid !important;
  place-items: center;
  font-weight: 600;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
  min-height: 1.3em;
  text-align: center;
  /* Pop-in tuning */
  --zx-pop-dur: 800ms;
  --zx-pop-stagger: 90ms;
  --zx-pop-distance: 8px;
  --zx-pop-blur: 6px;
  --zx-pop-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}
.zx-phrase {
  grid-area: 1 / 1;
  /* Solid white text — reliable across Ghost themes (no background-clip:text dependency) */
  color: #f4f4f6;
  text-shadow: 0 0 18px rgba(255,255,255,0.15);
  /* By default only the first phrase is visible. */
  opacity: 0;
  animation: zx-phrase-fade 16s infinite both !important;
  animation-delay: var(--zx-pd, 0s) !important;
}
.zx-phrase:nth-child(1) { --zx-pd: 0s; }
.zx-phrase:nth-child(2) { --zx-pd: 4s; }
.zx-phrase:nth-child(3) { --zx-pd: 8s; }
.zx-phrase:nth-child(4) { --zx-pd: 12s; }

.zx-word {
  display: inline-block !important;
  /* Words only animate motion (transform + blur). Opacity is controlled by phrase. */
  animation: zx-word-pop 16s infinite both !important;
  animation-delay: calc(var(--zx-pd, 0s) + var(--zx-s, 0) * var(--zx-pop-stagger, 70ms)) !important;
  will-change: transform, filter;
}
/* Stagger via :nth-child so it survives Ghost stripping inline style attrs */
.zx-word:nth-child(1) { --zx-s: 0; }
.zx-word:nth-child(2) { --zx-s: 1; }
.zx-word:nth-child(3) { --zx-s: 2; }
.zx-word:nth-child(4) { --zx-s: 3; }
.zx-word:nth-child(5) { --zx-s: 4; }
.zx-word:nth-child(6) { --zx-s: 5; }
.zx-word:nth-child(7) { --zx-s: 6; }
.zx-word:nth-child(8) { --zx-s: 7; }

/* Phrase fade: short quick ramp so the per-word opacity drives the wave feel */
@keyframes zx-phrase-fade {
  0%, 100% { opacity: 0; }
  3%       { opacity: 1; }
  25%      { opacity: 1; }
  29%      { opacity: 0; }
}
/* Word pop-in: each word fades in WITH its translate+blur, so long phrases reveal word-by-word instead of all-visible-then-wave */
@keyframes zx-word-pop {
  0% {
    opacity: 0;
    transform: translateY(var(--zx-pop-distance, 8px));
    filter: blur(var(--zx-pop-blur, 6px));
    animation-timing-function: var(--zx-pop-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
  }
  9% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    animation-timing-function: linear;
  }
  22% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    animation-timing-function: cubic-bezier(0.4, 0, 0.7, 0.3);
  }
  28% {
    opacity: 0;
    transform: translateY(-4px);
    filter: blur(var(--zx-pop-blur, 6px));
  }
  100% {
    opacity: 0;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Sub-text: gentle opacity breathing */
.zx-sub-anim {
  display: inline-block;
  animation: zx-breath 6s ease-in-out infinite;
}
@keyframes zx-breath {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.85; }
}
.zx-sub {
  margin: 10px auto 22px;
  max-width: 460px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.55);
}

/* ---- Actions ---- */
.zx-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  align-items: stretch;
  gap: 12px;
  margin: 0 auto;
  max-width: 720px;
}
/* Visually separate primary from the secondary cluster */
.zx-actions > .zx-primary { margin-right: 28px; }

/* ---- Zipmex button (square, gradient border, conic glow) ---- */
.zx-btn {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--zx-border);
  background: transparent;
  isolation: isolate;
  font-family: inherit;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform .25s ease;
}
.zx-btn:hover { transform: translateY(-1px); }

.zx-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.zx-main {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  /* Gradient-clip lives on the text element so children render */
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 60%, rgba(255,255,255,0.5) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.zx-desc {
  font-family: ui-monospace, "JetBrains Mono", "Fira Code", "Roboto Mono", monospace;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.zx-arrow {
  width: 13px; height: 13px;
  stroke: rgba(255,255,255,0.7);
  transition: transform .2s ease, stroke .2s ease;
}
.zx-btn:hover .zx-arrow { transform: translateX(3px); stroke: #fff; }

/* Layered fills */
.zx-fill {
  position: absolute; inset: -1px; z-index: -2;
  border-radius: inherit;
  background: linear-gradient(135deg, #fff 0%, transparent 32%);
}
.zx-mask {
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  background: var(--zx-mask);
}
.zx-radial {
  position: absolute; inset: -1px; z-index: -2;
  border-radius: inherit;
  background: radial-gradient(90% 90% at 0% 0%, rgba(255,255,255,0.55), transparent 55%);
  opacity: 0.25;
  transition: opacity .6s ease;
  pointer-events: none;
}
.zx-btn:hover .zx-radial { opacity: 0.5; }

/* Conic glow — always rotating, faint at rest, bright on hover */
.zx-conic-wrap {
  position: absolute; inset: -1px; z-index: -3;
  border-radius: inherit;
  opacity: 0.18;
  transition: opacity .5s ease;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.28));
  pointer-events: none;
}
.zx-btn:hover .zx-conic-wrap { opacity: 1; }
.zx-conic {
  position: absolute; inset: 0;
  border-radius: inherit;
  overflow: hidden;
}
.zx-conic::before {
  content: "";
  position: absolute; inset: -100%;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    rgba(255,255,255,0.85) 50deg,
    transparent 110deg,
    transparent 230deg,
    rgba(255,255,255,0.6) 290deg,
    transparent 360deg);
  animation: zx-rot 8s linear infinite;
}
.zx-btn:hover .zx-conic::before { animation-duration: 3s; }
@keyframes zx-rot { to { transform: rotate(360deg); } }

/* Primary: bigger + brighter resting glow, purple accent halo */
.zx-primary { padding: 13px 20px; border-radius: 12px; }
.zx-primary .zx-main { font-size: 15px; font-weight: 700; }
.zx-primary .zx-desc { font-size: 10px; color: rgba(255,255,255,0.62); }
.zx-primary .zx-conic-wrap {
  opacity: 0.7;
  filter: drop-shadow(0 0 12px rgba(69,9,214,0.55)) drop-shadow(0 0 4px rgba(255,255,255,0.3));
}
.zx-primary .zx-conic::before {
  background: conic-gradient(from 0deg,
    transparent 0deg,
    rgba(255,255,255,0.85) 40deg,
    rgba(140,80,255,0.9) 80deg,
    transparent 130deg,
    transparent 220deg,
    rgba(69,9,214,0.9) 270deg,
    rgba(255,255,255,0.6) 310deg,
    transparent 360deg);
  animation-duration: 6s;
}
.zx-primary .zx-radial {
  opacity: 0.5;
  background: radial-gradient(90% 90% at 0% 0%, rgba(255,255,255,0.55), transparent 50%),
              radial-gradient(80% 80% at 100% 100%, rgba(69,9,214,0.45), transparent 55%);
}
.zx-primary:hover .zx-radial { opacity: 0.75; }
.zx-primary:hover .zx-conic-wrap { opacity: 1; }

/* ---- Mobile ---- */
@media (max-width: 720px) {
  .zx-banner { padding: 22px 24px 22px !important; }
  .zx-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .zx-actions > .zx-primary { margin-right: 0; }
  /* On mobile, drop tags back to normal flow under the buttons */
  .zx-banner .zx-tags {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 20px 0 0 !important;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 8px;
    column-gap: 18px;
  }
  /* All four buttons equal in a 2×2 grid */
  .zx-primary {
    grid-column: auto;
    padding: 12px 14px;
    border-radius: 10px;
  }
  .zx-primary .zx-main { font-size: 14px; font-weight: 600; }
  .zx-primary .zx-desc { font-size: 9.5px; }
  .zx-arrow { display: none; }
}
@media (max-width: 640px) {
  .zx-banner { padding: 22px 18px 20px !important; }
  .zx-logo { height: 26px !important; margin-bottom: 12px !important; }
  .zx-title { font-size: 28px; }
  .zx-sub { font-size: 13px; margin-bottom: 20px; }
  /* Even 2×2 grid */
  .zx-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .zx-btn, .zx-primary { padding: 12px 14px; border-radius: 10px; }
  .zx-primary .zx-main { font-size: 14px; }
  .zx-primary .zx-desc { font-size: 9.5px; }
  .zx-arrow { display: none; }
}
@media (max-width: 420px) {
  .zx-stack { align-items: center; text-align: center; }
  .zx-header { flex-direction: row; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .zx-blob, .zx-conic::before, .zx-phrase, .zx-word, .zx-sub-anim { animation: none !important; }
  .zx-conic-wrap { opacity: 0 !important; }
  .zx-phrase { opacity: 0 !important; }
  .zx-phrase:first-child { opacity: 1 !important; }
}
