/* ═══════════════════════════════════════════════════
   MarketsEdge — reference pages

   One external stylesheet shared by every generated page, so a reader
   moving between them downloads it once. The application inlines its CSS
   because it is a single page; these are sixty-nine.

   Reading pages, unlike the dashboard, are set for long-form text:
   a measure of about 70 characters, generous line height, and a type
   scale with real steps between levels.
   ═══════════════════════════════════════════════════ */

:root{
  --bg:#050a14; --surface:#0c1322; --surface2:#111a2c; --well:#070d18;
  --border:#1b263d; --border2:#141d2f;
  --text:#d4dcea; --text2:#9fb0c8; --muted:#6b7f9c; --dim:#415872;
  --gold:#e8c97a; --gold2:#b8976a; --gold3:#7a6040;
  --green:#00c896; --red:#ff4e6a; --blue:#4f9fff;
  --measure:72ch;
}
*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background:
    radial-gradient(1100px 480px at 20% -6%, rgba(232,201,122,.05), transparent 62%),
    radial-gradient(800px 420px at 85% 2%, rgba(79,159,255,.04), transparent 58%),
    linear-gradient(180deg,#060c18 0%, var(--bg) 46%, #04080f 100%);
  background-attachment:fixed;
  color:var(--text);
  font-family:'IBM Plex Sans',-apple-system,BlinkMacSystemFont,Arial,sans-serif;
  font-size:17px; line-height:1.72; -webkit-font-smoothing:antialiased;
}

