/*
 * MyInscribe OS, design system.
 * Values are locked by wordpress_handoff/01-design-system.md. Do not "improve" them.
 *
 * House rules encoded here:
 *   - amber is the only interaction/emphasis colour; cobalt never appears as type
 *   - nothing below 12px
 *   - sibling spacing is flex/grid + gap, never margins
 */

/* ============================================================ tokens */

:root {
  --bg: #08090B;
  --panel: #0F1114;
  --panel-2: #16191F;
  --line: #22262D;
  --line-2: #333A44;
  --txt: #F2F3F5;
  --dim: #CFD4DC;
  /* Lifted from #9CA5B2: the old value could not reach 4.5:1 over the gradient. */
  --dim-2: #A9B2BF;
  --amber: #FFC72E;
  --cobalt: #3D5AFE;
  --good: #34D399;
  --warn: #FBBF24;
  --bad: #F87171;

  /*
   * Three roles, not two. --display is the editorial serif and carries voice;
   * --ui is the grotesk and carries every small functional label. Collapsing
   * those two into one face is what made every section read the same.
   */
  --display: 'Newsreader', 'Cabinet Grotesk', Georgia, serif;
  --ui: 'Switzer', system-ui, sans-serif;
  --body: 'Switzer', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1320px;
  --prose: 960px;
  --gutter: 32px;
  --rhythm: clamp(90px, 12vh, 140px);
  --rhythm-sub: clamp(80px, 11vh, 130px);
}

/* ============================================================ base */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 90px; /* sticky nav is 72px */
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.045) 1px, transparent 1.7px);
  background-size: 30px 30px;
  background-repeat: repeat;
  color: var(--txt);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--amber); }
::selection { background: var(--amber); color: #08090B; }

img, svg, video { max-width: 100%; }
img { height: auto; display: block; }

button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: 16px;
  z-index: 200;
  background: var(--amber); color: #08090B;
  font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: 10px;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; color: #08090B; }

/* ============================================================ motion */

@keyframes fadeSwap { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes barIn    { from { transform: scaleX(0); }                    to { transform: scaleX(1); } }
@keyframes marquee  { from { transform: translateX(0); }                to { transform: translateX(-50%); } }
@keyframes pulse    { 0%, 100% { opacity: 1; }                          50% { opacity: 0.35; } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }

.mi-swap { animation: fadeSwap 0.45s var(--ease) both; }

/* Reveal-on-scroll. JS adds .is-in; without JS the content is simply visible. */
[data-rv] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
[data-rv].is-in { opacity: 1; transform: none; }

/* Word-reveal headings. */
.mi-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em);
  filter: blur(6px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), filter 0.6s var(--ease);
}
.is-in .mi-word { opacity: 1; transform: none; filter: none; }

/* ============================================================ layout */

.mi-container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.mi-section { padding-top: var(--rhythm); }
.mi-section--sub { padding-top: var(--rhythm-sub); }
.mi-section--prose { max-width: var(--prose); }
.mi-section--flush { padding-top: 0; }

/*
 * Section header. The full-width rule above every one of the seventeen sections
 * was doing the job whitespace should do, and repeating it that many times is
 * what made the page scan as a template. The kicker's own short rule now marks
 * the start, and the sections are separated by air instead.
 */
.mi-secheader {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
}
.mi-secheader__lead { margin-top: -4px; }

.mi-two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 4vw, 72px);
}
.mi-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 20px;
}
.mi-stack { display: flex; flex-direction: column; }
.mi-row { display: flex; align-items: center; flex-wrap: wrap; }
.mi-spacer { flex: 1; }

/* ============================================================ typography */

/*
 * Serif display wants the opposite treatment to the grotesk it replaces:
 * lighter weight, near-zero tracking, and a touch more line-height. Cranking a
 * serif to 800 and -0.025em is what makes a serif look like a sans in costume.
 */
