/* ==========================================================================
   Stock Market Paglu — design tokens
   Palette is taken from the logo: forest ink, candle green, horn cream.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f3f5ec;
  --surface: #ffffff;
  --surface-2: #e8ecdd;
  --ink: #14211b;
  --muted: #55625a;
  --line: #d5dbc9;
  --accent: #52701a;      /* links and small text in green */
  --candle: #7f9f2c;      /* logo green, for fills */
  --down: #b5462f;        /* red candle, used only in charts */
  --horn: #efe6cd;        /* logo cream */
  --forest: #14211b;
  --on-forest: #eef2e5;
  --forest-muted: #aab8a6;
  --forest-candle: #9cc23f;
  --forest-down: #e0795f;
  --bar-muted: #c3cbb3;
  --shadow: 0 1px 0 rgba(20, 33, 27, .06), 0 12px 32px -18px rgba(20, 33, 27, .35);

  --font-ui: 'Gabarito', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-read: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --wrap: 1180px;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1612;
  --surface: #15201a;
  --surface-2: #1d2a22;
  --ink: #e8eee0;
  --muted: #a2afa5;
  --line: #2a382f;
  --accent: #a9c85c;
  --candle: #8fb339;
  --down: #e07a62;
  --horn: #262b1d;
  --forest: #0a120e;
  --bar-muted: #3d4c41;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 36px -20px rgba(0, 0, 0, .8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1612;
    --surface: #15201a;
    --surface-2: #1d2a22;
    --ink: #e8eee0;
    --muted: #a2afa5;
    --line: #2a382f;
    --accent: #a9c85c;
    --candle: #8fb339;
    --down: #e07a62;
    --horn: #262b1d;
    --forest: #0a120e;
    --bar-muted: #3d4c41;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 36px -20px rgba(0, 0, 0, .8);
  }
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-ui); line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 32px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:focus { top: 12px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-ghost { background: transparent; color: var(--ink); }
.button-ghost:hover { background: var(--surface); }
.button-small { min-height: 40px; padding: 0 16px; font-size: 15px; }

.section-heading { font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -.02em; }

.topic-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.5;
}
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 14px; }

/* Candle art (thumbnails and banners) */
.candle-art line { stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.candle-art .up line { stroke: var(--candle); }
.candle-art .up rect { fill: var(--candle); }
.candle-art .down line { stroke: var(--down); }
.candle-art .down rect { fill: var(--down); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 32px; height: 76px; }
.brand { display: block; margin-right: auto; border-radius: 10px; flex-shrink: 0; }
.brand-logo { height: 46px; width: auto; }
.main-nav { display: flex; gap: 6px; }
.main-nav a { text-decoration: none; font-weight: 500; font-size: 16px; padding: 8px 12px; border-radius: 999px; color: var(--muted); }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

/* The logo is dark ink on transparent, so in dark mode it sits on a light plate. */
:root[data-theme="dark"] .brand, :root[data-theme="dark"] .logo-plate { background: #f3f5ec; padding: 6px 12px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand, :root:not([data-theme="light"]) .logo-plate { background: #f3f5ec; padding: 6px 12px; }
}

/* ==========================================================================
   Home: hero + beginner path
   ========================================================================== */

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 80px;
}
.hero-solo { grid-template-columns: 1fr; padding-bottom: 64px; }
.hero-solo h1 { max-width: 20ch; }
.hero-solo .hero-lede { max-width: 40em; }
.hero h1 { font-size: clamp(40px, 4.8vw, 62px); font-weight: 800; letter-spacing: -.03em; line-height: 1.03; max-width: 15ch; }
.hero-lede { margin-top: 24px; font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.path-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 28px 20px; box-shadow: var(--shadow); scroll-margin-top: 100px;
}
.path-head h2 { font-size: 22px; font-weight: 700; }
.path-head p { color: var(--muted); margin-top: 4px; font-size: 16px; }

