/* ==========================================================================
   style.css — everything below the fold. Loaded asynchronously; the first
   screen is already painted from the inlined critical.css, so nothing here
   may affect header, hero, highlights or breadcrumbs layout.
   ========================================================================== */

/* --- Language menu ------------------------------------------------------- */

.language-menu {
  position: absolute;
  z-index: 90;
  right: 0;
  top: calc(100% + var(--sp-2));
  width: 17rem;
  max-height: min(70vh, 32rem);
  padding: var(--sp-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
}
.language-menu a {
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  align-items: center;
  gap: var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--step--1);
  transition: background .15s ease, color .15s ease;
}
.language-menu a:hover { background: var(--surface-2); color: var(--text); }
.language-menu a.active { background: var(--accent-soft); color: var(--accent-text); }
.language-menu a b { font-size: var(--step--2); font-weight: 800; }
.language-menu a span { white-space: nowrap; }

/* --- Content layout ------------------------------------------------------ */

.content-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem);
  padding-block: clamp(3.5rem, 6vw, 5.5rem) clamp(4rem, 7vw, 6.5rem);
}

.toc {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + var(--sp-5));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc > span {
  margin-bottom: var(--sp-2);
  color: var(--text-faint);
  font-size: var(--step--2);
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.toc > a {
  padding: var(--sp-2) var(--sp-3);
  border-left: 2px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: var(--step--1);
  line-height: 1.4;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.toc > a:hover { color: var(--text); background: var(--surface); }
.toc > a[aria-current="true"] {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.toc-promo {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.toc-promo small {
  display: block;
  color: var(--text-faint);
  font-size: var(--step--2);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.toc-promo strong {
  display: block;
  margin: var(--sp-2) 0 var(--sp-3);
  color: var(--pop-text);
  font-size: var(--step-1);
  font-weight: 800;
}
.toc-promo button {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--step--2);
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.toc-promo button:hover { border-color: var(--accent-line); }

.article { min-width: 0; }

/* --- Notice -------------------------------------------------------------- */

.notice {
  margin-bottom: var(--sp-9);
  padding: var(--sp-5);
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: var(--sp-4);
  border: 1px solid var(--pop-line);
  border-radius: var(--radius);
  background: var(--pop-soft);
}
.notice > b {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--pop);
  color: var(--pop-ink);
  font-size: 18px;
}
.notice p {
  align-self: center;
  color: var(--text);
  font-size: var(--step--1);
  line-height: 1.65;
}

/* --- Article sections ---------------------------------------------------- */

.article-section {
  scroll-margin-top: calc(var(--header-h) + var(--sp-5));
  padding-bottom: clamp(3rem, 5vw, 4.5rem);
}
.article-section + .article-section {
  padding-top: clamp(2.75rem, 4.5vw, 4rem);
  border-top: 1px solid var(--line);
}
.article-section:empty { display: none; }

.section-number {
  display: inline-block;
  color: var(--accent-text);
  font-size: var(--step--2);
  font-weight: 800;
  letter-spacing: .16em;
}

.article h2 {
  max-width: 22ch;
  margin: var(--sp-2) 0 var(--sp-5);
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.028em;
}

.article-section > p {
  max-width: 68ch;
  margin-bottom: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--step-1);
  line-height: 1.75;
}

/* --- Info cards ---------------------------------------------------------- */

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.info-card {
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.info-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.info-card > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: var(--step--2);
  font-weight: 800;
}
.info-card:nth-child(3n+1) > span { background: var(--accent-soft); color: var(--accent-text); }
.info-card:nth-child(3n+2) > span { background: var(--info-soft); color: var(--info); }
.info-card h3 {
  margin: var(--sp-4) 0 var(--sp-2);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -.01em;
}
.info-card p {
  color: var(--text-muted);
  font-size: var(--step--1);
  line-height: 1.65;
}

/* --- Guide links --------------------------------------------------------- */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}
.guide-grid a {
  min-height: 11rem;
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.guide-grid a:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  background: var(--surface-2);
}
.guide-grid span {
  color: var(--text-faint);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.guide-grid strong {
  margin: var(--sp-4) 0;
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.guide-grid em {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--accent-text);
  font-size: var(--step--2);
  font-style: normal;
  font-weight: 700;
}

/* --- Conversion card ----------------------------------------------------- */

.conversion-card {
  position: relative;
  margin-bottom: clamp(3rem, 5vw, 5rem);
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-7);
  overflow: hidden;
  border: 1px solid var(--pop-line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 70% 120% at 85% 0%, var(--pop-soft), transparent 70%),
    var(--surface);
}
.conversion-card > div { position: relative; z-index: 2; }
.conversion-card span {
  color: var(--text-faint);
  font-size: var(--step--2);
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.conversion-card h2 {
  margin: var(--sp-2) 0 var(--sp-3);
  color: var(--pop-text);
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -.01em;
}
.conversion-card p {
  max-width: 56ch;
  color: var(--text-muted);
  font-size: var(--step--1);
  line-height: 1.6;
}
.conversion-actions {
  display: flex;
  flex-shrink: 0;
  gap: var(--sp-2);
}

/* --- FAQ ----------------------------------------------------------------- */

.faq-section { padding-bottom: 0; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  min-height: 72px;
  padding: var(--sp-4) var(--sp-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  cursor: pointer;
  list-style: none;
  font-size: var(--step-1);
  font-weight: 600;
  transition: color .18s ease;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--accent-text); }
.faq-list summary i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  font-style: normal;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.faq-list details[open] summary i {
  transform: rotate(45deg);
  background: var(--accent);
  color: var(--accent-ink);
}
.faq-list details > p {
  max-width: 68ch;
  margin: 0 0 var(--sp-5);
  color: var(--text-muted);
  font-size: var(--step-0);
  line-height: 1.7;
}

/* --- Telegram band ------------------------------------------------------- */

.telegram-band {
  position: relative;
  padding-block: clamp(3.5rem, 6vw, 5rem);
  overflow: hidden;
  border-block: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 100% at 15% 50%, var(--info-soft), transparent 70%),
    var(--bg-elev);
}
.telegram-band-inner {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.telegram-orbit {
  width: 9rem;
  height: 9rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 2rem color-mix(in srgb, var(--info) 6%, transparent),
    0 0 0 4rem color-mix(in srgb, var(--info) 3%, transparent);
}
.telegram-orbit > span {
  width: 4.5rem;
  height: 4.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--info);
  color: var(--info-ink);
  font-size: 26px;
}
.telegram-band-inner > div:nth-child(2) > span {
  color: var(--info);
  font-size: var(--step--2);
  font-weight: 800;
  letter-spacing: .14em;
}
.telegram-band h2 {
  margin: var(--sp-2) 0;
  max-width: 20ch;
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.025em;
}
.telegram-band p { color: var(--text-muted); font-size: var(--step--1); }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  padding-block: var(--sp-7);
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-faint);
}
.footer-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-6);
}
.footer-brand { color: var(--text); }
.site-footer p { font-size: var(--step--2); }
.site-footer nav {
  max-width: 34rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2) var(--sp-5);
  font-size: var(--step--2);
}
.site-footer nav a { transition: color .18s ease; }
.site-footer nav a:hover { color: var(--accent-text); }