.mi-h1 {
  font-family: var(--ui);
  font-weight: 500;
  font-size: clamp(52px, 7vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  margin: 0;
  max-width: 16ch;
  text-wrap: pretty;
}
.mi-h1 em, .mi-h2 em, .mi-h3 em {
  font-style: italic;
  font-weight: 400;
}
.mi-h1 sup {
  font-size: 0.36em;
  font-weight: 700;
  vertical-align: super;
  letter-spacing: 0;
  margin-left: 0.04em;
}
.mi-h1--sub {
  font-size: clamp(44px, 5.8vw, 86px);
  line-height: 1.03;
  letter-spacing: -0.028em;
  max-width: 18ch;
}

.mi-h2 {
  font-family: var(--ui);
  font-weight: 500;
  font-size: clamp(38px, 4.4vw, 62px);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0;
  max-width: 22ch;
  text-wrap: pretty;
}
.mi-h2--wide { max-width: 24ch; }
.mi-h2--sub {
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.022em;
  max-width: 20ch;
}
.mi-h2--cta {
  font-size: clamp(40px, 5.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 18ch;
  margin: 0 auto;
}

.mi-h3 {
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(20px, 1.9vw, 28px);
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: pretty;
}

.mi-lead {
  font-size: 19px;
  line-height: 1.65;
  color: #DADEE5;
  max-width: 64ch;
  margin: 0;
  text-wrap: pretty;
}
.mi-lead--hero {
  font-size: clamp(17px, 1.55vw, 20px);
  line-height: 1.6;
  color: #E7EAF0;
  max-width: 54ch;
  text-shadow: 0 1px 24px rgba(8, 9, 11, 0.7);
}
.mi-lead--sub {
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--dim);
  max-width: 62ch;
}

.mi-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--dim);
  max-width: 52ch;
  margin: 0;
  text-wrap: pretty;
}

/* Micro-labels and eyebrows are Cabinet Grotesk, never mono, never ALL-CAPS. */
.mi-label {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--dim-2);
}
.mi-label--amber { color: var(--amber); }
.mi-label--cobalt { color: #A6B6FF; }

.mi-numeral {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--dim-2);
  width: 26px;
  flex-shrink: 0;
}

.mi-stat__value {
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--amber);
}
.mi-stat__label {
  font-size: 15px;
  line-height: 1.55;
  color: var(--dim);
  margin-top: 10px;
  max-width: 26ch;
  text-wrap: pretty;
}
.mi-stats {
  display: flex;
  gap: clamp(28px, 5vw, 72px);
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--line-2);
}
.mi-stats > * { min-width: 190px; }

/* ============================================================ components */

/*
 * Section eyebrow. Was a cobalt pill with an icon, repeated seventeen times,
 * which is the single most template-looking element on the page. Now a hairline
 * and a quiet label: the same information, none of the decoration, and it lets
 * the serif headline underneath do the work.
 */
.mi-kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--dim-2);
  white-space: nowrap;
}
.mi-kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--dim-2);
  opacity: 0.55;
  flex-shrink: 0;
}

/* Buttons */
.mi-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  border-radius: 11px;
  padding: 16px 30px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.2s, border-color 0.2s, background 0.2s, color 0.2s, transform 0.25s var(--ease);
}
.mi-btn--primary { color: #08090B; background: var(--amber); }
.mi-btn--primary:hover { filter: brightness(1.1); color: #08090B; }
.mi-btn--secondary {
  color: var(--txt);
  background: transparent;
  border-color: var(--line-2);
  padding: 15px 28px;
}
.mi-btn--secondary:hover { border-color: var(--dim-2); background: var(--panel); color: var(--txt); }
.mi-btn--sm { font-size: 15px; padding: 12px 22px; border-radius: 10px; }
.mi-btn--lg { font-size: 16px; padding: 18px 36px; border-radius: 12px; }

.mi-textlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--amber);
}

/* Elevated card / panel. Optional cursor spotlight via --sa/--mx/--my. */
.mi-card {
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background:
    radial-gradient(520px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 199, 46, calc(0.13 * var(--sa, 0))), transparent 60%),
    linear-gradient(180deg, #14171E, #0E1116);
  box-shadow: 0 18px 50px -34px rgba(0, 0, 0, 0.9);
  padding: clamp(24px, 2.6vw, 36px);
}
.mi-card--flat {
  background: var(--panel);
  border-radius: 18px;
  transition: border-color 0.25s;
  box-shadow: none;
  padding: 30px;
}
.mi-card--flat:hover { border-color: var(--dim-2); }
/* Wrapper card that holds a stack of editorial rows. */
.mi-card--rows {
  border-radius: 22px;
  background:
    radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 199, 46, calc(0.10 * var(--sa, 0))), transparent 60%),
    linear-gradient(180deg, rgba(21, 25, 32, 0.72), rgba(12, 14, 19, 0.72));
  box-shadow: none;
  padding: 12px 26px 26px;
}
.mi-card__divider { border-top: 1px solid var(--line); }

