/* ==========================================================================
   AI-T — blog stylesheet (knowledge base)
   Shared by the article list and every article page.
   Dark theme by default; light via :root[data-theme="light"].
   Design tokens mirror the main ai-t.org site (Space Grotesk, cyan→violet).
   ========================================================================== */

*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }

/* ── DARK THEME (default) ── */
:root {
  --font-display:'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --bg:#0b0d12; --bg2:#11141b; --bg3:#161a23; --bg4:#1c212d;
  --border:rgba(255,255,255,0.08); --border2:rgba(255,255,255,0.16);
  --text:#eef1f7; --muted:#8b93a7; --muted2:#a3aabd;
  --accent:#7cf8ff; --accent2:#a070ff; --on-accent:#0b0d12;
  --shadow-md:0 10px 32px rgba(0,0,0,0.40); --shadow-lg:0 24px 64px rgba(0,0,0,0.55);
  /* category colours (dark) */
  --c-sites:#7cf8ff; --c-shop:#5ce8a0; --c-seo:#c79bff; --c-ai:#ffb070;
  --c-software:#ff8a9b; --c-bigdata:#6fd6e6; --c-vps:#a070ff; --c-servers:#ffd66b;
}

/* ── LIGHT THEME ── */
:root[data-theme="light"] {
  --bg:#f7f7f4; --bg2:#ffffff; --bg3:#f1f1ec; --bg4:#e9e9e2;
  --border:rgba(20,23,31,0.10); --border2:rgba(20,23,31,0.20);
  --text:#14171f; --muted:#545b6d; --muted2:#3c4253;
  --accent:#2c6cff; --accent2:#8b3dff; --on-accent:#ffffff;
  --shadow-md:0 8px 24px rgba(20,23,31,0.08); --shadow-lg:0 24px 56px rgba(20,23,31,0.14);
  --c-sites:#0a73a8; --c-shop:#1f9d57; --c-seo:#7b3fc4; --c-ai:#c25e10;
  --c-software:#c43850; --c-bigdata:#0a7d92; --c-vps:#6d3fd6; --c-servers:#b5860a;
}
:root[data-theme="light"] header { background:rgba(255,255,255,0.82); }
:root[data-theme="light"] .blog-card { box-shadow:var(--shadow-md); }
.theme-toggle .icon-sun { display:none; } .theme-toggle .icon-moon { display:block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display:block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display:none; }

html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  background:var(--bg); color:var(--text);
  font-family:var(--font-display);
  font-size:16px; line-height:1.6; min-height:100vh; overflow-x:hidden;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  transition:background-color .35s, color .35s;
}
a { color:inherit; text-decoration:none; }
img { max-width:100%; display:block; }
button { font:inherit; cursor:pointer; }
::selection { background:var(--accent); color:var(--on-accent); }
.container { max-width:1200px; margin:0 auto; padding:0 24px; }

/* ── HEADER ── */
header { position:sticky; top:0; z-index:100; background:rgba(11,13,18,0.78); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-bottom:1px solid var(--border); }
.header-inner { max-width:1200px; margin:0 auto; height:68px; padding:0 24px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.logo-mark { display:flex; align-items:center; gap:11px; }
.logo-mark .badge-logo { width:34px; height:34px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.logo-mark .badge-logo svg { width:30px; height:30px; }
.logo-mark .name { font-size:19px; font-weight:700; letter-spacing:-.4px; }
.logo-mark .name .accent { color:var(--accent2); }
nav.main-nav { display:flex; gap:4px; }
nav.main-nav a { color:var(--muted2); font-size:14px; font-weight:500; padding:8px 14px; border-radius:999px; border:1px solid transparent; transition:.2s; }
nav.main-nav a:hover, nav.main-nav a.active { color:var(--text); background:var(--surface,rgba(255,255,255,0.04)); border-color:var(--border); }
.header-cta { display:inline-flex; align-items:center; gap:8px; padding:9px 18px; border-radius:999px; background:linear-gradient(135deg,var(--accent),var(--accent2)); color:var(--on-accent); font-size:13px; font-weight:600; box-shadow:0 8px 22px rgba(124,248,255,0.20); transition:.2s; }
.header-cta:hover { transform:translateY(-1px); box-shadow:0 12px 30px rgba(160,112,255,0.32); }
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:999px; background:transparent; border:1px solid var(--border); color:var(--muted2); padding:0; transition:.2s; flex-shrink:0; }
.theme-toggle:hover { color:var(--accent); border-color:var(--accent); transform:translateY(-1px); }
.theme-toggle svg { width:18px; height:18px; }
.menu-trigger { display:none; background:transparent; border:none; color:var(--text); }

/* ── MOBILE MENU ── */
.mobile-menu { position:fixed; inset:0; z-index:200; background:rgba(11,13,18,0.96); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); display:none; flex-direction:column; align-items:center; justify-content:center; gap:22px; padding:24px; }
.mobile-menu.open { display:flex; }
.mobile-menu a { font-size:22px; font-weight:600; color:var(--text); transition:color .2s; }
.mobile-menu a:hover { color:var(--accent); }
.mobile-menu a.header-cta { color:var(--on-accent); font-size:15px; margin-top:6px; }
.mobile-menu .close { position:absolute; top:18px; right:18px; width:44px; height:44px; border-radius:12px; background:var(--bg2); border:1px solid var(--border); color:var(--text); display:flex; align-items:center; justify-content:center; }
:root[data-theme="light"] .mobile-menu { background:rgba(247,247,244,0.97); }

