/* Lendstack: Midnight & mint */
:root {
  --midnight: #0F1A2E;
  --mint: #1F8A70;
  --mint-dark: #176E59;
  --paper: #F3F6F4;
  --slate: #5B6673;
  --line: #D5DBD8;
  --wash: #E4F1EC;
  --bright: #5FD3B3;
  --on-dark: #E9EEF4;
  --on-dark-soft: #A7B4C4;
  --danger: #B3372C;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--midnight);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--bright);
  outline-offset: 3px;
  border-radius: 2px;
}
main a:focus-visible, main button:focus-visible, main input:focus-visible { outline-color: var(--mint); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 28px; }

/* ---------- Top bar ---------- */
.top { background: var(--midnight); color: var(--on-dark); padding-top: env(safe-area-inset-top, 0px); }
.top.home {
  background-color: var(--midnight);
  background-image: radial-gradient(rgba(255,255,255,0.055) 1px, transparent 1.2px);
  background-size: 24px 24px;
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; }
.top.home .nav { border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; color: #fff; }
.brand span { color: var(--bright); }
.nav-links { display: flex; gap: 28px; font-size: 0.92rem; }
.nav-links a { text-decoration: none; color: var(--on-dark-soft); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 40px;
  align-items: center;
  padding: 56px 0 76px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: #fff;
  margin: 0 0 22px;
  max-width: 17ch;
}
.hero-lede { font-size: 1.14rem; line-height: 1.6; color: var(--on-dark-soft); max-width: 50ch; margin: 0 0 30px; }
.hero-lede strong { color: var(--on-dark); font-weight: 600; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--mint); color: #fff; }
.btn-primary:hover { background: var(--mint-dark); }
.btn-ghost { border-color: rgba(255,255,255,0.28); color: var(--on-dark); }
.btn-ghost:hover { border-color: var(--bright); color: #fff; }

/* Stack infographic */
.stack-fig { margin: 0; }
.stack-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.stack-fig figcaption { font-size: 0.85rem; color: var(--on-dark-soft); margin-top: 6px; max-width: 46ch; }
.lbl-title { font-family: var(--serif); font-size: 21px; font-weight: 600; fill: #fff; }
.lbl-desc { font-family: var(--sans); font-size: 14.5px; fill: var(--on-dark-soft); }
.slab { opacity: 0; transform: translateY(-28px); animation: slab-drop 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.slab.s1 { animation-delay: 0.1s; }
.slab.s2 { animation-delay: 0.38s; }
.slab.s3 { animation-delay: 0.66s; }
.bar { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); animation: bar-grow 0.55s ease-out forwards; }
.bar.b1 { animation-delay: 1.05s; } .bar.b2 { animation-delay: 1.15s; } .bar.b3 { animation-delay: 1.25s; } .bar.b4 { animation-delay: 1.35s; }
.leader { stroke-dasharray: 1; stroke-dashoffset: 1; animation: leader-draw 0.45s ease-out forwards; }
.lbl { opacity: 0; animation: lbl-fade 0.5s ease-out forwards; }
.d1 { animation-delay: 1.45s; } .d2 { animation-delay: 1.6s; } .d3 { animation-delay: 1.75s; }
@keyframes slab-drop { to { opacity: 1; transform: none; } }
@keyframes bar-grow { to { transform: scaleY(1); } }
@keyframes leader-draw { to { stroke-dashoffset: 0; } }
@keyframes lbl-fade { to { opacity: 1; } }

/* ---------- Section headings ---------- */
.section { padding: 72px 0 16px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 2rem; letter-spacing: -0.01em; margin: 0; }
.section-intro { color: var(--slate); max-width: 62ch; margin: -14px 0 30px; }

/* ---------- Latest: featured essay + RBI feed ---------- */
.latest-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 56px; }
.featured-pillar, .article-pillar { font-size: 0.85rem; font-weight: 600; color: var(--mint); margin: 0 0 12px; text-decoration: none; display: inline-block; }
.featured h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 16px; }
.featured h3 a, .article h3 a { text-decoration: none; }
.featured h3 a:hover, .article h3 a:hover { color: var(--mint); }
.featured p { color: var(--slate); font-size: 1.08rem; max-width: 58ch; margin: 0 0 16px; }
.byline { font-size: 0.9rem; color: var(--slate); }
.byline strong { color: var(--midnight); font-weight: 600; }
.feed { border-left: 1px solid var(--line); padding-left: 32px; }
.feed h3 { font-size: 0.98rem; font-weight: 700; margin: 2px 0 4px; }
.feed-sub { font-size: 0.85rem; color: var(--slate); margin: 0 0 18px; }
.feed ol { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 14px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: none; padding-top: 0; }
.feed time { display: block; font-size: 0.8rem; color: var(--mint); font-weight: 600; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.feed a { font-family: var(--serif); font-size: 1.06rem; line-height: 1.35; text-decoration: none; }
.feed a:hover { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }
.text-link { display: inline-block; margin-top: 16px; font-weight: 600; font-size: 0.92rem; color: var(--mint); }

/* ---------- Article grid ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  font-family: var(--sans); font-size: 0.85rem; font-weight: 500; color: var(--slate);
  background: transparent; border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.filters button:hover { color: var(--midnight); border-color: var(--slate); }
.filters button[aria-pressed="true"] { background: var(--midnight); border-color: var(--midnight); color: #fff; }
.articles { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; }
.article { padding: 26px 0 30px; border-top: 2px solid var(--midnight); }
.article[hidden] { display: none; }
.article h3 { font-family: var(--serif); font-weight: 500; font-size: 1.55rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
.article p { color: var(--slate); margin: 0 0 14px; max-width: 58ch; }
.article-date { font-size: 0.85rem; color: var(--slate); }
.empty-note { color: var(--slate); }

/* ---------- Regulations tracker ---------- */
.reg {
  display: grid;
  grid-template-columns: 124px 116px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.reg:last-of-type { border-bottom: 1px solid var(--line); }
.reg[hidden] { display: none; }
.reg time { font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.reg-cat { justify-self: start; font-size: 0.8rem; font-weight: 600; color: var(--mint); background: var(--wash); padding: 3px 10px; border-radius: 4px; }
.reg h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; line-height: 1.3; margin: 0 0 6px; }
.reg h3 a { text-decoration: none; }
.reg h3 a:hover { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }
.reg-ref { font-size: 0.82rem; color: var(--slate); margin: 0 0 6px; }
.reg p.reg-sum { color: var(--slate); font-size: 0.95rem; margin: 0; max-width: 70ch; }
.disclaimer { font-size: 0.88rem; color: var(--slate); background: var(--wash); border-radius: 8px; padding: 16px 20px; margin: 0 0 28px; max-width: 80ch; }
.disclaimer a { color: var(--mint-dark); font-weight: 600; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 52px 0 12px; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.015em; line-height: 1.1; margin: 0 0 12px; }
.page-head p { color: var(--slate); max-width: 62ch; margin: 0; font-size: 1.05rem; }

/* ---------- Article page ---------- */
.post { padding: 44px 0 20px; }
.back { font-size: 0.9rem; color: var(--slate); text-decoration: none; display: inline-block; margin-bottom: 26px; }
.back:hover { color: var(--mint); }
.post h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.1rem, 4.4vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 18px; }
.post-dek { font-size: 1.2rem; line-height: 1.55; color: var(--slate); margin: 0 0 26px; }
.post-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.post-meta p { margin: 0; font-size: 0.92rem; color: var(--slate); }
.post-meta strong { color: var(--midnight); font-weight: 600; }
.share-jump { font-size: 0.9rem; font-weight: 600; color: var(--mint); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; }
.share-jump:hover { border-color: var(--mint); }
.prose { font-family: var(--serif); font-size: 1.2rem; line-height: 1.72; }
.prose p { margin: 0 0 1.25em; }
.prose h2 { font-family: var(--sans); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.005em; margin: 2em 0 0.6em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.25em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--mint); font-size: 1.3rem; line-height: 1.5; color: var(--midnight); }

/* Share */
.share { margin: 44px 0 0; padding: 28px 28px 24px; background: var(--midnight); color: var(--on-dark); border-radius: 10px; scroll-margin-top: 24px; }
.share h2 { font-family: var(--serif); font-weight: 500; font-size: 1.55rem; margin: 0 0 6px; color: #fff; }
.share > p { margin: 0 0 20px; color: var(--on-dark-soft); font-size: 0.95rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 0.9rem; font-weight: 600;
  color: var(--on-dark); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
  padding: 10px 16px; text-decoration: none; cursor: pointer;
}
.share-btn:hover { border-color: var(--bright); color: #fff; background: rgba(95,211,179,0.1); }
.share-btn svg { width: 16px; height: 16px; flex: none; }
.share-btn.native { display: none; }
.share-status { min-height: 1.3em; margin: 12px 0 0; font-size: 0.88rem; color: var(--bright); }
.author-box { display: flex; gap: 16px; align-items: flex-start; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--slate); font-size: 0.95rem; }
.author-box .initials { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--wash); color: var(--mint-dark); font-weight: 700; display: grid; place-items: center; }
.author-box p { margin: 0; max-width: 60ch; }
.author-box strong { color: var(--midnight); }

/* ---------- Subscribe ---------- */
.subscribe { padding: 72px 0; }
.subscribe-box { background: var(--wash); border-radius: 12px; padding: 44px 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.subscribe-box h2 { font-family: var(--serif); font-weight: 500; font-size: 1.9rem; line-height: 1.15; margin: 0 0 10px; }
.subscribe-box > div > p { color: var(--slate); margin: 0; max-width: 44ch; }
.sub-form { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-form label { width: 100%; font-size: 0.85rem; font-weight: 600; }
.sub-form input { flex: 1; min-width: 200px; font: inherit; padding: 13px 14px; border: 1px solid #B9C7C1; border-radius: 6px; background: #fff; color: var(--midnight); }
.sub-form button { font: inherit; font-weight: 600; padding: 13px 22px; border: none; border-radius: 6px; background: var(--mint); color: #fff; cursor: pointer; }
.sub-form button:hover { background: var(--mint-dark); }
.sub-form.sending button { opacity: 0.65; pointer-events: none; }
.sub-note { font-size: 0.82rem; color: var(--slate); width: 100%; margin: 4px 0 0; }
.sub-note.error { color: var(--danger); }
.sub-done { display: none; font-weight: 600; color: var(--mint-dark); margin: 0; }

/* ---------- About + footer ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; padding: 56px 0 64px; border-top: 1px solid var(--line); }
.about h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: 0; }
.about p { color: var(--slate); margin: 0 0 12px; max-width: 64ch; }
.about a { color: var(--mint-dark); font-weight: 600; }
footer { background: var(--midnight); color: var(--on-dark-soft); font-size: 0.88rem; padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot-top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: 36px 0 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.foot-top h2 { font-size: 0.85rem; font-weight: 600; color: var(--on-dark); margin: 0 0 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
.foot-links a { color: var(--on-dark-soft); text-decoration: none; }
.foot-links a:hover { color: #fff; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 26px; }
.foot-bottom a { color: var(--on-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 56px; }
  .latest-grid { grid-template-columns: 1fr; gap: 36px; }
  .feed { border-left: none; padding-left: 0; border-top: 2px solid var(--midnight); padding-top: 22px; }
  .articles { grid-template-columns: 1fr; }
  .reg { grid-template-columns: 1fr; gap: 6px; }
  .subscribe-box { grid-template-columns: 1fr; padding: 32px 26px; gap: 24px; }
  .about { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 600px) {
  .container, .narrow { padding: 0 20px; }
  .nav-links { gap: 18px; }
  .nav-links a.hide-sm { display: none; }
  .lbl-desc { display: none; }
  .lbl-title { font-size: 27px; }
  .prose { font-size: 1.1rem; }
  .share { padding: 24px 20px; }
  .share-btn { flex: 1 1 calc(50% - 10px); justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slab, .bar, .leader, .lbl { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
}
.filters a { font-size: 0.85rem; font-weight: 500; color: var(--slate); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; text-decoration: none; }
.filters a:hover { color: var(--midnight); border-color: var(--slate); }
.filters a[aria-current="page"] { background: var(--midnight); border-color: var(--midnight); color: #fff; }
.prose sup { font-family: var(--sans); font-size: 0.65em; line-height: 0; }
.prose sup a { color: var(--mint); text-decoration: none; padding: 0 1px; }
.prose ol.sources { font-family: var(--sans); font-size: 0.92rem; line-height: 1.6; color: var(--slate); padding-left: 1.3em; }
.prose ol.sources li { margin-bottom: 0.4em; scroll-margin-top: 24px; }
.prose ol.sources a { color: var(--mint-dark); }
.prose .also-on { font-family: var(--sans); font-size: 0.95rem; color: var(--slate); }
.prose .also-on a { color: var(--mint-dark); font-weight: 600; }
.prose [id^="ref"] { scroll-margin-top: 24px; }
