/* FinancePulse — premium editorial stylesheet
   Tokens: trust-navy + premium gold on cool paper. Full light/dark theming. */

:root {
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #f5f6f8;
  --paper: #ffffff;
  --paper-2: #fbfcfd;
  --ink: #0b1220;
  --ink-soft: #475569;
  --ink-faint: #64748b;
  --line: #e6e9ee;
  --line-strong: #d6dbe3;
  --navy: #0f172a;
  --blue: #1e3a8a;
  --accent: #1e3a8a;
  --accent-hover: #152a63;
  --gold: #ca8a04;
  --gold-ink: #87610a;
  --up: #047857;
  --down: #b91c1c;
  --flat: #64748b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #080d17;
  --paper: #0f1626;
  --paper-2: #131c2e;
  --ink: #e8ecf3;
  --ink-soft: #9aa6b8;
  --ink-faint: #6b7689;
  --line: #1d2840;
  --line-strong: #29375200;
  --line-strong: #2a3852;
  --navy: #0b1120;
  --blue: #3b5bdb;
  --accent: #93b4ff;
  --accent-hover: #b9ceff;
  --gold: #e6b450;
  --gold-ink: #e6b450;
  --up: #34d399;
  --down: #f87171;
  --flat: #8b97a9;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color 0.18s var(--ease); }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 0.5em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 720px; }

:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--flat); }
.dot { color: var(--ink-faint); margin: 0 0.5ch; }