/* ── Header ── */
header.site{
  display:flex; align-items:center; gap:22px; flex-wrap:wrap;
  padding:16px 28px;
  background:linear-gradient(180deg,#0a1322,#070e1b);
  border-bottom:1px solid var(--border);
  box-shadow:0 1px 0 rgba(232,201,122,.10);
}
.brand{display:flex; align-items:center; gap:11px; text-decoration:none;}
.mark{width:34px; height:34px; flex-shrink:0;}
.wordmark{font-family:'Playfair Display',Georgia,serif; font-size:21px; line-height:1;}
.wordmark b{color:#fff; font-weight:700;}
.wordmark i{color:var(--gold); font-style:normal;}
.site-nav{display:flex; gap:20px; flex-wrap:wrap; margin-left:auto; align-items:center;}
.site-nav a{
  color:var(--text2); text-decoration:none; font-size:14.5px;
  border-bottom:1px solid transparent; padding-bottom:2px;
}
.site-nav a:hover{color:var(--gold); border-bottom-color:rgba(184,151,106,.45);}
.site-nav a.app{
  color:var(--gold); border:1px solid rgba(196,160,85,.4); border-radius:8px;
  padding:6px 13px; font-size:13.5px;
}
.site-nav a.app:hover{background:rgba(26,20,8,.7);}

/* ── Layout ── */
main{max-width:860px; margin:0 auto; padding:34px 28px 60px;}
.crumb{font-size:13px; color:var(--dim); margin-bottom:20px;}
.crumb a{color:var(--muted); text-decoration:none;}
.crumb a:hover{color:var(--gold2);}
.kicker{
  font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:1.9px;
  text-transform:uppercase; color:var(--gold3); margin-bottom:10px;
}

/* ── Type scale ──
   Real steps between levels, so a reader can see the structure without
   reading it. */
h1{
  font-family:'Playfair Display',Georgia,serif; font-weight:700;
  font-size:clamp(30px,5vw,44px); line-height:1.15; color:#fff;
  margin-bottom:20px; letter-spacing:-.4px;
}
h2{
  font-size:21px; font-weight:600; color:var(--gold); margin:36px 0 12px;
  padding-bottom:7px; border-bottom:1px solid var(--border2);
  max-width:var(--measure);
}
h2 .count{
  font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--dim);
  margin-left:8px; font-weight:400;
}
p{max-width:var(--measure); margin-bottom:15px; color:var(--text2);}

/* ── The answer ──
   First thing after the heading, set larger than body text. This is the
   sentence a reader skims for and the one an answer engine quotes. */
.answer{
  font-size:19.5px; line-height:1.68; color:var(--text);
  border-left:3px solid var(--gold2); padding:4px 0 4px 20px;
  margin:4px 0 28px; max-width:var(--measure);
}

/* ── Chart figure ── */
figure.chart{
  background:var(--well); border:1px solid var(--border); border-radius:12px;
  padding:18px; margin:26px 0;
  box-shadow:0 1px 0 rgba(255,255,255,.035) inset, 0 12px 30px -16px rgba(0,0,0,.85);
}
figure.chart svg{width:100%; height:auto; display:block;}
figcaption{
  font-size:12.5px; color:var(--dim); margin-top:12px; font-style:italic;
  line-height:1.6;
}

/* ── Fact list ── */
dl.facts{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px;
  margin:22px 0 30px;
}
dl.facts > div{
  background:var(--surface); border:1px solid var(--border); border-radius:10px;
  padding:13px 16px;
  box-shadow:0 1px 0 rgba(255,255,255,.03) inset;
}
dl.facts dt{
  font-family:'IBM Plex Mono',monospace; font-size:9.5px; letter-spacing:1.4px;
  text-transform:uppercase; color:var(--muted); margin-bottom:5px;
}
dl.facts dd{font-size:15px; color:#e8eef8;}

/* ── Emphasis blocks ── */
.caveat{color:var(--muted);}
aside.note{
  background:var(--surface); border:1px solid var(--border);
  border-left:3px solid var(--gold3); border-radius:0 11px 11px 0;
  padding:16px 20px; margin:26px 0;
  box-shadow:0 1px 0 rgba(255,255,255,.03) inset;
}
aside.note p{margin:0; font-size:15px; color:var(--muted);}
.ready{
  background:rgba(0,200,150,.05); border:1px solid rgba(0,200,150,.22);
  border-radius:10px; padding:14px 18px; color:var(--text);
}

/* ── Lists ── */
ul.plain-list{list-style:none; max-width:var(--measure); margin-bottom:18px;}
ul.plain-list li{
  padding:8px 0 8px 20px; position:relative; color:var(--text2);
  border-bottom:1px solid var(--border2);
}
ul.plain-list li:last-child{border-bottom:none;}
ul.plain-list li::before{
  content:'';
  position:absolute; left:2px; top:17px;
  width:5px; height:5px; border-radius:50%; background:var(--gold3);
}
ul.plain-list .muted{color:var(--dim); font-size:13px;}

/* ── Card grids ── */
ul.cards{list-style:none; display:grid; gap:12px; margin:18px 0 30px;
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));}
ul.cards.plain{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));}
ul.cards a{
  display:block; height:100%; text-decoration:none;
  background:var(--surface); border:1px solid var(--border); border-radius:11px;
  padding:16px 18px; transition:transform .14s, border-color .14s, box-shadow .14s;
  box-shadow:0 1px 0 rgba(255,255,255,.03) inset;
}
ul.cards a:hover{
  transform:translateY(-2px); border-color:rgba(196,160,85,.4);
  box-shadow:0 1px 0 rgba(255,255,255,.06) inset, 0 16px 32px -18px rgba(0,0,0,.9);
}
.thumb{display:block; background:var(--well); border:1px solid var(--border2);
  border-radius:8px; padding:6px; margin-bottom:12px;}
