:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  background: #07131f;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 16%, rgba(0, 119, 181, 0.18), transparent 45%),
    #07131f;
}

.telegram-backdrop {
  --telegram-outline-opacity: 0.035;
  position: absolute;
  z-index: -1;
  inset: -64px -66px;
  color: #8bc7e5;
  pointer-events: none;
}
.telegram-backdrop svg {
  display: block;
  width: 100%;
  height: 100%;
  opacity: var(--telegram-outline-opacity);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 36px, 560px);
  min-height: 100svh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.content-group {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.page-intro {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 450px;
  margin-bottom: 36px;
  text-align: left;
}
.page-intro::before {
  flex: 0 0 3px;
  margin: 4px 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #8bc7e5, #5086a0);
  content: "";
}
.page-intro-copy { min-width: 0; }
.page-intro h1 {
  min-width: 0;
  margin: 0;
  color: #d7e7ef;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.page-intro h1 span { color: #8bc7e5; font-weight: 600; }
.page-intro p {
  margin: 8px 0 0;
  color: #9fb5c2;
  font-size: 14px;
  line-height: 1.5;
}

.join-card {
  position: relative;
  isolation: isolate;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 28px;
  padding: 48px 48px 42px;
  border: 1px solid #354b5a;
  border-radius: 16px;
  background: linear-gradient(165deg, #152c3b, #102330 55%, #0d1d29);
  color: #fff;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 1px 0 #3a5060,
    0 3px 0 #203746,
    0 4px 0 #0b1822,
    0 24px 54px rgba(0, 0, 0, 0.28);
}

.join-card::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.055' filter='url(%23grain)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 0, rgba(43, 98, 125, 0.16), transparent 72%);
  background-size: 160px 160px, 100% 100%;
  background-repeat: repeat, no-repeat;
  content: "";
  pointer-events: none;
}

.join-card::after {
  position: absolute;
  z-index: -1;
  inset: 12px;
  border: 1px solid rgba(139, 199, 229, 0.12);
  border-radius: 7px;
  content: "";
  pointer-events: none;
}

.corner-tag {
  position: absolute;
  top: -22px;
  right: -12px;
  z-index: 1;
  display: block;
  width: clamp(112px, 36vw, 148px);
  aspect-ratio: 1;
  pointer-events: none;
}

.tag-art {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.28));
}
.tag-copy {
  position: absolute;
  z-index: 4;
  left: 48.5%;
  top: 65.5%;
  width: 52%;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%) rotate(11deg);
  color: #d7e7ef;
  font-size: clamp(10px, 3.1vw, 13px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.025em;
  text-align: center;
  text-transform: uppercase;
}

.join-avatar {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid #0d1d29;
  border-radius: 50%;
  background: linear-gradient(145deg, #176b81, #0077b5);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.06em;
  box-shadow: 0 0 0 2px #6288a0, 0 10px 22px rgba(0, 0, 0, 0.25);
}

.join-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }

.join-kicker {
  margin: 30px 0 10px;
  color: #8bc7e5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.join-card h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.description {
  max-width: 370px;
  margin: 18px 0 0;
  color: #b5c6d1;
  font-size: 16px;
  line-height: 1.6;
}

.member-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 25px 0 0;
  color: #b5c6d1;
  font-size: 15px;
  line-height: 1.4;
}

.member-count svg { width: 19px; height: 19px; margin-right: 2px; flex: none; }
.member-count strong { color: #4ade80; font-weight: 700; }
.rolling-count { --count-roll-duration: 3.25s; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.rolling-digit { height: 1em; overflow: hidden; line-height: 1; text-align: center; }
.rolling-digit-track { display: block; transform: translateY(-10em); animation: roll-digit var(--count-roll-duration) cubic-bezier(0.18, 0.72, 0.25, 1) both; }
.rolling-digit-track span { display: block; height: 1em; line-height: 1; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes roll-digit {
  from { transform: translateY(0); }
  to { transform: translateY(-10em); }
}

.primary-cta {
  --cta-ripple-duration: 1.6s;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin-top: 32px;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: #0077b5;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 58%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 119, 181, 0.22);
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.primary-cta::before {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.04);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  animation: cta-ripple var(--cta-ripple-duration) ease-out infinite;
}

.primary-cta svg { width: 21px; height: 21px; flex: none; }

.primary-cta:hover {
  background: #00699f;
  box-shadow: 0 10px 24px rgba(0, 119, 181, 0.28);
  transform: translateY(-2px);
}
.primary-cta:active { transform: translateY(0); }
.primary-cta:focus-visible { outline: 3px solid #d8ae64; outline-offset: 4px; }
.primary-cta:hover::before,
.primary-cta:focus-visible::before { animation: none; opacity: 0; }

@keyframes cta-ripple {
  0%, 12% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  22% { opacity: 0.7; }
  70%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(3.5); }
}

.advertising-contact {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 4px;
  text-align: center;
}

.advertising-contact[hidden] { display: none; }
.advertising-contact p { margin: 0; color: #aabdc9; font-size: 13px; line-height: 1.5; }
.advertising-email { min-width: 0; max-width: 100%; }
.advertising-email strong { color: #8bc7e5; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.advertising-credit strong { color: #d7e7ef; font-weight: 600; }

.disclaimer {
  width: 100%;
  padding: 22px 4px 0;
  text-align: center;
}
.advertising-contact,
.disclaimer { position: relative; }
.advertising-contact::before,
.disclaimer::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 199, 229, 0.24), transparent);
  content: "";
}
.disclaimer p { margin: 0; color: #91a6b4; font-size: 12px; line-height: 1.5; }

@media (max-width: 600px) {
  .main-content { padding: 32px 0; }
  .telegram-backdrop { inset: -52px -18px; }
  .join-card { padding: 38px 24px 34px; border-radius: 14px; }
  .join-card::after { inset: 10px; border-radius: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .rolling-digit-track { animation: none; }
  .primary-cta { transition: none; }
  .primary-cta::before { animation: none; opacity: 0; }
  .primary-cta:hover { transform: none; }
}
