/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --font:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  ui-monospace, 'SF Mono', 'Fira Code', monospace;

  --bg:      #ffffff;
  --altbg:   #f7f7f7;
  --cardbg:  #ffffff;
  --fg:      #111111;
  --muted:   #555555;
  --muted2:  #888888;
  --border:  #e8e8e8;
  --border2: #d0d0d0;
  --accent:  #e03300;

  --body-size:   18px;
  --body-lh:     1.78;
  --body-width:  740px;
  --content-max: 1280px;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
}

[data-theme="dark"] {
  --bg:      #111111;
  --altbg:   #1a1a1a;
  --cardbg:  #1a1a1a;
  --fg:      #efefef;
  --muted:   #aaaaaa;
  --muted2:  #777777;
  --border:  #2a2a2a;
  --border2: #383838;
  --accent:  #ff4f1f;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s, color 0.2s;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ── Site Header ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 40px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header-left { display: flex; align-items: center; gap: 28px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.logo-icon { flex-shrink: 0; }
.logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--fg);
}
.logo-text em { color: var(--accent); font-style: normal; }

.header-nav { display: flex; gap: 6px; align-items: center; }
.nav-link {
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-link:hover { color: var(--fg); background: var(--altbg); }
.nav-chevron { transition: transform 0.2s; }
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 220px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 6px 0;
  z-index: 200;
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.nav-dropdown-menu a:hover { background: var(--altbg); color: var(--fg); }
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown.open .nav-chevron { transform: rotate(180deg); }
.nav-dropdown-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 10px 16px 4px;
}
.nav-dropdown-label:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; }

/* Burger */
.burger {
  display: none;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border2);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.2s, opacity 0.2s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Mobile nav panel */
.mobile-nav {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 199;
  overflow-y: auto;
  padding: 8px 16px 32px;
  border-top: 1px solid var(--border);
}
.mobile-nav.open { display: block; }
.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: var(--fg);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-group { }
.mobile-nav-sub {
  display: none;
  padding-left: 16px;
}
.mobile-nav-group.open .mobile-nav-sub { display: block; }
.mobile-nav-group.open .nav-chevron { transform: rotate(180deg); }
.mobile-nav-sub a {
  display: block;
  padding: 11px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-sub a:hover { color: var(--fg); }
.mobile-nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 12px 0 4px;
}
.mobile-nav-label:not(:first-child) { border-top: 1px solid var(--border); margin-top: 4px; }

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { border-color: var(--fg); color: var(--fg); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ── Kicker ─────────────────────────────────────────────────── */
.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  padding: 18px 40px 0;
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted2);
  flex-wrap: wrap;
}
.breadcrumb a { text-decoration: none; color: var(--muted2); }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb .current { color: var(--muted); }

/* ── Homepage Hero ──────────────────────────────────────────── */
/* ── Home Hero ──────────────────────────────────────────────── */
.home-hero {
  border-bottom: 1px solid var(--border);
  padding: 64px 40px 52px;
}
.home-hero-inner { max-width: var(--content-max); margin: 0 auto; }
.home-hero h1 {
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -2.5px;
  color: var(--fg);
  margin: 12px 0 20px;
  max-width: 14ch;
}
.home-hero h1 em { color: var(--accent); font-style: normal; }
.home-hero p {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 36px;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  padding: 0 28px 0 0;
}
.hero-stat strong {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--fg);
}
.hero-stat span {
  font-size: 12px;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
}
.hero-stat-sep {
  width: 1px;
  height: 36px;
  background: var(--border);
  margin: 0 28px 0 0;
}

/* ── Home Category Rows ─────────────────────────────────────── */
.home-catrow { padding: 48px 40px; border-bottom: 1px solid var(--border); }
.home-catrow-inner { max-width: var(--content-max); margin: 0 auto; }
.home-catrow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.home-catrow-head h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
}
.home-catrow-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.home-catrow-all:hover { text-decoration: underline; }
.home-catrow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── Home Featured ──────────────────────────────────────────── */
.home-featured { padding: 52px 40px; border-bottom: 1px solid var(--border); }
.home-featured-inner { max-width: var(--content-max); margin: 0 auto; }
.home-featured-label { margin-bottom: 16px; }
.home-featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  transition: box-shadow 0.18s, border-color 0.18s;
  min-height: 320px;
}
.home-featured-card:hover {
  border-color: var(--fg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.home-featured-img {
  background-size: cover;
  background-position: center;
  min-height: 280px;
}
.home-featured-text {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  background: var(--cardbg);
}
.home-featured-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}
.home-featured-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.home-featured-time { font-size: 11px; color: var(--muted2); }
.home-featured-text h2 {
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin: 0;
}
.home-featured-text p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}
.home-featured-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

