/* The mechanism: one centred column, a pill that follows the reading, line figures on dark panels. */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.guide-page {
  background-color: #000;
}

.nav-link.is-current {
  background-color: #ffffff1a;
  color: #fff;
}

.guide {
  padding: 7.5rem 1.25rem 4rem;
}

.guide-head {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}

.guide-lede {
  margin-top: 1.25rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.625;
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------------------------
   The pill that follows the reading
   --------------------------------------------------------------------------------------------- */

.steps {
  position: sticky;
  top: 1rem;
  z-index: 20;
  display: flex;
  gap: 0.125rem;
  width: max-content;
  max-width: 100%;
  margin: 3rem auto 0;
  padding: 0.375rem;
  overflow-x: auto;
  border-radius: 9999px;
  background-color: #0c0c0cf5;
  box-shadow: inset 0 0 0 1px var(--line), 0 16px 40px #000000b3;
  scrollbar-width: none;
}

.steps::-webkit-scrollbar {
  display: none;
}

.steps a {
  display: flex;
  flex: none;
  align-items: center;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.7rem;
  border-radius: 9999px;
  color: #fffc;
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.steps a b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.steps a span {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.5s var(--out), opacity 0.3s ease, margin-left 0.5s var(--out);
}

.steps a:hover {
  background-color: #ffffff1a;
  color: #fff;
}

.steps a.is-active {
  background-color: #fff;
  color: #000;
}

.steps a.is-active span {
  max-width: 14rem;
  margin-left: 0.5rem;
  opacity: 1;
}

/* ---------------------------------------------------------------------------------------------
   Parts
   --------------------------------------------------------------------------------------------- */

.part {
  max-width: 46rem;
  margin: 0 auto;
  padding-top: clamp(4.5rem, 10vw, 7rem);
}

.part-num {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.part h2 {
  margin-top: 0.6rem;
  font-size: clamp(1.75rem, 4.4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.part > p {
  margin-top: 1.1rem;
  color: #ffffffcc;
  font-size: 1.125rem;
  line-height: 1.7;
}

.part h2 + p {
  margin-top: 1.5rem;
}

.pull {
  margin-top: 2rem !important;
  color: #fff !important;
  font-size: clamp(1.5rem, 4vw, 2rem) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.025em;
}

.pull span {
  background-image: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.card {
  padding: 1.5rem 1.6rem 1.4rem;
  border-radius: 1.5rem;
  background-color: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.card b {
  display: block;
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.card span {
  display: block;
  margin-top: 0.8rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.lines {
  margin-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.lines li {
  position: relative;
  padding: 1.05rem 0 1.05rem 2.4rem;
  border-bottom: 1px solid var(--line);
  color: #ffffffcc;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.lines li b {
  color: #fff;
  font-weight: 500;
}

.lines li::before {
  content: "";
  position: absolute;
  top: 1.5rem;
  left: 0.2rem;
  width: 0.9rem;
  height: 0.9rem;
  background-image: var(--grad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-9 -9 18 18'%3E%3Cpath d='M-2-8.5h4v17h-4zM6.361-5.982 8.361-2.518-6.361 5.982-8.361 2.518zM8.361 2.518 6.361 5.982-8.361-2.518-6.361-5.982z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-9 -9 18 18'%3E%3Cpath d='M-2-8.5h4v17h-4zM6.361-5.982 8.361-2.518-6.361 5.982-8.361 2.518zM8.361 2.518 6.361 5.982-8.361-2.518-6.361-5.982z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------------------------------------------------------------------------------------------
   Figures
   --------------------------------------------------------------------------------------------- */

.fig {
  margin-top: 2rem;
  overflow: hidden;
  border-radius: 1.75rem;
  background-color: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.fig-scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.fig-scroll::-webkit-scrollbar {
  display: none;
}

.fig svg {
  display: block;
  width: 100%;
  min-width: 40rem;
  height: auto;
}

.fig .rule-scroll {
  margin: 0;
  padding: 1.5rem 1.75rem 0.75rem;
}

.fig .rule svg {
  min-width: 37rem;
}

.fig figcaption {
  padding: 0.9rem 1.75rem 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.fig text {
  fill: #ffffff99;
  font: 12px var(--mono);
  letter-spacing: 0.01em;
}

.fig .t {
  fill: #fff;
  font: 500 14px Inter, sans-serif;
  letter-spacing: 0;
}

.fig .t-big {
  fill: #fff;
  font: 400 26px Inter, sans-serif;
  letter-spacing: -0.03em;
}

.fig .t-grad {
  fill: var(--lilac);
}

.fig .ln {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fig .ln-dim {
  fill: none;
  stroke: #ffffff47;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fig .ln-grad {
  fill: none;
  stroke: url(#fig-grad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fig .dash {
  stroke-dasharray: 4 6;
}

.fig .fill {
  fill: #ffffff26;
}

.fig .fill-w {
  fill: #fff;
}

.fig .fill-grad {
  fill: url(#fig-grad);
}

/* ---------------------------------------------------------------------------------------------
   A few words, and the way out
   --------------------------------------------------------------------------------------------- */

.words {
  margin-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.words div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.words dt {
  color: #fff;
}

.words dd {
  color: var(--soft);
  line-height: 1.6;
}

.guide-end {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(4.5rem, 10vw, 7rem) 0 2rem;
  text-align: center;
}

@media (min-width: 640px) {
  .guide {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 639px) {
  .guide {
    padding-top: 6.25rem;
  }

  .steps {
    justify-content: flex-start;
    width: auto;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }

  .part > p {
    font-size: 1.0625rem;
  }

  .fig {
    border-radius: 1.5rem;
  }

  .fig figcaption {
    padding: 0.9rem 1.25rem 1rem;
  }

  .words div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}

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

  .steps a,
  .steps a span {
    transition: none;
  }
}