/* ── BLOG HERO (list) ── */
.blog-hero { position:relative; padding:64px 0 40px; overflow:hidden; }
.blog-hero::before { content:""; position:absolute; inset:0; background:radial-gradient(700px 320px at 50% -10%, rgba(124,248,255,0.16), transparent 70%); pointer-events:none; }
.bh-inner { position:relative; max-width:760px; margin:0 auto; text-align:center; }
.bh-tag { display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); border:1px solid var(--border); padding:6px 14px; border-radius:999px; margin-bottom:18px; }
.bh-tag .pulse { width:8px; height:8px; border-radius:50%; background:var(--accent); animation:pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(124,248,255,.5);} 70%{box-shadow:0 0 0 10px rgba(124,248,255,0);} 100%{box-shadow:0 0 0 0 rgba(124,248,255,0);} }
.blog-hero h1 { font-size:clamp(30px,5vw,48px); line-height:1.1; letter-spacing:-1px; margin-bottom:16px; }
.blog-hero h1 em { font-style:normal; background:linear-gradient(135deg,var(--accent),var(--accent2)); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.blog-hero p { color:var(--muted); font-size:17px; max-width:620px; margin:0 auto; }

/* ── SEARCH ── */
.blog-search { max-width:520px; margin:26px auto 0; position:relative; }
.blog-search input { width:100%; padding:14px 18px 14px 46px; border-radius:999px; border:1px solid var(--border2); background:var(--bg2); color:var(--text); font-size:15px; outline:none; transition:.2s; font-family:var(--font-display); }
.blog-search input:focus { border-color:var(--accent); box-shadow:0 0 0 4px rgba(124,248,255,.12); }
.blog-search svg { position:absolute; left:16px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--muted); }

/* ── CATEGORY FILTER ── */
.filters { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin:36px auto 0; max-width:960px; }
.chip { font-size:13px; font-weight:600; padding:8px 16px; border-radius:999px; border:1px solid var(--border); background:var(--bg2); color:var(--muted2); cursor:pointer; transition:.2s; font-family:var(--font-display); }
.chip:hover { color:var(--text); border-color:var(--border2); }
.chip.active { color:var(--on-accent); background:linear-gradient(135deg,var(--accent),var(--accent2)); border-color:transparent; }

/* ── ARTICLE GRID ── */
.blog-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; padding:48px 0 80px; }
.blog-card { display:flex; flex-direction:column; background:var(--bg2); border:1px solid var(--border); border-radius:18px; overflow:hidden; transition:transform .25s, border-color .25s, box-shadow .25s; }
.blog-card:hover { transform:translateY(-4px); border-color:var(--border2); box-shadow:var(--shadow-lg); }
.bc-cover { height:120px; position:relative; display:flex; align-items:flex-end; padding:16px; background:linear-gradient(135deg,var(--cat,var(--accent)) 0%, transparent 130%); }
.bc-cover::before { content:""; position:absolute; inset:0; background:var(--bg3); opacity:.55; }
.bc-ico { position:relative; width:46px; height:46px; border-radius:12px; background:var(--bg2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--cat,var(--accent)); }
.bc-ico svg { width:24px; height:24px; }
.bc-body { padding:20px; display:flex; flex-direction:column; flex:1; }
.bc-cat { font-size:12px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--cat,var(--accent)); margin-bottom:10px; }
.bc-body h2 { font-size:18px; line-height:1.35; margin-bottom:10px; }
.bc-body h2 a:hover { color:var(--accent); }
.bc-body p { font-size:14px; color:var(--muted); margin-bottom:16px; flex:1; }
.bc-meta { display:flex; align-items:center; gap:14px; font-size:12.5px; color:var(--muted); border-top:1px solid var(--border); padding-top:14px; }
.bc-meta .read { display:inline-flex; align-items:center; gap:5px; }
.bc-meta .read svg { width:13px; height:13px; }
.bc-link { margin-left:auto; color:var(--accent); font-weight:600; display:inline-flex; align-items:center; gap:5px; }
.bc-link svg { width:14px; height:14px; }
.no-results { grid-column:1/-1; text-align:center; color:var(--muted); padding:60px 0; display:none; }

