/* ===========================================================================
   Afbiz — agency theme
   ========================================================================== */
:root {
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #ffffff;
  --bg-alt: #f5f6fb;
  --ink: #0b1220;
  --ink-soft: #334155;
  --muted: #64748b;
  --border: #e6e9f2;
  --primary: #6366f1;
  --primary-2: #4f46e5;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 52%, #22d3ee 100%);
  --grad-2: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #ecfeff 100%);
  --dark: #070c18;
  --dark-2: #0d1426;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .06);
  --shadow: 0 8px 30px rgba(11, 18, 32, .08);
  --shadow-lg: 0 24px 60px rgba(11, 18, 32, .16);
  --maxw: 1160px;
  --header-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); color: var(--ink);
  background: var(--bg); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0; color: var(--ink); font-weight: 700; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 3px solid rgba(99, 102, 241, .45); outline-offset: 2px; border-radius: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 15px 28px; font-size: 16px; }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-primary { background: var(--grad-2); color: #fff; box-shadow: 0 8px 24px rgba(99, 102, 241, .35); }
.btn-primary:hover { box-shadow: 0 12px 32px rgba(99, 102, 241, .48); }
.btn-light { background: #fff; color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); }
.btn-light:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .24); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Badge / chip */
.badge {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary); background: #eef2ff; padding: 6px 12px; border-radius: 999px;
}
.badge-light { color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); }
.chip {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary);
  background: #eef2ff; padding: 4px 10px; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.chip:hover { background: var(--primary); color: #fff; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--grad); border-radius: 10px; color: #fff; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { font-size: 15px; font-weight: 500; color: var(--ink-soft); transition: color .15s ease; }
.main-nav a:hover { color: var(--primary); }
.main-nav a.nav-mobile-only { display: none; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--border);
  background: #fff; border-radius: 12px; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Language switcher */
