:root {
  color-scheme: light;
  --page-bg: #fff;
  --ink: #111;
  --accent-blue: #3c70e4;
  --reading-width: 520px;
  --body-tracking: normal;
  --brand-tracking: normal;
}

:root.typography-pending body {
  visibility: hidden;
}

:root.has-helvetica {
  --body-tracking: -0.008em;
  --brand-tracking: -0.031em;
}

* {
  box-sizing: border-box;
}
html {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  min-height: 100vh;
  border-top: 26px solid var(--accent-blue);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  background: var(--page-bg);
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: var(--body-tracking);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-underline-offset: 3px;
  transition: color 180ms ease;
}
a:hover {
  color: var(--accent-blue);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 5px;
}
img,
svg {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-size: 1em;
  line-height: 1.2;
  font-weight: 700;
}
p + p {
  margin-top: 24px;
}
button,
input,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

.site-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: 56px auto 52px;
  color: var(--accent-blue);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: var(--brand-tracking);
  font-weight: 700;
  text-decoration: none;
}
.site-brand__mark {
  flex: 0 0 37px;
  width: 37px;
  height: 30px;
  background: currentColor;
  mask: url("/assets/ca_logo-icon.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/ca_logo-icon.svg") center / contain no-repeat;
}
.reading-column {
  width: min(var(--reading-width), calc(100% - 40px));
  margin-inline: auto;
  overflow-wrap: break-word;
}
.homepage-copy > p {
  line-height: 1.45;
}
.homepage-copy > h1 {
  margin-bottom: 24px;
}
.blog-index {
  margin-top: 56px;
}
.post-list {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}
.post-list__title {
  font-size: 20px;
}
.homepage .post-list__title {
  font-weight: 500;
}
.homepage .post-list__subtitle {
  color: #666;
}
.post-list__link {
  display: block;
  text-decoration: none;
}
.post-list__link:focus-visible {
  color: var(--accent-blue);
}
.post-list__subtitle {
  color: var(--ink);
  margin-top: 3px;
  font-size: 16px;
  line-height: 1.35;
}
.site-contact {
  margin: 64px max(30px, env(safe-area-inset-right)) 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: #fff;
  color: #a3a3a3;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.site-contact a {
  text-decoration: none;
}
/* Keep fixed contact links only where the homepage has room beside its copy. */
@media (min-width: 1100px) {
  body.homepage {
    padding-bottom: 120px;
  }
  .homepage .site-contact {
    position: fixed;
    right: max(30px, env(safe-area-inset-right));
    bottom: max(28px, env(safe-area-inset-bottom));
    z-index: 20;
    margin: 0;
  }
}

/* Research articles keep their data, figures, code and mathematical notation. */
.blog-article-page {
  --reading-width: 720px;
  line-height: 1.5;
}
.article-template__hero {
  margin-bottom: 36px;
}
.article-template__title {
  margin: 10px 0 14px;
  font-size: 28px;
}
.article-template__title-line {
  display: inline;
}
.article-template__dek {
  font-size: 20px;
  line-height: 1.35;
}
.article-template__date,
.article-template__author-block {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}
.article-template__author-block {
  margin-top: 20px;
}
.article-template__author-label {
  display: none;
}
.article-template__author-name {
  margin: 0;
}
.article-template__author-link {
  text-decoration: none;
}
.article-toc {
  margin: 32px 0;
  font-size: 16px;
}
.article-toc__list {
  margin: 12px 0 0;
  padding-left: 24px;
}
.article-toc__item + .article-toc__item {
  margin-top: 6px;
}
.article-section + .article-section {
  margin-top: 40px;
}
.article-section__title {
  margin-bottom: 18px;
  font-size: 22px;
}
.article-body__heading {
  margin: 32px 0 16px;
  font-size: 21px;
}
.article-body__subheading {
  margin: 24px 0 14px;
}
.article-body__paragraph + .article-body__paragraph {
  margin-top: 20px;
}
.article-body__list {
  margin: 20px 0;
  padding-left: 26px;
}
.article-body__list-item + .article-body__list-item {
  margin-top: 12px;
}
.article-body__quote {
  margin: 28px 0;
  padding-left: 20px;
  border-left: 2px solid var(--accent-blue);
}
.article-body__figure,
.article-body__split-media,
.article-body__interactive-frame {
  margin: 28px 0;
  min-width: 0;
}
.article-media__image {
  display: block;
  width: 100%;
  height: auto;
}
.article-media--small {
  max-width: 340px;
  margin-inline: auto;
}
.article-media__caption,
.article-body__caption {
  margin-top: 10px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}