/* ── BLOG CTA (list) ── */
.blog-cta { max-width:900px; margin:0 auto 80px; background:linear-gradient(135deg,rgba(124,248,255,.10),rgba(160,112,255,.08)); border:1px solid var(--border2); border-radius:22px; padding:40px; text-align:center; }
.blog-cta h3 { font-size:24px; margin-bottom:10px; }
.blog-cta p { color:var(--muted); margin-bottom:22px; }

/* ── READING PROGRESS ── */
.read-progress { position:fixed; top:0; left:0; height:3px; width:0; background:linear-gradient(90deg,var(--accent),var(--accent2)); z-index:200; transition:width .1s; }

/* ── BREADCRUMBS ── */
.crumbs { font-size:13px; color:var(--muted); padding:22px 0 0; }
.crumbs a:hover { color:var(--accent); }
.crumbs span { margin:0 8px; opacity:.5; }

/* ── ARTICLE HEAD ── */
.art-head { max-width:760px; margin:0 auto; padding:26px 0 8px; }
.art-cat { display:inline-block; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--cat,var(--accent)); border:1px solid var(--border); padding:5px 12px; border-radius:999px; margin-bottom:18px; }
.art-head h1 { font-size:clamp(28px,4.4vw,42px); line-height:1.15; letter-spacing:-0.6px; margin-bottom:18px; }
.art-meta { display:flex; flex-wrap:wrap; align-items:center; gap:16px; font-size:13.5px; color:var(--muted); padding-bottom:8px; border-bottom:1px solid var(--border); }
.art-meta .av { display:inline-flex; align-items:center; gap:8px; }
.art-meta .av span.badge { width:30px; height:30px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:inline-flex; align-items:center; justify-content:center; color:var(--on-accent); font-weight:700; font-size:11px; }
.art-meta .dotsep::before { content:"•"; margin-right:16px; opacity:.4; }

