/* The Index / metafusion.css
 * Blocks that only the metafusion case study uses. Everything shared still
 * comes from case.css. The colours below are read from the Figma frames.
 */

:root {
  --mf-green: #66B037;
  --mf-green-ink: #3E7A1B;
  --mf-navy: #0B1024;
  --mf-blue: #2463B0;
  --mf-deep: #12305E;
  --mf-amber: #EA9A1B;
  --mf-red: #D1410C;
  --mf-strip: #FCF3F0;
  --mf-card: #FFFFFF;
  --mf-page: #F0F1F2;
  --mf-text: #171717;
}
:root[data-theme="dark"] {
  --mf-green-ink: #7CC64A;
  --mf-strip: #262626;
  --mf-card: #1B1B1B;
  --mf-page: #0D0D0D;
  --mf-text: #F2F1ED;
}

/* A screen that follows the page theme: two images, one shown. */
.mf-l, .mf-d { display: block; width: 100%; height: auto; }
.mf-d { display: none; }
:root[data-theme="dark"] .mf-l { display: none; }
:root[data-theme="dark"] .mf-d { display: block; }

/* ---- Hero ---------------------------------------------------------------- */
.mf-hero {
  max-width: var(--col-panel); margin: 0 auto;
  background: var(--panel-fill); border: 1px solid var(--panel-line);
  border-radius: var(--radius-card);
  padding: 72px 24px 64px; text-align: center;
}
.mf-hero h1 {
  margin: 0; font-size: clamp(40px, 7vw, 60px); line-height: 1; font-weight: 600;
  letter-spacing: -.035em; color: var(--ink);
  /* The real lockup is the mark then the word, so the hero is built the same
     way. The mark is the product's own SVG, green in both themes. */
  display: flex; align-items: center; justify-content: center; gap: .2em;
}
.mf-hero h1 .mf-logo {
  flex: none; width: auto; height: .74em; color: var(--mf-green);
  /* The glyph is a circle with a flat left edge, so its mass sits a hair low
     against lowercase letterforms. */
  transform: translateY(-.015em);
}
.mf-hero p {
  max-width: 520px; margin: 22px auto 0;
  font-size: 17px; line-height: 1.35; letter-spacing: -.015em; color: var(--ink-soft);
}

/* ---- The console --------------------------------------------------------- */
.mf-console { padding: 28px 28px 32px; }
.mf-console .jump { justify-content: center; margin-bottom: 20px; }
.mf-view { position: relative; aspect-ratio: 1920 / 1079; background: var(--mf-page); }
.mf-view img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transition: opacity 260ms var(--ease-expo);
}
.mf-view img[data-out] { opacity: 0; }

/* The tabs drawn inside the screenshot, made to work. */
.mf-hot { position: absolute; left: 5.4%; top: 10.4%; width: 14.4%; height: 3.3%; display: flex; }
.mf-hot button {
  appearance: none; border: 0; background: transparent; cursor: pointer; padding: 0;
  border-radius: 6px; flex: 1 1 0;
}
.mf-hot button:nth-child(1) { flex-grow: 3.45; }
.mf-hot button:nth-child(2) { flex-grow: 3.25; }
.mf-hot button:nth-child(3) { flex-grow: 3.55; }
.mf-hot button:nth-child(4) { flex-grow: 3.95; }
.mf-hot button:hover { box-shadow: 0 0 0 1.5px var(--marker); }
.mf-hot button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.mf-hot[data-hint]::after {
  content: ""; position: absolute; inset: -5px; border-radius: 10px; pointer-events: none;
  border: 1.5px dashed var(--marker);
  animation: mf-hint 1.6s var(--ease-expo) infinite;
}
@keyframes mf-hint { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mf-hot[data-hint]::after { animation: none; opacity: .8; } }

