/* ============================================================
   FlowDesk Tools — Design System v2
   Editorial tech review aesthetic
   Instrument Serif (headlines) + DM Sans (body)
   ============================================================ */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

/* === TOKENS === */
:root {
  --ink: #0f1419;
  --ink-soft: #1d2733;
  --slate: #5e6c7a;
  --slate-light: #8f9baa;
  --rule: #dfe3e8;
  --rule-light: #eef1f4;
  --wash: #f7f8fa;
  --paper: #ffffff;
  --signal: #d35322;
  --signal-hover: #b8441a;
  --signal-soft: #fef4f0;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.1875rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.75rem;
  --fs-4xl: 3.5rem;

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-base: 1.65;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  --max-width: 1200px;
  --content-width: 720px;
  --sidebar-width: 300px;
  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(15,20,25,.05);
  --shadow-md: 0 4px 16px rgba(15,20,25,.08);
  --shadow-lg: 0 12px 40px rgba(15,20,25,.1);

  --ease: cubic-bezier(.4,0,.2,1);
}

/* === RESET === */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--signal); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--signal-hover); }
a:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
ul, ol { list-style: none; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 400; color: var(--ink); line-height: var(--lh-tight); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin-bottom: var(--sp-4); }

/* === LAYOUT === */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--sp-6); }
.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; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  height: var(--header-height);
  display: flex; align-items: center;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--sp-6);
}
.site-logo {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 700; font-size: var(--fs-lg);
  color: var(--ink); text-decoration: none; letter-spacing: -.02em;
}
.site-logo img { height: 36px; width: auto; display: block; }
.site-logo:hover { color: var(--ink); }
.logo-icon {
  width: 28px; height: 28px;
  background: var(--signal); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-icon svg { width: 15px; height: 15px; fill: #fff; }

.nav-wrapper { display: flex; align-items: center; }
.nav-main { display: flex; align-items: center; gap: 0; }
.nav-main a {
  font-family: var(--font-body); font-weight: 500; font-size: var(--fs-sm);
  color: var(--slate); padding: var(--sp-2) var(--sp-3); border-radius: 6px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-main a:hover, .nav-main a[aria-current="page"] {
  color: var(--ink); background: var(--wash);
}
.nav-search-btn {
  background: none; border: 1px solid var(--rule); border-radius: 6px;
  padding: 6px; cursor: pointer; color: var(--slate);
  transition: all .2s var(--ease); display: flex; align-items: center; justify-content: center;
  margin-left: var(--sp-2);
}
.nav-search-btn:hover { border-color: var(--signal); color: var(--signal); }
.nav-search-btn svg { width: 16px; height: 16px; }

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: var(--sp-2); color: var(--ink);
}
.menu-toggle svg { width: 22px; height: 22px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--ink);
  padding: var(--sp-20) 0;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { max-width: 680px; position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-xs);
  color: var(--signal); text-transform: uppercase; letter-spacing: .12em;
  margin-bottom: var(--sp-4);
}
.hero h1 {
  font-family: var(--font-display); font-size: var(--fs-4xl);
  color: #fff; line-height: var(--lh-tight); margin-bottom: var(--sp-6);
  letter-spacing: -.01em;
}
.hero h1 span { color: var(--signal); font-style: italic; }
.hero-subtitle {
  font-size: var(--fs-md); color: var(--slate-light);
  line-height: var(--lh-base); margin-bottom: var(--sp-8); max-width: 520px;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--signal); color: #fff;
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm);
  padding: var(--sp-3) var(--sp-6); border-radius: var(--radius);
  transition: background .2s var(--ease), transform .15s var(--ease);
  text-decoration: none;
}
.hero-cta:hover { background: var(--signal-hover); color: #fff; transform: translateY(-1px); }
.hero-cta svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.hero-cta:hover svg { transform: translateX(3px); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: var(--sp-16) 0; }
.section-alt { background: var(--wash); }
.section-header { margin-bottom: var(--sp-10); }
.section-header h2 { margin-bottom: var(--sp-2); }
.section-header p { color: var(--slate); font-size: var(--fs-md); max-width: 480px; }

/* ============================================================
   ARTICLE CARDS
   ============================================================ */
.articles-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-6);
}
.article-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
  display: flex; flex-direction: column;
}
.article-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-3px);
  border-color: var(--rule-light);
}
.article-card-img {
  width: 100%; aspect-ratio: 16/9;
  background: var(--wash);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--rule-light);
}
.article-card-img svg { width: 40px; height: 40px; color: var(--slate-light); opacity: .4; }
.article-card-body {
  padding: var(--sp-5); flex: 1; display: flex; flex-direction: column;
}
.article-card-category {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-xs);
  color: var(--signal); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: var(--sp-2);
}
.article-card-title {
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-lg);
  color: var(--ink); margin-bottom: var(--sp-3); line-height: var(--lh-snug);
}
.article-card-title a { color: inherit; text-decoration: none; }
.article-card-title a:hover { color: var(--signal); }
.article-card-excerpt {
  font-size: var(--fs-sm); color: var(--slate); line-height: var(--lh-base);
  margin-bottom: var(--sp-4); flex: 1;
}
.article-card-link {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm);
  color: var(--signal); display: inline-flex; align-items: center; gap: var(--sp-1);
}
.article-card-link svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.article-card-link:hover svg { transform: translateX(3px); }

