/* ============================================
   TechPulse — Complete Stylesheet v20261005
   ============================================ */

:root {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --bg-soft: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --brand-2: #7c3aed;
  --brand-home: #16a34a;
  --header-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: #0f172a;
  --footer-text: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 20px 50px rgba(15, 23, 42, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dark-theme {
  --bg: #0b1220;
  --bg-alt: #131c2e;
  --bg-soft: #1a2438;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #22304a;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: #1e3a8a;
  --header-bg: rgba(11, 18, 32, 0.85);
  --footer-bg: #060c18;
  --footer-text: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { width: 92%; max-width: 1240px; margin: 0 auto; padding: 0 4px; }

/* ============ Ticker ============ */
.ticker {
  background: linear-gradient(90deg, #0f172a, #1e293b);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
  position: relative;
  z-index: 5;
}
.ticker-label {
  background: #dc2626;
  color: #fff;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ticker-label::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.ticker-track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  animation: ticker-scroll 90s linear infinite;
  padding-left: 40px;
  will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; }
.ticker-item::before { content: "▸"; color: #3b82f6; font-weight: 700; }
.ticker-item a { color: inherit; }
.ticker-item a:hover { color: #60a5fa; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ Header ============ */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  gap: 16px;
  flex-wrap: wrap;
}
.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo svg polyline { stroke: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover { background: var(--bg-soft); color: var(--primary); }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); }

#darkModeToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  margin-left: 4px;
}
#darkModeToggle:hover { border-color: var(--primary); color: var(--primary); }

.lang-select {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.lang-select:focus { border-color: var(--primary); }

/* ============ Hero ============ */
.hero-section { text-align: center; margin: 40px 0 24px; padding: 0 4px; }
.hero-section h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-section p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

.site-stats-bar {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px 0 6px;
}
.site-stats-bar .stat-block { text-align: center; }
.site-stats-bar .stat-num { font-size: 1.6rem; font-weight: 800; color: var(--primary); display: block; }
.site-stats-bar .stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.lang-coverage {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px 0;
  margin: 12px 0 4px;
  font-size: 0.85rem;
}
.lang-coverage span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--bg-soft);
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 500;
  color: var(--text-muted);
}
.lang-coverage span strong { color: var(--primary); }

/* ============ Trending Today ============ */
.trending-today {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.trending-header h2 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.trending-header .hot-badge {
  background: linear-gradient(135deg, #dc2626, #f59e0b);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.trending-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.trending-item {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  transition: background var(--transition);
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover { background: var(--bg-soft); }
.trending-rank {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
  line-height: 1.2;
}
.trending-item.top-3 .trending-rank { color: var(--accent); }
.trending-content { flex: 1; min-width: 0; }
.trending-content h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin-bottom: 6px;
  font-weight: 600;
}
.trending-content h3 a { color: var(--text); }
.trending-content h3 a:hover { color: var(--primary); }
.trending-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
  align-items: center;
}
.trending-meta .source-tag {
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--primary);
}

/* ============ Did You Know ============ */
.did-you-know {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 24px 0;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
html.dark-theme .did-you-know {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
  border-left-color: #fbbf24;
}
.did-you-know::before {
  content: "💡";
  position: absolute;
  top: 12px;
  right: 20px;
  font-size: 3rem;
  opacity: 0.15;
}
.did-you-know h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
}
html.dark-theme .did-you-know h3 { color: #fbbf24; }
.did-you-know p {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #78350f;
  font-weight: 500;
  max-width: 90%;
}
html.dark-theme .did-you-know p { color: #fef3c7; }
.did-you-know .dyk-source {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: #92400e;
  opacity: 0.7;
}
html.dark-theme .did-you-know .dyk-source { color: #fbbf24; }

/* ============ Best Picks ============ */
.best-picks {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.best-picks-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.best-picks-header h2 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}
.best-picks-header .trust-badge {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.pick-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  background: var(--bg);
  transition: all var(--transition);
}
.pick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pick-card.best { border-color: var(--primary); border-width: 2px; }
.pick-card.also-great { border-color: var(--primary); }
.pick-card.budget { border-color: var(--brand-home); }
.pick-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}
.pick-badge.best { background: var(--primary); }
.pick-badge.also-great { background: var(--brand-2); }
.pick-badge.budget { background: var(--brand-home); }
.pick-card h4 { font-size: 1.02rem; margin-bottom: 8px; margin-top: 6px; }
.pick-card .pick-price { font-weight: 700; color: var(--primary); font-size: 0.95rem; margin-bottom: 8px; }
.pick-card .pick-why { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }

/* ============ Home & Tech ============ */
.home-tech-section {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}
.home-tech-section h2 { color: var(--brand-home); }
.home-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.home-tech-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-tech-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-home);
  color: var(--text);
}
.home-tech-card .ht-icon { font-size: 1.8rem; line-height: 1; }
.home-tech-card h4 { font-size: 0.95rem; margin: 0; }
.home-tech-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* ============ Academy Preview ============ */
.academy-preview {
  background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 50%, #6b21a8 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: 32px 0;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}
.academy-preview-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.academy-preview-content .academy-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.academy-preview-content h2 {
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  margin-bottom: 12px;
  line-height: 1.2;
  font-weight: 800;
}
.academy-preview-content p {
  font-size: 0.98rem;
  opacity: 0.92;
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 640px;
}
.academy-preview-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.academy-preview-stats > div {
  display: flex;
  flex-direction: column;
}
.academy-preview-stats strong {
  font-size: 1.5rem;
  color: #fbbf24;
  font-weight: 900;
}
.academy-preview-stats small {
  font-size: 0.75rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.academy-preview-content .btn-primary {
  background: #fff;
  color: #2563eb;
  font-weight: 700;
}
.academy-preview-content .btn-primary:hover {
  background: #f1f5f9;
  color: #1d4ed8;
  transform: translateY(-2px);
}
.academy-preview-visual {
  font-size: 7rem;
  line-height: 1;
  opacity: 0.35;
  text-align: center;
}

/* ============ Toolbar ============ */
.toolbar { display: flex; gap: 12px; align-items: center; margin: 24px 0 8px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 220px; position: relative; }
.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-box::before {
  content: "🔍";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.6;
}
.category-select {
  padding: 10px 16px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.category-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ============ Articles Grid ============ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding: 12px 0 60px;
}
.article-card {
  background: var(--bg-alt);
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 320px;
}
.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--brand-2));
  opacity: 0;
  transition: opacity var(--transition);
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.article-card:hover::before { opacity: 1; }
.card-category {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: fit-content;
}
.article-card h3 {
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.article-card h3 a { color: inherit; }
.article-card h3 a:hover { color: var(--primary); }
.article-card p { color: var(--text-muted); font-size: 0.93rem; flex: 1; }
.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.92rem;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition);
}
.read-more:hover { gap: 10px; color: var(--primary-hover); }

/* ============ Layout ============ */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; padding: 12px 0 60px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 90px; }
.widget {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.widget h3 {
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.popular-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.popular-list li { display: flex; gap: 12px; align-items: flex-start; }
.popular-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.popular-list a { color: var(--text); font-size: 0.9rem; font-weight: 500; line-height: 1.4; }
.popular-list a:hover { color: var(--primary); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--bg-soft);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.tag:hover { background: var(--primary); color: #fff; }

.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-form input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
.newsletter-form input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.newsletter-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: background var(--transition);
}
.newsletter-form button:hover { background: var(--primary-hover); }
.newsletter-msg { font-size: 0.85rem; color: var(--success); min-height: 1em; }
.newsletter-msg.error { color: var(--danger); }

/* ============ Buttons ============ */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }

/* ============ All Articles List ============ */
.all-articles { margin: 48px 0 8px; padding-top: 24px; border-top: 1px solid var(--border); }
.all-articles-list { list-style: none; padding: 0; margin: 0; columns: 2 320px; column-gap: 32px; font-size: 0.92rem; }
.all-articles-list li { break-inside: avoid; margin-bottom: 8px; }
.all-articles-cat { color: var(--text-muted); font-size: 0.78rem; margin-left: 4px; }

/* ============ Section Heading ============ */
.section-heading {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  position: relative;
  padding-left: 14px;
}
.section-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}

