/* =========================================================
   Megamatrix Solution — inner pages
   Load after mm-theme.css (via {% block extra_head %})
   ========================================================= */

html { scroll-behavior: smooth; }
.mm-body [id] { scroll-margin-top: 96px; }

/* ---------- page hero ---------- */
.mm-page-hero {
  position: relative; overflow: hidden;
  padding: 96px 0 80px; border-bottom: 1px solid var(--mm-line);
}
.mm-page-hero__inner { position: relative; max-width: 860px; }
.mm-page-hero--center .mm-page-hero__inner { margin: 0 auto; text-align: center; }
.mm-page-hero--center .mm-lead { margin: 0 auto; }
.mm-page-hero--center .mm-hero__cta { justify-content: center; }
.mm-page-hero h1 {
  font-family: var(--mm-serif); font-weight: 400; letter-spacing: -0.01em;
  font-size: clamp(48px, 7.4vw, 92px); line-height: .95; margin: 18px 0 22px; color: var(--mm-text);
}
.mm-page-hero h1 em { font-style: italic; color: var(--mm-accent); }
.mm-page-hero .mm-hero__cta { margin-top: 32px; }

/* "On this page" chip row */
.mm-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.mm-page-hero--center .mm-jump { justify-content: center; }
.mm-jump a {
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--mm-muted);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--mm-line-2);
  transition: color .2s, border-color .2s;
}
.mm-jump a:hover { color: var(--mm-text); border-color: var(--mm-text); }

/* ---------- prose ---------- */
.mm-prose { max-width: 740px; color: var(--mm-muted); font-size: 17px; line-height: 1.8; }
.mm-prose > *:first-child { margin-top: 0; }
.mm-prose p { margin: 0 0 20px; }
.mm-prose h2 {
  font-family: var(--mm-serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.08; color: var(--mm-text); margin: 56px 0 20px;
}
.mm-prose h3 { font-size: 19px; font-weight: 700; color: var(--mm-text); margin: 32px 0 12px; }
.mm-prose strong { color: var(--mm-text); font-weight: 700; }
.mm-prose a { color: var(--mm-accent); text-decoration: none; border-bottom: 1px solid rgba(198,240,95,.35); }
.mm-prose a:hover { border-bottom-color: var(--mm-accent); }
.mm-prose ul, .mm-prose ol { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 10px; }
.mm-prose ul li { position: relative; padding-left: 22px; }
.mm-prose ul li::before {
  content: ""; position: absolute; left: 2px; top: .72em; width: 7px; height: 7px; border-radius: 2px;
  background: var(--mm-accent); transform: rotate(45deg);
}
.mm-prose ol { counter-reset: li; }
.mm-prose ol li { position: relative; padding-left: 34px; counter-increment: li; }
.mm-prose ol li::before {
  content: counter(li, lower-alpha); position: absolute; left: 0; top: .2em;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mm-mono); font-size: 11px; color: var(--mm-text); border: 1px solid var(--mm-line-2);
}
.mm-caps { font-size: 13.5px; letter-spacing: .02em; line-height: 1.75; color: var(--mm-faint); }

/* ---------- legal layout ---------- */
.mm-legal { display: grid; grid-template-columns: 250px 1fr; gap: 72px; align-items: start; padding: 72px 24px 112px; }
.mm-toc { position: sticky; top: 100px; }
.mm-toc__label {
  display: block; font-family: var(--mm-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--mm-faint); margin-bottom: 14px;
}
.mm-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--mm-line); }
.mm-toc a {
  display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--mm-muted); text-decoration: none; font-size: 14px; line-height: 1.4;
  transition: color .2s, border-color .2s;
}
.mm-toc a:hover { color: var(--mm-text); }
.mm-toc a.is-active { color: var(--mm-text); border-left-color: var(--mm-accent); }
.mm-toc__help {
  margin-top: 28px; padding: 18px; border-radius: var(--mm-r);
  background: var(--mm-panel); border: 1px solid var(--mm-line); font-size: 14px; color: var(--mm-muted);
}
.mm-toc__help a { color: var(--mm-accent); text-decoration: none; font-weight: 600; }

.mm-legal .mm-prose { max-width: 760px; }
.mm-legal .mm-prose h2 { padding-top: 8px; border-top: 1px solid var(--mm-line); padding-top: 40px; margin-top: 48px; }
.mm-legal .mm-prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.mm-num { font-family: var(--mm-mono); font-size: 14px; color: var(--mm-accent); margin-right: 12px; vertical-align: middle; }

