/* ───────────────────────────────────
   FlowMind — Light Editorial Design System
   Inspired by NerdWallet / Investopedia / HubSpot
─────────────────────────────────── */

:root {
  --bg:           #ffffff;
  --bg-secondary: #f6f8fb;
  --bg-tint:      #f0f5ff;
  --card:         #ffffff;
  --card-hover:   #f9fbfe;
  --text:         #0f1b2d;
  --text-soft:    #33425a;
  --muted:        #677488;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --brand:        #4f8ef7;
  --accent-dim:   #eaf1fe;
  --ok:           #15935f;
  --warn:         #b4690e;
  --border:       #e6eaf0;
  --border-soft:  #d6dde8;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --shadow-card:  0 1px 2px rgba(15,27,45,0.04), 0 1px 3px rgba(15,27,45,0.06);
  --shadow-hover: 0 6px 24px rgba(15,27,45,0.10);
  --shadow-accent: 0 0 0 3px rgba(37,99,235,0.15);
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 140ms;
  --t-base: 200ms;
}

/* ── Reset ──────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; text-size-adjust: 100%; }
html, body { height: 100%; }
img, video { max-width: 100%; display: block; }

/* ── Base ─────────────────────── */
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; color: var(--text); }
p { line-height: 1.7; }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
ul, ol { padding-left: 1.4rem; }
li { line-height: 1.65; }

/* ── Layout ───────────────────── */
.container { max-width: 1080px; margin: 0 auto; padding: 20px 28px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 20px 28px; }

/* ── Navigation ─────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
header .container { padding-top: 14px; padding-bottom: 14px; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.brand::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.brand:hover { color: var(--accent); text-decoration: none; }
.navlinks { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.navlinks a { padding: 6px 12px; border-radius: 7px; color: var(--text-soft); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.navlinks a:hover { color: var(--accent); background: var(--bg-tint); text-decoration: none; }

/* ── Hero ────────────────────── */
.hero { padding: 64px 0 44px; max-width: 720px; }
.hero h1 { font-size: clamp(34px, 5.5vw, 56px); line-height: 1.08; margin-bottom: 18px; color: var(--text); letter-spacing: -0.035em; }
.hero h1 .acc { color: var(--accent); }
.lead { font-size: 19px; color: var(--text-soft); max-width: 580px; line-height: 1.6; margin-bottom: 28px; }

/* ── Buttons ──────────────────── */
.ctaRow { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 22px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; border: none; transition: all var(--t-fast) var(--ease); white-space: nowrap; }
.btn:not(.secondary) { background: var(--accent); color: #ffffff; box-shadow: 0 1px 2px rgba(37,99,235,0.25); }
.btn:not(.secondary):hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,0.25); text-decoration: none; color: #ffffff; }
.btn.secondary { background: #ffffff; color: var(--text); box-shadow: inset 0 0 0 1px var(--border-soft); }
.btn.secondary:hover { background: var(--bg-secondary); box-shadow: inset 0 0 0 1px var(--muted); text-decoration: none; color: var(--text); }

/* ── Tool Cards ───────────────── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-card); transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease); }
.card:hover { border-color: var(--border-soft); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card h2 { font-size: 15.5px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin: 0; }
.card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; flex: 1; margin: 0; }
.card a { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); transition: gap var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.card a:hover { gap: 7px; text-decoration: none; color: var(--accent-hover); }

/* ── Utility ──────────────────── */
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Breadcrumb ───────────────── */
.breadcrumb { font-size: 13px; color: var(--muted); margin: 4px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb span.sep { color: var(--border-soft); }

/* ── Article meta (byline + date) ────── */
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); margin: 0 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-meta .by { font-weight: 600; color: var(--text-soft); }
.article-meta .dot { color: var(--border-soft); }

/* ── Key takeaways box ──────────── */
.takeaways { background: var(--bg-tint); border: 1px solid #d8e4fb; border-radius: var(--r); padding: 20px 22px; margin: 0 0 32px; }
.takeaways h2 { font-size: 13px !important; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent) !important; margin: 0 0 12px !important; padding: 0 !important; border: none !important; }
.takeaways ul { margin: 0 !important; padding-left: 1.2rem !important; }
.takeaways li { font-size: 14.5px; color: var(--text-soft); margin-bottom: 6px; }

/* ── Table of contents ──────────── */
.toc { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 22px; margin: 0 0 32px; }
.toc strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px; }
.toc ul { list-style: none; padding: 0 !important; margin: 0 !important; display: flex; flex-direction: column; gap: 7px !important; }
.toc li { font-size: 14px; }
.toc a { color: var(--text-soft); font-weight: 500; }
.toc a:hover { color: var(--accent); text-decoration: none; }

/* ── Homepage section ───────────── */
.section { margin: 44px 0; }
.section > h2 { font-size: 22px; margin-bottom: 18px; color: var(--text); letter-spacing: -0.02em; }
.section > p.muted { margin-top: 16px; }
.section > ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.section > ul > li { padding: 16px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 14.5px; color: var(--text-soft); line-height: 1.55; box-shadow: var(--shadow-card); }
.section > ul > li strong { color: var(--text); }

