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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
    "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #fff;
  background: #08090c;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
}

/* Backdrop = same image, full bleed (visible only on desktop where phone is centered) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("public/background.webp") center/cover no-repeat,
              url("public/background.jpg") center/cover no-repeat;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: -1;
}

/* ----- Mobile: full-bleed card ----- */
.card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: url("public/background.webp") center/cover no-repeat,
              url("public/background.jpg") center/cover no-repeat;
  min-height: 100dvh;
}

/* Dark overlay inside the card for legibility */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.55) 60%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.card__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 56px 24px 40px;
  min-height: 100dvh;
}

.head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-top: 8px;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  background: #2a2a2e;
}

.name {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.verified {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.bio {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  opacity: 0.88;
  max-width: 38ch;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.links {
  width: 85%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  align-self: center;
}

.link {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  column-gap: 10px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #0a0a0a;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.18s ease, background 0.18s ease;
}

.link-icon {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #1a1a1d;
  color: #fff;
  border-radius: 7px;
  flex-shrink: 0;
}

.link-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.link-text {
  grid-column: 2;
  text-align: center;
  min-width: 0;
}

.link:hover,
.link:focus-visible {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  background: #fff;
  outline: none;
}

.link:active {
  transform: translateY(0) scale(0.99);
}

/* ---- Expandable About-me pill ---- */
.link--expand {
  display: block;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.link--expand > summary {
  list-style: none;
  display: block;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 16px;
  color: #0a0a0a;
  cursor: pointer;
  border-radius: 18px;
  -webkit-user-select: none;
  user-select: none;
}

.link--expand > summary::-webkit-details-marker,
.link--expand > summary::marker {
  display: none;
  content: "";
}

.summary-row {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  column-gap: 10px;
}

.summary-row .chevron {
  grid-column: 3;
  justify-self: center;
}

.chevron {
  display: inline-block;
  width: 16px;
  height: 16px;
  color: #444;
  flex: 0 0 16px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.link--expand[open] .chevron {
  transform: rotate(180deg);
}

.about-text {
  margin: 0;
  padding: 4px 22px 18px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: #2a2a2e;
  letter-spacing: -0.005em;
  animation: aboutFade 0.25s ease;
}

@keyframes aboutFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.socials {
  display: flex;
  gap: 28px;
  margin-top: auto;
  padding-top: 16px;
}

/* iOS-style outline mini-pill: "Save Contact" */
.vcard-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  margin-top: -12px;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.vcard-btn:hover,
.vcard-btn:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  outline: none;
}

.vcard-btn svg {
  opacity: 0.85;
}

.footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  padding-bottom: 4px;
}

.legal {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.legal a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.55);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}

.legal a:hover,
.legal a:focus-visible {
  text-decoration-color: #fff;
  outline: none;
}

.legal span {
  opacity: 0.45;
}

.counter {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.counter #visit-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

.social {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.92;
  transition: opacity 0.15s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.social:hover,
.social:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
  outline: none;
}

.social svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ----- Desktop: show card inside an iPhone-like frame ----- */
@media (min-width: 768px) {
  body {
    align-items: center;
    padding: 48px 20px;
  }

  /* Blur the page backdrop so the phone pops */
  body::before {
    filter: blur(28px) brightness(0.45) saturate(1.05);
    transform: scale(1.1);
  }
  body::after {
    background: rgba(0, 0, 0, 0.45);
  }

  .card {
    width: 390px;
    max-width: 390px;
    min-height: 0;
    height: min(844px, 92vh);
    border-radius: 52px;
    overflow: hidden;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.06),
      0 0 0 12px #0c0c0e,
      0 40px 80px -20px rgba(0, 0, 0, 0.7),
      0 25px 50px -15px rgba(0, 0, 0, 0.5);
  }

  .card__inner {
    min-height: 0;
    height: 100%;
    padding: 80px 26px 36px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  }

  .card__inner::-webkit-scrollbar {
    width: 4px;
  }

  .card__inner::-webkit-scrollbar-track {
    background: transparent;
  }

  .card__inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
  }

  /* iPhone-style dynamic island / notch — stays put while inner scrolls */
  .card::after {
    content: "";
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 32px;
    background: #000;
    border-radius: 20px;
    z-index: 3;
    pointer-events: none;
  }
}