/* ============================================================
   CATEGORIES
   ============================================================ */
.categories-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-5);
}
.category-block {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5); text-align: center;
  transition: all .25s var(--ease); text-decoration: none; display: block;
}
.category-block:hover {
  border-color: var(--signal); box-shadow: var(--shadow-md); transform: translateY(-3px);
}
.category-icon {
  width: 48px; height: 48px; margin: 0 auto var(--sp-3);
  background: var(--signal-soft); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.category-icon svg { width: 22px; height: 22px; color: var(--signal); }
.category-block h3 {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm);
  margin-bottom: var(--sp-1); color: var(--ink);
}
.category-block p { font-size: var(--fs-xs); color: var(--slate); margin-bottom: 0; }

/* ============================================================
   ADSENSE
   ============================================================ */
.ad-container {
  background: var(--wash); border: 1px dashed var(--rule);
  border-radius: var(--radius); padding: var(--sp-5);
  text-align: center; margin: var(--sp-8) 0;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
}
.ad-container-horizontal { min-height: 90px; }
.ad-container-sidebar { min-height: 250px; margin-bottom: var(--sp-6); }
.ad-container-incontent { margin: var(--sp-6) 0; min-height: 250px; }
.ad-label {
  font-size: var(--fs-xs); color: var(--slate-light);
  text-transform: uppercase; letter-spacing: .08em;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.6);
  padding: var(--sp-16) 0 var(--sp-8);
}
.footer-grid {
  display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: var(--sp-10); margin-bottom: var(--sp-12);
}
.footer-brand p { font-size: var(--fs-sm); line-height: var(--lh-base); max-width: 280px; }
.footer-brand .site-logo { color: #fff; margin-bottom: var(--sp-4); }
.footer-brand .site-logo img { filter: brightness(0) invert(1); opacity: .85; }
.footer-heading {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-xs);
  color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: var(--sp-4);
}
.footer-links { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-links a { color: rgba(255,255,255,.6); font-size: var(--fs-sm); transition: color .2s; }
.footer-links a:hover { color: var(--signal); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: var(--sp-6); display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom p { font-size: var(--fs-xs); color: rgba(255,255,255,.35); margin-bottom: 0; }

/* ============================================================
   ARTICLE PAGE LAYOUT
   ============================================================ */
.article-layout {
  display: grid; grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--sp-10); align-items: start; padding: var(--sp-10) 0;
}
.article-main { max-width: var(--content-width); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-sm); color: var(--slate-light); margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--signal); }
.breadcrumb-sep { color: var(--rule); font-size: var(--fs-xs); }

/* Article Header */
.article-header { margin-bottom: var(--sp-8); }
.article-category-tag {
  display: inline-block; font-family: var(--font-body); font-weight: 600;
  font-size: var(--fs-xs); color: var(--signal); text-transform: uppercase;
  letter-spacing: .06em; background: var(--signal-soft);
  padding: var(--sp-1) var(--sp-3); border-radius: 4px; margin-bottom: var(--sp-4);
}
.article-header h1 { margin-bottom: var(--sp-4); font-size: var(--fs-3xl); }
.article-meta {
  display: flex; align-items: center; gap: var(--sp-4);
  font-size: var(--fs-sm); color: var(--slate-light);
}
.article-meta time { display: flex; align-items: center; gap: var(--sp-1); }
.article-reading-time { display: flex; align-items: center; gap: var(--sp-1); }