/* ── Ticker ─────────────────────────────────────────────────────────── */
.ticker {
  background: var(--navy);
  color: #cdd6e6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}
.ticker__track { display: inline-flex; align-items: center; will-change: transform; animation: ticker 70s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; gap: 0.5ch; padding: 9px 22px; border-right: 1px solid rgba(255, 255, 255, 0.07); align-items: baseline; }
.ticker__sym { color: #fff; font-weight: 500; letter-spacing: 0.02em; }
.ticker__val { color: #aab6cc; }
.ticker .up { color: #4ade80; }
.ticker .down { color: #f87171; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } .ticker { overflow-x: auto; } }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(145deg, var(--navy), var(--blue)); color: var(--gold); box-shadow: var(--shadow-sm); }
.brand__mark svg { width: 20px; height: 20px; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand__accent { color: var(--gold-ink); }
[data-theme="dark"] .brand__accent { color: var(--gold); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  color: var(--ink-soft); font-weight: 500; font-size: 15px; padding: 8px 13px; border-radius: 8px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a.is-active { color: var(--accent); }
[data-theme="dark"] .nav a:hover { background: rgba(255, 255, 255, 0.04); }
.header__actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink-soft); border-radius: 10px; cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 19px; height: 19px; }
#theme-toggle .moon-icon, #theme-toggle svg:last-child { display: none; }
[data-theme="dark"] #theme-toggle svg:first-child { display: none; }
[data-theme="dark"] #theme-toggle svg:last-child { display: block; }
.nav-toggle { display: none; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { padding: 44px 0 16px; }
.hero__inner { display: grid; grid-template-columns: 1.55fr 1fr; gap: 40px; align-items: stretch; }
.hero__feature { display: flex; flex-direction: column; justify-content: center; padding: 4px 0; }
.hero__kicker { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-ink); font-weight: 500; margin-bottom: 14px; }
[data-theme="dark"] .hero__kicker { color: var(--gold); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero__title { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.5rem); font-weight: 700; letter-spacing: -0.025em; margin-bottom: 16px; }
.hero__feature:hover .hero__title { color: var(--accent); }
.hero__dek { font-size: 1.18rem; color: var(--ink-soft); margin: 0 0 22px; max-width: 36ch; line-height: 1.55; }
.hero__cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.hero__cta svg { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.hero__feature:hover .hero__cta svg { transform: translateX(4px); }
.hero__side { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 32px; gap: 2px; }
.hero__item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.hero__item:first-child { padding-top: 0; }
.hero__item:last-child { border-bottom: 0; }
.hero__item-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.hero__item h3 { font-size: 1.12rem; font-weight: 600; margin: 6px 0 0; transition: color 0.18s var(--ease); }
.hero__item:hover h3 { color: var(--accent); }

/* ── Sections + grid + cards ────────────────────────────────────────── */
.home-section { margin: 30px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
[data-theme="dark"] .section-head { border-bottom-color: var(--line-strong); }
.section-head h2 { font-size: 1.5rem; margin: 0; }
.section-head__more { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.section-head__more:hover { color: var(--accent); }
.section-head__more svg { width: 15px; height: 15px; }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card__link { display: block; color: inherit; height: 100%; }
.card__link:hover { color: inherit; }
.card__body { padding: 22px 22px 20px; }
.card__kicker { display: inline-block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gold-ink); font-weight: 500; margin-bottom: 10px; }
[data-theme="dark"] .card__kicker { color: var(--gold); }
.card__title { font-size: 1.24rem; font-weight: 600; margin: 0 0 9px; transition: color 0.18s var(--ease); }
.card:hover .card__title { color: var(--accent); }
.card__dek { color: var(--ink-soft); font-size: 0.96rem; margin: 0 0 14px; line-height: 1.55; }
.card__meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); display: flex; align-items: center; gap: 7px; }

/* ── 2-column layout + sidebar ──────────────────────────────────────── */
.layout-2col { display: grid; grid-template-columns: 1fr 320px; gap: 44px; align-items: start; margin-top: 8px; }
.layout-aside { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 24px; }

.snapshot { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.snapshot__head { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.snapshot__row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.snapshot__row:last-of-type { border-bottom: 0; }
.snapshot__label { color: var(--ink); font-weight: 500; font-size: 0.92rem; }
.snapshot__val { font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink-soft); }
.snapshot__chg { font-family: var(--font-mono); font-size: 0.84rem; font-weight: 500; text-align: right; min-width: 56px; }
.snapshot__foot { font-size: 0.82rem; color: var(--ink-faint); padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--line); }

.promo { background: linear-gradient(160deg, var(--navy), #16223f); color: #e8ecf3; border-radius: var(--radius); padding: 24px; }
.promo h4 { color: #fff; font-size: 1.18rem; margin: 0 0 8px; }
.promo p { color: #b6c2d6; font-size: 0.92rem; margin: 0; }
.promo a { color: var(--gold); }

/* ── Ad (single centered 300x250 band, homepage top only) ───────────── */
.ad-band { display: flex; flex-direction: column; align-items: center; margin: 22px auto 4px; }
.ad__label { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; text-align: center; }
.ad-mrec { width: 300px; height: 250px; display: flex; align-items: center; justify-content: center; margin: 0 auto; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.ad-mrec iframe { display: block; }

/* ── Page head (category / static) ──────────────────────────────────── */
.page-head { padding: 48px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.page-head__kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-ink); }
[data-theme="dark"] .page-head__kicker { color: var(--gold); }
.page-head h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); margin: 10px 0 8px; }
.page-head p { color: var(--ink-soft); font-size: 1.1rem; margin: 0; max-width: 60ch; }
.empty { color: var(--ink-soft); padding: 40px 0; }

/* ── Article ────────────────────────────────────────────────────────── */
.article { padding-top: 36px; padding-bottom: 20px; }
.crumb { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.crumb svg { width: 13px; height: 13px; }
.crumb a { color: var(--ink-soft); }
.article__head { margin-bottom: 30px; }
.article__kicker { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--gold-ink); font-weight: 500; }
[data-theme="dark"] .article__kicker { color: var(--gold); }
.article__title { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); font-weight: 700; letter-spacing: -0.025em; margin: 12px 0 14px; }
.article__dek { font-size: 1.28rem; line-height: 1.5; color: var(--ink-soft); font-family: var(--font-display); font-style: italic; margin: 0 0 22px; }
.article__meta { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Prose */
.prose { font-size: 1.12rem; line-height: 1.78; color: var(--ink); }
.prose > p:first-of-type::first-letter { font-family: var(--font-display); font-size: 3.6rem; font-weight: 700; float: left; line-height: 0.82; padding: 6px 12px 0 0; color: var(--navy); }
[data-theme="dark"] .prose > p:first-of-type::first-letter { color: var(--gold); }
.prose p { margin: 0 0 1.3em; }
.prose h2 { font-size: 1.62rem; margin: 1.8em 0 0.6em; padding-top: 0.2em; }
.prose h3 { font-size: 1.28rem; margin: 1.5em 0 0.5em; }
.prose h3 a { color: inherit; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.prose li { margin: 0.45em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--gold); }
.prose ol li::marker { color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.9em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose a { font-weight: 500; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.prose a:hover { box-shadow: inset 0 -2px 0 var(--accent); }
.prose code { font-family: var(--font-mono); font-size: 0.86em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.prose blockquote { margin: 1.6em 0; padding: 6px 0 6px 24px; border-left: 3px solid var(--gold); font-family: var(--font-display); font-style: italic; font-size: 1.22rem; color: var(--ink-soft); }

/* Callout (concept of the day) */
.callout { background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 20px 24px; margin: 1.8em 0; }
.callout__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-ink); font-weight: 500; }
[data-theme="dark"] .callout__label { color: var(--gold); }
.callout h3 { font-size: 1.2rem; margin: 8px 0 6px; }
.callout p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* Market tables */
.table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mkt-table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.mkt-table thead th { text-align: right; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; padding: 12px 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.mkt-table thead th:first-child { text-align: left; }
.mkt-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.mkt-table td:first-child { text-align: left; font-family: var(--font-sans); color: var(--ink); font-weight: 500; }
.mkt-table tbody tr:last-child td, .mkt-table tbody tr:last-child td { border-bottom: 0; }
.mkt-table tr:hover td { background: var(--paper-2); }
.mkt-table .sym { color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.82em; font-weight: 400; }
.mkt-table .up { color: var(--up); }
.mkt-table .down { color: var(--down); }

.data-note { font-size: 0.86rem !important; color: var(--ink-faint); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 2em; }
.data-note::first-letter { font-size: inherit !important; float: none !important; font-family: inherit !important; padding: 0 !important; color: inherit !important; }

.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.tag { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.article__disclaimer { font-size: 0.9rem; color: var(--ink-faint); background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; line-height: 1.6; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: #aeb9cd; margin-top: 64px; padding: 56px 0 28px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.site-footer .brand { color: #fff; }
.site-footer .brand__name { color: #fff; }
.site-footer .brand__accent { color: var(--gold); }
.footer__tag { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: #cdd6e6; margin: 14px 0 10px; }
.footer__note { font-size: 0.9rem; color: #8595ad; max-width: 42ch; line-height: 1.6; }
.footer__col h4 { color: #fff; font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 14px; }
.footer__col a { display: flex; align-items: center; gap: 7px; color: #aeb9cd; font-size: 0.94rem; padding: 5px 0; }
.footer__col a:hover { color: var(--gold); }
.footer__col svg { width: 14px; height: 14px; }
.footer__bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.footer__bottom p { font-size: 0.84rem; color: #74839c; margin: 0; }
.footer__bottom a { color: #aeb9cd; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .layout-2col { grid-template-columns: 1fr; gap: 8px; }
  .layout-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .layout-aside > * { flex: 1 1 280px; }
  .hero__inner { grid-template-columns: 1.4fr 1fr; gap: 28px; }
}
@media (max-width: 860px) {
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); padding: 12px 16px;
  }
  .nav.is-open { display: flex; }
  .nav a { font-size: 1rem; padding: 12px 14px; }
  .nav-toggle { display: grid; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 18px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .prose { font-size: 1.06rem; }
  .prose > p:first-of-type::first-letter { font-size: 3rem; }
  .layout-aside > * { flex-basis: 100%; }
}