.mf-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px;
  flex-wrap: wrap; margin-top: 18px;
}
.mf-read {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--ink); font-variant-numeric: tabular-nums;
}
.mf-read em { font-style: normal; color: var(--marker-text); }
.mf-bar__ctl { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Pins on a screen ---------------------------------------------------- */
.mf-pinned { position: relative; }
.mf-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 24px; height: 24px; border-radius: 999px; cursor: pointer;
  appearance: none; border: 2px solid var(--ground); padding: 0;
  background: var(--marker); color: var(--on-marker, #fff);
  font-family: var(--font-mono); font-size: 10.5px; line-height: 20px; text-align: center;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,.5);
  transition: transform 240ms var(--ease-expo);
}
.mf-pin[aria-pressed="true"], .mf-pin:hover { transform: translate(-50%, -50%) scale(1.3); }
.mf-pin:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mf-notes {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
}
.mf-notes li {
  padding: 12px; border-radius: var(--radius-media); cursor: default;
  border: 1px solid var(--panel-line); background: var(--ground);
  transition: border-color 240ms var(--ease-expo), opacity 240ms var(--ease-expo);
}
.mf-notes[data-active] li { opacity: .5; }
.mf-notes[data-active] li[data-on] { opacity: 1; border-color: var(--marker); }
.mf-notes b { display: block; font-size: 13px; line-height: 18px; font-weight: 500; }
.mf-notes b span { font-family: var(--font-mono); font-size: 10.5px; color: var(--marker-text); margin-right: 6px; }
.mf-notes p { margin: 4px 0 0; font-size: 12px; line-height: 17px; color: var(--ink-muted); }

/* ---- Today against Week --------------------------------------------------- */
.mf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.mf-two { position: relative; }
.mf-two img { display: block; width: 100%; height: auto; }
.mf-two img + img { position: absolute; inset: 0; opacity: 0; transition: opacity 320ms var(--ease-expo); }
.mf-two[data-mode="week"] img + img { opacity: 1; }
.mf-mark {
  position: absolute; left: 5.1%; top: 16%; width: 22.8%; height: 39.8%;
  border: 2px dashed var(--marker); border-radius: 14px; pointer-events: none;
}
.mf-mark span {
  position: absolute; left: 12px; bottom: -13px; white-space: nowrap;
  padding: 5px 9px; border-radius: var(--radius-pill);
  background: var(--marker); color: var(--on-marker, #fff);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase;
}
.mf-two[data-mode="week"] .mf-mark span:first-child,
.mf-two:not([data-mode="week"]) .mf-mark span:last-child { display: none; }

/* ---- The acknowledge control, rebuilt ------------------------------------ */
.mf-ack { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.mf-ui {
  font-family: "Lexend", var(--font-sans);
  background: var(--mf-card); color: var(--mf-text);
  border-radius: 18px; padding: 18px; border: 1px solid var(--panel-line);
  min-height: 206px;
}
.mf-ui__strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--mf-strip); border-radius: 10px; padding: 14px 16px;
}
.mf-ui__msg { flex: 1 1 200px; font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.mf-ui__btns { display: flex; gap: 8px; position: relative; }
.mf-btn {
  appearance: none; cursor: pointer; border-radius: 6px; padding: 8px 12px;
  white-space: nowrap;
  font: 500 10px/1 "Lexend", var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--mf-green); background: transparent; color: var(--mf-green-ink);
}
.mf-btn--red { background: var(--mf-red); border-color: var(--mf-red); color: #fff; }
.mf-btn--red::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 0 2px 8px;
  border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg); }