/* ---------- callouts ---------- */
.mm-callout {
  margin: 28px 0; padding: 22px 24px; border-radius: var(--mm-r);
  background: var(--mm-panel); border: 1px solid var(--mm-line); border-left: 3px solid var(--mm-accent);
  color: var(--mm-text);
}
.mm-callout__title { display: block; font-family: var(--mm-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mm-accent); margin-bottom: 8px; }
.mm-callout p { margin: 0; color: var(--mm-muted); }
.mm-callout p + p { margin-top: 12px; }
.mm-callout--warn { border-left-color: #f5b94a; }
.mm-callout--warn .mm-callout__title { color: #f5b94a; }
.mm-callout--info { border-left-color: #7aa7ff; }
.mm-callout--info .mm-callout__title { color: #7aa7ff; }

/* ---------- layout helpers ---------- */
.mm-split--top { align-items: start; }
.mm-cards--2 { grid-template-columns: repeat(2, 1fr); }
.mm-aside {
  position: sticky; top: 100px; padding: 28px; border-radius: var(--mm-r-lg);
  background: var(--mm-panel); border: 1px solid var(--mm-line);
}
.mm-aside h3 { margin: 0 0 6px; font-size: 18px; }
.mm-aside p { margin: 0 0 18px; color: var(--mm-muted); font-size: 14px; }
.mm-chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-chipset span {
  font-family: var(--mm-mono); font-size: 12px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--mm-line-2); color: var(--mm-text);
}

.mm-card__k { display: block; font-family: var(--mm-mono); font-size: 12px; color: var(--mm-accent); margin-bottom: 18px; }
.mm-card ul { margin: 14px 0 0; padding-left: 18px; color: var(--mm-muted); font-size: 15px; display: grid; gap: 6px; }

/* numbered factor list */
.mm-factors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--mm-line-2); }
.mm-factors li { padding: 28px 22px 0 0; }
.mm-factors li + li { padding-left: 22px; border-left: 1px solid var(--mm-line); }
.mm-factors span { display: block; font-family: var(--mm-serif); font-size: 44px; line-height: 1; color: var(--mm-accent); margin-bottom: 14px; }
.mm-factors strong { display: block; color: var(--mm-text); font-size: 16px; line-height: 1.35; }

/* statement */
.mm-statement {
  font-family: var(--mm-serif); font-weight: 400; color: var(--mm-text);
  font-size: clamp(30px, 4vw, 48px); line-height: 1.15; margin: 0; max-width: 980px;
}
.mm-statement em { font-style: italic; color: var(--mm-accent); }
.mm-statement-by { margin-top: 24px; color: var(--mm-muted); max-width: 720px; }

/* video */
.mm-video {
  margin: 0 auto; max-width: 960px; border-radius: var(--mm-r-lg); overflow: hidden;
  background: var(--mm-panel); border: 1px solid var(--mm-line-2);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.9);
}
.mm-video video { display: block; width: 100%; height: auto; background: #000; }
.mm-video-wrap { padding: 72px 0 0; }

/* example / worked numbers */
.mm-example {
  margin: 28px 0; padding: 24px; border-radius: var(--mm-r);
  background: var(--mm-ink); border: 1px dashed var(--mm-line-2);
}
.mm-example__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--mm-line); font-size: 15px; }
.mm-example__row:last-of-type { border-bottom: 0; }
.mm-example__row span { color: var(--mm-muted); }
.mm-example__row strong { font-family: var(--mm-mono); font-weight: 500; color: var(--mm-text); }
.mm-example__row strong.up { color: var(--mm-accent); }
.mm-example p { margin: 14px 0 0; font-size: 14px; color: var(--mm-faint); }

/* DCA bars */
.mm-dca { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 120px; margin: 24px 0 8px; }
.mm-dca i { display: block; border-radius: 4px 4px 0 0; background: var(--mm-line-2); height: var(--h); }
.mm-dca i:nth-child(odd) { background: rgba(198,240,95,.45); }
.mm-dca-legend { display: flex; justify-content: space-between; font-family: var(--mm-mono); font-size: 11px; color: var(--mm-faint); }

/* section number label */
.mm-sec-num { font-family: var(--mm-mono); font-size: 12px; color: var(--mm-faint); letter-spacing: .1em; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .mm-factors { grid-template-columns: repeat(3, 1fr); }
  .mm-factors li:nth-child(4) { padding-left: 0; border-left: 0; }
  .mm-factors li:nth-child(n+4) { margin-top: 28px; }
}
@media (max-width: 900px) {
  .mm-page-hero { padding: 64px 0 56px; }
  .mm-legal { grid-template-columns: 1fr; gap: 40px; padding: 48px 24px 80px; }
  .mm-toc { position: static; }
  .mm-toc ol { columns: 2; column-gap: 24px; border-left: 0; }
  .mm-toc a { border-left: 0; padding-left: 0; }
  .mm-cards--2 { grid-template-columns: 1fr; }
  .mm-aside { position: static; }
  .mm-video-wrap { padding-top: 48px; }
}
@media (max-width: 560px) {
  .mm-legal { padding: 40px 16px 64px; }
  .mm-toc ol { columns: 1; }
  .mm-factors { grid-template-columns: 1fr; }
  .mm-factors li, .mm-factors li + li { padding: 22px 0; border-left: 0; border-top: 1px solid var(--mm-line); margin: 0; }
  .mm-factors li:first-child { border-top: 0; }
  .mm-prose { font-size: 16px; }
}
