/* ==========================================================================
   bpleon.com — stylesheet
   Clean finance / editorial aesthetic. Light + dark, fully responsive.
   Edit colors in :root below if you want a different palette.
   ========================================================================== */

:root {
  /* Palette - warm "morning paper" cream + terracotta accent. Forced light. */
  --bg:        #fbf7ef;   /* warmer cream, slight peach */
  --bg-soft:   #f3ece0;   /* a touch warmer than before */
  --ink:       #1c1a16;   /* near-black with warm tint */
  --ink-soft:  #534f47;
  --muted:     #8e887d;
  --rule:      #e6dfd0;
  --accent:    #b56a3f;   /* warm terracotta -- feels editorial + inviting */
  --accent-2:  #5b7f6b;   /* muted sage, used sparingly */

  /* Type */
  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --maxw-prose: 38rem;   /* ~640px reading width */
  --maxw-wide:  64rem;   /* project grid pages */
  --gutter:     1.25rem;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.3,1);
}

/* Dark mode is opt-in via [data-theme="dark"] only -- prefers-color-scheme
   no longer forces dark, so the site stays warm and light by default. */
[data-theme="dark"] {
  --bg:       #15140f;
  --bg-soft:  #1d1c17;
  --ink:      #f0eadd;
  --ink-soft: #beb6a4;
  --muted:    #7d766a;
  --rule:     #2c2a23;
  --accent:   #d99a72;
  --accent-2: #8db4a0;
}

