:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-deep: #4338ca;
  --accent: #a855f7;
  --accent-soft: #ede9fe;
  --cyan: #06b6d4;
  --rose: #f43f5e;
  --emerald: #10b981;
  --amber: #f59e0b;
  --max: 1200px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.03);
  --shadow-md: 0 8px 24px -8px rgba(15,23,42,.10), 0 4px 8px -4px rgba(15,23,42,.06);
  --shadow-lg: 0 24px 48px -16px rgba(79,70,229,.18), 0 8px 16px -8px rgba(15,23,42,.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(99,102,241,.18); color: var(--brand-deep); }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  padding: .75rem 1rem;
  border-radius: 10px;
  background: var(--brand-dark);
  color: #fff;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(226,232,240,.6);
}
.site-nav {
  width: min(var(--max), calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand img { border-radius: 8px; }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .35rem;
  font-size: .92rem;
  font-weight: 600;
}
.nav-links a {
  padding: .5rem .75rem;
  border-radius: 8px;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--surface-soft); color: var(--brand-dark); }
.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  border-radius: 12px;
  padding: .75rem 1.1rem;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.005em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.nav-cta,
.button-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(79,70,229,.55), inset 0 1px 0 rgba(255,255,255,.18);
}
.nav-cta:hover,
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(79,70,229,.55); }
.button-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.button-secondary:hover { border-color: var(--brand); color: var(--brand-deep); }

/* ============ HERO ============ */
.page-hero {
  position: relative;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 5rem 0 3.5rem;
  isolation: isolate;
}
.page-hero::before,
.page-hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  pointer-events: none;
}
.page-hero::before {
  top: -10%;
  left: -8%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(99,102,241,.45), transparent 70%);
}
.page-hero::after {
  top: 10%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(168,85,247,.35), transparent 70%);
}
.page-hero h1 {
  max-width: 880px;
  margin: .5rem 0 1.1rem;
  font-size: clamp(2.25rem, 5.4vw, 4rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 800;
  color: var(--ink);
}
.page-hero p {
  max-width: 720px;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--ink-soft);
  line-height: 1.6;
}
.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--brand-deep);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before,
.section-kicker::before {
  content: '';
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 2px;
}
.hero-actions,
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.75rem;
}
.page-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  margin-top: 1.5rem;
  padding: .55rem .9rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.page-meta .meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.page-meta strong { color: var(--ink); font-weight: 700; }
.page-meta a { color: var(--brand-deep); font-weight: 600; }
.prose-body { display: grid; gap: 1.25rem; }
.prose-body h3 {
  margin: .25rem 0 -.25rem;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}
.prose-body p { margin: 0; color: var(--ink-soft); line-height: 1.7; font-size: 1.02rem; }
.prose-body ul { margin: .25rem 0; padding-left: 1.15rem; color: var(--ink-soft); line-height: 1.65; }
.prose-body ul li { margin-bottom: .35rem; }
.callout {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, var(--surface-soft), #fff);
  padding: 1.1rem 1.25rem;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}
.callout strong { color: var(--brand-deep); }
.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.5rem;
}

/* ============ SECTIONS ============ */
.section,
.cta-band,
.toc,
.article-page > .section {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 4rem 0;
}
.section-compact { padding: 2.5rem 0; }
.section h2,
.cta-band h2,
.toc h2 {
  max-width: 820px;
  margin: .4rem 0 .85rem;
  font-size: clamp(1.65rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--ink);
}
.section > p,
.article-page > p {
  color: var(--ink-soft);
  max-width: 760px;
  font-size: 1.05rem;
}

/* ============ ANSWER BLOCK ============ */
.answer-block {
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem !important;
  background: linear-gradient(135deg, #f8faff 0%, #f5f3ff 100%);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.answer-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}
.answer-block p {
  max-width: 860px;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.6;
  margin: 0;
}
.answer-block .section-kicker { margin-bottom: .35rem; }
.answer-block h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin-top: 0; }

/* ============ CARD GRIDS ============ */
.feature-grid,
.card-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature-grid article,
.card-grid article,
.faq-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem;
  background: var(--surface);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-grid article:hover,
.feature-grid article:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.35);
  box-shadow: var(--shadow-md);
}
.feature-grid h2,
.card-grid h3,
.faq-item h3 {
  margin: 0 0 .5rem;
  font-size: 1.06rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.card-grid p,
.faq-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .96rem;
  line-height: 1.55;
}
.card-grid a { color: var(--brand-deep); }
.card-grid a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ============ ARTICLE LAYOUT ============ */
.split,
.article-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 2.5rem;
  align-items: start;
}
.article-body p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}
.article-body > div > p:first-of-type { color: var(--ink); font-size: 1.08rem; }

