/* Telegram-like public channel preview — dark theme */

:root {
  --bg-deep: #0e1621;
  --bg-card: #17212b;
  --tg-blue: #24a1de;
  --tg-blue-hover: #4cb3e8;
  --text: #ffffff;
  --text-muted: #aaaaaa;
  --top-bar: #000000;
  --radius-card: 12px;
  --radius-btn: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background-color: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image: url("../images/bg-pattern.svg");
  background-size: 440px 440px;
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: 0 0;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 15px;
  background: var(--top-bar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand__logo {
  display: block;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.brand__text {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
}

.page {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* Pin card under the fixed header (Telegram preview sits upper–middle, not dead center) */
  padding: 72px 16px 32px;
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px 32px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.card__avatar-link {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.card__avatar-link:focus-visible {
  outline: 2px solid var(--tg-blue);
  outline-offset: 3px;
}

.card__avatar {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: #fff;
}

.card__title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.card__meta {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 400;
}

.card__desc {
  margin: 0 0 26px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--download {
  background: var(--tg-blue);
  color: #fff;
  min-height: 32px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.btn--download:hover {
  background: var(--tg-blue-hover);
}

.btn--primary {
  background: var(--tg-blue);
  color: #fff;
  width: 100%;
}

.btn--primary:hover {
  background: var(--tg-blue-hover);
}

.btn--outline {
  background: transparent;
  color: #fff;
  width: 100%;
  border: 1px solid var(--tg-blue);
}

.btn--outline:hover {
  background: rgba(36, 161, 222, 0.12);
}

/* Toasts — bottom right */
.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  pointer-events: auto;
  max-width: 100%;
  padding: 12px 16px;
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  opacity: 0;
  transform: translateX(12px) translateY(8px);
  animation: toast-in 0.35s ease forwards;
}

.toast.toast--out {
  animation: toast-out 0.3s ease forwards;
}

.toast__name {
  font-weight: 700;
  color: #fff;
}

.toast__msg {
  color: var(--text-muted);
  margin-top: 2px;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(8px) translateY(6px);
  }
}

@media (max-width: 480px) {
  .card {
    padding: 24px 20px 22px;
  }

  .card__title {
    font-size: 20px;
  }

  .toast-root {
    right: 12px;
    bottom: 12px;
  }
}