/* Blog index list links */
.section ul li a { display: block; padding: 13px 4px; font-size: 15px; font-weight: 500; color: var(--text-soft); border-bottom: 1px solid var(--border); transition: color var(--t-fast), padding-left var(--t-fast) var(--ease); }
.section ul li a:hover { color: var(--accent); padding-left: 6px; text-decoration: none; }
.section ul li:last-child a { border-bottom: none; }

/* ── Blog Article ──────────────── */
article:not(.card) { max-width: 720px; }
article:not(.card) h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.18; margin: 8px 0 18px; letter-spacing: -0.03em; }

/* Short answer callout */
article:not(.card) > p.muted { font-size: 16px; line-height: 1.7; color: var(--text-soft); background: var(--bg-tint); border: 1px solid #d8e4fb; border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 16px 20px; margin-bottom: 28px; }
article:not(.card) > p.muted strong { color: var(--accent); }

/* Formula / diagram images */
article:not(.card) img { width: 100%; max-width: 600px; height: auto; border-radius: var(--r); border: 1px solid var(--border); margin: 4px 0 32px; display: block; }

/* Section headings */
article:not(.card) h2 { font-size: 22px; font-weight: 700; margin: 40px 0 14px; padding-top: 36px; border-top: 1px solid var(--border); color: var(--text); letter-spacing: -0.02em; }
article:not(.card) h2:first-of-type { margin-top: 8px; padding-top: 0; border-top: none; }
article:not(.card) h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; color: var(--text); }

/* Body text */
article:not(.card) p { font-size: 16.5px; line-height: 1.8; color: var(--text-soft); margin-bottom: 18px; }

/* Lists */
article:not(.card) ul, article:not(.card) ol { padding-left: 1.4rem; margin-bottom: 20px; display: flex; flex-direction: column; gap: 9px; }
article:not(.card) li { font-size: 16.5px; line-height: 1.7; color: var(--text-soft); }
article:not(.card) li strong { color: var(--text); font-weight: 600; }
article:not(.card) li a { font-weight: 500; }

/* FAQ items */
article:not(.card) > p:not(.muted):has(> strong:first-child) { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 16px 18px; margin-bottom: 10px; font-size: 15.5px; line-height: 1.7; color: var(--text-soft); box-shadow: var(--shadow-card); }
article:not(.card) > p:not(.muted):has(> strong:first-child) strong { display: block; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; letter-spacing: -0.01em; }

/* Related guides */
article:not(.card) > ul:last-of-type { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 0; box-shadow: var(--shadow-card); }
article:not(.card) > ul:last-of-type li { border-bottom: 1px solid var(--border); font-size: 15px; }
article:not(.card) > ul:last-of-type li:last-child { border-bottom: none; }
article:not(.card) > ul:last-of-type li a { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; color: var(--text-soft); font-weight: 500; font-size: 15px; transition: background var(--t-fast), color var(--t-fast), padding-left var(--t-fast) var(--ease); text-decoration: none; }
article:not(.card) > ul:last-of-type li a::after { content: '→'; color: var(--muted); font-size: 13px; transition: color var(--t-fast), transform var(--t-fast) var(--ease); flex-shrink: 0; margin-left: 8px; }
article:not(.card) > ul:last-of-type li a:hover { background: var(--bg-tint); color: var(--accent); padding-left: 22px; text-decoration: none; }
article:not(.card) > ul:last-of-type li a:hover::after { color: var(--accent); transform: translateX(3px); }

/* ── Tool pages ───────────────── */
.label { display: block; margin: 18px 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.label:first-child { margin-top: 0; }
.input { width: 100%; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--border-soft); background: #ffffff; color: var(--text); font-family: var(--font); font-size: 15px; outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input:hover { border-color: var(--muted); }
.input:focus { border-color: var(--accent); box-shadow: var(--shadow-accent); }
.input::placeholder { color: var(--muted); opacity: 0.7; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { background: var(--bg-secondary); border: 1px solid var(--border); padding: 11px 14px; font-weight: 600; color: var(--text); text-align: left; letter-spacing: -0.01em; }
.table td { border: 1px solid var(--border); padding: 11px 14px; color: var(--text-soft); }
.table tr:hover td { background: var(--bg-secondary); }

/* ── Footer ──────────────────── */
.footer { border-top: 1px solid var(--border); margin-top: 64px; background: var(--bg-secondary); }
.footerGrid { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 28px 0; }
.footer strong { font-size: 14px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; }
.footerLinks a { margin-right: 14px; color: var(--muted); font-size: 13px; font-weight: 500; transition: color var(--t-fast); }
.footerLinks a:hover { color: var(--accent); text-decoration: none; }

/* ── Accessibility ─────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ── Responsive ───────────────── */
@media (max-width: 860px) { .grid { grid-template-columns: 1fr 1fr; } .row { grid-template-columns: 1fr; } .hero { padding: 44px 0 32px; } .lead { font-size: 17px; } }
@media (max-width: 600px) { .container, .container-narrow { padding: 16px 20px; } .grid { grid-template-columns: 1fr; } .navlinks a { padding: 4px 8px; font-size: 13px; } .hero { padding: 32px 0 24px; } .hero h1 { font-size: 30px; } .lead { font-size: 16px; } article:not(.card) h1 { font-size: 26px; } article:not(.card) h2 { font-size: 19px; } article:not(.card) p, article:not(.card) li { font-size: 16px; } }
@media (max-width: 400px) { .navlinks a { font-size: 12px; padding: 3px 6px; } .brand { font-size: 14px; } }