/* ── Home Latest Grid ───────────────────────────────────────── */
.home-latest { padding: 52px 40px 80px; }
.home-latest-inner { max-width: var(--content-max); margin: 0 auto; }
.home-latest-head { margin-bottom: 28px; }
.home-latest-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; margin: 6px 0 0; }
.home-latest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.home-latest-card {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-latest-card:hover {
  border-color: var(--fg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.home-latest-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--altbg);
  background-size: cover;
  background-position: center;
}
.home-latest-thumb--empty { background: var(--altbg); }
.home-latest-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.home-latest-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted2);
}
.home-latest-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}
.home-latest-card h3 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.1px;
  margin: 0;
}

/* ── Legacy article-card (kept for possible other uses) ─────── */
.article-card {
  background: var(--cardbg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}
.article-card:hover { border-color: var(--fg); }
.article-card-meta { display: flex; gap: 8px; align-items: center; }
.article-card-cat { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
.article-card-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border2); }
.article-card-time { font-size: 11px; color: var(--muted2); }
.article-card h3 { font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -0.1px; margin: 0; }
.article-card p  { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 0; }

/* ── Category Page Hero ─────────────────────────────────────── */
.cat-hero { border-bottom: 1px solid var(--fg); padding: 40px 40px 48px; }
.cat-hero-inner { max-width: var(--content-max); margin: 0 auto; }
.cat-hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -1.5px;
  margin: 10px 0 16px;
}
.cat-hero p { font-size: 17px; font-weight: 300; line-height: 1.6; color: var(--muted); max-width: 54ch; margin: 0; }

/* ── Category Article List ──────────────────────────────────── */
.cat-articles { max-width: var(--content-max); margin: 0 auto; padding: 40px 40px 80px; }
.article-row {
  display: grid;
  grid-template-columns: 72px 1fr 200px;
  gap: 24px;
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-decoration: none;
  color: inherit;
  align-items: center;
}
.article-row-thumb {
  width: 200px;
  height: 112px;
  border-radius: 8px;
  background: var(--altbg);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  overflow: hidden;
}
.article-row:first-child { border-top: 2px solid var(--fg); }
.article-row:hover .article-row-title { color: var(--accent); }
.article-row-num {
  font-size: 48px;
  font-weight: 800;
  line-height: 0.9;
  color: var(--border2);
  letter-spacing: -2px;
  padding-top: 4px;
}
.article-row-kicker { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.article-row-title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
  transition: color 0.15s;
}
.article-row-subtitle { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; max-width: 60ch; font-weight: 300; }
.article-row-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted2); }

/* ── Article Page Layout ────────────────────────────────────── */
.article-layout {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 40px 96px;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 60px;
  align-items: start;
}
.article-sidebar { position: sticky; top: 76px; }

/* Article hero */
.article-hero { border-bottom: 2px solid var(--fg); padding: 32px 0 44px; }
.article-hero h1 {
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 12px 0 18px;
}
.article-hero .subtitle {
  font-size: 19px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--muted);
  max-width: 54ch;
  margin: 0;
}
.article-byline {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.byline-item { display: flex; flex-direction: column; gap: 3px; }
.byline-label { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted2); }
.byline-value { font-size: 13px; font-weight: 400; color: var(--fg); }