/* Reset-ish ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;   /* tell the browser this page is light, no auto-dark */
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Hide the blinking text caret that appears when clicking on prose. */
  caret-color: transparent;
}
/* Re-enable the caret only inside actual form inputs. */
input, textarea, [contenteditable="true"] { caret-color: auto; }
img, svg { max-width: 100%; height: auto; display: block; }
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease), color .2s var(--ease);
}
a:hover { text-decoration-color: var(--accent); color: var(--accent); }
ul, ol { padding-left: 1.1rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* Typography ---------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .6em;
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 4.2vw + 1rem, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.8vw + .8rem, 2rem); margin-top: 2.2em; }
h3 { font-size: 1.25rem; margin-top: 1.8em; }
p  { margin: 0 0 1.1em; }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.lede {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
}
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Ticker tape (custom, mounted via script.js) ----------------------------- */
.ticker-wrap {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
  height: 42px;
  overflow: hidden;
  position: relative;
  cursor: grab;
  /* Hint to the reader that the strip is interactive. */
  touch-action: pan-y;
}
.ticker-wrap:hover .ticker-track {
  /* Pause the marquee while the cursor is over it (read in peace). */
  animation-play-state: paused;
}
.ticker-wrap.dragging .ticker-track {
  /* While dragging, fully disable the animation so the inline transform
     applied by the drag JS isn't overridden by the keyframes. */
  animation: none;
}
.ticker-wrap.dragging {
  cursor: grabbing;
  user-select: none;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: 0 1.5rem;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--rule);
  /* Keep <a> looking like the text it replaced -- no underline, inherit color. */
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease;
}
a.ticker-item:hover,
a.ticker-item:focus-visible {
  background-color: var(--bg);
  outline: none;
}
.ticker-wrap.dragging .ticker-item {
  cursor: grabbing;
}
.ticker-label {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .04em;
}
.ticker-price { color: var(--ink-soft); }
.ticker-change {
  font-size: .8rem;
  font-weight: 500;
}
.ticker-change.up   { color: #1a6e3f; }
.ticker-change.down { color: #b03a2e; }
[data-theme="dark"] .ticker-change.up   { color: #5fbf83; }
[data-theme="dark"] .ticker-change.down { color: #e08775; }

/* Markets page: live price grid + watchlist links ------------------------- */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1rem 0 0;
}
.price-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
}
.price-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(28, 26, 22, 0.06);
  border-color: var(--accent);
}
.price-card .pc-label {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .35em;
}
.price-card .pc-price {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 .15em;
  letter-spacing: -0.01em;
}
.price-card .pc-change { font-size: .85rem; font-weight: 500; }
.price-card .pc-change.up   { color: #1a6e3f; }
.price-card .pc-change.down { color: #b03a2e; }
[data-theme="dark"] .price-card .pc-change.up   { color: #5fbf83; }
[data-theme="dark"] .price-card .pc-change.down { color: #e08775; }
.price-card.placeholder .pc-price { color: var(--muted); }
/* Anchor variant -- look identical to the div, just clickable. */
a.price-card.price-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.watchlist {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  border-top: 1px solid var(--rule);
}
.watchlist li {
  border-bottom: 1px solid var(--rule);
}
.watchlist a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .85rem 0;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.watchlist .wl-name {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 1rem;
}
.watchlist .wl-symbol {
  color: var(--muted);
  font-size: .85rem;
  font-family: var(--sans);
}
.watchlist a:hover .wl-name { color: var(--accent); }

/* Toolkit & Reports list --------------------------------------------------- */
.tool-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  counter-reset: toolnum;
}
.tool-list li {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  border-radius: 8px;
  transition: background .2s var(--ease), padding-left .2s var(--ease);
}
.tool-list li:hover {
  background: var(--bg-soft);
  padding-left: 1.25rem;
}
.tool-list h3 {
  margin: 0 0 .25em;
  font-size: 1.15rem;
  font-family: var(--serif);
}
.tool-list p { margin: 0 0 .35em; color: var(--ink-soft); }
.tool-meta {
  color: var(--muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.tool-actions { display: flex; gap: .5rem; flex-shrink: 0; }
@media (max-width: 600px) {
  .tool-list li { grid-template-columns: 1fr; gap: .75rem; }
}

/* Featured tool card (toolkit, links to dcf) ------------------------------- */
.featured-tool {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.75rem 2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  margin: 1.25rem 0 2.5rem;
}
.featured-tool h3 {
  color: #fff;
  margin: 0 0 .35em;
  font-size: 1.4rem;
  font-family: var(--serif);
}
.featured-tool p { color: rgba(255,255,255,0.86); margin: 0; }
.featured-tool .btn {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
  flex-shrink: 0;
}
.featured-tool .btn:hover {
  background: var(--bg-soft);
  color: var(--accent);
  border-color: var(--bg-soft);
}
@media (max-width: 600px) { .featured-tool { grid-template-columns: 1fr; } }

/* Now page ----------------------------------------------------------------- */
.now-block {
  padding: 1.75rem 2rem;
  background: var(--bg-soft);
  border-radius: 12px;
  margin: 1.5rem 0 2.5rem;
}
.now-block p:last-child { margin-bottom: 0; }
.now-date {
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 .85rem;
  font-variant-numeric: tabular-nums;
}
.now-archive { list-style: none; padding: 0; margin: 1.5rem 0 2.5rem; border-top: 1px solid var(--rule); }
.now-archive li { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.now-archive li p:last-child { margin-bottom: 0; }

/* DCF calculator ---------------------------------------------------------- */
.dcf-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr);
  gap: 2rem;
  margin: 1.5rem 0 2rem;
  align-items: start;
}
@media (max-width: 760px) {
  .dcf-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}
.dcf-form {
  background: var(--bg-soft);
  padding: 1.5rem;
  border-radius: 12px;
}
.dcf-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
}
.dcf-form fieldset:last-child { margin-bottom: 0; }
.dcf-form legend {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 .75rem;
  padding: 0;
  letter-spacing: -0.01em;
}
.dcf-form label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .55rem;
  font-size: .9rem;
}
.dcf-form label > span:first-child {
  color: var(--ink-soft);
  flex: 1;
}
.dcf-form input[type=number] {
  width: 8rem;
  padding: .4rem .6rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.dcf-form input[type=number]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.dcf-output {
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg);
}
.dcf-output h3 {
  margin: 0 0 .35em;
  font-size: .95rem;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 500;
}
.dcf-output h3:not(:first-of-type) { margin-top: 2rem; }
.dcf-headline {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw + 1rem, 3rem);
  font-weight: 600;
  margin: 0 0 .15em;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.dcf-sub {
  color: var(--muted);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  margin: 0 0 1rem;
}
.dcf-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
}
.dcf-table th,
.dcf-table td {
  padding: .45rem .5rem;
  text-align: right;
  border-bottom: 1px solid var(--rule);
}
.dcf-table th:first-child,
.dcf-table td:first-child {
  text-align: left;
  color: var(--ink-soft);
}
.dcf-table thead th {
  font-weight: 600;
  color: var(--ink);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom-width: 2px;
}
.dcf-table tfoot td {
  font-weight: 600;
  border-bottom: 0;
  padding-top: .65rem;
  border-top: 1px solid var(--rule);
}
.dcf-table tfoot tr:first-child td { border-top: 2px solid var(--rule); }

/* DCF sensitivity heatmap */
.dcf-sens {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  margin-top: 1rem;
  border: 1px solid var(--rule);
}
.dcf-sens th,
.dcf-sens td {
  padding: .5rem .55rem;
  text-align: center;
  border: 1px solid var(--rule);
}
.dcf-sens th {
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .04em;
}
.dcf-sens td.center-cell {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.dcf-sens td.up   { background: rgba(42, 67, 101, 0.07); color: var(--ink); }
.dcf-sens td.down { background: rgba(122, 59, 46, 0.06); color: var(--ink); }

.dcf-method {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: .92rem;
}
.dcf-method h2 { font-size: 1.1rem; margin: 0 0 .75em; }
.dcf-method code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--bg-soft);
  padding: .1em .3em;
  border-radius: 3px;
}

/* Markets page ------------------------------------------------------------- */
.markets-section {
  margin: 2.5rem 0 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.markets-section:first-of-type { border-top: 0; padding-top: 0; }
.markets-section h2 {
  margin-top: 0;
  margin-bottom: .25em;
  font-size: 1.4rem;
}
.markets-section .markets-note {
  color: var(--muted);
  font-size: .9rem;
  margin: 0 0 1.25rem;
}
.markets-widget {
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

/* Header / nav -------------------------------------------------------------- */
/* Skip-to-content link (WCAG 2.4.1) — hidden until keyboard-focused. */
.skip-link {
  position: absolute; left: -9999px; top: .5rem; z-index: 2000;
  background: var(--accent); color: #fff; padding: .55rem 1rem;
  border-radius: 4px; font-family: var(--sans); font-size: .9rem; text-decoration: none;
}
.skip-link:focus { left: .5rem; }

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 1.6rem var(--gutter) 1rem;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
}
.brand img {
  height: 38px;
  width: auto;
  display: block;
}
.brand:hover { text-decoration: none; opacity: .85; }
@media (max-width: 560px) {
  .brand img { height: 30px; }
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 1.4rem;
  font-size: .95rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
}
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -.35em;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Layout containers --------------------------------------------------------- */
main {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 4rem;
}
main.prose {
  max-width: var(--maxw-prose);
}
main.prose.wide {
  max-width: var(--maxw-wide);
}
main.prose.center {
  text-align: center;
}

.page-head { margin-bottom: 2.5rem; }

/* Hero ---------------------------------------------------------------------- */
.hero {
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}
.hero-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.hero-split .hero-text { min-width: 0; }
.hero-art {
  width: 100%;
  max-width: 380px;
  justify-self: end;
}
.hero-art svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(28,26,22,0.06);
}
@media (max-width: 720px) {
  .hero-split { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-art { max-width: 100%; justify-self: stretch; }
}

/* Featured highlight card -------------------------------------------------- */
.feature-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.75rem;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-soft);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--rule);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(28,26,22,0.08);
  border-color: var(--accent);
}
.feature-card-art svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.feature-card-body h3 {
  margin: .35em 0 .35em;
  font-size: 1.5rem;
  font-family: var(--serif);
}
.feature-card-body p { margin: 0 0 .6em; color: var(--ink-soft); }
.feature-card-cta {
  color: var(--accent) !important;
  font-weight: 500;
  margin-top: .5rem !important;
}
@media (max-width: 600px) {
  .feature-card { grid-template-columns: 1fr; }
  .feature-card-art { max-width: 200px; }
}

