/* ===== link.me style — тёмная тема ===== */
:root {
  --bg: #0a0a0a;
  --bg-card: #1a1a1a;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --accent: #8b5cf6;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration: 0.3s;
  --duration-slow: 0.45s;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -ms-overflow-style: none; /* IE, Edge */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----- Top bar ----- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #000;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.top-bar-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--duration) var(--ease-out);
}

.top-bar-btn:hover {
  opacity: 0.8;
}

.top-bar-btn:active {
  opacity: 0.6;
}

.top-bar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.top-bar-text {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-domain {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
}

/* ----- Page ----- */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 24px;
  /* padding-top: 24px; */
  /* padding-bottom: 100px; */
}

/* ----- Hero ----- */
.hero {
  text-align: center;
  margin-bottom: 20px;
}

.hero-image-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;

  /* Adaptive height: scales with viewport, keeps 4:5 ratio, never taller than width allows */
  aspect-ratio: 4 / 5;
  max-height: min(70vh, calc(100vw * 5 / 4));
  min-height: min(40vh, 200px);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  margin: auto;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
}

.hero-image-wrap:hover .hero-image {
  transform: scale(1.02);
}

/* Short viewport (landscape / small phone): smaller hero so content is visible */
@media (max-height: 500px) {
  .hero-image-wrap {
    max-height: 55vh;
    min-height: 180px;
    aspect-ratio: 4 / 4;
  }
}

/* Very small phones: cap hero height */
@media (max-width: 360px) {
  .hero-image-wrap {
    max-height: min(65vh, calc(100vw * 5 / 4));
  }
}

/* Tall/normal portrait: comfortable hero size */
@media (min-height: 600px) {
  .hero-image-wrap {
    max-height: min(72vh, calc(100vw * 5 / 4));
  }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

.hero-name {
  margin: 0 0 4px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-handle {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ----- Social links ----- */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text);
  text-decoration: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transition: background var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.social-link:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

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

.social-link svg {
  width: 22px;
  height: 22px;
}

.social-link-me {
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
}

body.is-tiktok-browser .social-link-tiktok {
  display: none !important;
}

/* ----- Bio ----- */
.bio {
  text-align: center;
  margin-bottom: 24px;
  padding: 0 8px;
}

.bio p {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
}

.bio p:last-child {
  margin-bottom: 0;
}

/* ----- Gallery — grid, крупные фото, вертикальный скролл ----- */
.gallery {
  margin-bottom: 24px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--duration) var(--ease-out);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

@media (min-width: 520px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* ----- Bottom banner ----- */
.bottom-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 10px 16px;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #5b21b6 100%);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  transition: transform var(--duration-slow) var(--ease-out),
              opacity var(--duration) var(--ease-out);
}

.bottom-banner.is-closed {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.bottom-banner-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bottom-banner-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  flex-shrink: 0;
}

.bottom-banner-text {
  flex: 1;
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  min-width: 0;
}

.bottom-banner-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.9;
  flex-shrink: 0;
  transition: opacity var(--duration) var(--ease-out),
              transform var(--duration) var(--ease-out);
}

.bottom-banner-close:hover {
  opacity: 1;
}

.bottom-banner-close:active {
  transform: scale(0.9);
}

/* ----- Full-page message: link copiat (blur bg) ----- */
.link-toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
}

.link-toast-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s;
}

.link-toast-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: backdrop-filter 0.4s ease;
}

.link-toast-content {
  position: relative;
  max-width: 340px;
  width: 100%;
  padding: 28px 24px;
  background: rgba(26, 26, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.4s var(--ease-out);
}

.link-toast-overlay.is-visible .link-toast-content {
  transform: scale(1);
}

.link-toast-message {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}