.mf-btn--plain::after { display: none; }
.mf-btn--ghost { border-color: var(--mf-red); color: var(--mf-red); }
.mf-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mf-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 2; min-width: 124px;
  background: var(--mf-card); border-radius: 8px; padding: 6px;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.35); border: 1px solid var(--panel-line);
}
.mf-menu[hidden] { display: none; }
.mf-menu button {
  display: block; width: 100%; text-align: left; appearance: none; border: 0; cursor: pointer;
  background: transparent; padding: 9px 10px; border-radius: 5px;
  font: 500 10px/1 "Lexend", var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
}
.mf-menu button:first-child { color: var(--mf-red); }
.mf-menu button:last-child { color: var(--mf-green-ink); }
.mf-menu button:hover, .mf-menu button:focus-visible { background: var(--mf-strip); outline: none; }
.mf-ui__pend {
  margin: 12px 0 0; text-align: center;
  font-size: 10px; letter-spacing: .04em; color: var(--ink-muted);
}
.mf-ui__pend b { color: var(--mf-red); font-weight: 500; }
.mf-ui__log { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.mf-ui__log li {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .3px; color: var(--ink-muted);
  padding-top: 6px; border-top: 1px dashed var(--panel-line);
}
.mf-ui__log li b { font-weight: 400; color: var(--mf-text); }
.mf-ack__side img { display: block; width: 100%; height: auto; border-radius: var(--radius-media); border: 1px solid var(--panel-line); }
.mf-ack__side img.mf-d { display: none; }
:root[data-theme="dark"] .mf-ack__side img.mf-d { display: block; }
.mf-ack__side p { margin: 12px 0 0; font-size: 12.5px; line-height: 18px; color: var(--ink-muted); }

/* ---- The scale ------------------------------------------------------------ */
.mf-scale { display: grid; gap: 22px; }
.mf-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mf-legend div { border-radius: var(--radius-media); padding: 12px; background: var(--ground); border: 1px solid var(--panel-line); }
.mf-legend i { display: block; width: 100%; height: 8px; border-radius: 3px; margin-bottom: 10px; }
.mf-legend b { display: block; font-size: 17px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mf-cells { display: grid; grid-template-columns: 72px repeat(6, minmax(0, 1fr)); gap: 8px; align-items: center; }
.mf-cells span.lab { white-space: nowrap; }
.mf-cells b {
  display: block; text-align: center; padding: 9px 0; border-radius: 6px;
  font: 500 12px/1 "Lexend", var(--font-sans); color: #fff; font-variant-numeric: tabular-nums;
}

/* ---- Counting -------------------------------------------------------------- */
.mf-gate { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.mf-gate svg { display: block; width: 100%; height: auto; border-radius: var(--radius-media); background: var(--ground); border: 1px solid var(--panel-line); }
.mf-gate__nums { display: grid; gap: 14px; }
.mf-gate__nums div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--panel-line); }
.mf-gate__nums b { font-size: 40px; line-height: 1; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mf-gate__nums div:nth-child(1) b { color: #0F5B4F; }
.mf-gate__nums div:nth-child(2) b { color: var(--mf-red); }
:root[data-theme="dark"] .mf-gate__nums div:nth-child(1) b { color: #4FB39F; }
.mf-gate__ctl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* These are the one place in this section where the reader is asked to do
   something rather than read something. As hairline pills on a panel of
   almost the same colour they read as labels, so they get a surface of their
   own, a press that answers, and one nudge when the section arrives. */
.mf-gate__ctl button {
  position: relative;
  padding: 9px 15px; font-size: 10px; letter-spacing: 1px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border-color: color-mix(in srgb, var(--ink) 15%, transparent);
  color: var(--ink-soft);
  transition: background 200ms var(--ease-expo), color 200ms var(--ease-expo),
              border-color 200ms var(--ease-expo), box-shadow 200ms var(--ease-expo),
              transform 140ms var(--ease-expo);
}
.mf-gate__ctl button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 13%, transparent);
  border-color: color-mix(in srgb, var(--ink) 28%, transparent);
  color: var(--ink); transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--ink) 50%, transparent);
}
/* The press has to land under the finger, not after it. */
.mf-gate__ctl button:active:not(:disabled) {
  transform: translateY(0) scale(.97); box-shadow: none;
  transition-duration: 60ms;
}

/* Add a person is the invitation; the other two only matter once you accept. */
.mf-gate__ctl #mf-add {
  background: var(--ink); border-color: var(--ink); color: var(--ground);
}
.mf-gate__ctl #mf-add:hover:not(:disabled) {
  background: var(--ink); border-color: var(--ink); color: var(--ground);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--ink) 70%, transparent);
}
.mf-gate__ctl #mf-add:disabled {
  background: transparent; color: var(--marker-text); cursor: default;
  border-color: color-mix(in srgb, var(--ink) 12%, transparent);
  transform: none; box-shadow: none;
}

/* Pause is a state, so it says so while it is holding the walkers still. */
.mf-gate__ctl #mf-pause[aria-pressed="true"] {
  background: color-mix(in srgb, var(--mf-green) 18%, transparent);
  border-color: color-mix(in srgb, var(--mf-green) 55%, transparent);
  color: var(--mf-green-ink);
}

/* Start again, under the acknowledge demo, is the same kind of control sitting
   in the same kind of panel, so it gets the same surface. The dashboard picker
   above is not: those are tabs with a chosen one, and they stay as they are. */
