/* ==========================================================================
   Design tokens
   Values reverse-engineered from the live linktr.ee/tpbee page's computed
   theme (custom theme, DARK luminance, GLASS button style, ROUNDED_SM
   corners, SHADOW_SM shadow).
   ========================================================================== */

:root {
  --profile-bg-color: #dd9c73;
  --tint-color: rgba(0, 0, 0, 0.24);
  --text-color: #ffffff;

  --link-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%), rgba(255, 255, 255, 0.1);
  --link-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%), rgba(255, 255, 255, 0.14);
  --link-radius: 8px;
  --link-inner-radius: 4px;
  --link-shadow: 0px 0 8px rgba(0, 0, 0, 0.02);
  --link-gap: 14px;

  --font-primary: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --header-font-size: 20px;
  --tagline-font-size: 16px;
  --link-header-font-size: 14px;
  --link-text-font-size: 14px;

  --container-width: 580px;
}

@media screen and (min-width: 576px) {
  :root {
    --link-header-font-size: 16px;
    --link-text-font-size: 16px;
    --desktop-frame-color: #c38a66;
  }
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-primary);
  font-weight: 500;
  color: var(--text-color);
  background-color: var(--profile-bg-color);
}

@media screen and (min-width: 576px) {
  body {
    background-color: var(--desktop-frame-color);
  }
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
}

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

/* ==========================================================================
   Background image + tint
   ========================================================================== */

#page-background {
  position: fixed;
  top: -100px;
  right: 0;
  bottom: -100px;
  left: 0;
  z-index: -1;
  background-image: linear-gradient(var(--tint-color), var(--tint-color)), url('assets/background.jpg');
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  will-change: transform;
}

/* ==========================================================================
   Page container
   ========================================================================== */

#page {
  position: relative;
  max-width: var(--container-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media screen and (min-width: 576px) {
  #page {
    min-height: 0;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.25);
  }
}

/* ==========================================================================
   Header
   ========================================================================== */

#profile-header {
  width: 100%;
  padding: 96px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 8px 0 16px;
}

#profile-title {
  width: 100%;
  max-width: calc(100% - var(--link-gap) * 2);
  display: flex;
  justify-content: center;
  margin-bottom: var(--link-gap);
}

#profile-logo {
  max-height: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
}

#tagline {
  margin: 0 0 24px;
  padding: 0 calc(var(--link-gap) * 2);
  max-width: 460px;
  text-align: center;
  text-wrap: balance;
  font-size: var(--tagline-font-size);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-color);
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Links
   ========================================================================== */

#links {
  width: 100%;
  padding: 0 var(--link-gap) 8px;
  display: flex;
  flex-direction: column;
  gap: var(--link-gap);
}

@media screen and (min-width: 576px) {
  #links {
    padding: 0 calc(var(--link-gap) * 2) 8px;
  }
}

.link-group-heading {
  margin: 10px 0 0;
  text-align: center;
  font-size: var(--link-header-font-size);
  font-weight: 700;
  line-height: normal;
  color: var(--text-color);
}

.link-group-heading:first-child {
  margin-top: 0;
}

.link-group-items {
  display: flex;
  flex-direction: column;
  gap: var(--link-gap);
}

/* -- shared glass card -- */

.link-card {
  position: relative;
  display: block;
  width: 100%;
  background: var(--link-bg);
  -webkit-backdrop-filter: blur(20px) brightness(1.1) contrast(0.9);
  backdrop-filter: blur(20px) brightness(1.1) contrast(0.9);
  border-radius: var(--link-radius);
  box-shadow: var(--link-shadow);
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.link-card:hover {
  background: var(--link-bg-hover);
  transform: translateY(-1px);
}

.link-card:active {
  transform: translateY(0);
}

/* -- stack layout (icon left, centered label) -- */

.link-stack {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 64px;
}

.link-icon {
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 48px;
  border-radius: var(--link-inner-radius);
  overflow: hidden;
}

.link-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-title {
  width: 100%;
  font-size: var(--link-text-font-size);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.2px;
  text-align: center;
  text-wrap: balance;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* -- featured layout (Start Here: thumbnail + label) -- */

.link-featured {
  display: flex;
  flex-direction: column;
}

.link-featured-thumb {
  padding: var(--link-gap) var(--link-gap) 0;
}

.link-featured-thumb-inner {
  aspect-ratio: 16 / 9;
  border-radius: var(--link-inner-radius);
  overflow: hidden;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
}

.link-featured-thumb-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-featured .link-stack {
  padding: 12px 32px;
  min-height: 56px;
}

/* -- grid layout (playlists) -- */

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--link-gap);
}

.link-grid-card {
  display: flex;
  flex-direction: column;
}

.link-grid-thumb {
  padding: 10px 10px 0;
}

.link-grid-thumb-inner {
  aspect-ratio: 1 / 1;
  border-radius: var(--link-inner-radius);
  overflow: hidden;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
}

.link-grid-thumb-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-grid-card .link-title {
  padding: 10px;
  min-height: 0;
}

/* ==========================================================================
   Social icons
   ========================================================================== */

#socials {
  width: 100%;
  margin-top: 8px;
  padding: 8px var(--link-gap) 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-color);
  transition: transform 150ms ease;
}

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

.social-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  pointer-events: none;
}
