/* ================================
   Un-Tax Blog — shared stylesheet
   Matches app.html dark brand
   ================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0c;
  --surface: #18181e;
  --surface-2: #1e1e26;
  --border: #2a2a35;
  --border-light: #3a3a48;
  --accent: #3d5afe;
  --accent-dim: #2a3fc7;
  --green: #00e676;
  --green-dim: rgba(0, 230, 118, 0.12);
  --amber: #ffc107;
  --amber-dim: rgba(255, 193, 7, 0.12);
  --red: #ff5252;
  --red-dim: rgba(255, 82, 82, 0.12);
  --text: #e8e8ed;
  --text-body: #c8c8d0;
  --text-dim: #8888a0;
  --text-muted: #55556a;
  --heading: 'DM Serif Display', Georgia, serif;
  --body: 'Instrument Sans', -apple-system, system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* --- HEADER --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header a { text-decoration: none; color: inherit; }
.logo {
  font-family: var(--heading); font-size: 1.5rem; letter-spacing: -0.01em;
  user-select: none;
}
.logo-un { color: #fff; }
.logo-tax { color: var(--accent); }
.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a {
  color: var(--text-dim); font-size: 0.95rem; font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--text); }
.site-nav a.primary {
  background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 8px;
  transition: background 0.15s;
}
.site-nav a.primary:hover { background: var(--accent-dim); color: #fff; }

/* --- BLOG INDEX --- */
.blog-hero {
  max-width: 1100px; margin: 0 auto;
  padding: 80px 32px 48px;
  text-align: center;
}
.blog-hero h1 {
  font-family: var(--heading); font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.blog-hero h1 .accent { color: var(--accent); }
.blog-hero p {
  font-size: 1.125rem; color: var(--text-dim);
  max-width: 600px; margin: 0 auto;
}

.pillar-nav {
  max-width: 1100px; margin: 0 auto 48px;
  padding: 0 32px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.pillar-nav a {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-body); font-size: 0.9rem; font-weight: 500;
  padding: 8px 16px; border-radius: 20px;
  text-decoration: none; transition: all 0.15s;
}
.pillar-nav a:hover { border-color: var(--accent); color: var(--text); }

.pillar-section {
  max-width: 1100px; margin: 0 auto;
  padding: 48px 32px;
  scroll-margin-top: 80px;
}
.pillar-section h2 {
  font-family: var(--heading); font-size: 2rem; letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.pillar-section .pillar-meta {
  color: var(--text-dim); font-size: 0.95rem;
  margin-bottom: 32px;
}

.article-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.article-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  text-decoration: none; color: inherit;
  transition: all 0.2s;
  display: flex; flex-direction: column;
  min-height: 180px;
}
.article-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(61,90,254,0.08);
}
.article-card .card-tag {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 12px;
}
.article-card h3 {
  font-family: var(--heading); font-size: 1.25rem;
  line-height: 1.25; letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.article-card p {
  color: var(--text-dim); font-size: 0.95rem;
  flex-grow: 1;
}
.article-card .read-more {
  color: var(--accent); font-size: 0.9rem; font-weight: 500;
  margin-top: 16px;
}
.article-card.flagship {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(61,90,254,0.08) 100%);
  border-color: var(--accent-dim);
}
@media (max-width: 760px) {
  .article-card.flagship { grid-column: span 1; }
}
.article-card.flagship h3 { font-size: 1.5rem; }

/* --- ARTICLE PAGE --- */
.article-page {
  max-width: 720px; margin: 0 auto;
  padding: 64px 32px 48px;
}
.article-breadcrumb {
  font-size: 0.875rem; color: var(--text-dim);
  margin-bottom: 24px;
}
.article-breadcrumb a {
  color: var(--text-dim); text-decoration: none;
  transition: color 0.15s;
}
.article-breadcrumb a:hover { color: var(--accent); }
.article-breadcrumb .sep { margin: 0 8px; color: var(--text-muted); }

.article-header { margin-bottom: 40px; }
.article-header .pillar-tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 16px;
}
.article-header h1 {
  font-family: var(--heading); font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.article-header .lede {
  font-size: 1.2rem; color: var(--text-body);
  line-height: 1.5;
}
.article-meta {
  font-size: 0.875rem; color: var(--text-dim);
  margin-top: 24px;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; gap: 16px; flex-wrap: wrap;
}

/* Article body typography */
.article-body {
  font-size: 1.0625rem; line-height: 1.75;
  color: var(--text-body);
}
.article-body > * + * { margin-top: 1.25em; }
.article-body h2 {
  font-family: var(--heading); color: var(--text);
  font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em;
  margin-top: 2.5em; margin-bottom: 0.5em;
}
.article-body h3 {
  font-family: var(--heading); color: var(--text);
  font-size: 1.35rem; line-height: 1.25;
  margin-top: 2em; margin-bottom: 0.4em;
}
.article-body p { margin-bottom: 0; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { color: var(--text); font-style: italic; }
.article-body a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; transition: color 0.15s;
}
.article-body a:hover { color: var(--text); }
.article-body ul, .article-body ol {
  padding-left: 1.5em;
}
.article-body li { margin-bottom: 0.5em; }
.article-body li::marker { color: var(--text-muted); }
.article-body hr {
  border: 0; height: 1px;
  background: var(--border);
  margin: 3em 0;
}

/* Tables */
.article-body table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  font-size: 0.95rem;
}
.article-body th {
  background: var(--surface-2);
  color: var(--text); font-weight: 600;
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
}
.article-body tr:last-child td { border-bottom: 0; }

