/* Money, Drawn Out: cream paper, ink, coral, teal, yellow */
:root {
  --paper: #FBF6EC;
  --paper-2: #F4ECDC;
  --card: #FFFDF8;
  --ink: #2B2A28;
  --ink-2: #5A5650;
  --line: #E4D9C4;
  --coral: #E3674B;
  --coral-dark: #C24F35;
  --teal: #2A9D8F;
  --teal-dark: #1F7A6F;
  --yellow: #FFD166;
  --radius: 14px;
  --sketch: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --shadow: 3px 4px 0 var(--ink);
  --hand: "Caveat", "Comic Sans MS", cursive;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.7 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--coral-dark); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.01em; }
.hl, mark {
  background: linear-gradient(transparent 55%, var(--yellow) 55%, var(--yellow) 92%, transparent 92%);
  color: inherit; padding: 0 .1em;
}
.kicker { font-weight: 700; color: var(--coral-dark); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; margin: 0 0 .6rem; }
.kicker a { color: inherit; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 46em; }

/* Buttons */
.btn {
  display: inline-block; font-weight: 800; text-decoration: none; padding: .7em 1.3em;
  border: 2px solid var(--ink); border-radius: var(--sketch); box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s; line-height: 1.2; margin: 4px 6px 4px 0;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { color: #fff; }
.btn-ghost { background: var(--card); color: var(--ink); }
.btn-ghost:hover { color: var(--ink); }
.btn-small { font-size: .85rem; padding: .5em 1em; box-shadow: 2px 3px 0 var(--ink); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 246, 236, .95); backdrop-filter: blur(6px); border-bottom: 2px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand img { width: 160px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.site-nav ul a { color: var(--ink); text-decoration: none; font-weight: 700; }
.site-nav ul a:hover, .site-nav ul a[aria-current] { color: var(--coral-dark); }
.nav-toggle { display: none; font: 800 .9rem var(--sans); background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: 8px 14px; color: var(--ink); }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--paper); border-bottom: 2px solid var(--line); flex-direction: column; align-items: flex-start; padding: 12px 16px 20px; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 10px; }
}

/* Breadcrumbs */
.breadcrumbs { font-size: .85rem; color: var(--ink-2); margin: 20px 0 18px; }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs .sep { margin: 0 6px; opacity: .6; }

/* Sections */
.section { padding: 28px 16px 36px; }
.section-title { font-family: var(--hand); font-weight: 700; font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: .2em; }
.section-intro { color: var(--ink-2); margin-top: 0; }

/* Hero */
.hero { border-bottom: 2px solid var(--line); background: radial-gradient(circle at 85% 20%, rgba(255, 209, 102, .35), transparent 40%), var(--paper); }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.6rem); }
.hero-latest { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 6px 7px 0 var(--ink); overflow: hidden; transform: rotate(1.2deg); }
.hero-latest:hover { color: var(--ink); transform: rotate(0deg); }
.hero-latest-label { display: block; padding: 12px 16px 0; font-family: var(--hand); font-size: 1.4rem; color: var(--coral-dark); }
.hero-latest-title { display: block; padding: 0 16px 16px; font-weight: 800; }
@media (max-width: 880px) { .hero-inner { grid-template-columns: 1fr; padding-top: 32px; gap: 28px; } .hero-latest { transform: none; } }

/* Course path */
.path { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.path a { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 16px 10px 10px; }
.path a:hover { border-color: var(--ink); color: var(--ink); }
.path-num { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-family: var(--hand); font-size: 1.6rem; font-weight: 700; background: var(--teal); color: #fff; }
.path .soon .path-num { background: var(--paper-2); color: var(--ink-2); border: 2px dashed var(--ink-2); }
.path-title { font-weight: 700; line-height: 1.35; }
.path-status { font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 640px) { .path a { grid-template-columns: 44px 1fr; } .path-status { grid-column: 2; white-space: normal; } }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; margin-top: 18px; }
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s; }
.card:hover { transform: translateY(-3px) rotate(-.4deg); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); }
.card-link:hover { color: var(--ink); }
.card-thumb { aspect-ratio: 16 / 9; background: var(--paper-2); border-bottom: 2px solid var(--ink); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-kicker { margin: 0 0 4px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--coral-dark); }
.card-title { font-size: 1.12rem; margin: 0 0 6px; }
.card-text { font-size: .93rem; color: var(--ink-2); margin: 0 0 12px; line-height: 1.55; }
.card-meta { margin: auto 0 0; display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--ink-2); align-items: center; }
.badge { font-weight: 800; padding: 2px 9px; border-radius: 999px; font-size: .75rem; }
.badge-live { background: var(--teal); color: #fff; }
.badge-soon { background: var(--yellow); color: var(--ink); }

/* Topics */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.topic-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: var(--sketch); box-shadow: var(--shadow); }
.topic-card:hover { color: var(--ink); background: #fff; }
.topic-name { font-family: var(--hand); font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--teal-dark); }
.topic-desc { font-size: .93rem; color: var(--ink-2); line-height: 1.5; }
.topic-count { font-size: .8rem; font-weight: 800; color: var(--coral-dark); margin-top: auto; }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 14px; }
.why-grid > div { background: var(--card); border: 2px dashed var(--ink-2); border-radius: var(--radius); padding: 18px 20px; }
.why-grid p { margin: 0; color: var(--ink-2); }
.why-grid .why-title { font-family: var(--hand); font-size: 1.7rem; color: var(--ink); font-weight: 700; margin-bottom: 4px; }
@media (max-width: 820px) { .why-grid { grid-template-columns: 1fr; } }

