/* =========================================================
   DARK CODE — Responsive
   Breakpoints: 1180 / 900 / 640 / 400
   ========================================================= */

/* ---------- 1180px : tighten grids, keep 2-col hero ---------- */
@media (max-width:1180px){
  :root{--section-pad:72px;}
  .container{padding:0 24px;}
  .category-grid{grid-template-columns:repeat(5,1fr);}
  .topic-grid{grid-template-columns:repeat(4,1fr);}
  .lang-grid{grid-template-columns:repeat(4,1fr);}
  .feature-grid{grid-template-columns:repeat(3,1fr);}
}

/* ---------- 900px : hero stacks, nav collapses ---------- */
@media (max-width:900px){
  .hero .container{grid-template-columns:1fr;}
  .hero-copy{order:1;}
  .hero-visual{order:2;margin-top:8px;}
  .hero-copy p.lede{max-width:none;}
  .hero-actions{margin-bottom:36px;}
  .fic{display:none;}

  .category-grid{grid-template-columns:repeat(4,1fr);}
  .topic-grid{grid-template-columns:repeat(3,1fr);}
  .lang-grid{grid-template-columns:repeat(3,1fr);}
  .feature-grid{grid-template-columns:repeat(2,1fr);}
  .blog-grid{grid-template-columns:repeat(2,1fr);}
  .notes-grid{grid-template-columns:repeat(2,1fr);}

  .cta-banner{flex-direction:column;align-items:flex-start;padding:40px 32px;}
  .cta-mark{position:static;transform:none;margin-top:-8px;order:-1;width:64px;height:64px;border-radius:16px;}
  .cta-mark svg{width:28px;height:28px;}
  .cta-actions{width:100%;flex-wrap:wrap;}
  .cta-actions .btn{flex:1;justify-content:center;}

}

/* ---------- 640px : single column throughout ---------- */
@media (max-width:640px){
  :root{--section-pad:56px;}
  .container{padding:0 18px;}
  .section-head{flex-direction:column;align-items:flex-start;gap:10px;margin-bottom:26px;}

  .hero{padding-top:24px;}
  .hero-copy h1{font-size:clamp(30px,8vw,40px);margin:16px 0 14px;}
  .hero-copy p.lede{font-size:15px;margin-bottom:26px;}
  .hero-actions{flex-direction:column;}
  .hero-actions .btn{width:100%;justify-content:center;}
  .hero-stats{flex-wrap:wrap;row-gap:18px;}
  .stat{flex:1 1 45%;padding-right:0;}
  .stat + .stat{border-left:none;padding-left:0;}
  .stat:nth-child(odd){padding-right:12px;}
  .stat:nth-child(even){padding-left:12px;border-left:1px solid var(--border-soft);}

  .editor-body{padding:18px 16px 22px;font-size:12.5px;}
  .editor-body .line{gap:12px;}

  .category-grid{grid-template-columns:repeat(3,1fr);gap:10px;}
  .cat-card{padding:16px 8px;}
  .cat-card span{font-size:11.5px;}
  .cat-icon{width:38px;height:38px;}

  .topic-grid{grid-template-columns:repeat(2,1fr);}
  .lang-grid{grid-template-columns:repeat(2,1fr);}
  .feature-grid{grid-template-columns:1fr;}
  .blog-grid{grid-template-columns:1fr;}
  .notes-grid{grid-template-columns:1fr;}

  .cta-banner{padding:32px 22px;border-radius:22px;}
  .cta-copy h2{font-size:22px;}

}

/* ---------- 400px : compact typography ---------- */
@media (max-width:400px){
  .category-grid{grid-template-columns:repeat(2,1fr);}
  .lang-grid{grid-template-columns:repeat(2,1fr);}
  .topic-grid{grid-template-columns:repeat(2,1fr);}
  .stat-num{font-size:18px;}
  .logo{font-size:16px;}
}