/* --- Mobile CTA + toast -------------------------------------------------- */

.mobile-cta { display: none; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: var(--sp-6);
  min-width: 12rem;
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- Rendering hints -----------------------------------------------------
   Deliberately NOT applied to .article-section. Those are the targets of the
   table-of-contents anchors, and contain-intrinsic-size is only an estimate:
   while it is wrong, the document height is wrong too, which is what makes
   anchor scrolling land imprecisely. The saving across three to six sections
   is small next to a table of contents that jumps, so only blocks nothing
   links into get it. */

.telegram-band,
.site-footer {
  content-visibility: auto;
}
.telegram-band { contain-intrinsic-size: auto 20rem; }
.site-footer { contain-intrinsic-size: auto 12rem; }

/* --- Below-the-fold responsive ------------------------------------------- */

@media (max-width: 1120px) {
  .content-layout { grid-template-columns: 12.5rem minmax(0, 1fr); gap: var(--sp-7); }
}

@media (max-width: 860px) {
  .content-layout { display: block; }
  .toc { display: none; }

  .telegram-band-inner { grid-template-columns: 7.5rem 1fr; }
  .telegram-band .button { grid-column: 2; justify-self: start; }
  .telegram-orbit { width: 6.5rem; height: 6.5rem; }
  .telegram-orbit > span { width: 3.25rem; height: 3.25rem; font-size: 20px; }

  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-brand, .site-footer nav { justify-self: center; }
  .site-footer nav { justify-content: center; }
}

@media (max-width: 620px) {
  .language-menu {
    position: fixed;
    left: var(--sp-3);
    right: var(--sp-3);
    top: calc(var(--header-h) + var(--sp-1));
    width: auto;
  }

  .info-grid, .guide-grid { grid-template-columns: 1fr; }

  .conversion-card { display: block; }
  .conversion-actions { margin-top: var(--sp-5); flex-direction: column; }
  .conversion-actions .button { width: 100%; }

  .telegram-band-inner {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: var(--sp-6);
  }
  .telegram-band h2 { margin-inline: auto; }
  .telegram-band .button { width: 100%; }

  .site-footer { padding-bottom: var(--sp-7); }

  .mobile-cta {
    position: fixed;
    z-index: 60;
    left: 0;
    right: 0;
    bottom: 0;
    height: 76px;
    padding: var(--sp-2) var(--sp-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    border-top: 1px solid var(--line-strong);
    background: color-mix(in srgb, var(--bg-elev) 95%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .mobile-cta > div { display: flex; flex-direction: column; min-width: 0; }
  .mobile-cta small {
    color: var(--text-faint);
    font-size: var(--step--2);
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  .mobile-cta strong {
    color: var(--pop-text);
    font-size: var(--step--1);
    font-weight: 800;
  }
  .mobile-cta a {
    min-height: 48px;
    padding: 0 var(--sp-4);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
    background: var(--pop);
    color: var(--pop-ink);
    font-size: var(--step--1);
    font-weight: 800;
  }

  .toast { left: var(--sp-4); right: var(--sp-4); bottom: 92px; transform: translateY(12px); }
  .toast.show { transform: translateY(0); }
}

@media print {
  .site-header, .mobile-cta, .toast, .toc, .conversion-card, .telegram-band, .hero-media { display: none; }
  body { background: #fff; color: #000; padding: 0; }
}

.site-footer .disclosure {
  display: block;
  margin-top: var(--sp-2);
  max-width: 46ch;
  color: var(--text-faint);
  font-size: var(--step--2);
  line-height: 1.5;
}
@media (max-width: 860px) { .site-footer .disclosure { margin-inline: auto; } }
