/* ToolMag Identity System v2 — dark mode */
:root {
  --tm-bg:        #0a0a0f;
  --tm-bg2:       #13131a;
  --tm-bg3:       #1a1a24;
  --tm-border:    rgba(99,102,241,0.18);
  --tm-border-s:  rgba(255,255,255,0.06);
  --tm-blue:      #6366f1;
  --tm-blue-d:    #4f46e5;
  --tm-purple:    #8b5cf6;
  --tm-orange:    #f97316;
  --tm-cyan:      #22d3ee;
  --tm-ink:       #f0f0f5;
  --tm-ink-m:     #9ca3af;
  --tm-ink-f:     #6b7280;
  --tm-score-high: #4ade80;
  --tm-score-mid:  #fbbf24;
  --tm-score-low:  #f87171;
  --tm-gradient:   linear-gradient(135deg, #6366f1, #8b5cf6);
  --tm-glow:       0 0 40px rgba(99,102,241,0.25);
  --tm-font-display: 'Bricolage Grotesque', sans-serif;
  --tm-font-body:    'DM Sans', sans-serif;
  --tm-shadow-card:  0 4px 24px rgba(0,0,0,0.4);
  --tm-shadow-hover: 0 20px 48px rgba(99,102,241,0.2);
  --tm-radius:    16px;
  --tm-radius-sm: 10px;
}

/* ===== SCORE BADGES ===== */
.tm-score-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--tm-font-display);
  font-weight: 800;
  color: #0a0a0f;
  font-size: 14px;
  line-height: 1;
  z-index: 3;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.tm-score-badge.high { background: var(--tm-score-high); }
.tm-score-badge.mid  { background: var(--tm-score-mid); }
.tm-score-badge.low  { background: var(--tm-score-low); }
.tm-score-badge span { font-size: 9px; opacity: 0.7; }

/* ===== MARQUEE TRUST BAR ===== */
.tm-marquee-bar {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--tm-bg2);
  border-top: 1px solid var(--tm-border-s);
  border-bottom: 1px solid var(--tm-border-s);
  padding: 14px 0;
  user-select: none;
  z-index: 50;
}
.tm-marquee-track {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: tm-marquee 28s linear infinite;
}
.tm-marquee-bar:hover .tm-marquee-track { animation-play-state: paused; }
.tm-marquee-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--tm-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--tm-ink-m);
  white-space: nowrap;
}
.tm-marquee-item strong { color: var(--tm-blue); font-weight: 700; }
.tm-marquee-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tm-blue);
  opacity: 0.5;
  flex-shrink: 0;
}
@keyframes tm-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== COUNTER TRUST BAR ===== */
.tm-count-trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 40px 32px;
  background: var(--tm-bg2);
  border-bottom: 1px solid var(--tm-border-s);
  flex-wrap: wrap;
}
.tm-ctr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 56px;
  text-align: center;
}
.tm-ctr-sep {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, transparent, var(--tm-border), transparent);
}
.tm-ctr-label {
  font-size: 13px;
  color: var(--tm-ink-f);
  font-weight: 500;
  font-family: var(--tm-font-body);
  letter-spacing: .02em;
}
.tm-counter {
  font-family: var(--tm-font-display);
  font-size: 48px;
  font-weight: 800;
  background: var(--tm-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* ===== SEARCH PILLS ===== */
.tm-search-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tm-pill {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--tm-border);
  border-radius: 20px;
  background: rgba(99,102,241,0.08);
  color: var(--tm-blue);
  cursor: pointer;
  font-family: var(--tm-font-body);
  transition: transform 0.2s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
.tm-pill:hover {
  transform: scale(1.05);
  background: var(--tm-blue);
  color: white;
  border-color: var(--tm-blue);
}

/* ===== WHY TOOLMAG SECTION ===== */
.tm-why-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 32px;
}
.tm-why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.tm-why-card {
  background: var(--tm-bg2);
  border: 1px solid var(--tm-border-s);
  border-radius: var(--tm-radius);
  padding: 36px 28px;
  text-align: center;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.tm-why-card:hover {
  box-shadow: var(--tm-shadow-hover);
  border-color: var(--tm-border);
}
.tm-why-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
}
.tm-why-title {
  font-family: var(--tm-font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--tm-ink);
}
.tm-why-text {
  font-size: 14px;
  color: var(--tm-ink-m);
  line-height: 1.65;
}

/* ===== SVG CHECK ANIMATION ===== */
.tm-check-path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  transition: stroke-dashoffset 0.8s ease 0.2s;
}
.tm-why-card.is-visible .tm-check-path { stroke-dashoffset: 0; }

/* ===== NEEDLE ANIMATION ===== */
@keyframes tm-needle-sweep {
  0%   { transform: rotate(-50deg); }
  100% { transform: rotate(50deg); }
}
.tm-needle-el {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: tm-needle-sweep 2.2s ease-in-out infinite alternate;
}

/* ===== PULSE DOT ===== */
@keyframes tm-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}
.tm-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tm-score-high);
  animation: tm-pulse-dot 2s ease-in-out infinite;
  margin-right: 6px;
  vertical-align: middle;
}

