/* ============================================================
   LEDGER — "App" direction shared stylesheet
   ============================================================ */

:root{
  --bg: #fffff8;
  --card: #FFFFFF;
  --ink: #000;
  --ink-dim: #525866;
  --ink-soft:#2B2E36;
  --indigo: #cc0000;
  --indigo-tint: #EEF0FE;
  --gain: #12946A;
  --gain-tint: #E3F7EE;
  --loss: #D6432F;
  --loss-tint: #f0f0e4;
  --rule: rgba(18,21,28,0.08);
  --rule-strong: rgba(18,21,28,0.16);
  --display: 'Literata', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --maxw: 1180px;
  --paper:#ffffff;
  --slate:#5C6470;
  --hairline:#f0f0e4;
  --gold:#cc0000;
  --gold-soft:#cc0000;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--display);
  -webkit-font-smoothing:antialiased;
  font-size: 14px;
  font-weight: 500;
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
/*::selection{ background:var(--indigo); color:#fff; }*/

a:focus-visible, button:focus-visible, input:focus-visible{
  outline:2px solid var(--indigo);
  outline-offset:2px;
}

/* ---------- Reading progress bar ---------- */
.progress{
  position:fixed; top:0; left:0; height:3px; width:0%;
  background:var(--indigo); z-index:100; transition:width 0.1s linear;
}

/* ---------- Ticker ---------- */
.ticker{ background:var(--ink); overflow:hidden; white-space:nowrap; padding:9px 0; }
.ticker__track{ display:inline-flex; gap:28px; padding-left:100%; animation:scroll 34s linear infinite; }
.ticker:hover .ticker__track{ animation-play-state:paused; }
@keyframes scroll{ from{transform:translateX(0);} to{transform:translateX(-100%);} }
.tick{ font-family:var(--mono); font-size:11.5px; color:#C9CDD6; }
.tick b{ color:#fff; font-weight:500; margin-right:6px; }
.tick.up{ color:#6EE7B7; } .tick.down{ color:#FCA5A5; }

/* ---------- Masthead / Nav ---------- */
.masthead{
  max-width:var(--maxw); margin:0 auto; padding:20px 20px 10px;
  display:flex; align-items:center; justify-content:space-between;
}
.masthead__mark{ font-size:24px; font-weight:700; display:flex; align-items:center; gap:8px; }
.masthead__mark .dot{ width:10px; height:10px; border-radius:50%; background:var(--indigo); display:inline-block; }
.masthead__meta{ /*font-family:var(--mono);*/ font-size:12px; text-align:right; line-height:1.6; font-weight: bold; border: solid 1px #E2E6EC; padding: 5px 15px 7px 15px; border-radius: 20px;}

nav.masthead__nav{
  max-width:var(--maxw); margin:0 auto; padding:10px 20px 10px;
  display:flex; align-items:center; position: sticky;top: 0; z-index: 999; background:var(--bg); overflow: hidden;
}
.nav__links{
  display:flex; gap:8px; overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
  scrollbar-width: none;             /* hide scrollbar on Firefox */
}

nav.masthead__nav a{
  font-size:13px; font-weight:600; padding:5px 15px 7px 15px; border-radius:20px;
  color:var(--ink-dim); /*transition:background .15s ease, color .15s ease;*/ border: 1px solid #f0f0e4;
}
nav.masthead__nav a.is-active, nav.masthead__nav a:hover{
  background-color: var(--loss-tint); color:var(--ink); /*box-shadow:0 1px 2px rgba(18,21,28,0.06);*/ font-weight: 600;
}

.nav__toggle{
  display:none; margin-left:auto; background:var(--card);
  border:1px solid var(--rule-strong); border-radius:20px; color:var(--ink);
  font-family:var(--display); font-weight:500; font-size:12px; padding:8px 14px; cursor:pointer;
}

/* ---------- Layout ---------- */
main{ max-width:var(--maxw); margin:0 auto; padding:0 20px; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:0 40px; }

/* ---------- Hero (home) ---------- */
.hero{ background:var(--card); border-radius:20px; padding:32px; box-shadow:0 1px 2px rgba(18,21,28,0.04); }
.hero__eyebrow{
  display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600;
  color:var(--indigo); background:var(--indigo-tint); padding:5px 12px; border-radius:20px; margin-bottom:16px;
}
.hero h1{ font-size:32px; line-height:1.2; font-weight:700; margin:0 0 14px; letter-spacing:-0.01em; }
.hero p.dek{ font-size:15px; line-height:1.6; color:var(--ink-dim); max-width:56ch; margin:0 0 22px; }
.hero__stat-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.stat{ background:var(--loss-tint); border-radius:14px; padding:14px 16px; text-align: center;}
.stat__label{ font-size:11px; color:var(--ink-dim); display:block; margin-bottom:4px; font-weight:500; }
.stat__value{ font-family:var(--mono); font-size:15px; font-weight:500; }
.stat__value.up{ color:var(--gain); } .stat__value.down{ color:var(--loss); }

.hero__figure{ margin-top:20px; background:var(--bg); border-radius:14px; padding:16px 18px 12px; }
.hero__figure svg{ display:block; width:100%; height:110px; }
.hero__figure figcaption{ font-family:var(--mono); font-size:10.5px; color:var(--ink-dim); margin-top:8px; display:flex; justify-content:space-between; }

/* ---------- Sidebar rows ---------- */
.rail__label{ font-family:var(--mono); font-size:11px; letter-spacing:0.05em; text-transform:uppercase; color:var(--ink-dim); margin:0 0 10px 4px; }
aside{ display:flex; flex-direction:column; gap:12px; }
.row{
  background:var(--card); border-radius:16px; padding:16px 18px;
  box-shadow:0 1px 2px rgba(18,21,28,0.04); display:flex; justify-content:space-between; gap:10px; align-items:flex-start;
}
.row a{ display:block; color:inherit; text-decoration:none; flex:1; }
.row__ticker{ /*font-family:var(--mono);*/ font-size:12px; color:var(--indigo); font-weight:600; margin-bottom:8px; display:block; }
.row h3{ font-size:14.5px; font-weight:600; line-height:1.35; margin:0 0 4px; }
.row:hover h3{ color:var(--indigo); }
.row p{ font-size:12px; color:var(--ink-dim); margin:0; font-family:var(--mono); }
.row__date{ /*font-family:var(--mono);*/ font-size:12px; color:var(--ink-dim); margin-top:10px; display:block;}
.row__spark svg{ width:60px; height:28px; }
.row__delta{
  font-family:var(--mono); font-size:12px; font-weight:600; white-space:nowrap;
  padding:4px 8px; border-radius:8px; display:inline-block; margin-top:4px;
}
.row__delta.up{ color:var(--gain); background:var(--gain-tint); }
.row__delta.down{ color:var(--loss); background:var(--loss-tint); }
.row__delta:not(.up):not(.down){ color:var(--ink-dim); background:var(--bg); }

/* ---------- Card grid ---------- */
.section{ max-width:var(--maxw); margin:0 auto; padding:20px 28px 60px; }
.section__head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:20px; }
.section__head h2{ font-size:22px; font-weight:700; margin:0; }
.section__head a{ font-family:var(--mono); font-size:11.5px; color:var(--ink-dim); }
.cards{ display:grid; grid-template-columns:repeat(3,1fr); gap:0 40px; }
.card{
  /*background:var(--card);*/ border-radius:18px; /*padding:22px*/;
  /*box-shadow:0 1px 2px rgba(18,21,28,0.04);*/ display:block; color:inherit; text-decoration:none;
}
.card__eyebrow{ font-size:11px; font-weight:600; color:var(--ink-dim); text-transform:uppercase; letter-spacing:0.03em; margin-bottom:10px; }
.card h2{ font-size:22px; font-weight:700; margin:0 0 10px; /*line-height:1.4;*/ }
.card h3{ font-size:16px; font-weight:700; margin:0 0 10px; /*line-height:1.4;*/ }
.card a:hover h3{ color:var(--indigo); }
.card p{ font-size:13px; color:var(--ink-dim); margin:0 0 14px; }
.card__foot{ display:flex; justify-content:space-between; font-family:var(--mono); font-size:11px; color:var(--ink-dim); border-top:1px solid var(--rule); padding-top:12px; }
.card img {border-radius: 18px; margin: 12px 0px; height: 220px; width: 100%; object-fit: cover;}
.card p{margin: 0;}

/* ---------- Article page ---------- */
.article__header{ max-width:760px; margin:0 auto; padding:32px 28px 0; }
.article__header h1{ font-size:38px; line-height:1.15; font-weight:700; margin:0 0 16px; letter-spacing:-0.01em; }
.article__dek{ font-size:17px; line-height:1.6; color:var(--ink-dim); margin:0 0 22px; }
.article__byline{
  display:flex; flex-wrap:wrap; gap:8px; margin-bottom:28px;
}
.article__byline span{
  font-family:var(--mono); font-size:11px; color:var(--ink-dim);
  background:var(--card); border-radius:20px; padding:6px 12px; box-shadow:0 1px 2px rgba(18,21,28,0.04);
}
.article__byline b{ color:var(--ink); font-weight:600; }

.article__stat-row{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom:32px; }
.article__stat-row .stat{ flex:1; min-width:140px; }

.article__photo{ max-width:900px; margin:0 auto 32px; padding:0 28px; }
.article__photo img{ width:100%; height:auto; display:block; border-radius:18px; }
.article__photo-placeholder{
  width:100%; aspect-ratio:16/9; background:repeating-linear-gradient(45deg, var(--card), var(--card) 12px, var(--bg) 12px, var(--bg) 24px);
  border-radius:18px; border:1px dashed var(--rule-strong);
  display:flex; align-items:center; justify-content:center; text-align:center; padding:24px;
}
.article__photo-placeholder span{ font-family:var(--mono); font-size:12px; color:var(--ink-dim); max-width:40ch; }
.article__photo figcaption{ font-family:var(--mono); font-size:11px; color:var(--ink-dim); margin-top:8px; }
.article__photo figcaption a{ color:var(--ink-dim); text-decoration:underline; text-underline-offset:2px; }
.article__photo figcaption a:hover{ color:var(--indigo); }

.article__figure{ max-width:900px; margin:0 auto 40px; padding:0 28px; }
.article__figure .frame{ background:var(--card); border-radius:18px; padding:20px 22px 16px; box-shadow:0 1px 2px rgba(18,21,28,0.04); }
.article__figure svg{ width:100%; height:170px; display:block; }
.article__figure figcaption{ font-family:var(--mono); font-size:10.5px; color:var(--ink-dim); margin-top:10px; display:flex; justify-content:space-between; }

.article__body{ max-width:700px; margin:0 auto; padding:0 28px 60px; font-size:17px; line-height:1.75; }
.article__body p{ margin:0 0 22px; }
.article__body h2{ font-size:24px; font-weight:700; margin:44px 0 18px; letter-spacing:-0.005em; }
.article__body blockquote{
  font-size:20px; line-height:1.5; font-weight:600; color:var(--indigo);
  background:var(--indigo-tint); border-radius:16px; margin:32px 0; padding:20px 24px;
}
.article__body .cite{ font-family:var(--mono); font-size:12px; color:var(--ink-dim); font-weight:400; display:block; margin-top:10px; }

.data-table-wrap{ background:var(--card); border-radius:16px; padding:8px; box-shadow:0 1px 2px rgba(18,21,28,0.04); margin:8px 0 32px; overflow:hidden; }
.data-table{ width:100%; border-collapse:collapse; font-family:var(--mono); font-size:13px; }
.data-table th, .data-table td{ padding:12px 14px; text-align:right; }
.data-table th:first-child, .data-table td:first-child{ text-align:left; }
.data-table thead th{ color:var(--ink-dim); font-weight:500; text-transform:uppercase; font-size:10.5px; letter-spacing:0.05em; }
.data-table tbody tr{ border-top:1px solid var(--rule); }
.data-table td.up{ color:var(--gain); } .data-table td.down{ color:var(--loss); }

.sources-box{ max-width:700px; margin:0 auto 60px; padding:22px 24px; background:var(--card); border-radius:18px; box-shadow:0 1px 2px rgba(18,21,28,0.04); }
.sources-box h4{ font-family:var(--mono); font-size:11px; letter-spacing:0.05em; text-transform:uppercase; color:var(--ink-dim); margin:0 0 14px; }
.sources-box ul{ margin:0; padding:0; list-style:none; }
.sources-box li{ font-family:var(--mono); font-size:12.5px; padding:10px 0; border-bottom:1px solid var(--rule); display:flex; justify-content:space-between; }
.sources-box li:last-child{ border-bottom:none; }
.sources-box .note{ font-family:var(--display); font-size:13px; color:var(--ink-dim); line-height:1.6; margin-top:14px; }

/* ---------- About page ---------- */
.about-hero{ max-width:800px; margin:0 auto; padding:44px 28px 24px; }
.about-hero h1{ font-size:38px; font-weight:700; line-height:1.18; margin:0 0 20px; letter-spacing:-0.01em; }
.about-hero p{ font-size:16px; line-height:1.7; color:var(--ink-dim); max-width:62ch; }

.steps{ max-width:800px; margin:0 auto; padding:16px 28px 50px; display:flex; flex-direction:column; gap:12px; }
.step{
  display:grid; grid-template-columns:44px 1fr; gap:16px; align-items:flex-start;
  background:var(--card); border-radius:16px; padding:20px; box-shadow:0 1px 2px rgba(18,21,28,0.04);
}
.step__num{
  width:32px; height:32px; border-radius:50%; background:var(--indigo-tint); color:var(--indigo);
  font-family:var(--mono); font-size:12px; font-weight:600; display:flex; align-items:center; justify-content:center;
}
.step h3{ font-size:16px; font-weight:700; margin:0 0 6px; }
.step p{ font-size:13.5px; line-height:1.6; color:var(--ink-dim); margin:0; }

.values{ max-width:var(--maxw); margin:0 auto; padding:0 28px 50px; display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.value{ background:var(--card); border-radius:18px; padding:24px; box-shadow:0 1px 2px rgba(18,21,28,0.04); }
.value h3{ font-size:15px; font-weight:700; margin:0 0 10px; color:var(--indigo); }
.value p{ font-size:13px; line-height:1.6; color:var(--ink-dim); margin:0; }

.disclaimer{font-size: 12px; margin-top:15px; color: #888; line-height: 1.4em;}
.disclaimer .box{ background:var(--card); border-radius:18px; padding:24px 26px; font-size:13px; line-height:1.7; color:var(--ink-dim); box-shadow:0 1px 2px rgba(18,21,28,0.04); }
.disclaimer .box p{ margin:0 0 16px; }
.disclaimer .box p:last-child{ margin-bottom:0; }
.disclaimer .box b{ color:var(--ink); }

/* ---------- Footer ---------- */
footer{
  max-width:var(--maxw); margin:0 auto; padding:26px 20px;
  /*font-family:var(--mono);*/ font-size:13px; color:var(--ink-dim);
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px){
  .grid-2{ grid-template-columns:1fr; }
  .cards{ grid-template-columns:1fr; }
  .values{ grid-template-columns:1fr; }
  .hero h1{ font-size:26px; }
  .hero__stat-row{ grid-template-columns:repeat(2,1fr); }
  .article__header h1{ font-size:28px; }
  .masthead{ flex-wrap:wrap; gap:10px; }
  .nav__toggle{ display:inline-block; }
  /*
  nav.masthead__nav{ flex-wrap:wrap; }
  .nav__links{ display:none; flex-direction:column; align-items:flex-start; gap:8px; width:100%; padding-top:10px; }
  .nav__links.is-open{ display:flex; }
  */
  .article-title{font-size: 25px !important;}
}

@media (prefers-reduced-motion: reduce){
  .ticker__track{ animation:none; }
  html{ scroll-behavior:auto; }
}

/* ---------- Custom Styles ---------- */
p,li{line-height: 1.6em;}
hr{height: 1px; border: none; background-color: #ddd; margin: 22px 0;}
a:hover{ color:var(--indigo); }
.border{border:1px solid var(--hairline);background:var(--bg); padding: 15px;}
.display-inlin-block{display: inline-block; width: 100%;}

.contactform input, textarea {width: 100%; background-color:var(--loss-tint); padding: 12px; border: 0; margin-bottom: 10px; font-family: inherit; font-size: inherit;}
input[type="submit"]{background-color: #000; color: #fff; font-weight: bold; padding: 12px 22px; border: 0; cursor: pointer;}
input[type="submit"]:hover{background-color: var(--indigo);}

.title-with-line-right{display:flex; align-items:center; font-size: 20px;font-weight: bold; margin-bottom: 25px;}
.title-with-line-right::after {content: "";flex: 1;height: 1px;background: currentColor;opacity: 0.5;margin-left: 15px;}

.one-line-limit {display: -webkit-box; -webkit-line-clamp: 1; /* Change this number to limit to more/fewer lines */ -webkit-box-orient: vertical; overflow: hidden;}
.two-line-limit {display: -webkit-box; -webkit-line-clamp: 2; /* Change this number to limit to more/fewer lines */ -webkit-box-orient: vertical; overflow: hidden;}
.three-line-limit {display: -webkit-box; -webkit-line-clamp: 3; /* Change this number to limit to more/fewer lines */ -webkit-box-orient: vertical; overflow: hidden;}
.four-line-limit {display: -webkit-box; -webkit-line-clamp: 4; /* Change this number to limit to more/fewer lines */ -webkit-box-orient: vertical; overflow: hidden;}

.article{max-width: 760px;margin: 0 auto; margin-bottom: 30px; text-align: left;}
.article img{border-radius: 18px;}
.article-title{font-size: 28px; line-height: 1.3em; font-weight: 900; margin: 0;}
.article-txt{line-height: 1.6em;}
.article-txt{font-size: 15px;}
.article-txt h5{font-size: 1.25em; margin: 35px 0 15px 0;}
  
  .newsletter{
    display:grid;
    grid-template-columns:1fr 1.2fr;
    border:1px solid var(--hairline);
    background:#f0f0e4;
    overflow:hidden;
    margin: 30px 0;
  }
  .newsletter__image{
    background:var(--hairline);
    overflow:hidden;
    min-height:280px;
  }
  .newsletter__image img{
    width:100%; height:350px; object-fit:cover; display:block;
  }
  .newsletter__body{
    padding:44px 48px;
    display:flex;
    flex-direction:column;
    justify-content:center;
  }
  .newsletter__eyebrow{
    display:inline-flex; align-items:center; gap:8px;
    font-size:12.5px; color:var(--gold); font-weight:600;
    text-transform:uppercase; letter-spacing:0.05em;
    margin-bottom:14px;
  }
  .newsletter__eyebrow::before{
    content:""; width:16px; height:1px; background:var(--gold);
  }
  .newsletter__title{
    font-size:26px; font-weight:800;
    line-height:1.25; margin:0 0 10px; color:var(--ink);
  }
  .newsletter__desc{
    font-size:14px; color:var(--slate); line-height:1.55;
    margin:0 0 24px; max-width:44ch;
  }
  .newsletter__form{
    display:flex; gap:0; max-width:420px;
  }
  .newsletter__input{
    flex:1; padding:13px 16px; border:1px solid var(--hairline);
    border-right:none; font-size:14px;
    background:var(--paper); color:var(--ink);
  }
  .newsletter__input:focus{
    outline:none; border-color:var(--gold);
  }
  .newsletter__submit{
    padding:13px 22px; background:var(--ink); color:#fff;
    border:1px solid var(--ink); font-size:14px; font-weight:600;
    font-family:var(--sans); cursor:pointer; white-space:nowrap;
  }
  .newsletter__submit:hover{ background:var(--gold); border-color:var(--gold); }
  .newsletter__fine{
    font-size:14px; color:var(--slate); margin-top:12px;
  }

  @media(max-width:760px){
    .newsletter{ grid-template-columns:1fr; }
    .newsletter__image{ min-height:180px; order:-1; }
    .newsletter__body{ padding:32px 24px; }
    .newsletter__form{ flex-direction:column; max-width:100%; }
    .newsletter__input{ border-right:1px solid var(--hairline); border-bottom:none; }
    .newsletter__submit{ border-left:1px solid var(--ink); }
  }
