/* ---------------------------------------------------------------
   Mamut case study visuals. Everything is scoped under .mm so none
   of it can touch the other pages. The frames, tiles and toggle come
   from the approved components file; the Before and After toggle uses
   the site's own .dgm__toggle styles.
   --------------------------------------------------------------- */

/* The palette used inside the visuals. It only applies inside .mm. */
.mm {
  --paper: #FFF6ED;
  --panel: #FCFCFC;
  --ink: #1E1E1E;
  --muted: #5C5D60;
  --line: #000000;
  --soft: rgba(0, 0, 0, .14);
  --edge: #8A8A8A;
  --on-ink: #FFFFFF;
  --brand: #1B1919;
  --tint: #F5F5F5;
  margin-top: var(--space-xl);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  min-width: 0;
}
.mm *, .mm *::before, .mm *::after { box-sizing: border-box; }
.mm p, .mm h3, .mm figure, .mm ul, .mm ol { margin: 0; }
.mm .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mm a { color: inherit; text-underline-offset: 3px; }

/* Before and After toggle: same look as the site, with a 44px target. */
.mm .dgm__toggle { align-self: center; margin-bottom: 0; }
.mm .dgm__toggle button { min-height: 44px; min-width: 88px; padding: 0 20px; }

/* Spacing next to the site's own paragraphs. */
.case-section .mm { margin-top: var(--space-xl); }
.case-section .mm + p { margin-top: var(--space-xl); }
/* The type scale table is for desktop only, it needs the width. */
.mm.mm--table { display: none; }
@media (min-width: 768px) { .mm.mm--table { display: block; } }
.case-body > .mm:first-child { margin-top: 0; margin-bottom: var(--space-3xl); }

