/* ============================================================
   Premium Linktree — Refined, Elegant, Luxurious
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;1,400&display=swap");

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

/* --- Theme variables --- */

:root {
  --bg: #050505;
  --bg-secondary: #0a0a0a;
  --text-primary: #f0ece2;
  --text-secondary: rgba(240, 236, 226, 0.5);
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.08);
  --card-border: 1px solid rgba(255, 255, 255, 0.06);
  --card-hover-border: 1px solid rgba(255, 255, 255, 0.12);
  --icon-color: #f0ece2;
  --accent: rgba(200, 170, 110, 0.8);
  --accent-glow: rgba(200, 170, 110, 0.15);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.5);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font, "Inter", sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Outer page with ambient background --- */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--outer-bg, #0d0d0d);
  padding: 40px 16px;
  position: relative;
  overflow: hidden;
}

/* Ambient background orbs */
.page::before,
.page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.page::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(200, 170, 110, 0.15),
    transparent 70%
  );
  top: -10%;
  left: -10%;
  animation: floatOrb 20s ease-in-out infinite;
}

.page::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(120, 100, 180, 0.1),
    transparent 70%
  );
  bottom: -10%;
  right: -10%;
  animation: floatOrb 25s ease-in-out infinite reverse;
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -40px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* --- Phone frame --- */

.phone-frame {
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  border-radius: 40px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 32px 100px rgba(0, 0, 0, 0.5),
    0 12px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-frame:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 40px 120px rgba(0, 0, 0, 0.5),
    0 16px 48px rgba(0, 0, 0, 0.3),
    0 0 80px rgba(200, 170, 110, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.phone-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 32px;
}

/* --- Hero photo --- */

.hero {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 380px;
  position: relative;
  overflow: hidden;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 8s cubic-bezier(0.4, 0, 0.2, 1);
}

.phone-frame:hover .hero-photo {
  transform: scale(1.03);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 10%,
    rgba(5, 5, 5, 0.2) 40%,
    rgba(5, 5, 5, 0.8) 75%,
    var(--bg) 100%
  );
  pointer-events: none;
}

/* Subtle vignette on hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(5, 5, 5, 0.3) 100%
  );
  pointer-events: none;
}

/* --- Profile --- */

.profile {
  text-align: center;
  padding: 0 28px;
  margin-top: -28px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.profile h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  font-style: italic;
  line-height: 1.3;
}

.profile p {
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* --- Decorative divider --- */

.profile::after {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 16px auto 0;
  opacity: 0.6;
}

/* --- Social icons --- */

.socials {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 28px;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.1s;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--icon-color);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.social-icon:hover {
  transform: translateY(-3px) scale(1.1);
  background: rgba(200, 170, 110, 0.1);
  border-color: rgba(200, 170, 110, 0.25);
  box-shadow: 0 4px 20px rgba(200, 170, 110, 0.1);
}

.social-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--icon-color);
  transition: fill 0.3s;
}

.social-icon:hover svg {
  fill: var(--accent);
}

/* --- Link cards --- */

.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 18px;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 15px 20px;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--radius, 16px);
  text-decoration: none;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Shimmer highlight on hover */
.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.03),
    transparent
  );
  transition: left 0.6s ease;
  pointer-events: none;
}

.link-card:hover::before {
  left: 100%;
}

.link-card:hover {
  background: var(--card-hover);
  border: var(--card-hover-border);
  transform: translateY(-2px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(200, 170, 110, 0.03);
}

.link-card:active {
  transform: translateY(0) scale(0.99);
  transition-duration: 0.1s;
}

/* --- Link thumbnail --- */

.link-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  margin-right: 14px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s;
}

.link-card:hover .link-icon {
  border-color: rgba(200, 170, 110, 0.2);
}

/* Placeholder when no icon is provided */
.link-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  margin-right: 14px;
  flex-shrink: 0;
  background: linear-gradient(
    135deg,
    rgba(200, 170, 110, 0.08),
    rgba(200, 170, 110, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.3s;
}

.link-card:hover .link-placeholder {
  background: linear-gradient(
    135deg,
    rgba(200, 170, 110, 0.15),
    rgba(200, 170, 110, 0.05)
  );
  border-color: rgba(200, 170, 110, 0.2);
}

.link-title {
  flex: 1;
  text-align: center;
}

.link-arrow {
  color: var(--text-secondary);
  font-size: 0.75rem;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 8px;
  transform: translateX(-4px);
}

.link-card:hover .link-arrow {
  opacity: 0.6;
  transform: translateX(0);
}

/* --- Footer --- */

.footer {
  margin-top: 36px;
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.4;
  letter-spacing: 0.06em;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.5s;
}

/* --- Credit line --- */

.credit {
  margin-top: 16px;
  font-family: "Inter", sans-serif;
  font-size: 0.6rem;
  color: var(--text-secondary);
  opacity: 0.25;
  text-align: center;
  letter-spacing: 0.04em;
}

.credit a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 236, 226, 0.1);
  transition: all 0.3s;
}

.credit a:hover {
  color: var(--accent);
  border-bottom-color: rgba(200, 170, 110, 0.3);
}

/* --- QR Code widget --- */

.qr-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.8s;
}

.qr-widget.hidden {
  display: none;
}

.qr-label {
  font-family: "Inter", sans-serif;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

#qr-canvas {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  background: #fff;
  padding: 8px;
}

.qr-img {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  background: #fff;
  padding: 8px;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-img:hover {
  transform: scale(1.05);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* --- Animations --- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Staggered entrance for link cards */
.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:nth-child(5) {
  animation-delay: 0.43s;
}
.link-card:nth-child(6) {
  animation-delay: 0.5s;
}
.link-card:nth-child(7) {
  animation-delay: 0.57s;
}
.link-card:nth-child(8) {
  animation-delay: 0.64s;
}

/* --- Mobile: full-bleed --- */

@media (max-width: 520px) {
  .page {
    padding: 0;
    background: var(--bg);
  }
  .page::before,
  .page::after {
    display: none;
  }
  .phone-frame {
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }
  .phone-frame:hover {
    transform: none;
    box-shadow: none;
  }
  .qr-widget {
    display: none;
  }
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .page::before,
  .page::after {
    animation: none;
  }
}
