:root {
  --bg: #f4f3fb;
  --surface: #ffffff;
  --surface-alt: #ece9f9;
  --text: #1f1b38;
  --muted: #625d7f;
  --primary: #5042a8;
  --primary-2: #6b5fd3;
  --accent: #58b8a0;
  --border: #d8d3ef;
  --code-bg: #221f3a;
  --code-text: #e9e6ff;
  --shadow: 0 8px 30px rgba(38, 29, 84, 0.08);
  --header-h: 78px;
  --container: min(1320px, 94vw);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(195, 177, 230, 0.1) 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #f9f8fe 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell {
  width: var(--container);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  background: linear-gradient(135deg, rgba(249, 248, 254, 0.95) 0%, rgba(245, 243, 255, 0.92) 100%);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, rgba(91, 78, 194, 0.3), rgba(88, 184, 160, 0.3)) 1;
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand-icon {
  font-size: 1.25rem;
}

.main-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

a,
button,
.nav-link,
.hero-btn,
.hub-card,
input,
textarea,
select {
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: 160ms ease;
  background: transparent;
}

.nav-link:hover {
  background: linear-gradient(135deg, rgba(236, 233, 249, 0.8), rgba(127, 168, 159, 0.2));
  border-color: var(--border);
  transform: translateY(-2px);
}

.nav-link:active {
  transform: translateY(0);
}

.nav-link.is-active {
  background: linear-gradient(135deg, #5042a8 0%, #6b5fd3 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(80, 66, 168, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.site-main {
  width: var(--container);
  flex: 1;
  padding-block: 2rem 3rem;
}

.site-footer {
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, rgba(91, 78, 194, 0.3), rgba(88, 184, 160, 0.3)) 1;
  background: linear-gradient(180deg, #f8f7fd 0%, #ede8f5 100%);
}

.footer-inner {
  min-height: 84px;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.hero {
  background: linear-gradient(130deg, #43388b, #6157c8 60%, #5bb8a6 120%);
  color: white;
  border-radius: 22px;
  padding: clamp(1.2rem, 2.8vw, 2.8rem);
  box-shadow: var(--shadow);
  animation: slideInDown 0.6s ease-out;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.hero h1 {
  margin: 0.3rem 0 0.8rem;
  line-height: 1.2;
  max-width: 24ch;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  animation: slideInDown 0.7s ease-out;
}

.hero p {
  max-width: 68ch;
}

.hero-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.65rem 0.95rem;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.hero-btn:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hero-btn:active {
  transform: translateY(-2px);
}

.hero-btn-icon {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
}

.hub-grid {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hub-grid > * {
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: both;
}

.hub-grid > :nth-child(1) { animation-delay: 0.1s; }
.hub-grid > :nth-child(2) { animation-delay: 0.2s; }
.hub-grid > :nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hub-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 1rem 1.1rem;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(127, 168, 159, 0.15), transparent);
  transition: left 500ms ease;
}

.hub-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, rgba(139, 123, 168, 0.05), transparent);
  pointer-events: none;
}

.hub-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(38, 29, 84, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border-color: var(--primary-2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(195, 177, 230, 0.1) 100%);
}

.hub-card a {
  text-decoration: none;
  color: var(--text);
  transition: color 180ms ease;
}

.hub-card a:hover {
  color: var(--primary);
}

.home-section {
  margin-top: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.quick-links {
  margin: 0;
  padding-left: 1.25rem;
}

.quick-links a {
  color: var(--primary);
}

.breadcrumbs {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1rem;
  animation: fadeIn 0.4s ease-out 0.2s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 140ms ease;
}

.breadcrumbs a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.4vw, 2rem);
  animation: fadeIn 0.5s ease-out;
}

.article > :first-child {
  margin-top: 0;
}

.article h1,
.article h2,
.article h3 {
  color: #261d54;
}

