/* CrowdToken — site styles.
   Achromatic by design: hierarchy comes from type, spacing and one signature element (the demonstration in the hero).
   Order: fonts, tokens, base, layout, components, sections, motion. */

/* ---------- Fonts (SIL OFL 1.1, see fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: "Geologica";
  src: url("fonts/geologica-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geologica";
  src: url("fonts/geologica-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono-cyrillic.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Tokens ---------- */
:root {
  --paper: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #4b4c51;
  --ink-3: #6e7076;
  --line: #e5e5e8;
  --line-2: #cdced3;
  --fill: #f5f5f6;
  --rule-on-fill: rgb(11 11 12 / 0.11);
  --solid-hover: #2c2c30;
  --tick-used: #a4a6ac;
  --tick-free: #d5d6da;

  /* the application panel is dark in both themes */
  --band: #0b0b0c;
  --band-ink: #f5f5f6;
  --band-ink-2: #a9abb1;
  --band-line: #2e2e33;
  --band-line-hover: #4c4c53;
  --band-field: #17171a;
  --band-error: #ff9f97;

  --sans: "Geologica", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

  --wrap: 1240px;
  --gutter: clamp(20px, 4.4vw, 56px);
  --header-h: 68px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0b0c;
    --ink: #f4f4f5;
    --ink-2: #b1b3b9;
    --ink-3: #8a8c93;
    --line: #242428;
    --line-2: #3b3b41;
    --fill: #141416;
    --rule-on-fill: rgb(244 244 245 / 0.12);
    --solid-hover: #d6d6da;
    --tick-used: #6c6e75;
    --tick-free: #3a3b40;

    --band: #141416;
    --band-field: #0b0b0c;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
figure,
dl,
dd,
ol,
ul,
fieldset,
legend {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

fieldset {
  min-width: 0;
  border: 0;
}

a {
  color: inherit;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

[hidden] {
  display: none !important;
}

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

.section {
  padding-block: clamp(48px, 6.4vw, 92px);
}

.split {
  display: grid;
  gap: clamp(32px, 5vw, 48px) 24px;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
  }
  .split__head {
    grid-column: 1 / span 5;
    position: sticky;
    top: calc(var(--header-h) + 40px);
  }
  .split__body {
    grid-column: 7 / span 6;
  }
}

.split__note {
  margin-top: 20px;
  max-width: 27em;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Type roles ---------- */
.label {
  font: 400 0.75rem/1.4 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.label--quiet {
  color: var(--ink-3);
}

.h2 {
  margin-top: 20px;
  font-size: clamp(1.875rem, 1.25rem + 2.5vw, 3.25rem);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.h2--wide {
  max-width: 17em;
}

.h3 {
  font-size: 1.3125rem;
  font-weight: 480;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* ---------- Links and buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 500 1rem/1.2 var(--sans);
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--sm {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.9375rem;
}

.btn--solid {
  background: var(--ink);
  color: var(--paper);
}

.btn--line {
  border-color: var(--line-2);
}

.btn--light {
  background: var(--band-ink);
  color: #0b0b0c;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.text-link {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-2);
  text-underline-offset: 0.3em;
  transition: text-decoration-color 0.15s ease;
}

.quiet-link {
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

@media (hover: hover) {
  .btn--solid:hover {
    background: var(--solid-hover);
  }
  .btn--line:hover {
    border-color: var(--ink);
  }
  .btn--light:hover {
    background: #d6d6da;
  }
  .text-link:hover {
    text-decoration-color: currentColor;
  }
  .quiet-link:hover {
    color: var(--ink);
  }
}

.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ---------- Header ---------- */
.top-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  transition: border-color 0.2s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
}

.site-header__in {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.125rem;
  font-weight: 560;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.site-nav {
  display: none;
  gap: 30px;
  margin-inline-start: 44px;
}

.site-nav a {
  font-size: 0.9375rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

@media (hover: hover) {
  .site-nav a:hover {
    color: var(--ink);
  }
}

.site-header__end {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-inline-start: auto;
}

.site-header__end .quiet-link {
  display: none;
}

@media (min-width: 520px) {
  .site-header__end .quiet-link {
    display: inline;
  }
}

@media (min-width: 960px) {
  .site-nav {
    display: flex;
  }
}

/* ---------- Hero ---------- */
/* sized so that the demonstration is on screen when the page opens on a laptop */
.hero {
  padding-block: clamp(40px, 7vh, 84px) clamp(56px, 7.6vw, 112px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 400 0.75rem/1.4 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* hollow, because nothing is live yet */
.status__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.hero__title {
  max-width: 12.6em;
  margin-top: clamp(22px, 2.6vw, 32px);
  font-size: min(clamp(2.5rem, 1.25rem + 5.6vw, 6rem), 11.8vh);
  font-weight: 440;
  line-height: 1.04;
  letter-spacing: -0.042em;
  text-wrap: balance;
}

/* Russian words run longer: a smaller size keeps the headline to two lines on a desktop */
:lang(ru) .hero__title {
  max-width: none;
  font-size: min(clamp(2.25rem, 0.6rem + 5.2vw, 5.25rem), 10.4vh);
}

.hero__lead {
  max-width: 35em;
  margin-top: clamp(22px, 2.8vw, 36px);
  font-size: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem);
  font-weight: 380;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 3.4vw, 44px);
}

.hero__row {
  display: grid;
  gap: clamp(26px, 3.2vw, 40px) 48px;
}

.hero__row > * {
  margin-top: 0;
}

.hero__row .hero__lead {
  margin-top: clamp(22px, 2.8vw, 34px);
}

@media (min-width: 900px) {
  .hero__row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

.simple {
  min-height: 62vh;
  padding-block: clamp(64px, 11vw, 152px);
}

/* ---------- The demonstration (signature element) ----------
   Two bars of 100 ticks each. Left: the visitor's weekly limit. Right: a campaign.
   The range input lies over the unused part of the week, so dragging its marker is the same
   gesture as choosing a slice; the same slice then shows up in the campaign bar. */
.demo {
  --used: 62; /* mirrors WEEK in src/page.mjs */
  --min: 1;
  --max: 38;
  --bar-h: clamp(52px, 6vw, 68px);
  --grip: 44px; /* width of the draggable area around the marker */
  --knob: 22px; /* room above the ticks for the marker's ring */
  container-type: inline-size;
  display: grid;
  margin-top: clamp(36px, 5.6vh, 60px);
}

.demo__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.demo__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 1rem;
  font-weight: 520;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.demo__n {
  font: 400 0.75rem/1 var(--mono);
  color: var(--ink-3);
}

.demo__readout {
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.demo__track {
  position: relative;
  height: var(--bar-h);
  margin-top: calc(var(--knob) + 38px); /* the label and the marker's ring sit in this space */
}

.demo__panel--week .demo__track {
  --center: 68; /* middle of the slice, in ticks; app.js keeps it current */
}

.demo__panel--campaign .demo__track {
  --center: 52;
}

/* the campaign's goal: the right end of its bar */
.demo__panel--campaign .demo__track::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 2px;
  height: calc(100% + 8px);
  background: var(--ink);
}

.demo__ticks {
  display: grid;
  grid-template-columns: repeat(100, minmax(0, 1fr));
  height: 100%;
}

.demo__ticks i {
  justify-self: center;
  width: 1px;
  height: 100%;
  background: var(--tick-free);
  transform: scaleY(0.6);
  transform-origin: 50% 100%;
  transition:
    transform 0.24s var(--ease-out),
    background-color 0.14s linear,
    opacity 0.14s linear;
}

@media (min-width: 720px) {
  .demo__ticks i {
    width: 2px;
  }
}

/* what is left unused fades out toward the reset */
.demo__panel--week .demo__ticks i:nth-child(n + 79) {
  opacity: 0.82;
}
.demo__panel--week .demo__ticks i:nth-child(n + 85) {
  opacity: 0.64;
}
.demo__panel--week .demo__ticks i:nth-child(n + 91) {
  opacity: 0.46;
}
.demo__panel--week .demo__ticks i:nth-child(n + 96) {
  opacity: 0.3;
}

.demo__ticks i.is-used {
  background: var(--tick-used);
}

.demo .demo__ticks i.is-slice {
  background: var(--ink);
  opacity: 1;
  transform: scaleY(1);
}

/* the label that names the slice, centred above it in both bars */
.demo__tag {
  position: absolute;
  bottom: calc(100% + var(--knob) + 5px);
  left: calc(var(--center) * 1%);
  padding: 6px 11px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8125rem;
  font-weight: 520;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  transition: left 0.24s var(--ease-out);
}

.demo__range {
  position: absolute;
  z-index: 1;
  top: calc(-1 * var(--knob));
  /* the marker stands on the last tick of the slice: half a tick left of the slice's edge */
  left: calc((var(--used) + var(--min) - 0.5) * 1% - var(--grip) / 2);
  width: calc((var(--max) - var(--min)) * 1% + var(--grip));
  height: calc(100% + var(--knob));
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
  outline: none;
  --marker: radial-gradient(circle at 50% 11px, var(--paper) 0 4px, var(--ink) 4.8px 6.6px, transparent 7.3px) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 50% 100% / 2px calc(100% - 17px) no-repeat;
  --marker-held: radial-gradient(circle at 50% 11px, var(--ink) 0 6.6px, transparent 7.3px) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 50% 100% / 2px calc(100% - 17px) no-repeat;
  --marker-focus: radial-gradient(
        circle at 50% 11px,
        var(--ink) 0 5px,
        var(--paper) 5.6px 8px,
        var(--ink) 8.6px 10.2px,
        transparent 10.9px
      )
      no-repeat,
    linear-gradient(var(--ink), var(--ink)) 50% 100% / 2px calc(100% - 17px) no-repeat;
}

.demo__range::-webkit-slider-runnable-track {
  height: 100%;
  border: 0;
  background: transparent;
}

.demo__range::-moz-range-track {
  height: 100%;
  border: 0;
  background: transparent;
}

.demo__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--grip);
  height: calc(var(--bar-h) + var(--knob));
  border: 0;
  border-radius: 0;
  background: var(--marker);
}

.demo__range::-moz-range-thumb {
  width: var(--grip);
  height: calc(var(--bar-h) + var(--knob));
  border: 0;
  border-radius: 0;
  background: var(--marker);
}

.demo__range:active::-webkit-slider-thumb {
  background: var(--marker-held);
}
.demo__range:active::-moz-range-thumb {
  background: var(--marker-held);
}
.demo__range:focus-visible::-webkit-slider-thumb {
  background: var(--marker-focus);
}
.demo__range:focus-visible::-moz-range-thumb {
  background: var(--marker-focus);
}

@media (hover: hover) {
  .demo__range:hover::-webkit-slider-thumb {
    background: var(--marker-held);
  }
  .demo__range:hover::-moz-range-thumb {
    background: var(--marker-held);
  }
  .demo__range:focus-visible:hover::-webkit-slider-thumb {
    background: var(--marker-focus);
  }
  .demo__range:focus-visible:hover::-moz-range-thumb {
    background: var(--marker-focus);
  }
}

.demo__ends {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--ink-2);
}

.demo__ends div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.45em;
}

.demo__ends div:last-child {
  justify-content: flex-end;
  text-align: end;
}

.demo__ends dd {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.demo__text {
  max-width: 31em;
  margin-top: 14px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* the arrow from the first bar to the second; it points down while the bars are stacked */
.demo__link {
  display: flex;
  align-items: center;
  width: 40px;
  height: 40px;
  margin: 18px 0 22px 4px;
  color: var(--ink-3);
  transform: rotate(90deg);
}

.demo__link::before {
  content: "";
  flex: 1;
  height: 1.5px;
  background: currentColor;
}

.demo__link::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-inline-start: -9px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}

.demo__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(24px, 3vw, 34px);
}

@media (min-width: 900px) {
  .demo {
    grid-template-columns: auto minmax(48px, 1fr) auto;
    grid-template-rows: repeat(4, auto) auto;
  }

  /* both panels share the grid's rows, so their bars sit on one line */
  .demo__panel {
    display: grid;
    grid-row: 1 / span 4;
    grid-template-rows: subgrid;
    width: calc((100cqw - 64px) / 2);
    /* a width in whole hundreds of pixels gives every tick the same whole-pixel step */
    width: round(down, calc((100cqw - 64px) / 2), 100px);
  }

  .demo__panel--week {
    grid-column: 1;
  }

  .demo__panel--campaign {
    grid-column: 3;
  }

  .demo__link {
    grid-row: 2;
    grid-column: 2;
    align-self: end;
    width: auto;
    height: var(--bar-h);
    margin: 0;
    padding-inline: 20px;
    transform: none;
  }

  .demo__foot {
    grid-row: 5;
    grid-column: 1 / -1;
  }
}

/* ---------- How it works ---------- */
.step {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  padding-block: 26px 30px;
  border-top: 1px solid var(--line);
}

.step:last-child {
  padding-bottom: 0;
}

.step__n {
  font: 400 0.75rem/2.2 var(--mono);
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

.step__text {
  max-width: 33em;
  margin-top: 8px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Who it's for ---------- */
.sides {
  display: grid;
  gap: 16px;
  margin-top: clamp(36px, 5vw, 64px);
}

@media (min-width: 800px) {
  .sides {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(26px, 3.6vw, 52px);
  border-radius: clamp(22px, 2.6vw, 34px);
  background: var(--fill);
}

.side__title {
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.125rem);
  font-weight: 460;
  line-height: 1.12;
  letter-spacing: -0.032em;
}

.side__list {
  width: 100%;
  margin-block: clamp(20px, 2.6vw, 34px) clamp(28px, 3.4vw, 44px);
}

.side__list li {
  padding-block: 15px;
  border-top: 1px solid var(--rule-on-fill);
  text-wrap: pretty;
}

.side__list li:last-child {
  border-bottom: 1px solid var(--rule-on-fill);
}

.side .btn {
  margin-top: auto;
}

/* ---------- Principles ---------- */
.principles {
  display: grid;
  gap: 0 32px;
}

@media (min-width: 620px) {
  .principles {
    grid-template-columns: 1fr 1fr;
  }
}

.principle {
  padding-block: 24px 34px;
  border-top: 1px solid var(--line);
}

.principle p {
  margin-top: 10px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Questions ---------- */
.faq__item {
  border-top: 1px solid var(--line);
}

.faq__item:last-child {
  border-bottom: 1px solid var(--line);
}

.faq__q {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
  list-style: none;
  cursor: pointer;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q h3 {
  font-size: 1.1875rem;
  font-weight: 460;
  line-height: 1.35;
  letter-spacing: -0.018em;
}

/* a plus that turns into a cross */
.faq__q::after {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  margin-top: 0.42em;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  transition: transform 0.28s var(--ease-out);
}

.faq__item[open] .faq__q::after {
  transform: rotate(45deg);
}

.faq__a {
  max-width: 34em;
  padding-bottom: 26px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Application panel ---------- */
.apply {
  padding-block: clamp(8px, 2vw, 32px) clamp(40px, 6vw, 88px);
}

.apply .wrap {
  width: min(100% - 2 * clamp(10px, 3vw, 56px), var(--wrap));
}

.panel {
  padding: clamp(30px, 5.6vw, 84px) clamp(22px, 5.6vw, 84px);
  border-radius: clamp(24px, 3.2vw, 44px);
  background: var(--band);
  color: var(--band-ink);
  color-scheme: dark;
}

.panel .label,
.panel .split__note {
  color: var(--band-ink-2);
}

.panel__fine {
  max-width: 30em;
  margin-top: 28px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--band-ink-2);
  text-wrap: pretty;
}

.panel :focus-visible {
  outline-color: var(--band-ink);
}

.panel ::selection {
  background: var(--band-ink);
  color: var(--band);
}

.form {
  display: grid;
  gap: 26px;
}

/* the form shows only the questions that belong to the chosen side */
.form:has(input[name="role"][value="project"]:checked) .only-backer,
.form:has(input[name="role"][value="backer"]:checked) .only-project {
  display: none;
}

.field {
  min-width: 0;
}

.field__label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9375rem;
  font-weight: 450;
  line-height: 1.35;
}

.field__opt {
  margin-inline-start: 0.5em;
  font: 400 0.6875rem/1 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--band-ink-2);
}

.field__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.field__value {
  font: 500 0.8125rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.field__hint,
.field__err {
  margin-top: 9px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--band-ink-2);
}

.field__err {
  color: var(--band-error);
}

.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--band-line);
  border-radius: 12px;
  background: var(--band-field);
  color: var(--band-ink);
  font: 400 1rem/1.4 var(--sans);
  transition: border-color 0.15s ease;
}

.input--area {
  min-height: 104px;
  padding-block: 14px;
  resize: vertical;
}

.input[aria-invalid="true"] {
  border-color: var(--band-error);
}

.input:focus-visible {
  outline-offset: 2px;
}

@media (hover: hover) {
  .input:hover {
    border-color: var(--band-line-hover);
  }
  .input[aria-invalid="true"]:hover {
    border-color: var(--band-error);
  }
}

.select {
  position: relative;
}

.select select {
  padding-inline-end: 44px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 19px;
  width: 8px;
  height: 8px;
  border: solid var(--band-ink-2);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.seg {
  display: inline-grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--band-line);
  border-radius: 999px;
  background: var(--band-field);
}

.seg__opt {
  position: relative;
}

.seg__opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg__opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 450;
  line-height: 1.2;
  color: var(--band-ink-2);
  white-space: nowrap;
  transition:
    background-color 0.18s ease,
    color 0.18s ease;
}

.seg__opt input:checked + span {
  background: var(--band-ink);
  color: #0b0b0c;
}

.seg__opt input:focus-visible + span {
  outline: 2px solid var(--band-ink);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .seg {
    display: grid;
    grid-auto-flow: row;
    border-radius: 20px;
  }
  .seg__opt span {
    border-radius: 15px;
  }
}

.range {
  --f: 0.111; /* filled part of the track, 0–1; app.js keeps it in step with the value */
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.range::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(
    to right,
    var(--band-ink) calc(10px + (100% - 20px) * var(--f)),
    var(--band-line) calc(10px + (100% - 20px) * var(--f))
  );
}

.range::-moz-range-track {
  height: 2px;
  background: var(--band-line);
}

.range::-moz-range-progress {
  height: 2px;
  background: var(--band-ink);
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -9px;
  border: 0;
  border-radius: 50%;
  background: var(--band-ink);
}

.range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--band-ink);
}

.range:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--band-ink);
  outline-offset: 3px;
}

