/* ---------- tokens ---------- */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --text: #12161f;
  --muted: #5a6373;
  --line: #e4e7ee;
  --brand: #1677d2;
  --brand-2: #22a3e6;
  --brand-ink: #0d64b5;
  --hot: #e5484d;
  --hot-bg: #fdecec;
  --ok: #15803d;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1015;
    --surface: #151a21;
    --surface-2: #1c222b;
    --text: #e9edf3;
    --muted: #9ba5b4;
    --line: #262e39;
    --brand: #2b8ae6;
    --brand-2: #3cb4f0;
    --brand-ink: #6cb8ff;
    --hot: #ff6b70;
    --hot-bg: #3a1c1f;
    --ok: #4ade80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 16px/1.6 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 3px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main > section, main > aside, main > article, main > div { margin-block: 48px; }
main > nav.crumbs + section { margin-top: 16px; }
.small { font-size: .875rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: 700 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-tg {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 6px 18px rgba(22, 119, 210, .32);
}
.btn-tg:hover { box-shadow: 0 10px 24px rgba(22, 119, 210, .42); }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-light { color: #0d4f8f; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn-sm { min-height: 38px; padding: 8px 16px; font-size: .925rem; }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1.075rem; }
.btn-block { display: flex; width: 100%; }
.tg-ico { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); }
.logo-mark .tg-ico { width: 20px; height: 20px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 560px) {
  .logo-text { display: none; }
  .hide-sm { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; text-align: center;
  padding: clamp(40px, 8vw, 88px) 0 clamp(24px, 4vw, 40px);
  margin-top: 0 !important;
}
.hero::before {
  content: ""; position: absolute; inset: -40px -50vw 0; z-index: -1;
  background:
    radial-gradient(600px 280px at 50% 0%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 70%),
    radial-gradient(400px 200px at 80% 30%, color-mix(in srgb, var(--hot) 10%, transparent), transparent 70%);
}
.hero h1 { max-width: 20ch; margin-inline: auto; text-wrap: balance; }
.hero-sm { padding-top: 24px; }
.hero-sm h1 { max-width: 22ch; }
.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); color: var(--muted); max-width: 62ch; margin-inline: auto; }
.grad { background: linear-gradient(120deg, var(--brand-2), var(--brand) 50%, var(--hot)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 28px 0 20px; }
.hero-emoji { display: inline-grid; place-items: center; width: 64px; height: 64px; font-size: 32px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 16px; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; color: var(--muted); font-size: .925rem; font-weight: 600; }

/* ---------- sections ---------- */
.sec-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { margin: 0; }
.more { font-weight: 700; text-decoration: none; }
.search input {
  width: min(320px, 100%); min-height: 44px; padding: 10px 16px 10px 40px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238a93a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 14px 50% no-repeat;
  color: var(--text); font: inherit;
}
.search { flex: 1 1 220px; display: flex; justify-content: flex-end; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* ---------- categories ---------- */
.chips-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chips-row .cat { flex-direction: row; padding: 10px 16px; border-radius: 999px; gap: 8px; }
.chips-row .cat-emoji { font-size: 1.1rem; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 18px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.cat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.cat-emoji { font-size: 1.6rem; line-height: 1; }
.cat-name { font-weight: 700; }
.cat-count { font-size: .825rem; color: var(--muted); }
@media (max-width: 640px) {
  .chips-row { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding: 4px 16px 10px; scrollbar-width: none; }
  .chips-row::-webkit-scrollbar { display: none; }
  .chips-row .cat { flex: none; scroll-snap-align: start; }
}

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-top { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.card-top:hover h3 { color: var(--brand-ink); }
.card-head { min-width: 0; }
.card h3 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc { color: var(--muted); font-size: .925rem; margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.avatar {
  --h: 210;
  flex: none; display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 16px; object-fit: cover;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 85% 62%), hsl(calc(var(--h) + 40) 80% 48%));
}
.avatar-lg { width: 88px; height: 88px; border-radius: 24px; font-size: 2.6rem; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: .8rem; color: var(--muted); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .75rem; background: var(--surface-2); color: var(--muted); }
.badge-hot { background: var(--hot-bg); color: var(--hot); }

/* ---------- CTA band ---------- */
.band {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px;
  padding: clamp(24px, 4vw, 40px); border-radius: 24px; color: #fff;
  background:
    radial-gradient(400px 200px at 90% 0%, rgba(255, 255, 255, .22), transparent 70%),
    linear-gradient(135deg, #1b8fe0, #1260b8);
  box-shadow: var(--shadow-lg);
}
.band h2 { margin-bottom: 6px; }
.band p { margin: 0; opacity: .92; max-width: 52ch; }

/* ---------- steps / summary / faq ---------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps li { counter-increment: s; position: relative; padding: 20px 20px 20px 70px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li::before { content: counter(s); position: absolute; left: 20px; top: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); }
.steps strong { display: block; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: .925rem; }
.summary { padding: 18px 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); }
.summary strong { display: block; margin-bottom: 6px; color: var(--brand-ink); }
.summary ul { margin: 0; padding-left: 1.2em; }
.summary p { margin: 0; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 700; padding: 16px 28px 16px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 16px; margin: 0; }

/* ---------- prose / article ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }
.article { margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 44px); box-shadow: var(--shadow); }
.article h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
.article .summary { margin: 20px 0; }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide { display: flex; flex-direction: column; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s; }
.guide:hover { transform: translateY(-2px); }
.guide h2 { font-size: 1.15rem; }
.guide p { color: var(--muted); flex: 1; }
.guide .more { color: var(--brand-ink); }

/* ---------- group page ---------- */
.group { max-width: 680px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow); display: grid; gap: 18px; }
.group-head { display: flex; align-items: center; gap: 18px; }
.group-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); margin-bottom: 8px; }
.group .lead { margin: 0; text-align: left; }
.group .small { margin: -6px 0 0; }

/* ---------- breadcrumbs ---------- */
.crumbs { margin-top: 20px; font-size: .875rem; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

/* ---------- footer ---------- */
.footer { margin-top: 80px; padding: 48px 0 120px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; margin-bottom: 28px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-grid nav a { color: var(--muted); text-decoration: none; font-size: .925rem; }
.footer-grid nav a:hover { color: var(--text); }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-bottom: 6px; }
.legal { border-top: 1px solid var(--line); padding-top: 20px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer { padding-bottom: 48px; } }

/* ---------- sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky-cta.show { transform: none; }
@media (min-width: 900px) { .sticky-cta { display: none; } }

/* ---------- age gate ---------- */
.age-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(8, 12, 18, .55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.age-gate[hidden] { display: none; }
.age-box { width: min(420px, 100%); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px 24px 24px; box-shadow: var(--shadow-lg); }
.age-badge { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-weight: 900; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, var(--hot), #b4232a); margin-bottom: 14px; }
.age-box h2 { font-size: 1.45rem; }
.age-box p { color: var(--muted); font-size: .95rem; }
.age-actions { display: grid; gap: 10px; margin-top: 18px; }
body.locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