.lang-switch { position: relative; }
.lang-current {
  display: inline-flex; align-items: center; gap: 7px; background: #fff;
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.lang-current svg { width: 16px; height: 16px; }
.lang-current .chev { transition: transform .2s ease; }
.lang-switch.open .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 150px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); list-style: none; margin: 0; padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu li a, .lang-menu li .active {
  display: block; padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-soft);
}
.lang-menu li a:hover { background: #f1f3f9; }
.lang-menu li .active { color: var(--primary); background: #eef2ff; font-weight: 600; }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--dark); color: #fff; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 60% at 15% 20%, rgba(99, 102, 241, .45), transparent 60%),
    radial-gradient(50% 50% at 85% 15%, rgba(34, 211, 238, .28), transparent 60%),
    radial-gradient(50% 60% at 50% 110%, rgba(139, 92, 246, .35), transparent 60%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 0%, transparent 100%);
}
.hero-inner { position: relative; padding: 96px 24px 88px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-title { font-size: clamp(38px, 6vw, 68px); color: #fff; letter-spacing: -0.03em; }
.hero-title .grad {
  background: linear-gradient(135deg, #a5b4fc 0%, #22d3ee 55%, #67e8f9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 640px; margin-top: 20px; font-size: 18px; color: rgba(255, 255, 255, .78); }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }
.hero-stats { display: flex; gap: 48px; margin-top: 56px; flex-wrap: wrap; justify-content: center; }
.stat { text-align: center; }
.stat strong { display: block; font-family: var(--font-display); font-size: 32px; font-weight: 700; background: linear-gradient(135deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 13.5px; color: rgba(255, 255, 255, .65); }

/* Sections */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { color: var(--muted); font-size: 17px; }
.center { text-align: center; margin-top: 44px; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service {
  display: flex; flex-direction: column; gap: 12px; padding: 30px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.service:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.service-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--grad-soft); color: var(--primary); }
.service-icon svg { width: 24px; height: 24px; }
.service h3 { font-size: 21px; }
.service p { color: var(--muted); font-size: 15px; flex: 1; }
.service-link { font-weight: 600; color: var(--primary); font-size: 14.5px; }

/* Grid + cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--grad-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-media-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--primary); background: var(--grad-soft); }
.card-media-fallback svg { width: 42px; height: 42px; }
.card-body { display: flex; flex-direction: column; gap: 12px; padding: 22px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-meta time { font-size: 12.5px; color: var(--muted); }
.card-title { font-size: 19px; line-height: 1.3; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { color: var(--muted); font-size: 14.5px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.card-link { font-weight: 600; font-size: 14.5px; color: var(--primary); display: inline-flex; gap: 6px; align-items: center; }
.card-link:hover span { transform: translateX(3px); }
.card-link span { transition: transform .18s ease; }
.reading-time { font-size: 12.5px; color: var(--muted); }

/* Categories */
.categories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.category-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 28px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.category-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.category-card h3 { font-size: 22px; }
.category-card .count { color: var(--muted); font-size: 14px; }
.category-arrow { position: absolute; right: 22px; bottom: 22px; font-size: 20px; color: var(--primary); opacity: 0; transform: translateX(-6px); transition: opacity .2s ease, transform .2s ease; }
.category-card:hover .category-arrow { opacity: 1; transform: translateX(0); }

/* CTA band */
.cta-band { background: var(--grad-2); color: #fff; }
.cta-inner { padding: 72px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cta-inner h2 { color: #fff; font-size: clamp(26px, 4vw, 38px); }
.cta-inner p { color: rgba(255, 255, 255, .85); max-width: 560px; font-size: 16.5px; }

/* Page hero (list / terms) */
.page-hero { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 64px 0; }
.page-hero .container { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.page-title { font-size: clamp(30px, 5vw, 46px); }
.page-sub { color: var(--muted); font-size: 17px; max-width: 620px; }

/* Article hero */
.article-hero { background: var(--dark); color: #fff; padding: 72px 0 56px; }
.article-hero-inner { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.article-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.article-title { color: #fff; font-size: clamp(30px, 5vw, 48px); }
.article-desc { color: rgba(255, 255, 255, .78); font-size: 18px; }
.article-meta { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .65); font-size: 14.5px; }
.article-meta .dot { color: rgba(255, 255, 255, .4); }

/* Article layout */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 48px; padding-bottom: 72px; align-items: start; }
.article-main { min-width: 0; }
.article-featured { margin: 0 0 8px; }
.article-featured img { border-radius: var(--radius-lg); width: 100%; }

/* Prose (article body) */
.prose { font-size: 17px; line-height: 1.8; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; margin-top: 1.6em; }
.prose h3 { font-size: 22px; margin-top: 1.5em; }
.prose h4 { font-size: 18px; margin-top: 1.4em; }
.prose p { margin: 0 0 1em; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: .4em 0; }
.prose blockquote {
  margin: 1.4em 0; padding: 16px 20px; border-left: 4px solid var(--primary);
  background: #f6f7fd; border-radius: 0 12px 12px 0; color: var(--ink-soft); font-style: italic;
}
.prose img { border-radius: var(--radius); }
.prose code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9em; background: #f1f3f9; padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--dark-2); color: #e2e8f0; padding: 18px; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.prose th { background: var(--bg-alt); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* Table of contents */
.article-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.toc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.toc-title { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.toc #TableOfContents ul { list-style: none; margin: 0; padding: 0; }
.toc #TableOfContents li { margin: 8px 0; font-size: 14.5px; line-height: 1.4; }
.toc #TableOfContents li ul { padding-left: 14px; margin-top: 8px; }
.toc #TableOfContents a { color: var(--ink-soft); transition: color .15s ease; }
.toc #TableOfContents a:hover { color: var(--primary); }

/* FAQ */
.faq { margin-top: 48px; }
.faq-title { font-size: 26px; margin-bottom: 20px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 18px 20px; font-weight: 600; font-size: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--primary); transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 20px 18px; color: var(--ink-soft); font-size: 15.5px; }

/* Article nav + back */
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.article-nav-link { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.article-nav-link:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.article-nav-link.next { text-align: right; }
.article-nav-link .dir { font-size: 13px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; }
.article-nav-link .t { font-weight: 600; font-size: 15px; color: var(--ink); }
.back-link { display: inline-block; margin-top: 28px; font-weight: 600; color: var(--primary); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 48px; }
.page-link { font-weight: 600; color: var(--primary); }
.page-info { color: var(--muted); font-size: 14.5px; }

/* Footer */
.site-footer { background: var(--dark); color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 64px 24px 48px; }
.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand .brand-name { color: #fff; }
.footer-tagline { color: rgba(255, 255, 255, .62); font-size: 15px; max-width: 320px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.footer-col a { color: rgba(255, 255, 255, .66); font-size: 15px; transition: color .15s ease; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 22px 0; }
.footer-bottom p { color: rgba(255, 255, 255, .5); font-size: 13.5px; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; padding: 72px 0; }
.notfound-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.nf-code { font-family: var(--font-display); font-size: clamp(90px, 18vw, 160px); font-weight: 700; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf-title { font-size: clamp(26px, 4vw, 36px); }
.nf-text { color: var(--muted); font-size: 17px; }
.nf-actions { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .services, .categories-grid, .grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 16px 24px 22px; transform: translateY(-8px);
    opacity: 0; visibility: hidden; transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .main-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .main-nav a { padding: 12px 0; font-size: 17px; }
  .main-nav a.nav-mobile-only { display: block; color: var(--primary); font-weight: 600; }
  .header-actions .btn-sm { display: none; }
  .section { padding: 60px 0; }
  .hero-inner { padding: 72px 20px 64px; }
  .hero-stats { gap: 28px; }
}
@media (max-width: 560px) {
  .services, .categories-grid, .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-nav { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}




