/* ===== DESIGN TOKENS ===== */
:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ===== LIGHT MODE (Default) ===== */
:root, [data-theme="light"] {
  --color-bg:             #f8f7fc;
  --color-surface:        #ffffff;
  --color-surface-2:      #f3f1f9;
  --color-surface-offset: #ece9f4;
  --color-surface-dynamic: #ddd8ea;
  --color-divider:        #ddd8ea;
  --color-border:         #c9c3d9;

  --color-text:           #1a1625;
  --color-text-muted:     #6b6580;
  --color-text-faint:     #a49dba;
  --color-text-inverse:   #ffffff;

  /* Primary — purple/violet */
  --color-primary:        #7c3aed;
  --color-primary-hover:  #6d28d9;
  --color-primary-active: #5b21b6;
  --color-primary-light:  #f3eeff;

  /* Success green */
  --color-success:        #2d9f4e;
  --color-success-light:  #e8f5e9;

  /* Warning amber */
  --color-warning:        #e67e22;
  --color-warning-light:  #fff3e0;

  /* Accent — magenta-pink for CTAs */
  --color-accent:         #d946ef;
  --color-accent-hover:   #c026d3;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg:             #0e0b1a;
  --color-surface:        #1a1628;
  --color-surface-2:      #231e36;
  --color-surface-offset: #16122a;
  --color-surface-dynamic: #2a2440;
  --color-divider:        #2a2440;
  --color-border:         #3a3455;

  --color-text:           #e8e5f0;
  --color-text-muted:     #9a94b0;
  --color-text-faint:     #5a5475;
  --color-text-inverse:   #0e0b1a;

  --color-primary:        #a78bfa;
  --color-primary-hover:  #8b5cf6;
  --color-primary-active: #7c3aed;
  --color-primary-light:  #1a1530;

  --color-success:        #4caf50;
  --color-success-light:  #1a2e1a;

  --color-warning:        #ffa726;
  --color-warning-light:  #2e2a1a;

  --color-accent:         #e879f9;
  --color-accent-hover:   #d946ef;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0e0b1a;
    --color-surface:        #1a1628;
    --color-surface-2:      #231e36;
    --color-surface-offset: #16122a;
    --color-surface-dynamic: #2a2440;
    --color-divider:        #2a2440;
    --color-border:         #3a3455;
    --color-text:           #e8e5f0;
    --color-text-muted:     #9a94b0;
    --color-text-faint:     #5a5475;
    --color-text-inverse:   #0e0b1a;
    --color-primary:        #a78bfa;
    --color-primary-hover:  #8b5cf6;
    --color-primary-active: #7c3aed;
    --color-primary-light:  #1a1530;
    --color-success:        #4caf50;
    --color-success-light:  #1a2e1a;
    --color-warning:        #ffa726;
    --color-warning-light:  #2e2a1a;
    --color-accent:         #e879f9;
    --color-accent-hover:   #d946ef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}

/* ===== GLOBAL STYLES ===== */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--narrow {
  max-width: var(--content-default);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-3) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.logo:hover { text-decoration: none; }

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* ===== HERO ===== */
.hero {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  max-width: 18ch;
  margin-inline: auto;
}

.hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--color-accent-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-muted);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* ===== TOOL CARDS ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.tool-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.tool-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.tool-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.tool-rating {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-warning);
}

.tool-price {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.tool-price strong {
  color: var(--color-text);
  font-size: var(--text-base);
}

.tool-features {
  list-style: none;
  margin-bottom: var(--space-5);
  flex: 1;
}
.tool-features li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.tool-features li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  margin-top: 8px;
  flex-shrink: 0;
}

.tool-card-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: auto;
}
.tool-card-actions .btn {
  flex: 1;
  text-align: center;
}

/* ===== COMPARISON TABLE ===== */
.comparison-section {
  padding: clamp(var(--space-8), 6vw, var(--space-16)) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.section-header p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-inline: auto;
}

.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
}

.comparison-table {
  min-width: 700px;
  font-size: var(--text-sm);
}

.comparison-table thead {
  background: var(--color-surface-2);
}

