/* CashIn News — banknote ink on mint paper.
   Archivo (condensed → expanded) carries headlines and UI; Source Serif 4 carries reading text. */

:root {
  --paper: #EEF3EC;
  --paper-2: #E1EADF;
  --ink: #16231D;
  --ink-2: #4A5B51;
  --note: #1F5C46;      /* banknote green */
  --note-2: #2D7A5D;
  --seal: #A83A2F;      /* treasury-seal red: corrections, breaking */
  --brass: #8C6B22;     /* sponsored */
  --rule: #C6D4C6;
  --focus: #2D7A5D;
  --head: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --read: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1713; --paper-2: #16211B; --ink: #E3ECE5; --ink-2: #A2B3A8;
    --note: #74C29C; --note-2: #8FD3B0; --seal: #E5806F; --brass: #D4B566; --rule: #2A3A31; --focus: #8FD3B0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1713; --paper-2: #16211B; --ink: #E3ECE5; --ink-2: #A2B3A8;
  --note: #74C29C; --note-2: #8FD3B0; --seal: #E5806F; --brass: #D4B566; --rule: #2A3A31; --focus: #8FD3B0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--read);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--note); color: var(--paper); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- masthead */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead__band { color: var(--note); opacity: .38; height: 26px; overflow: hidden; }
.guilloche { display: block; width: 100%; height: 100%; }
.masthead__inner { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 12px 28px; padding-top: 14px; padding-bottom: 10px; }
.wordmark { text-decoration: none; display: inline-flex; gap: .28em; align-items: baseline; color: var(--note); font-family: var(--head); font-weight: 900; font-stretch: 125%; font-size: clamp(1.9rem, 4.6vw, 3.1rem); line-height: .9; letter-spacing: -.02em; }
.wordmark__news { color: var(--ink); font-weight: 300; font-stretch: 100%; }
.wordmark--small { font-size: 1.35rem; }
.masthead__date { margin: 0; font: 600 .82rem/1.35 var(--head); color: var(--ink-2); }
.masthead__tag { display: block; font-weight: 400; }
.search input { width: 220px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper-2); font: 500 .9rem var(--head); }
.search input:focus { background: var(--paper); }
.sections { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-bottom: 0; }
.sections::-webkit-scrollbar { display: none; }
.sections a { flex: none; padding: 10px 12px 9px; text-decoration: none; font: 650 .9rem var(--head); font-stretch: 88%; color: var(--ink-2); border-bottom: 3px solid transparent; }
.sections a:hover { color: var(--ink); border-bottom-color: color-mix(in srgb, var(--sec, var(--note)) 45%, transparent); }
.sections a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--sec, var(--note)); }
.notice { margin: 12px auto 0; padding: 10px 16px; background: var(--paper-2); border-left: 4px solid var(--seal); font: 600 .95rem var(--head); }

/* ---------------------------------------------------------------- ads (LBM) */
.ad { display: grid; justify-items: center; gap: 4px; margin: 28px auto; }
.ad__label { font: 500 .72rem/1 var(--head); color: var(--ink-2); letter-spacing: .02em; }
.ad .lbm-slot { max-width: 100%; }
.ad-top .ad { margin: 14px auto 6px; }
.ad--leaderboard .lbm-slot { width: 728px; min-height: 90px; }
.ad--sidebar .lbm-slot { width: 300px; min-height: 250px; }
.ad--incontent { padding: 14px 0; border-block: 1px solid var(--rule); }
.ad--incontent .lbm-slot { width: 100%; min-height: 100px; }
.ad--video .lbm-slot { width: 100%; max-width: 640px; aspect-ratio: 16 / 9; }
.ad--mobile { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--rule); box-shadow: 0 -6px 18px rgb(0 0 0 / .08); }
.ad--mobile .ad__label { display: none; }
.ad--mobile .lbm-slot { width: 320px; height: 50px; }
.ad__close { position: absolute; right: 6px; top: -30px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); font: 700 1.1rem/1 var(--head); cursor: pointer; }
.ad--empty, .ad[hidden] { display: none !important; }
@media (max-width: 767px) { body:has(.ad--mobile:not(.ad--empty)) { padding-bottom: 66px; } }

