/* ---------------------------------------------------------------------------
   ChunkTrace marketing site

   Tokens are RGB triplets on `.marketing` so every colour can take an alpha:
   rgb(var(--fg) / 0.6). The homepage is always dark; nothing here reads the
   OS colour scheme. `mk-*` are the page primitives. The product window and
   the findings panel show real screenshots of the dashboard (static/shots,
   taken by `npm run docs:screenshots`). The docs add docs.css on top.
   --------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

::selection {
  background: rgb(var(--accent) / 0.4);
  color: rgb(var(--fg));
}

/* ---------------------------------------------------------------------------
   Tokens
   --------------------------------------------------------------------------- */
.marketing {
  color-scheme: dark;

  /* Surfaces, darkest to lightest. --surface matches the product UI's dark bg. */
  --bg: 10 11 14;
  --surface: 15 17 21;
  --surface-2: 23 26 33;
  --surface-3: 30 34 42;
  --line: 36 40 48;
  --line-strong: 54 59 70;
  --fg: 232 234 238;
  --ink-soft: 196 200 208;
  --muted: 148 153 165;

  /* Accent: the product UI's own dark-theme accent (#60a5fa), used sparingly. */
  --accent: 96 165 250;
  --accent-hover: 125 182 252;
  --accent-active: 74 148 240;
  --accent-ink: 8 22 40;

  /* Status colours lifted from the product UI's dark theme, softened. */
  --ok: 110 212 150;
  --ok-bg: 20 60 38;
  --bad: 244 120 112;
  --bad-bg: 70 26 24;
  --warn: 240 184 68;
  --warn-bg: 66 44 10;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-window:
    0 0 0 1px rgb(0 0 0 / 0.7),
    0 1px 0 rgb(255 255 255 / 0.05) inset,
    0 50px 120px -40px rgb(0 0 0 / 0.95),
    0 24px 48px -28px rgb(0 0 0 / 0.8);
  --shadow-panel:
    0 1px 0 rgb(255 255 255 / 0.04) inset,
    0 30px 60px -36px rgb(0 0 0 / 0.9);

  background: rgb(var(--bg));
  color: rgb(var(--fg));
}

/* ---------------------------------------------------------------------------
   Layout primitives
   --------------------------------------------------------------------------- */
