/* =====================================================================
 *  LinkLink — стилі. Mobile-first, одна колонка, максимум 480px.
 * ===================================================================== */
:root {
  --bg: #121012;
  --bg-rgb: 18, 16, 18;
  --fg: #ffffff;
  --fg-dim: rgba(255, 255, 255, 0.72);
  --fg-faint: rgba(255, 255, 255, 0.45);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.16);
  --accent: #ff4d8d;
  --accent-2: #ff8a5c;
  --accent-3: #b14dff;
  --online: #3ddc84;
  --radius-card: 26px;
  --radius-btn: 999px;
  --col: 440px;
  --shadow-card: 0 24px 60px -18px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Фон ---------- */
.bg {
  position: fixed;
  inset: -40px;
  background-position: center 20%;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(26px) saturate(1.25) brightness(0.55);
  transform: scale(1.08);
  z-index: 0;
}
.bg--flat { display: none; }
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 77, 141, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(11, 6, 8, 0.25) 0%, rgba(11, 6, 8, 0.6) 55%, rgba(11, 6, 8, 0.92) 100%);
}

/* ---------- Каркас ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(28px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

.col {
  width: 100%;
  max-width: var(--col);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Профіль ---------- */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.avatar {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  box-shadow: 0 10px 40px -10px rgba(255, 77, 141, 0.6);
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  background: #222;
}
.avatar__dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--online);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: ping 2.2s ease-out infinite;
}

.name {
  margin: 16px 0 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.name__verified {
  width: 22px;
  height: 22px;
  color: #3ea6ff;
  display: inline-flex;
}
.name__verified svg { width: 100%; height: 100%; }

.bio {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--fg-dim);
  font-weight: 500;
}

.online {
  margin: 10px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-dim);
  letter-spacing: 0.01em;
}
.online__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: ping 2.2s ease-out infinite;
}

.geo-greeting {
  margin: 8px 0 0;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}

/* ---------- Хедер з фото (як в оригіналі) ---------- */
.profile--hero { width: 100%; }
.hero {
  position: relative;
  width: calc(100% + 32px);
  margin: calc(-28px - env(safe-area-inset-top)) -16px 0;
  aspect-ratio: 1 / 1.18;
  max-height: 84vh;
  overflow: hidden;
  border-radius: 0;
  background: #140b0e;
  isolation: isolate;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  z-index: 0;
}
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Довгий плавний перехід фото у фон сторінки, як у прикладі */
  background: linear-gradient(
    180deg,
    rgba(var(--bg-rgb), 0)    0%,
    rgba(var(--bg-rgb), 0)    38%,
    rgba(var(--bg-rgb), 0.18) 50%,
    rgba(var(--bg-rgb), 0.48) 62%,
    rgba(var(--bg-rgb), 0.78) 74%,
    rgba(var(--bg-rgb), 0.95) 86%,
    rgb(var(--bg-rgb))        100%
  );
}
.hero__text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 20px 0;
  text-align: center;
}
.hero__text .name { margin: 0; font-size: 32px; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6); }
.hero__text .online { margin: 0; }
.hero__text .geo-greeting { margin: 0; }
.hero__text .bio { margin: 0; font-size: 17px; color: var(--fg); }
.profile--hero + .socials-wrap .socials { margin-top: 14px; }
.profile--hero ~ .links { margin-top: 22px; }
.profile--hero .avatar { margin-top: -56px; position: relative; z-index: 3; }

/* ---------- Соцмережі ---------- */
.socials {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  animation: rise 0.6s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.socials__item {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.15s ease, background 0.15s ease;
}
.socials__item svg { width: 20px; height: 20px; }
.socials__item:active { transform: scale(0.94); }

/* ---------- Список лінок ---------- */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 26px;
}
.links > * {
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(0.12s + var(--i, 0) * 0.07s);
}

.link-details {
  margin-top: 12px;
  text-align: center;
}
.countdown {
  margin: 0;
  line-height: 1.35;
}
.countdown {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  padding: 7px 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 143, 183, 0.38);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.14), rgba(255, 138, 92, 0.08));
  box-shadow: 0 0 0 0 rgba(255, 77, 141, 0.28), 0 8px 24px -14px rgba(255, 77, 141, 0.9);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12.5px;
  font-weight: 700;
  animation: countdownGlow 2.4s ease-in-out infinite;
}
.countdown::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  background: linear-gradient(110deg, transparent 26%, rgba(255, 255, 255, 0.3) 46%, transparent 66%);
  transform: translateX(-120%);
  animation: countdownShine 3.2s ease-in-out infinite;
}
.countdown > * {
  position: relative;
  z-index: 1;
}
.countdown__time {
  color: #ff9fc3;
  text-shadow: 0 0 12px rgba(255, 77, 141, 0.9);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.countdown--ended { opacity: 0.72; }

/* ---------- Картка (головна кнопка) ---------- */
.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 72vh;
  border-radius: var(--radius-card);
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: var(--fg);
  box-shadow: var(--shadow-card);
  background: #1a1014;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari overflow fix */
  transition: transform 0.18s ease;
  cursor: pointer;
}
.card:active { transform: scale(0.985); }
.card:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.92);
  outline-offset: 4px;
}