/* Editorial row, the workhorse list unit. */
.mi-erow {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 4px;
  border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
  transition: background 0.25s;
}
.mi-erow:hover { background: var(--panel); }
.mi-erow--roomy { align-items: baseline; gap: 24px; padding: 22px 4px; }
.mi-erow--link { padding: 22px 4px; }
.mi-erow__name {
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(18px, 1.6vw, 23px);
  letter-spacing: -0.015em;
  min-width: 190px;
}
.mi-erow__name--wide { min-width: 250px; font-size: clamp(19px, 1.7vw, 24px); }
.mi-erow__desc {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--dim);
  flex: 1;
  min-width: 260px;
  text-wrap: pretty;
}
.mi-erow__meta {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--dim-2);
  white-space: nowrap;
}
.mi-erow__meta--amber { color: var(--dim-2); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; }
/* Close every row stack with this bare rule. */
.mi-rows-end { border-top: 1px solid var(--line-2); }

/* Icon tile (tool / desk logos) */
.mi-tile {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
}
.mi-tile__img { width: 24px; height: 24px; object-fit: contain; }
.mi-tile__mono { font-family: var(--ui); font-weight: 800; font-size: 19px; }
.mi-tile i { font-size: 22px; }

/* Underline tabs */
.mi-tabs { display: flex; gap: 22px; flex-wrap: wrap; }
.mi-tab {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 9px 0 11px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--dim-2);
  transition: color 0.2s, border-color 0.2s;
}
.mi-tab.is-active { color: var(--txt); border-bottom-color: var(--amber); }
.mi-tabs--year { justify-content: center; gap: clamp(24px, 4vw, 48px); }
.mi-tabs--year .mi-tab {
  font-weight: 800;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -0.02em;
  border-bottom-width: 3px;
  padding: 0 2px 10px;
}
/* Pill variant (Tools, Proof of Impact) */
.mi-tabs--pill { gap: 8px; }
.mi-tabs--pill .mi-tab {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 11px 20px;
  color: var(--dim);
  transition: all 0.2s;
}
.mi-tabs--pill .mi-tab.is-active { background: var(--amber); border-color: var(--amber); color: #08090B; }

.mi-panel[hidden] { display: none; }

/* Signal bar */
.mi-signal { padding: 15px 2px; border-bottom: 1px solid var(--line); }
.mi-signal__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.mi-signal__k { font-family: var(--ui); font-weight: 700; font-size: 15.5px; }
.mi-signal__note { font-family: var(--ui); font-weight: 800; font-size: 14px; letter-spacing: 0.06em; }
.mi-track {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin-top: 11px;
  overflow: hidden;
}
.mi-track--thin { height: 3px; margin-top: 9px; }
.mi-track__fill {
  height: 100%;
  border-radius: 2px;
  transform-origin: left;
  animation: barIn 0.9s var(--ease) both;
}
.mi-score {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-top: 18px;
}
.mi-score__n {
  font-family: var(--ui);
  font-weight: 800;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.mi-score__v { font-size: 15px; line-height: 1.6; color: var(--dim); text-wrap: pretty; }

/* Chips */
.mi-chip {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--dim);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 13px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  line-height: 1.4;
}
.mi-chip--step { padding: 7px 14px; background: transparent; box-shadow: none; }
.mi-chip--use { padding: 8px 15px; background: rgba(255, 255, 255, 0.04); line-height: 1.1; white-space: nowrap; }
.mi-chip--proof {
  font-family: var(--ui);
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: 0.07em;
  color: var(--good);
  border-color: rgba(52, 211, 153, 0.28);
  background: transparent;
  box-shadow: none;
  padding: 7px 14px;
}
.mi-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Accordion */
/*
 * An open row used to paint a hard-edged slab of --panel that ran the full
 * container width and stopped dead, so the corners read as a rendering fault
 * rather than a surface. It now has its own rounded, inset panel that sits
 * inside the row and is obviously a deliberate shape.
 */
.mi-acc__item { border-top: 1px solid var(--line-2); transition: border-color 0.35s; }
.mi-acc__item.is-open { border-top-color: transparent; }
.mi-acc__item.is-open + .mi-acc__item { border-top-color: transparent; }
.mi-acc__panel {
  border-radius: 16px;
  background: rgba(15, 17, 20, 0.72);
  border: 1px solid transparent;
  transition: background 0.35s, border-color 0.35s;
  padding: 0 clamp(10px, 1.4vw, 22px);
}
.mi-acc__item.is-open > .mi-acc__panel {
  background: linear-gradient(180deg, rgba(21, 25, 32, 0.94), rgba(12, 14, 19, 0.94));
  border-color: var(--line-2);
}
.mi-acc__head {
  display: flex;
  width: 100%;
  align-items: baseline;
  gap: 22px;
  padding: 26px 4px;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: var(--ui);
}
.mi-acc__name {
  font-weight: 800;
  font-size: clamp(26px, 2.6vw, 40px);
  letter-spacing: -0.02em;
  color: var(--txt);
  transition: color 0.3s;
}
.is-open .mi-acc__head .mi-acc__name { color: var(--amber); }
.mi-acc__teaser { font-size: 15px; color: var(--dim); flex: 1; min-width: 180px; font-family: var(--body); }
.mi-acc__icon { font-size: 17px; color: var(--dim-2); transition: transform 0.3s, color 0.3s; }
.is-open .mi-acc__head .mi-acc__icon { transform: rotate(45deg); color: var(--amber); }
.mi-acc__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
}
.is-open .mi-acc__body { grid-template-rows: 1fr; }
.mi-acc__inner { overflow: hidden; min-height: 0; }