.article h1 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  animation: slideInLeft 0.6s ease-out;
  background: linear-gradient(135deg, #261d54 0%, #4a3266 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.article h2 {
  margin-top: 2rem;
  margin-bottom: 0.7rem;
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  background: linear-gradient(90deg, #2d1b45 0%, #5b4ec2 70%, #58b8a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #5b4ec2, #58b8a0) 1;
  padding-bottom: 0.5rem;
  animation: slideInLeft 0.5s ease-out;
  transition: all 200ms ease;
}

.article h2:hover {
  transform: translateX(8px);
  text-shadow: 0 2px 8px rgba(91, 78, 194, 0.1);
}

.article h3 {
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: #362251;
  animation: slideInLeft 0.5s ease-out;
  animation-delay: 0.1s;
  animation-fill-mode: both;
  transition: all 140ms ease;
  padding-left: 0;
}

.article h3:hover {
  padding-left: 0.5rem;
  color: #5b4ec2;
}

.article h4 {
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
  font-weight: 640;
  color: #3d2959;
  letter-spacing: -0.005em;
  line-height: 1.35;
  animation: slideInLeft 0.5s ease-out;
  animation-delay: 0.15s;
  animation-fill-mode: both;
  transition: all 140ms ease;
}

.article h4:hover {
  color: #5b4ec2;
  transform: translateX(4px);
}

.article h5 {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  font-weight: 630;
  color: #4a3266;
  animation: slideInLeft 0.5s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: both;
  transition: color 140ms ease;
}

.article h5:hover {
  color: #58b8a0;
}

.article h6 {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  font-size: 1rem;
  font-weight: 620;
  color: #5a4577;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: slideInLeft 0.5s ease-out;
  animation-delay: 0.25s;
  animation-fill-mode: both;
  transition: all 140ms ease;
}

.article h6:hover {
  color: #58b8a0;
  letter-spacing: 0.08em;
}

.article h2,
.article h3 {
  scroll-margin-top: calc(var(--header-h) + 18px);
}

.article h2 > a.heading-anchor,
.article h3 > a.heading-anchor {
  color: inherit;
  text-decoration: none;
}

.article h2 > a.heading-anchor::after,
.article h3 > a.heading-anchor::after {
  content: " #";
  color: var(--primary-2);
  margin-left: 0.25rem;
  text-decoration: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

.article h2:hover > a.heading-anchor::after,
.article h3:hover > a.heading-anchor::after,
.article h2:focus-within > a.heading-anchor::after,
.article h3:focus-within > a.heading-anchor::after {
  opacity: 1;
}

.article p,
.article li {
  line-height: 1.7;
}

.article a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: all 140ms ease;
}

.article a:hover {
  text-decoration-color: var(--primary);
}

.article a:active {
  transform: scale(0.98);
}

.article blockquote {
  margin: 1rem 0;
  border-left: 4px solid var(--accent);
  background: #f7fbfa;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
}

.article pre,
.article :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
}

