@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --ink: #0e1117;
  --paper: #f3f5f7;
  --card: #ffffff;
  --green: #1a6641;
  --green-light: #e8f4ed;
  --gold: #c8962a;
  --gold-light: #fdf6e3;
  --rule: #d5dade;
  --muted: #64707a;
  --caution: #9a6a1f;
  --caution-light: #f7f0e3;
  --blue: #1a4a6e;
  --blue-light: #e8f0f7;
  --purple: #4a2a6e;
  --purple-light: #f0ebf7;
  --teal: #1a5f6e;
  --teal-light: #e8f4f6;
  --orange: #8b4513;
  --orange-light: #fdf0e8;
  --red: #c0392b;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

/* NAV */
nav {
  background: var(--ink);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  color: #fff;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-logo span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover { color: #fff; }
.nav-links a.active { color: var(--gold); }

/* DISCLAIMER */
.disclaimer {
  background: var(--gold-light);
  border-left: 4px solid var(--gold);
  padding: 12px 24px;
  font-size: 0.8rem;
  color: #7a5c1a;
  text-align: center;
}

/* BREADCRUMB */
.breadcrumb {
  padding: 12px 24px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}

.breadcrumb a {
  color: var(--green);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

/* MAIN */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* AD UNIT */
.ad-unit {
  background: var(--card);
  border: 1px dashed var(--rule);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin: 32px 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: 'DM Mono', monospace;
}

/* SECTION HEADER */
.section-header {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--rule);
}

.section-icon { font-size: 2.4rem; line-height: 1; }

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.section-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.section-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: auto;
  padding-bottom: 6px;
}

/* CARDS GRID */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* CARD */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 500;
}

.card-difficulty {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

.card h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  line-height: 1.25;
}

.card-what {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  font-family: 'DM Mono', monospace;
}

.card p {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-best {
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 600;
}

.card-best strong { color: var(--muted); font-weight: 500; }

.card-arrow {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
  display: block;
}

/* SYSTEM PAGE */
.system-hero {
  background: var(--ink);
  color: #fff;
  padding: 48px 24px 40px;
  border-bottom: 3px solid var(--gold);
}

.system-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.system-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.system-hero p {
  font-size: 1rem;
  color: #b0aea8;
  max-width: 600px;
  font-weight: 300;
}

.system-meta {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.system-meta-item {
  font-size: 0.78rem;
  color: #888;
  font-family: 'DM Mono', monospace;
}

.system-meta-item strong { color: var(--gold); }

/* SYSTEM CONTENT */
.system-content {
  max-width: 720px;
  margin: 40px auto 80px;
  padding: 0 24px;
}

.system-section {
  margin-bottom: 40px;
}

.system-section-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.steps { display: flex; flex-direction: column; gap: 16px; }

.step { display: flex; gap: 16px; align-items: flex-start; }

.step-num {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.7;
  padding-top: 4px;
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pro-con-box {
  background: var(--paper);
  border-radius: 8px;
  padding: 16px;
}

.pro-con-title {
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  font-weight: 500;
}

.pro-con-title.pros { color: var(--green); }
.pro-con-title.cons { color: var(--caution); }

.pro-con-box ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.pro-con-box li {
  font-size: 0.85rem;
  color: #444;
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}

.pro-con-box li::before { position: absolute; left: 0; top: 0; }
.pro-con-box.pros li::before { content: '✓'; color: var(--green); }
.pro-con-box.cons li::before { content: '·'; color: var(--caution); font-weight: 700; font-size: 1.1rem; }

/* RELATED */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.related-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow 0.15s;
  font-size: 0.88rem;
}

.related-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.related-card strong { display: block; margin-bottom: 4px; font-size: 0.92rem; }
.related-card span { color: var(--muted); font-size: 0.8rem; }

/* CATEGORY PAGE HERO */
.cat-hero {
  padding: 48px 24px 40px;
  border-bottom: 3px solid;
}

/* FOOTER */
footer {
  background: var(--ink);
  color: #666;
  text-align: center;
  padding: 32px 24px;
  font-size: 0.78rem;
  line-height: 1.8;
}

footer strong { color: #999; }

footer a { color: #888; text-decoration: none; }
footer a:hover { color: #aaa; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* COLOR THEMES */
.debt .card::before, .debt.cat-hero { background: var(--green); border-color: var(--green); }
.debt .card-tag { background: var(--green-light); color: var(--green); }
.debt .step-num { background: var(--green); }

.budget .card::before { background: var(--blue); }
.budget .card-tag { background: var(--blue-light); color: var(--blue); }
.budget .step-num { background: var(--blue); }

.mortgage .card::before { background: var(--orange); }
.mortgage .card-tag { background: var(--orange-light); color: var(--orange); }
.mortgage .step-num { background: var(--orange); }

.savings .card::before { background: var(--teal); }
.savings .card-tag { background: var(--teal-light); color: var(--teal); }
.savings .step-num { background: var(--teal); }

.investing .card::before { background: var(--purple); }
.investing .card-tag { background: var(--purple-light); color: var(--purple); }
.investing .step-num { background: var(--purple); }

.credit .card::before { background: var(--gold); }
.credit .card-tag { background: var(--gold-light); color: var(--gold); }
.credit .step-num { background: var(--gold); color: var(--ink); }

.habits .card::before { background: var(--red); }
.habits .card-tag { background: #fdf0f0; color: var(--red); }
.habits .step-num { background: var(--red); }

@media (max-width: 600px) {
  .nav-links a { font-size: 0.72rem; padding: 6px 7px; }
  .pros-cons { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .system-hero h1 { font-size: 1.6rem; }
}