/* ---------------------------------------------------------------- seals & tags */
.seal { --seal: var(--note); flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--seal); border: 2px solid var(--seal); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px color-mix(in srgb, var(--seal) 55%, transparent); font: 800 .78rem/1 var(--head); font-stretch: 70%; letter-spacing: .04em; background: var(--paper); }
.seal--lg { width: 64px; height: 64px; font-size: 1.05rem; }
.seal--sm { width: 30px; height: 30px; font-size: .62rem; box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px color-mix(in srgb, var(--seal) 55%, transparent); }
.kicker { font: 700 .82rem/1.2 var(--head); color: var(--sec, var(--note)); text-decoration: none; }
.meta { font: 500 .8rem/1.4 var(--head); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tag-ai { color: var(--note); font-family: var(--head); }
.tag-sponsored { color: var(--brass); font: 700 .8rem/1.4 var(--head); }

/* ---------------------------------------------------------------- front page */
.lead { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; padding: 26px 0 30px; border-bottom: 1px solid var(--rule); }
.lead__story { display: grid; gap: 14px; align-content: start; }
.lead__top { display: flex; gap: 14px; align-items: center; }
.lead h1, .lead h2.lead__title { margin: 0; font: 780 clamp(2.15rem, 5.2vw, 4.1rem)/.98 var(--head); font-stretch: 72%; letter-spacing: -.012em; text-wrap: balance; }
.lead__title a { text-decoration: none; }
.lead__title a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.lead__dek { margin: 0; font: 400 1.28rem/1.45 var(--read); color: var(--ink-2); max-width: 46ch; }
.tape { border-left: 1px solid var(--rule); padding-left: 24px; }
.tape h2, .rail h2, .shelf__head h2, .block h2 { margin: 0 0 12px; font: 750 1.05rem/1.2 var(--head); font-stretch: 90%; }
.tape ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tape li { display: grid; grid-template-columns: 4.6rem 1fr; gap: 10px; }
.tape time { font: 600 .78rem/1.5 var(--head); color: var(--note); font-variant-numeric: tabular-nums; }
.tape a { font: 620 1rem/1.3 var(--head); font-stretch: 92%; text-decoration: none; }
.tape a:hover { text-decoration: underline; }

.front, .reading { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; padding: 26px 0 44px; }
.rail { display: grid; gap: 30px; align-content: start; }
.rail__sticky { position: sticky; top: 12px; display: grid; gap: 26px; }
.rail .ad { margin: 0; }

.feed { display: grid; gap: 0; }
.row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.row:first-child { padding-top: 0; }
.row h3 { margin: 2px 0 6px; font: 720 1.42rem/1.12 var(--head); font-stretch: 80%; text-wrap: balance; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; }
.row p { margin: 0 0 8px; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.feed .ad--incontent { margin: 0; border-top: 0; padding: 18px 0; border-bottom: 1px solid var(--rule); }

.shelf { padding: 30px 0 6px; }
.shelf__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.shelf__head h2 { margin: 0; flex: 1; font-size: 1.3rem; }
.shelf__head a.more { font: 600 .85rem var(--head); color: var(--note); }
.shelf__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.shelf__grid article { border-top: 3px solid var(--sec, var(--note)); padding-top: 10px; }
.shelf__grid h3 { margin: 0 0 6px; font: 700 1.15rem/1.18 var(--head); font-stretch: 84%; }
.shelf__grid h3 a { text-decoration: none; }
.shelf__grid p { margin: 0 0 6px; font-size: .95rem; color: var(--ink-2); line-height: 1.45; }

.ranked { list-style: none; counter-reset: r; margin: 0; padding: 0; display: grid; gap: 12px; }
.ranked li { counter-increment: r; display: grid; grid-template-columns: 1.8rem 1fr; gap: 8px; }
.ranked li::before { content: counter(r); font: 800 1.35rem/1 var(--head); font-stretch: 70%; color: var(--note); }
.ranked a { font: 600 .98rem/1.28 var(--head); font-stretch: 92%; text-decoration: none; }
.ranked a:hover { text-decoration: underline; }

.box { background: var(--paper-2); padding: 18px; border-radius: 4px; }
.box p { margin: 0 0 10px; font-size: .95rem; }
.box h2 { margin-bottom: 6px; }

/* ---------------------------------------------------------------- story page */
.story { min-width: 0; }
.story__head { display: grid; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.story__head h1 { margin: 0; font: 780 clamp(2.05rem, 5vw, 3.6rem)/1 var(--head); font-stretch: 74%; letter-spacing: -.01em; text-wrap: balance; }
.story__dek { margin: 0; font: 400 1.3rem/1.45 var(--read); color: var(--ink-2); }
.byline { display: flex; align-items: center; gap: 12px; }
.byline strong { font: 700 .9rem var(--head); display: block; }
.disclose { margin: 0; font: 500 .85rem/1.45 var(--head); color: var(--ink-2); }
.disclose a { color: var(--note); }
.sponsor-line { margin: 0; padding: 8px 12px; border-left: 4px solid var(--brass); background: color-mix(in srgb, var(--brass) 10%, var(--paper)); font: 600 .9rem var(--head); }
.correction { margin: 18px 0 0; padding: 12px 14px; border-left: 4px solid var(--seal); background: color-mix(in srgb, var(--seal) 8%, var(--paper)); font-size: .98rem; }
.correction strong { font-family: var(--head); color: var(--seal); }

.body { font-size: 1.16rem; line-height: 1.72; max-width: 68ch; padding-top: 8px; }
.body p { margin: 0 0 1.05em; }
.body h2, .body h3 { font: 740 1.45rem/1.2 var(--head); font-stretch: 84%; margin: 1.5em 0 .5em; }
.body h3 { font-size: 1.2rem; }
.body ul, .body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.body li { margin-bottom: .35em; }
.body blockquote { margin: 1.2em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--note); font-style: italic; color: var(--ink-2); }
.body a { color: var(--note); }
.body .ad { max-width: 100%; }

.sources { margin: 28px 0 0; padding: 18px 0 0; border-top: 1px solid var(--rule); max-width: 68ch; }
.sources h2, .made h2, .engage h2, .talk h2 { font: 750 1.1rem/1.2 var(--head); margin: 0 0 10px; }
.sources ol { margin: 0; padding-left: 1.3em; font-size: .98rem; }
.sources li { margin-bottom: 6px; }
.sources small { color: var(--ink-2); font-family: var(--head); }
.made { margin-top: 18px; max-width: 68ch; }
.made summary { cursor: pointer; font: 650 .95rem var(--head); color: var(--note); }
.made dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; font-size: .95rem; }
.made dt { font: 600 .85rem var(--head); color: var(--ink-2); }
.made dd { margin: 0; }

.engage { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 26px 0 0; padding: 16px 0; border-block: 1px solid var(--rule); }
.engage h2 { margin: 0 8px 0 0; font-size: 1rem; }
.btn, .chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--note); background: var(--note); color: var(--paper); font: 650 .9rem/1 var(--head); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--note-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { background: transparent; color: var(--ink); border-color: var(--rule); }
.chip:hover { border-color: var(--note); }
.chip[aria-pressed="true"] { background: var(--note); color: var(--paper); border-color: var(--note); }
.chip .n { font-variant-numeric: tabular-nums; }