.mk-frame {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.mk-section {
  position: relative;
  padding-block: clamp(5rem, 9vw, 8rem);
}

.mk-section + .mk-section {
  border-top: 1px solid rgb(var(--line));
}

.mk-section-head {
  max-width: 40rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.mk-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: rgb(var(--accent));
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.mk-kicker::before {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgb(var(--accent));
  content: "";
}

.mk-h2 {
  margin: 1.1rem 0 0;
  color: rgb(var(--fg));
  font-size: clamp(1.85rem, 3.3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.08;
  text-wrap: balance;
}

.mk-lede {
  margin: 1.1rem 0 0;
  max-width: 34rem;
  color: rgb(var(--muted));
  font-size: 1.02rem;
  line-height: 1.68;
  text-wrap: pretty;
}

.mk-lede strong,
.mk-points strong {
  color: rgb(var(--ink-soft));
  font-weight: 500;
}

.mk-lede code,
.mk-points code,
.mk-steps code,
.mk-list code,
.mk-note code {
  padding: 0.1em 0.38em;
  border-radius: 5px;
  background: rgb(var(--fg) / 0.06);
  color: rgb(var(--ink-soft));
  font-size: 0.86em;
}

.mk-points {
  margin: 1.6rem 0 0;
  padding: 0;
  max-width: 34rem;
  list-style: none;
  color: rgb(var(--muted));
  font-size: 0.95rem;
  line-height: 1.6;
}

.mk-points li {
  position: relative;
  padding: 0.85rem 0 0.85rem 1.4rem;
  border-top: 1px solid rgb(var(--line));
}

.mk-points li:last-child {
  border-bottom: 1px solid rgb(var(--line));
}

.mk-points li::before {
  position: absolute;
  top: 1.45rem;
  left: 0.15rem;
  width: 0.5rem;
  height: 1px;
  background: rgb(var(--accent));
  content: "";
}

.mk-skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgb(var(--accent));
  color: rgb(var(--accent-ink));
  font-weight: 600;
  text-decoration: none;
}

.mk-skip:focus-visible {
  top: 0.75rem;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.mk-btn {
  display: inline-flex;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgb(var(--fg));
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms var(--ease-out);
}

.mk-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.mk-btn:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 3px;
}

.mk-btn:active {
  transform: translateY(1px);
}

.mk-btn-sm {
  height: 2.125rem;
  padding-inline: 0.8rem;
  border-radius: 8px;
  font-size: 0.8125rem;
}

.mk-btn-lg {
  height: 3rem;
  padding-inline: 1.35rem;
  border-radius: 12px;
  font-size: 0.9375rem;
}

.mk-btn-primary {
  background: rgb(var(--accent));
  border-color: rgb(var(--accent-active) / 0.7);
  color: rgb(var(--accent-ink));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    0 1px 2px rgb(0 0 0 / 0.4),
    0 10px 28px -14px rgb(var(--accent) / 0.6);
}

.mk-btn-secondary {
  background: rgb(var(--fg) / 0.04);
  border-color: rgb(var(--line-strong));
  color: rgb(var(--fg));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04);
}

.mk-btn-ghost {
  background: transparent;
  color: rgb(var(--muted));
}

@media (hover: hover) and (pointer: fine) {
  .mk-btn-primary:hover {
    background: rgb(var(--accent-hover));
    border-color: rgb(var(--accent-hover));
  }

  .mk-btn-secondary:hover {
    background: rgb(var(--fg) / 0.08);
    border-color: rgb(var(--fg) / 0.28);
  }

  .mk-btn-ghost:hover {
    background: rgb(var(--fg) / 0.06);
    color: rgb(var(--fg));
  }
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.mk-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: rgb(var(--bg) / 0.6);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  transition:
    border-color 200ms ease,
    background-color 200ms ease;
}

.mk-header[data-scrolled="true"],
.mk-header[data-open="true"] {
  border-bottom-color: rgb(var(--line));
  background: rgb(var(--bg) / 0.84);
}

.mk-header-row {
  display: flex;
  height: 3.75rem;
  align-items: center;
  gap: 0.5rem;
}

.mk-brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.6rem;
  margin-right: 0.75rem;
  border-radius: 8px;
  color: rgb(var(--fg));
  text-decoration: none;
}

.mk-brand:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 4px;
}

.mk-brand-mark {
  display: grid;
  width: 1.625rem;
  height: 1.625rem;
  place-items: center;
  border-radius: 7px;
  background: rgb(var(--accent));
  color: rgb(var(--accent-ink));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.35),
    0 1px 2px rgb(0 0 0 / 0.4);
}

.mk-brand-mark svg {
  width: 0.9rem;
  height: 0.9rem;
}

