:root {
  --purple: #7e2f9e;
  --ink: #1b1b20;
  --muted: #5d6170;
  --line: #dedee3;
  --card: #f5f5f6;
  --bg: #ffffff;
  --shadow: 0 22px 55px rgba(0, 0, 0, .18);
  --content: 1120px;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.top-stripe { height: 4px; background: var(--purple); }
.site-header {
  height: 66px;
  border-bottom: 1px solid #dfe0e4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 60px);
  background: #fff;
  font-weight: 700;
}
.brand { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.brand-logo { width: 31px; height: 31px; object-fit: cover; display: block; }
.header-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 18px; }
.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid #d9d9df;
  border-radius: 999px;
  background: #f6f6f8;
  font-size: 13px;
  line-height: 1;
}
.lang-link {
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555965;
}
.lang-link:hover { color: var(--purple); }
.lang-link.is-active { background: var(--purple); color: #fff; }
.visit-link { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; white-space: nowrap; }
.challenge-link {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
}
.challenge-link:hover { color: #fff; background: #6c238b; }
.hero {
  min-height: 480px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}
.dot-field {
  position: absolute;
  width: 390px;
  height: 260px;
  opacity: .54;
  background-image: radial-gradient(circle, rgba(26, 26, 32, .36) 1.55px, transparent 1.8px);
  background-size: 14px 14px;
  filter: blur(.2px);
  mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
}
.dot-field-left { left: -14px; top: 42px; }
.dot-field-right { right: -34px; bottom: 28px; }
.hero-inner { width: min(720px, calc(100% - 32px)); text-align: center; transform: translateY(-8px); }
.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -.4px;
  font-weight: 600;
  color: var(--purple);
}
.search { position: relative; z-index: 5; }
.search-box {
  width: min(540px, 100%);
  height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 9px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(27, 27, 32, .04);
  overflow: hidden;
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 16px;
  padding: 0 18px;
  color: var(--ink);
  background: transparent;
}
.search input::placeholder { color: #9295a1; opacity: 1; }
.search button {
  border: 0;
  background: transparent;
  color: #101014;
  cursor: pointer;
  height: 100%;
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-clear { display: none !important; color: #7d808b !important; }
.search.has-query .search-clear { display: inline-flex !important; }
.search-panel {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  max-height: 520px;
  overflow: auto;
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
  text-align: left;
  padding: 12px;
}
.search.has-results .search-panel,
.search.has-empty .search-panel { display: block; }
.search-title { font-weight: 700; font-size: 14px; color: var(--muted); padding: 8px 10px 10px; }
.search-result { display: block; padding: 13px 14px; border-radius: 8px; }
.search-result:hover, .search-result:focus { outline: none; background: #f4f1f6; }
.search-result strong { display: block; margin-bottom: 5px; font-weight: 700; }
.search-result span { display: block; color: #3f4149; font-size: 14px; line-height: 1.45; }
.search-empty { padding: 18px 14px; color: var(--muted); }
.content-section { width: min(var(--content), calc(100% - 48px)); margin: 0 auto; }
.content-section h2 {
  margin: 0 0 32px;
  font-size: clamp(30px, 3.3vw, 34px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -.25px;
}
.popular-section { padding: 38px 0 82px; }
.popular-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 46px 86px; }
.popular-card h3 { margin: 0 0 12px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.popular-card p { margin: 0; font-size: 20px; line-height: 1.46; color: #020207; }
.popular-card:hover h3 { color: var(--purple); }
.categories-section { padding: 0 0 110px; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; align-items: stretch; }
.category-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 445px;
  display: flex;
  flex-direction: column;
}
.category-head { padding: 30px 30px 26px; min-height: 116px; display: block; }
.category-head h3 { margin: 0 0 8px; font-size: 26px; line-height: 1.18; font-weight: 700; }
.category-head p { margin: 0; font-size: 16px; color: #666a77; }
.category-list { border-top: 1px solid var(--line); }
.category-row {
  min-height: 57px;
  padding: 14px 29px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.28;
  font-weight: 700;
}
.category-row:hover { color: var(--purple); background: #fff; }
.category-row svg { flex: 0 0 auto; }
.category-foot { margin-top: auto; padding: 24px 30px 28px; }
.show-all {
  min-width: 154px;
  height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #cfd0d5;
  border-radius: 7px;
  background: #fff;
  font-weight: 700;
  font-size: 17px;
}
.show-all:hover { border-color: var(--purple); color: var(--purple); }
.article-layout {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 90px;
  display: grid;
  grid-template-columns: 230px minmax(0, 720px) 250px;
  gap: 38px;
  align-items: start;
}
.side-search { grid-column: 1 / -1; }
.side-search .search-box { width: min(640px, 100%); height: 54px; box-shadow: 0 14px 40px rgba(0, 0, 0, .12); margin: 0; }
.side-search .search-panel { left: 0; transform: none; width: min(720px, calc(100vw - 48px)); }
.article-main { grid-column: 2; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 22px 0 38px;
  color: #717481;
  font-size: 14px;
}
.breadcrumbs a:hover { color: var(--purple); }
.breadcrumbs .sep { color: #aaacb4; }
.article-document h1, .collection-card h1 {
  margin: 0 0 28px;
  font-size: clamp(36px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -.4px;
  font-weight: 700;
}
.article-body { font-size: 17px; line-height: 1.72; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 0 0 20px; }
.article-body li { margin: 7px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.article-body img { border-radius: 10px; border: 1px solid var(--line); margin: 14px 0; }
.article-body details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  margin: 16px 0;
  background: #fff;
  overflow: hidden;
}
.article-body summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  background: #f7f7f8;
}
.article-body details > :not(summary) { margin-left: 18px; margin-right: 18px; }
.article-body strong, .article-body b { font-weight: 700; }
.article-sidebar {
  grid-column: 3;
  border-left: 1px solid var(--line);
  padding-left: 22px;
  position: sticky;
  top: 18px;
}
.sidebar-topic { display: block; font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.sidebar-list { display: grid; gap: 4px; }
.sidebar-link {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  color: #4a4d57;
  font-size: 14px;
  line-height: 1.35;
}
.sidebar-link:hover, .sidebar-link.is-active { background: #f4f1f6; color: var(--purple); }
.collection-layout { grid-template-columns: minmax(0, 760px); justify-content: center; }
.collection-layout .article-main { grid-column: 1; }
.collection-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
}
.collection-card h1 { padding: 32px 32px 0; margin-bottom: 8px; }
.collection-card > p { padding: 0 32px 28px; margin: 0; color: var(--muted); }
.collection-list { border-top: 1px solid var(--line); }
.collection-item {
  min-height: 62px;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  font-weight: 700;
}
.collection-item:hover { background: #fff; color: var(--purple); }
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px clamp(18px, 5vw, 60px);
  color: #60636e;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-links { display: inline-flex; align-items: center; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--purple); }
.support-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.support-link svg { color: #229ed9; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-header.has-search { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(280px, 460px) minmax(260px, 1fr); gap: 24px; }
.site-header.has-search .brand { justify-self: start; }
.site-header.has-search .header-actions { justify-self: end; }
.header-search { width: 100%; justify-self: center; }
.header-search .search-box { width: 100%; height: 48px; box-shadow: none; background: #f1f1f3; border: 0; border-radius: 9px; }
.header-search .search-panel { top: 52px; }
.flat-page {
  width: min(1120px, calc(100% - 160px));
  margin: 0 auto;
  padding: 64px 0 70px;
}
.flat-page h1 {
  margin: 32px 0 18px;
  font-size: clamp(31px, 3.5vw, 36px);
  line-height: 1.14;
  letter-spacing: -.3px;
}
.flat-list { border-top: 0; }
.collection-item.flat {
  min-height: 60px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  font-size: 20px;
}
.collection-item.flat:hover { background: transparent; color: var(--purple); }
.article-page-wrap { padding: 0 0 48px; }
.article-page {
  width: min(712px, calc(100% - 48px));
  margin: 0 auto;
  padding: 64px 0 0;
}
.article-page .breadcrumbs { margin: 0 0 30px; }
.article-page h1 {
  margin: 0 0 34px;
  font-size: clamp(40px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -.5px;
  font-weight: 800;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  align-items: center;
  margin: 0 0 34px;
  color: #555965;
  font-size: 16px;
  font-weight: 500;
}
.article-page .article-body { font-size: 17px; line-height: 1.54; }
.article-page .article-body p { margin: 0 0 24px; }
.helpful-card {
  width: min(1120px, calc(100% - 160px));
  min-height: 245px;
  margin: 82px auto 0;
  border-radius: 5px;
  background: #f4f4f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.helpful-card h2 { margin: 0 0 36px; font-size: 24px; line-height: 1.2; }
.helpful-actions { display: flex; gap: 24px; }
.helpful-actions button {
  min-width: 108px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid #cfd0d5;
  border-radius: 7px;
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.helpful-actions button:hover { border-color: var(--purple); color: var(--purple); transform: translateY(-1px); }
.helpful-actions button.is-selected { border-color: var(--purple); background: var(--purple); color: #fff; }
.helpful-actions button span { margin-left: 8px; }
.helpful-message { min-height: 22px; margin: 18px 0 0; color: var(--muted); font-weight: 600; }
@media (max-width: 980px) {
  .site-header.has-search { grid-template-columns: 1fr auto; }
  .site-header.has-search .header-search { grid-column: 1 / -1; grid-row: 2; padding-bottom: 12px; }
  .site-header.has-search { height: auto; padding-top: 14px; padding-bottom: 14px; }
  .flat-page, .helpful-card { width: min(100% - 48px, 1120px); }
  .hero { min-height: 390px; }
  .popular-grid { grid-template-columns: 1fr; gap: 30px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .article-main, .article-sidebar { grid-column: 1; }
  .article-sidebar { position: static; border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
}
@media (max-width: 680px) {
  .site-header { padding: 0 18px; }
  .site-header.has-search { padding: 12px 18px; gap: 12px; }
  .header-search .search-box { height: 46px; }
  .flat-page, .helpful-card { width: min(100% - 28px, 1120px); }
  .helpful-card { min-height: 210px; margin-top: 56px; }
  .helpful-actions { gap: 12px; }
  .article-page { width: min(100% - 28px, 712px); padding-top: 44px; }
  .article-page h1 { font-size: 34px; }
  .visit-link { font-size: 0; gap: 0; }
  .visit-link svg { width: 24px; height: 24px; }
  .header-actions { gap: 10px; }
  .language-switch { font-size: 12px; }
  .lang-link { min-width: 30px; height: 26px; padding: 0 8px; }
  .hero { min-height: 345px; }
  .dot-field { opacity: .35; }
  .content-section, .article-layout { width: min(100% - 28px, var(--content)); }
  .popular-section { padding-top: 30px; }
  .popular-card p { font-size: 17px; }
  .category-grid { grid-template-columns: 1fr; gap: 22px; }
  .category-card { min-height: auto; }
  .article-document h1, .collection-card h1 { font-size: 32px; }
  .article-body { font-size: 16px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .footer-links { justify-content: flex-start; }
}