/* TOC */
.toc {
  background: var(--wash); border: 1px solid var(--rule);
  border-left: 3px solid var(--signal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--sp-5); margin-bottom: var(--sp-8);
}
.toc-title {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm);
  color: var(--ink); margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.toc-list { display: flex; flex-direction: column; gap: var(--sp-1); }
.toc-list a {
  font-size: var(--fs-sm); color: var(--slate);
  padding: var(--sp-1) var(--sp-3); border-radius: 4px;
  transition: all .2s var(--ease); display: block;
  border-left: 2px solid transparent;
}
.toc-list a:hover { color: var(--signal); background: var(--signal-soft); }
.toc-list a.active {
  color: var(--signal); border-left-color: var(--signal);
  background: var(--signal-soft); font-weight: 500;
}

/* Article Body */
.article-body h2 {
  margin: var(--sp-10) 0 var(--sp-4); padding-top: var(--sp-4);
  font-size: var(--fs-2xl);
}
.article-body h3 { margin: var(--sp-6) 0 var(--sp-3); font-size: var(--fs-xl); }
.article-body p {
  font-size: var(--fs-md); line-height: 1.75; margin-bottom: var(--sp-5);
  color: var(--ink-soft);
}
.article-body ul, .article-body ol { margin: var(--sp-4) 0; padding-left: var(--sp-6); }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li {
  margin-bottom: var(--sp-2); font-size: var(--fs-md); line-height: var(--lh-base);
  color: var(--ink-soft);
}
.article-body strong { font-weight: 600; color: var(--ink); }
.article-body blockquote {
  border-left: 3px solid var(--signal); padding: var(--sp-4) var(--sp-6);
  background: var(--signal-soft); border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--sp-6) 0; font-style: italic; color: var(--ink-soft);
}
.article-body table {
  width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: var(--sp-6) 0;
}
.article-body th {
  text-align: left; padding: var(--sp-3); border-bottom: 2px solid var(--ink);
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink);
}
.article-body td {
  padding: var(--sp-3); border-bottom: 1px solid var(--rule);
}
.article-body tr:nth-child(even) { background: var(--wash); }

/* Tool Cards */
.tool-card {
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: var(--sp-6); margin: var(--sp-6) 0; background: var(--paper);
  transition: border-color .2s var(--ease);
}
.tool-card:hover { border-color: var(--signal); }
.tool-card h3 { margin-top: 0; font-family: var(--font-display); font-size: var(--fs-xl); }
.tool-card-meta {
  display: flex; gap: var(--sp-3); margin: var(--sp-3) 0;
  font-size: var(--fs-sm); color: var(--slate); flex-wrap: wrap;
}
.tool-card-badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 2px var(--sp-2); background: var(--wash); border-radius: 4px;
  font-size: var(--fs-xs); font-weight: 500;
}