/* Lesson layout */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.lesson { min-width: 0; width: 100%; max-width: 760px; }
.lesson-aside .sticky { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 24px; padding-top: 72px; }
.toc-mobile { display: none; }
@media (max-width: 1060px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .lesson { margin: 0 auto; }
  .lesson-aside { display: none; }
  .toc-mobile { display: block; }
}
.lesson-header h1 { margin-bottom: .35em; }
.dateline { font-size: .85rem; color: var(--ink-2); margin: 0 0 22px; }

.video { position: relative; aspect-ratio: 16 / 9; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 5px 6px 0 var(--ink); overflow: hidden; background: #000; }
.video img, .video iframe { width: 100%; height: 100%; object-fit: cover; border: 0; }
.video-play { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; position: relative; }
.video-play:focus-visible { outline: 3px solid var(--yellow); outline-offset: -6px; }
.play-icon { position: absolute; left: 50%; top: 50%; width: 84px; height: 60px; transform: translate(-50%, -50%); background: var(--coral); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 3px 4px 0 var(--ink); transition: transform .15s; }
.play-icon::after { content: ""; position: absolute; left: 33px; top: 15px; border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent #fff; }
.video-play:hover .play-icon { transform: translate(-50%, -50%) scale(1.08); }
.video-caption { font-size: .85rem; color: var(--ink-2); margin: 12px 0 0; }
.video-soon img { filter: saturate(.75) brightness(.55); }
.soon-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 16px 24px; color: #fff; }
.soon-overlay p { margin: 0 0 10px; max-width: 30em; font-size: .95rem; }
.soon-overlay .soon-title { font-family: var(--hand); font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; line-height: 1.1; }
@media (max-width: 520px) { .soon-overlay p:not(.soon-title) { display: none; } }

.takeaways { margin: 28px 0; background: #FFF5D6; border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 22px 8px; box-shadow: var(--shadow); }
.takeaways-title { font-family: var(--hand); font-size: 1.7rem; font-weight: 700; margin: 0 0 4px; }
.takeaways ul { margin: 0; padding-left: 1.2em; }
.takeaways li { margin-bottom: 8px; }

.toc { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: .9rem; }
.toc-title { font-weight: 800; margin: 0 0 6px; text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; color: var(--ink-2); }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 4px 0; line-height: 1.4; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--coral-dark); text-decoration: underline; }
.toc-mobile .toc { margin: 0 0 28px; }

/* Prose */
.prose { font-size: 1.08rem; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-top: 2.2em; padding-top: .2em; }
.prose h2::after { content: ""; display: block; width: 72px; height: 6px; margin-top: 10px; background: var(--coral); border-radius: 6px 2px 8px 3px; transform: rotate(-1deg); }
.prose h3 { font-size: 1.22rem; margin-top: 1.8em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose strong { font-weight: 800; }
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--teal); color: #fff; font-weight: 800; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: var(--paper); }
@media (max-width: 600px) {
  .prose table { font-size: .85rem; }
  .prose th, .prose td { padding: 8px 10px; }
  .prose th { white-space: normal; }
}
.callout { margin: 1.6em 0; padding: 16px 20px; background: #E3F3F0; border-left: 6px solid var(--teal); border-radius: 0 var(--radius) var(--radius) 0; }
.callout p { margin: 0 0 .6em; }
.callout p:last-child { margin: 0; }
.prose code { background: var(--paper-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.sources { font-size: .9rem; color: var(--ink-2); }

.note-box { margin: 36px 0 28px; padding: 14px 18px; border: 2px dashed var(--ink-2); border-radius: var(--radius); font-size: .9rem; color: var(--ink-2); }
.note-box p { margin: 0; }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
.prevnext a { display: block; padding: 14px 18px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.35; box-shadow: var(--shadow); }
.prevnext a span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--coral-dark); margin-bottom: 4px; }
.prevnext .next { text-align: right; }
@media (max-width: 600px) { .prevnext { grid-template-columns: 1fr; } .prevnext .next { text-align: left; } }

.subscribe-box { background: var(--teal); color: #fff; border: 2px solid var(--ink); border-radius: var(--sketch); box-shadow: 5px 6px 0 var(--ink); padding: 26px 26px 20px; margin: 36px 0; }
.subscribe-box p { margin: 0 0 12px; }
.subscribe-title { font-family: var(--hand); font-size: 2.1rem; font-weight: 700; line-height: 1.05; }
.related { margin: 40px 0 20px; }

/* Ads: reserve space so pages don't jump when ads load */
.ad { margin: 32px auto; min-height: 280px; text-align: center; position: relative; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.ad-sidebar { min-height: 600px; width: 300px; margin: 0; }
.grid-ad { grid-column: 1 / -1; margin: 0; min-height: 250px; }
.ad-preview { border: 2px dashed var(--coral); border-radius: var(--radius); background: repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(227, 103, 75, .06) 12px, rgba(227, 103, 75, .06) 24px); display: grid; place-items: center; }
.ad-preview .ad-label { font-weight: 800; color: var(--coral-dark); }

/* Footer */
.site-footer { margin-top: 48px; border-top: 2px solid var(--line); background: var(--paper-2); padding: 36px 0 20px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 4px 0; }
.footer-grid a { color: var(--ink); }
.footer-brand { font-family: var(--hand); font-size: 2rem; font-weight: 700; margin: 0; }
.footer-title { font-weight: 800; text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; color: var(--ink-2); }
.footer-legal { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--ink-2); font-size: .8rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 16px; } }