/* Tile row (tools) --------------------------------------------------------- */
.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
}
.tile {
  display: block;
  padding: 1.5rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(181,106,63,0.10);
}
.tile-icon {
  width: 48px;
  height: 48px;
  margin-bottom: .9rem;
}
.tile-icon svg { width: 100%; height: 100%; display: block; }
.tile h3 {
  margin: 0 0 .3em;
  font-size: 1.15rem;
  font-family: var(--serif);
}
.tile p { margin: 0 0 .5em; color: var(--ink-soft); font-size: .92rem; }
.tile-cta { color: var(--accent) !important; font-weight: 500; margin: 0 !important; }

/* Project tag chips on home page ------------------------------------------ */
.project-tag {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: .5rem;
}

/* Reading + watching list -------------------------------------------------- */
.rw-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0.5rem;
}
.rw-list li {
  display: flex;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.rw-list li:last-child { border-bottom: 0; }
.rw-tag {
  flex: 0 0 5.5rem;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.rw-text { color: var(--ink); font-family: var(--serif); }
.hero h1 { max-width: 22ch; }
.hero .lede { max-width: 56ch; }
.hero-cta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Buttons ------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: .7rem 1.25rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 500;
  border: 1px solid var(--accent);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  transition: transform .18s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  background: #9a5530;        /* slightly deeper terracotta on hover */
  border-color: #9a5530;
  box-shadow: 0 6px 18px rgba(181, 106, 63, 0.22);
  color: #fff;
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(181, 106, 63, 0.18);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(181, 106, 63, 0.10);
}

/* Sections ------------------------------------------------------------------ */
.section { margin: 4.25rem 0; }
.section-head {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rule);
}
/* Short terracotta bar over the hairline — quiet editorial marker. */
.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 3.25rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 1.1vw + 1rem, 1.65rem);
  letter-spacing: -0.015em;
}
.more {
  display: inline-block;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .18s var(--ease), transform .18s var(--ease);
}
.more:hover { color: var(--accent); transform: translateX(3px); }

