/* ============================================================
   coasterdaniel — custom linktree
   ============================================================ */

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

:root {
  --white:       #ffffff;
  --white-60:    rgba(255,255,255,0.60);
  --white-20:    rgba(255,255,255,0.18);
  --white-10:    rgba(255,255,255,0.10);
  --card-bg:     rgba(255,255,255,0.15);
  --card-border: rgba(255,255,255,0.28);
  --card-hover:  rgba(255,255,255,0.26);
  --shadow:      0 8px 32px rgba(0,0,0,0.25);
  --radius:      18px;
  --radius-sm:   12px;

  /* platform colours */
  --tt:   #000000;
  --ig:   #e1306c;
  --yt:   #ff0000;
  --snap: #fffc00;
}

html, body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--white);
  position: relative;
}

/* ── Background ─────────────────────────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  background: url('images/bg.png') center center / cover no-repeat;
  z-index: 0;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(0,0,0,0.30) 0%,
    rgba(0,0,0,0.45) 60%,
    rgba(0,0,0,0.55) 100%
  );
  z-index: 1;
}

/* ── Grain ──────────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.055;
  pointer-events: none;
  z-index: 10;
  animation: grain-shift 0.8s steps(1) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, -4%); }
  40%  { transform: translate(4%,  2%); }
  60%  { transform: translate(-2%, 5%); }
  80%  { transform: translate(5%, -3%); }
  100% { transform: translate(0, 0); }
}

/* ── Layout container ───────────────────────────────────── */
.container {
  position: relative;
  z-index: 2;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ── Profile ─────────────────────────────────────────────── */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  animation: fade-up 0.7s ease both;
}

.pfp-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.15));
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.pfp {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.username {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--white);
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.bio {
  font-size: clamp(0.82rem, 3vw, 0.92rem);
  font-weight: 300;
  color: var(--white-60);
  text-align: center;
  line-height: 1.55;
}

.bio span {
  font-style: italic;
  color: rgba(255,255,255,0.50);
}

/* ── Social icons row ────────────────────────────────────── */
.socials {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 36px;
  animation: fade-up 0.7s 0.1s ease both;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white-20);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  transition: transform 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.social-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.social-icon:hover {
  transform: translateY(-3px) scale(1.1);
  background: var(--card-hover);
}

/* ── Link cards ──────────────────────────────────────────── */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 16px 10px 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--white);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  animation: fade-up 0.6s ease both;
}

.link-card:nth-child(1) { animation-delay: 0.15s; }
.link-card:nth-child(2) { animation-delay: 0.22s; }
.link-card:nth-child(3) { animation-delay: 0.29s; }
.link-card:nth-child(4) { animation-delay: 0.36s; }

.link-card:hover {
  transform: translateY(-2px) scale(1.012);
  background: var(--card-hover);
  box-shadow: 0 12px 40px rgba(0,0,0,0.32);
}

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

/* Thumbnail / icon area */
.link-thumb {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--white-10);
}

.link-thumb img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback coloured icon when no thumb image */
.link-icon-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.link-thumb img:first-child:not([style*="display:none"]) ~ .link-icon-wrap {
  display: none; /* hide icon if thumb loaded */
}

.link-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.tiktok-bg { background: #000; }
.insta-bg  { background: radial-gradient(circle at 30% 110%, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.yt-bg     { background: #ff0000; }
.snap-bg   { background: #fffc00; }
.snap-bg img { filter: brightness(0); } /* snap ghost is black on yellow */

/* Label */
.link-label {
  flex: 1;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: clamp(0.95rem, 3vw, 1.05rem);
  letter-spacing: 0.01em;
}

/* Arrow */
.link-arrow {
  width: 18px;
  height: 18px;
  color: var(--white-60);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.link-card:hover .link-arrow {
  transform: translateX(3px);
  color: var(--white);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 360px) {
  .container { padding: 44px 14px 48px; }
  .pfp-wrap  { width: 82px; height: 82px; }
  .link-thumb { width: 48px; height: 48px; }
}

@media (min-width: 600px) {
  .container { padding: 72px 24px 80px; }
}
