:root {
  --bg: #FFFFFF;
  --section-bg: #F4F5F7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: #1E1B2E;
  --muted: #4B5563;
  --muted-2: #6B7280;
  --border: #E5E7EB;
  --shadow-card: 0 18px 45px rgba(2, 6, 23, 0.10);
  --shadow-soft: 0 10px 25px rgba(2, 6, 23, 0.08);

  --accent: #7C3AED;
  --accent-2: #6D28D9;
  --accent-bg: #F3E8FF;
  --pink: #EC4899;
  --pink-2: #DB2777;
  --grad: linear-gradient(90deg, #7C3AED 0%, #EC4899 100%);
  --ring: rgba(124, 58, 237, 0.35);

  --trouble-bg: #FFF1F2;
  --trouble-border: #FBCFE8;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  /* Match masterclass landing: system UI sans stack. */
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  line-height: 1.45;
  overflow-x: clip;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 10px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 18px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background atmosphere */
.bg {
  position: relative;
  isolation: isolate;
}
.bg::before,
.bg::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  /* Avoid 100vw (can include scrollbar width and cause horizontal overflow). */
  width: min(1600px, 100%);
  top: -120px;
  height: 520px;
  background:
    radial-gradient(closest-side, rgba(141, 60, 220, 0.18), rgba(141, 60, 220, 0) 70%),
    radial-gradient(closest-side, rgba(236, 72, 153, 0.14), rgba(236, 72, 153, 0) 70%),
    radial-gradient(closest-side, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0) 72%);
  filter: blur(12px);
  z-index: -2;
  pointer-events: none;
}
.bg::after {
  top: auto;
  bottom: -180px;
  opacity: 0.7;
}

.mobilebar {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(255, 250, 247, 0.70);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand__logo {
  width: 66px;
  height: 66px;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(141, 60, 220, 0.18);
  background: #fff;
}
.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand__name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__tag {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.70);
  border-color: rgba(15, 23, 42, 0.06);
  text-decoration: none;
}
.nav a[aria-current="page"] {
  background: rgba(141, 60, 220, 0.10);
  border-color: rgba(141, 60, 220, 0.20);
}
.nav__menu {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  user-select: none;
  text-decoration: none;
  transition: transform 0.10s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.btn:hover { text-decoration: none; opacity: 0.95; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 26px rgba(124, 58, 237, 0.18);
}
.btn--primary:hover {
  box-shadow: 0 16px 34px rgba(124, 58, 237, 0.22);
}
.btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--secondary:hover {
  background: var(--accent-bg);
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.10);
}
.btn--sm { height: 40px; padding: 0 14px; font-size: 13px; font-weight: 600; border-radius: 12px; }
.btn--lg { padding: 0 22px; font-size: 15px; font-weight: 600; }

/* Hub (simple instructions site) */
body.hub {
  background: var(--bg);
}
.hub-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.hub-top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.hub-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: var(--text);
}
.hub-brand__logo {
  /* Horizontal logo (like on the masterclass site). */
  width: auto;
  height: 48px;
  display: block;
  object-fit: contain;
  /* Header logo: no "card" container around the image. */
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
}

@media (max-width: 420px) {
  .hub-brand__logo { height: 42px; }
}
.hub-brand__text { display: flex; flex-direction: column; min-width: 0; }
.hub-brand__title {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 16px;
  line-height: 1.05;
}
.hub-brand__sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.1;
}
.hub-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.hub-back:hover { text-decoration: underline; }

.hub-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hub-actions--center { justify-content: center; }

.hub-main { padding: 20px 0 0; }
.hub-section { padding: 26px 0; }
.hub-head { padding: 10px 0 18px; }
.hub-h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 800;
}
.hub-h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.hub-lead {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 70ch;
  font-size: 16px;
}
.hub-accent { color: var(--accent); font-weight: 600; }

.hub-search {
  display: grid;
  gap: 8px;
  margin: 10px 0 18px;
}
.hub-search__label { font-weight: 600; font-size: 13px; color: var(--muted); }
.hub-search__input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 15px;
}
.hub-search__input:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.hub-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.hub-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  align-content: start;
}
.hub-card:hover {
  border-color: #D8B4FE;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.08);
}
.hub-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-bg);
  border: 1px solid rgba(124, 58, 237, 0.20);
  font-size: 22px;
}
.hub-card__title {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 700;
}
.hub-card__text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.hub-card__btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.hub-card__btn:hover { text-decoration: none; background: var(--accent-bg); }

.hub-section--faq { background: var(--section-bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hub-faq { display: grid; gap: 10px; }
.hub-faq__item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 14px 14px;
}
.hub-faq__item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  list-style: none;
}
.hub-faq__item summary::-webkit-details-marker { display: none; }
.hub-faq__body { padding: 8px 2px 2px; color: var(--muted); }
.hub-faq__body p { margin: 0; }

.hub-section--cta { text-align: center; }
.hub-cta { display: grid; gap: 12px; justify-items: center; padding: 12px 0; }