.range:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--band-ink);
  outline-offset: 3px;
}

/* a field people never see; bots fill it in */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 6px;
}

.form__status {
  flex: 1 1 14em;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--band-error);
}

.form__status:empty {
  display: none;
}

.done {
  outline: none;
}

.done__title {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 450;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.done__text {
  max-width: 26em;
  margin-top: 14px;
  color: var(--band-ink-2);
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 12px 56px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.site-footer__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 36px;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-end: auto;
  font-size: 1rem;
  font-weight: 560;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.site-footer .quiet-link {
  font-size: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-2);
  text-underline-offset: 0.3em;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* one orchestrated moment: the bars draw themselves in, then the marker and labels appear */
  .demo__ticks i {
    animation: tick-in 0.7s var(--ease-out) backwards;
    animation-delay: 80ms;
    animation-delay: calc(80ms + sibling-index() * 7ms);
  }

  .demo__range,
  .demo__tag {
    animation: fade-in 0.4s ease 0.95s backwards;
  }

  @supports (interpolate-size: allow-keywords) {
    :root {
      interpolate-size: allow-keywords;
    }
    .faq__item::details-content {
      block-size: 0;
      overflow: clip;
      transition:
        block-size 0.32s var(--ease-out),
        content-visibility 0.32s allow-discrete;
    }
    .faq__item[open]::details-content {
      block-size: auto;
    }
  }
}

@keyframes tick-in {
  from {
    transform: scaleY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
}