/* TOC */
.toc-widget {
  background: var(--altbg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.toc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 12px;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.35;
  transition: color 0.15s;
}
.toc-list li a:hover,
.toc-list li a.active { color: var(--accent); }
.toc-list li.h3-item a {
  padding-left: 14px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.toc-num { font-size: 10px; color: var(--muted2); flex-shrink: 0; padding-top: 2px; font-variant-numeric: tabular-nums; }

/* ── Article Body ───────────────────────────────────────────── */
.article-body { padding-top: 36px; }

.article-body h2 {
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.4px;
  color: var(--fg);
  margin: 48px 0 16px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}
.article-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
  color: var(--fg);
  margin: 32px 0 12px;
}

.article-body h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted2);
  margin: 28px 0 10px;
}

.article-body p {
  font-size: var(--body-size);
  font-weight: 400;
  line-height: var(--body-lh);
  color: var(--fg);
  margin: 0 0 22px;
  max-width: 66ch;
}

.article-body ul,
.article-body ol {
  padding-left: 22px;
  margin: 0 0 22px;
}
.article-body li {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--fg);
  margin-bottom: 6px;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 22px;
  margin: 32px 0;
  font-size: 20px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.55;
  color: var(--muted);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--altbg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent);
}

.article-body strong { font-weight: 700; }
.article-body em { font-style: italic; }

.article-body a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
}
.article-body a:hover { color: var(--accent); }

/* Hide H1 inside body (already shown in article-hero) */
.article-body > h1:first-child { display: none; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 2px solid var(--fg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted2);
  white-space: nowrap;
}
.table-wrap td {
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

/* ── Related Articles ───────────────────────────────────────── */
.related-section {
  border-top: 2px solid var(--fg);
  padding: 44px 0 0;
  margin-top: 52px;
}
.related-section h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; margin: 8px 0 24px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.related-card { text-decoration: none; color: inherit; }
.related-card-art {
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  background: var(--altbg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
}
.related-card-art-label { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted2); }
.related-card-kicker { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted2); margin-bottom: 5px; }
.related-card h3 { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.1px; margin: 0; transition: color 0.15s; }
.related-card:hover h3 { color: var(--accent); }

/* ── Site Footer ────────────────────────────────────────────── */
.site-footer { background: var(--altbg); border-top: 1px solid var(--border); padding: 36px 40px; }
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted2);
}
.footer-logo { font-size: 18px; font-weight: 800; color: var(--fg); margin-bottom: 6px; }
.footer-logo em { color: var(--accent); font-style: normal; }
.footer-brand p { margin: 0; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--muted2); text-decoration: none; }
.footer-links a:hover { color: var(--fg); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { padding: 80px 40px; text-align: center; color: var(--muted); max-width: var(--content-max); margin: 0 auto; }
.empty-state h2 { font-size: 28px; font-weight: 700; margin: 0 0 10px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .article-sidebar { position: static; }
  .toc-widget { margin: 28px 0; }
}
@media (max-width: 1024px) {
  .home-catrow-grid    { grid-template-columns: repeat(2, 1fr); }
  .home-latest-grid    { grid-template-columns: repeat(2, 1fr); }
  .home-featured-card  { grid-template-columns: 1fr; }
  .home-featured-img   { min-height: 240px; }
}

@media (max-width: 800px) {
  html, body { overflow-x: hidden; }
  .header-inner  { padding: 0 16px; }
  .header-nav--desktop { display: none; }
  .burger { display: flex; }
  .home-hero,
  .home-catrow,
  .home-featured,
  .home-latest,
  .cat-hero      { padding-left: 16px; padding-right: 16px; }
  .cat-articles   { padding-left: 16px; padding-right: 16px; }
  .article-layout { padding: 0 16px 64px; }
  .breadcrumb     { padding: 14px 16px 0; }
  .site-footer    { padding: 28px 16px; }
  .article-row    { grid-template-columns: 52px 1fr; gap: 14px; }
  .article-row-num { font-size: 36px; }
  .article-row-thumb { display: none; }
  .article-body p,
  .article-body li { font-size: 16px; }
  .app-screenshots { grid-template-columns: repeat(2, 1fr); }
  .home-catrow-grid  { grid-template-columns: 1fr 1fr; }
  .home-latest-grid  { grid-template-columns: 1fr 1fr; }
  .hero-stats        { gap: 0; }
  .hero-stat         { padding-right: 20px; }
  .hero-stat-sep     { margin-right: 20px; }
}
@media (max-width: 480px) {
  .home-catrow-grid  { grid-template-columns: 1fr; }
  .home-latest-grid  { grid-template-columns: 1fr; }
  .related-grid      { grid-template-columns: 1fr; }
  .home-featured-text { padding: 20px 16px; }
  .home-featured-card { min-height: auto; }
  .home-featured-img  { min-height: 180px; }
  .app-card { padding: 14px; }
}

/* ── App Card ───────────────────────────────────────────────── */
.app-card {
  background: var(--altbg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0 32px;
  max-width: var(--body-width);
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.app-icon {
  width: 64px !important;
  max-width: 64px !important;
  height: 64px !important;
  border-radius: 14px;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}

.app-icon-placeholder {
  background: var(--border);
}

.app-card-info {
  flex: 1;
  min-width: 120px;
}

.app-card-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fg);
}

.app-card-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.app-stars {
  color: #f5a623;
  font-size: 13px;
}

.app-rating-num {
  color: var(--muted);
  font-size: 12px;
}

/* Google Play button */
.app-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: var(--font);
  flex-shrink: 0;
  transition: background 0.15s;
}