.article-media__placeholder {
  padding: 40px 20px;
  background: #f5f5f5;
  color: #666;
  font-size: 14px;
  text-align: center;
}
.article-body__split {
  margin-block: 28px;
}
.article-body__split-copy > * + * {
  margin-top: 20px;
}
.article-body__interactive-frame-window {
  display: block;
  width: 100%;
  height: 560px;
  border: 1px solid #ddd;
  border-radius: 0;
}
.article-body__interactive-frame-actions {
  margin-top: 10px;
  font-size: 14px;
}
.article-body__code,
.article-bibtex__code {
  max-width: 100%;
  margin: 24px 0;
  padding: 16px;
  overflow-x: auto;
  background: #f6f6f6;
  border: 1px solid #e8e8e8;
  font:
    13px/1.6 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}
.article-body__paragraph code,
.article-body__list-item code {
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.article-code-card {
  overflow: hidden;
  border: 1px solid #e8e8e8;
  background: #f6f6f6;
}
.article-code-card__header {
  padding: 8px 14px;
  border-bottom: 1px solid #e8e8e8;
  font-size: 13px;
  color: #666;
}
.article-code-card__viewport {
  overflow-x: auto;
}
.article-code-card__code .shiki {
  margin: 0;
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
}
.article-body__math {
  max-width: 100%;
  overflow-x: auto;
  margin: 24px 0;
}
.article-body__math .katex-display {
  margin: 0;
  padding: 8px 0;
}
.article-template .katex {
  font-size: 1em;
}
.article-footnote-ref {
  font-size: 0.7em;
  vertical-align: super;
}
.article-footnotes,
.article-acknowledgments,
.article-bibtex {
  margin-top: 40px;
  font-size: 15px;
}
.article-footnotes__list {
  padding-left: 22px;
}
.article-footnotes__item + .article-footnotes__item {
  margin-top: 16px;
}
.article-acknowledgments__item {
  margin-top: 16px;
}
.article-bullet-list {
  display: grid;
  gap: 20px;
  margin: 24px 0;
}
.article-bullet-row {
  display: flex;
  gap: 12px;
}
.article-bullet-row__marker {
  color: var(--accent-blue);
}
.article-bullet-row__title {
  margin-bottom: 6px;
}
.article-not-found > * + * {
  margin-top: 20px;
}
[id] {
  scroll-margin-top: 24px;
}

body.doug-page {
  --body-tracking: normal;
  --brand-tracking: normal;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}
.doug-portrait {
  margin: 0 0 28px;
}
.doug-portrait img {
  display: block;
  width: 128px;
  height: 128px;
  object-fit: contain;
}
.doug-mode-toggle {
  display: block;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 180ms ease;
}
.doug-mode-toggle:hover {
  color: var(--accent-blue);
}

/* Other pages share the same column and typographic hierarchy. */
.agm-hero {
  margin-bottom: 28px;
}
.agm-hero h1,
.note h1 {
  font-size: 28px;
}
.agm-dek {
  margin-top: 16px;
}
.agm-prose,
.note {
  line-height: 1.5;
}
.agm-section,
.agm-apply {
  margin-top: 32px;
}
.agm-section h2 {
  margin-bottom: 16px;
}
.agm-prose p + p {
  margin-top: 20px;
}
.agm-apply-meta {
  margin-top: 16px;
  font-size: 16px;
}
.note h1 {
  margin-bottom: 28px;
}
.note h2 {
  margin: 28px 0 16px;
}
.note li + li {
  margin-top: 10px;
}
.note footer {
  margin-top: 32px;
  font-size: 16px;
}

@media (max-width: 640px) {
  body {
    border-top-width: 14px;
    font-size: 16px;
    line-height: 1.5;
  }
  .site-brand {
    margin: 36px auto 40px;
    font-size: 24px;
    gap: 10px;
  }
  .site-brand__mark {
    flex-basis: 28px;
    width: 28px;
    height: 22px;
  }
  .blog-index {
    margin-top: 42px;
  }
  .post-list__title {
    font-size: 16px;
    line-height: 1.35;
  }
  .post-list__subtitle {
    font-size: 14px;
    line-height: 1.4;
  }
  .post-list {
    gap: 24px;
  }
  .site-contact {
    margin: 56px max(20px, env(safe-area-inset-right)) 0;
    font-size: 14px;
  }
  .article-template__title,
  .agm-hero h1,
  .note h1 {
    font-size: 24px;
    line-height: 1.25;
  }
  .article-template__dek {
    font-size: 17px;
    line-height: 1.45;
  }
  .article-section__title {
    font-size: 20px;
    line-height: 1.3;
  }
  .article-body__heading {
    font-size: 18px;
    line-height: 1.35;
  }
  .article-body__interactive-frame-window {
    height: 480px;
  }
}
@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}
