/* The Trading Manual, web edition (/course/ and /members/). Same palette and type as styles.css. */
:root {
  --bg: #050b1c; --panel: #0b1631; --panel-2: #071026; --panel-hi: #112352; --line: #1a2c58;
  --ink: #e8eefc; --ink-dim: #8c9cc6; --accent: #1e8bff; --accent-soft: rgba(30,139,255,.14);
  --green: #3ddc97; --amber: #f0b23e;
  --brand: 'Michroma', 'Space Grotesk', sans-serif; --disp: 'Space Grotesk', sans-serif;
  --body: 'Inter', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  font-family: var(--body); font-size: 16px; line-height: 1.7; color: var(--ink); min-height: 100vh;
  display: flex; flex-direction: column;
  background: radial-gradient(1100px 520px at 80% -10%, rgba(20,90,220,.26), transparent 65%), var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* top bar */
.c-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px; background: rgba(5,11,28,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.c-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.c-brand img { width: 40px; height: auto; }
.c-brand span { font-family: var(--brand); font-size: 13px; letter-spacing: .12em; }
.c-user { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--ink-dim); }
.c-user a { color: var(--ink-dim); text-decoration: none; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.c-user a:hover { color: var(--ink); border-color: var(--accent); }
.c-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 24px 64px; flex: 1; }
.c-foot { text-align: center; font-size: 13px; color: var(--ink-dim); padding: 24px; border-top: 1px solid var(--line); }

/* course map */
.kicker { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.c-hero h1, .lesson h1 { font-family: var(--disp); font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin: 8px 0 12px; }
.subtitle { color: var(--ink-dim); font-size: 18px; max-width: 680px; }
.c-progress { display: flex; align-items: center; gap: 14px; margin-top: 24px; font-size: 14px; color: var(--ink-dim); }
.c-progress .bar { width: 220px; height: 8px; border-radius: 99px; background: var(--panel-hi); overflow: hidden; }
.c-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width .4s; }
.c-locked-note { margin-top: 20px; padding: 14px 18px; border-radius: 12px; border: 1px solid rgba(240,178,62,.4);
  background: rgba(240,178,62,.08); color: var(--ink); max-width: 680px; }
/* Module cards: every card has the same 5 parts (header, line, rule, first 6 lessons, "show all"), and on wide
   screens the cards in a row share row heights (subgrid), so titles, rules and lesson lists line up. No inner
   scrollbars: longer modules expand with "Show all N lessons". */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 36px; }
.mod { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px;
  display: grid; grid-template-rows: subgrid; grid-row: span 5; row-gap: 0; align-content: start; transition: border-color .2s; }
.mod:hover { border-color: rgba(30,139,255,.45); }
@supports not (grid-template-rows: subgrid) { .mod { display: flex; flex-direction: column; } }
.mod header { margin-bottom: 10px; }
.mod-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.mod-k { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.mod h2 { font-family: var(--disp); font-size: 21px; line-height: 1.25; }
.mod-n { font-size: 13px; color: var(--ink-dim); white-space: nowrap; }
.mod-blurb { font-size: 15px; color: var(--ink-dim); margin-bottom: 12px; }
.mod-gate, .mod-lock { align-self: start; font: 500 12.5px/1.45 var(--mono); color: var(--green); margin-bottom: 14px; }
.mod.gated .mod-gate, .mod-lock { color: var(--amber); }
.mod-lock { visibility: hidden; }
.mod.locked .mod-lock { visibility: visible; }
.mod.unlocked .mod-lock { visibility: visible; color: var(--green); }
.ls { list-style: none; align-self: start; }
.ls li { border-top: 1px solid var(--line); }
.ls li:first-child { border-top: 0; }
.ls li > a, .ls li > .row { display: grid; grid-template-columns: 44px 1fr auto; align-items: baseline; gap: 6px;
  padding: 9px 4px; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.35; border-radius: 8px; }
.ls li > a:hover { background: var(--panel-hi); }
.ls li > a.done::after { content: "\2713"; color: var(--green); }
.ln { font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); }
.js-clamp .mod:not(.open) .ls li:nth-child(n+7) { display: none; }
/* while a card is expanded, the other cards fit their own content instead of stretching to its height */
.mods.has-open .mod:not(.open) { display: flex; flex-direction: column; align-self: start; }
.more { align-self: end; margin-top: 6px; }
button.more { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; cursor: pointer;
  font: 600 14px var(--body); color: var(--accent); background: transparent; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
button.more::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.mod.open button.more::after { transform: rotate(-135deg) translate(-2px, 0); }
button.more:hover { border-color: var(--accent); }
html:not(.js-clamp) button.more { display: none; }
.more .when-open, .mod.open .more .when-closed { display: none; }
.mod.open .more .when-open { display: inline; }
.mod.locked .ls { opacity: .45; pointer-events: none; }
.mod-quiz { align-self: end; justify-self: start; margin-top: 14px; font-size: 14px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; }
.mod-quiz:hover { border-color: var(--accent); }

/* lesson page */
.lesson-page { max-width: 820px; }
.crumb { display: inline-block; font-size: 14px; color: var(--ink-dim); text-decoration: none; margin-bottom: 20px; }
.crumb::before { content: "\2190  "; }
.crumb:hover { color: var(--ink); }
.deck { position: relative; margin: 28px auto 8px; max-width: 520px; }
.deck-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 14px; border: 1px solid var(--line);
  scrollbar-width: none; background: var(--panel-2); }