/* ============ Single Article ============ */
.breadcrumb { margin: 16px 0; font-size: 0.9rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

.single-article {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}
.article-header { margin-bottom: 24px; }
.article-header .article-category {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.article-excerpt {
  padding: 16px 20px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 24px;
  font-style: italic;
}
.article-excerpt p { margin: 0; }
.article-content { font-size: 1.02rem; line-height: 1.75; }
.article-content p { margin-bottom: 18px; }
.article-content h2 { margin: 34px 0 12px; font-size: 1.45rem; line-height: 1.3; position: relative; scroll-margin-top: 90px; }
.article-content h3 { margin: 22px 0 8px; font-size: 1.15rem; }
.article-content ul, .article-content ol { margin: 0 0 18px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}
.article-content code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.article-content p code, .article-content li code {
  background: rgba(100, 116, 139, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
}
.heading-anchor {
  display: inline-block;
  margin-left: 8px;
  color: var(--primary);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
  font-size: 0.85em;
  transition: opacity var(--transition);
  vertical-align: middle;
}
.article-content h2:hover .heading-anchor { opacity: 0.6; }
.heading-anchor:hover { opacity: 1 !important; }

.article-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 8px;
  margin: 20px auto;
  display: block;
}

.tags-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }

.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 32px 0 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.share-label { font-weight: 600; font-size: 0.9rem; color: var(--text-muted); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.share-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.like-btn:hover { border-color: var(--primary); }
.like-btn.liked { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.like-count { font-variant-numeric: tabular-nums; }

.bookmark-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  padding: 0 2px;
  transition: transform 0.2s;
}
.bookmark-btn:hover { transform: scale(1.15); }

/* ============ TOC ============ */
.article-toc-slot { margin: 24px 0 32px; }
.toc-nav {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  position: relative;
  transition: all var(--transition);
}
.toc-nav.collapsed .toc-list { display: none; }
.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.toc-title { font-weight: 700; font-size: 0.92rem; color: var(--text); letter-spacing: -0.01em; }
.toc-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.toc-toggle:hover { border-color: var(--primary); color: var(--primary); }
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc-counter;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 60vh;
  overflow-y: auto;
}
.toc-item { counter-increment: toc-counter; border-radius: 6px; transition: background var(--transition); }
.toc-item:hover { background: rgba(37, 99, 235, 0.06); }
.toc-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px 8px 34px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  position: relative;
}
.toc-link::before {
  content: counter(toc-counter);
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.toc-link:hover { color: var(--primary); background: var(--bg-alt); }
.toc-link.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--bg-alt);
  box-shadow: inset 3px 0 0 var(--primary);
}
.toc-link.active::before {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.toc-progress {
  margin-top: 12px;
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.toc-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--brand-2));
  transition: width 0.15s linear;
  border-radius: 3px;
}