.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: 0;
}
.card__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.55) 78%, rgba(0, 0, 0, 0.85) 100%);
}

.badge18 {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.badge18--inline {
  position: static;
  margin-left: auto;
  padding: 3px 7px;
  font-size: 10px;
}

.card__bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 0 14px 0 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff6a9a 50%, var(--accent-2) 100%);
  box-shadow: 0 14px 34px -10px rgba(255, 77, 141, 0.75), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
  color: #fff;
}
.card__icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  flex: none;
  opacity: 0.95;
}
.card__icon svg { width: 100%; height: 100%; }
.card__label {
  flex: 1;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.card__arrow {
  width: 22px;
  height: 22px;
  display: inline-flex;
  flex: none;
  opacity: 0.9;
}
.card__arrow svg { width: 100%; height: 100%; }

/* Блиск, що пробігає по кнопці */
.card__shine,
.btn__shine {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.0) 44%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.0) 56%,
    transparent 60%,
    transparent 100%
  );
  background-size: 250% 100%;
  background-position: 120% 0;
  opacity: 0;
}
.card .card__shine {
  /* тільки по нижній плашці */
  top: auto;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 62px;
  border-radius: 20px;
}

/* ---------- Звичайна кнопка ---------- */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.14); }
.btn__icon { width: 24px; height: 24px; display: inline-flex; flex: none; }
.btn__icon svg { width: 100%; height: 100%; }
.btn__label { flex: 1; }

/* ---------- Ефекти кнопок (fx-*) ---------- */
.fx-shine .card__shine,
.fx-shine .btn__shine {
  opacity: 1;
  animation: shine 3.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: 1.2s;
}
.fx-pulse .card__bar,
.btn.fx-pulse {
  animation: pulse 2.4s ease-in-out infinite;
}
.fx-bounce { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both, bounce 2.6s ease-in-out 1.2s infinite !important; }

/* ---------- Футер ---------- */
.footer {
  margin-top: 34px;
  font-size: 12px;
  color: var(--fg-faint);
  text-align: center;
}
/* ---------- Анімації ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes drop {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}
@keyframes shine {
  0%   { background-position: 120% 0; }
  45%  { background-position: -120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 14px 34px -10px rgba(255, 77, 141, 0.75), 0 0 0 0 rgba(255, 77, 141, 0.45); }
  50%      { transform: scale(1.025); box-shadow: 0 18px 40px -10px rgba(255, 77, 141, 0.9),  0 0 0 10px rgba(255, 77, 141, 0); }
}
@keyframes countdownGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 141, 0.28), 0 8px 24px -14px rgba(255, 77, 141, 0.9); }
  50% { box-shadow: 0 0 0 5px rgba(255, 77, 141, 0), 0 10px 28px -12px rgba(255, 77, 141, 1); }
}
@keyframes countdownShine {
  0%, 58% { transform: translateX(-120%); }
  82%, 100% { transform: translateX(120%); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  12%      { transform: translateY(-8px); }
  24%      { transform: translateY(0); }
  32%      { transform: translateY(-4px); }
  40%      { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* На смартфоні CTA залишається на першому екрані навіть на невисоких дисплеях. */
@media (max-width: 719px) {
  .hero {
    height: clamp(205px, 40svh, 340px);
    min-height: 0;
    aspect-ratio: auto;
    max-height: none;
  }
  .hero__img { object-position: center 14%; }
  .hero__text { gap: 5px; }
  .hero__text .name { font-size: clamp(25px, 7.6vw, 31px); }
  .hero__text .bio { font-size: 14px; }
  .profile--hero ~ .links { margin-top: 28px; }
  .card {
    height: clamp(225px, 42svh, 340px);
    min-height: 0;
    aspect-ratio: auto;
    max-height: none;
  }
  .footer {
    align-self: flex-start;
    margin: 34px 0 0 16px;
    text-align: left;
  }
}

/* На великих екранах CTA також повністю видно без першого скролу. */
@media (min-width: 720px) {
  .page { padding-top: 56px; }
  .col { min-height: calc(100svh - 80px); }
  .hero {
    width: 100%;
    height: min(38svh, 320px);
    margin: 0;
    border-radius: 28px 28px 0 0;
    aspect-ratio: auto;
    max-height: none;
  }
  .name { font-size: 30px; }
  .profile--hero ~ .links { margin-top: clamp(24px, 4svh, 48px); }
  .card {
    height: min(43svh, 330px);
    aspect-ratio: auto;
    max-height: none;
  }
  .footer {
    align-self: flex-start;
    margin: auto auto 0 16px;
  }
}
