@font-face {
  font-display: swap;
  font-family: 'MathMigo Sans';
  font-style: normal;
  font-weight: 400;
  src: url('/oauth/assets/MathMigoSans-Regular.ttf?v=7db47c93bbf1') format('truetype');
}

@font-face {
  font-display: swap;
  font-family: 'MathMigo Sans';
  font-style: normal;
  font-weight: 700;
  src: url('/oauth/assets/MathMigoSans-Bold.ttf?v=cd92fd346c6b') format('truetype');
}

:root {
  color-scheme: light;
  --paper: #fffbf1;
  --sheet: #ffffff;
  --sunken: #fbf1dc;
  --dots: #c9dbf0;
  --ink: #1d2143;
  --ink2: #555a7a;
  --outline: #1d2143;
  --shadow: #1d2143;
  --hairline: #e9e1ce;
  --field: #ffffff;
  --control-border: #1d2143;
  --link: #4b3fd9;
  --focus: #1d2143;
  --error: #c92a2a;
  --pencil-yellow: #ffc61a;
  --pencil-yellow-hover: #ffd447;
  --on-crayon: #1d2143;
  --tint-strawberry: #ffe3e8;
  --tint-tangerine: #ffebd6;
  --tint-sunshine: #fff4cc;
  --tint-grass: #ddf5e6;
  --tint-sky: #dcf0fd;
  --tint-grape: #efe4fd;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #183b31;
    --sheet: #21483c;
    --sunken: #123027;
    --dots: #2c5a4b;
    --ink: #f6f3ea;
    --ink2: #b7ccc2;
    --outline: #0d211b;
    --shadow: #0a1a15;
    --hairline: #2c5a4b;
    --field: #123027;
    --control-border: #b7ccc2;
    --link: #f6f3ea;
    --focus: #f6f3ea;
    --error: #ffa8a8;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family:
    'MathMigo Sans', ui-rounded, 'Comic Sans MS', 'Chalkboard SE', system-ui,
    sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle at 11px 11px,
    var(--dots) 1.1px,
    transparent 1.6px
  );
  background-size: 22px 22px;
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 16px 32px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.brand-mark {
  display: block;
  width: 52px;
  height: 52px;
}

.wordmark {
  display: block;
  width: 132px;
  height: 46px;
  background-color: var(--ink);
  mask: url('/oauth/assets/wordmark.svg?v=f262e679fec4') center / contain no-repeat;
  -webkit-mask: url('/oauth/assets/wordmark.svg?v=f262e679fec4') center / contain no-repeat;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 20px 24px;
  border: 2px solid var(--outline);
  border-radius: 20px;
  background-color: var(--sheet);
  box-shadow: 0 4px 0 var(--shadow);
}

.title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.heading {
  margin: 8px 0 0;
  padding-top: 18px;
  border-top: 2px solid var(--hairline);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.lede,
.body-text {
  margin: 0;
}

.lede {
  color: var(--ink);
}

.eyebrow {
  margin: 0;
  color: var(--ink2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.eyebrow-sep {
  margin: 0 8px;
}

.eyebrow strong {
  color: var(--ink);
  font-weight: 700;
}

.caption {
  margin: 0;
  color: var(--ink2);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:focus-visible,
.link-button:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

strong {
  font-weight: 700;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 12px 22px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--shadow);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

a.button {
  text-decoration: none;
}

.button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--shadow);
}

.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.button svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.button-primary {
  background-color: var(--pencil-yellow);
  color: var(--on-crayon);
}

.button-primary:hover {
  background-color: var(--pencil-yellow-hover);
}

.button-secondary {
  background-color: var(--sheet);
  color: var(--ink);
}

.button-small {
  width: auto;
  min-height: 40px;
  padding: 6px 16px;
  box-shadow: 0 3px 0 var(--shadow);
  font-size: 15px;
  background-color: var(--sheet);
  color: var(--ink);
}

.button[aria-busy='true'] {
  cursor: progress;
}

.button:disabled:not([aria-busy='true']) {
  border-color: var(--ink2);
  background-color: var(--sheet);
  color: var(--ink2);
  cursor: not-allowed;
}

.link-button {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.eyebrow .link-button {
  font-size: 14px;
}

.text-actions {
  display: flex;
  justify-content: center;
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 15px;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--outline);
  border-radius: 14px;
  background-color: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}

.input:focus {
  outline: 3px solid var(--pencil-yellow);
  outline-offset: 1px;
}

.form-error {
  margin: 0;
  color: var(--error);
  font-size: 15px;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

.rows {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 0;
}

.row + .row {
  position: relative;
}

.row + .row::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 46px;
  height: 2px;
  background-color: var(--hairline);
}

.tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--outline);
  border-radius: 9px;
  color: var(--on-crayon);
}