/* Project list (homepage teasers) ------------------------------------------- */
.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.project h3 { margin: 0 0 .25em; font-size: 1.15rem; }
.project h3 a { text-decoration: none; }
.project-meta { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.project p:last-child { color: var(--ink-soft); }

/* Project cards (full page) ------------------------------------------------- */
.project-card {
  padding: 1.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  border-radius: 8px;
  transition: background .2s var(--ease), padding-left .2s var(--ease);
}
.project-card:hover {
  background: var(--bg-soft);
  padding-left: 1.25rem;
}
.project-card:last-of-type { border-bottom: 0; }
.project-card h2 { margin: 0 0 .25em; }
.project-card h2 a { text-decoration: none; }

/* Writing list (homepage teasers) ------------------------------------------- */
.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.writing-list li {
  border-bottom: 1px solid var(--rule);
}
.writing-list li:last-child { border-bottom: 0; }
.writing-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .9rem 0;
  text-decoration: none;
  transition: padding-left .18s var(--ease);
}
.writing-list a:hover { padding-left: .4rem; }
.writing-list a:hover .post-title { color: var(--accent); }
.writing-list .post-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  transition: color .18s var(--ease);
}
.writing-list .post-date { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Writing index (full page) ------------------------------------------------- */
.writing-index {
  list-style: none;
  padding: 0;
  margin: 2rem 0 3rem;
}
.writing-index li { margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.writing-index li:last-child { border-bottom: 0; }
.writing-index .post {
  display: block;
  padding: 1.5rem 0;
  text-decoration: none;
  color: inherit;
}
.writing-index .post time {
  display: block;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.writing-index .post h2 {
  font-size: 1.4rem;
  margin: 0 0 .35rem;
}
.writing-index .post p { color: var(--ink-soft); margin: 0; }
.writing-index .post:hover h2 { color: var(--accent); }

/* CV / about ---------------------------------------------------------------- */
.cv {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
  border-top: 1px solid var(--rule);
}
.cv li {
  display: flex;
  gap: 1.25rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--rule);
}
.cv-when {
  flex: 0 0 9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  letter-spacing: .04em;
}
.cv-what { color: var(--ink); }

/* Contact list -------------------------------------------------------------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  border-top: 1px solid var(--rule);
}
.contact-list li {
  display: flex;
  gap: 1.25rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.contact-label {
  flex: 0 0 6rem;
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Subscribe ----------------------------------------------------------------- */
.subscribe {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-soft);
  border-radius: 14px;
}
.subscribe h2 { margin-top: 0; }
.subscribe-fallback { font-size: .9rem; color: var(--muted); margin: .75rem 0 0; }

/* Footer -------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
}
/* Subscribe CTA injected by script.js into every page's footer. */
.footer-subscribe {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) .25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}
.footer-subscribe-prompt {
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-soft);
}
.footer-subscribe-btn {
  padding: .5rem 1.1rem;
  font-size: .9rem;
}
@media (max-width: 560px) {
  .footer-subscribe { flex-direction: column; align-items: flex-start; gap: .75rem; }
}
.footer-inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .9rem;
  color: var(--muted);
}
.copy { margin: 0; }
.social {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}
.social a { color: var(--ink-soft); text-decoration: none; }
.social a:hover { color: var(--accent); }

