/* ============================================
   SmartWealth AI — Emil Design System
   Taste-driven polish layer
   ============================================ */

/* ---- Custom Easing Curves (never use default easings for UI) ---- */
:root {
  --ease-out:     cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out:  cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-drawer:  cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Reading */
  --article-width: 720px;
  --sidebar-width: 280px;
  --line-height-article: 1.85;
  --font-size-article: 17px;
}

/* ============================================
   Buttons — press feedback is non-negotiable
   ============================================ */

/* Replace generic transition with specific properties */
.btn {
  transition:
    transform   150ms var(--ease-out),
    box-shadow  200ms var(--ease-out),
    background-color 150ms ease,
    border-color     150ms ease,
    color            150ms ease,
    opacity          150ms ease;
  will-change: transform;
}

/* Press feedback — every button MUST feel responsive */
.btn:active {
  transform: scale(0.97) !important;
}

/* Gate hover animations — touch devices get false positives */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(29,78,216,0.4);
  }
  .btn-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5,150,105,0.4);
  }
  .btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(215,119,6,0.4);
  }
  .btn-outline:hover { transform: translateY(-1px); }
  .btn-outline-white:hover { transform: translateY(-1px); }
}

/* ============================================
   Cards — specific transitions, never 'all'
   ============================================ */
.tool-card,
.article-card,
.category-card,
.testimonial-card,
.resource-card,
.card {
  transition:
    transform   280ms var(--ease-out),
    box-shadow  280ms var(--ease-out),
    border-color 200ms ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .tool-card:hover     { transform: translateY(-5px); }
  .article-card:hover  { transform: translateY(-4px); }
  .category-card:hover { transform: translateY(-3px); }
  .card:hover          { transform: translateY(-2px); }
  .resource-card:hover { transform: translateX(5px); }
}

/* Prevent double-transform from old styles */
.tool-card:hover   { box-shadow: var(--shadow-xl); }
.article-card:hover { box-shadow: var(--shadow-xl); }

/* ============================================
   Stagger Animations — cards reveal in sequence
   ============================================ */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-item.revealed {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity  500ms var(--ease-out),
    transform 500ms var(--ease-out);
}

/* Stagger delays */
.stagger-item:nth-child(1).revealed { transition-delay: 0ms; }
.stagger-item:nth-child(2).revealed { transition-delay: 60ms; }
.stagger-item:nth-child(3).revealed { transition-delay: 120ms; }
.stagger-item:nth-child(4).revealed { transition-delay: 180ms; }
.stagger-item:nth-child(5).revealed { transition-delay: 240ms; }
.stagger-item:nth-child(6).revealed { transition-delay: 300ms; }
.stagger-item:nth-child(7).revealed { transition-delay: 360ms; }
.stagger-item:nth-child(8).revealed { transition-delay: 420ms; }
.stagger-item:nth-child(9).revealed { transition-delay: 480ms; }

/* ============================================
   Nav Links — specific transition, not color flicker
   ============================================ */
.nav-link {
  transition: color 150ms ease, background-color 150ms ease;
  will-change: auto;
}

/* ============================================
   Reading Progress Bar
   ============================================ */
.reading-progress-bar {
  position: fixed;
  top: 68px;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--emerald) 100%);
  z-index: 1001;
  transition: width 80ms linear;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

/* ============================================
   Article Layout
   ============================================ */
.article-page {
  background: var(--white);
  padding-top: 68px;
}

.article-hero {
  background: linear-gradient(155deg, #0A0F2E 0%, #0F1E5C 50%, #0B3D30 100%);
  padding: 64px 0 56px;
}

.article-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.article-hero-eyebrow a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 150ms ease;
}
.article-hero-eyebrow a:hover { color: rgba(255,255,255,0.85); }
.article-hero-eyebrow .sep { opacity: 0.4; }

.article-hero-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  margin-bottom: 16px;
}

.article-hero-title {
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 20px;
  max-width: 860px;
}

.article-hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  max-width: 660px;
  margin-bottom: 28px;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.article-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}

.article-author-info {}
.article-author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
  margin-top: 3px;
}

.article-meta-dot { opacity: 0.4; }

/* Article Body Layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 56px;
  padding: 56px 0 80px;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Article Content */
.article-content {
  max-width: var(--article-width);
}

.article-content p {
  font-size: var(--font-size-article);
  line-height: var(--line-height-article);
  color: var(--gray-700);
  margin-bottom: 1.5em;
}

.article-content h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  line-height: 1.2;
  scroll-margin-top: 88px;
}

.article-content h3 {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.01em;
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.3;
  scroll-margin-top: 88px;
}

.article-content h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.article-content ul, .article-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.article-content li {
  font-size: var(--font-size-article);
  line-height: var(--line-height-article);
  color: var(--gray-700);
  margin-bottom: 0.5em;
}