/* FAQ variant: smaller heads, prose answer. */
.mi-acc--faq .mi-acc__head { gap: 20px; padding: 24px 4px; }
.mi-acc--faq .mi-acc__name { font-weight: 700; font-size: clamp(18px, 1.8vw, 23px); letter-spacing: -0.01em; flex: 1; }
.mi-acc--faq .mi-numeral { width: 30px; }
.mi-acc__answer {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--dim);
  margin: 0;
  padding: 0 4px 26px 50px;
  max-width: 62ch;
  text-wrap: pretty;
}

/* Expanded practice grid: Process / Outcome / Includes */
.mi-row-feature {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.8fr;
  gap: clamp(24px, 3vw, 48px);
  padding: 6px 4px 36px 46px;
}
.mi-row-feature__head {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--dim-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.mi-row-feature__head--amber { color: var(--dim-2); }
.mi-includes__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--ui);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--dim);
  transition: color 0.2s;
}
.mi-includes__link:hover { color: var(--amber); }

/* Logo wall */
.mi-logo-wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.mi-logo-wall--5 { grid-template-columns: repeat(5, 1fr); }
.mi-logo-wall__cell {
  height: 104px;
  background: #0A0C0F;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
}
.mi-logo-wall__cell img { max-height: 100%; object-fit: contain; }
/*
 * Placeholder wordmark, shown until a real client logo is uploaded. Was #4B5058,
 * which measures 2.19:1 and fails WCAG AA. These are visible to real visitors for
 * as long as the logos are missing, so they have to be readable.
 */
.mi-logo-wall__cell--empty {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #80858D;
}

/* Marquee */
.mi-marquee {
  margin-top: var(--rhythm);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
  overflow: hidden;
}
.mi-marquee__track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 56px;
  padding-right: 56px;
  animation: marquee 34s linear infinite;
}
.mi-marquee:hover .mi-marquee__track { animation-play-state: paused; }
.mi-marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 56px;
  white-space: nowrap;
}
.mi-marquee__word {
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1;
  letter-spacing: -0.015em;
  color: rgba(155, 161, 171, 0.5);
}
.mi-marquee__rule {
  width: 1px;
  height: 30px;
  background: var(--line-2);
  display: inline-block;
  flex-shrink: 0;
}

