:root {
  --ink: #e8ecf5;
  --subtle: #a0a8b5;
  --panel: #1e2122;
  --line: #2a2d2f;
  --muted-bg: #181a1b;
  --accent: #2f68f8;
  --chip: #24282a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.04), transparent 32%), radial-gradient(circle at 82% 0, rgba(255, 255, 255, 0.03), transparent 30%), #141416;
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

.shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  background: rgba(20, 20, 22, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  color: var(--subtle);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.nav-links a.is-active {
  color: var(--ink);
  background: #2a2d2f;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #24282a;
  color: #cfd4de;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn:hover {
  border-color: #2f68f8;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -18px rgba(0, 0, 0, 0.55);
}

.icon-btn.ghost {
  background: #1e2122;
}

.icon-lines,
.icon-plus {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
}

.icon-lines::before,
.icon-lines::after,
.icon-lines span {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
}

.icon-lines::before {
  top: 2px;
}

.icon-lines span {
  top: 8px;
}

.icon-lines::after {
  top: 14px;
}

.icon-plus::before,
.icon-plus::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
  background: currentColor;
}

.icon-plus::after {
  transform: rotate(90deg);
}

.icon-plus.rotated {
  transform: rotate(45deg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pill {
  border: 1px solid var(--line);
  background: #1e2122;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pill:hover {
  transform: translateY(-1px);
  border-color: #3b4146;
  box-shadow: 0 10px 30px -24px rgba(0, 0, 0, 0.65);
}

.pill.ghost {
  background: #24282a;
  border-color: #343a3f;
  color: var(--ink);
}

.profile-card {
  margin: 28px 0 60px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px -65px rgba(0, 0, 0, 0.75);
  position: relative;
}

.cover {
  position: relative;
  height: 280px;
  background-image: url("../images/ens-profile.png");
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 20, 22, 0.12) 0%, rgba(20, 20, 22, 0.82) 100%);
  mix-blend-mode: multiply;
}

.avatar-row {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 20px 30px;
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.follow-spot {
  margin-left: auto;
  align-self: flex-start;
  padding-top: 6px;
}

.avatar-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: -90px;
  flex: 1 1 auto;
  width: 100%;
}

.avatar-wrap {
  width: 132px;
  height: 132px;
  border-radius: 36px;
  overflow: hidden;
  background: linear-gradient(135deg, #25292b, #30363a);
  border: 6px solid #141416;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.identity {
  padding-bottom: 10px;
}

.label {
  margin: 0 0 4px;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
}

.ens-name {
  margin: 0 0 2px;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ens-bio {
  margin: 0 0 12px;
  color: #ced5de;
  max-width: 740px;
}
.ens-nick {
  margin: 0;
  color: var(--subtle);
  font-size: 0.95rem;
}

.avatar-col .ens-bio {
  margin: 0;
  max-width: 340px;
}

.avatar-col .ens-name {
  margin: 0;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink);
}

.meta-chip.muted {
  color: var(--subtle);
}

.follow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  text-decoration: none;
  min-width: 170px;
  background: #2f68f8;
  border-color: #2f68f8;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 30px -18px rgba(47, 104, 248, 0.55);
  font-weight: 700;
}

.follow-btn:hover {
  border-color: #2653c8;
  transform: translateY(-1px);
}

.profile-body {
  padding: 10px 30px 28px;
}

.section-head {
  padding: 18px 30px 6px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.timestamp {
  color: var(--subtle);
  font-size: 10px;
  margin-left: auto;
  font-weight: 500;
  margin: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.block-bricks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.block-brick {
  height: 100%;
}

.block-brick-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 8px;
}

.block-brick-meta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.block-brick-subrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.block-brick-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--muted-bg);
}

.block-brick-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 14px;
}

.block-brick-status {
  color: var(--subtle);
  font-size: 12px;
}

.block-brick-media {
  margin: 8px 0 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--muted-bg);
  min-height: 180px;
}

