:root {
  --page-width: 72rem;
}

body {
  color: #3d3d3d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  text-decoration: none;
}

.page-column {
  width: min(calc(100% - 2rem), var(--page-width));
  margin-inline: auto;
}

.site-header {
  padding-block: 2rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.75rem 1.25rem;
  overflow-x: auto;
  white-space: nowrap;
  background: #f4f5f2;
  border: 1px solid #dedfdd;
  border-radius: 999px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: #111;
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
}

.site-brand__mark {
  flex: 0 0 auto;
  width: 1.625rem;
  aspect-ratio: 1;
  background: #ffd51f;
  border-radius: 50%;
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-menu a {
  display: block;
  padding: 0.5rem 0.625rem;
  color: #70716f;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

.site-menu a:hover {
  color: #111;
}

.site-nav-toggle {
  display: none;
}

.site-brand:focus-visible,
.site-menu a:focus-visible,
.site-nav-toggle:focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.page-main {
  padding-block: 0.75rem 4rem;
}

.site-intro {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.65;
  text-wrap: pretty;
}

.site-intro > * + * {
  margin-block-start: 0.75em;
}

.site-intro a,
.article-text a {
  color: #2934d9;
}

.site-intro + .latest-articles {
  margin-block-start: clamp(2.5rem, 5vw, 4rem);
}

.section-heading {
  margin-block-end: 1rem;
  color: #2934d9;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.article-list__item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 1.5rem;
  padding-block: 1rem;
  border-block-end: 1px dotted #d2d2d2;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.article-list__date {
  color: #737373;
  font-size: 0.9375rem;
}

.article-list__link {
  min-width: 0;
  overflow-wrap: anywhere;
  color: inherit;
  text-decoration: none;
}

.article-list__link:hover {
  color: #2934d9;
}

.page-main a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.article-body {
  max-width: 48rem;
}

.article-body h1 {
  margin-block-end: 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.2;
}

.article-text {
  max-width: 42rem;
  margin-block-start: 2rem;
  font-size: clamp(1rem, calc(0.875rem + 0.3125vw), 1.125rem);
  line-height: 1.7;
}

.article-text > * + *,
.article-markdown > * + * {
  margin-block-start: 1em;
}

.article-text :is(h2, h3, h4, h5, h6) {
  margin-block-start: 1.8em;
  line-height: 1.3;
  font-weight: 500;
  text-wrap: pretty;
}

.article-text h2 { font-size: 1.5em; }
.article-text h3 { font-size: 1.25em; }
.article-text :is(h4, h5, h6) { font-size: 1.1em; }
.article-text :is(h2, h3, h4, h5, h6) + * { margin-block-start: 0.6em; }
.article-text > :first-child { margin-block-start: 0; }
.article-text :is(ul, ol) { padding-inline-start: 1.5em; }
.article-text li + li { margin-block-start: 0.35em; }
.article-text li > :is(ul, ol) { margin-block-start: 0.35em; }

.article-text figure { margin-block: 1.5em; }
.article-text img { width: 100%; height: auto; }
.article-text figcaption {
  margin-block-start: 0.6rem;
  color: #737373;
  font-size: 0.875rem;
  line-height: 1.5;
}

.article-text .article-gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.75rem;
  padding: 0;
}
.article-gallery__grid li + li { margin: 0; }
.article-gallery__grid li:only-child { grid-column: 1 / -1; }

.article-text blockquote {
  border-inline-start: 4px solid #ffd51f;
  padding: 0.25em 0 0.25em 1.25em;
  font-size: 1.125em;
}
.article-text blockquote footer {
  margin-block-start: 0.65em;
  color: #737373;
  font-size: 0.875rem;
}
.article-text hr { margin-block: 2em; border: 0; border-block-start: 1px solid #dedfdd; }
.article-text code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.875em; }
.article-text :not(pre) > code { padding: 0.15em 0.3em; background: #f4f5f2; border-radius: 0.2rem; }
.article-text pre {
  overflow-x: auto;
  padding: 1.25rem;
  background: #f4f5f2;
  border: 1px solid #dedfdd;
  border-radius: 0.5rem;
  line-height: 1.6;
}
.article-text pre code { display: block; min-width: max-content; }
.article-text :is(iframe, video) { width: 100%; max-width: 100%; border: 0; }
.article-text iframe { aspect-ratio: 16 / 9; height: auto; }
.article-text video { height: auto; }
.table-scroll, .article-markdown { overflow-x: auto; overscroll-behavior-inline: contain; }
.table-scroll:focus-visible, .article-text pre:focus-visible { outline: 2px solid #2934d9; outline-offset: 3px; }
.article-text table { width: 100%; border-collapse: collapse; font-size: 0.9375em; line-height: 1.5; }
.article-text :is(th, td) { min-width: 7rem; padding: 0.75rem; border-block-end: 1px solid #dedfdd; text-align: left; vertical-align: top; }
.article-text th { font-weight: 500; background: #f4f5f2; }
.article-text tbody tr:nth-child(even) { background: #fafbf9; }
.article-text caption { margin-block-end: 0.65rem; text-align: left; font-size: 0.875rem; color: #737373; }
.error-page p { margin-block-start: 1rem; }
.error-page a { color: #2934d9; }

.site-footer {
  padding-block: 2.5rem 3rem;
  border-block-start: 1px solid #dedfdd;
}
.site-footer__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
.site-footer__description { max-width: 30rem; font-size: 1rem; line-height: 1.65; }
.site-footer__description > * + * { margin-block-start: 0.75em; }
.site-footer__description + nav { margin-block-start: 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { display: inline-block; padding-block: 0.4rem; font-size: 0.9375rem; color: #737373; }
.site-footer a:hover { color: #2934d9; }
.site-footer a:focus-visible, .newsletter-form input:focus-visible, .form-button:focus-visible { outline: 2px solid #2934d9; outline-offset: 3px; }
.site-footer__newsletter h2 { margin-block-end: 1rem; font-size: 1.125rem; font-weight: 500; }
.newsletter-form { max-width: 30rem; }
.newsletter-form label { display: block; margin-block-end: 0.4rem; font-size: 0.875rem; }
.newsletter-form__fields { display: flex; gap: 0.5rem; }
.newsletter-form input[type="email"] { min-width: 0; width: 100%; min-height: 2.875rem; padding: 0.65rem 0.75rem; background: #fff; border: 1px solid #c8cac5; border-radius: 0.5rem; }
.form-button { flex-shrink: 0; padding: 0.65rem 1rem; min-height: 2.875rem; border: 1px solid #ffd51f; border-radius: 0.5rem; background: #ffd51f; color: #111; font-weight: 500; cursor: pointer; }
.form-button:hover { background: #f4ca12; border-color: #f4ca12; }
.form-message { padding: 0.75rem 1rem; border-inline-start: 3px solid #ffd51f; background: #f4f5f2; }
.form-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.newsletter-page > * + * { margin-block-start: 1.25rem; }
.newsletter-page p { max-width: 42rem; line-height: 1.7; }
.newsletter-page a { color: #2934d9; }

@media (max-width: 42rem) {
  :root {
    --mobile-header-height: 4.5rem;
  }

  html {
    scroll-padding-block-start: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px) + 1rem);
  }

  .page-column {
    width: calc(100% - 1rem);
  }

  .site-header {
    width: 100%;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) 0 0;
    background: #f4f5f2;
    border-block-end: 1px solid #dedfdd;
  }

  .site-header.is-enhanced {
    position: fixed;
    inset: 0 0 auto;
    z-index: 30;
    box-shadow: 0 3px 16px rgb(25 28 20 / 4%);
  }

  .site-header.is-enhanced + .page-main {
    margin-block-start: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px) + 1px);
    padding-block-start: 1.5rem;
  }

  .site-nav {
    position: relative;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--mobile-header-height);
    padding: 0.75rem max(1rem, env(safe-area-inset-right, 0px)) 0.75rem max(1rem, env(safe-area-inset-left, 0px));
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .site-brand {
    gap: 0.625rem;
    min-height: 2.75rem;
    font-size: 1.25rem;
  }

  .site-brand__mark {
    width: 1.5rem;
  }

  .is-enhanced .site-nav-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    color: #20231e;
    background: transparent;
    border: 0;
    border-radius: 0.75rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 160ms ease;
  }

  .site-nav-toggle:hover,
  .site-nav-toggle[aria-expanded="true"] {
    background: #e7e9e3;
  }

  .site-nav-toggle__icon {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
  }

  .site-nav-toggle__icon span {
    position: absolute;
    inset: calc(50% - 1px) 0 auto;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform: translateY(-4px);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .site-nav-toggle__icon span:last-child {
    transform: translateY(4px);
  }

  .site-nav-toggle[aria-expanded="true"] .site-nav-toggle__icon span:first-child {
    transform: rotate(45deg);
  }

  .site-nav-toggle[aria-expanded="true"] .site-nav-toggle__icon span:last-child {
    transform: rotate(-45deg);
  }

  .is-enhanced .site-menu-panel {
    position: absolute;
    inset: 100% 0 auto;
    display: grid;
    grid-template-rows: 0fr;
    padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
    background: #f4f5f2;
    border-block-end: 1px solid #dedfdd;
    border-radius: 0 0 1.25rem 1.25rem;
    box-shadow: 0 16px 24px -12px rgb(25 28 20 / 18%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.375rem);
    transition: grid-template-rows 220ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 160ms ease,
      visibility 0s linear 220ms;
  }

  .is-enhanced.is-menu-open .site-menu-panel {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .site-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    overflow: hidden;
    border-block-start: 1px solid #dedfdd;
  }

  .is-menu-open .site-menu {
    max-height: calc(100dvh - var(--mobile-header-height) - env(safe-area-inset-top, 0px) - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .site-menu li:first-child {
    padding-block-start: 0.5rem;
  }

  .site-menu li:last-child {
    padding-block-end: 1rem;
  }

  .site-menu a {
    display: flex;
    align-items: center;
    min-height: 3rem;
    padding: 0.75rem;
    color: #3d3d3d;
    border-radius: 0.625rem;
    font-size: 1.0625rem;
    line-height: 1.5;
  }

  .site-menu a:hover,
  .site-menu a:focus-visible {
    background: #e7e9e3;
  }

  .site-menu a:focus-visible {
    outline-offset: -3px;
  }

  .site-header:not(.is-enhanced) .site-nav {
    flex-wrap: wrap;
  }

  .site-header:not(.is-enhanced) .site-menu-panel {
    width: 100%;
  }

  .article-list__item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
    font-size: 1rem;
  }

  .article-list__date {
    font-size: 0.8125rem;
  }

  .site-footer__content { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .site-footer { padding-block: 2rem; }
  .site-footer__newsletter { max-width: 30rem; }
}

@media (prefers-reduced-motion: reduce) {
  .site-menu-panel,
  .site-nav-toggle,
  .site-nav-toggle__icon span {
    transition: none;
  }
}
