/* The Fight for Mobile Money 2.0
   Concept: a magazine feature. The cracked flip phone (mobile money 1.0) opens the story,
   a high-contrast serif carries the drama, and a signal yellow marks what matters. */

html.theme-mm2 {
  --fg: #151412;
  --muted: #6b665d;
  --accent: #8a6a00;
  --signal: #f2c200;
  --rule: #e9e4d8;
  --selection: #ffe680;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
}
.theme-mm2 a { text-decoration-color: var(--signal); text-decoration-thickness: 0.12em; }
.theme-mm2 a:hover { color: var(--fg); background: color-mix(in srgb, var(--signal) 35%, transparent); }

/* ---------------------------------------------------------------- hero */

.mm-hero {
  position: relative;
  max-width: 88rem; margin: 0 auto clamp(2rem, 5vw, 4rem); padding: 0;
}
.mm-cover { margin: 0; }
.mm-cover img { width: 100%; height: auto; }
.mm-hero-text {
  position: absolute; right: 4%; top: 50%; translate: 0 -50%;
  width: 34%;
}
.theme-mm2 .hero-meta { color: var(--muted); }
.theme-mm2 .hero-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: clamp(2.6rem, 1rem + 4.4vw, 5.6rem);
  line-height: 0.92; letter-spacing: -0.035em;
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 1;
}
.theme-mm2 .hero-title > span:first-child {
  display: block; margin-bottom: 0.25em;
  font-weight: 400; font-style: italic; font-size: 0.42em; letter-spacing: -0.01em;
  color: var(--muted);
}
.theme-mm2 .hero-dek {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 1.25em; color: var(--fg);
  padding-top: 1.1rem; border-top: 3px solid var(--signal); display: inline-block;
}
/* "1.0" rolls over to "2.0" like an odometer, then gets underlined. */
.ver { display: inline-flex; position: relative; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.ver-roll { display: inline-block; height: 0.92em; overflow: hidden; vertical-align: top; }
.ver-roll i {
  display: block; font-style: normal; line-height: 0.92;
  animation: roll 0.9s cubic-bezier(.5,-0.4,.3,1.4) 0.9s both;
}
.ver::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -0.06em; height: 0.12em;
  background: var(--signal); transform-origin: left; transform: scaleX(0);
  animation: sweep 0.5s ease-out 1.7s forwards;
}
@keyframes roll { from { translate: 0 0; } to { translate: 0 -100%; } }
@keyframes sweep { to { transform: scaleX(1); } }

@media (max-width: 62rem) {
  .mm-hero-text { position: static; translate: none; width: auto; padding: 0 var(--gutter); max-width: 40rem; margin-top: 1.5rem; }
}

/* ---------------------------------------------------------------- prose */

/* Drop cap for the cinematic opening */
.theme-mm2 .prose > p:first-child { font-size: 1.1em; }
.theme-mm2 .prose > p:first-child::first-letter {
  float: left; margin: 0.08em 0.12em 0 -0.04em;
  font: 700 4.6em/0.8 var(--font-display);
  font-variation-settings: 'opsz' 144;
  color: var(--fg);
  text-shadow: 0.06em 0.06em 0 var(--signal);
}

/* Chapters: the headings are statements, so set them like pull quotes with a number. */
.theme-mm2 .prose { counter-reset: chapter; }
.theme-mm2 .prose > h2 {
  counter-increment: chapter;
  font-family: var(--font-display);
  font-weight: 600; font-size: clamp(1.7rem, 1.1rem + 1.8vw, 2.6rem);
  line-height: 1.08; letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 144;
  margin-top: 2.6em;
}
.theme-mm2 .prose > h2::before {
  content: counter(chapter, decimal-leading-zero);
  display: inline-block; margin-bottom: 0.9rem;
  font: 600 0.8rem/1 var(--font-ui); letter-spacing: 0.12em;
  padding: 0.35rem 0.5rem; background: var(--signal); color: var(--fg);
}
.theme-mm2 .prose > h2 a { text-decoration: none; }

.theme-mm2 .prose figcaption {
  font-family: var(--font-display); font-style: italic; font-size: 0.9rem;
}

/* The one pull quote in the piece */
.theme-mm2 .prose blockquote {
  border: 0; padding: 0; margin-block: 2.2em;
  font: italic 400 clamp(1.35rem, 1rem + 1vw, 1.75rem)/1.35 var(--font-display);
  letter-spacing: -0.01em;
}
.theme-mm2 .prose blockquote::before {
  content: '“'; display: block; height: 0.55em;
  font: 700 4.5em/1 var(--font-display); color: var(--signal);
}
.theme-mm2 .prose blockquote strong { font-weight: 600; background: linear-gradient(transparent 60%, color-mix(in srgb, var(--signal) 55%, transparent) 60%); }

.theme-mm2 .prose ul { list-style: none; padding-left: 0; }
.theme-mm2 .prose ul li { padding-left: 1.6rem; position: relative; }
.theme-mm2 .prose ul li::before {
  content: ''; position: absolute; left: 0; top: 0.55em; width: 0.6rem; height: 0.6rem; background: var(--signal);
}

.theme-mm2 .prose aside.note { border-color: var(--signal); border-width: 0 0 0 3px; border-radius: 0; }

.endnotes { margin-top: 1.5em; padding-top: 1.5em; border-top: 1px solid var(--rule); }
.theme-mm2 .endnotes h2 {
  margin: 0 0 1rem; font: 650 0.78rem var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.endnotes ol { margin: 0; padding-left: 1.4rem; font: 0.88rem/1.55 var(--font-ui); color: var(--muted); }
.endnotes li::marker { color: var(--accent); }