.block-brick-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.floating-menu {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: none;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(47, 104, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.75);
  z-index: 50;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 60;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: 90%;
  max-width: 90%;
  margin: 120px auto;
  background: #1e2122;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 24px 80px -50px rgba(0, 0, 0, 0.9);
  z-index: 1;
  max-height: 80vh;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  color: var(--ink);
  line-height: 1.6;
  max-height: calc(80vh - 70px);
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Modal-only CTA styles */
.modal-actions .ens-cta,
.modal-actions .pinata-cta {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  padding: 14px 18px;
  font-size: 1rem;
  text-align: center;
}

.modal-actions .ens-cta {
  background: #2f68f8;
  border-color: #2f68f8;
  color: #fff;
  box-shadow: 0 12px 30px -18px rgba(47, 104, 248, 0.55);
}

.modal-actions .ens-cta:hover {
  border-color: #2653c8;
}

.modal-actions .pinata-cta {
  background: linear-gradient(135deg, #8c5bff, #6a4ad8);
  border-color: #7447e6;
  color: #fff;
  box-shadow: 0 12px 30px -18px rgba(116, 71, 230, 0.55);
}

.modal-actions .pinata-cta:hover {
  border-color: #5f3bc4;
}

@media (min-width: 720px) {
  .modal-actions .ens-cta,
  .modal-actions .pinata-cta {
    flex: 1 1 calc(50% - 10px);
    padding: 16px 20px;
    font-size: 1.05rem;
  }
}

.info-block {
  padding: 14px 16px;
  background: var(--muted-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.info-value {
  margin: 4px 0 0;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  text-decoration: none;
}

.info-value a {
  color: #7fb0ff;
  text-decoration: none;
}

.info-value a:hover {
  text-decoration: underline;
}

.ens-bio a {
  color: #7fb0ff;
  text-decoration: none;
}

.ens-bio a:hover {
  text-decoration: underline;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: #24282a;
  color: var(--ink);
  border: 1px solid #343a3f;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.social-button:hover {
  border-color: #2f68f8;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -18px rgba(0, 0, 0, 0.55);
}

.market-button {
  display: none;
  padding: 12px 18px;
  background: #2f68f8;
  color: #fff;
  border: 1px solid #2f68f8;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  flex: 1 1 50%;
  text-align: center;
}

.market-button.ghost {
  background: #24282a;
  color: var(--ink);
  border-color: #343a3f;
}

.market-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -18px rgba(0, 0, 0, 0.55);
}

.support-button {
  display: inline-flex;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  flex: 1 1 100%;
  text-align: center;
}

.support-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -18px rgba(47, 104, 248, 0.55);
  border-color: #2653c8;
}

.helper {
  margin-top: 16px;
}

.muted {
  color: var(--subtle);
}

.error {
  color: #c0392b;
}

.site-footer {
  margin: 40px 0 20px;
  text-align: center;
  color: var(--subtle);
  font-size: 0.95rem;
}

.site-footer a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .site-header .shell {
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    margin: 8px 0 0;
  }

  .avatar-row {
    flex-direction: column;
    align-items: flex-start;
    margin-top: -30px;
    padding: 0 22px 20px;
  }

  .avatar-col {
    margin-top: -30px;
  }

  .follow-spot {
    margin-left: 0;
    padding-top: 0;
    width: 100%;
  }

  .follow-btn {
    width: 100%;
    justify-content: center;
  }

  .ens-name {
    font-size: 1.7rem;
  }

  .profile-body {
    padding: 10px 22px 22px;
  }

  .desktop-menu {
    display: none;
  }

  .floating-menu {
    display: inline-flex;
  }

  /* Ensure Block Bricks stays visible on mobile */
  #block-bricks {
    display: block !important;
  }

  /* Hide Block Bricks nav link on mobile */
  .nav-links a[href="#block-bricks"] {
    display: none !important;
  }
}