/* Grain overlay */
.mi-grain {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Fixed background stack */
/* Static stand-in, painted behind the canvas so the page is never flat black. */
.mi-bg-fallback {
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.6s var(--ease);
  background-color: #0A0E1C;
}
/*
 * Three drifting cobalt blooms. They have to be this saturated to survive the
 * 0.32-0.56 legibility scrim that sits above them; anything subtler reads as
 * flat black once the scrim lands, which defeats the point of having a fallback.
 * Each layer moves on its own cycle so the field never visibly loops.
 */
.mi-bg-fallback::before,
.mi-bg-fallback::after {
  content: "";
  position: absolute;
  inset: -25%;
  background-repeat: no-repeat;
  will-change: transform;
}
.mi-bg-fallback::before {
  background:
    radial-gradient(38% 46% at 30% 32%, rgba(61, 90, 254, 0.95) 0%, rgba(61, 90, 254, 0) 68%),
    radial-gradient(30% 38% at 74% 66%, rgba(90, 120, 255, 0.75) 0%, rgba(90, 120, 255, 0) 70%);
  animation: bgDriftA 38s ease-in-out infinite alternate;
}
.mi-bg-fallback::after {
  background:
    radial-gradient(34% 42% at 68% 22%, rgba(22, 34, 94, 0.95) 0%, rgba(22, 34, 94, 0) 72%),
    radial-gradient(42% 50% at 22% 78%, rgba(61, 90, 254, 0.55) 0%, rgba(61, 90, 254, 0) 74%);
  animation: bgDriftB 53s ease-in-out infinite alternate;
}
@keyframes bgDriftA {
  0%   { transform: translate3d(-6%, 4%, 0) scale(1.05) rotate(0deg); }
  100% { transform: translate3d(8%, -6%, 0) scale(1.22) rotate(22deg); }
}
@keyframes bgDriftB {
  0%   { transform: translate3d(7%, -5%, 0) scale(1.18) rotate(0deg); }
  100% { transform: translate3d(-8%, 6%, 0) scale(1.03) rotate(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mi-bg-fallback::before,
  .mi-bg-fallback::after { animation: none; }
}
/*
 * The canvas sits at opacity 0.9, so leaving the fallback lit would tint the
 * approved gradient. modules.js sets this class once the canvas is actually
 * painting, and the stand-in fades away.
 */
.mi-has-webgl-bg .mi-bg-fallback { opacity: 0; }
.mi-bg-gradient { position: fixed; inset: 0; z-index: -3; pointer-events: none; overflow: hidden; }
/*
 * Soften the canvas. The marbling has a lot of high-frequency detail, and text
 * over a busy pattern is hard to read even when the contrast ratio is fine. A
 * blur keeps the colour and the motion, which is the part worth having, and
 * removes the fine structure that was fighting the type. The layer is scaled up
 * so the blur has material to sample at the edges instead of fading out.
 */
.mi-bg-gradient animated-gradient {
  filter: blur(34px) saturate(1.05);
  transform: scale(1.14);
  transform-origin: center;
}
.mi-bg-gradient animated-gradient { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }
/*
 * Legibility scrim. The brief set this at 0.32-0.56 to keep the gradient vivid,
 * but at those values small meta text measured 4.1:1, below the 4.5:1 the WCAG
 * AA floor asks for. Raised until every text token clears AA against the
 * brightest part of the animation. The gradient is still clearly alive; it is
 * just no longer competing with the words on top of it.
 */
.mi-bg-scrim {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 9, 11, 0.52), rgba(8, 9, 11, 0.64) 55%, rgba(8, 9, 11, 0.72));
}
.mi-bg-dots {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  background-image: radial-gradient(circle, rgba(255, 199, 46, 0.55) 1.3px, transparent 1.3px);
  background-size: 30px 30px;
}

/* Local gradient wash (hero, CTA, banner) */
.mi-wash { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/*
 * The inline stand-in gradient on .mi-wash exists only for the case where the
 * canvas never paints. Once it does, drop it: the canvas is semi-transparent, so
 * leaving the stand-in underneath would tint the approved colours.
 */
.mi-has-webgl-bg .mi-wash { background: none !important; }
.mi-wash animated-gradient { position: absolute; inset: 0; width: 100%; height: 100%; }
.mi-wash__scrim { position: absolute; inset: 0; }

/* ------------------------------------------------------------ icons */

/*
 * Inline SVG replacements for the Phosphor webfont. Sized in em so every
 * existing font-size that used to drive the icon still does, and set to
 * currentColor so the colour rules that targeted the old <i> still apply.
 */
.mi-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.135em;
  fill: currentColor;
}
.mi-acc__icon .mi-icon { width: 17px; height: 17px; vertical-align: middle; }
.mi-nav__caret { width: 10px; height: 10px; opacity: 0.7; transition: transform 0.25s var(--ease); }
.mi-social .mi-icon { width: 19px; height: 19px; }
.mi-tile .mi-icon { width: 22px; height: 22px; }
.mi-navbtn .mi-icon { width: 18px; height: 18px; }
.mi-nav__toggle .mi-icon { width: 20px; height: 20px; }

/* ============================================================ header */

.mi-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 9, 11, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.mi-nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 72px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.mi-wordmark {
  font-family: var(--ui);
  font-weight: 800;
  font-size: 23px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mi-wordmark__chip {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #08090B;
  background: var(--amber);
  border-radius: 4px;
  padding: 3px 6px;
  transform: translateY(1px);
}
.mi-nav__links {
  display: flex;
  gap: 26px;
  font-size: 15px;
  font-weight: 500;
  color: var(--dim);
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.mi-nav__links .current-menu-item > a { color: var(--txt); }
.mi-nav__item { position: relative; }
.mi-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 24px 0;
  transition: color 0.2s;
}
.mi-nav__link.is-current { color: var(--txt); }
.mi-nav__caret { font-size: 10px; transition: transform 0.25s var(--ease); opacity: 0.7; }
.mi-nav__item.is-open > .mi-nav__link { color: var(--amber); }
.mi-nav__item.is-open .mi-nav__caret { transform: rotate(180deg); }

/* Dropdown panel. Uses the elevated-card treatment so it reads as part of the
   same system rather than a browser-default menu. */
.mi-navpanel {
  position: absolute;
  top: 100%;
  left: -22px;
  z-index: 70;
  padding-top: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}
.mi-nav__item.is-open > .mi-navpanel { opacity: 1; visibility: visible; transform: none; }
.mi-navpanel__inner {
  display: flex;
  gap: 28px;
  min-width: 300px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: linear-gradient(180deg, #14171E, #0E1116);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 30px 70px -30px rgba(0, 0, 0, 0.85);
  padding: 20px;
}
.mi-navpanel--wide .mi-navpanel__inner { min-width: 620px; }
.mi-navpanel__col { flex: 1; min-width: 0; }
.mi-navpanel__head {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--dim-2);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.mi-navpanel__link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}
.mi-navpanel__link:hover,
.mi-navpanel__link:focus-visible { background: var(--panel-2); color: inherit; }
.mi-navpanel__link.is-current { background: var(--panel-2); }
.mi-navpanel__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  color: var(--txt);
}
.mi-navpanel__label i { font-size: 12px; color: var(--dim-2); opacity: 0; transition: opacity 0.2s; }
.mi-navpanel__link:hover .mi-navpanel__label { color: var(--amber); }
.mi-navpanel__link:hover .mi-navpanel__label i { opacity: 1; }
.mi-navpanel__desc {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--dim-2);
  margin-top: 3px;
}

