@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* Butter and crust come from the croissant, night from the CI log. */
:root {
  color-scheme: light dark;

  --butter: #f7c65c;
  --butter-pale: #fdf3dc;
  --butter-deep: #f0b441;
  --crust: #6b3d16;
  --crust-muted: #7f5128;
  --night: #0f141a;
  --night-raised: #19212b;
  --on-night: #f3ece0;
  --on-night-muted: #c3bcb0;

  --page: var(--butter-pale);
  --page-alt: #fbe9c2;
  --ink: var(--crust);
  --ink-muted: var(--crust-muted);
  --hero: var(--butter);
  --hero-ink: var(--crust);
  --link: #0a665c;
  --button: #0b7065;
  --button-ink: #ffffff;
  --button-quiet: rgb(107 61 22 / 0.1);
  --line: rgb(107 61 22 / 0.2);
  --code-bg: rgb(107 61 22 / 0.09);
  --panel: #ffffff;
  --panel-ink: #1f2328;
  --panel-muted: #59636e;
  --panel-line: #d1d9e0;
  --panel-code: rgb(129 139 152 / 0.12);
  --focus: #0b7065;

  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #12171e;
    --page-alt: #171d25;
    --ink: var(--on-night);
    --ink-muted: var(--on-night-muted);
    --hero: #2b1d10;
    --hero-ink: var(--butter);
    --link: #5ed6c7;
    --button: #1fb3a0;
    --button-ink: #0f141a;
    --button-quiet: rgb(247 198 92 / 0.12);
    --line: rgb(243 236 224 / 0.16);
    --code-bg: rgb(243 236 224 / 0.08);
    --panel: #0d1117;
    --panel-ink: #f0f6fc;
    --panel-muted: #9198a1;
    --panel-line: #3d444d;
    --panel-code: rgb(101 108 118 / 0.3);
    --focus: #5ed6c7;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
}

h3 {
  font-size: 1.375rem;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 0.35em;
  background: var(--code-bg);
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: var(--night-raised);
  color: var(--on-night);
  font-size: 0.95rem;
  line-height: 1.55;
  tab-size: 2;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--night);
  color: var(--on-night);
}

.skip:focus {
  top: 1rem;
}

.more {
  margin-top: 2rem;
  font-weight: 600;
}

/* Hero */

.hero {
  background: var(--hero);
  color: var(--hero-ink);
  overflow: hidden;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(2rem, 6vw, 5rem) clamp(4rem, 9vw, 7rem);
}

.hero h1 {
  font-size: clamp(3.25rem, 1.8rem + 6vw, 6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.015em;
}

.lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  font-size: 1.25rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.22);
}

.button:hover {
  text-decoration: none;
  translate: 0 1px;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.22);
}

.button-quiet {
  background: var(--button-quiet);
  color: var(--hero-ink);
  box-shadow: inset 0 0 0 2px currentColor;
}

.button-quiet:hover {
  box-shadow: inset 0 0 0 3px currentColor;
}

.fineprint {
  margin-top: 1rem;
  font-size: 1rem;
}

/* The pull request comment the verdicts get stuck on */

.hero-comment {
  position: relative;
  margin: 4.5rem 0 0 1.5rem;
}

.peek {
  position: absolute;
  right: 1.5rem;
  top: -5.4rem;
  width: 8.5rem;
  rotate: 6deg;
}

.comment {
  position: relative;
  border: 1px solid var(--panel-line);
  border-radius: 0.75rem;
  background: var(--panel);
  color: var(--panel-ink);
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: 0 1.25rem 2.5rem -1rem rgb(60 30 5 / 0.45);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--panel-line);
  border-radius: 0.75rem 0.75rem 0 0;
  background: var(--panel-code);
  color: var(--panel-muted);
  font-size: 0.875rem;
}

.avatar {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--panel-ink);
}

.bot {
  padding: 0 0.4rem;
  border: 1px solid var(--panel-line);
  border-radius: 1rem;
  font-size: 0.75rem;
}

.comment-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.comment-title img {
  width: 1.75rem;
}

.comment-rows {
  margin: 0 1rem;
  padding: 0;
  list-style: none;
  border: 1px solid var(--panel-line);
  border-radius: 0.4rem;
}

.comment-rows li {
  position: relative;
  display: grid;
  gap: 0.3rem;
  padding: 0.75rem 0.9rem 0.75rem 2.6rem;
}

.comment-rows li + li {
  border-top: 1px solid var(--panel-line);
}