.thumb svg{width:100%; height:auto; display:block;}
ul.cards .t{display:block; font-size:16.5px; font-weight:600; color:#e8eef8;}
ul.cards .b{
  display:inline-block; font-family:'IBM Plex Mono',monospace; font-size:9px;
  letter-spacing:1.2px; text-transform:uppercase; border:1px solid currentColor;
  border-radius:7px; padding:2px 8px; margin:7px 0 8px; opacity:.85;
}
ul.cards .b.bullish{color:var(--green);} ul.cards .b.bearish{color:var(--red);}
ul.cards .b.indecision{color:var(--text2);} ul.cards .b.continuation{color:var(--gold2);}
ul.cards .meta{display:block; font-family:'IBM Plex Mono',monospace; font-size:11px;
  color:var(--dim); margin:5px 0 8px;}
ul.cards .d{display:block; font-size:13.5px; color:var(--muted); line-height:1.6;}

/* ── Stage list ── */
ol.stages{list-style:none; counter-reset:stage; margin:20px 0 32px;}
ol.stages li{counter-increment:stage; margin-bottom:11px;}
ol.stages a{
  display:block; text-decoration:none; position:relative;
  background:var(--surface); border:1px solid var(--border); border-radius:11px;
  padding:18px 22px 18px 66px; transition:border-color .14s, transform .14s;
  box-shadow:0 1px 0 rgba(255,255,255,.03) inset;
}
ol.stages a::before{
  content:counter(stage);
  position:absolute; left:20px; top:19px;
  width:30px; height:30px; border-radius:50%;
  background:#1a1408; border:1px solid rgba(196,160,85,.4); color:var(--gold);
  font-family:'IBM Plex Mono',monospace; font-size:14px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}
ol.stages a:hover{border-color:rgba(196,160,85,.4); transform:translateY(-2px);}
ol.stages .lvl{font-family:'IBM Plex Mono',monospace; font-size:9.5px; letter-spacing:1.5px;
  text-transform:uppercase; color:var(--gold3); display:block;}
ol.stages .t{display:inline-block; font-size:19px; font-weight:600; color:#fff; margin:2px 0;}
ol.stages .time{font-size:12.5px; color:var(--dim); font-style:italic; margin-left:10px;}
ol.stages .d{display:block; font-size:14.5px; color:var(--muted); margin-top:4px;}

/* ── Related ── */
ul.related{list-style:none; display:grid; gap:7px; margin:16px 0 28px;
  grid-template-columns:repeat(auto-fill,minmax(200px,1fr));}
ul.related li{background:var(--surface); border:1px solid var(--border);
  border-radius:9px; padding:11px 14px; display:flex; justify-content:space-between;
  align-items:center; gap:10px;}
ul.related a{color:var(--text); text-decoration:none; font-size:14.5px;}
ul.related a:hover{color:var(--gold);}
ul.related span{font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--dim);}

/* ── Tables ── */
table{width:100%; border-collapse:collapse; margin:18px 0 10px; font-size:15px;}
thead th{
  text-align:left; font-family:'IBM Plex Mono',monospace; font-size:10px;
  letter-spacing:1.3px; text-transform:uppercase; color:var(--muted);
  padding:11px 14px; background:linear-gradient(180deg,#0b1322,#080f1c);
  border-bottom:1px solid rgba(184,151,106,.22);
}
tbody td{padding:12px 14px; border-bottom:1px solid var(--border2); color:var(--text2);}
tbody tr:nth-child(even){background:rgba(255,255,255,.012);}
tbody td b{color:#e8eef8;}

/* ── Navigation between pages ── */
nav.prevnext{display:flex; justify-content:space-between; gap:14px; margin:36px 0 10px;
  flex-wrap:wrap;}
nav.prevnext a{
  color:var(--text2); text-decoration:none; font-size:15px;
  background:var(--surface); border:1px solid var(--border); border-radius:9px;
  padding:11px 17px;
}
nav.prevnext a:hover{border-color:rgba(196,160,85,.4); color:var(--gold);}

.cta{margin:32px 0 8px;}
.cta a{
  display:inline-block; color:var(--gold); text-decoration:none; font-size:15.5px;
  background:#1a1408; border:1px solid rgba(196,160,85,.4); border-radius:9px;
  padding:12px 20px;
}
.cta a:hover{background:#231a09;}
.updated{font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--dim);
  margin-top:34px; padding-top:14px; border-top:1px solid var(--border2);}

/* ── Footer ── */
footer.site{
  border-top:1px solid var(--border); margin-top:40px;
  padding:26px 28px 40px; background:rgba(7,13,24,.6);
}
footer.site p{max-width:760px; margin:0 auto 10px; font-size:13.5px; color:var(--muted);}
footer.site p.warn{color:var(--dim); font-size:12.5px;}
footer.site .links a{color:var(--gold3); text-decoration:none;}
footer.site .links a:hover{color:var(--gold);}

@media(max-width:640px){
  body{font-size:16px;}
  main{padding:24px 18px 48px;}
  header.site{padding:13px 18px; gap:14px;}
  .site-nav{gap:14px; width:100%; margin-left:0;}
  .answer{font-size:17.5px; padding-left:15px;}
  ul.cards{grid-template-columns:1fr;}
  ol.stages a{padding:16px 18px 16px 58px;}
}
