/* BGDemocracy · design system "Бюлетина" (see DESIGN.md). Only the five greys plus paper. */
:root {
  --g-100: #eeeeee;
  --g-300: #afafaf;
  --g-500: #909090;
  --g-700: #5c5c5c;
  --g-900: #383838;
  --paper: #ffffff;
  --font: "Commissioner", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "PT Mono", Consolas, "Courier New", monospace;
  --col: 600px;
  --container: 720px;
  --gutter: 24px;
  --band: 60px;
  --shadow-desk: 0 1px 2px rgba(56, 56, 56, 0.1), 0 10px 28px -14px rgba(56, 56, 56, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--g-100);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--g-900);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--g-900);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--g-300);
}
a:hover {
  text-decoration-color: var(--g-900);
}
::selection {
  background: var(--g-900);
  color: var(--g-100);
}
:focus-visible {
  outline: 2px solid var(--g-900);
  outline-offset: 3px;
}
button {
  font: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.num {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--g-700);
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--paper);
  color: var(--g-900);
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 10;
}
.skip-link:focus {
  left: 8px;
}
[hidden] {
  display: none !important;
}

/* Band (navigation) */
.band {
  background: var(--g-900);
  color: var(--g-100);
}
.band__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--band);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--g-100);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand svg {
  display: block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__link {
  color: var(--g-300);
  text-decoration: none;
  font-size: 15px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav__link:hover {
  color: var(--g-100);
}
.nav__link--active {
  color: var(--g-100);
  border-bottom-color: var(--g-100);
}
.lang {
  color: var(--g-100);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--g-500);
  border-radius: 4px;
  padding: 4px 9px;
}
.lang:hover {
  border-color: var(--g-100);
}
.menu {
  display: none;
}

/* Page column */
.page {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px var(--gutter) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}
.col {
  width: 100%;
  max-width: var(--col);
}
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__mark {
  display: block;
}
.hero__title {
  margin-top: 16px;
  font-size: 46px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 620px;
}
.hero__lead {
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--g-700);
  max-width: 520px;
  text-wrap: pretty;
}
.dateline {
  margin-top: 16px;
}
.page-title {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.page-sub {
  margin-top: 10px;
}

/* Ballot */
.ballot {
  position: relative;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--g-300);
  border-radius: 2px;
  box-shadow: var(--shadow-desk);
  padding: 36px 44px 0;
  text-align: center;
}
.ballot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 14px;
  background: radial-gradient(circle at 8px 0, var(--g-100) 4px, transparent 4.6px) 0 0 / 16px 14px repeat-x;
}
.ballot__grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.7;
  mix-blend-mode: multiply;
  border-radius: 2px;
}
.ballot > :not(.ballot__grain, .stamp) {
  position: relative;
}
.stamp {
  position: absolute;
  top: -14px;
  right: -22px;
  transform: rotate(-8deg);
  border: 2px solid var(--g-700);
  color: var(--g-700);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  mix-blend-mode: multiply;
  white-space: nowrap;
}
.stamp--ink {
  border-color: var(--g-900);
  color: var(--g-900);
}
.ballot__q {
  font-size: 30px;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.ballot__ctx {
  margin: 14px auto 0;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--g-700);
  max-width: 460px;
  text-wrap: pretty;
}
.vote {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.vote__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 58px;
  border: 1.5px solid var(--g-900);
  border-radius: 2px;
  background: transparent;
  color: var(--g-900);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 120ms ease-out,
    color 120ms ease-out;
}
.vote__btn svg {
  display: block;
  flex: none;
}
.vote__btn:hover {
  background: var(--g-900);
  color: var(--g-100);
}
.vote__btn:active {
  background: var(--g-700);
  border-color: var(--g-700);
  color: var(--g-100);
}
.vote__btn:disabled {
  border-color: var(--g-300);
  color: var(--g-500);
  cursor: default;
  background: transparent;
}
.vote__btn.is-busy {
  border-color: var(--g-500);
  color: var(--g-500);
  cursor: progress;
}
.vote__error {
  margin-top: 12px;
  font-size: 14px;
  color: var(--g-900);
}
.tear {
  margin: 34px -44px 0;
  padding: 14px 44px 18px;
  border-top: 1px dashed var(--g-300);
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--g-700);
}
.tear a {
  color: var(--g-700);
  text-decoration-color: var(--g-300);
}
.tear a:hover {
  color: var(--g-900);
}
.count {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--g-700);
}
.nojs {
  margin-top: 24px;
  font-size: 14px;
  color: var(--g-700);
}

/* After-vote rows */
.avrows {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.avrow {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 14px;
}
.avrow__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--g-700);
}
.avrow__label svg {
  display: block;
  flex: none;
}
.avrow--mine .avrow__label,
.avrow--mine .avrow__pct {
  font-weight: 600;
  color: var(--g-900);
}
.avrow__mine {
  font-weight: 400;
  color: var(--g-700);
  white-space: nowrap;
}
.avrow__bar {
  position: relative;
  height: 12px;
  border-radius: 2px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--g-300);
  overflow: hidden;
}
.avrow__bar > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 2px;
}
.avrow__pct {
  font-size: 15px;
  color: var(--g-700);
  text-align: right;
}
.fill--yes {
  background: var(--g-900);
}
.fill--no {
  background: var(--g-700);
}
.fill--unsure {
  background: var(--g-500);
}

