/* AlphaPatterns brand palette — light lavender "phone frame" card floating on a
   neutral canvas + teal (from the logo) as a secondary accent. */
:root {
  --bg: #E7E4EC;
  --frame-bg: #ded7fb;
  --text: #1E1B34;
  --card: #FFFFFF;
  --muted: #55516E;
  --on-bg: #1E1B34;
  --on-bg-muted: #4a4470;
  --track: #c6bcf2;
  --placeholder: #C9C4E8;
  --accent: #7864FD;
  --teal: #12C1AB;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 400px;
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 26px 20px;
  background: var(--frame-bg);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

/* Mobile: the "phone frame" card becomes the viewport itself — no floating
   canvas, no rounded corners, no shadow. */
@media (max-width: 480px) {
  .page {
    max-width: none;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Profile header */
.profile { text-align: center; }

.logo-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #fff;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
}
.logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
}

.handle {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--on-bg);
}

.socials {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
}
.socials a {
  color: var(--on-bg);
  display: flex;
  transition: color 0.15s ease, transform 0.15s ease;
}
.socials a:hover {
  color: var(--teal);
  transform: translateY(-2px);
}

/* Tabs — iOS-style sliding pill: the indicator translates, the track stays put.
   Sized to fit its content, not the full column width. */
.tablist {
  position: relative;
  display: flex;
  width: fit-content;
  background: var(--track);
  border-radius: 999px;
  padding: 2px;
  margin: 14px auto 16px;
}
.tablist-indicator {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: var(--card);
  border-radius: 999px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.tablist button {
  position: relative;
  z-index: 1;
  flex: none;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--on-bg-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 0 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.tablist button[aria-selected="true"] { color: var(--text); }

.panel { display: block; }
.panel[hidden] { display: none; }

/* Featured video card */
.card {
  display: block;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 12px;
}

.card-feature {
  border-radius: 18px;
  padding: 16px 16px 0;
}
.card-feature .card-caption {
  padding: 13px 2px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}
.card-thumb-large-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--placeholder);
  border-radius: 8px;
  overflow: hidden;
}
.card-thumb-large {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #000;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 5px;
}
.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
}
.play-btn svg { margin-left: 2px; }

.card-caption {
  display: block;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

/* Product row card */
.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  padding: 8px 14px 8px 8px;
  margin-bottom: 12px;
}
.card-thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--placeholder);
}
.card-row .card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-row .badge {
  position: static;
  display: inline-block;
  width: fit-content;
  font-size: 9px;
  padding: 4px 7px;
  border-radius: 4px;
  margin-bottom: 5px;
}
.card-row .card-caption { padding: 0; font-size: 14px; font-weight: 500; line-height: 1.35; }
.chevron { flex-shrink: 0; color: var(--muted); }

/* Shop link tiles — white tile, colored icon chip, text centered
   independent of the icon (icon sits absolute so it doesn't skew centering). */
.link-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 18px 9px 9px;
  min-height: 60px;
  margin-bottom: 10px;
  -webkit-tap-highlight-color: transparent;
}
.link-tile-primary {
  background: var(--accent);
  color: #fff;
}
.link-icon {
  position: absolute;
  left: 9px;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
}
.link-icon-violet { background: var(--accent); }
.link-icon-orange { background: #F16521; }
.link-icon-logo { background: #fff; padding: 4px; }
.link-icon-logo img { width: 100%; height: 100%; object-fit: contain; }
.link-title { font-size: 14px; font-weight: 500; text-align: center; }

footer {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-bg-muted);
}
footer a { color: inherit; text-decoration: none; }
footer a:hover { text-decoration: underline; }

.affiliate-disclosure {
  margin: 14px 2px 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--on-bg-muted);
  text-align: center;
}

/* Shop tab: collection tiles + drill-down grid */
.collection-tile {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  border: none;
  padding: 14px 14px 12px;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
/* One large image + a 2x2 grid of small ones beside it, matching the real
   Linktree "collection" card shape (aspect-video row, 1px gaps, cover-fit). */
.collection-mosaic {
  display: flex;
  gap: 1px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}
.collection-mosaic-main {
  flex: 1;
  height: 100%;
  min-width: 0;
  object-fit: contain;
  background: #fff;
}
.collection-tile-bestsellers .collection-mosaic-main,
.collection-tile-bestsellers .collection-mosaic-grid img {
  object-fit: cover;
}
.collection-mosaic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1px;
  aspect-ratio: 1;
  height: 100%;
  width: auto;
}
.collection-mosaic-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.collection-tile-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 12px 0 0;
}
.collection-tile-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collection-tile-count { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

/* Collection drill-down: a modal on top of the page, not an in-place swap.
   The blurred/dimmed backdrop shows through everywhere — only the product
   tiles inside are opaque white cards, floating directly on the blur. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.modal-panel {
  max-width: 460px;
  min-height: 100%;
  margin: 0 auto;
}
.modal-topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
}
.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--track);
  color: var(--text);
  cursor: pointer;
}
.modal-body { padding: 0 16px 24px; }
.collection-detail-title {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
}
.collection-detail-count {
  margin: 2px 0 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.collection-grid a {
  display: block;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  padding: 14px 14px 12px;
}
.collection-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.collection-grid-bestsellers img {
  object-fit: cover;
}
.collection-grid span {
  display: block;
  padding: 12px 0 0;
  color: #000;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}
