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

html {
  margin: 0;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--font-regular);
  line-height: var(--leading-body);
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-heading);
  font-weight: var(--font-medium);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

h1 {
  font-size: clamp(var(--text-h1), 4.8vw, calc(var(--text-h1) * 2.2));
  line-height: 1.02;
}

h2 {
  font-size: clamp(var(--text-h2), 3.2vw, calc(var(--text-h2) * 2));
  line-height: 1.08;
}

h3 {
  font-size: clamp(var(--text-h3), 2.2vw, calc(var(--text-h3) * 1.6));
  line-height: 1.12;
}

h4 {
  font-size: clamp(var(--text-h4), 1.8vw, calc(var(--text-h4) * 1.38));
  line-height: 1.16;
}

h5 {
  font-size: clamp(var(--text-h5), 1.35vw, calc(var(--text-h5) * 1.22));
  line-height: 1.18;
}

h6 {
  font-size: clamp(var(--text-h6), 1.05vw, calc(var(--text-h6) * 1.12));
  line-height: 1.22;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

.screen-reader-text {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-shell__content {
  flex: 1 0 auto;
}

.site-container {
  width: min(100%, var(--container-width));
  margin: 0 auto;
  padding-inline: var(--container-padding-mobile);
}

.site-container--wide {
  width: min(100%, var(--container-wide));
}

.site-section {
  /*
   * A section token should represent one real gap between neighboring
   * sections, not top + bottom spacing that doubles into a large white band.
   */
  padding-block-start: var(--section-vertical-spacing);
  padding-block-end: 0;
}

.site-section--with-grid-accent {
  position: relative;
  overflow: clip;
  isolation: isolate;
  background: var(--color-background);
}

.site-section--with-grid-accent > .site-container {
  position: relative;
  z-index: 1;
}

.site-section__grid-accent {
  position: absolute;
  inset-block: 0;
  inset-inline: 0;
  pointer-events: none;
  opacity: var(--section-grid-opacity, 0.62);
  z-index: 0;
  -webkit-mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.94) 0%,
    rgba(0, 0, 0, 0.88) 16%,
    rgba(0, 0, 0, 0.58) 34%,
    rgba(0, 0, 0, 0.22) 50%,
    rgba(0, 0, 0, 0.58) 66%,
    rgba(0, 0, 0, 0.88) 84%,
    rgba(0, 0, 0, 0.94) 100%
  );
  mask-image: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.94) 0%,
    rgba(0, 0, 0, 0.88) 16%,
    rgba(0, 0, 0, 0.58) 34%,
    rgba(0, 0, 0, 0.22) 50%,
    rgba(0, 0, 0, 0.58) 66%,
    rgba(0, 0, 0, 0.88) 84%,
    rgba(0, 0, 0, 0.94) 100%
  );
}

.site-section__grid-accent::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      var(--color-background) 0%,
      color-mix(in srgb, var(--color-background) 82%, transparent) 6%,
      color-mix(in srgb, var(--color-background) 44%, transparent) 14%,
      transparent 24%,
      transparent 100%
    );
}

.site-section__grid-accent canvas {
  inline-size: 100% !important;
  block-size: 100% !important;
  display: block;
}

.stack {
  display: grid;
  gap: var(--space-2xl);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--card-grid-gap);
}

.grid--cards {
  grid-template-columns: 1fr;
}

.two-column {
  display: grid;
  gap: var(--card-grid-gap);
}

.list-plain {
  list-style: none;
}

.code-text {
  font-family: var(--font-mono);
  font-size: var(--text-code);
}

.ui-text {
  font-size: var(--text-ui);
}

.small-text {
  font-size: var(--text-small);
}

.muted-text {
  color: var(--color-text-secondary);
}

.entry-content > * + * {
  margin-block-start: var(--space-2xl);
}

.entry-content ul,
.entry-content ol {
  padding-inline-start: var(--space-2xl);
}

.entry-content a {
  color: var(--color-accent);
}

@media (min-width: 1024px) {
  .site-container {
    padding-inline: var(--container-padding-desktop);
  }

  .grid--cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1084px) {
  .site-section {
    padding-block-start: var(--section-vertical-spacing-tablet);
    padding-block-end: 0;
  }

  .site-section__grid-accent {
    opacity: var(--section-grid-opacity-tablet, 0.5);
    -webkit-mask-image: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.84) 16%,
      rgba(0, 0, 0, 0.54) 34%,
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0.54) 66%,
      rgba(0, 0, 0, 0.84) 84%,
      rgba(0, 0, 0, 0.92) 100%
    );
    mask-image: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.84) 16%,
      rgba(0, 0, 0, 0.54) 34%,
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0.54) 66%,
      rgba(0, 0, 0, 0.84) 84%,
      rgba(0, 0, 0, 0.92) 100%
    );
  }
}

@media (max-width: 767px) {
  .site-section {
    padding-block-start: var(--section-vertical-spacing-mobile);
    padding-block-end: 0;
  }

  .site-section__grid-accent {
    opacity: var(--section-grid-opacity-mobile, 0.28);
    -webkit-mask-image: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.8) 16%,
      rgba(0, 0, 0, 0.5) 34%,
      rgba(0, 0, 0, 0.16) 50%,
      rgba(0, 0, 0, 0.5) 66%,
      rgba(0, 0, 0, 0.8) 84%,
      rgba(0, 0, 0, 0.9) 100%
    );
    mask-image: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.8) 16%,
      rgba(0, 0, 0, 0.5) 34%,
      rgba(0, 0, 0, 0.16) 50%,
      rgba(0, 0, 0, 0.5) 66%,
      rgba(0, 0, 0, 0.8) 84%,
      rgba(0, 0, 0, 0.9) 100%
    );
  }
}