/* ============ FAQ ============ */
.faq-section {
  margin: 40px 0;
  padding: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.faq-section h2 {
  font-size: 1.3rem;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  color: var(--primary);
}
.faq-item {
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.faq-item summary { cursor: pointer; font-size: 0.95rem; color: var(--text); padding: 4px 0; }
.faq-item summary:hover { color: var(--primary); }
.faq-item p {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ============ Related ============ */
.related-section { margin-top: 50px; content-visibility: auto; contain-intrinsic-size: 400px; }

/* ============ Not Found ============ */
.not-found { text-align: center; padding: 80px 20px; }
.not-found-icon { font-size: 4rem; margin-bottom: 16px; }
.not-found h1 { font-size: 1.8rem; margin-bottom: 8px; }
.not-found p { color: var(--text-muted); margin-bottom: 24px; }

.loading-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ============ Footer ============ */
.main-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 40px 0 24px;
  margin-top: 40px;
  font-size: 0.9rem;
}
.main-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--footer-text); }
.footer-links a:hover { color: #60a5fa; }

/* ============ Site Status ============ */
.global-site-stats {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-status {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--footer-text);
  padding: 16px 20px;
  background: var(--footer-bg);
  margin-top: 0;
}
.site-status-item { display: inline-flex; align-items: center; gap: 6px; }
.site-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  animation: status-pulse 2s infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============ Scroll Top ============ */
#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  width: 48px;
  height: 48px;
  font-size: 20px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
  align-items: center;
  justify-content: center;
}
#scrollTopBtn.visible { display: flex; }
#scrollTopBtn:hover { background: var(--primary-hover); transform: translateY(-3px); }