[data-theme="dark"] .app-play-btn {
  background: #2a2a2a;
  border: 1px solid #444;
}

.app-play-btn:hover {
  background: #000;
  color: #fff !important;
}

.app-play-btn .gp-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.app-play-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.app-play-btn small {
  font-size: 10px;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.app-play-btn strong {
  font-size: 14px;
  font-weight: 600;
}

/* Screenshot strip */
.app-screenshots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.app-screenshots--compact {
  grid-template-columns: repeat(2, 1fr);
}

.app-screenshots img {
  border-radius: 8px;
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  border: 1px solid var(--border);
}

.app-screenshots--landscape {
  grid-template-columns: repeat(3, 1fr);
}

.app-screenshots--landscape img {
  aspect-ratio: 16/9;
}

/* Compact card (body-mention overview articles) */
.app-card--compact {
  margin: 12px 0 20px;
  padding: 14px 16px;
}

.app-card--compact .app-card-header {
  gap: 12px;
}

.app-card--compact .app-screenshots--compact {
  margin-top: 12px;
  max-width: 400px;
}

/* ── Inline app name links ──────────────────────────────────── */
.app-inline-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding-bottom: 1px;
  white-space: nowrap;
}
.app-inline-link:hover {
  border-bottom-color: var(--accent);
}
.app-inline-icon {
  display: inline;
  vertical-align: middle;
  margin-left: 2px;
  opacity: 0.6;
  color: var(--accent);
}

/* ── App Quick Pick ─────────────────────────────────────────── */
.app-quickpick {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 32px 0 40px;
  max-width: var(--body-width);
  font-size: 15px;
}

.app-qp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--altbg);
  border-bottom: 1px solid var(--border);
}

.app-qp-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

.app-qp-count {
  font-size: 12px;
  color: var(--muted2);
}

.app-qp-list {
  display: flex;
  flex-direction: column;
}

.app-qp-row {
  display: grid;
  grid-template-columns: 28px 44px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.app-qp-row:last-child { border-bottom: none; }
.app-qp-row:hover { background: var(--altbg); }

.app-qp-rank {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted2);
  text-align: center;
}

.app-qp-icon {
  width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.app-qp-icon-ph {
  background: var(--border);
  border-radius: 10px;
}

.app-qp-info {
  min-width: 0;
}

.app-qp-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-qp-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.app-qp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.app-qp-stars {
  font-size: 12px;
  color: #f5a623;
  font-weight: 600;
  white-space: nowrap;
}

.app-qp-installs {
  font-size: 11px;
  color: var(--muted2);
  white-space: nowrap;
}

.app-qp-btn {
  flex-shrink: 0;
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.app-qp-btn:hover { opacity: 0.85; }

@media (max-width: 600px) {
  .app-qp-row {
    grid-template-columns: 24px 36px 1fr auto;
    gap: 8px;
    padding: 10px 14px;
  }
  .app-qp-meta { display: none; }
  .app-qp-icon { width: 36px !important; max-width: 36px !important; height: 36px !important; }
}