@media (prefers-color-scheme: dark) {
  .mm :root:not([data-theme="light"]) {
    --paper: #1C1815; --panel: #25211D; --ink: #F4ECE3; --muted: #B9AFA4; --line: #F4ECE3;
    --soft: rgba(244, 236, 227, .22); --on-ink: #1C1815; --brand: #F4ECE3; --tint: #2E2924;
    color-scheme: dark;
  }
}
.mm .fig { margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mm .fig > figcaption, .mm .cap { font-size: 14px; color: var(--muted); text-align: center; }
.mm .frame { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.mm .lx .frame { padding: 0; overflow: hidden; }
.mm .lx__body { display: flex; justify-content: center; padding: 32px 16px; }
.mm .lx__stage { width: min(100%, 320px); }
.mm .lx [data-state="before"], .mm .lens[data-state="before"] { --ph: #8C8C8E; --fb: #CFCFCF; --btn: #AF08FD; --dotc: #E9E7E2; --cb: #D1D5DC; --fs-sub: 12px; --sub2: -6px; --fs-lab: 10px; --fs-ph: 12px; --fs-btn: 12px; --fs-g: 11px; --fs-t: 9px; }
.mm .lx [data-state="after"], .mm .lens[data-state="after"] { --ph: #6B6B6B; --fb: #8A8A8A; --btn: #9A04E0; --dotc: #8A8A8A; --cb: #8A8A8A; --fs-sub: 16px; --sub2: 0px; --fs-lab: 12px; --fs-ph: 16px; --fs-btn: 16px; --fs-g: 14.5px; --fs-t: 11.5px; }
.mm .phone { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .22)) drop-shadow(0 2px 4px rgba(0, 0, 0, .18)); }
.mm .lx .frame { background: var(--tint); border: 0; }
.mm .fx { display: flex; flex-direction: column; gap: 10px; }
.mm .fx + .fx { border-top: 1px solid var(--soft); padding-top: 20px; }
.mm .fx h3 { margin: 0; font: 400 1.25rem/1.25 var(--font-serif); }
.mm .fx .g { font-size: 13px; color: var(--muted); }
.mm .fx__big { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-variant-numeric: tabular-nums; }
.mm .fx__big > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid var(--edge); border-radius: 10px; padding: 12px; }
.mm .fx__big small { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mm .fx__big .n { font: 400 clamp(1.5rem, 6vw, 2rem)/1 var(--font-serif); }
.mm .verdict { font-size: 12px; font-weight: 500; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--ink); }
.mm .verdict.pass { background: var(--ink); color: var(--paper); }
.mm .fx .rule { font-size: 14px; margin: 0; }
.mm .lens-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.mm .lens { position: relative; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; background: #72CDEA; }
.mm .lens svg { display: block; width: 100%; height: auto; }
.mm .lens--text { display: flex; align-items: center; justify-content: flex-start; min-height: 112px; padding: 16px 20px; background: #F7F7F7; color: #111111; font-family: var(--font-sans); }
.mm .lens--text p { margin: 0; text-align: left; line-height: 1.5; font-size: calc(var(--fs-sub) * 1.5); }
.mm .lens--text.ph { background: #D8EFF8; }
.mm .lens--text.ph p { font-size: calc(var(--fs-ph) * 1.5); color: var(--ph); }
.mm .lensbox .lens { flex: 1; }
.mm .lensbox { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mm .lens__tag { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mm .fx .fixline { font-size: 14px; color: var(--muted); margin: 0; }
.mm .fx .fixline b { color: var(--ink); font-weight: 500; }
.mm .cards { display: flex; flex-direction: column; gap: 24px; }
.mm .cards .fx { background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 20px; }
.mm .cards .fx + .fx { padding-top: 20px; }
.mm .cards .lens-pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.mm .skill { display: flex; flex-direction: column; gap: 20px; }
.mm .skill__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mm .tag { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: var(--on-ink); }
.mm .skill__name { font: 400 1.125rem/1.3 ui-monospace, "SFMono-Regular", Menlo, monospace; word-break: break-word; }
.mm .steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.mm .steps li { counter-increment: s; background: var(--paper); border: 1.25px solid var(--edge); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mm .steps li::before { content: "Step " counter(s); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mm .steps strong { font: 400 1rem/1.35 var(--font-serif); }
.mm .steps span { font-size: 14px; color: var(--muted); }
.mm .docs--one { max-width: 340px; width: 100%; margin: 0 auto; }
.mm .docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.mm .doc { background: #FFFFFF; color: #1E1E1E; border: 1px solid #D9D5CF; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); padding: 24px 20px 28px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mm .doc__label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #6B6B6B; }
.mm .doc h3 { margin: 0; font: 400 1.125rem/1.3 var(--font-serif); padding-bottom: 12px; border-bottom: 2px solid #1E1E1E; }
.mm .doc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mm .doc li { font-size: 14px; line-height: 1.45; }
.mm .doc li b { font-weight: 500; }
.mm .doc li small { display: block; color: #6B6B6B; font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mm .doc .ok { float: right; font-size: 12px; letter-spacing: .06em; font-weight: 500; border: 1.5px solid #1E1E1E; border-radius: 999px; padding: 1px 8px; margin-left: 8px; }
.mm .keycap { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; }
.mm .keycap .key { margin: 0; }
.mm .spec__pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.mm .spec__col .spec__sample { flex: 1; }
.mm .spec__col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mm .spec--b p { font-size: 12px; line-height: 18px; }
.mm .spec--a p { font-size: 16px; line-height: 24px; }
.mm .spec__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; padding: 24px 16px; align-items: start; }
.mm .spec .frame { padding: 0; }
.mm .spec__sample { background: #FFFFFF; color: #1D1B20; border: 1px solid #D9D5CF; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mm .spec__sample p { margin: 0; font-family: var(--font-sans); letter-spacing: .01em; transition: font-size .4s var(--ease), line-height .4s var(--ease); }
.mm .spec [data-state="before"] .spec__sample p { font-size: 12px; line-height: 18px; }
.mm .spec [data-state="after"] .spec__sample p { font-size: 16px; line-height: 24px; }
.mm .spec__tag { font: 400 1.25rem/1 var(--font-serif); font-variant-numeric: tabular-nums; }
.mm .spec__tag small { font: 400 12px var(--font-sans); color: #6B6B6B; margin-left: 8px; }
.mm .changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mm .changes li { font-size: 14px; line-height: 1.4; }
.mm .changes b { display: block; font-weight: 500; font-size: 15px; }
.mm .changes code { font: 12px ui-monospace, Menlo, monospace; color: var(--muted); }
.mm .key { display: inline-block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--paper); margin-left: 6px; vertical-align: 1px; }
.mm .flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; max-width: 640px; margin: 0 auto; padding: 8px 0; }
.mm .flow__src { list-style: none; margin: 0; padding: 0 28px 0 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.mm .flow__src::before { content: ""; position: absolute; right: 0; top: 24px; bottom: 24px; width: 1.5px; background: var(--brand); }
.mm .flow__src li { position: relative; display: flex; align-items: center; min-height: 48px; padding: 0 16px; background: var(--paper); border: 1.25px solid var(--edge); border-radius: 12px; font-size: 15px; font-weight: 500; }
.mm .flow__src li::after { content: ""; position: absolute; left: 100%; top: 50%; width: 28px; height: 1.5px; margin-top: -.75px; background: var(--brand); }
.mm .ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 12px; background: #FFFFFF; border: 1px solid #D4D4D4; border-radius: 8px; }
.mm .ico img, .mm .ico svg { display: block; width: 20px; height: 20px; }
.mm .flow__ico { display: flex; gap: 8px; margin-bottom: 8px; }
.mm .flow__ico .ico { margin: 0; }
.mm .flow__link { position: relative; width: 44px; height: 1.5px; background: var(--brand); }
.mm .flow__link::before { content: ""; position: absolute; left: -4px; top: -3.25px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.mm .flow__link::after { content: ""; position: absolute; right: -1px; top: -5px; border-left: 9px solid var(--brand); border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; }
.mm .flow__dest { background: var(--brand); color: var(--on-ink); border-radius: 16px; padding: 24px 16px; min-height: 120px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.mm .flow__dest strong { font: 400 1rem/1.35 var(--font-serif); }
.mm .flow__dest > span:not(.flow__ico):not(.sr-only) { font-size: 14px; opacity: .85; }
@media (max-width: 599px) {
  .mm .flow { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .mm .flow__src { padding: 0; }
  .mm .flow__src::before, .mm .flow__src li::after { display: none; }
  .mm .flow__link { width: 1.5px; height: 40px; justify-self: center; }
  .mm .flow__link::before { left: -3.25px; top: -4px; }
  .mm .flow__link::after { right: auto; left: -5px; top: auto; bottom: -1px; border-left: 5.5px solid transparent; border-right: 5.5px solid transparent; border-top: 9px solid var(--brand); border-bottom: 0; }
  .mm .flow__dest { min-height: 0; }
}
.mm .tbl__head { background: #1B1919; color: #FFFFFF; padding: 20px 24px; display: flex; flex-direction: column; gap: 2px; font-family: var(--font-sans); }
.mm .tbl__head strong { font-size: 1.75rem; font-weight: 500; line-height: 1.2; }
.mm .tbl__head span { font-size: 15px; font-weight: 500; }
.mm .tbl__rule { margin: 0; padding: 12px 24px; font-size: 12px; color: var(--muted); }
.mm .tbl__scroll { max-height: 400px; overflow: auto; border-top: 1px solid var(--soft); }
.mm .tbl__scroll:focus-visible { outline-offset: -3px; }
.mm .ts { min-width: 640px; }
.mm .ts thead th { position: sticky; top: 0; z-index: 1; }
.mm .tbl { display: none; }
@media (min-width: 768px) {
  .mm .tbl { display: block; }
}
.mm .more summary { cursor: pointer; font-weight: 500; font-size: 15px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.25px solid var(--edge); border-radius: 999px; padding: 0 20px; width: max-content; margin: 0 auto; list-style: none; }
.mm .more summary::-webkit-details-marker { display: none; }
.mm .more summary::after { content: "+"; font-size: 18px; }
.mm .more[open] summary::after { content: "\2212"; }
.mm .more[open] .fig { margin-top: 16px; }
.mm .tbl__wrap { padding: 0; overflow: hidden; }
.mm .ts { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.mm .ts th:nth-child(1) { width: 22%; }
.mm .ts th:nth-child(2) { width: 18%; }
.mm .ts th:nth-child(3) { width: 14%; }
.mm .ts th:nth-child(4) { width: 11%; }
.mm .ts th:nth-child(5) { width: 7%; }
.mm .ts .pv { overflow: hidden; }
.mm .ts thead th { text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px; background: var(--tint); }
.mm .ts tbody tr { border-top: 1px solid var(--soft); }
.mm .ts td, .mm .ts tbody th { padding: 10px 10px; text-align: left; vertical-align: middle; font-weight: 400; }
.mm .ts tbody th { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.mm .ts td small { display: inline; margin-left: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mm .ts .pv { color: var(--ink); line-height: 1.1; white-space: nowrap; }
.mm .ts .is-key td, .mm .ts .is-key th { background: var(--tint); }
.mm .ts .is-key b { font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .mm * { transition: none !important; } }