/* Article CTA */
.article-cta {
  background: var(--ink); border-radius: var(--radius-lg);
  padding: var(--sp-8); margin: var(--sp-10) 0; text-align: center;
}
.article-cta h3 { color: #fff; margin-bottom: var(--sp-3); }
.article-cta p { color: var(--slate-light); margin-bottom: var(--sp-5); }
.article-cta a {
  display: inline-flex; background: var(--signal); color: #fff;
  padding: var(--sp-3) var(--sp-8); border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600;
  transition: background .2s var(--ease);
}
.article-cta a:hover { background: var(--signal-hover); color: #fff; }

/* Sidebar */
.sidebar { position: sticky; top: calc(var(--header-height) + var(--sp-6)); }
.sidebar-section { margin-bottom: var(--sp-8); }
.sidebar-title {
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-sm);
  color: var(--ink); margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2); border-bottom: 2px solid var(--signal);
}
.sidebar-card {
  display: flex; gap: var(--sp-3); padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--rule-light);
}
.sidebar-card:last-child { border-bottom: none; }
.sidebar-card-img {
  width: 56px; height: 42px; background: var(--wash);
  border-radius: 4px; flex-shrink: 0;
}
.sidebar-card-title {
  font-family: var(--font-body); font-weight: 500; font-size: var(--fs-sm);
  color: var(--ink); line-height: var(--lh-snug);
}
.sidebar-card-title a { color: inherit; }
.sidebar-card-title a:hover { color: var(--signal); }
.sidebar-card-cat { font-size: var(--fs-xs); color: var(--slate-light); margin-top: 2px; }

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0; background: rgba(15,20,25,.5);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease);
}
.search-overlay.active { opacity: 1; pointer-events: auto; }
.search-box {
  background: var(--paper); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  padding: var(--sp-5);
  transform: translateY(-8px); transition: transform .2s var(--ease);
}
.search-overlay.active .search-box { transform: translateY(0); }
.search-input-wrap {
  display: flex; align-items: center; gap: var(--sp-3);
  border-bottom: 2px solid var(--rule); padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.search-input-wrap svg { width: 18px; height: 18px; color: var(--slate-light); flex-shrink: 0; }
.search-input {
  flex: 1; border: none; outline: none;
  font-family: var(--font-body); font-size: var(--fs-lg);
  color: var(--ink); background: transparent;
}
.search-input::placeholder { color: var(--slate-light); }
.search-results { max-height: 300px; overflow-y: auto; }
.search-result-item {
  display: block; padding: var(--sp-3) var(--sp-3);
  border-radius: 6px; transition: background .15s var(--ease); text-decoration: none;
}
.search-result-item:hover { background: var(--wash); }
.search-result-title {
  font-family: var(--font-body); font-weight: 500; font-size: var(--fs-sm); color: var(--ink);
}
.search-result-cat { font-size: var(--fs-xs); color: var(--slate-light); margin-top: 2px; }
.search-empty {
  text-align: center; padding: var(--sp-8); color: var(--slate-light); font-size: var(--fs-sm);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm);
  padding: var(--sp-3) var(--sp-5); border-radius: var(--radius);
  border: none; cursor: pointer; transition: all .2s var(--ease); text-decoration: none;
}
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-hover); color: #fff; }
.btn-outline { background: transparent; color: var(--signal); border: 1px solid var(--signal); }
.btn-outline:hover { background: var(--signal); color: #fff; }

/* ============================================================
   RESPONSIVE — MOBILE (< 640px)
   ============================================================ */
@media (max-width: 639px) {
  :root {
    --fs-3xl: 2rem;
    --fs-4xl: 2.5rem;
    --fs-2xl: 1.5rem;
  }
  .menu-toggle { display: block; }
  .nav-wrapper {
    position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0;
    background: var(--paper); padding: var(--sp-6);
    transform: translateX(100%); transition: transform .3s var(--ease);
    z-index: 99; overflow-y: auto;
  }
  .nav-wrapper.open { transform: translateX(0); }
  .nav-main { flex-direction: column; gap: var(--sp-1); }
  .nav-main a { font-size: var(--fs-base); padding: var(--sp-3) var(--sp-4); width: 100%; }
  .nav-search-btn {
    margin-left: 0; margin-top: var(--sp-4);
    width: 100%; justify-content: center; padding: var(--sp-3);
  }
  .hero { padding: var(--sp-12) 0; }
  .articles-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .categories-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .article-layout { grid-template-columns: 1fr; padding: var(--sp-6) 0; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .footer-bottom { flex-direction: column; gap: var(--sp-2); text-align: center; }
  .search-overlay { padding: var(--sp-4); padding-top: var(--sp-12); }
  .search-box { max-width: 100%; }
}

/* ============================================================
   RESPONSIVE — TABLET (640px–1023px)
   ============================================================ */
@media (min-width: 640px) and (max-width: 1023px) {
  .articles-grid { grid-template-columns: repeat(2,1fr); }
  .categories-grid { grid-template-columns: repeat(2,1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; display: grid;
    grid-template-columns: 1fr 1fr; gap: var(--sp-6);
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
}

/* ============================================================
   REDUCED MOTION & PRINT
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .site-header,.site-footer,.sidebar,.ad-container,.search-overlay,.toc { display: none; }
  .article-layout { grid-template-columns: 1fr; }
  .article-body { font-size: 11pt; }
}
