/* ===========================================================
   Market University — Design System
   Institutional-grade educational platform (educational only)
   =========================================================== */

:root {
  /* Palette */
  --bg: #0b1020;
  --bg-2: #0f1730;
  --surface: #131c38;
  --surface-2: #18234a;
  --line: #25304f;
  --line-soft: #1d2742;
  --text: #e8edf7;
  --muted: #9aa7c4;
  --faint: #6b779a;
  --brand: #3b82f6;
  --brand-2: #6366f1;
  --gold: #f4b740;
  --emerald: #34d399;
  --rose: #fb7185;
  --grad: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --grad-gold: linear-gradient(135deg, #f4b740, #f59e0b);

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Geometry */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --shadow-sm: 0 4px 18px rgba(0,0,0,.25);
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, #1a2547 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #14224a 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: #93b4fb; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1rem; color: var(--muted); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
section { padding: 64px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 700; color: var(--gold); margin-bottom: .8rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.text-center { text-align: center; }
.center-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- Compliance top banner ---------- */
.compliance-bar {
  background: linear-gradient(90deg, rgba(244,183,64,.16), rgba(251,113,133,.12));
  border-bottom: 1px solid var(--line);
  font-size: .78rem; color: #ffe6b3; text-align: center;
  padding: 7px 14px;
}
.compliance-bar strong { color: #fff; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11,16,32,.82);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; font-size: 1.05rem; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; font-weight: 900; color: #fff; box-shadow: var(--shadow-sm);
}
.brand small { display: block; font-size: .62rem; font-weight: 600; color: var(--gold); letter-spacing: .08em; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--muted); font-weight: 600; font-size: .9rem; padding: 8px 12px; border-radius: 9px;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: var(--surface-2); }
.nav-cta { background: var(--grad); color: #fff !important; padding: 9px 16px !important; }
.nav-cta:hover { filter: brightness(1.08); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: #fff; border-radius: 9px; padding: 7px 11px; font-size: 1.1rem; cursor: pointer; }

@media (max-width: 940px) {
  .nav-toggle { display: block; margin-left: auto; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 10px; gap: 2px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-cta { text-align: center; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem;
  padding: 12px 22px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: .18s; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: #fff; }
.btn-gold { background: var(--grad-gold); color: #2a1a00; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 56px; position: relative; overflow: hidden; }
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.2rem; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; justify-content: center; flex-wrap: wrap; margin-top: 46px; }
.hero-stats .stat { text-align: center; }
.hero-stats .num { font-size: 1.9rem; font-weight: 800; color: #fff; }
.hero-stats .lbl { font-size: .82rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px){ .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px){ .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 24px; transition: .2s; position: relative; overflow: hidden;
}
.card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { color: #fff; }
.card .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.4rem; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.card .tag { font-size: .72rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; }
.card-link { color: var(--brand); font-weight: 700; font-size: .9rem; }

.module-card { display: flex; flex-direction: column; }
.module-card .mod-num { font-family: var(--mono); font-size: .8rem; color: var(--faint); }
.module-card .meta { margin-top: auto; padding-top: 14px; display: flex; gap: 14px; font-size: .8rem; color: var(--faint); }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.badge-edu { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.4); color: var(--emerald); }
.badge-gold { background: rgba(244,183,64,.12); border-color: rgba(244,183,64,.4); color: var(--gold); }

/* ---------- Section header ---------- */
.section-head { margin-bottom: 34px; }
.section-head.center { text-align: center; }
.section-head.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Pills / chips list ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  font-size: .88rem; font-weight: 600; color: var(--text); transition: .15s; }
.chip:hover { border-color: var(--brand); color: #fff; background: var(--surface-2); }

/* ---------- Market ticker ---------- */
.ticker { background: var(--bg-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.ticker-track { display: flex; gap: 40px; white-space: nowrap; padding: 10px 0; animation: scroll 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.ticker-item b { color: #fff; }
.up { color: var(--emerald); } .down { color: var(--rose); }
@keyframes scroll { from { transform: translateX(0);} to { transform: translateX(-50%);} }

/* ---------- Roadmap ---------- */
.roadmap { display: grid; gap: 0; }
.road-step { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px dashed var(--line); }
.road-step:last-child { border-bottom: 0; }
.road-step .n { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; color: var(--gold); }

/* ---------- Tools / calculators ---------- */
.calc { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; }
.calc h3 { color: #fff; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; color: #fff; font-size: .95rem; font-family: var(--font);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.calc-result { margin-top: 16px; background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; }
.calc-result .big { font-size: 1.7rem; font-weight: 800; color: var(--emerald); font-family: var(--mono); }
.calc-result .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: .9rem; border-bottom: 1px solid var(--line-soft); }
.calc-result .row:last-child { border-bottom: 0; }
.calc-result .row span:last-child { color: #fff; font-weight: 700; font-family: var(--mono); }

/* ---------- News ---------- */
.news-item { display: flex; flex-direction: column; gap: 8px; }
.news-item .src { font-size: .76rem; color: var(--faint); display:flex; gap:8px; align-items:center; }
.news-tag { font-size: .7rem; color: var(--gold); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }

/* ---------- Disclaimer block ---------- */
.disclaimer-block {
  background: rgba(251,113,133,.07); border: 1px solid rgba(251,113,133,.3);
  border-radius: var(--radius); padding: 20px 22px; margin: 26px 0;
}
.disclaimer-block h4 { color: #ffb3bd; margin-bottom: 8px; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.disclaimer-block p { color: #ffd5da; font-size: .9rem; margin: 0; }
.disclaimer-inline { font-size: .8rem; color: var(--faint); font-style: italic; }

/* ---------- Article / prose ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.8em; color: #fff; }
.prose h3 { margin-top: 1.4em; color: #fff; }
.prose ul, .prose ol { color: var(--muted); padding-left: 1.3em; }
.prose li { margin: .4em 0; }
.prose code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-family: var(--mono); font-size: .85em; color: var(--gold); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .9rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--surface-2); color: #fff; }

/* ---------- AI assistant ---------- */
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 280px; max-height: 440px; overflow-y: auto; }
.msg { max-width: 80%; padding: 11px 15px; border-radius: 14px; font-size: .92rem; }
.msg.bot { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; color: var(--text); }
.msg.user { background: var(--grad); color: #fff; align-self: flex-end; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; color: #fff; }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
@media (max-width: 800px){ .dash-grid { grid-template-columns: 1fr; } }
.dash-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; height: fit-content; }
.dash-side a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.dash-side a:hover, .dash-side a.active { background: var(--surface-2); color: #fff; }
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 30px; }
@media (max-width: 800px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer a { display: block; color: var(--muted); font-size: .9rem; padding: 4px 0; }
.footer a:hover { color: #fff; }
.footer-disclaimer { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--faint); }
.footer-disclaimer strong { color: #ffd5da; }
.footer-bottom { margin-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--faint); }

/* ---------- Accordion (topic explainers) ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 760px){ .topic-grid { grid-template-columns: 1fr; } }
details.topic {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 0; overflow: hidden; transition: border-color .15s;
}
details.topic[open] { border-color: var(--brand); background: linear-gradient(180deg, var(--surface-2), var(--bg-2)); }
details.topic > summary {
  list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 10px; font-size: .96rem;
}
details.topic > summary::-webkit-details-marker { display: none; }
details.topic > summary::before {
  content: "+"; width: 22px; height: 22px; min-width: 22px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--gold); font-weight: 800; transition: .15s;
}
details.topic[open] > summary::before { content: "\2212"; background: var(--brand); color: #fff; border-color: var(--brand); }
details.topic > summary:hover { color: #fff; }
details.topic .topic-body { padding: 0 18px 16px 50px; }
details.topic .topic-body p { margin: 0 0 8px; font-size: .9rem; color: var(--muted); }
details.topic .topic-body .k { color: var(--gold); font-weight: 600; }
.topic-note { font-size: .78rem; color: var(--faint); font-style: italic; margin-top: 6px; }

/* ---------- Pattern visual (diagram + chart button) ---------- */
.pat-visual { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; flex-wrap: wrap; }
.pat-diagram { width: 150px; min-width: 150px; background: #0f1730; border: 1px solid var(--line-soft); border-radius: 10px; padding: 4px; }
.pat-diagram svg { display: block; width: 100%; height: auto; }
.chart-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-weight: 700; font-size: .85rem; padding: 9px 14px; border-radius: 10px; cursor: pointer; transition: .15s;
}
.chart-btn:hover { border-color: var(--brand); color: #fff; background: #1b2950; }
.chart-btn::before { content: "\25B6"; color: var(--gold); margin-right: 7px; font-size: .8em; }

/* ---------- Modal ---------- */
.mu-modal { position: fixed; inset: 0; z-index: 200; background: rgba(5,8,18,.78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 18px; }
.mu-modal[hidden] { display: none; }
.mu-modal-panel { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  max-width: 740px; width: 100%; box-shadow: var(--shadow); }
.mu-modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mu-modal-head strong { color: #fff; font-size: 1.05rem; }
.mu-modal-x { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px;
  width: 30px; height: 30px; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.mu-modal-x:hover { color: #fff; border-color: var(--brand); }
.mu-modal canvas { width: 100%; height: auto; background: #0f1730; border: 1px solid var(--line-soft); border-radius: 10px; }
.mu-modal-cap { font-size: .9rem; color: var(--muted); margin: 12px 2px 0; min-height: 2.4em; }

/* ---------- Mini calculators (fundamentals) ---------- */
.mini-calc { background: #0f1730; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; margin: 4px 0 10px; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mini-row label { font-size: .82rem; color: var(--muted); }
.mini-row input { width: 110px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: #fff; font-size: .88rem; font-family: var(--mono); }
.mini-row input:focus { outline: none; border-color: var(--brand); }
.mini-out { margin-top: 8px; padding: 9px 11px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; font-family: var(--mono); font-weight: 700; color: var(--emerald); font-size: .95rem; }

/* ---------- News filter active chip ---------- */
.chip.chip-active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Progress checklist (academy) ---------- */
.mod-check { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: .82rem; color: var(--muted); cursor: pointer; user-select: none; }
.mod-check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.progress-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 24px; }
.progress-wrap .flex { gap: 12px; }

/* ---------- Dashboard tab panels ---------- */
.dash-panel { display: none; }
.dash-panel.active { display: block; }

/* ---------- Utilities ---------- */
.mt-0{margin-top:0}.mb-0{margin-bottom:0}.mt-1{margin-top:1rem}.mt-2{margin-top:2rem}
.flex{display:flex}.between{justify-content:space-between}.center{align-items:center}.gap{gap:12px}.wrap{flex-wrap:wrap}
.divider{height:1px;background:var(--line);margin:40px 0;border:0}
.reveal{opacity:0;transform:translateY(16px);transition:.6s}
.reveal.in{opacity:1;transform:none}