/* Callouts */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 1.5em 0 !important;
}
.callout .callout-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 8px;
}
.callout.warning { border-left-color: var(--amber); }
.callout.warning .callout-label { color: var(--amber); }
.callout.danger { border-left-color: var(--red); }
.callout.danger .callout-label { color: var(--red); }
.callout.win { border-left-color: var(--green); background: linear-gradient(135deg, var(--surface), var(--green-dim)); }
.callout.win .callout-label { color: var(--green); }

/* Big number pullquote */
.big-number {
  font-family: var(--heading);
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1;
  color: var(--green);
  text-align: center;
  margin: 1.5em 0 !important;
  letter-spacing: -0.02em;
}
.big-number .label {
  display: block;
  font-family: var(--body);
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* Code-style form references */
.form-ref {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 4px;
  font-size: 0.92em; color: var(--text);
}

/* CTA blocks */
.cta-block {
  margin: 3em 0 !important;
  padding: 32px;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(61,90,254,0.1) 100%);
  border: 1px solid var(--accent-dim); border-radius: 12px;
  text-align: center;
}
.cta-block h3 {
  font-family: var(--heading); color: var(--text);
  font-size: 1.5rem; margin-bottom: 12px !important;
}
.cta-block p {
  color: var(--text-dim); margin-bottom: 20px;
}
.cta-button {
  display: inline-block;
  background: var(--accent); color: #fff !important;
  padding: 12px 28px; border-radius: 10px;
  text-decoration: none !important; font-weight: 600;
  transition: all 0.2s;
}
.cta-button:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(61,90,254,0.3);
}
.cta-button.secondary {
  background: transparent; border: 1px solid var(--border-light);
  color: var(--text) !important;
}
.cta-button.secondary:hover { border-color: var(--accent); background: rgba(61,90,254,0.05); }

/* Waitlist form (inline) */
.waitlist-form {
  display: flex; gap: 8px; max-width: 420px; margin: 0 auto;
  flex-wrap: wrap; justify-content: center;
}
.waitlist-form input[type="email"] {
  flex: 1 1 240px; min-width: 0;
  background: var(--bg); border: 1px solid var(--border-light);
  color: var(--text); padding: 12px 16px;
  border-radius: 10px; font-size: 1rem; font-family: var(--body);
  transition: border-color 0.15s;
}
.waitlist-form input[type="email"]:focus {
  outline: none; border-color: var(--accent);
}
.waitlist-form input[type="email"]::placeholder { color: var(--text-muted); }

/* Related articles */
.related-articles {
  margin-top: 64px; padding-top: 40px;
  border-top: 1px solid var(--border);
}
.related-articles h3 {
  font-family: var(--heading); font-size: 1.5rem;
  margin-bottom: 24px !important; color: var(--text);
}
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.related-grid a {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px;
  text-decoration: none !important; color: inherit !important;
  transition: all 0.15s;
}
.related-grid a:hover { border-color: var(--accent); }
.related-grid a .related-tag {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 8px; display: block;
}
.related-grid a strong {
  font-family: var(--heading); font-weight: normal;
  color: var(--text); font-size: 1.05rem;
  line-height: 1.3;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 32px 32px;
  margin-top: 80px;
  text-align: center;
  color: var(--text-dim); font-size: 0.9rem;
}
.site-footer .footer-links {
  display: flex; gap: 24px; justify-content: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.site-footer a {
  color: var(--text-dim); text-decoration: none;
  transition: color 0.15s;
}
.site-footer a:hover { color: var(--text); }
.site-footer .disclaimer {
  max-width: 560px; margin: 16px auto 0;
  font-size: 0.8rem; color: var(--text-muted); line-height: 1.5;
}

/* Mobile tuning */
@media (max-width: 560px) {
  .site-header { padding: 12px 20px; }
  .site-nav { gap: 16px; }
  .site-nav a:not(.primary) { display: none; }
  .article-page { padding: 48px 20px 40px; }
  .article-body { font-size: 1rem; }
  .article-body h2 { font-size: 1.5rem; }
  .article-body table { font-size: 0.875rem; }
  .article-body th, .article-body td { padding: 10px 12px; }
  .pillar-section { padding: 32px 20px; }
  .blog-hero { padding: 48px 20px 32px; }
}
