:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5c6370;
  --border: #e6e2da;
  --accent: #0f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e5f2ec;
  --cat-personal-finance: #0f6b4f;
  --cat-investing: #2b5bb8;
  --cat-credit: #b4532a;
  --cat-economy: #6b4fb0;
  --cat-taxes: #a3361f;
  --cat-real-estate: #8a6a12;
  --cat-crypto: #0e7490;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #ecebe7;
    --muted: #a0a6b1;
    --border: #2b2f37;
    --accent: #3fbf8f;
    --accent-ink: #0b1f17;
    --accent-soft: #16302a;
    --cat-personal-finance: #3fbf8f;
    --cat-investing: #6f9cf0;
    --cat-credit: #e48a5e;
    --cat-economy: #a68ce6;
    --cat-taxes: #ef7d6a;
    --cat-real-estate: #d9b44a;
    --cat-crypto: #4cc3dd;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--accent); }
img { max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small-text { font-size: 14px; }

/* Header */
#site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo.small { font-size: 20px; }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--text); }
.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* Hero / page intro */
.intro { padding: 48px 0 24px; }
.intro h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.intro p { color: var(--muted); font-size: 19px; max-width: 640px; margin: 0; }

.section-title {
  font-family: var(--serif);
  font-size: 24px;
  margin: 48px 0 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--text);
}

/* Cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  --cat: var(--accent);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
.card[data-cat="personal-finance"] { --cat: var(--cat-personal-finance); }
.card[data-cat="investing"] { --cat: var(--cat-investing); }
.card[data-cat="credit"] { --cat: var(--cat-credit); }
.card[data-cat="economy"] { --cat: var(--cat-economy); }
.card[data-cat="taxes"] { --cat: var(--cat-taxes); }
.card[data-cat="real-estate"] { --cat: var(--cat-real-estate); }
.card[data-cat="crypto"] { --cat: var(--cat-crypto); }
.card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card-band { height: 6px; background: var(--cat); }
.card-body { padding: 20px; }
.card h3 { font-family: var(--serif); font-size: 21px; line-height: 1.25; margin: 8px 0; }
.card p { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.card .tag { color: var(--cat); }

.card-large { display: grid; }
.card-large .card-band { height: 10px; }
.card-large .card-body { padding: 32px; }
.card-large h3 { font-size: clamp(26px, 4vw, 36px); }
.card-large p { font-size: 18px; max-width: 680px; }

.tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
}
.meta { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

/* See-all button + archive filters */
.see-all { text-align: center; margin-top: 32px; }
.see-all-btn {
  display: inline-block; padding: 14px 28px; border-radius: 999px;
  border: 2px solid var(--accent); color: var(--accent);
  font-weight: 700; text-decoration: none;
}
.see-all-btn:hover { background: var(--accent); color: var(--accent-ink); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 28px; }
.filter-chip {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.filter-chip span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.filter-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter-chip[aria-pressed="true"] span { color: inherit; opacity: 0.8; }

/* Video feature */
.video-feature {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 32px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.video-frame video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  background: #000;
}
.video-copy h2 { font-family: var(--serif); font-size: clamp(28px, 4vw, 38px); line-height: 1.15; margin: 8px 0 12px; }
.video-copy p { color: var(--muted); margin: 0 0 16px; max-width: 520px; }
.video-link { font-weight: 600; text-decoration: none; }
.video-link:hover { text-decoration: underline; }
.video-copy .video-note { font-size: 13px; margin: 20px 0 0; }
.video-frame iframe, .yt-facade {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 0;
  border-radius: 14px;
  background: #000;
}
.yt-facade { position: relative; padding: 0; cursor: pointer; overflow: hidden; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #ff0000; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}
.yt-play .yt-icon { width: 84px; height: 84px; }
.yt-play .yt-icon path { fill: #ff0000; }
.yt-facade:hover .yt-play .yt-icon { transform: scale(1.08); transition: transform 0.15s ease; }

/* YouTube links */
.yt-icon { width: 20px; height: 20px; flex: none; }
.yt-button {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 10px 16px;
  border-radius: 8px; background: #ff0000; color: #ffffff;
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.yt-button:hover { background: #d90000; }
.nav .nav-yt { display: inline-flex; align-items: center; gap: 6px; }
.nav .nav-yt .yt-icon { color: #ff0000; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-top .yt-button { margin-top: 0; }

/* Newsletter */
.newsletter {
  background: var(--accent-soft);
  border-radius: var(--radius);
  margin: 56px 0;
  padding: 40px 24px;
  text-align: center;
}
.newsletter h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; }
.newsletter p { color: var(--muted); margin: 0 auto 20px; max-width: 520px; }
.signup { display: flex; gap: 8px; max-width: 460px; margin: 0 auto; }
.signup input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.signup button {
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.form-msg { margin-top: 12px !important; font-size: 14px; }
.newsletter .form-note { margin: 12px auto 0; font-size: 13px; }
.newsletter .form-note a { color: var(--muted); }

/* Article */
.article { max-width: 720px; margin: 0 auto; padding: 48px 0 0; }
.article-header { margin-bottom: 32px; }
.article-header h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 12px 0;
}
.article-header .dek { font-size: 20px; color: var(--muted); margin: 0 0 16px; }
#article-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.byline { font-size: 14px; color: var(--muted); margin-top: 8px; }
.article-body { font-family: var(--serif); font-size: 20px; line-height: 1.7; }
.article-body h2 { font-family: var(--sans); font-size: 24px; margin: 40px 0 12px; letter-spacing: -0.01em; }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 16px 20px;
  margin: 28px 0;
  font-family: var(--sans);
  font-size: 17px;
  border-radius: 0 8px 8px 0;
}
.article-disclaimer {
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 40px;
}

/* Footer */
#site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 64px; }
.footer-inner { padding: 40px 16px; display: grid; gap: 16px; }
.footer-inner p { margin: 0; }
.disclaimer { font-size: 13px; color: var(--muted); max-width: 760px; }

/* Responsive */
@media (max-width: 1040px) {
  .menu-btn { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 16px; border-top: 1px solid var(--border); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .logo { font-size: 22px; white-space: nowrap; }
  .video-feature { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
  .video-frame { max-width: 300px; margin: 0 auto; width: 100%; }
  .card-large .card-body { padding: 24px; }
  .signup { flex-direction: column; }
  .article-body { font-size: 18px; }
}