.mf-ack__side .jump button {
  padding: 9px 15px; font-size: 10px; letter-spacing: 1px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border-color: color-mix(in srgb, var(--ink) 15%, transparent);
  color: var(--ink-soft);
}
.mf-ack__side .jump button:hover {
  background: color-mix(in srgb, var(--ink) 13%, transparent);
  border-color: color-mix(in srgb, var(--ink) 28%, transparent);
  color: var(--ink);
  box-shadow: 0 4px 12px -6px color-mix(in srgb, var(--ink) 50%, transparent);
}
.mf-ack__side .jump button:active { transform: translateY(0) scale(.97); box-shadow: none; }

/* One ring, three times, the first time the gate comes into view. It stops on
   the first press and never comes back: a button that keeps asking is noise. */
.mf-gate__ctl #mf-add::after {
  content: ""; position: absolute; inset: -3px; border-radius: 999px;
  border: 2px solid var(--mf-green); opacity: 0; pointer-events: none;
}
.mf-gate__ctl.is-idle #mf-add:not(:disabled)::after {
  animation: mf-nudge 2200ms var(--ease-expo) 3;
}
@keyframes mf-nudge {
  0%   { opacity: 0; transform: scale(.96); }
  12%  { opacity: .6; transform: scale(1); }
  60%  { opacity: 0; transform: scale(1.26); }
  100% { opacity: 0; transform: scale(1.26); }
}
@media (prefers-reduced-motion: reduce) {
  .mf-gate__ctl.is-idle #mf-add::after { animation: none; }
  .mf-gate__ctl button:hover:not(:disabled),
  .mf-gate__ctl button:active:not(:disabled) { transform: none; }
}
.mf-words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.mf-words figure { margin: 0; }
.mf-words img { width: 100%; height: auto; border-radius: var(--radius-media); border: 1px solid var(--panel-line); }
.mf-words figcaption { margin-top: 10px; }
.mf-words figcaption b { display: block; font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.mf-words figcaption p { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--ink-muted); }

/* ---- Light against dark ---------------------------------------------------- */
.mf-wipe { position: relative; --x: 50%; aspect-ratio: 1920 / 1079; overflow: hidden; }
.mf-wipe img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mf-wipe img + img { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.mf-wipe__line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: var(--marker); pointer-events: none; }
.mf-wipe__line::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px;
  border-radius: 999px; background: var(--marker); border: 2px solid #fff;
  box-shadow: 0 6px 18px -4px rgba(0,0,0,.5);
}
.mf-wipe input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
}
.mf-wipe:focus-within .mf-wipe__line::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.mf-tokens { width: 100%; border-collapse: collapse; margin-top: 32px; }
.mf-tokens th, .mf-tokens td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--panel-line); font-size: 13px; }
.mf-tokens th { font-family: var(--font-mono); font-size: 9.58px; letter-spacing: .38px; text-transform: uppercase; color: var(--diagram-ink); font-weight: 400; }
.mf-tokens td code { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }
.mf-tokens td i { display: inline-block; width: 18px; height: 18px; border-radius: 5px; vertical-align: -4px; margin-right: 8px; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }

/* ---- The wall --------------------------------------------------------------- */
.mf-wall { display: grid; gap: 22px; }
.mf-wall__row { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; }
.mf-wall__row > span { padding-top: 4px; }
.mf-wall__shots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mf-wall__shots button {
  appearance: none; padding: 0; cursor: pointer; display: block; overflow: hidden;
  border-radius: 6px; border: 1px solid var(--panel-line); background: var(--mf-page);
  aspect-ratio: 1920 / 1079;
  transition: transform 240ms var(--ease-expo), border-color 240ms var(--ease-expo);
}
.mf-wall__shots button:hover { transform: translateY(-2px) scale(1.03); border-color: var(--marker); }
.mf-wall__shots button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mf-wall__shots img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 760px) {
  .mf-console { padding: 18px 12px 22px; }
  .mf-notes { grid-template-columns: minmax(0, 1fr); }
  .mf-ack, .mf-gate { grid-template-columns: minmax(0, 1fr); }
  .mf-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mf-cells { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mf-cells span.lab { grid-column: 1 / -1; }
  .mf-words { grid-template-columns: minmax(0, 1fr); }
  .mf-wall__row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mf-wall__shots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mf-pin { width: 20px; height: 20px; font-size: 9px; line-height: 16px; }
}
