/* Home page: "Solutions that fit", the module index (assets/js/modules.js). */
#home .md-section { padding: 120px 24px 128px; background: #fff; font-family: var(--mag-sans); }
.md { --md-ink: #0b1d33; --md-text: #3d4f66; --md-muted: #7a8899; --md-line: #e6ebf1; --md-blue: #1f4e8c; --md-sky: #31a1f7;
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 72px; align-items: start; max-width: 1140px; margin: 0 auto; }

/* Left: heading, then the preview of the active module. */
.md-side { position: sticky; top: 112px; }
#home .md-side .section-label { margin-bottom: 26px; }
#home .md-side .section-headline { margin: 0 0 16px; font-size: clamp(40px, 5vw, 68px); }
.md-lede { max-width: 40ch; margin: 0; font-size: 17px; line-height: 1.65; color: var(--md-text); }

.md-preview { position: relative; margin-top: 44px; min-height: 290px; }
.md-card { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 360ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1); }
.md-card.is-active { opacity: 1; transform: none; pointer-events: auto; }
.md-card-num { display: block; margin-bottom: -18px; font-family: var(--mag-serif); font-size: 120px; font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1.2px #c9d7e5; letter-spacing: -0.04em; user-select: none; }
.md-card h3 { position: relative; margin: 0 0 10px; font-family: var(--mag-serif); font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: var(--md-ink); }
.md-card p { margin: 0 0 18px; max-width: 42ch; font-size: 15.5px; line-height: 1.6; color: var(--md-text); }
.md-card ul { display: grid; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.md-card li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--md-ink); }
.md-card li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--md-sky); box-shadow: 0 0 0 4px rgba(49, 161, 247, 0.12); }
.md-explore { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--md-blue); }
.md-explore span { transition: transform 260ms cubic-bezier(0.34, 1.4, 0.64, 1); }
.md-explore:hover span { transform: translateX(4px); }

/* Right: the index. */
.md-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--md-line); }
.md-row { position: relative; border-bottom: 1px solid var(--md-line); }
.md-btn { display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px; align-items: center; gap: 8px; width: 100%; padding: 22px 4px; text-align: left; cursor: pointer; }
.md-num { font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: 0.08em; color: var(--md-muted); transition: color 250ms ease; }
.md-name { font-family: var(--mag-serif); font-size: clamp(22px, 2.3vw, 30px); font-weight: 700; letter-spacing: -0.01em; color: #9aa8b8; transition: color 300ms ease, transform 450ms cubic-bezier(0.22, 1, 0.36, 1); }
.md-desc { display: none; }
.md-arrow { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--md-line); color: var(--md-muted); transition: background-color 250ms ease, color 250ms ease, box-shadow 250ms ease, transform 400ms cubic-bezier(0.34, 1.4, 0.64, 1); }
.md-arrow svg { width: 15px; height: 15px; }
.md-row.is-active .md-num { color: var(--md-blue); }
.md-row.is-active .md-name { color: var(--md-ink); transform: translateX(8px); }
.md-row.is-active .md-arrow { background: var(--md-ink); color: #fff; box-shadow: none; transform: rotate(-45deg); }
@media (hover: hover) and (pointer: fine) {
  .md-btn:hover .md-name { color: var(--md-ink); }
}
.md-btn:focus-visible { outline: 2px solid var(--md-blue); outline-offset: -2px; border-radius: 8px; }

/* The active row's line fills, then hands on to the next module. */
.md-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--md-sky); transform: scaleX(0); transform-origin: left; }
.md-row.is-active .md-progress { animation: md-fill 5.5s linear forwards; animation-play-state: paused; }
.md.is-playing .md-row.is-active .md-progress { animation-play-state: running; }
@keyframes md-fill { to { transform: scaleX(1); } }

/* Rows rise in one after another. */
.md-rise { opacity: 0; transform: translateY(16px); transition: opacity 700ms ease, transform 800ms cubic-bezier(0.22, 1, 0.36, 1); transition-delay: var(--md-delay, 0ms); }
.md.is-seen .md-rise { opacity: 1; transform: none; }

@media (max-width: 900px) {
  #home .md-section { padding: 88px 20px 96px; }
  .md { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .md-side { position: static; }
  .md-preview { display: none; }
  .md-btn { grid-template-columns: 40px minmax(0, 1fr) 36px; padding: 18px 2px; }
  .md-desc { display: block; grid-column: 2; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--md-muted); }
  .md-name { color: var(--md-ink); }
  .md-row.is-active .md-name { transform: none; }
  .md-progress { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .md-card, .md-name, .md-arrow, .md-rise { transition: none; }
  .md-rise { opacity: 1; transform: none; }
  .md-progress { display: none; }
}