/* ============ Reading Progress ============ */
#readingProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--brand-2));
  width: 0%;
  z-index: 10000;
  transition: width 0.1s ease-out;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 500;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============ Admin Modal ============ */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.admin-modal-overlay.active { display: flex; }
.admin-modal-card {
  background: #1e293b;
  color: #f8fafc;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 360px;
  text-align: center;
  border: 1px solid #334155;
  font-family: inherit;
}
.admin-modal-card h3 { margin-top: 0; margin-bottom: 12px; font-size: 1.25rem; }
.admin-modal-card input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #fff;
  box-sizing: border-box;
  outline: none;
}
.admin-modal-card button {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}
.admin-modal-card button:hover { background: #1d4ed8; }

/* ============ Copy Code Button ============ */
pre { position: relative; }
.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #334155;
  color: #ffffff;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.copy-code-btn:hover { background: #475569; }

/* ============ Comments ============ */
.comments-section { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.comments-unavailable {
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============ News widget ============ */
.news-widget-item {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
}
.news-widget-item:last-child { border-bottom: none; }
.news-widget-item:hover { color: var(--primary); }
.news-widget-tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 4px;
  padding: 1px 6px;
  margin-inline-end: 6px;
}

/* ============ Forum ============ */
.forum-hero { text-align: center; padding: 40px 20px; background: linear-gradient(135deg, #0f172a, #1e293b); color: #fff; border-radius: 16px; margin: 20px 0 30px; }
.forum-hero h1 { font-size: 2.2rem; margin-bottom: 10px; color: #38bdf8; }
.forum-hero p { color: #94a3b8; font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .academy-preview-inner { grid-template-columns: 1fr; }
  .academy-preview-visual { display: none; }
}
@media (max-width: 720px) {
  .main-header .container { flex-direction: column; align-items: stretch; gap: 8px; }
  .nav-links { justify-content: flex-start; }
  .nav-links a { font-size: 0.88rem; padding: 6px 10px; }
  .hero-section h1 { font-size: 1.5rem; }
  .main-footer .container { justify-content: center; text-align: center; }
  .ticker { font-size: 0.82rem; }
  .ticker-label { font-size: 0.68rem; padding: 6px 10px; }
  .single-article { padding: 24px 20px; }
  .academy-preview { padding: 24px 20px; }
  .all-articles-list { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ticker-track { animation: none; padding-left: 20px; overflow-x: auto; }
}

/* ===== Command Palette ===== */
.tp-cmdk-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);backdrop-filter:blur(6px);z-index:9999;display:none;align-items:flex-start;justify-content:center;padding-top:12vh}
.tp-cmdk-overlay.open{display:flex}
.tp-cmdk{width:min(640px,92vw);background:var(--bg-alt);border:1px solid var(--border);border-radius:14px;box-shadow:0 24px 60px rgba(0,0,0,.35);overflow:hidden}
.tp-cmdk-input{width:100%;padding:18px 22px;border:none;outline:none;background:transparent;color:var(--text);font-size:1.05rem;border-bottom:1px solid var(--border);font-family:inherit}
.tp-cmdk-results{max-height:400px;overflow-y:auto;padding:8px 0}
.tp-cmdk-item{padding:10px 22px;cursor:pointer;display:flex;align-items:center;gap:12px;color:var(--text);text-decoration:none;transition:background .15s}
.tp-cmdk-item.active,.tp-cmdk-item:hover{background:var(--primary-soft)}
.tp-cmdk-item .icon{font-size:1.1rem;width:22px;text-align:center}
.tp-cmdk-item .title{flex:1;font-weight:500}
.tp-cmdk-item .type{font-size:.7rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}
.tp-cmdk-empty{padding:24px 22px;color:var(--text-muted);text-align:center}
.tp-cmdk-footer{padding:8px 22px;background:var(--bg-soft,#f8fafc);border-top:1px solid var(--border);font-size:.75rem;color:var(--text-muted);display:flex;gap:16px;flex-wrap:wrap}
.tp-cmdk-footer kbd{background:var(--bg-alt);border:1px solid var(--border);padding:2px 6px;border-radius:4px;font-family:monospace;font-size:.7rem}

/* ===== Command Palette hint badge ===== */
.tp-cmdk-hint{position:fixed;bottom:16px;right:16px;padding:8px 12px;background:var(--bg-alt);border:1px solid var(--border);border-radius:8px;font-size:.75rem;color:var(--text-muted);box-shadow:0 4px 12px rgba(0,0,0,.06);z-index:9000;display:flex;align-items:center;gap:6px;cursor:pointer;transition:opacity .3s,transform .3s}
.tp-cmdk-hint:hover{border-color:var(--primary);color:var(--primary)}
.tp-cmdk-hint kbd{background:var(--bg-soft,#f1f5f9);border:1px solid var(--border);padding:1px 5px;border-radius:4px;font-family:monospace}
.tp-cmdk-hint.hidden{opacity:0;transform:translateY(10px);pointer-events:none}
@media (max-width:600px){.tp-cmdk-hint{display:none}}


/* ===== Q&A / Forum cards ===== */
.qa-item,.forum-card{display:flex;gap:16px;padding:20px;background:var(--bg-alt);border:1px solid var(--border);border-radius:12px;margin-bottom:12px;text-decoration:none;color:var(--text);transition:border-color .15s,box-shadow .15s}
.qa-item:hover,.forum-card:hover{border-color:var(--primary);box-shadow:0 4px 12px rgba(0,0,0,.05)}
.qa-votes{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:60px;background:var(--bg-soft,#f1f5f9);border-radius:8px;padding:8px 12px;font-size:.75rem;color:var(--text-muted)}
.qa-votes .vote-count{font-size:1.1rem;font-weight:700;color:var(--primary)}
.qa-votes .vote-label{text-transform:uppercase;letter-spacing:.05em}
.qa-content{flex:1;min-width:0}
.qa-content h3{margin:0 0 8px;font-size:1.05rem;line-height:1.4}
.qa-excerpt{margin:0 0 12px;color:var(--text-muted);font-size:.9rem;line-height:1.5}
.qa-meta{display:flex;flex-wrap:wrap;gap:12px;font-size:.78rem;color:var(--text-muted);align-items:center}
.qa-status{padding:2px 8px;border-radius:999px;font-weight:600}
.qa-status.answered{background:#dcfce7;color:#166534}
.qa-status.open{background:#fef3c7;color:#92400e}
.qa-tag{padding:2px 8px;background:var(--bg-soft,#f1f5f9);border-radius:999px;font-size:.72rem;text-transform:uppercase;letter-spacing:.04em}
.forum-card{flex-direction:column;gap:8px}
.forum-badge{align-self:flex-start;padding:3px 10px;background:var(--primary-soft,#dbeafe);color:var(--primary,#2563eb);border-radius:999px;font-size:.7rem;font-weight:700;letter-spacing:.05em}
.forum-card h3{margin:4px 0 6px;font-size:1.05rem;line-height:1.4}
.forum-card p{margin:0 0 12px;color:var(--text-muted);font-size:.9rem;line-height:1.5}
.forum-meta{display:flex;flex-wrap:wrap;gap:16px;font-size:.8rem;color:var(--text-muted)}

/* ============ Performance fixes (CLS / LCP) — 2026-10-16 ============ */
img, picture, video { max-width: 100%; height: auto; display: block; }
.article-hero-img, .hero-img, .og-image {
  aspect-ratio: 1200 / 630;
  width: 100%;
  object-fit: cover;
  background: #1e293b;
}
.article-card img {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: #1e293b;
}
.ticker, .ticker-track { min-height: 40px; }
.hero-section { min-height: 220px; }
.best-picks, .home-tech-grid, .academy-preview { min-height: 140px; }
.sidebar .widget { min-height: 60px; }
.loading-state { min-height: 120px; }

/* Wait indicator without any text (replaces "Loading..." messages) */
.loading-state:empty { display:flex; align-items:center; justify-content:center; min-height:120px; }
.loading-state:empty::before { content:""; width:34px; height:34px; border-radius:50%; border:3px solid var(--border, #ddd); border-top-color:var(--primary, #0ea5e9); animation:tp-spin .8s linear infinite; }
@keyframes tp-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-state:empty::before { animation:none; } }
