/* Swarm of Agents: the logo's colours (navy ink, amber, mint, cream), system sans type, one column.
   Light and dark follow the system setting; the header toggle overrides it (data-theme on <html>).
   Every colour is a light-dark() pair, so each one is defined once. */

:root {
  color-scheme: light dark;

  --site-width: 880px;
  --site-read: 720px;
  --site-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --site-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --site-bg: light-dark(#fbfaf7, #08161d);
  --site-fg: light-dark(#0b2530, #e8eef0);
  --site-muted: light-dark(#566870, #9bb0b8);
  --site-rule: light-dark(#e8e3d9, #1b303a);
  --site-card: light-dark(#ffffff, #0d1f28);
  --site-accent: light-dark(#a94a07, #fbbf24);
  --site-accent-strong: light-dark(#7c3608, #fcd34d);
  --site-amber: #f5a623;
  --site-amber-hover: #ffb940;
  --site-on-amber: #0b2530;
  --site-chip: light-dark(#fdeccb, #2b2210);
  --site-chip-fg: light-dark(#7a3c08, #fcd34d);
  --site-hero: light-dark(#fff3dd, #0f2530);
  --site-dot: light-dark(rgba(11, 37, 48, 0.13), rgba(232, 238, 240, 0.09));
  --site-mint: light-dark(rgba(127, 214, 168, 0.55), rgba(127, 214, 168, 0.16));
  --site-cyan: light-dark(rgba(43, 179, 201, 0.28), rgba(43, 179, 201, 0.14));
  --site-shadow: light-dark(rgba(11, 37, 48, 0.09), rgba(0, 0, 0, 0.45));
  --site-inline-code: light-dark(#f1ede4, #15303b);

  /* The theme's own variables, mapped onto ours. */
  --md-default-bg-color: var(--site-bg);
  --md-default-fg-color: var(--site-fg);
  --md-default-fg-color--light: var(--site-muted);
  --md-default-fg-color--lighter: light-dark(#9fadb3, #4f6570);
  --md-default-fg-color--lightest: var(--site-rule);
  --md-typeset-color: var(--site-fg);
  --md-typeset-a-color: var(--site-accent);
  --md-accent-fg-color: var(--site-accent-strong);
  --md-primary-fg-color: var(--site-fg);
  --md-text-font-family: var(--site-sans);
  --md-code-font-family: var(--site-mono);
  --md-code-bg-color: light-dark(#0b2530, #0f2934);
  --md-code-fg-color: #e8eef0;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
  background: var(--site-bg);
  color: var(--site-fg);
  font-family: var(--site-sans);
  -webkit-font-smoothing: antialiased;
}

/* One column, no sidebars. */
.md-main__inner.md-grid,
.site-header,
.site-footer {
  width: 100%;
  max-width: var(--site-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}
.md-main__inner.md-grid { margin-top: 0; }
.md-content { max-width: none; }
.md-content__inner { margin: 0; padding: 0 0 40px; }
.md-content__inner::before { display: none; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  padding-top: 22px;
  padding-bottom: 22px;
}
.site-name {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--site-fg);
  text-decoration: none;
}
.site-name img { width: 34px; height: 34px; border-radius: 50%; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 15px; font-weight: 550; }
.site-nav a { padding: 6px 12px; border-radius: 999px; color: var(--site-muted); text-decoration: none; }
.site-nav a:hover { color: var(--site-fg); background: var(--site-inline-code); }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--site-rule);
  border-radius: 999px;
  background: var(--site-card);
  color: var(--site-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--site-fg); border-color: var(--site-amber); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .icon-moon { fill: currentColor; stroke: none; }
/* The moon in light mode (switch to dark), the sun in dark mode. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
/* Phones: name and toggle on the first line, the links below. */
@media (max-width: 560px) {
  .site-header { padding-top: 16px; padding-bottom: 8px; }
  .site-name { order: 1; }
  .theme-toggle { order: 2; margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin-left: -12px; }
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 26px;
  padding-bottom: 48px;
  border-top: 1px solid var(--site-rule);
  font-size: 14px;
  color: var(--site-muted);
}
.site-footer__links { display: flex; gap: 18px; }
.site-footer a { color: var(--site-muted); text-decoration: none; }
.site-footer a:hover { color: var(--site-fg); }

/* Buttons */
.md-typeset .button,
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--site-amber);
  color: var(--site-on-amber);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(11, 37, 48, 0.12), 0 6px 18px rgba(245, 166, 35, 0.28);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.md-typeset .button:hover,
.button:hover { background: var(--site-amber-hover); color: var(--site-on-amber); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(11, 37, 48, 0.12), 0 10px 24px rgba(245, 166, 35, 0.36); }
.button--small { padding: 8px 15px; font-size: 14px; }

/* Home page hero: the logo on a cream panel, a faint dot grid and two soft glows in the logo's mint and cyan. */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  margin: 24px 0 48px;
  padding: 44px 44px 44px 48px;
  border: 1px solid var(--site-rule);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 22%, var(--site-mint), transparent 42%),
    radial-gradient(circle at 70% 95%, var(--site-cyan), transparent 40%),
    radial-gradient(circle, var(--site-dot) 1.2px, transparent 1.4px) 0 0 / 18px 18px,
    var(--site-hero);
  overflow: hidden;
}
.hero p { margin: 0; }
.hero__eyebrow {
  display: inline-block;
  margin-bottom: 18px !important;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--site-card);
  border: 1px solid var(--site-rule);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--site-muted);
}
.hero__title {
  margin: 0 0 16px;
  font-size: 46px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--site-fg);
}
.hero__lede { max-width: 30em; font-size: 19px; line-height: 1.55; color: var(--site-muted); }
.hero__logo {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 18px 30px var(--site-shadow));
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero:hover .hero__logo { transform: rotate(-8deg) scale(1.03); }
@media (prefers-reduced-motion: reduce) {
  .hero__logo, .button, .project-card { transition: none; }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding: 28px 24px 30px; border-radius: 22px; margin: 12px 0 36px; }
  .hero__logo { order: -1; width: 96px; height: 96px; }
  .hero__title { font-size: 34px; }
  .hero__lede { font-size: 17px; }
}

/* Project lists: the home page, categories and archives */
.list-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--site-muted);
  margin: 0 0 16px;
}
.list-header { margin-top: 32px; }
.list-header h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; margin: 0 0 24px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--site-rule);
  border-radius: 20px;
  padding: 24px 24px 22px;
  background: var(--site-card);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.project-card:hover { box-shadow: 0 14px 36px var(--site-shadow); transform: translateY(-3px); border-color: light-dark(#e2cfa9, #3a3420); }
.project-card__title { font-size: 22px; line-height: 1.25; font-weight: 750; letter-spacing: -0.025em; margin: 14px 0 0; }
.project-card__title a { color: var(--site-fg); text-decoration: none; }
.project-card__title a:hover { color: var(--site-accent); }
.project-card__desc { margin: 8px 0 20px; font-size: 16px; line-height: 1.55; color: var(--site-muted); }
.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: auto 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--site-rule);
}
.link-more { font-size: 15px; font-weight: 650; color: var(--site-fg); text-decoration: none; }
.link-more:hover { color: var(--site-accent); }
@media (max-width: 400px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* The meta line: category chips and date */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 550;
  color: var(--site-muted);
  font-variant-numeric: tabular-nums;
}
.post-meta__when { margin-left: 6px; white-space: nowrap; }
.md-typeset .post-category,
.post-category {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--site-chip);
  color: var(--site-chip-fg);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.md-typeset .post-category:hover,
.post-category:hover { background: var(--site-amber); color: var(--site-on-amber); }
.post-draft { font-size: 12px; border: 1px solid var(--site-rule); border-radius: 4px; padding: 0 6px; }

.md-typeset .back-link {
  display: inline-block;
  margin: 0 0 22px;
  font-size: 15px;
  font-weight: 550;
  color: var(--site-muted);
  text-decoration: none;
}
.md-typeset .back-link:hover { color: var(--site-fg); }

/* Reading: project pages and plain pages */
.md-typeset {
  font-size: 18px;
  line-height: 1.7;
  color: var(--site-fg);
}
.md-typeset.post,
.md-typeset.page { max-width: var(--site-read); margin: 0 auto; padding-top: 32px; }
.md-typeset h1 {
  font-size: 44px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--site-fg);
  margin: 14px 0 14px;
}
.post-lede { font-size: 21px; line-height: 1.5; color: var(--site-muted); margin: 0 0 26px !important; }
.post-cta { margin: 0 0 40px !important; }
.md-typeset h2,
.md-typeset h3 { letter-spacing: -0.025em; color: var(--site-fg); }
.md-typeset h2 { font-size: 26px; line-height: 1.3; font-weight: 750; margin: 44px 0 12px; }
.md-typeset h3 { font-size: 21px; line-height: 1.35; font-weight: 750; margin: 36px 0 12px; }
.md-typeset p, .md-typeset ul, .md-typeset ol { margin: 0 0 20px; }
.md-typeset li { margin-bottom: 6px; }
.md-typeset ul li::marker { color: var(--site-amber); }
.md-typeset a { color: var(--site-accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.md-typeset a:hover { color: var(--site-accent-strong); }
.md-typeset hr { border: 0; border-top: 1px solid var(--site-rule); margin: 40px 0; }
.md-typeset code, .md-typeset pre, .md-typeset kbd { font-family: var(--site-mono); }
.md-typeset :not(pre) > code { font-size: 0.85em; padding: 2px 6px; border-radius: 6px; background: var(--site-inline-code); color: var(--site-fg); }
.md-typeset pre > code { font-size: 14px; line-height: 1.6; padding: 18px 20px; border-radius: 14px; }
.md-typeset .headerlink { display: none; }

/* Loom demos: a framed 16:10-ish player. */
.md-typeset .video {
  position: relative;
  padding-bottom: 64.86%;
  height: 0;
  margin: 8px 0 0;
  border: 1px solid var(--site-rule);
  border-radius: 18px;
  overflow: hidden;
  background: var(--site-hero);
  box-shadow: 0 18px 44px var(--site-shadow);
}
.md-typeset .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.md-typeset .video-caption { margin: 12px 0 8px; text-align: center; font-size: 15px; color: var(--site-muted); }

/* Phones: slightly smaller type. */
@media (max-width: 560px) {
  .md-typeset { font-size: 17px; }
  .md-typeset.post, .md-typeset.page { padding-top: 20px; }
  .md-typeset h1 { font-size: 34px; }
  .md-typeset h2 { font-size: 23px; }
  .post-lede { font-size: 18px; }
  .project-card { padding: 20px 20px 18px; }
  .md-typeset .video { border-radius: 14px; }
}

/* Things the plain layout doesn't use */
.md-header, .md-tabs, .md-sidebar, .md-top, .md-footer, .md-content__button { display: none !important; }