figure { margin: 0; }
figure img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: var(--shadow-md);
}
figcaption { margin-top: .75rem; color: var(--muted); font-size: .9rem; }

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}
.showcase-grid img { border-radius: var(--radius); border: 1px solid var(--line); }

/* ============ TABLES ============ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-top: 1.5rem;
}
table { width: 100%; border-collapse: collapse; min-width: 680px; background: #fff; }
th, td { padding: 1rem 1.15rem; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-size: .96rem; }
th { background: var(--surface-soft); color: var(--brand-deep); font-weight: 700; letter-spacing: -.005em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(99,102,241,.025); }

/* ============ FAQ ============ */
.faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.faq-item {
  padding: 1.35rem 1.4rem;
}
.faq-item h3 {
  font-size: 1.02rem;
  color: var(--brand-deep);
}

/* ============ CTA BAND ============ */
.cta-band {
  margin-top: 5rem;
  margin-bottom: 4rem;
  border-radius: var(--radius-lg);
  padding: 3.25rem 2.5rem;
  background:
    radial-gradient(ellipse at top left, rgba(168,85,247,.35), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(6,182,212,.25), transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 56px -16px rgba(79,70,229,.45);
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: .5;
}
.cta-band h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta-band p { max-width: 720px; color: rgba(226,232,240,.85); font-size: 1.05rem; margin: 0; position: relative; }
.cta-band .cta-row { position: relative; }
.cta-band .button-secondary {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
}
.cta-band .button-secondary:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); }
.cta-band .button-primary {
  background: #fff;
  color: var(--brand-deep);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.35);
}
.cta-band .button-primary:hover { background: #fff; color: var(--brand-deep); }

/* ============ TOC ============ */
.toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
}
.toc h2 { font-size: .82rem; margin: 0 .75rem 0 0; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.toc a,
.link-list a {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem .9rem;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .88rem;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.toc a:hover,
.link-list a:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--accent-soft); }

/* ============ STEPS ============ */
.step-list {
  display: grid;
  gap: .85rem;
  padding: 0;
  list-style: none;
  margin-top: 1.5rem;
}
.step-list li {
  display: grid;
  gap: .25rem;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--surface-soft), #fff);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  box-shadow: var(--shadow-sm);
}
.step-list li strong { font-weight: 700; color: var(--ink); }
.step-list li span { color: var(--ink-soft); font-size: .96rem; }

.source-list { padding-left: 1.1rem; color: var(--ink-soft); }
.source-list a { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 3px; }