.path {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--steps, 5), 1fr); gap: 8px;
  background-image: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 45px);
  background-size: 100% 180px; background-repeat: no-repeat;
}
.step > a, .step > div {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  padding: 0 4px 8px; border-radius: var(--radius); transition: background-color .15s ease;
}
.step > a:hover { background: var(--surface-2); }
.candle { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 180px; margin-bottom: 14px; }
.candle .body {
  position: relative; z-index: 1; width: 34px; height: var(--h); background: var(--candle); border-radius: 5px;
  transform-origin: bottom; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.candle .wick {
  position: absolute; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  height: calc(var(--h) + 22px); background: var(--candle); border-radius: 2px;
  transform-origin: bottom; animation: rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.step:nth-child(2) .candle > * { animation-delay: .08s; }
.step:nth-child(3) .candle > * { animation-delay: .16s; }
.step:nth-child(4) .candle > * { animation-delay: .24s; }
.step:nth-child(5) .candle > * { animation-delay: .32s; }
.step > a:hover .body { background: var(--accent); }
.is-soon .candle .body { background: transparent; border: 2px dashed var(--bar-muted); }
.is-soon .candle .wick { background: var(--bar-muted); }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.step-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.step-label { font-weight: 700; font-size: 16px; line-height: 1.2; margin-top: 2px; }
.step > a:hover .step-label { text-decoration: underline; text-underline-offset: 3px; }
.step-time { font-size: 13px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.step-time.soon { color: var(--muted); font-style: italic; }

/* ==========================================================================
   Home: topics
   ========================================================================== */

.topics { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 40px 0; scroll-margin-top: 76px; }
.topic-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.topic-list li + li { border-left: 1px solid var(--line); }
.topic-list a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 8px 20px 10px; text-decoration: none; border-radius: var(--radius-sm); }
.topic-list li:first-child a { padding-left: 0; }
.topic-list strong { font-size: 20px; font-weight: 700; }
.topic-list span { color: var(--muted); font-size: 15px; line-height: 1.4; }
.topic-list em { font-style: normal; font-size: 14px; color: var(--accent); font-weight: 600; margin-top: auto; padding-top: 8px; }
.topic-list a:hover strong { text-decoration: underline; text-underline-offset: 4px; }

/* ==========================================================================
   Home: featured + latest
   ========================================================================== */

.featured { padding-top: 64px; }
.featured-card {
  display: grid; grid-template-columns: 1fr 1fr; text-decoration: none; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
}
.featured-art { background: var(--forest); padding: 40px; display: flex; align-items: center; min-height: 320px; }
.featured-art .candle-art { width: 100%; height: 220px; }
.featured-art .up line { stroke: var(--forest-candle); }
.featured-art .up rect { fill: var(--forest-candle); }
.featured-art .down line { stroke: var(--forest-down); }
.featured-art .down rect { fill: var(--forest-down); }
.featured-copy { padding: 44px 48px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.featured-copy .topic-tag { background: var(--horn); }
.featured-copy h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.02em; }
.featured-copy > p { color: var(--muted); font-size: 18px; line-height: 1.5; }
.text-link { font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.featured-card:hover h2 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.latest { padding-top: 72px; padding-bottom: 88px; scroll-margin-top: 76px; }
.latest-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 10px; width: min(340px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; height: 48px;
}
.search:focus-within { border-color: var(--ink); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search input { border: 0; background: transparent; outline: 0; width: 100%; font-size: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.filter {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 16px; font-size: 15px; font-weight: 500; cursor: pointer; min-height: 40px;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.result-count { color: var(--muted); font-size: 14px; margin-top: 20px; }

.post-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; margin-top: 8px; }
.post { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.post[hidden] { display: none; }
.post-art { display: block; background: var(--surface-2); border-radius: var(--radius); padding: 14px; aspect-ratio: 4 / 3; align-self: start; }
.post-art .candle-art { width: 100%; height: 100%; }
.post-body { display: flex; flex-direction: column; gap: 8px; }
.post h3 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.post h3 a { text-decoration: none; }
.post h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-desc { color: var(--muted); font-size: 16px; line-height: 1.45; }
.post time { color: var(--muted); font-size: 14px; }
.no-results { display: none; padding: 32px 0; color: var(--muted); }
.no-results a { color: var(--accent); }

/* ==========================================================================
   Home: promise
   ========================================================================== */

.promise { padding-bottom: 96px; }
.promise h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; letter-spacing: -.02em; }
.promise-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; margin-top: 24px; }
.promise-lede { font-family: var(--font-read); font-size: 24px; line-height: 1.5; }
.promise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.promise-list li { position: relative; padding-left: 26px; color: var(--muted); font-size: 17px; }
.promise-list li::before { content: ""; position: absolute; left: 6px; top: 4px; width: 8px; height: 18px; border-radius: 2px; background: var(--candle); }
.promise-list strong { color: var(--ink); }

/* ==========================================================================
   Newsletter
   ========================================================================== */

.newsletter { background: var(--forest); color: var(--on-forest); padding: 72px 0; scroll-margin-top: 76px; }
.newsletter-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.newsletter h2 { font-size: clamp(32px, 4vw, 48px); font-weight: 800; letter-spacing: -.02em; }
.newsletter-copy p { margin-top: 12px; font-size: 19px; color: var(--forest-muted); max-width: 26em; }
.subscribe-form label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
.input-row { display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 6px; }
.input-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 16px; font-size: 17px; color: #14211b; }
.input-row input::placeholder { color: #7a857d; }
.input-row:focus-within { outline: 3px solid var(--forest-candle); outline-offset: 2px; }
.newsletter .button { background: var(--forest-candle); border-color: var(--forest-candle); color: #14211b; }
.form-message { min-height: 22px; margin-top: 10px; font-size: 15px; }
.form-message.success { color: var(--forest-candle); }
.form-message.error { color: #f3a690; }
.form-fine { font-size: 14px; color: var(--forest-muted); }
.newsletter-compact { padding: 56px 0; }
.newsletter-compact h2 { font-size: clamp(28px, 3vw, 36px); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { padding: 56px 0 32px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; }
.logo-plate { display: inline-block; border-radius: 10px; }
.footer-logo { height: 40px; width: auto; }
.footer-brand p { color: var(--muted); margin-top: 16px; max-width: 30em; font-size: 16px; }
.site-footer h2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--muted); text-decoration: none; font-size: 16px; }
.site-footer ul a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 32px; color: var(--muted); font-size: 14px; }
.footer-legal p:first-child { max-width: 60em; }
.footer-legal p:last-child { white-space: nowrap; }

/* ==========================================================================
   Article
   ========================================================================== */

.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 30; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--candle); transform-origin: left; transform: scaleX(0); }

.article-head { padding-top: 48px; }
.article-head > * { max-width: 860px; }
.crumbs { display: flex; gap: 10px; font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.article-head h1 { margin-top: 20px; font-size: clamp(36px, 5vw, 60px); font-weight: 800; letter-spacing: -.03em; line-height: 1.04; }
.deck { margin-top: 20px; font-family: var(--font-read); font-size: clamp(20px, 2.2vw, 24px); line-height: 1.45; color: var(--muted); max-width: 40em; }
.byline { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.byline-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--horn); padding: 4px; }
.byline-name { font-weight: 700; }
.byline-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 15px; }

.article-hero { margin-top: 36px; }
.hero-candles { background: var(--forest); border-radius: var(--radius-lg); padding: 28px 36px; }
.candle-art-wide { width: 100%; height: auto; }
.hero-candles .up line { stroke: var(--forest-candle); }
.hero-candles .up rect { fill: var(--forest-candle); }
.hero-candles .down line { stroke: var(--forest-down); }
.hero-candles .down rect { fill: var(--forest-down); }
.hero-image img { width: 100%; height: auto; border-radius: var(--radius-lg); }

.article-layout { display: grid; grid-template-columns: 220px minmax(0, 700px); gap: 72px; padding-top: 48px; padding-bottom: 72px; }
.article-aside { position: sticky; top: 100px; align-self: start; display: grid; gap: 32px; }
.toc-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--candle); font-weight: 600; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.share .toc-title { width: 100%; margin-bottom: 2px; }
.share a { font-size: 14px; text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.share a:hover { border-color: var(--ink); }

/* Long-form reading */
.prose { font-family: var(--font-read); font-size: 19px; line-height: 1.72; min-width: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-family: var(--font-ui); font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 2.2em; scroll-margin-top: 100px; }
.prose h3 { font-family: var(--font-ui); font-size: 22px; font-weight: 700; margin-top: 1.8em; scroll-margin-top: 100px; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose ol li::marker { font-family: var(--font-ui); font-weight: 700; color: var(--accent); }
.prose ul li::marker { color: var(--candle); }
.prose code { font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: var(--surface-2); padding: 16px 20px; border-radius: var(--radius); overflow-x: auto; font-size: 15px; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: 20px; border-left: 3px solid var(--line); font-style: italic; color: var(--muted); }
.figure img { width: 100%; height: auto; border-radius: var(--radius); }
.figure figcaption { margin-top: 10px; font-family: var(--font-ui); font-size: 15px; color: var(--muted); }

.takeaways { background: var(--horn); border-radius: var(--radius-lg); padding: 26px 30px; font-family: var(--font-ui); }
.prose .takeaways h2 { font-size: 20px; margin: 0; }
.takeaways ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.takeaways li { position: relative; padding-left: 28px; font-size: 17px; line-height: 1.45; margin: 0; }
.takeaways li::before { content: ""; position: absolute; left: 4px; top: .35em; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 16px; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose thead th { background: var(--surface-2); font-weight: 700; font-size: 15px; }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.prose .a-right { text-align: right; }
.prose .a-center { text-align: center; }

.callout { border-radius: var(--radius); padding: 18px 22px 18px 22px; border-left: 5px solid var(--accent); background: var(--surface); font-family: var(--font-ui); font-size: 17px; line-height: 1.55; }
.callout p + p { margin-top: 4px; }
.callout-label { font-weight: 700; font-size: 15px; }
.callout-note { border-left-color: var(--accent); }
.callout-tip { border-left-color: var(--candle); background: color-mix(in srgb, var(--candle) 12%, var(--surface)); }
.callout-warning { border-left-color: var(--down); background: color-mix(in srgb, var(--down) 9%, var(--surface)); }
.callout-warning .callout-label { color: var(--down); }

.chart { margin: 2em 0 0; padding: 24px 24px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); font-family: var(--font-ui); }
.chart-title { font-weight: 700; font-size: 18px; line-height: 1.3; }
.chart-legend { list-style: none; padding: 0; margin: 10px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 8px; margin: 0; }
.c-key { width: 14px; height: 14px; border-radius: 4px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-axis { fill: var(--muted); font-size: 13px; font-family: var(--font-ui); }
.c-value { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: var(--font-ui); }
.c-bar.s0, .c-key.s0 { fill: var(--bar-muted); background: var(--bar-muted); }
.c-bar.s1, .c-key.s1 { fill: var(--candle); background: var(--candle); }
.c-bar.s2, .c-key.s2 { fill: var(--down); background: var(--down); }
.c-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.c-line.s0 { stroke: var(--bar-muted); } .c-line.s1 { stroke: var(--candle); } .c-line.s2 { stroke: var(--down); }
.c-dot { stroke: var(--surface); stroke-width: 2; }
.c-dot.s0 { fill: var(--bar-muted); } .c-dot.s1 { fill: var(--candle); } .c-dot.s2 { fill: var(--down); }
.c-bar:hover { opacity: .85; }
.chart-note { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.chart-data { margin-top: 10px; font-size: 15px; }
.chart-data summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.chart-data table { margin-top: 10px; }

.next-step { display: block; margin-top: 2.4em !important; padding: 20px 24px; border: 2px solid var(--ink); border-radius: var(--radius); text-decoration: none; font-family: var(--font-ui); }
.next-step span { display: block; font-size: 14px; color: var(--muted); }
.next-step strong { display: block; font-size: 21px; line-height: 1.25; margin-top: 2px; }
.next-step:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.disclaimer { margin-top: 2.4em !important; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--font-ui); font-size: 14px; line-height: 1.55; color: var(--muted); }
.author-box { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--radius); background: var(--surface-2); font-family: var(--font-ui); font-size: 15px; line-height: 1.5; color: var(--muted); }
.author-box img { width: 56px; height: 56px; border-radius: 50%; background: var(--horn); padding: 5px; flex-shrink: 0; }
.author-name { color: var(--ink); font-weight: 700; font-size: 17px; }

.related { padding-bottom: 80px; }
.related h2 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
.related-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.related-card .candle-art { width: 100%; height: 90px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; }
.related-card .topic-tag { align-self: flex-start; }
.related-card strong { font-size: 19px; line-height: 1.25; }
.related-card:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.related-meta { color: var(--muted); font-size: 14px; margin-top: auto; }

/* Simple pages */
.page-narrow { max-width: 820px; padding-top: 64px; padding-bottom: 80px; }
.page-narrow h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; }
.page-narrow .prose { margin-top: 24px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .main-nav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .hero h1 { max-width: 16ch; }
  .topic-list { grid-template-columns: repeat(3, 1fr); row-gap: 24px; }
  .topic-list li:nth-child(4) { border-left: 0; }
  .topic-list li:nth-child(4) a { padding-left: 0; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 780px; }
  .article-aside { position: static; order: 2; margin-top: 40px; }
  .toc { display: none; }
}

@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  body { font-size: 16px; }
  .header-inner { height: 64px; gap: 12px; }
  .brand-logo { height: 34px; }
  .header-actions .button-small { display: none; }
  .hero h1 { font-size: clamp(34px, 9.5vw, 46px); }
  .hero-lede { font-size: 18px; }
  .hero-actions .button { flex: 1 1 auto; }
  .path-card { padding: 22px 16px 12px; }
  .path { grid-template-columns: 1fr; gap: 2px; background: none; }
  .step > a, .step > div { display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 10px 8px; }
  .candle { grid-row: 1 / 3; height: 56px; margin: 0; }
  .candle .body { width: 18px; height: calc(var(--h) * .7); border-radius: 3px; }
  .candle .wick { height: calc(var(--h) * .7 + 10px); }
  .step-num { grid-column: 2; }
  .step-label { grid-column: 2; }
  .step-time { grid-column: 3; grid-row: 1 / 3; margin: 0; padding: 0; }
  .topic-list { grid-template-columns: 1fr 1fr; }
  .topic-list li { border-left: 0 !important; }
  .topic-list a { padding-left: 0 !important; padding-right: 12px; }
  .featured { padding-top: 48px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-art { min-height: 0; padding: 24px; }
  .featured-art .candle-art { height: 140px; }
  .featured-copy { padding: 24px 22px 28px; }
  .latest { padding-top: 56px; }
  .post-list { grid-template-columns: 1fr; }
  .post { grid-template-columns: 96px 1fr; gap: 14px; padding: 20px 0; }
  .post-art { padding: 8px; }
  .post h3 { font-size: 18px; }
  .post-desc { display: none; }
  .promise-grid { grid-template-columns: 1fr; gap: 28px; }
  .promise-lede { font-size: 20px; }
  .newsletter { padding: 56px 0; }
  .newsletter-inner { grid-template-columns: 1fr; gap: 28px; }
  .input-row { flex-direction: column; border-radius: var(--radius); padding: 6px; }
  .input-row input { min-height: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-legal { flex-direction: column; gap: 12px; }
  .article-head { padding-top: 28px; }
  .article-head h1 { font-size: clamp(30px, 8.6vw, 40px); }
  .hero-candles { padding: 18px; border-radius: var(--radius); }
  .article-layout { padding-top: 32px; }
  .prose { font-size: 18px; }
  .prose h2 { font-size: 25px; }
  .takeaways { padding: 22px 20px; }
  .chart { padding: 18px 14px 12px; margin-inline: -4px; }
  .prose th, .prose td { padding: 10px 12px; font-size: 15px; }
  .related-grid { grid-template-columns: 1fr; }
  .c-axis, .c-value { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
