/* ============================================================
   Rafail — personal card. Dark minimalism.
   ============================================================ */

:root {
  --bg: #0a1322;
  --bg-soft: #0f1e30;
  --surface: rgba(120, 180, 245, 0.05);
  --surface-hover: rgba(120, 185, 250, 0.09);
  --line: rgba(140, 190, 245, 0.16);
  --line-strong: rgba(150, 200, 255, 0.3);
  --text: #eaf2fb;
  --text-dim: #9db2ca;
  --text-faint: #647a94;
  --accent: #33b4ff; /* electric cyan-blue — the single accent */
  --accent-strong: #6fcbff;
  --accent-soft: rgba(51, 180, 255, 0.18);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);

  --radius: 14px;
  --maxw: 460px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  /* steals.top-style: navy base + corner glow + central bloom */
  background:
    radial-gradient(780px 560px at 6% 0%, rgba(38, 150, 240, 0.3), transparent 55%),
    radial-gradient(900px 620px at 94% 4%, rgba(34, 120, 210, 0.16), transparent 55%),
    radial-gradient(1000px 720px at 50% 34%, rgba(30, 110, 200, 0.16), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Space Grotesk", "Helvetica Neue", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ---- ambient layers ------------------------------------- */

/* soft light blob that eases toward the cursor via rAF (see script.js) */
.glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle,
    rgba(70, 190, 255, 0.28) 0%,
    rgba(55, 175, 255, 0.12) 32%,
    rgba(45, 110, 200, 0.07) 55%,
    transparent 72%
  );
  filter: blur(28px);
  will-change: transform;
  transform: translate3d(50vw, 40vh, 0);
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
.glow.is-ready {
  opacity: 1;
}

/* faint tech grid for depth — fixed, non-interactive (steals.top vibe) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: linear-gradient(
      rgba(120, 175, 235, 0.045) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(120, 175, 235, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  /* fade the grid out toward the edges so it reads as ambient texture */
  -webkit-mask-image: radial-gradient(120% 90% at 50% 20%, #000 35%, transparent 80%);
  mask-image: radial-gradient(120% 90% at 50% 20%, #000 35%, transparent 80%);
}

/* ---- layout --------------------------------------------- */

.wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 6rem) 1.5rem 2.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.75rem;
}

/* ---- identity badge (top pill) -------------------------- */

.badge {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 1.15rem 0.4rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(70, 160, 250, 0.14),
    rgba(255, 255, 255, 0.02)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 30px rgba(20, 90, 190, 0.22);
  backdrop-filter: blur(6px);
}

.badge__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(150, 200, 255, 0.35);
  /* fallback tint if the photo is missing */
  background: radial-gradient(circle at 35% 30%, #2a6fb0, #0d2036);
  box-shadow: 0 0 0 3px rgba(51, 180, 255, 0.12);
}
.badge__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.badge__name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: #f2f8ff;
  padding-right: 0.2rem;
}

/* ---- link rows ------------------------------------------ */

.links {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.link {
  --pad: 1rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: var(--pad) 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out),
    transform 0.4s var(--ease-out);
}

.link::before {
  /* accent wash that fades in from the icon side on hover */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent 55%);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
  pointer-events: none;
}

.link__icon {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-dim);
  transition: color 0.4s var(--ease-out), border-color 0.4s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.link__icon svg {
  width: 20px;
  height: 20px;
}

.link__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.link__title {
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.link__sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-faint);
  transition: color 0.4s var(--ease-out);
}

.link__arrow {
  position: relative;
  margin-left: auto;
  color: var(--text-faint);
  display: grid;
  place-items: center;
  transition: color 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
.link__arrow svg {
  width: 18px;
  height: 18px;
}

/* hover (fine pointers only) */
@media (hover: hover) and (pointer: fine) {
  .link:hover {
    border-color: var(--line-strong);
    background: var(--surface-hover);
    transform: translateY(-2px);
  }
  .link:hover::before {
    opacity: 1;
  }
  .link:hover .link__icon {
    color: var(--accent);
    border-color: rgba(53, 182, 255, 0.4);
    transform: translateY(-1px);
  }
  .link:hover .link__sub {
    color: var(--text-dim);
  }
  .link:hover .link__arrow {
    color: var(--accent);
    transform: translate(3px, -3px);
  }
}

.link:active {
  transform: scale(0.985);
}

.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- wallet --------------------------------------------- */

.wallet {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.15rem;
}

.wallet__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.wallet__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--accent);
}
.wallet__icon svg {
  width: 21px;
  height: 21px;
}

.wallet__meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.wallet__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.wallet__note {
  font-size: 0.74rem;
  color: var(--text-faint);
}

.wallet__badge {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(53, 182, 255, 0.3);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.wallet__address {
  width: 100%;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(5, 12, 22, 0.4);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out),
    transform 0.2s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .wallet__address:hover {
    border-color: rgba(51, 180, 255, 0.45);
    background: rgba(51, 180, 255, 0.07);
  }
}
.wallet__address:active {
  transform: scale(0.99);
}
.wallet__address:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.wallet__address.is-copied .wallet__copy-ico {
  opacity: 0;
  transform: scale(0.6);
}
.wallet__address.is-copied .wallet__check-ico {
  opacity: 1;
  transform: scale(1);
}
.wallet__address code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}
.wallet__copy {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: color 0.3s var(--ease-out);
}
.wallet__address:hover .wallet__copy {
  color: var(--accent);
}
.wallet__copy svg {
  grid-area: 1 / 1;
  width: 17px;
  height: 17px;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.wallet__check-ico {
  opacity: 0;
  transform: scale(0.6);
  color: var(--accent);
}

.wallet__copied {
  display: block;
  height: 0.9rem;
  margin-top: 0.55rem;
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.wallet__copied.is-shown {
  opacity: 1;
  transform: translateY(0);
}

/* ---- entrance stagger ----------------------------------- */

.badge,
.link,
.wallet {
  opacity: 0;
  transform: translateY(14px);
}
body.is-loaded .badge,
body.is-loaded .link,
body.is-loaded .wallet {
  animation: rise 0.7s var(--ease-soft) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 60ms);
}
body.is-loaded .badge {
  --i: 0;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- reduced motion ------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .glow {
    display: none;
  }
  .badge,
  .link,
  .wallet {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}