.deck-track::-webkit-scrollbar { display: none; }
.deck-track img { flex: 0 0 100%; scroll-snap-align: center; width: 100%; aspect-ratio: 4 / 5; object-fit: contain; }
.deck-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(5,11,28,.8); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.deck-btn.prev { left: -56px; } .deck-btn.next { right: -56px; }
.deck-btn:hover { border-color: var(--accent); }
.deck-btn:disabled { opacity: .3; cursor: default; }
.deck-count { text-align: center; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); margin-top: 10px; }
.prose { margin-top: 32px; font-size: 17px; }
.prose h2 { font-family: var(--disp); font-size: 25px; line-height: 1.25; margin: 40px 0 12px; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote, .prose figure { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: #fff; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink-dim); font-weight: 600; background: var(--panel-2); }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; }
.prose blockquote p:last-child { margin: 0; }
.prose figure img { border-radius: 12px; border: 1px solid var(--line); }
.prose figcaption { font-size: 14px; color: var(--ink-dim); margin-top: 8px; }
.prose .box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 6px; margin: 28px 0; }
.prose .box h2 { margin-top: 0; font-size: 19px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); color: var(--accent); }
.prose .box.task h2 { color: var(--green); }
.prose .box.check h2 { color: var(--amber); }
.credit { font-size: 14px; color: var(--ink-dim); font-style: italic; margin-top: 24px; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.done-btn, .quiz-link { font: 600 15px var(--body); padding: 11px 20px; border-radius: 999px; cursor: pointer; text-decoration: none; }
.done-btn { border: 0; background: var(--accent); color: #fff; }
.done-btn.is-done { background: rgba(61,220,151,.15); color: var(--green); box-shadow: inset 0 0 0 1px rgba(61,220,151,.5); }
.quiz-link { border: 1px solid var(--line); color: var(--ink); }
.quiz-link:hover { border-color: var(--accent); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pn a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35; }
.pn a:hover { border-color: var(--accent); }
.pn small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-dim); margin-bottom: 4px; }
.pn-next { text-align: right; }

/* public course outline (/curriculum/) */
.o-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 8px; }
.o-cta .m-btn { margin: 18px 0 0; max-width: 100%; text-align: center; }
.o-alt { margin-top: 18px; font-weight: 600; text-decoration: none; }
.o-alt:hover { text-decoration: underline; }
/* paywall: every lesson row is a locked link (the edge gate decides); course.js swaps the lock for "›" on modules a
   signed-in member has open */
.o-paywall { max-width: 680px; margin-top: 22px; }
.o-paywall.is-member { background: rgba(61,220,151,.08); border-color: rgba(61,220,151,.4); }
.o-free { margin-top: 10px; font-size: 14px; }
.o-free a { color: var(--ink-dim); }
.o-free a:hover { color: var(--ink); }
.ls li > a.lrow .lk { font-size: 12px; opacity: .75; }
.ls li > a.lrow.open .lk { font-size: 18px; line-height: 1; opacity: 1; color: var(--accent); }
.o-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.o-facts li { font-size: 14px; color: var(--ink-dim); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; }
.o-facts b { color: var(--ink); font-weight: 600; }
.o-end { text-align: center; margin: 56px auto 0; max-width: 560px; }
.o-end h2 { font-family: var(--disp); font-size: 30px; margin-bottom: 10px; }
.o-end p { color: var(--ink-dim); }

/* sign-in page */
.m-card { max-width: 520px; margin: 8vh auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; text-align: center; }
.m-card h1 { font-family: var(--disp); font-size: 34px; line-height: 1.15; margin: 10px 0 12px; }
.m-card p { color: var(--ink-dim); }
.m-btn { display: inline-flex; align-items: center; gap: 10px; margin: 26px 0 8px; padding: 14px 26px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; font-size: 16px; }
.m-btn:hover { background: #3a9bff; }
.m-btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.m-btn.ghost:hover { background: var(--accent-soft); }
.m-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.m-msg { margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: rgba(240,178,62,.08); border: 1px solid rgba(240,178,62,.4); color: var(--ink); font-size: 15px; }
.m-alt { margin-top: 22px; font-size: 14px; }

@media (max-width: 720px) {
  .c-top { padding: 10px 16px; }
  .c-brand span { display: none; }
  .c-main { padding: 28px 16px 48px; }
  .mods { grid-template-columns: 1fr; }
  .deck-btn { display: none; }
  .prose { font-size: 16px; }
  .pn { grid-template-columns: 1fr; }
  .pn-next { text-align: left; }
  .m-card { padding: 28px 20px; }
}
@media (max-width: 520px) {
  .o-cta { gap: 12px; }
  .o-cta .m-btn, .m-actions .m-btn { width: 100%; justify-content: center; }
  .m-actions .m-btn { margin: 14px 0 0; }
}