.article :not(pre) > code {
  background: linear-gradient(135deg, #f0edf8 0%, #e8dff5 100%);
  border: 1px solid #d9d0f6;
  border-radius: 6px;
  padding: 0.12rem 0.35rem;
  font-size: 0.92em;
}

.code-wrap {
  position: relative;
  margin: 1rem 0;
}

.article pre {
  margin: 0;
  overflow-x: auto;
  background: #f5f4fb;
  color: #23203e;
  border: 1px solid #d6d1ea;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: all 200ms ease;
}

.article pre:hover {
  border-color: var(--primary-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 12px rgba(107, 95, 211, 0.08);
}

.copy-btn {
	position: absolute;
	top: 0.55rem;
	right: 0.55rem;
  border: 1px solid #c7c0e6;
  background: #ffffff;
  color: #2f2954;
	border-radius: 8px;
	padding: 0.25rem 0.5rem;
	font-size: 0.78rem;
	cursor: pointer;
	transition: all 140ms ease;
	opacity: 0.7;
}

.copy-btn:hover {
  background: #f2effd;
  border-color: var(--primary-2);
	opacity: 1;
	transform: scale(1.05);
}

.copy-btn:active {
  transform: scale(0.95);
}

code[class*="language-"],
pre[class*="language-"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
  font-size: 1em;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #708090;
}

.token.punctuation {
  color: #999;
}

.token.namespace {
  opacity: 0.7;
}

.token.boolean,
.token.constant,
.token.deleted,
.token.number,
.token.property,
.token.symbol,
.token.tag {
  color: #905;
}

.token.attr-name,
.token.builtin,
.token.char,
.token.inserted,
.token.selector,
.token.string {
  color: #690;
}

.language-css .token.string,
.style .token.string,
.token.entity,
.token.operator,
.token.url {
  color: #9a6e3a;
  background: hsla(0, 0%, 100%, 0.5);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #07a;
}

.token.class-name,
.token.function {
  color: #dd4a68;
}

.token.important,
.token.regex,
.token.variable {
  color: #e90;
}

.token.bold,
.token.important {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 200ms ease;
}

.article table:hover {
  border-color: var(--primary-2);
  box-shadow: 0 0 12px rgba(107, 95, 211, 0.08);
}

.article th,
.article td {
  border: 1px solid var(--border);
  padding: 0.6rem;
  text-align: left;
}

.article th {
  background: linear-gradient(90deg, #efeafa, #f4f0fc);
  transition: background 200ms ease;
}

.article tr:hover {
  background: rgba(80, 66, 168, 0.04);
}

.article details {
  border: 1px solid var(--border);
  background: #faf8fe;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin-block: 0.75rem;
  transition: all 200ms ease;
}

.article details:hover {
  border-color: var(--primary-2);
  background: #fcfbfe;
}

.article summary {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  transition: color 140ms ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.article summary:hover {
  color: var(--primary);
}

.article details[open] > summary {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.related {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  animation: fadeInUp 0.5s ease-out 0.3s both;
}

.related ul > li {
  transition: all 140ms ease;
  padding: 0.2rem 0;
}

.related ul > li:hover {
  padding-left: 0.4rem;
}

.related a {
  color: var(--primary);
  text-decoration: none;
  transition: all 140ms ease;
}

.related a:hover {
  text-decoration: underline;
  text-decoration-color: var(--primary);
  transform: translateX(4px);
  display: inline-block;
}

/* FAQ section styling - make questions stand out from answers */
.article > :is(h2, h3)#frequently-asked-questions ~ :is(p, ul, ol),
.article > :is(h2, h3)#faq ~ :is(p, ul, ol) {
  margin-top: 0.9rem;
}

.article > :is(h2, h3)#frequently-asked-questions ~ p,
.article > :is(h2, h3)#faq ~ p {
  padding: 0.85rem 1rem 0.9rem;
  border-left: 3px solid #e4dff8;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(236, 233, 249, 0.4));
}

.article > :is(h2, h3)#frequently-asked-questions ~ p > strong:first-child,
.article > :is(h2, h3)#faq ~ p > strong:first-child {
  display: block;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.article > :is(h2, h3)#frequently-asked-questions ~ p > strong:first-child::after,
.article > :is(h2, h3)#faq ~ p > strong:first-child::after {
  content: "";
  display: block;
  height: 0.15rem;
}

.article > :is(h2, h3)#frequently-asked-questions ~ p:hover > strong:first-child,
.article > :is(h2, h3)#faq ~ p:hover > strong:first-child {
  color: var(--primary-2);
}

/* Strong styling for terms in lists acting as FAQ-like items */
.article ul > li > strong,
.article ol > li > strong {
  color: var(--primary);
  font-weight: 700;
  transition: color 140ms ease;
}

.article ul > li:hover > strong,
.article ol > li:hover > strong {
  color: var(--primary-2);
}

@media (max-width: 940px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: flex-start;
    padding-block: 0.8rem;
    min-height: unset;
    flex-direction: column;
    background: linear-gradient(180deg, transparent 0%, rgba(91, 78, 194, 0.03) 100%);
  }

  :root {
    --header-h: 132px;
  }
}

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