/* ------------------------------------------------------ mobile navigation */

.mi-mobilenav { display: flex; flex-direction: column; }
.mi-mobilenav__group { border-bottom: 1px solid var(--line); }
.mi-mobilenav__head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.mi-mobilenav__title {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.015em;
}
.mi-mobilenav__solo {
  display: block;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.015em;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
}
.mi-mobilenav__links { display: flex; flex-direction: column; padding: 0 0 16px; }
.mi-mobilenav__links .mi-navpanel__head { padding: 12px 2px 8px; margin-bottom: 0; }
.mi-mobilenav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 12px 14px;
  font-size: 16px;
  color: var(--dim);
  border-bottom: 1px solid rgba(34, 38, 45, 0.6);
}
.mi-mobilenav__link i { font-size: 12px; color: var(--dim-2); }
.mi-mobilenav__link.is-current { color: var(--amber); }
.mi-mobilenav__cta { margin-top: 28px; align-self: flex-start; }

.mi-nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel);
  color: var(--txt);
  font-size: 20px;
  cursor: pointer;
}

.mi-mobile-menu {
  position: fixed;
  inset: 72px 0 0;
  z-index: 55;
  background: rgba(8, 9, 11, 0.97);
  backdrop-filter: blur(18px);
  padding: 28px var(--gutter) 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
}
.mi-mobile-menu.is-open { opacity: 1; transform: none; visibility: visible; }
.mi-mobile-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
body.mi-menu-open { overflow: hidden; }

/* ============================================================ footer */

.mi-footer { border-top: 1px solid var(--line); background: #060708; }
.mi-footer__top {
  max-width: var(--container);
  margin: 0 auto;
  padding: 68px var(--gutter) 44px;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.mi-footer__blurb {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dim);
  margin: 16px 0 0;
  max-width: 36ch;
  text-wrap: pretty;
}
.mi-footer__links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  font-size: 14.5px;
  line-height: 2.4;
  color: var(--dim);
}
.mi-footer__links ul { list-style: none; margin: 0; padding: 0; }
.mi-footer__head {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--dim-2);
  margin-bottom: 8px;
}
.mi-social { display: flex; gap: 10px; margin-top: 24px; }
.mi-social a {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--dim);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.mi-social a:hover { color: var(--amber); border-color: var(--dim-2); background: var(--panel-2); }
.mi-footer__bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--gutter) 32px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--dim-2);
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.mi-hash { font-family: var(--ui); font-weight: 700; letter-spacing: 0.08em; }
/* The legal menu sits on the copyright line, not under it. */
.mi-footer__legal,
.mi-footer__legal-inline { display: inline; }
.mi-footer__legal { list-style: none; margin: 0; padding: 0; }
.mi-footer__legal li { display: inline; }
.mi-footer__legal li::before { content: " · "; }