/* ============ SECTION TINTS ============ */
.section:nth-of-type(even):not(:has(.answer-block)):not(.section-compact) {
  background: linear-gradient(180deg, #fff, var(--surface-soft));
  border-radius: var(--radius-lg);
}

/* ============ FOOTER ============ */
.site-footer {
  margin-top: 5rem;
  padding: 4rem 0 2.5rem;
  background:
    radial-gradient(ellipse at top, rgba(99,102,241,.12), transparent 60%),
    #0b1120;
  color: rgba(226,232,240,.75);
  border-top: 1px solid rgba(99,102,241,.18);
}
.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) 2fr;
  gap: 3rem;
  align-items: start;
}
.footer-brand { display: flex; flex-direction: column; gap: .85rem; }
.site-footer .brand,
.site-footer .brand-footer { color: #fff; font-size: 1.15rem; }
.site-footer p { color: rgba(148,163,184,.85); font-size: .92rem; line-height: 1.6; max-width: 360px; margin: 0; }
.footer-meta { font-size: .8rem !important; color: rgba(148,163,184,.55) !important; letter-spacing: .02em; }
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.footer-col { display: flex; flex-direction: column; gap: .55rem; }
.footer-col h4 {
  margin: 0 0 .35rem;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.footer-col a {
  color: rgba(203,213,225,.78);
  font-size: .92rem;
  font-weight: 500;
  transition: color .15s ease, transform .15s ease;
}
.footer-col a:hover { color: #c7d2fe; transform: translateX(2px); }

/* ============ ARTICLE PAGE ============ */
.article-page > header.page-hero { padding-top: 4rem; padding-bottom: 2rem; }
.article-page { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.article-page > .section,
.article-page > section { width: 100%; padding-left: 0; padding-right: 0; }

/* ============ MOBILE MENU ============ */
.mobile-menu { flex: 1; min-width: 0; }
.mobile-menu summary { display: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary::marker { content: ''; }
.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; }
.hamburger {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: background .2s ease;
}
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s ease, top .2s ease;
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* ============ RESPONSIVE ============ */
/* Large tablets and below: collapse nav into hamburger */
@media (max-width: 960px) {
  .mobile-menu { flex: 0 0 auto; }
  .mobile-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    list-style: none;
  }
  .mobile-menu summary:hover { border-color: var(--brand); }
  .mobile-menu[open] summary { background: var(--surface-soft); border-color: var(--brand); }
  .mobile-menu[open] .hamburger { background: transparent; }
  .mobile-menu[open] .hamburger::before { top: 0; transform: rotate(45deg); }
  .mobile-menu[open] .hamburger::after { top: 0; transform: rotate(-45deg); }
  .mobile-menu .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    gap: .2rem;
    padding: .75rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 60;
  }
  .mobile-menu[open] .nav-links { display: flex; }
  .mobile-menu .nav-links a { padding: .75rem 1rem; font-size: 1rem; border-radius: 8px; }
  .site-nav { position: relative; gap: .75rem; }
  .nav-cta { padding: .65rem .95rem; font-size: .88rem; }
}

/* Tablets */
@media (max-width: 768px) {
  .site-nav { padding: .5rem 0; min-height: 60px; }
  .page-hero { padding: 3.5rem 0 2.5rem; }
  .section, .article-page > .section, .article-page > section { padding: 3rem 0; }
  .cta-band { padding: 2.5rem 1.75rem; margin-top: 3rem; margin-bottom: 2.5rem; }
  .answer-block { padding: 1.75rem 1.5rem !important; }
  .card-grid,
  .card-grid.four,
  .faq-grid,
  .split,
  .article-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .showcase-grid { grid-template-columns: 1fr; }
  .toc { padding: 1rem; }
}

/* Small tablets and large phones */
@media (max-width: 640px) {
  .feature-grid,
  .card-grid,
  .card-grid.two,
  .card-grid.four,
  .faq-grid,
  .article-body,
  .split { grid-template-columns: 1fr; gap: .85rem; }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .article-body { gap: 1.5rem; }
  .page-hero { padding: 2.75rem 0 2rem; }
  .page-hero h1 { font-size: clamp(1.85rem, 7vw, 2.5rem); }
  .cta-band { padding: 2rem 1.5rem; }
  table { min-width: 540px; }
}

/* Phones */
@media (max-width: 480px) {
  .site-nav { padding: .35rem 0; }
  .brand span { font-size: 1.05rem; }
  .nav-cta { padding: .55rem .85rem; font-size: .85rem; min-height: 40px; }
  .page-hero { padding: 2.25rem 0 1.75rem; }
  .section, .article-page > .section, .article-page > section { padding: 2.5rem 0; }
  .hero-actions, .cta-row { flex-direction: column; align-items: stretch; }
  .hero-actions .button, .cta-row .button { width: 100%; }
  .cta-band { padding: 1.75rem 1.25rem; margin-top: 2.5rem; border-radius: 16px; }
  .answer-block { padding: 1.4rem 1.25rem !important; border-radius: 16px; }
  .answer-block p { font-size: 1.02rem; }
  .feature-grid article, .card-grid article, .faq-item { padding: 1.15rem 1.1rem; }
  .footer-nav { grid-template-columns: 1fr; gap: 1.25rem; }
  .step-list li { padding: .85rem 1rem; }
  table { min-width: 0; font-size: .88rem; }
  th, td { padding: .65rem .75rem; }
}

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