:root {
  --ink: #fff;
  --paper: #000;
  --quiet: #8c8c8c; /* the only grey; 6.7:1 on black, still AA for small text */

  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(16px, 3.2vw, 46px);
  --hair: 1px;
  --small: 12px;          /* service labels, like the reference's nav */
  --body: 15px;
  --field: 22px;          /* input text: big enough to feel like writing, >=16 so iOS won't zoom */
  --giant: clamp(92px, 19vw, 320px);
  --below-title: calc(var(--giant) * .3); /* clears the descender of «д» at the tight .78 line-height */

  --marquee-time: 38s;    /* slow enough to read a hashtag without chasing it */
  --tilt: -2.2deg;        /* second strip; steep enough to read as intentional, not a bug */
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--body)/1.35 var(--sans);
  overflow-x: clip;
}

a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: var(--hair); }
img { display: block; max-width: 100%; height: auto; }

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

/* ---- top ---- */

.handle {
  margin: 0;
  padding: 7px 0;
  text-align: center;
  font: var(--small)/1 var(--mono);
}
.handle a { background: var(--quiet); color: var(--paper); padding: 1px 3px; text-decoration: none; }
.handle a:hover { background: var(--ink); }

.marquee {
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--small);
  line-height: 1;
  padding: 7px 0 6px;
  white-space: nowrap;
  user-select: none;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-time) linear infinite;
}
/* Two identical groups: shifting by exactly one group width makes the loop seamless. */
.marquee__group { display: flex; gap: 2.6em; padding-right: 2.6em; }
.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee--reverse {
  position: relative;
  z-index: 2;
  margin: -24px -4vw 0;   /* wider than the viewport so the tilted ends never show */
  transform: rotate(var(--tilt));
  font-family: var(--mono);
  letter-spacing: -.02em;
}
.marquee--reverse .marquee__track { animation-direction: reverse; animation-duration: calc(var(--marquee-time) * .8); }

@keyframes marquee { to { transform: translateX(-50%); } }

.nav {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr auto;
  align-items: center;
  padding: 14px var(--gutter) 0;
  font-size: 13px;
}
.nav__logo { width: 78px; }
.nav__link { text-decoration: none; }
.nav__link:hover { text-decoration: underline; }
.nav__link--quiet { color: var(--quiet); }
.nav__aside { font: var(--small)/1 var(--mono); }

/* ---- posters ---- */

.posters { padding: 46px var(--gutter) 0; }

.rule {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 5vw, 90px);
}
.rule__title { margin: 0; font-size: 13px; font-weight: 400; }
.rule__line { height: var(--hair); background: var(--ink); }
.rule__range { font: var(--small)/1 var(--mono); }

.posters__hint {
  margin: 12px 0 0 calc(100% / 6);
  color: var(--quiet);
  font: 11px/1.3 var(--mono);
}

/* Without JS the wall is a plain staggered column; site.js scatters it. */
.wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 9%;
  padding: 56px 4% 120px;
}
.wall > :nth-child(even) { margin-top: 90px; }

.poster {
  position: relative;
  margin: 0;
  rotate: var(--r, 0deg);
}
.poster:nth-child(odd) { --r: -2.5deg; }
.poster:nth-child(even) { --r: 3deg; }
.poster img { width: 100%; }

.poster__tag {
  position: absolute;
  top: -11px;
  left: -11px;
  z-index: 1;
  background: var(--ink);
  color: var(--paper);
  padding: 7px 6px 6px;
  font: 11px/1 var(--mono);
}

.poster--empty {
  aspect-ratio: 3 / 4;
  border: var(--hair) solid var(--ink);
  display: grid;
  place-items: center;
  background: var(--paper);
}
.poster__soon {
  font: var(--small)/1.3 var(--mono);
  color: var(--quiet);
  text-align: center;
}
.poster__hash { position: absolute; top: 10px; right: 12px; font-size: 13px; }

.wall.is-scattered { display: block; position: relative; padding: 0; gap: 0; }
.wall.is-scattered > .poster { position: absolute; margin: 0; }

.can-drag .wall.is-scattered > .poster { cursor: grab; touch-action: none; }
.can-drag .wall.is-scattered > .poster.is-held { cursor: grabbing; }

/* ---- apply ---- */