.comparison-table th,
.comparison-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-divider);
  vertical-align: top;
}

.comparison-table th {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.comparison-table td {
  color: var(--color-text-muted);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background: var(--color-surface-offset, var(--color-surface-2));
}

.check { color: var(--color-success); font-weight: 600; }
.cross { color: var(--color-text-faint); }

/* ===== COMPARISONS GRID ===== */
.comparisons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-4);
}

.comparison-link-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.comparison-link-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
}
.comparison-link-card .vs {
  color: var(--color-accent);
  font-weight: 700;
  font-size: var(--text-xs);
}

/* ===== BEST FOR SECTION ===== */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-4);
}

.use-case-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow var(--transition-interactive);
}
.use-case-card:hover {
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.use-case-card h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.use-case-card p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.use-case-card .rec {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
}

/* ===== ARTICLE / REVIEW PAGE ===== */
.article-header {
  padding: clamp(var(--space-8), 6vw, var(--space-16)) 0 var(--space-8);
  text-align: center;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.article-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.article-body {
  max-width: 72ch;
  margin-inline: auto;
  padding-bottom: var(--space-16);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.article-body h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.article-body p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.article-body ul, .article-body ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}
.article-body li {
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

/* Verdict / CTA Box */
.verdict-box {
  background: var(--color-primary-light);
  border: 1px solid oklch(from var(--color-primary) l c h / 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin: var(--space-8) 0;
  text-align: center;
}
.verdict-box h3 {
  margin-top: 0;
  color: var(--color-primary);
}
.verdict-box p {
  margin-bottom: var(--space-4);
}

/* Pros/Cons */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.pros, .cons {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.pros {
  background: var(--color-success-light);
}
.cons {
  background: var(--color-warning-light);
}

.pros h4, .cons h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.pros h4 { color: var(--color-success); }
.cons h4 { color: var(--color-warning); }

.pros ul, .cons ul {
  list-style: none;
  padding: 0;
}
.pros li, .cons li {
  font-size: var(--text-xs);
  padding: var(--space-1) 0;
}

/* Quick Stats */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.stat-card .stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ===== VS PAGE ===== */
.vs-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.vs-tool {
  text-align: center;
}

.vs-tool .tool-initial {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: #fff;
  margin: 0 auto var(--space-2);
}

.vs-badge {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-accent);
}

/* ===== PRICING TABLE ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-align: center;
}

.pricing-card.recommended {
  border-color: var(--color-primary);
  position: relative;
}

.pricing-card.recommended::before {
  content: 'Best Value';
  position: absolute;
  top: calc(-1 * var(--space-3));
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.pricing-card h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pricing-card .price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.pricing-card .price-period {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* ===== NEWSLETTER ===== */
.newsletter {
  background: var(--color-surface-2);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  margin: var(--space-12) 0;
}

.newsletter h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.newsletter p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  max-width: 45ch;
  margin-inline: auto;
}

.newsletter-form {
  display: flex;
  gap: var(--space-2);
  max-width: 400px;
  margin-inline: auto;
}

.newsletter-form input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  font-size: var(--text-sm);
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-12);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-brand p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  max-width: 30ch;
}

.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.footer-col ul {
  list-style: none;
}
.footer-col a {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  display: block;
  padding: var(--space-1) 0;
}
.footer-col a:hover {
  color: var(--color-text);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-bottom a {
  color: var(--color-text-faint);
}
.footer-bottom a:hover {
  color: var(--color-text-muted);
}

/* ===== AFFILIATE DISCLOSURE ===== */
.disclosure {
  background: var(--color-surface-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}
.breadcrumbs a {
  color: var(--color-text-muted);
}
.breadcrumbs span {
  margin: 0 var(--space-1);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-divider);
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
  }

  .hero h1 { font-size: clamp(1.5rem, 6vw, 2.5rem); }

  .pros-cons { grid-template-columns: 1fr; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .vs-header { flex-direction: column; gap: var(--space-3); }

  .newsletter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
}

/* ===== SCROLL ANIMATION ===== */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