.tile svg {
  width: 20px;
  height: 20px;
}

.tile-strawberry {
  background-color: var(--tint-strawberry);
}

.tile-tangerine {
  background-color: var(--tint-tangerine);
}

.tile-sunshine {
  background-color: var(--tint-sunshine);
}

.tile-grass {
  background-color: var(--tint-grass);
}

.tile-sky {
  background-color: var(--tint-sky);
}

.row-title {
  display: flex;
  align-items: center;
  font-weight: 400;
}

.row-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.row-value {
  color: var(--ink2);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.check-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--outline);
  border-radius: 16px;
  background-color: var(--sunken);
  cursor: pointer;
}

.check-input {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 30px;
  height: 30px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.check-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--control-border);
  border-radius: 9px;
  background-color: var(--sheet);
  color: transparent;
}

.check-box svg {
  width: 22px;
  height: 22px;
}

.check-input:checked + .check-box {
  background-color: var(--pencil-yellow);
  color: var(--on-crayon);
}

.check-input:focus-visible + .check-box {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.check-label {
  padding-top: 2px;
  line-height: 1.45;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--outline);
  border-radius: 50%;
  background-color: var(--tint-sunshine);
  color: var(--on-crayon);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.step-body {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding-top: 2px;
}

.step-body p {
  margin: 0;
}

.steps > li:nth-child(1)::before {
  background-color: var(--tint-strawberry);
}

.steps > li:nth-child(2)::before {
  background-color: var(--tint-tangerine);
}

.steps > li:nth-child(3)::before {
  background-color: var(--tint-sunshine);
}

.steps > li:nth-child(4)::before {
  background-color: var(--tint-grass);
}

.steps > li:nth-child(5)::before {
  background-color: var(--tint-sky);
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 8px 8px 14px;
  border: 2px solid var(--outline);
  border-radius: 14px;
  background-color: var(--sunken);
}

.copy-value {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  overflow-wrap: anywhere;
}

@media (max-width: 479px) {
  .copy-field {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .copy-value {
    font-size: 13px;
  }

  .copy-field .button-small {
    width: 100%;
  }
}

.setup {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.setup-intro,
.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.setup-demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 0;
}

.demo-frame {
  position: relative;
  aspect-ratio: 1200 / 750;
  overflow: hidden;
  border: 2px solid var(--outline);
  border-radius: 16px;
  background-color: #0d0d0d;
  box-shadow: 0 4px 0 var(--shadow);
}

.demo-poster,
.demo-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.demo-canvas {
  opacity: 0;
  transition: opacity 240ms ease;
}

.setup-demo[data-state='playing'] .demo-canvas {
  opacity: 1;
}

.demo-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink2);
  font-size: 14px;
}

.demo-caption .link-button {
  font-size: 14px;
}

.steps > li {
  margin: 0 -12px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: background-color 200ms ease;
}

.steps > li[data-current] {
  background-color: var(--sunken);
}

.shell-wide {
  max-width: 640px;
}

@media (min-width: 1040px) {
  .shell-wide {
    max-width: 1240px;
  }

  .card-wide {
    padding: 40px 44px 36px;
  }

  .setup {
    display: grid;
    grid-template-areas:
      'intro demo'
      'steps demo';
    grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr);
    grid-template-rows: auto 1fr;
    column-gap: 48px;
    row-gap: 18px;
  }

  .setup-intro {
    grid-area: intro;
  }

  .setup-steps {
    grid-area: steps;
  }

  .setup-demo {
    position: sticky;
    top: 24px;
    grid-area: demo;
    align-self: start;
  }
}

.footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  color: var(--ink2);
  font-size: 14px;
}

.footer a {
  color: var(--ink2);
}

@media (min-width: 640px) {
  .shell {
    gap: 24px;
    padding-top: 56px;
  }

  .card {
    gap: 18px;
    padding: 34px 36px 32px;
  }

  .title {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .demo-canvas,
  .steps > li {
    transition: none;
  }

  .button:active {
    transform: none;
  }
}