.article-content strong { color: var(--dark); font-weight: 700; }

.article-content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(29,78,216,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease, color 150ms ease;
}
.article-content a:hover {
  text-decoration-color: var(--primary);
}

/* Article First Paragraph — drop cap style */
.article-content .article-intro:first-letter {
  font-size: 3.2em;
  font-weight: 900;
  line-height: 0.8;
  float: left;
  margin-right: 8px;
  margin-top: 4px;
  color: var(--primary);
  font-family: var(--font);
}

/* Callout Boxes */
.callout {
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 2em 0;
  border-left: 4px solid;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.callout-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }

.callout-body {}
.callout-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.callout-text  { font-size: 14px; line-height: 1.65; margin: 0; }

.callout-tip {
  background: rgba(5,150,105,0.06);
  border-color: var(--emerald);
}
.callout-tip .callout-title { color: var(--emerald); }
.callout-tip .callout-text  { color: var(--gray-700); }

.callout-warning {
  background: rgba(215,119,6,0.06);
  border-color: var(--gold);
}
.callout-warning .callout-title { color: var(--gold); }
.callout-warning .callout-text  { color: var(--gray-700); }

.callout-info {
  background: rgba(29,78,216,0.05);
  border-color: var(--primary);
}
.callout-info .callout-title { color: var(--primary); }
.callout-info .callout-text  { color: var(--gray-700); }

.callout-key {
  background: var(--gray-50);
  border-color: var(--gray-400);
}
.callout-key .callout-title { color: var(--dark); }
.callout-key .callout-text  { color: var(--gray-600); }

/* Key Takeaways */
.key-takeaways {
  background: linear-gradient(135deg, #EFF6FF, #F0FDF4);
  border: 1px solid rgba(29,78,216,0.15);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin: 0 0 2.5em;
}

.key-takeaways-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-takeaways ul {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.key-takeaways li {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.6;
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  border-bottom: 1px solid rgba(29,78,216,0.08);
}

.key-takeaways li:last-child { border-bottom: none; }

.key-takeaways li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--emerald);
  font-weight: 900;
  font-size: 14px;
}

/* Comparison Table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  font-size: 15px;
}

.comparison-table th {
  background: var(--dark);
  color: var(--white);
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.comparison-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  line-height: 1.5;
}

.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:nth-child(even) td { background: var(--gray-50); }

/* Tool CTA within articles */
.article-tool-cta {
  background: linear-gradient(135deg, #0F1E5C, #0B3D30);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin: 2.5em 0;
  display: flex;
  align-items: center;
  gap: 24px;
}

.article-tool-cta-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.article-tool-cta-body { flex: 1; }
.article-tool-cta-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.article-tool-cta-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Share Row */
.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  margin: 2em 0;
  flex-wrap: wrap;
}

.share-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
}

.share-btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  font-family: var(--font);
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms var(--ease-out);
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .share-btn:hover { border-color: var(--primary); color: var(--primary); }
}

.share-btn:active { transform: scale(0.97); }

/* ============================================
   Article Sidebar
   ============================================ */
.article-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
}

.toc-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: 14px;
}

.toc-list { padding: 0; margin: 0; }

.toc-item {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
  margin-bottom: 2px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: all 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .toc-item:hover {
    color: var(--primary);
    background: rgba(29,78,216,0.06);
  }
}

.toc-item.active {
  color: var(--primary);
  background: rgba(29,78,216,0.08);
  border-left-color: var(--primary);
  font-weight: 600;
}

.toc-item.toc-h3 {
  padding-left: 22px;
  font-size: 12px;
}

/* Sidebar author card */
.sidebar-author-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.sidebar-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
  margin: 0 auto 12px;
  border: 3px solid rgba(29,78,216,0.1);
}

.sidebar-author-name { font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.sidebar-author-title { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; }
.sidebar-author-bio { font-size: 13px; color: var(--gray-600); line-height: 1.6; }

/* ============================================
   Related Articles
   ============================================ */
.related-articles {
  background: var(--gray-50);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-top: 3em;
}

.related-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  text-decoration: none;
  display: block;
  transition:
    transform 250ms var(--ease-out),
    box-shadow 250ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }
}

.related-card:active { transform: scale(0.99); }

.related-card-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.related-card-body { padding: 16px; }
.related-card-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary); margin-bottom: 6px; }
.related-card-title { font-size: 14px; font-weight: 700; color: var(--dark); line-height: 1.4; }
.related-card-time { font-size: 12px; color: var(--gray-500); margin-top: 8px; }

/* ============================================
   Number Stats (article callouts)
   ============================================ */
.stat-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 2em 0;
}

.stat-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.stat-item-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-item-label {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.4;
}

/* ============================================
   Income List (for Make Money articles)
   ============================================ */
.income-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .income-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
  }
}

