/* ============================================================
   CODEHUB — Design System
   Author: Built for an Arabic developer portfolio / knowledge hub
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --brand-1: #6d5efc;
  --brand-2: #00d4ff;
  --brand-3: #ff4d8d;
  --brand-4: #ffb800;
  --brand-grad: linear-gradient(135deg, #6d5efc 0%, #00d4ff 100%);
  --brand-grad-2: linear-gradient(135deg, #ff4d8d 0%, #ffb800 100%);

  --bg: #07080f;
  --bg-soft: #0c0e19;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eef1f8;
  --text-soft: #a7b0c4;
  --text-dim: #6f7891;

  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-brand: 0 20px 60px -22px rgba(109, 94, 252, 0.75);
  --max: 1240px;
  --nav-h: 76px;
  --font: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme='light'] {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: rgba(9, 12, 25, 0.04);
  --border: rgba(9, 12, 25, 0.09);
  --border-strong: rgba(9, 12, 25, 0.18);
  --text: #0d1120;
  --text-soft: #4a5468;
  --text-dim: #7c869c;
  --shadow: 0 20px 50px -24px rgba(15, 20, 40, 0.28);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
  font-weight: 400;
  letter-spacing: 0;
  transition: background .4s var(--ease), color .4s var(--ease);
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; }

::selection { background: var(--brand-1); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--brand-1), var(--brand-2));
  border-radius: 99px;
  border: 2px solid var(--bg);
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 24px; }

.section { padding: 96px 0; position: relative; }
.section--tight { padding: 64px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--brand-2);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.22);
  padding: 6px 14px; border-radius: 99px;
  margin-bottom: 18px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 10px var(--brand-2); }

.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.22rem; }

.grad-text {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.grad-text-2 {
  background: var(--brand-grad-2);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

p.lead { color: var(--text-soft); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border-radius: 99px;
  font-weight: 700; font-size: .95rem;
  transition: transform .3s var(--spring), box-shadow .3s var(--ease), background .3s, color .3s, border-color .3s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }

.btn--primary {
  background: var(--brand-grad); color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover { box-shadow: 0 26px 70px -20px rgba(109, 94, 252, 0.95); }

.btn--ghost {
  border: 1px solid var(--border-strong); color: var(--text);
  background: var(--surface);
  backdrop-filter: blur(12px);
}
.btn--ghost:hover { border-color: var(--brand-2); color: var(--brand-2); }

.btn--sm { padding: 9px 18px; font-size: .85rem; }
.btn--block { width: 100%; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .35s var(--ease), border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 28px; width: 100%; }

.logo { display: flex; align-items: center; gap: 11px; font-weight: 900; font-size: 1.15rem; letter-spacing: -.02em; }
.logo__mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--brand-grad);
  display: grid; place-items: center;
  box-shadow: 0 10px 26px -10px rgba(109, 94, 252, .9);
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.logo__mark::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.5) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: shine 4s infinite;
}
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.logo__mark svg { width: 21px; height: 21px; stroke: #fff; }

.nav__links { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav__links a {
  padding: 8px 14px; border-radius: 99px; font-size: .92rem; font-weight: 600;
  color: var(--text-soft); transition: color .25s, background .25s;
}
.nav__links a:hover, .nav__links a.active { color: var(--text); background: var(--surface-2); }
.nav__links a.active { color: var(--brand-2); }

.nav__actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color .25s, color .25s, transform .25s;
}
.icon-btn:hover { border-color: var(--brand-2); color: var(--brand-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; }

.burger { display: none; }

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(24px);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer a { font-size: 1.5rem; font-weight: 800; padding: 10px 24px; }
.drawer .close { position: absolute; top: 22px; inset-inline-end: 24px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: calc(var(--nav-h) + 70px) 0 90px;
  overflow: hidden;
}
.hero__glow {
  position: absolute; border-radius: 50%; filter: blur(110px); opacity: .5; pointer-events: none; z-index: 0;
}
.hero__glow--1 { width: 560px; height: 560px; background: #6d5efc; top: -160px; inset-inline-end: -120px; }
.hero__glow--2 { width: 460px; height: 460px; background: #00d4ff; bottom: -220px; inset-inline-start: -140px; opacity: .32; }
.hero__glow--3 { width: 340px; height: 340px; background: #ff4d8d; top: 30%; inset-inline-start: 40%; opacity: .16; }

.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  opacity: .55;
}

.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; gap: 60px; align-items: center; }

.hero h1 { margin-bottom: 22px; }
.hero h1 .line { display: block; }
.hero__desc { font-size: 1.1rem; color: var(--text-soft); max-width: 540px; margin-bottom: 34px; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }

.hero__stats { display: flex; gap: 38px; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.8rem; font-weight: 900; letter-spacing: -.03em; }
.stat span { font-size: .84rem; color: var(--text-dim); font-weight: 600; }

/* Code window */
.codewin {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(18,22,40,.96), rgba(10,12,22,.98));
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.03) inset;
  position: relative;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.codewin__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
}
.codewin__dots { display: flex; gap: 7px; }
.codewin__dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.codewin__dots i:nth-child(1) { background: #ff5f57; }
.codewin__dots i:nth-child(2) { background: #febc2e; }
.codewin__dots i:nth-child(3) { background: #28c840; }
.codewin__file { font-family: var(--mono); font-size: .78rem; color: #7d88a5; margin-inline-start: 8px; direction: ltr; }
.codewin__body {
  padding: 22px; font-family: var(--mono); font-size: .82rem; line-height: 1.95;
  direction: ltr; text-align: left; overflow-x: auto;
  color: #c8d3ec;
}
.codewin__body .ln { color: #3b4360; display: inline-block; width: 26px; user-select: none; }
.kw { color: #c792ea; } .fn { color: #82aaff; } .str { color: #c3e88d; }
.num { color: #f78c6c; } .cm { color: #5c6784; font-style: italic; } .prop { color: #ffcb6b; }
.var { color: #89ddff; }

.hero__badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.chip {
  font-size: .78rem; font-weight: 700; padding: 6px 13px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
}
.chip--hot { border-color: rgba(255,77,141,.35); color: var(--brand-3); background: rgba(255,77,141,.08); }
.chip--new { border-color: rgba(0,212,255,.35); color: var(--brand-2); background: rgba(0,212,255,.08); }

/* Marquee */
.marquee {
  border-block: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 18px 0; overflow: hidden; position: relative;
}
.marquee::before, .marquee::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2;
}
.marquee::before { inset-inline-start: 0; background: linear-gradient(to left, transparent, var(--bg-soft)); }
.marquee::after { inset-inline-end: 0; background: linear-gradient(to right, transparent, var(--bg-soft)); }
.marquee__track { display: flex; gap: 56px; width: max-content; animation: scrollx 32s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes scrollx { to { transform: translateX(50%); } }
.marquee__item {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .9rem; font-weight: 600;
  color: var(--text-dim); white-space: nowrap; direction: ltr;
  transition: color .25s;
}
.marquee__item:hover { color: var(--brand-2); }
.marquee__item::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-1); }

/* ---------- Audience cards ---------- */
.aud-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.aud-card {
  position: relative; padding: 30px 24px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  overflow: hidden; transition: transform .4s var(--ease), border-color .4s, background .4s;
  display: flex; flex-direction: column; gap: 12px;
}
.aud-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(109,94,252,.16), transparent 65%);
  transition: opacity .4s;
}
.aud-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.aud-card:hover::before { opacity: 1; }
.aud-card > * { position: relative; z-index: 1; }
.aud-card__icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 1.3rem; margin-bottom: 4px;
}
.aud-card h3 { font-size: 1.1rem; }
.aud-card p { font-size: .89rem; color: var(--text-soft); line-height: 1.7; }
.aud-card__link { margin-top: auto; padding-top: 12px; font-size: .85rem; font-weight: 700; color: var(--brand-2); display: inline-flex; gap: 6px; align-items: center; }
.aud-card__link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.4; transform: rotate(180deg); transition: transform .3s; }
.aud-card:hover .aud-card__link svg { transform: rotate(180deg) translateX(-4px); }

/* ---------- Featured / post cards ---------- */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.post-card {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.post-card:hover { transform: translateY(-7px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.post-card__thumb {
  aspect-ratio: 16/9; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1a1f3a, #0d1024);
  display: grid; place-items: center;
}
.post-card__thumb::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(109,94,252,.4), transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(0,212,255,.28), transparent 55%);
}
.post-card__thumb .glyph {
  font-family: var(--mono); font-size: 2.4rem; font-weight: 700;
  color: rgba(255,255,255,.9); position: relative; z-index: 1;
  direction: ltr; text-shadow: 0 4px 24px rgba(0,0,0,.5);
  transition: transform .5s var(--spring);
}
.post-card:hover .post-card__thumb .glyph { transform: scale(1.12) rotate(-4deg); }
.post-card__tagline {
  position: absolute; z-index: 2; top: 12px; inset-inline-start: 12px;
  font-size: .72rem; font-weight: 800; padding: 4px 11px; border-radius: 99px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(8px); color: #fff;
  border: 1px solid rgba(255,255,255,.16);
}
.post-card__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 10px; font-size: .76rem; color: var(--text-dim); font-weight: 600; }
.post-card__meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.post-card h3 { font-size: 1.05rem; line-height: 1.5; }
.post-card p { font-size: .86rem; color: var(--text-soft); line-height: 1.7; flex: 1; }
.post-card__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 4px; }
.lvl { font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.lvl--beginner { background: rgba(40,200,64,.12); color: #34d058; }
.lvl--inter { background: rgba(255,184,0,.12); color: #ffb800; }
.lvl--advanced { background: rgba(255,77,141,.12); color: #ff4d8d; }
.post-card__read { font-size: .8rem; color: var(--text-dim); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Filter tabs ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.filter-btn {
  padding: 9px 18px; border-radius: 99px; font-size: .87rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  transition: all .25s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.active {
  background: var(--brand-grad); color: #fff; border-color: transparent;
  box-shadow: 0 10px 30px -12px rgba(109,94,252,.9);
}

/* ---------- Programs table/cards ---------- */
.prog-card {
  display: flex; gap: 16px; padding: 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color .3s, transform .3s, background .3s;
}
.prog-card:hover { border-color: var(--border-strong); transform: translateX(-4px); background: var(--surface-2); }
.prog-card__ico {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.4rem;
  background: var(--surface-2); border: 1px solid var(--border);
}
.prog-card h4 { font-size: 1rem; margin-bottom: 4px; }
.prog-card p { font-size: .83rem; color: var(--text-soft); line-height: 1.6; }
.prog-card__tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.mini-tag { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-dim); }

/* ---------- AI section ---------- */
.ai-panel {
  border-radius: var(--radius-lg); border: 1px solid var(--border-strong);
  background: linear-gradient(150deg, rgba(109,94,252,.1), rgba(0,212,255,.05) 60%, transparent);
  padding: 44px; position: relative; overflow: hidden;
}
.ai-panel::before {
  content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: var(--brand-1); filter: blur(120px); opacity: .18;
  top: -180px; inset-inline-end: -100px;
}
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; position: relative; z-index: 1; }
.ai-tool {
  padding: 20px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border: 1px solid var(--border);
  transition: border-color .3s, transform .3s;
}
.ai-tool:hover { border-color: var(--brand-2); transform: translateY(-4px); }
.ai-tool .ico { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.ai-tool h4 { font-size: .95rem; margin-bottom: 6px; }
.ai-tool p { font-size: .8rem; color: var(--text-soft); line-height: 1.6; }

/* ---------- Newsletter ---------- */
.newsletter {
  border-radius: var(--radius-lg); padding: 52px 44px; text-align: center;
  border: 1px solid var(--border-strong); position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(109,94,252,.14), rgba(255,77,141,.08));
}
.newsletter__form {
  display: flex; gap: 10px; max-width: 480px; margin: 26px auto 0;
}
.newsletter input {
  flex: 1; padding: 14px 18px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text); font-size: .92rem; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.newsletter input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(0,212,255,.12); }
.newsletter input::placeholder { color: var(--text-dim); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-soft); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer__brand p { font-size: .88rem; color: var(--text-soft); margin: 16px 0 20px; max-width: 300px; line-height: 1.8; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  transition: all .25s;
}
.socials a:hover { border-color: var(--brand-2); color: var(--brand-2); transform: translateY(-3px); }
.socials svg { width: 17px; height: 17px; fill: currentColor; }
.footer h5 { font-size: .82rem; font-weight: 800; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 16px; text-transform: uppercase; }
.footer__col a { display: block; padding: 5px 0; font-size: .89rem; color: var(--text-soft); transition: color .2s, padding-inline-start .2s; }
.footer__col a:hover { color: var(--brand-2); padding-inline-start: 5px; }
.footer__bottom {
  border-top: 1px solid var(--border); padding-top: 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-dim);
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: calc(var(--nav-h) + 64px) 0 48px; position: relative; overflow: hidden; }
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-bottom: 16px; }
.page-hero p { color: var(--text-soft); max-width: 640px; font-size: 1.02rem; }
.breadcrumb { display: flex; gap: 8px; font-size: .82rem; color: var(--text-dim); margin-bottom: 18px; font-weight: 600; }
.breadcrumb a:hover { color: var(--brand-2); }

/* ---------- Article / prose ---------- */
.article-wrap { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 56px; align-items: start; }
.prose { font-size: 1.02rem; color: var(--text-soft); line-height: 1.95; }
.prose > * + * { margin-top: 22px; }
.prose h2 { color: var(--text); font-size: 1.6rem; margin-top: 46px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.prose h3 { color: var(--text); font-size: 1.2rem; margin-top: 34px; }
.prose strong { color: var(--text); font-weight: 800; }
.prose ul, .prose ol { padding-inline-start: 24px; }
.prose ul li { list-style: none; position: relative; padding-inline-start: 22px; margin-top: 10px; }
.prose ul li::before {
  content: ''; position: absolute; inset-inline-start: 0; top: .72em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--brand-grad);
}
.prose ol li { list-style: decimal; margin-top: 10px; padding-inline-start: 6px; }
.prose ol li::marker { color: var(--brand-2); font-weight: 800; }
.prose a { color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose blockquote {
  border-inline-start: 3px solid var(--brand-1); padding: 4px 0 4px 22px;
  background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px; font-size: 1rem; color: var(--text);
}
.prose code:not(pre code) {
  font-family: var(--mono); font-size: .87em; direction: ltr; display: inline-block;
  padding: 2px 7px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--brand-4);
}
.prose pre {
  direction: ltr; text-align: left; overflow-x: auto;
  background: #0b0e1a; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px;
  font-family: var(--mono); font-size: .84rem; line-height: 1.85; color: #c8d3ec;
}
.prose pre code { font-family: inherit; }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td { padding: 11px 14px; border: 1px solid var(--border); text-align: start; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 800; }

.toc {
  position: sticky; top: calc(var(--nav-h) + 24px);
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface);
  padding: 20px;
}
.toc h5 { font-size: .78rem; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 12px; font-weight: 800; text-transform: uppercase; }
.toc a { display: block; font-size: .84rem; color: var(--text-soft); padding: 5px 0; border-inline-start: 2px solid var(--border); padding-inline-start: 12px; transition: all .2s; }
.toc a:hover, .toc a.active { color: var(--brand-2); border-color: var(--brand-2); }

.copy-btn {
  position: absolute; top: 10px; inset-inline-end: 10px;
  font-size: .72rem; font-weight: 700; padding: 5px 12px; border-radius: 8px;
  background: rgba(255,255,255,.08); color: #c8d3ec; border: 1px solid rgba(255,255,255,.12);
  transition: all .2s;
}
.copy-btn:hover { background: var(--brand-1); color: #fff; }
.code-wrap { position: relative; }

/* ---------- Utilities ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

.card {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); padding: 26px;
  transition: border-color .3s, transform .3s;
}
.card:hover { border-color: var(--border-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero__inner { grid-template-columns: 1fr; gap: 44px; }
  .hero__desc { max-width: none; }
  .aud-grid { grid-template-columns: repeat(2, 1fr); }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .article-wrap { grid-template-columns: 1fr; }
  .toc { position: static; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .burger { display: grid; }
  .section { padding: 68px 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .ai-panel, .newsletter { padding: 32px 22px; }
}
@media (max-width: 640px) {
  .aud-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .hero__stats { gap: 24px; }
  .newsletter__form { flex-direction: column; }
  .newsletter__form .btn { width: 100%; }
  .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
