:root {
  --accent-color: #8b2346;
  --accent-hover: #711b38;
  --background-color: #f7f4f2;
  --card-color: #ffffff;
  --text-color: #242124;
  --muted-text-color: #686168;
  --border-color: #e8dfe2;
  --radius: 18px;
  --avatar-radius: 50%;
  --shadow-soft: 0 18px 48px rgba(58, 35, 45, 0.12);
  --shadow-card: 0 12px 30px rgba(58, 35, 45, 0.08);
  --focus-ring: 0 0 0 4px rgba(139, 35, 70, 0.18);
}

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

html {
  min-height: 100%;
  background: var(--background-color);
  color: var(--text-color);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(139, 35, 70, 0.09), transparent 32rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(247, 244, 242, 0.95)),
    var(--background-color);
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  z-index: 10;
  transform: translateY(-140%);
  border-radius: 999px;
  background: var(--accent-color);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  padding:
    calc(22px + env(safe-area-inset-top))
    calc(14px + env(safe-area-inset-right))
    calc(22px + env(safe-area-inset-bottom))
    calc(14px + env(safe-area-inset-left));
}

.portal {
  position: relative;
  width: min(100%, 660px);
  margin: 0 auto;
  border: 1px solid rgba(232, 223, 226, 0.9);
  border-radius: calc(var(--radius) + 10px);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.25rem, 4vw, 2.2rem);
  overflow: hidden;
}

.portal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.18));
}

.portal > * {
  position: relative;
}

.share-button {
  position: absolute;
  top: clamp(0.9rem, 3vw, 1.35rem);
  right: clamp(0.9rem, 3vw, 1.35rem);
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--card-color);
  color: var(--accent-color);
  box-shadow: 0 8px 18px rgba(58, 35, 45, 0.08);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
}

.share-button:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 35, 70, 0.35);
  color: var(--accent-hover);
}

.profile {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-top: 0.2rem;
}

.avatar-wrap {
  position: relative;
  display: grid;
  width: clamp(108px, 28vw, 132px);
  height: clamp(108px, 28vw, 132px);
  place-items: center;
  margin-bottom: 1rem;
}

.avatar,
.avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: var(--avatar-radius);
  border: 4px solid var(--card-color);
  box-shadow: 0 14px 34px rgba(58, 35, 45, 0.16);
}

.avatar {
  object-fit: cover;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: linear-gradient(145deg, var(--accent-color), #b8647f);
  color: #ffffff;
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: 0;
}

.avatar-fallback.is-visible {
  display: grid;
}

.profile__eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent-color);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
}

.profile__name {
  margin: 0;
  color: var(--text-color);
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.profile__handle {
  margin: 0.35rem 0 0;
  color: var(--muted-text-color);
  font-weight: 650;
}

.profile__description {
  max-width: 34rem;
  margin: 0.9rem auto 0;
  color: var(--muted-text-color);
  font-size: 1rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.25rem 0 1.45rem;
}

.social-link {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--card-color);
  color: var(--accent-color);
  padding: 0.65rem;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(58, 35, 45, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 35, 70, 0.35);
  color: var(--accent-hover);
}

.link-list {
  display: grid;
  gap: 0.85rem;
}

.link-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 0.9rem;
  min-height: 76px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--card-color);
  color: var(--text-color);
  padding: 0.92rem;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease, background-color 170ms ease;
}

.link-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 35, 70, 0.36);
  box-shadow: 0 18px 36px rgba(58, 35, 45, 0.13);
}

.link-card:focus-visible {
  box-shadow: var(--focus-ring), var(--shadow-card);
}

.link-card--featured {
  border-color: rgba(139, 35, 70, 0.35);
  background:
    linear-gradient(135deg, rgba(139, 35, 70, 0.08), rgba(255, 255, 255, 0) 54%),
    var(--card-color);
}

.link-card__icon,
.link-card__external {
  display: grid;
  place-items: center;
  color: var(--accent-color);
}

.link-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(139, 35, 70, 0.09);
}

.link-card__external {
  opacity: 0.72;
}

.link-card__body {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.link-card__title-line {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.link-card__title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
  line-height: 1.25;
}

.link-card__description {
  color: var(--muted-text-color);
  font-size: 0.92rem;
  line-height: 1.35;
}

.link-card__badge {
  border: 1px solid rgba(139, 35, 70, 0.2);
  border-radius: 999px;
  background: rgba(139, 35, 70, 0.08);
  color: var(--accent-color);
  padding: 0.17rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
}

.toast {
  min-height: 1.4rem;
  margin: 1rem 0 0;
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 750;
  text-align: center;
  opacity: 0;
  transition: opacity 160ms ease;
}

.toast.is-visible {
  opacity: 1;
}

.footer {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.35rem;
  color: var(--muted-text-color);
  font-size: 0.83rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

.noscript {
  max-width: 36rem;
  margin: 1rem auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--card-color);
  color: var(--text-color);
  padding: 1rem;
  text-align: center;
}

@media (max-width: 430px) {
  .page-shell {
    padding-right: calc(10px + env(safe-area-inset-right));
    padding-left: calc(10px + env(safe-area-inset-left));
  }

  .portal {
    padding: 1.15rem 0.85rem;
    border-radius: 24px;
  }

  .share-button {
    width: 42px;
    height: 42px;
  }

  .profile {
    padding-right: 2.2rem;
    padding-left: 2.2rem;
  }

  .link-card {
    grid-template-columns: 44px minmax(0, 1fr) 24px;
    gap: 0.72rem;
    padding: 0.82rem;
  }

  .link-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
}

@media (max-width: 340px) {
  .portal {
    padding-right: 0.72rem;
    padding-left: 0.72rem;
  }

  .profile {
    padding-right: 1.55rem;
    padding-left: 1.55rem;
  }

  .link-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .link-card__icon {
    width: 40px;
    height: 40px;
  }

  .link-card__external {
    display: none;
  }
}

@media (min-width: 768px) {
  .page-shell {
    display: grid;
    align-items: center;
    padding-top: calc(40px + env(safe-area-inset-top));
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.no-motion *,
.no-motion *::before,
.no-motion *::after {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
}