/* ============================================================ forms */

.mi-field { display: flex; flex-direction: column; gap: 10px; }
.mi-field > label {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--dim-2);
}
.mi-input,
.mi-textarea,
.mi-select {
  font-family: var(--body);
  font-size: 15px;
  color: var(--txt);
  background: rgba(8, 9, 11, 0.6);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 15px 18px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}
.mi-input:focus,
.mi-textarea:focus,
.mi-select:focus { border-color: var(--dim-2); }
.mi-input::placeholder, .mi-textarea::placeholder { color: var(--dim-2); }
.mi-textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
/*
 * Honeypot. The old left:-9999px trick pushes a real 300px box far outside the
 * layout, which some engines still count toward scrollable overflow. Clipping to
 * a zero-size box hides it from people just as well, keeps it fillable by bots,
 * and contributes nothing to page width.
 */
.mi-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.mi-notice {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.6;
}
.mi-notice--ok { border-color: rgba(52, 211, 153, 0.35); color: var(--good); }
.mi-notice--bad { border-color: rgba(248, 113, 113, 0.35); color: var(--bad); }

/* ============================================================ prose (legal, WYSIWYG) */

.mi-prose { max-width: 74ch; font-size: 16.5px; line-height: 1.75; color: var(--dim); }
.mi-prose > * + * { margin-top: 20px; }
.mi-prose h2 {
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.018em;
  color: var(--txt);
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--line-2);
  text-wrap: pretty;
}
.mi-prose h3 {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.012em;
  color: var(--txt);
  margin-top: 32px;
}
.mi-prose ul, .mi-prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.mi-prose a { color: var(--amber); font-weight: 600; }
.mi-prose strong { color: var(--txt); }
.mi-prose blockquote {
  border-left: 2px solid var(--amber);
  padding-left: 22px;
  color: var(--dim);
  font-size: 18px;
}

/*
 * Tables. The theme had no table styles at all, so any table in prose fell back
 * to the browser default: white background, serif text, hairline borders. On a
 * dark page that reads as a rendering fault. The comparison table in the post
 * series is the first content on the site to need them.
 *
 * The wrapper scrolls rather than the page, so a four-column table cannot force
 * the body into horizontal overflow on a phone.
 */
.mi-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 26px 0; }
.mi-prose table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-family: var(--ui);
  font-size: 14.5px;
  line-height: 1.55;
}
.mi-prose thead th {
  text-align: left;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line);
}
.mi-prose tbody td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line-2);
  color: var(--dim);
  vertical-align: top;
}
/* The publisher's own row. Marking it is more honest than letting it blend in. */
.mi-prose tbody tr:first-child td { color: var(--txt); font-weight: 600; }
.mi-prose tbody tr:last-child td { border-bottom: 0; }
.mi-tablenote { font-family: var(--ui); font-size: 13px; color: var(--dim-2); }

