/* ==========================================================================
   Shared components: buttons, nav, tags, marquee, toast, bubbles
   ========================================================================== */

/* ---------- Buttons (comic "pop" style) ---------- */

.btn {
  --btn-bg: var(--volt-400);
  --btn-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--pop);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.2s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:focus-visible {
  outline: 3px solid var(--cream-50);
  outline-offset: 4px;
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

.btn--volt {
  background-image: linear-gradient(180deg, var(--volt-300), var(--volt-500));
}

.btn--volt .btn__lock {
  transition: transform 0.3s var(--ease-spring);
}

.btn--volt:hover .btn__lock {
  transform: rotate(-12deg) translateY(-1px);
}

.btn--lg {
  min-height: 60px;
  padding: 0.95rem 1.9rem;
  font-size: clamp(1.35rem, 1.9vw, 1.6rem);
  border-radius: 16px;
}

.btn--sm {
  min-height: 42px;
  padding: 0.5rem 1rem;
  font-size: 1.05rem;
  box-shadow: var(--pop-sm);
}

.btn--sm:hover {
  box-shadow: 5px 5px 0 var(--ink);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--cream-100);
  border-color: rgba(255, 244, 224, 0.55);
  box-shadow: none;
}

.btn--ghost:hover {
  --btn-bg: rgba(255, 244, 224, 0.08);
  border-color: var(--cream-100);
  box-shadow: none;
}

.btn--ink {
  --btn-bg: var(--ink);
  --btn-fg: var(--cream-50);
}

.btn--cream {
  --btn-bg: var(--cream-50);
}

.btn--block {
  width: 100%;
}

.btn--chip {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  font-size: 1rem;
  border-width: 2px;
  box-shadow: var(--pop-sm);
}

.btn--chip:hover {
  box-shadow: 4px 4px 0 var(--ink);
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cream-50);
}

.brand__shield {
  width: 34px;
  height: 36px;
  flex: none;
  transition: transform 0.35s var(--ease-spring);
}

.brand:hover .brand__shield {
  transform: rotate(-8deg) scale(1.08);
}

.brand__word {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.brand__tick {
  padding: 0.18rem 0.45rem 0.12rem;
  border-radius: 6px;
  background: var(--cape-500);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease;
}

.nav.is-scrolled {
  background: rgba(8, 21, 54, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(255, 244, 224, 0.08);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
}

.nav__links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav__links a {
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  color: rgba(255, 244, 224, 0.82);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav__links a:hover {
  color: var(--cream-50);
  background: rgba(255, 244, 224, 0.08);
}

@media (max-width: 960px) {
  .nav__links {
    display: none;
  }
}

@media (max-width: 420px) {
  .brand__tick {
    display: none;
  }

  .nav .btn--sm {
    padding-inline: 0.8rem;
    font-size: 0.98rem;
  }
}

/* ---------- Tags, chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.85rem 0.4rem 0.5rem;
  border: 2px solid rgba(255, 244, 224, 0.2);
  border-radius: 999px;
  background: rgba(8, 21, 54, 0.55);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-100);
}

.chip b {
  color: var(--volt-400);
}

.chip__ai {
  position: relative;
  color: rgba(255, 244, 224, 0.55);
}

.chip__ai::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 2px;
  background: var(--cape-400);
  transform: rotate(-12deg);
}

.chip__badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cape-500);
}

.chip__badge svg {
  width: 14px;
  height: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--volt-400);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}

.tag--red {
  background: var(--cape-500);
  color: var(--cream-50);
}

.tag--ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

/* Redaction bars: hidden wallet-specific values */
.redacted {
  position: relative;
  display: inline-block;
  width: 7.5rem;
  height: 1.15em;
  vertical-align: middle;
  border-radius: 4px;
  background: repeating-linear-gradient(-45deg, #0a1438 0 8px, #111f4f 8px 16px);
  overflow: hidden;
}

.redacted::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 210, 63, 0.3), transparent);
  transform: translateX(-100%);
  animation: redact-shimmer 2.6s ease-in-out infinite;
}

.redacted--long { width: 10rem; }
.redacted--xl { width: 12.5rem; }

@keyframes redact-shimmer {
  60%, 100% { transform: translateX(100%); }
}

/* ---------- Marquee (cape banner) ---------- */

.marquee {
  position: relative;
  z-index: 3;
  overflow: hidden;
  border-block: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--cape-500), var(--cape-600));
  transform: rotate(-1.4deg);
  margin-inline: -2vw;
  box-shadow: 0 10px 0 rgba(6, 11, 34, 0.35);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee__group {
  display: flex;
  align-items: center;
  flex: none;
}

.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cream-50);
}

.marquee__item::after {
  content: "";
  width: 0.8em;
  height: 0.8em;
  background: var(--volt-400);
  clip-path: polygon(50% 0, 61% 36%, 100% 38%, 69% 60%, 80% 100%, 50% 76%, 20% 100%, 31% 60%, 0 38%, 39% 36%);
}

.marquee__item em {
  font-style: inherit;
  color: var(--volt-400);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Speech bubble ---------- */

.bubble {
  position: relative;
  padding: 0.7rem 0.95rem;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--cream-50);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.1;
  text-transform: uppercase;
  box-shadow: var(--pop-sm);
}

.bubble::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--cream-50);
  border: 3px solid var(--ink);
  border-top: 0;
  border-left: 0;
}

.bubble--left::after {
  left: -11px;
  top: 50%;
  transform: translateY(-50%) rotate(135deg);
}

.bubble--down::after {
  left: 28px;
  bottom: -11px;
  transform: rotate(45deg);
}

.bubble.is-pop {
  animation: bubble-pop 0.45s var(--ease-spring);
}

@keyframes bubble-pop {
  0% { transform: scale(0.85) rotate(-2deg); }
  100% { transform: none; }
}

/* ---------- Toast (easter eggs, copy confirmations) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.1rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--volt-400);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--pop);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition:
    transform 0.45s var(--ease-spring),
    opacity 0.25s ease;
  pointer-events: none;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast__strike {
  text-decoration: line-through;
  text-decoration-color: var(--cape-600);
  text-decoration-thickness: 3px;
}