.talk { margin-top: 34px; max-width: 68ch; }
.talk__intro { margin: -4px 0 14px; color: var(--ink-2); font-size: .98rem; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font: 600 .85rem var(--head); }
.form input:not([type="checkbox"]):not([type="radio"]), .form textarea, .form select { width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); font: 400 1rem/1.45 var(--read); }
.form textarea { min-height: 110px; resize: vertical; }
.form .hp { position: absolute; left: -5000px; }
.form .btn { justify-self: start; }
.form__msg { margin: 0; font: 600 .9rem var(--head); color: var(--note); }
.form__msg.bad { color: var(--seal); }
.thread { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 18px; }
.thread li { display: grid; gap: 4px; }
.thread .who { font: 700 .88rem var(--head); }
.thread .who small { font-weight: 500; color: var(--ink-2); margin-left: 8px; }
.thread .who .ai { color: var(--note); }
.thread p { margin: 0; font-size: 1rem; }
.qa { border-left: 3px solid var(--note); padding-left: 14px; }
.qa .q { font-weight: 600; }

.related { padding: 8px 0 40px; border-top: 1px solid var(--rule); }

/* ---------------------------------------------------------------- sections, search, static */
.section-head { display: flex; gap: 16px; align-items: center; padding: 26px 0 8px; }
.section-head h1 { margin: 0; font: 800 clamp(2rem, 4.6vw, 3.2rem)/1 var(--head); font-stretch: 76%; }
.section-head p { margin: 4px 0 0; color: var(--ink-2); }
.page { max-width: 70ch; padding: 26px 0 50px; }
.page h1 { font: 800 clamp(2rem, 4.6vw, 3rem)/1.02 var(--head); font-stretch: 76%; margin: 0 0 14px; }
.page h2 { font: 740 1.35rem/1.2 var(--head); font-stretch: 86%; margin: 1.6em 0 .5em; }
.page p, .page li { font-size: 1.08rem; }
.empty { padding: 30px; background: var(--paper-2); border-radius: 4px; font-family: var(--head); }
.pager { display: flex; gap: 10px; padding: 20px 0; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 18px 0; }
.tier { border: 1px solid var(--rule); border-radius: 4px; padding: 16px; display: grid; gap: 10px; align-content: start; background: var(--paper); }
.tier h3 { margin: 0; font: 760 1.25rem var(--head); font-stretch: 84%; }
.tier p { margin: 0; font-size: .95rem; color: var(--ink-2); }
.refbox { padding: 16px; border: 2px dashed var(--note); border-radius: 4px; margin: 16px 0; }
.refbox code { font: 800 1.5rem var(--head); letter-spacing: .06em; color: var(--note); }