/* ── LAYOUT: article + TOC ── */
.art-layout { display:grid; grid-template-columns:1fr 260px; gap:48px; max-width:1060px; margin:0 auto; padding:36px 0 64px; align-items:start; }
.art-body { max-width:720px; font-size:16.5px; line-height:1.7; }
.art-body .lead { font-size:19px; color:var(--muted2); margin-bottom:28px; }
.art-body h2 { font-size:26px; letter-spacing:-0.3px; margin:38px 0 14px; scroll-margin-top:90px; }
.art-body h3 { font-size:19px; margin:26px 0 10px; }
.art-body p { margin-bottom:16px; }
.art-body ul, .art-body ol { margin:0 0 18px 0; padding-left:0; list-style:none; }
.art-body ul li { position:relative; padding-left:28px; margin-bottom:10px; }
.art-body ul li::before { content:""; position:absolute; left:6px; top:11px; width:7px; height:7px; border-radius:50%; background:var(--accent); }
.art-body ol { counter-reset:n; }
.art-body ol li { position:relative; padding-left:34px; margin-bottom:10px; counter-increment:n; }
.art-body ol li::before { content:counter(n); position:absolute; left:0; top:0; width:22px; height:22px; border-radius:50%; background:var(--bg3); border:1px solid var(--border); color:var(--accent); font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.art-body strong { color:var(--text); font-weight:650; }
.art-body a:not(.header-cta) { color:var(--accent); border-bottom:1px solid transparent; transition:.2s; }
.art-body a:not(.header-cta):hover { border-bottom-color:var(--accent); }

/* comparison table */
.cmp { width:100%; border-collapse:collapse; margin:8px 0 24px; font-size:14.5px; border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.cmp th, .cmp td { padding:13px 16px; text-align:left; border-bottom:1px solid var(--border); }
.cmp thead th { background:var(--bg3); font-size:13px; }
.cmp tbody tr:last-child td { border-bottom:none; }
.cmp td:first-child { color:var(--muted2); font-weight:600; }

/* callout */
.callout { background:linear-gradient(135deg,rgba(124,248,255,.10),rgba(160,112,255,.06)); border:1px solid var(--border2); border-left:3px solid var(--accent); border-radius:12px; padding:18px 20px; margin:24px 0; }
.callout strong { color:var(--accent); }

/* TOC */
.toc { position:sticky; top:90px; font-size:14px; }
.toc h4 { font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:12px; }
.toc a { display:block; color:var(--muted2); padding:6px 0 6px 14px; border-left:2px solid var(--border); transition:.2s; }
.toc a:hover, .toc a.active { color:var(--accent); border-left-color:var(--accent); }

/* ── FAQ ── */
.faq-wrap { max-width:760px; margin:0 auto; padding:8px 0 56px; }
.faq-wrap h2 { font-size:26px; margin-bottom:20px; }
.faq-item { border:1px solid var(--border); border-radius:14px; background:var(--bg2); margin-bottom:12px; overflow:hidden; }
.faq-item summary { list-style:none; cursor:pointer; padding:18px 22px; font-size:16px; font-weight:600; display:flex; justify-content:space-between; align-items:center; gap:16px; }
.faq-item summary::-webkit-details-marker { display:none; }
.faq-item summary::after { content:"+"; font-size:22px; color:var(--accent); line-height:1; }
.faq-item[open] summary::after { content:"−"; }
.faq-item .ans { padding:0 22px 20px; color:var(--muted); }

/* ── ARTICLE CTA ── */
.art-cta { max-width:760px; margin:0 auto 56px; background:linear-gradient(135deg,rgba(124,248,255,.14),rgba(160,112,255,.08)); border:1px solid var(--border2); border-radius:20px; padding:34px; text-align:center; }
.art-cta h3 { font-size:22px; margin-bottom:10px; }
.art-cta p { color:var(--muted); margin-bottom:20px; }

/* ── RELATED ── */
.related { max-width:1060px; margin:0 auto; padding:8px 0 72px; }
.related h2 { font-size:24px; margin-bottom:22px; }
.rel-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.rel-card { background:var(--bg2); border:1px solid var(--border); border-radius:16px; padding:20px; transition:.25s; }
.rel-card:hover { transform:translateY(-3px); border-color:var(--border2); box-shadow:var(--shadow-md); }
.rel-card .rc-cat { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--accent); }
.rel-card h3 { font-size:16px; line-height:1.4; margin:10px 0; }
.rel-card h3 a:hover { color:var(--accent); }
.rel-card .rc-link { color:var(--accent); font-weight:600; font-size:14px; }

/* ── FOOTER ── */
footer { border-top:1px solid var(--border); padding:56px 0 28px; background:var(--bg2); }
.footer-grid { display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr; gap:40px; }
.footer-col h5 { font-size:14px; margin-bottom:16px; }
.footer-col ul { list-style:none; }
.footer-col li { font-size:13.5px; color:var(--muted2); margin-bottom:9px; }
.footer-col a:hover { color:var(--accent); }
.footer-brand p.tagline { font-size:13px; color:var(--muted); margin:16px 0; max-width:320px; }
.footer-socials { display:flex; gap:8px; }
.footer-socials a { width:36px; height:36px; border:1px solid var(--border); border-radius:10px; display:flex; align-items:center; justify-content:center; color:var(--muted2); transition:.2s; }
.footer-socials a:hover { color:var(--accent); border-color:var(--accent); transform:translateY(-2px); }
.footer-socials svg { width:18px; height:18px; }
.footer-bottom { margin-top:40px; padding-top:24px; border-top:1px solid var(--border); display:flex; flex-wrap:wrap; gap:14px; justify-content:space-between; font-size:12.5px; color:var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width:980px) {
  .blog-grid { grid-template-columns:repeat(2,1fr); }
  .footer-grid { grid-template-columns:1fr 1fr; }
  .art-layout { grid-template-columns:1fr; gap:0; }
  .toc { display:none; }
  .rel-grid { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  nav.main-nav, .header-cta { display:none; }
  .menu-trigger { display:flex; }
  .blog-grid { grid-template-columns:1fr; }
  .footer-grid { grid-template-columns:1fr; gap:28px; }
}
