/*
 * @ackl/editorial
 * A deliberately quiet, content-first CSS system.
 *
 * All presentation is scoped to .editorial, so it can sit beside a component
 * library or utility framework without changing the rest of an application.
 */

:root {
  --ed-color-foreground: #111111;
  --ed-color-background: #ffffff;
  --ed-color-link: #222222;
  --ed-color-border: color-mix(in srgb, var(--ed-color-foreground) 24%, transparent);
  --ed-font-sans: "Arimo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --ed-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  --ed-space: 1.5rem;
  --ed-space-1: calc(var(--ed-space) / 4);
  --ed-space-2: calc(var(--ed-space) / 2);
  --ed-space-3: var(--ed-space);
  --ed-space-4: calc(var(--ed-space) * 1.5);
  --ed-space-5: calc(var(--ed-space) * 2);
  --ed-measure: 42rem;
  --ed-measure-narrow: 32rem;
  --ed-measure-wide: 50rem;
  --ed-page-padding: calc(var(--ed-space) + var(--ed-space-2));
  --ed-leading: 1.5;
  --ed-heading-leading: 1.1;
  --ed-radius: 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ed-color-foreground: #eeeeee;
    --ed-color-background: #111111;
    --ed-color-link: #dddddd;
  }
}

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

.editorial {
  min-height: 100vh;
  margin: 0;
  padding: var(--ed-page-padding);
  overflow-wrap: break-word;
  color: var(--ed-color-foreground);
  background: var(--ed-color-background);
  font-family: var(--ed-font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: var(--ed-leading);
}

.editorial :where(h1, h2, h3, h4, p, figure, blockquote, dl, dd) {
  margin-block: 0;
}

.editorial :where(ul, ol)[role="list"] {
  margin: 0;
  padding: 0;
  list-style: none;
}

.editorial :where(img, picture, svg) {
  display: block;
  max-width: 100%;
}

.editorial :where(input, button, textarea, select) {
  font: inherit;
}

.editorial :where(h1, h2, h3, h4, button, input, label) {
  line-height: var(--ed-heading-leading);
}

.editorial :where(h1, h2, h3, h4) {
  text-wrap: balance;
}

.editorial a {
  color: var(--ed-color-link);
  text-decoration: underline;
  text-decoration-skip-ink: auto;
  text-underline-offset: 0.12em;
}

.editorial a:hover {
  text-decoration-thickness: 0.125em;
}

.editorial__container {
  width: min(100%, var(--ed-measure));
  margin-inline: auto;
}

.editorial__container--narrow {
  max-width: var(--ed-measure-narrow);
}

.editorial__container--wide {
  max-width: var(--ed-measure-wide);
}

.editorial__section + .editorial__section {
  margin-block-start: var(--ed-space-5);
}

.editorial__heading {
  margin-block-end: var(--ed-space-2);
  font-size: 1em;
  font-weight: 700;
}

.editorial__heading--display {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.editorial__heading--section {
  margin-block-start: var(--ed-space-5);
  padding-block-end: var(--ed-space-1);
}

.editorial__lede {
  max-width: var(--ed-measure-narrow);
  font-size: 1.25em;
}

.editorial__stack > * + * {
  margin-block-start: var(--ed-space-2);
}

.editorial__stack--tight > * + * {
  margin-block-start: var(--ed-space-1);
}

.editorial__stack--loose > * + * {
  margin-block-start: var(--ed-space-3);
}

.editorial__meta,
.editorial__entry-title {
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.editorial__timeline {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
}

.editorial__timeline dt {
  margin-block-end: var(--ed-space-1);
}

.editorial__timeline dd + dt {
  margin-block-start: var(--ed-space-4);
}

.editorial__timeline dd > * + * {
  margin-block-start: var(--ed-space-2);
}

.editorial__timeline dd :where(ul, ol) {
  margin-block-end: 0;
}

@media (min-width: 50rem) {
  .editorial__timeline {
    grid-template-columns: minmax(8rem, 1fr) minmax(0, 3fr);
    column-gap: var(--ed-space-3);
    row-gap: var(--ed-space-3);
    align-items: start;
  }

  .editorial__timeline :where(dt, dd, dd + dt) {
    margin-block: 0;
  }
}

.editorial__rule {
  width: 100%;
  height: 0;
  margin-block: var(--ed-space-5);
  border: 0;
  border-block-start: 1px solid var(--ed-color-border);
}

.editorial__code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: 0;
  padding: var(--ed-space-2) var(--ed-space-3);
  overflow-x: auto;
  border: 1px solid var(--ed-color-border);
  border-radius: var(--ed-radius);
  font-family: var(--ed-font-mono);
  font-size: 0.8em;
  line-height: 1.9;
  text-align: left;
}

.editorial__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ed-space-2);
  align-items: center;
  margin-block: var(--ed-space-3) var(--ed-space-2);
}

.editorial__action {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: var(--ed-space-2);
  border: 1px solid currentColor;
  border-radius: var(--ed-radius);
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.editorial__action:hover {
  color: var(--ed-color-background);
  background: var(--ed-color-foreground);
}

.editorial__footer {
  margin-block-start: var(--ed-space-5);
  font-size: 0.9em;
}

@media (max-width: 40rem) {
  .editorial {
    padding: var(--ed-space-3) var(--ed-space-2) var(--ed-space-5);
  }
}

/*
 * Duplis' compact, content-first use of the vendored editorial system.
 * Source package: /Users/jamesacklin/src/editorial-system/editorial.css
 */

.duplis * {
  box-sizing: border-box;
}

.duplis {
  color: var(--ed-color-foreground);
  font-family: var(--ed-font-sans);
  font-size: 1rem;
  line-height: 1.5;
  text-align: left;
}

.duplis .wrap {
  max-width: var(--ed-measure);
  margin: 0 auto;
}

.duplis a {
  color: var(--ed-color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.duplis .icon {
  display: block;
  width: 3rem;
  height: 3rem;
  margin: 0 0 var(--ed-space-2);
  border-radius: 0.55rem;
}

.duplis h1,
.duplis header .sub {
  font-size: 1em;
  font-weight: 400;
  letter-spacing: normal;
}

.duplis h1 {
  margin: 0 0 var(--ed-space-2);
}

.duplis header .sub,
.duplis section p,
.duplis .qa p,
.duplis .legal p {
  max-width: none;
  margin: 0;
}

.duplis header + section,
.duplis section + section,
.duplis section + .qa,
.duplis .qa + footer {
  margin-top: var(--ed-space-5);
}

.duplis h2 {
  margin: 0 0 var(--ed-space-2);
  font-size: 1em;
  font-weight: 700;
}

.duplis .qa + .qa {
  margin-top: var(--ed-space-4);
}

.duplis .q {
  margin-bottom: var(--ed-space-1) !important;
  font-weight: 700;
}

.duplis footer {
  font-size: 0.9em;
}

.duplis footer .dot {
  padding: 0 8px;
}

.duplis .back {
  display: inline-block;
  margin-bottom: var(--ed-space-3);
}

.duplis .legal h2 {
  margin-top: var(--ed-space-4);
}

@media (prefers-reduced-motion: no-preference) {
  .duplis .icon {
    animation: duplis-arrive 420ms ease-out both;
  }
}

@keyframes duplis-arrive {
  from {
    opacity: 0;
    transform: translateY(0.25rem);
  }
}