.income-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.income-body { flex: 1; }
.income-name { font-size: 16px; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.income-desc { font-size: 14px; color: var(--gray-600); line-height: 1.6; margin-bottom: 8px; }
.income-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.income-tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; }
.tag-earn { background: rgba(5,150,105,0.1); color: var(--emerald); }
.tag-start { background: rgba(29,78,216,0.1); color: var(--primary); }
.tag-diff  { background: rgba(215,119,6,0.1); color: var(--gold); }

/* ============================================
   Footer — CoreForge Systems
   ============================================ */
.coreforge-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .coreforge-logo:hover { opacity: 0.85; }
}

.coreforge-mark {
  flex-shrink: 0;
}

.coreforge-text {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.coreforge-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* ============================================
   Legal Pages
   ============================================ */
.legal-page {
  background: var(--white);
  padding-top: 68px;
}

.legal-hero {
  background: var(--dark);
  padding: 48px 0;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.legal-content h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}

.legal-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.legal-content p, .legal-content li {
  font-size: 16px;
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 1em;
}

.legal-content ul, .legal-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.legal-last-updated {
  font-size: 13px;
  color: var(--gray-500);
  padding: 12px 18px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 2em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   Sitemap Page
   ============================================ */
.sitemap-section {
  margin-bottom: 48px;
}

.sitemap-group-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.sitemap-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sitemap-link {
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--gray-200);
  transition: background-color 150ms ease, border-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .sitemap-link:hover {
    background: rgba(29,78,216,0.06);
    border-color: var(--primary);
  }
}

/* ============================================
   Scroll Progress (hero numbers)
   ============================================ */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Mobile responsive adjustments
   ============================================ */
@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    order: -1;
  }
  .toc-card { display: none; } /* hide TOC on mobile, use sticky mini version */
  .related-grid { grid-template-columns: 1fr; }
  .stat-block { grid-template-columns: 1fr 1fr; }
  .article-tool-cta { flex-direction: column; text-align: center; }
}

@media (max-width: 640px) {
  :root {
    --font-size-article: 16px;
    --line-height-article: 1.75;
  }
  .stat-block { grid-template-columns: 1fr; }
  .key-takeaways { padding: 20px; }
  .article-hero { padding: 44px 0 40px; }
}

/* ============================================
   Accessibility — reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .stagger-item,
  .stagger-item.revealed {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .btn,
  .tool-card,
  .article-card,
  .card {
    transition: none;
  }

  .reading-progress-bar {
    transition: none;
  }
}

/* ============================================
   Legal Pages
   ============================================ */
.legal-page {
  padding: 60px 0 80px;
  min-height: 70vh;
}

.legal-header {
  max-width: 800px;
  margin: 0 auto 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--gray-200);
}

.legal-eyebrow {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
}
.legal-eyebrow a {
  color: var(--primary);
  text-decoration: none;
}
.legal-eyebrow a:hover { text-decoration: underline; }

.legal-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.legal-meta {
  font-size: 14px;
  color: var(--gray-500);
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  max-width: 1000px;
  margin: 0 auto;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 88px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.legal-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.legal-toc-link {
  display: block;
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-200);
  transition: color 150ms ease;
  line-height: 1.4;
}
.legal-toc-link:last-child { border-bottom: none; }
.legal-toc-link:hover { color: var(--primary); }

.legal-body {
  min-width: 0;
}

.legal-body h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin: 36px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}
.legal-body h2:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }

.legal-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 20px 0 8px;
}

.legal-body p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--gray-700);
  margin-bottom: 14px;
}

.legal-body ul,
.legal-body ol {
  margin: 8px 0 16px 20px;
}
.legal-body li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.legal-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-intro {
  font-size: 16px;
  line-height: 1.8;
  color: var(--gray-700);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.legal-info-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
  margin: 16px 0;
}
.legal-info-box a { color: var(--primary); }

.legal-alert {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: #92400E;
  margin-bottom: 28px;
}

.legal-table-wrapper {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: var(--radius);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.legal-table th {
  background: var(--gray-100);
  font-weight: 700;
  color: var(--dark);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--gray-300);
}
.legal-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
  vertical-align: top;
}

.legal-nav-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}
.legal-nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.legal-nav-links a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }
  .legal-toc {
    position: static;
    display: none;
  }
  .legal-page { padding: 40px 0 60px; }
}

/* ============================================
   Income Item Cards (AI Side Hustles article)
   ============================================ */
.income-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-200);
}

.income-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  margin-top: 2px;
}

.income-body { flex: 1; min-width: 0; }

.income-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}

.income-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-700);
  margin-bottom: 10px;
}

.income-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.income-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.tag-earn {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.tag-start {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.tag-diff {
  background: #FFF7ED;
  color: #92400E;
  border: 1px solid #FED7AA;
}