.comment code {
  background: var(--panel-code);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.comment-rows > li > code {
  justify-self: start;
}

.comment-foot {
  padding: 0.9rem 1rem 1rem;
  color: var(--panel-muted);
}

.stamp {
  position: absolute;
  left: -2.1rem;
  top: 50%;
  width: 3.9rem;
  translate: 0 -50%;
  rotate: -9deg;
  filter: drop-shadow(0 3px 0 rgb(0 0 0 / 0.2));
}

.comment-rows li:nth-child(2) .stamp {
  rotate: 7deg;
}

.comment-rows li:nth-child(3) .stamp {
  rotate: -4deg;
}

@media (prefers-reduced-motion: no-preference) {
  .stamp {
    animation: slap 460ms cubic-bezier(0.2, 1.5, 0.45, 1) both;
    animation-delay: 700ms;
  }

  .comment-rows li:nth-child(2) .stamp {
    --tilt: 7deg;
    animation-delay: 1100ms;
  }

  .comment-rows li:nth-child(3) .stamp {
    --tilt: -4deg;
    animation-delay: 1500ms;
  }
}

@keyframes slap {
  from {
    opacity: 0;
    scale: 2.4;
    rotate: -28deg;
  }

  55% {
    opacity: 1;
  }

  to {
    opacity: 1;
    scale: 1;
    rotate: var(--tilt, -9deg);
  }
}

/* Bands */

.band {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.band-alt {
  background: var(--page-alt);
}

.band-night {
  background: var(--night);
  color: var(--on-night);
  --link: #5ed6c7;
  --code-bg: rgb(243 236 224 / 0.1);
  --focus: #5ed6c7;
}

.band-butter {
  background: var(--hero);
  color: var(--hero-ink);
}

.section-head {
  max-width: 40rem;
}

.section-head p {
  margin-top: 1rem;
  color: var(--ink-muted);
}

.story h2 {
  max-width: 40rem;
}

.comic {
  margin-top: 2.5rem;
  border-radius: 1rem;
}

/* Verdicts */

.verdicts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem clamp(2rem, 5vw, 4.5rem);
  margin-top: 3.5rem;
}

.verdict {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
}

.verdict p {
  margin-top: 0.5rem;
}

.todo {
  color: var(--ink-muted);
}

.verdict-fixed {
  grid-column: 1 / -1;
  align-items: center;
  padding-top: 3rem;
  border-top: 2px dashed var(--line);
}

/* How it works */

.how {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.steps {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 4rem;
  counter-increment: step;
}

.steps li + li {
  margin-top: 2rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.2rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--butter);
  color: var(--crust);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--butter-deep);
}

.steps p {
  margin-top: 0.4rem;
}

.screenshot {
  margin: 0;
}

.screenshot img {
  border-radius: 0.75rem;
  box-shadow: 0 1.25rem 2.5rem -1.25rem rgb(60 30 5 / 0.4);
}

.screenshot figcaption {
  margin-top: 1rem;
  color: var(--ink-muted);
  font-size: 1rem;
}

/* Quick start */

.start {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.start-copy > p {
  margin-top: 1rem;
  color: var(--on-night-muted);
}

.start-sticker {
  width: 9.5rem;
  margin-bottom: 1.5rem;
  rotate: -5deg;
}

.notes {
  margin: 1.75rem 0 0;
  padding-left: 1.25rem;
}

.notes li + li {
  margin-top: 0.6rem;
}

.notes li::marker {
  color: var(--butter);
}

.code {
  position: relative;
}

.copy {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  padding: 0.35rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: var(--butter);
  color: var(--crust);
  font: 600 0.95rem var(--font-display);
  cursor: pointer;
}

.copy:hover {
  background: var(--butter-deep);
}

/* Quarantine */

.quarantine {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.quarantine img {
  justify-self: center;
  width: min(100%, 19rem);
  rotate: -4deg;
}

.quarantine p {
  max-width: 36rem;
  margin-top: 1rem;
}

.quarantine pre {
  max-width: 36rem;
  margin-top: 1.75rem;
}

.band-butter a {
  color: var(--hero-ink);
}

/* Demo pull requests */

.demos {
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 2px dashed var(--line);
}

.demos li {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  column-gap: 1.25rem;
  padding-block: 1.5rem;
  border-bottom: 2px dashed var(--line);
}

.demos img {
  grid-row: span 2;
}

.demos a {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.demos p {
  max-width: 44rem;
  margin-top: 0.25rem;
  color: var(--ink-muted);
}

/* Nothing to host */

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: 3rem 0 0;
}

.facts dt {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
}

.facts dd {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
}

/* Footer */

.footer {
  padding-block: 3.5rem;
  background: var(--night);
  color: var(--on-night-muted);
  --link: var(--on-night);
  --focus: #5ed6c7;
}

.footer-body {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.footer-body img {
  width: 10rem;
  rotate: -6deg;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

/* 404 */

.lost {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem var(--gutter);
  background: var(--hero);
  color: var(--hero-ink);
  text-align: center;
}

.lost img {
  width: 15rem;
  margin: 0 auto 2rem;
}

.lost p {
  margin-top: 1rem;
}

.lost .button {
  margin-top: 2rem;
}

/* Narrow screens */

@media (max-width: 60rem) {
  .hero-body,
  .how,
  .start,
  .quarantine {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-comment {
    margin-left: 1.75rem;
  }

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

@media (max-width: 40rem) {
  body {
    font-size: 1.0625rem;
  }

  .nav ul {
    gap: 0.25rem 1rem;
    font-size: 1rem;
  }

  .nav ul li:first-child {
    display: none;
  }

  .verdicts,
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .verdict {
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 1rem;
  }

  .footer-body {
    flex-direction: column;
    align-items: flex-start;
  }
}