/* ---------------------------------------------------------------- footer */
.footer { margin-top: 30px; border-top: 1px solid var(--rule); background: var(--paper-2); }
.footer__band { color: var(--note); opacity: .3; height: 22px; overflow: hidden; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-top: 26px; padding-bottom: 18px; }
.footer h2 { font: 750 .9rem var(--head); margin: 0 0 10px; }
.footer nav a { display: block; font: 500 .9rem/1.9 var(--head); text-decoration: none; color: var(--ink-2); }
.footer nav a:hover { color: var(--ink); text-decoration: underline; }
.footer__about { font-size: .95rem; color: var(--ink-2); max-width: 36ch; }
.footer__legal { font: 500 .78rem var(--head); color: var(--ink-2); padding-bottom: 26px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .lead { grid-template-columns: 1fr; gap: 26px; }
  .tape { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 18px; }
  .front, .reading { grid-template-columns: minmax(0, 1fr); }
  .rail__sticky { position: static; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .masthead__inner { grid-template-columns: 1fr; gap: 8px; }
  .masthead__date { display: none; }
  .search input { width: 100%; }
  .shelf__grid { grid-template-columns: 1fr; gap: 18px; }
  .row { grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
  .row .seal { width: 30px; height: 30px; font-size: .62rem; }
  .row h3 { font-size: 1.28rem; }
  .body { font-size: 1.1rem; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .ad, .masthead__band, .sections, .search, .rail, .engage, .talk, .footer { display: none !important; } }
@media (min-width: 768px) { .lbm-mobile-only { display: none !important; } }
@media (max-width: 767px) { .lbm-desktop-only { display: none !important; } }