.mk-brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.mk-brand-version {
  padding: 0.1rem 0.4rem;
  border: 1px solid rgb(var(--line));
  border-radius: 999px;
  color: rgb(var(--muted));
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

.mk-nav {
  display: none;
  align-items: center;
  gap: 0.125rem;
}

.mk-nav-link {
  display: inline-flex;
  height: 2.125rem;
  align-items: center;
  padding-inline: 0.75rem;
  border-radius: 8px;
  color: rgb(var(--muted));
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.mk-nav-link:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

.mk-header-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 0.25rem;
}

.mk-header-actions .mk-btn-primary {
  margin-left: 0.35rem;
}

.mk-from-sm,
.mk-from-md {
  display: none;
}

.mk-menu-toggle {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: 0.25rem;
  place-items: center;
  border-radius: 8px;
  color: rgb(var(--muted));
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.mk-menu-toggle:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

.mk-menu-toggle .mk-icon-close,
.mk-menu-toggle[aria-expanded="true"] .mk-icon-menu {
  display: none;
}

.mk-menu-toggle[aria-expanded="true"] .mk-icon-close {
  display: block;
}

.mk-mobile-nav {
  border-top: 1px solid rgb(var(--line));
  background: rgb(var(--bg));
}

.mk-mobile-nav[hidden] {
  display: none;
}

.mk-mobile-nav-inner {
  display: grid;
  gap: 0.125rem;
  padding-block: 0.75rem 1rem;
}

.mk-mobile-nav-link {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  padding-inline: 0.75rem;
  border-radius: 8px;
  color: rgb(var(--fg));
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.mk-mobile-nav-link span {
  color: rgb(var(--muted));
}

.mk-mobile-nav-link:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: -2px;
}

.mk-mobile-nav-footer {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(var(--line));
}

@media (hover: hover) and (pointer: fine) {
  .mk-nav-link:hover,
  .mk-menu-toggle:hover,
  .mk-mobile-nav-link:hover {
    background: rgb(var(--fg) / 0.06);
    color: rgb(var(--fg));
  }
}

@media (min-width: 640px) {
  .mk-from-sm {
    display: inline-flex;
  }
}

@media (min-width: 1024px) {
  .mk-nav {
    display: flex;
  }

  .mk-from-md {
    display: inline-flex;
  }

  .mk-menu-toggle,
  .mk-mobile-nav {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Motion
   --------------------------------------------------------------------------- */
@keyframes mk-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mk-reveal {
  animation: mk-rise 760ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

.mk-io {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms var(--ease-out),
    transform 700ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.mk-io.is-in {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.mk-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip; /* unlike hidden, clip can't be scrolled by focus or scrollIntoView */
  padding-top: clamp(4.5rem, 11vh, 7.5rem);
  text-align: center;
}

.mk-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-position: center top;
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 72%);
  pointer-events: none;
}

.mk-grid-bottom {
  mask-image: radial-gradient(ellipse 70% 80% at 50% 100%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 100%, black 10%, transparent 70%);
}

.mk-hero-glow {
  position: absolute;
  z-index: -1;
  top: -22rem;
  left: 50%;
  width: 70rem;
  height: 40rem;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgb(var(--accent) / 0.1), rgb(var(--accent) / 0.025) 40%, transparent 68%);
  pointer-events: none;
}

.mk-eyebrow {
  display: inline-flex;
  height: 1.875rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.75rem 0 0.35rem;
  border: 1px solid rgb(var(--line));
  border-radius: 999px;
  background: rgb(var(--fg) / 0.03);
  color: rgb(var(--muted));
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background-color 150ms ease;
}

.mk-eyebrow code {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgb(var(--accent) / 0.14);
  color: rgb(var(--accent));
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mk-eyebrow svg {
  width: 0.8rem;
  height: 0.8rem;
  transition: transform 180ms var(--ease-out);
}

.mk-eyebrow:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 3px;
}

.mk-hero-title {
  max-width: 14ch;
  margin: 1.75rem auto 0;
  color: rgb(var(--fg));
  font-size: clamp(2.6rem, 7.2vw, 5.3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}

.mk-hero-title span {
  display: block;
}

.mk-hero-lede {
  max-width: 38rem;
  margin: 1.5rem auto 0;
  color: rgb(var(--muted));
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.mk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.mk-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0;
  margin: 1.5rem 0 0;
  color: rgb(var(--muted));
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.mk-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-inline: 0.85rem;
}

.mk-hero-meta span::before {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgb(var(--ok));
  content: "";
}

.mk-hero-meta span + span {
  border-left: 1px solid rgb(var(--line));
}

/* Product window ----------------------------------------------------------- */
.mk-shot {
  position: relative;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  text-align: left;
}

.mk-shot-fade {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 9rem;
  background: linear-gradient(to bottom, rgb(var(--bg) / 0), rgb(var(--bg)) 85%);
  pointer-events: none;
}

.mk-window {
  overflow: hidden;
  border: 1px solid rgb(var(--line-strong));
  border-radius: var(--radius-lg);
  background: rgb(var(--surface));
  box-shadow: var(--shadow-window);
}

.mk-window-chrome {
  display: flex;
  height: 2.5rem;
  align-items: center;
  gap: 0.75rem;
  padding-inline: 0.9rem;
  border-bottom: 1px solid rgb(var(--line));
  background: rgb(var(--surface-2));
}

.mk-window-dots {
  display: flex;
  gap: 0.4rem;
}

.mk-window-dots i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: rgb(var(--fg) / 0.14);
}

.mk-window-url {
  flex: 1;
  max-width: 28rem;
  margin-inline: auto;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgb(var(--line));
  border-radius: 6px;
  background: rgb(var(--bg) / 0.6);
  color: rgb(var(--muted));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The screenshot fills the window; its ratio is reserved before it loads. */
.mk-window-shot {
  width: 100%;
  height: auto;
  aspect-ratio: 2560 / 2000;
  background: rgb(var(--bg));
}

/* A phone gets the dashboard as a phone shows it, not a desktop window shrunk to fit. */
@media (max-width: 640px) {
  .mk-window-shot {
    aspect-ratio: 780 / 1520;
  }
}

.mk-shot-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.25rem;
}

.mk-shot-tabs-label {
  margin-right: 0.5rem;
  color: rgb(var(--muted));
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mk-tab {
  height: 2rem;
  padding-inline: 0.8rem;
  border: 1px solid rgb(var(--line));
  border-radius: 999px;
  background: rgb(var(--fg) / 0.03);
  color: rgb(var(--muted));
  font-size: 0.8rem;
  font-weight: 500;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.mk-tab[aria-selected="true"] {
  border-color: rgb(var(--accent) / 0.5);
  background: rgb(var(--accent) / 0.12);
  color: rgb(var(--fg));
}

.mk-tab:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .mk-tab:hover {
    color: rgb(var(--fg));
    border-color: rgb(var(--line-strong));
  }

  .mk-eyebrow:hover {
    border-color: rgb(var(--line-strong));
    color: rgb(var(--fg));
  }

  .mk-eyebrow:hover svg {
    transform: translateX(2px);
  }
}

/* ---------------------------------------------------------------------------
   Feature rows and demo panels
   --------------------------------------------------------------------------- */
.mk-feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}

.mk-feature-flip .mk-feature-copy {
  order: 2;
}

.mk-feature-flip .mk-feature-demo {
  order: 1;
}

.mk-feature-demo {
  min-width: 0;
}

.mk-panel {
  overflow: hidden;
  border: 1px solid rgb(var(--line-strong));
  border-radius: var(--radius-lg);
  background: rgb(var(--surface));
  box-shadow: var(--shadow-panel);
}

.mk-panel-bar {
  display: flex;
  height: 2.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: 0.9rem;
  border-bottom: 1px solid rgb(var(--line));
  background: rgb(var(--surface-2));
}

.mk-panel-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgb(var(--ink-soft));
}

.mk-panel-meta {
  color: rgb(var(--muted));
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mk-panel-shot {
  width: 100%;
  height: auto;
  padding: 1.1rem 1.1rem 1.25rem;
  background: rgb(11 13 19); /* the dashboard's own dark background, so the picture has no edge */
}

/* "Read more in the docs", under a feature's points. */
.mk-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  border-radius: 4px;
  color: rgb(var(--accent-hover));
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.mk-more:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 3px;
}

.mk-more span {
  transition: transform 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .mk-more:hover span {
    transform: translateX(3px);
  }
}

.mk-panel-body {
  padding: 0.9rem;
}

.mk-code,
.mk-term {
  margin: 0;
  padding: 1rem 1.1rem;
  color: rgb(var(--ink-soft));
  font-size: 0.76rem;
  line-height: 1.65;
  overflow: auto;
  tab-size: 2;
}

.mk-code code,
.mk-term code {
  font-family: var(--font-mono);
}

.mk-code .c {
  color: rgb(var(--accent));
}

.mk-code .s,
.mk-term .ok {
  color: rgb(var(--ok));
}

.mk-code .n {
  color: rgb(var(--warn));
}

.mk-code .cm {
  color: rgb(var(--muted));
}

.mk-code mark {
  display: block;
  margin-inline: -1.1rem;
  padding-inline: calc(1.1rem - 2px);
  border-left: 2px solid rgb(var(--accent));
  background: rgb(var(--accent) / 0.08);
  color: inherit;
}

.mk-term .p,
.mk-code .p {
  color: rgb(var(--accent));
  user-select: none;
}

.mk-term .d {
  color: rgb(var(--muted));
}

.mk-term .h {
  color: rgb(var(--fg));
  font-weight: 600;
}

.mk-term .bad {
  color: rgb(var(--bad));
  font-weight: 600;
}

.mk-codes-title {
  margin: 1.8rem 0 0.6rem;
  color: rgb(var(--muted));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mk-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-codes li {
  padding: 0.15rem 0.55rem;
  border: 1px solid rgb(var(--line));
  border-radius: 999px;
  color: rgb(var(--ink-soft));
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------------
   Steps, list, note
   --------------------------------------------------------------------------- */
.mk-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.mk-split-head {
  position: sticky;
  top: 5.5rem;
}

.mk-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.mk-steps li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.35rem 0;
  border-top: 1px solid rgb(var(--line));
  color: rgb(var(--muted));
  font-size: 0.98rem;
  line-height: 1.6;
}

.mk-steps li:last-child {
  border-bottom: 1px solid rgb(var(--line));
}

.mk-steps strong {
  display: block;
  margin-bottom: 0.2rem;
  color: rgb(var(--fg));
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mk-step-n {
  padding-top: 0.25rem;
  color: rgb(var(--accent));
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.mk-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(2rem, 5vw, 4rem);
  margin: 0;
}

.mk-list > div {
  padding: 1.2rem 0;
  border-top: 1px solid rgb(var(--line));
}

.mk-list dt {
  color: rgb(var(--fg));
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mk-list dd {
  margin: 0.35rem 0 0;
  color: rgb(var(--muted));
  font-size: 0.92rem;
  line-height: 1.6;
}

.mk-note {
  margin: 2.5rem 0 0;
  max-width: 48rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgb(var(--line));
  color: rgb(var(--muted));
  font-size: 0.9rem;
  line-height: 1.6;
}

.mk-note strong {
  color: rgb(var(--ink-soft));
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Closing and footer
   --------------------------------------------------------------------------- */
.mk-closing {
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  text-align: center;
}

.mk-closing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mk-closing-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  letter-spacing: -0.038em;
}

.mk-closing-lede {
  margin-inline: auto;
  max-width: 36rem;
  text-align: center;
}

.mk-closing-code {
  width: 100%;
  max-width: 44rem;
  margin-top: 2.25rem;
  border: 1px solid rgb(var(--line-strong));
  border-radius: var(--radius-lg);
  background: rgb(var(--surface));
  box-shadow: var(--shadow-panel);
  text-align: left;
}

.mk-closing .mk-hero-actions {
  margin-top: 2rem;
}

.mk-footer {
  border-top: 1px solid rgb(var(--line));
  padding-block: 2rem;
}

.mk-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.mk-footer .mk-brand {
  margin-right: 0;
}

.mk-footer-tagline {
  margin: 0;
  color: rgb(var(--muted));
  font-size: 0.82rem;
}

.mk-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: auto;
}

.mk-footer-links a {
  display: inline-flex;
  height: 2rem;
  align-items: center;
  padding-inline: 0.65rem;
  border-radius: 8px;
  color: rgb(var(--muted));
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.mk-footer-links a:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .mk-footer-links a:hover {
    background: rgb(var(--fg) / 0.06);
    color: rgb(var(--fg));
  }
}

/* ---------------------------------------------------------------------------
   Breakpoints
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .mk-feature,
  .mk-split {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .mk-feature-flip .mk-feature-copy {
    order: 1;
  }

  .mk-feature-flip .mk-feature-demo {
    order: 2;
  }

  .mk-split-head {
    position: static;
  }

  .mk-feature-copy,
  .mk-split-head {
    max-width: 40rem;
  }
}

@media (max-width: 768px) {
  .mk-section {
    padding-block: 4rem;
  }

  .mk-hero {
    padding-top: 3.5rem;
  }

  .mk-hero-title {
    letter-spacing: -0.035em;
  }

  .mk-hero-meta span {
    padding-inline: 0.6rem;
  }

  .mk-hero-actions .mk-btn-lg {
    width: 100%;
    max-width: 22rem;
  }

  .mk-window-url {
    display: none;
  }

  /* The header has room for the brand, one button and the menu. */
  .mk-header .mk-brand-version {
    display: none;
  }

  .mk-list {
    grid-template-columns: 1fr;
  }

  .mk-steps li {
    grid-template-columns: 2.4rem 1fr;
  }

  .mk-footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .mk-footer-links {
    margin-left: -0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mk-reveal {
    animation: none;
  }

  .mk-io {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .mk-btn,
  .mk-nav-link,
  .mk-tab,
  .mk-eyebrow,
  .mk-eyebrow svg,
  .mk-header {
    transition: none;
  }
}
