/* =========================================================
   Components: buttons, glass, header, checks, CA card, toast
   ========================================================= */

/* ---------- Glass surface (Hooked's card treatment) ---------- */
.glass {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
}

/* ---------- Buttons ---------- */
.btn {
  --h: 52px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.985); }

.btn-lure {
  color: #fff;
  background: var(--lure);
  box-shadow:
    inset 0 1px 0 #ffffff80,
    inset 0 -10px 18px #28001e40,
    0 14px 34px -10px #e0197da6;
}
.btn-lure::after {
  /* sheen sweep on hover */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, #ffffff40 48%, transparent 66%);
  background-size: 250% 100%;
  background-position: 120% 0;
  transition: background-position .6s var(--ease);
  pointer-events: none;
}
.btn-lure:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 #ffffff80,
    inset 0 -10px 18px #28001e40,
    0 20px 44px -10px #e0197dcc;
}
.btn-lure:hover::after { background-position: -40% 0; }

.btn-glass {
  color: var(--ink);
  background: #ffffff0f;
  border: 1px solid #ffffff29;
  box-shadow: inset 0 1px 0 #ffffff1a;
}
.btn-glass:hover { background: #ffffff1a; border-color: #ffffff40; transform: translateY(-1px); }

.btn-sm { --h: 40px; padding: 0 16px; font-size: 15px; border-radius: 14px; }
.btn-lg { --h: 60px; padding: 0 28px; font-size: 17px; border-radius: 18px; }
.btn-block { width: 100%; }

/* Button feedback when a wallet action is pressed */
.btn.is-pinged { animation: ping-press .5s var(--ease); }
@keyframes ping-press {
  0% { transform: scale(1); }
  35% { transform: scale(.96); }
  100% { transform: scale(1); }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--ink2);
  transition: color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--ink); background: #ffffff0f; }

.text-link {
  display: inline-flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.text-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding: 14px var(--gutter);
  pointer-events: none;
}
.site-header .bar {
  pointer-events: auto;
  max-width: calc(var(--wrap) - 2 * 0px);
  margin-inline: auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 8px 0 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(#ffffff12, #ffffff08);
  border: 1px solid #ffffff17;
  box-shadow: inset 0 1px 0 #ffffff14, 0 20px 40px -24px #000000e6;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transition: background-color .3s;
}
.site-header.is-scrolled .bar { background: #0d0b14d9; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-mark { width: auto; height: 30px; }
.logo-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.03em;
  line-height: 1;
}
.logo-tag {
  margin-left: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--lure);
  box-shadow: inset 0 1px 0 #ffffff66;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink2);
  transition: color .2s, background-color .2s;
}
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); background: #ffffff0d; }
.nav .nav-ext { color: var(--ink3); }

.bar-end {
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #ffffff29;
  background: #ffffff0f;
  place-items: center;
}
.menu-lines,
.menu-lines::before,
.menu-lines::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .25s var(--ease), opacity .2s;
}
.menu-lines { position: relative; }
.menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
.menu-lines::before { top: -5px; }
.menu-lines::after { top: 5px; }
.menu-btn[aria-expanded="true"] .menu-lines { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-lines::before { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-lines::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav a:not(.nav-ext) { padding: 8px 9px; font-size: 14px; }
}
@media (max-width: 980px) {
  .menu-btn { display: grid; }
  .nav {
    position: absolute;
    top: calc(100% + 8px);
    left: var(--gutter);
    right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border-radius: var(--r-lg);
    background: #0d0b14f5;
    border: 1px solid #ffffff17;
    box-shadow: 0 30px 60px -20px #000;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s, transform .25s var(--ease), visibility 0s .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .25s var(--ease); }
  .nav a, .nav a:not(.nav-ext) { padding: 12px 14px; font-size: 16px; }
  .bar-end { margin-left: auto; }
}
@media (max-width: 520px) {
  .site-header { padding: 10px 12px; }
  .site-header .bar { padding: 0 6px 0 12px; gap: 10px; }
  .logo-word { font-size: 17px; }
  .logo-tag { display: none; }
  .bar-end .icon-btn { display: none; }
  .bar-end .btn-sm { padding: 0 12px; font-size: 14px; }
}

/* ---------- Pass / refuse checks (Hooked's hook verdict language) ---------- */
.ck {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 6px;
}
.pass .ck, .ck.pass-ck { background: #3dffa21f; box-shadow: inset 0 0 0 1px #3dffa259; }
.refuse .ck, .ck.refuse-ck { background: #ff4d5e1f; box-shadow: inset 0 0 0 1px #ff4d5e59; }
.pass .ck::before {
  content: "";
  width: 8px; height: 4px;
  border: solid var(--pass);
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
.refuse .ck::before, .refuse .ck::after,
.ck.refuse-ck::before, .ck.refuse-ck::after {
  content: "";
  position: absolute;
  width: 9px; height: 2px;
  border-radius: 1px;
  background: var(--refuse);
  transform: rotate(45deg);
}
.refuse .ck::after, .ck.refuse-ck::after { transform: rotate(-45deg); }

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink2);
}
.checks li { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Pills / dots ---------- */
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pass);
  box-shadow: 0 0 10px var(--pass);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pill-sealed { color: #ffd3c2; background: #ff6a3d1a; box-shadow: inset 0 0 0 1px #ff6a3d4d; }
.pill-sealed .dot { background: var(--coral); box-shadow: 0 0 10px var(--coral); animation: blink 1.6s steps(2, jump-none) infinite; }
.pill-open { color: var(--pass); background: #3dffa21a; box-shadow: inset 0 0 0 1px #3dffa24d; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- CA card (mirrors hookedpad.com's "$HOOKED is live" card) ---------- */
.ca-card {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  padding: 12px 12px 12px 14px;
  border-radius: 18px;
}
.ca-img { width: 44px; height: 44px; border-radius: 12px; }
.ca-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ca-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}
.copy-addr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--ink2);
  text-align: left;
}
.copy-addr:hover { color: var(--ink); }
.copy-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-ico { flex-shrink: 0; opacity: .7; }
.copy-addr.is-copied { color: var(--pass); }
.ca-links { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 520px) {
  .ca-card { flex-wrap: wrap; }
  .ca-links { width: 100%; }
  .ca-links .btn { flex: 1; }
}

/* ---------- Redacted values (sealed readout) ---------- */
.redact {
  position: relative;
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  color: transparent;
  user-select: none;
  background:
    repeating-linear-gradient(-45deg, #ffffff1f 0 4px, #ffffff0a 4px 8px);
  box-shadow: inset 0 0 0 1px #ffffff17;
  overflow: hidden;
}
.redact::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #ff2e9333, transparent);
  transform: translateX(-100%);
  animation: redact-sweep 3.2s var(--ease) infinite;
}
@keyframes redact-sweep {
  60%, 100% { transform: translateX(100%); }
}

/* ---------- Toast (placeholder wallet feedback) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: #15101ff2;
  border: 1px solid #ffffff29;
  box-shadow: 0 30px 60px -20px #000, inset 0 1px 0 #ffffff14;
  font-size: 14px;
  font-weight: 600;
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity .25s, transform .35s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast .mono { font-size: 12px; color: var(--ink3); }

/* ---------- Scroll reveal (class added by js/ui.js, so no-JS stays visible) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