/* Carousel */
.carousel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.carousel__item {
  width: 100%;
}
.carousel__ctl {
  width: 100%;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.ctl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 8px 6px;
  font-size: 14px;
  color: var(--g-700);
  cursor: pointer;
  border-radius: 4px;
}
.ctl svg {
  display: block;
}
.ctl:hover {
  color: var(--g-900);
}
.ctl:disabled {
  color: var(--g-300);
  cursor: default;
}
.dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dots__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--g-300);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.dots__dot--active {
  width: 8px;
  height: 8px;
  background: var(--g-900);
}
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--g-900);
  text-decoration: none;
}
.arrow-link svg {
  display: block;
  transition: transform 140ms ease-out;
}
.arrow-link:hover svg {
  transform: translateX(3px);
}

/* Sections */
.section {
  width: 100%;
  max-width: var(--col);
  margin-top: 72px;
  padding-top: 30px;
  border-top: 1px solid var(--g-300);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.section--first {
  margin-top: 32px;
  padding-top: 0;
  border-top: 0;
}
.section__title {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section__sub {
  margin-top: 10px;
}
.section__text {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--g-700);
  max-width: 520px;
  text-wrap: pretty;
}
.results {
  width: 100%;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.result {
  border-top: 1px solid var(--g-300);
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result:last-child {
  border-bottom: 1px solid var(--g-300);
}
.result__q {
  font-size: 16.5px;
  line-height: 1.4;
}
.result__meta {
  font-size: 13px;
  line-height: 1.5;
  color: var(--g-700);
}
.bar {
  display: flex;
  height: 8px;
  border-radius: 2px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
}
.list {
  width: 100%;
  max-width: var(--col);
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.prose {
  width: 100%;
  max-width: 560px;
  margin-top: 28px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--g-700);
}
.prose h2 {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--g-900);
}
.empty {
  margin-top: 28px;
  font-size: 16px;
  color: var(--g-700);
}

/* Footer */
.footer {
  width: 100%;
  max-width: var(--col);
  margin: 80px auto 0;
  padding: 26px 0 60px;
  border-top: 1px solid var(--g-300);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--g-700);
}
.footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer a {
  color: var(--g-700);
  text-decoration: none;
}
.footer a:hover {
  color: var(--g-900);
  text-decoration: underline;
}

/* Phone */
@media (max-width: 640px) {
  :root {
    --gutter: 20px;
    --band: 56px;
  }
  .brand {
    font-size: 16px;
    gap: 9px;
  }
  .nav {
    gap: 10px;
  }
  .nav__link {
    display: none;
  }
  .menu {
    display: block;
    position: relative;
  }
  .menu > summary {
    list-style: none;
    width: 44px;
    height: 44px;
    margin-right: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--g-100);
    cursor: pointer;
    border-radius: 4px;
  }
  .menu > summary::-webkit-details-marker {
    display: none;
  }
  .menu__list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: var(--g-900);
    border: 1px solid var(--g-700);
    border-radius: 4px;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    z-index: 5;
  }
  .menu__list .nav__link {
    display: block;
    padding: 12px 18px;
    border-bottom: 0;
  }
  .menu__list .nav__link--active {
    color: var(--g-100);
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .page {
    padding-top: 40px;
  }
  .hero__mark {
    width: 32px;
    height: 26px;
  }
  .hero__title {
    font-size: 36px;
    margin-top: 18px;
  }
  .hero__lead {
    font-size: 16.5px;
    line-height: 1.5;
  }
  .mono {
    font-size: 11.5px;
  }
  .page-title {
    font-size: 30px;
  }
  .ballot {
    padding: 30px 20px 0;
  }
  .ballot::before {
    height: 12px;
    background: radial-gradient(circle at 7px 0, var(--g-100) 3.5px, transparent 4.1px) 0 0 / 14px 12px repeat-x;
  }
  .stamp {
    top: -12px;
    right: -8px;
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .ballot__q {
    font-size: 24px;
  }
  .ballot__ctx {
    margin-top: 12px;
    font-size: 15px;
  }
  .vote {
    margin-top: 24px;
    gap: 8px;
  }
  .vote__btn {
    height: 52px;
    gap: 6px;
    padding: 0 4px;
    font-size: 15px;
    white-space: nowrap;
  }
  .vote__btn svg {
    width: 16px;
    height: 16px;
  }
  .tear {
    margin: 26px -20px 0;
    padding: 12px 20px 16px;
    font-size: 11.5px;
    gap: 8px 18px;
  }
  .avrows {
    margin-top: 24px;
    gap: 12px;
  }
  .avrow {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 8px 14px;
  }
  .avrow__bar {
    grid-column: 1 / -1;
  }
  .carousel__ctl {
    margin-top: 8px;
    padding: 0;
  }
  .ctl {
    padding: 10px 6px;
    min-height: 44px;
    gap: 4px;
  }
  .dots {
    gap: 7px;
  }
  .arrow-link {
    min-height: 44px;
    margin-top: 6px;
  }
  .section {
    margin-top: 52px;
    padding-top: 24px;
  }
  .section--first {
    margin-top: 32px;
    padding-top: 0;
  }
  .section__title {
    font-size: 22px;
  }
  .section__sub {
    margin-top: 8px;
  }
  .section__text {
    font-size: 15px;
  }
  .results {
    margin-top: 18px;
  }
  .result {
    padding: 16px 0;
    gap: 9px;
  }
  .result__q {
    font-size: 15.5px;
  }
  .result__meta {
    font-size: 12.5px;
  }
  .footer {
    margin-top: 52px;
    padding: 22px 0 48px;
    font-size: 12.5px;
  }
  .footer__links {
    gap: 16px;
  }
}

@media (max-width: 380px) {
  .vote__btn svg {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
