:root {
  --bg-base: #e4ebf0;
  --outer-backdrop: #9da3a8;
  --header-text-color: #3b3a52;
  --body-text-color: #4e4d4b;
  --button-bg: #ffffff;
  --button-hover-bg: #ededed;
  --button-text: #000000;
  --button-radius: 28px;
  --link-gap: 14px;
  --shadow-sm:
    0.3px 0.5px 0.7px hsl(0deg 0% 6.7% / 0.021),
    0.9px 1.8px 2.5px -0.6px hsl(0deg 0% 6.7% / 0.026),
    2px 4px 5.5px -1.2px hsl(0deg 0% 6.7% / 0.031),
    4.6px 9.3px 12.8px -1.7px hsl(0deg 0% 6.7% / 0.035);
  --font-main: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  scrollbar-gutter: stable;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--body-text-color);
  background-color: var(--bg-base);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

/* Desktop outer frame */
.page-backdrop {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background-color: var(--bg-base);
}

.profile-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-base);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-bg-blur {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #f1f5f9 0%, #e4ebf0 60%, #dce4eb 100%);
  pointer-events: none;
  z-index: 0;
}

.profile-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 72px 14px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

/* Top bar */
.top-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 16px;
}

.frosted-btn {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: rgba(255, 255, 255, 0.52);
  outline: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(16px) brightness(1.4);
  -webkit-backdrop-filter: blur(16px) brightness(1.4);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.frosted-btn:hover {
  background: rgba(255, 255, 255, 0.7);
}

.frosted-btn:active {
  transform: scale(0.95);
}

/* Profile Header */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-top: 4px;
}

.avatar-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

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

.profile-title {
  margin: 0;
  color: var(--header-text-color);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.profile-bio {
  margin: 4px 0 0;
  color: var(--body-text-color);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.social-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--body-text-color);
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.social-link:hover {
  transform: scale(1.075);
}

/* Section Heading */
.section-heading {
  margin: 22px 0 14px;
  color: var(--body-text-color);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

/* Search Bar */
.search-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 42px;
  border: none;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.78);
  color: var(--button-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  outline: 1px solid rgba(255, 255, 255, 0.7);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.search-input::placeholder {
  color: rgba(0, 0, 0, 0.42);
  font-weight: 400;
}

.search-input:focus {
  background-color: #ffffff;
  outline: 1px solid rgba(59, 58, 82, 0.25);
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.45);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.search-clear-btn[hidden] {
  display: none;
}

.search-clear-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.8);
}

.search-empty {
  margin: 18px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--body-text-color);
  opacity: 0.7;
  text-align: center;
}

/* Playlist Links */
.links-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--link-gap);
}

.link-card {
  position: relative;
  width: 100%;
  min-height: 64px;
  background-color: var(--button-bg);
  color: var(--button-text);
  border-radius: var(--button-radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 12px 64px;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.15s ease;
  text-align: center;
}

.link-card:hover {
  background-color: var(--button-hover-bg);
}

.link-card:active {
  transform: scale(0.99);
}

.link-thumb {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.link-text-wrap {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-title-track {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-title {
  margin: 0;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: var(--button-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-title--clone {
  display: none;
}

.link-card.is-overflowing:hover .link-text-wrap,
.link-card.is-overflowing:focus-visible .link-text-wrap {
  justify-content: flex-start;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.link-card.is-overflowing:hover .link-title-track,
.link-card.is-overflowing:focus-visible .link-title-track {
  width: max-content;
  justify-content: flex-start;
  gap: 48px;
  animation: link-marquee var(--marquee-duration, 10s) linear infinite;
}

.link-card.is-overflowing:hover .link-title,
.link-card.is-overflowing:focus-visible .link-title {
  width: auto;
  overflow: visible;
  text-overflow: clip;
  flex-shrink: 0;
}

.link-card.is-overflowing:hover .link-title--clone,
.link-card.is-overflowing:focus-visible .link-title--clone {
  display: inline-block;
}

@keyframes link-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-50% - 24px));
  }
}

.link-more-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.5);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.link-more-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.85);
}

/* Footer */
.profile-footer {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.footer-brand {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--body-text-color);
  opacity: 0.75;
}

/* Modal Sheet */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  color: #111827;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 28px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(20px);
  transition: transform 0.22s ease;
}

.modal-overlay.is-open .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-eyebrow {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}

.modal-close-btn:hover {
  background-color: #f3f4f6;
}

.modal-playlist-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 16px;
  margin-bottom: 16px;
}

.modal-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.modal-playlist-meta {
  min-width: 0;
}

.modal-playlist-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #111827;
}

.modal-playlist-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.modal-platforms {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  transition: background-color 0.15s ease;
}

.platform-row:hover {
  background-color: #f9fafb;
}

.platform-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.platform-name {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.platform-chevron {
  color: #6b7280;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.platform-row:hover .platform-chevron {
  color: #111827;
  transform: translateX(2px);
}

.modal-primary-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: 9999px;
  background-color: #111827;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.15s ease;
}

.modal-primary-cta:hover {
  background-color: #1f2937;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(17, 24, 39, 0.92);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive desktop frame (>= 640px) */
@media (min-width: 576px) {
  .section-heading {
    font-size: 16px;
  }
}

@media (min-width: 640px) {
  .profile-content {
    max-width: 580px;
    margin: 0 auto;
    padding: 84px 28px 48px;
  }

  .link-card {
    padding: 12px 24px 12px 68px;
  }

  .link-title {
    font-size: 16px;
  }

  .modal-overlay {
    align-items: center;
    padding: 20px;
  }

  .modal-sheet {
    border-radius: 24px;
  }
}