.hub-footer {
  padding: 22px 0 18px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.hub-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.hub-footer__title { font-weight: 600; font-size: 13px; }
.hub-footer__link { font-weight: 600; }
.hub-footer__links a { font-weight: 600; color: var(--muted); }
.hub-footer__links a:hover { text-decoration: underline; }
.hub-footer__copy {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}

.hub-article {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.06);
}
.hub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 13px;
}
.hub-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--section-bg);
  font-weight: 600;
  color: var(--text);
}
.hub-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.hub-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Steps + troubleshooting blocks for instruction pages */
.hub-article.prose ol {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  counter-reset: hubstep;
  display: grid;
  gap: 24px;
}
.hub-article.prose ol > li {
  counter-increment: hubstep;
  margin: 0;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: #fff;
}
.hub-article.prose ol > li::before {
  content: "Крок " counter(hubstep);
  display: block;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}
.hub-trouble {
  margin-top: 10px;
  background: var(--trouble-bg);
  border: 1px solid var(--trouble-border);
  border-radius: 16px;
  padding: 18px;
}
.hub-trouble > :first-child { margin-top: 0; }
.hub-trouble > :last-child { margin-bottom: 0; }

@media (max-width: 980px) {
  .hub-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hub-cards { grid-template-columns: 1fr; }
  .hub-top__inner .btn { width: 100%; }
  .hub-h1 { font-size: 28px; }
}

.hero {
  padding: 34px 0 10px;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: stretch;
}
.hero__card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.hero__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 220px at 15% 10%, rgba(141, 60, 220, 0.18), rgba(141, 60, 220, 0) 55%),
    radial-gradient(520px 200px at 90% 20%, rgba(236, 72, 153, 0.14), rgba(236, 72, 153, 0) 55%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  padding: 30px 26px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(141, 60, 220, 0.10);
  color: #3b1b68;
  font-weight: 700;
  font-size: 12px;
}
.title {
  margin: 14px 0 10px;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.title .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 62ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.hero__note {
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 12px;
}
.hero__aside {
  display: grid;
  gap: 14px;
}
.mini {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px;
}
.mini__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.mini__text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.section {
  padding: 22px 0 34px;
}
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 160px at 15% 0%, rgba(141, 60, 220, 0.12), transparent 60%);
  pointer-events: none;
  opacity: 0.65;
}
.card__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(141, 60, 220, 0.10);
  color: #3b1b68;
}
.card__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 18px rgba(2,6,23,0.06);
  font-size: 18px;
}
.card__title {
  position: relative;
  margin: 10px 0 6px;
  font-size: 15px;
  letter-spacing: -0.02em;
  font-weight: 900;
}
.card__text {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.card__link {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
}
.card:hover {
  transform: translateY(-1px);
  transition: transform 0.15s ease;
  box-shadow: 0 22px 50px rgba(2,6,23,0.12);
}
.card:hover .card__title { text-decoration: underline; }

.legal {
  padding: 26px 0 40px;
}
.legal__wrap {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 22px 18px;
}
.framewrap {
  margin-top: 14px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow-soft);
}
.frame {
  width: 100%;
  min-height: 920px;
  border: 0;
  display: block;
  background: #fff;
}
.prose {
  max-width: 76ch;
}
.prose h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.prose h2 {
  margin: 20px 0 8px;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.prose p { margin: 10px 0; color: var(--text); }
.prose a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prose ul, .prose ol { margin: 10px 0 10px 18px; }
.prose li { margin: 7px 0; color: var(--text); }
.prose blockquote {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #D8B4FE;
  background: var(--accent-bg);
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 6px;
  border-radius: 8px;
}
.prose hr {
  border: none;
  height: 1px;
  background: rgba(15, 23, 42, 0.10);
  margin: 18px 0;
}
.prose figure { margin: 14px 0; }
.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: var(--shadow-soft);
  background: #fff;
}
.prose figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.80);
  color: var(--text);
  font-weight: 700;
}

.footer {
  margin-top: auto;
  padding: 26px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
}
.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.footer__logo {
  width: 60px;
  height: 60px;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(2,6,23,0.08);
}
.footer__title {
  margin: 0;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.footer__muted {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.footer__links a {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255,255,255,0.70);
}
.footer__links a:hover {
  text-decoration: none;
  border-color: rgba(141, 60, 220, 0.25);
  box-shadow: 0 12px 20px rgba(141, 60, 220, 0.10);
}
.footer__copy {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

/* Mobile */
@media (max-width: 920px) {
  .hero__grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav__menu { display: inline-flex; }
  .topbar__inner { padding: 12px 0; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .mobilebar {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    background: rgba(255, 250, 247, 0.80);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
  }
  .mobilebar__inner {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .mobilebar a {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255,255,255,0.78);
    color: var(--text);
    font-weight: 900;
    font-size: 12px;
    text-decoration: none;
  }
  .mobilebar a:hover { text-decoration: none; }
  .mobilebar a[aria-current="page"] {
    border-color: rgba(141, 60, 220, 0.25);
    box-shadow: 0 12px 20px rgba(141, 60, 220, 0.10);
  }
}