/* Watchlist — homepage "What I'm watching" cards -------------------------- */
.section-sub { margin: -.4rem 0 1.25rem; max-width: 60ch; }
.xsmall { font-size: .78rem; }

.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.watch-card {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.watch-card-empty { opacity: .65; }
.watch-card-head strong,
.watch-card-head a {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.watch-card-head a:hover { color: var(--accent); }
.watch-sym {
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 500;
  font-size: .85em;
  letter-spacing: .04em;
}
.watch-price-row {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  font-variant-numeric: tabular-nums;
}
.watch-price {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
}
.watch-change {
  font-size: .92rem;
  font-weight: 500;
}
.watch-change.up   { color: #1a6e3f; }
.watch-change.down { color: #b03a2e; }
[data-theme="dark"] .watch-change.up   { color: #5fbf83; }
[data-theme="dark"] .watch-change.down { color: #e08775; }
.watch-thesis {
  margin: 0;
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.watch-target-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
  border-top: 1px dashed var(--rule);
  padding-top: .55rem;
}
.watch-totarget { font-size: .88rem; font-weight: 500; }
.watch-totarget.up   { color: #1a6e3f; }
.watch-totarget.down { color: #b03a2e; }
[data-theme="dark"] .watch-totarget.up   { color: #5fbf83; }
[data-theme="dark"] .watch-totarget.down { color: #e08775; }

/* World markets status grid ----------------------------------------------- */
.markets-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.mkt-card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: .85rem 1rem;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.mkt-card-closed { opacity: .85; }
.mkt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}
.mkt-name {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.mkt-code {
  font-family: var(--sans);
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .08em;
}
.mkt-status-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.mkt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.mkt-dot-open {
  background: #1a6e3f;
  box-shadow: 0 0 0 0 rgba(26, 110, 63, 0.6);
  animation: mkt-pulse 2s infinite;
}
.mkt-dot-closed { background: #b03a2e; }
[data-theme="dark"] .mkt-dot-open { background: #5fbf83; }
[data-theme="dark"] .mkt-dot-closed { background: #e08775; }
@keyframes mkt-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(26, 110, 63, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(26, 110, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 110, 63, 0); }
}
.mkt-status {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
}
.mkt-status-open   { color: #1a6e3f; }
.mkt-status-closed { color: #b03a2e; }
[data-theme="dark"] .mkt-status-open   { color: #5fbf83; }
[data-theme="dark"] .mkt-status-closed { color: #e08775; }
.mkt-card p { margin: 0; }

/* World markets ON BREAK state (Tokyo / Hong Kong midday halt) -- amber */
.mkt-card-lunch { opacity: .92; }
.mkt-dot-lunch  { background: #c98a35; }
.mkt-status-lunch { color: #c98a35; }
[data-theme="dark"] .mkt-dot-lunch    { background: #e0a560; }
[data-theme="dark"] .mkt-status-lunch { color: #e0a560; }

/* Watchlist row: lead pick card on the left, headlines panel on the right.
   The lead pick card is the merged "watchlist + snapshot" -- one tall
   card per the lead pick that holds price, sparkline, thesis, target,
   stats grid, and a Yahoo link. Stacks to a single column on mobile. */
.watchlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 760px) {
  .watchlist-row { grid-template-columns: 1fr; }
}

/* Lead pick card (replaces the old separate watchlist-card + snapshot-panel) */
.lead-pick-card {
  padding: 1.6rem 1.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.lp-head {
  margin-bottom: 1.1rem;
}
.lp-eyebrow {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .4rem;
  font-weight: 600;
}
.lp-name {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.lp-symbol {
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--muted);
  letter-spacing: .04em;
  margin: .25rem 0 0;
}
.lp-priceblock {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  margin: 0 0 1rem;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.lp-price {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.015em;
}
.lp-change {
  font-family: var(--sans);
  font-size: .92rem;
  font-weight: 500;
  color: var(--muted);
}
.lp-change.up   { color: #1a6e3f; }
.lp-change.down { color: #b03a2e; }
.lp-spark {
  position: relative;
  margin: .25rem auto .35rem;
  min-height: 140px;
  max-width: 420px;
  cursor: crosshair;
}
.lp-spark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}
.lp-spark-overlay.active { opacity: 1; }
.lp-spark-cross {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--ink-soft, #6b6558);
  opacity: .35;
  transform: translateX(-0.5px);
}
.lp-spark-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink, #1c1a16);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transform: translate(-50%, -50%);
}
.lp-spark-tip {
  position: absolute;
  background: rgba(28, 26, 22, .93);
  color: #fbf7ef;
  font-family: var(--sans);
  font-size: .72rem;
  line-height: 1.25;
  padding: .35rem .6rem;
  border-radius: 6px;
  white-space: nowrap;
  transform: translateX(-50%);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.lp-spark-tip strong {
  display: block;
  font-family: var(--serif);
  font-size: .9rem;
  font-weight: 600;
}
.lp-spark-tip span {
  display: block;
  margin-top: 1px;
  color: #c8c4ba;
  font-size: .62rem;
  letter-spacing: .04em;
  font-weight: 500;
}
.lp-spark-periods {
  display: flex;
  gap: .35rem;
  justify-content: center;
  margin: 0 0 1.1rem;
  flex-wrap: wrap;
}
.period-btn-sm {
  padding: .2rem .6rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.period-btn-sm:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}
.period-btn-sm.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.lp-thesis {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
  padding: 1rem 0 1.1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-style: italic;
}
.lp-pitch-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem 1.25rem;
  margin: 0 0 1.4rem;
  font-variant-numeric: tabular-nums;
}
.lp-pitch-row > div {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.lp-pitch-row dt {
  font-family: var(--sans);
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lp-pitch-row dd {
  font-family: var(--sans);
  font-size: .98rem;
  color: var(--ink);
  font-weight: 600;
  margin: 0;
}
.lp-tt.up   { color: #1a6e3f; }
.lp-tt.down { color: #b03a2e; }
.lp-section-label {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .8rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
  font-weight: 600;
}
.lp-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .8rem 1.5rem;
  margin: 0 0 1.4rem;
  font-variant-numeric: tabular-nums;
}
.lp-stats > div {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.lp-stats dt {
  font-family: var(--sans);
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lp-stats dd {
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-link {
  font-family: var(--sans);
  font-size: .88rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s var(--ease);
}
.lp-link:hover { color: #9a5530; }
.headlines-panel {
  padding: 1.25rem 1.4rem;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.headlines-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .85rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--rule);
}
.headlines-list { display: flex; flex-direction: column; gap: .85rem; }
.hl-row {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  text-decoration: none;
  padding-bottom: .85rem;
  border-bottom: 1px dashed var(--rule);
  color: var(--ink);
}
.hl-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hl-row:hover .hl-title { color: var(--accent); }
.hl-title {
  font-family: var(--serif);
  font-size: .95rem;
  line-height: 1.35;
  transition: color .15s var(--ease);
}
.hl-meta {
  font-family: var(--sans);
  font-size: .76rem;
  color: var(--muted);
  letter-spacing: .04em;
}

/* Sparkline holder inside watchlist cards */
.watch-spark {
  margin: .15rem 0 .55rem;
  min-height: 44px;
}

/* Metrics row inside watchlist cards (Mkt Cap / P/E / 52W / Vol) */
.watch-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
  padding: .65rem 0 .25rem;
  margin: 0 0 .35rem;
  border-top: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.watch-metrics:empty { display: none; padding: 0; margin: 0; border-top: 0; }
.wm-cell {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}
.wm-label {
  font-family: var(--sans);
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.wm-val {
  font-family: var(--sans);
  font-size: .85rem;
  color: var(--ink-soft);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hero chart label (top-left text inside the SVG) */
#hero-chart-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Hover crosshair + price/date tooltip on the S&P chart. */
.hero-chart-wrap {
  position: relative;
  cursor: crosshair;
}
.hero-chart-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  border-radius: 14px;
  overflow: hidden;
}
.hero-chart-overlay.active { opacity: 1; }
.hero-chart-cross {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #b56a3f;
  opacity: .55;
  transform: translateX(-0.5px);
}
.hero-chart-dot {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #b56a3f;
  border: 2px solid #fbf7ef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transform: translate(-50%, -50%);
}
.hero-chart-tip {
  position: absolute;
  background: rgba(28, 26, 22, .94);
  color: #fbf7ef;
  font-family: var(--sans);
  font-size: .75rem;
  line-height: 1.25;
  padding: .4rem .65rem;
  border-radius: 6px;
  white-space: nowrap;
  transform: translateX(-50%);
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
}
.hero-chart-tip strong {
  display: block;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}
.hero-chart-tip span {
  display: block;
  margin-top: 1px;
  color: #c8c4ba;
  font-size: .65rem;
  letter-spacing: .04em;
  font-weight: 500;
}

/* Hero chart range toggles (1M / 6M / YTD / 1Y / 5Y) */
.hero-chart-periods {
  display: flex;
  gap: .35rem;
  justify-content: center;
  margin: .65rem 0 0;
  flex-wrap: wrap;
}
.period-btn {
  padding: .3rem .8rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.period-btn:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}
.period-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Skeleton loading bars (perceived-speed UX for live data) ---------------
   Use .skel for any standalone shimmering bar. .skel-line is a block bar
   sized to look like a line of text; .tall makes it match the lede price
   line in the watch / price cards. The pulse is intentionally slow and
   subtle -- it should reassure, not distract. */
@keyframes skel-pulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1;   }
}
.skel {
  display: inline-block;
  background: var(--rule);
  border-radius: 4px;
  vertical-align: middle;
  animation: skel-pulse 1.4s ease-in-out infinite;
}
.skel-line { display: block; height: .85rem; margin: .35rem 0; }
.skel-line.tall { height: 1.35rem; }
.watch-card-loading .watch-card-head,
.mkt-card-loading .mkt-head { gap: .5rem; }
.watch-card-loading,
.mkt-card-loading { opacity: .85; }

/* Selection / focus --------------------------------------------------------- */
::selection { background: var(--accent); color: #fff; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 560px) {
  .site-header { padding-top: 1.1rem; }
  .site-nav { gap: .6rem .9rem; font-size: .88rem; justify-content: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .cv li, .contact-list li { flex-direction: column; gap: .15rem; }
  .cv-when, .contact-label { flex: 0 0 auto; }
  .subscribe { padding: 1.25rem; }
}

/* Wide data tables (article scoreboards, comp tables, sensitivity grids) scroll
   horizontally on phones instead of forcing the whole page sideways. !important
   beats the per-article inline <style> blocks, which load after this file. */
@media (max-width: 680px) {
  main table { display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; max-width: 100% !important; }
}

/* Print --------------------------------------------------------------------- */
/* Research gets saved-to-PDF and printed constantly. This makes a printout look
   like a clean research note: no nav chrome, paper margins, controlled page
   breaks, repeated table headers, and in-prose citations disclose their URL so
   a printed copy stays traceable. (Calculators are standalone and don't link
   this file, so this only affects the editorial pages — exactly the intent.) */
@page { margin: 1.8cm 1.6cm; }
@media print {
  /* Hide all interactive / navigational chrome */
  .site-header, .site-footer, .hero-cta, .more, .subscribe, .subscribe-fallback,
  .skip-link, .site-nav, nav, .btn, .btn-primary, .btn-ghost, .btn-sm,
  .pill, button { display: none !important; }

  /* Force a clean light document regardless of the dark-mode :root */
  html, body { background: #fff !important; color: #111 !important; }
  body { font-family: var(--serif); font-size: 11.5pt; line-height: 1.46; padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
  main { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }

  /* Headings stay with the text that follows them; near-black for ink economy */
  h1, h2, h3, h4 { color: #111 !important; break-after: avoid-page; page-break-after: avoid; }
  h1 { font-size: 22pt; } h2 { font-size: 16pt; } h3 { font-size: 13pt; }
  p, li { orphans: 3; widows: 3; }

  /* Keep atomic blocks from splitting across a page break */
  figure, table, blockquote, pre, .card { break-inside: avoid; page-break-inside: avoid; }
  figure { margin: 1em 0; }
  figure img, img { max-width: 100% !important; height: auto !important; }
  figcaption { font-size: 9pt; color: #555 !important; }
  pre, code { background: #f5f5f5 !important; color: #000 !important; border: 1px solid #ddd; }

  /* Tables render fully (override the mobile horizontal-scroll rule) and repeat
     their header row on every page they span */
  main table { display: table !important; overflow: visible !important; width: 100% !important; border-collapse: collapse; }
  thead { display: table-header-group; }
  tr { page-break-inside: avoid; }
  th, td { border-color: #ccc !important; }

  /* Links: black; in-prose external citations disclose their target URL */
  a { color: #000 !important; text-decoration: underline; }
  main p a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.82em; color: #555; word-break: break-all; }

  /* Document-end colophon so a saved PDF is attributable */
  body::after { content: "Brandon Leon · bpleon.com"; display: block; margin-top: 2em; padding-top: 0.5em; border-top: 1px solid #bbb; font-family: var(--sans); font-size: 9pt; color: #666; text-align: center; }
}