.apply {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding: 150px var(--gutter) 110px;
}

.apply__title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--giant);
  font-weight: 700;
  line-height: .78;
  letter-spacing: -.065em;
}
.apply__title span { display: block; }
/* The second half slips right, the way a flyer gets laid out by hand. */
.apply__title span + span { padding-left: 1.05em; }

.apply__note {
  grid-column: 1 / span 4;
  margin: var(--below-title) 0 0;
  max-width: 30ch;
  font-size: 13px;
}
.apply__mark { font: 11px/1 var(--mono); background: var(--ink); color: var(--paper); padding: 2px 3px; margin-right: 4px; }

.form,
.apply__done {
  grid-column: 6 / span 6;
  margin-top: var(--below-title);
}

.apply__done {
  margin-bottom: 0;
  font-size: clamp(36px, 6vw, 84px);
  font-weight: 700;
  line-height: .9;
  letter-spacing: -.05em;
}

.form__row { margin-bottom: 30px; }

.form__label {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}
.form__label span { font: 11px/1 var(--mono); color: var(--quiet); margin-right: 10px; }

.form__input {
  width: 100%;
  padding: 6px 0 8px;
  border: 0;
  border-bottom: var(--hair) solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: var(--field)/1.2 var(--sans);
  letter-spacing: -.01em;
}
.form__input::placeholder { color: #444; }
.form__input:focus-visible { outline: none; border-bottom-width: 3px; padding-bottom: 6px; }
.form__input[aria-invalid="true"] { border-bottom-style: dashed; }

.form__error {
  min-height: 1.3em;
  margin: 6px 0 0;
  font: 11px/1.3 var(--mono);
}
.form__error:not(:empty)::before { content: "* "; }

.form__consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 12px;
  align-items: start;
  font-size: 12px;
  line-height: 1.4;
  margin: 8px 0 26px;
}
.form__consent .form__error { grid-column: 2; }

.form__check {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  border: var(--hair) solid var(--ink);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.form__check:checked { background: var(--ink); box-shadow: inset 0 0 0 3px var(--paper); }

.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__submit {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 17px 16px 16px;
  border: var(--hair) solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: 700 18px/1 var(--sans);
  letter-spacing: -.02em;
  cursor: pointer;
}
.form__submit:hover { background: var(--paper); color: var(--ink); }
.form__submit:active { translate: 0 1px; }
.form__submit:disabled { cursor: progress; background: var(--paper); color: var(--quiet); border-color: var(--quiet); }

.form__status { min-height: 1.3em; margin: 12px 0 0; font: var(--small)/1.3 var(--mono); }

/* ---- end ---- */

.end {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 14px var(--gutter) 18px;
  border-top: var(--hair) solid var(--ink);
  font: 11px/1 var(--mono);
}
.end__mid { color: var(--quiet); }
.end a { justify-self: end; }

/* ---- privacy page ---- */

.page__top {
  display: flex;
  justify-content: space-between;
  padding: 14px var(--gutter);
  border-bottom: var(--hair) solid var(--ink);
  font: var(--small)/1 var(--mono);
}
.page__top a { text-decoration: none; }
.page__body { max-width: 62ch; padding: 60px var(--gutter) 120px; }
.page__body h1 { margin: 0 0 30px; font-size: clamp(32px, 5vw, 56px); line-height: .95; letter-spacing: -.04em; }
.page__stub { color: var(--quiet); font: 13px/1.5 var(--mono); }

/* ---- narrow ---- */

@media (max-width: 760px) {
  .nav { grid-template-columns: auto 1fr auto; gap: 18px; }
  .nav__logo { width: 60px; }
  .nav__aside { display: none; }
  .nav__link--quiet { justify-self: end; }

  .posters__hint { margin-left: 0; }

  .wall { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 40px 7% 110px; }
  .wall > .poster { width: 78%; margin-top: -18px; }
  .wall > :first-child { margin-top: 0; }
  .wall > :nth-child(even) { margin-top: -18px; justify-self: end; }

  .apply { padding-top: 110px; }
  .apply__title span + span { padding-left: .45em; }
  .apply__note,
  .form,
  .apply__done { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .poster:nth-child(n) { --r: 0deg; } /* site.js reads the same query and skips the tilt */
}