/* ===== SCORE WIDGET (article.html) ===== */
.tm-score-widget {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 0 32px;
}
.tm-score-widget-inner {
  background: var(--tm-bg2, white);
  border: 1px solid var(--tm-border-s, #e4e3df);
  border-radius: var(--tm-radius);
  padding: 28px 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--tm-shadow-card);
}
.tm-score-total {
  text-align: center;
  flex: 0 0 100px;
}
.tm-score-number {
  font-family: var(--tm-font-display);
  font-size: 52px;
  font-weight: 800;
  background: var(--tm-gradient, linear-gradient(135deg,#6366f1,#8b5cf6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.tm-score-label {
  font-size: 10px;
  color: var(--tm-ink-f, #5a5a5a);
  margin-top: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.tm-score-chart-wrap {
  flex: 1;
  min-width: 200px;
}

/* ===== PROGRESS BAR PULSE ===== */
@keyframes tm-prog-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}
.tm-prog-complete {
  animation: tm-prog-pulse 0.5s ease 3;
}

/* ===== SEARCH DROPDOWN ===== */
.tm-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--tm-bg2);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius-sm);
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  max-height: 320px;
  overflow-y: auto;
}
.tm-search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--tm-ink);
  transition: background 0.15s;
  border-bottom: 1px solid var(--tm-border-s);
}
.tm-search-result:last-child { border-bottom: none; }
.tm-search-result:hover { background: rgba(99,102,241,0.1); }
.tm-sr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tm-ink);
}
.tm-sr-desc {
  font-size: 12px;
  color: var(--tm-ink-m);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.tm-sr-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(99,102,241,0.15);
  color: var(--tm-blue);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media(max-width: 768px) {
  .tm-why-grid { grid-template-columns: 1fr; }
  .tm-score-widget { padding: 0 16px; }
  .tm-ctr-item { padding: 0 24px; }
  .tm-count-trust-bar { gap: 0; padding: 24px 16px; }
  .tm-counter { font-size: 36px; }
}
@media(max-width: 600px) {
  .tm-ctr-sep { display: none; }
  .tm-count-trust-bar { gap: 20px; }
  .tm-ctr-item { padding: 0; }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .tm-check-path { stroke-dashoffset: 0 !important; transition: none !important; }
  .tm-needle-el { animation: none !important; }
  .tm-marquee-track { animation: none !important; }
}

/* ── CARD HOVER ── */
.art-card {
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.2s;
}
.art-card:hover {
  transform: scale(1.02);
}

/* ── GLOWING SCORE BADGE ── */
.tm-score-badge.high {
  box-shadow: 0 0 12px rgba(16,185,129,0.5), 0 0 24px rgba(16,185,129,0.2);
  animation: pulse-score 2.5s ease-in-out infinite;
}
.tm-score-badge.mid {
  box-shadow: 0 0 12px rgba(245,158,11,0.4);
}
@keyframes pulse-score {
  0%, 100% { box-shadow: 0 0 12px rgba(16,185,129,0.5), 0 0 24px rgba(16,185,129,0.2); }
  50% { box-shadow: 0 0 20px rgba(16,185,129,0.8), 0 0 40px rgba(16,185,129,0.3); }
}

/* ── SCROLL PROGRESS GRADIENT ── */
#tm-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  z-index: 9999;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #f97316);
  background-size: 200% 100%;
  animation: progress-shimmer 2s linear infinite;
  transition: width 0.1s linear;
}
@keyframes progress-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── DARK THEME FOR ALL PAGES ── */
.page-dark {
  background: #0a0a0f;
  color: #e8e8f0;
  min-height: 100vh;
}
.page-dark .site-header {
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99,102,241,0.15);
}
.page-dark .logo span {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-dark .nav-links a { color: #9ca3af; }
.page-dark .nav-links a:hover { color: #e8e8f0; }
.page-dark h1, .page-dark h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  color: #e8e8f0;
}
.page-dark .art-card {
  background: #13131a;
  border-color: rgba(99,102,241,0.15);
  color: #e8e8f0;
}
.page-dark .art-card:hover {
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 8px 32px rgba(99,102,241,0.15);
}
.page-dark .card-title { color: #e8e8f0; }
.page-dark .card-desc { color: #9ca3af; }
.page-dark .card-date { color: #6b7280; }
.page-dark footer {
  background: #0a0a0f;
  border-top: 1px solid rgba(99,102,241,0.1);
  color: #6b7280;
}
.page-dark footer a { color: #6366f1; }

/* ── ARTICLE DARK THEME ── */
.article-dark-wrap {
  background: #0a0a0f;
  min-height: 100vh;
  color: #e8e8f0;
}
.article-dark-wrap .back-link { color: #9ca3af; }
.article-dark-wrap .back-link:hover { color: #6366f1; }

/* ── TRENDING PAGE DARK ── */
.page-dark .tool-row {
  background: #13131a;
  border-color: rgba(99,102,241,0.15);
  color: #e8e8f0;
}
.page-dark .tool-row:hover {
  border-color: rgba(99,102,241,0.4);
  background: #1a1a2e;
}
.page-dark .filter-btn {
  background: transparent;
  border-color: rgba(255,255,255,0.1);
  color: #9ca3af;
}
.page-dark .filter-btn.active {
  background: rgba(99,102,241,0.2);
  color: #6366f1;
  border-color: rgba(99,102,241,0.4);
}
.page-dark .score-num { color: #6366f1; }

/* ── SCORE RADAR WIDGET ── */
#score-widget-outer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 32px;
}
.score-widget-card {
  background: #13131a;
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}
.score-total-wrap {
  text-align: center;
  flex-shrink: 0;
}
.score-total-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.score-total-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
.score-radar-wrap { flex: 1; min-width: 200px; max-width: 280px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