/* Unsupplied figures, so a gap is visible rather than quietly filled. */
.mi-needsdata {
  background: rgba(255, 199, 46, 0.14);
  color: var(--amber);
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

/* ============================================================ misc utilities */

.mi-breadcrumb {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--dim-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mi-breadcrumb a { transition: color 0.2s; }
.mi-breadcrumb a:hover { color: var(--amber); }
.mi-breadcrumb [aria-current="page"] { color: var(--dim); }
.mi-breadcrumb__sep { color: var(--line-2); }
.mi-eyebrow-amber {
  font-family: var(--ui);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--amber);
}
.mi-hashtag {
  font-family: var(--ui);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--amber);
}
.mi-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  animation: pulse 2s infinite;
  display: inline-block;
}
.mi-gradient-text {
  background: linear-gradient(92deg, var(--amber), #FF9E2E);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================ responsive */

@media (max-width: 1080px) {
  .mi-two-col,
  .mi-os-grid,
  .mi-case-panel,
  .mi-row-feature,
  .mi-desk-grid,
  .mi-sub-grid,
  .mi-contact-grid { grid-template-columns: 1fr !important; }
  .mi-desk-preview { display: none !important; }
  .mi-logo-wall { grid-template-columns: repeat(3, 1fr) !important; }
  .mi-stats-row { flex-wrap: wrap !important; }
  .mi-nav__links { display: none !important; }
  .mi-nav__toggle { display: inline-flex; }
  .mi-res-grid,
  .mi-footer__top { grid-template-columns: 1fr !important; }
  .mi-row-feature { padding-left: 4px; }
  .mi-sticky-panel { position: static !important; }
}

@media (max-width: 860px) {
  :root { --gutter: 22px; }
  .mi-nav__cta { display: none; }
  .mi-acc__teaser { display: none; }
  .mi-stats-row > * { border-left: none !important; padding-left: 0 !important; }
}

/*
 * Horizontal-overflow guards.
 *
 * Grid and flex children default to min-width:auto, which refuses to shrink
 * below their content's minimum. On the homepage that let the stat row push the
 * document 96px wider than a 375px viewport, so the whole page could be dragged
 * sideways. Track children are told they may shrink, and the two items with hard
 * pixel minimums drop those minimums once there is no room for them.
 */
.mi-os-grid > *,
.mi-two-col > *,
.mi-desk-grid > *,
.mi-case-panel > *,
.mi-sub-grid > *,
.mi-res-grid > *,
.mi-contact-grid > *,
.mi-row-feature > * { min-width: 0; }

@media (max-width: 460px) {
  /* Last-resort guards for the narrowest phones, where any fixed minimum wins. */
  .mi-navpanel__inner,
  .mi-navpanel--wide .mi-navpanel__inner { min-width: 0; }
  .mi-sub__form .mi-input { min-width: 0; }
  .mi-hud__thead,
  .mi-hud__prow { flex-wrap: wrap; }
  .mi-hud__share { width: auto; }
  .mi-btn { white-space: normal; }
}

@media (max-width: 760px) {
  .mi-stats-row { gap: 28px 34px; }
  .mi-stats-row__cell,
  .mi-stats-row__cell + .mi-stats-row__cell { padding: 24px 0 0 !important; }
  .mi-inkwell__shot { min-width: 0; width: 100%; flex-basis: 100%; }
  .mi-inkwell__copy { min-width: 0; }
  .mi-hud__movetext,
  .mi-erow__desc,
  .mi-erow__name,
  .mi-process__desc,
  .mi-process__name { min-width: 0; }
}

@media (max-width: 720px) {
  .mi-footer__links { grid-template-columns: 1fr 1fr !important; }
  .mi-acc__answer { padding-left: 4px; }
}

@media (max-width: 640px) {
  .mi-logo-wall { grid-template-columns: 1fr 1fr !important; }
  .mi-erow { gap: 12px; }
  .mi-erow__name, .mi-erow__desc { min-width: 100%; }
}

/* ============================================================ reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-rv] { opacity: 1; transform: none; }
  .mi-word { opacity: 1; transform: none; filter: none; }
  .mi-marquee__track { animation: none; }
  .mi-track__fill { animation: none; }
}

/* ============================================================ print */

@media print {
  .mi-nav, .mi-footer, .mi-grain, .mi-bg-gradient, .mi-bg-scrim, .mi-bg-dots, .mi-wash { display: none !important; }
  body { background: #fff; color: #000; }
}


/* ---------------------------------------------------------------
   Editorial voice. Everything not listed here stays in the grotesk,
   because a serif below ~18px stops being elegant and starts being
   hard to read. This split is what gives the page two registers
   instead of one uniform texture.
   --------------------------------------------------------------- */
.mi-h1,
.mi-h2,
.mi-h3,
.mi-wordmark,
.mi-acc__name,
.mi-erow__name,
.mi-quote__text,
.mi-paper__title,
.mi-case__client,
.mi-case__statn,
.mi-shift__won,
.mi-marquee__word,
.mi-sub__h,
.mi-phase__name,
.mi-gain__argtitle,
.mi-thesis__argtitle,
.mi-inkwell__h,
.mi-essay__title,
.mi-coverage__headline,
.mi-related__title,
.mi-process__name,
.mi-archive__title,
.mi-stats-row__n,
.mi-stat__value,
.mi-score__n,
.mi-reading__n,
.mi-hud__big,
.mi-mobilenav__title,
.mi-detail__h3,
.mi-gain__insth3,
.mi-paper__series,
.mi-paper__vol {
  font-family: var(--display);
  font-weight: 500;
  font-synthesis-weight: none;
}
