/* =============================================================================
   MODULTHON — stage 01, by INCLT.

   The countdown page is one screen and never scrolls: header, a body split
   between the clock and the field of tags, and a footer line. That constraint
   drives every size below — type scales against the viewport's HEIGHT as much
   as its width, because on a page that may not overflow, a short window is the
   dangerous one, not a narrow one.

   Registration is the exception: seven questions cannot honestly be squeezed
   into a screen, so that page scrolls like any other.

   The tan is INCLT's, so the chain stays visible even here.
   ========================================================================== */

:root {
  --void:   #000000;
  --bone:   #f2efe9;
  --tan:    #c69a65;
  --tan-dk: #8e6a42;

  --muted:   rgba(242, 239, 233, 0.52);
  --muted-2: rgba(242, 239, 233, 0.3);
  --line:    rgba(242, 239, 233, 0.14);
  --line-2:  rgba(242, 239, 233, 0.07);

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --gut: clamp(18px, 4vw, 72px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(14px, 1vw, 16px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* One screen, three rows, no scrollbar. svh rather than vh so the mobile
   browser's collapsing toolbar cannot push the footer out of sight. */
body.screen {
  height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

/* A single warm source, low and off-centre, so the black has depth instead of
   being flat ink. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58vw 46vh at 74% 6%, rgba(198, 154, 101, 0.14), transparent 62%),
    radial-gradient(48vw 44vh at 10% 96%, rgba(198, 154, 101, 0.06), transparent 60%);
}

/* Film grain. Keeps large flat blacks from banding on cheap panels. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 1; min-height: 0; }

a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--tan); color: var(--void); }
:focus-visible { outline: 1px solid var(--tan); outline-offset: 4px; }

.wrap { padding-inline: var(--gut); }
.limit { max-width: 1500px; margin-inline: auto; width: 100%; }

.mono, .eyebrow, .btn, .tag, .foot, .clock__unit small {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow { font-size: clamp(9px, 0.72vw, 10.5px); color: var(--muted-2); display: block; }

/* ── header ─────────────────────────────────────────────────────────────── */

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: clamp(14px, 2.4vh, 26px);
}
.mark {
  font-family: var(--mono);
  font-size: clamp(10px, 0.85vw, 12px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  font-weight: 500;
}
.by {
  font-family: var(--mono);
  font-size: clamp(8.5px, 0.7vw, 10px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-decoration: none;
  transition: color 0.4s var(--ease);
}
/* .by перестал быть ссылкой целиком: проводит одна компания, ссылка ведёт на
   другую. Поэтому подсвечивается вложенный <a>, а не весь блок. */
.by a { color: inherit; text-decoration: none; transition: color 0.4s var(--ease); }
.by a:hover { color: var(--tan); }
.by b { font-weight: 400; color: var(--muted); }
.by a b { color: var(--muted); }
.by a:hover b { color: var(--tan); }

.head__right { display: inline-flex; align-items: center; gap: clamp(10px, 1.6vw, 26px); }
.langs-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.visitors {
  font-family: var(--mono);
  font-size: clamp(7.5px, 0.6vw, 9px);
  letter-spacing: 0.1em;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.visitors.is-ready { opacity: 1; }
.langs {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--mono);
  font-size: clamp(8.5px, 0.7vw, 10px);
  letter-spacing: 0.16em;
  color: var(--muted-2);
}
.langs a { text-decoration: none; transition: color 0.35s var(--ease); }
.langs a:hover { color: var(--bone); }
.langs a[aria-current] { color: var(--bone); }

/* ── the button, of which there is one ──────────────────────────────────── */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
  padding: 1.05em 2em;
  font-size: clamp(10px, 0.8vw, 11px);
  border: 1px solid var(--bone);
  border-radius: 999px;
  background: var(--bone);
  color: var(--void);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.5s var(--ease), background 0.5s var(--ease),
              color 0.5s var(--ease), border-color 0.5s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--tan); border-color: var(--tan); }
.btn__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.btn--quiet { background: none; color: var(--bone); border-color: var(--line); }
.btn--quiet:hover { background: none; color: var(--tan); border-color: var(--tan); }

/* ── the one screen ─────────────────────────────────────────────────────── */

.one {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(20px, 3.4vw, 64px);
  align-items: center;
  min-height: 0;
  padding-block: clamp(8px, 1.6vh, 24px);
}

.lead {
  display: grid;
  gap: clamp(10px, 1.9vh, 24px);
  align-content: center;
  min-height: 0;
}

.lead__title {
  margin: 0;
  font-weight: 200;
  /* min() against both axes: a wide-but-short window is the case that breaks
     a one-screen page, and vw alone cannot see it. */
  font-size: clamp(30px, min(8.4vw, 12.4vh), 132px);
  line-height: 0.86;
  letter-spacing: -0.05em;
}
.lead__title em { font-style: normal; color: var(--tan); }

.lead__line {
  margin: 0;
  max-width: 38ch;
  font-size: clamp(13px, min(1.25vw, 2vh), 19px);
  line-height: 1.42;
  color: var(--muted);
}
.lead__line b { font-weight: 400; color: var(--bone); }

.lead__act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.lead__act .note {
  margin: 0;
  font-size: clamp(10px, 0.85vw, 12.5px);
  color: var(--muted-2);
  max-width: 28ch;
}

/* ── the clock ──────────────────────────────────────────────────────────── */

.clock {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(12px, 2.4vw, 48px);
}
.clock__unit { display: grid; gap: 4px; }
.clock__unit b {
  font-weight: 200;
  font-size: clamp(30px, min(6.6vw, 10vh), 104px);
  line-height: 0.86;
  letter-spacing: -0.055em;
  /* Tabular figures, or the whole row twitches once a second. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.clock__unit small { font-size: clamp(8px, 0.66vw, 9.5px); color: var(--muted-2); }
.clock__sep {
  font-weight: 200;
  font-size: clamp(18px, min(4vw, 6vh), 66px);
  line-height: 1;
  color: var(--tan-dk);
  align-self: start;
}
@media (max-width: 620px) { .clock__sep { display: none; } }

/* Before the script runs there is a date in the markup, not an empty row. */
.clock__fallback { font-size: clamp(16px, 2.6vw, 30px); font-weight: 200; letter-spacing: -0.02em; }

.clock--done b { color: var(--tan); }

/* ── the tags ───────────────────────────────────────────────────────────── */

.field {
  display: grid;
  gap: clamp(10px, 1.8vh, 22px);
  align-content: center;
  min-height: 0;
  /* Список из семидесяти слов — запасной вариант для случая без JS, и он не
     должен вываливаться за экран, которому запрещено прокручиваться. */
  overflow: hidden;
}

/* Not a word-cloud generator — a hand-set field. Weight and opacity carry the
   hierarchy, so it reads as a list of possibilities rather than decoration. */
.cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: clamp(6px, 1vh, 14px) clamp(10px, 1.4vw, 26px);
}
.tag {
  font-size: clamp(9px, 0.72vw, 10.5px);
  color: var(--muted-2);
  white-space: nowrap;
  transition: color 0.45s var(--ease);
}
.tag:hover { color: var(--bone); }
/* Three tiers. The typologies shout, the craft words speak, the constraints
   whisper — roughly the order a participant meets them in. */
.tag--lg {
  font-family: var(--sans);
  font-weight: 200;
  font-size: clamp(19px, min(2.9vw, 4.3vh), 46px);
  letter-spacing: -0.035em;
  text-transform: none;
  color: var(--bone);
}
.tag--md {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(13px, min(1.6vw, 2.4vh), 25px);
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--muted);
}
.tag--lg:hover { color: var(--tan); }
.tag--md:hover { color: var(--bone); }

/* ── облако-сфера ───────────────────────────────────────────────────────── */

/* Два холста на весь экран: задний под содержимым страницы, передний над ним.
   Слово попадает в тот или другой по своей полусфере, поэтому оно проходит
   за заголовком и перед ним, а не поверх всего подряд. */
.cloud-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* Ручка центра. Её не должно быть видно, пока к ней не потянулись: круг из
   пунктира появляется под курсором и снова растворяется. */
#cloudHandle {
  position: fixed;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px dashed var(--line);
  border-radius: 50%;
  background: none;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.5s var(--ease), border-color 0.5s var(--ease);
}
#cloudHandle::before {
  content: "";
  position: absolute;
  inset: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--tan);
}
#cloudHandle:hover, #cloudHandle.active { opacity: 1; }
#cloudHandle:focus-visible { opacity: 1; }
#cloudHandle.grabbing { cursor: grabbing; border-color: var(--tan); }

/* Подсказка и заодно табло: во время перетаскивания показывает готовую строку
   атрибутов, которую можно перенести в разметку и зафиксировать для всех. */
#cloudHint {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: clamp(58px, 8vh, 84px);
  transform: translateX(-50%);
  max-width: min(92vw, 640px);
  padding: 0.55em 1.1em;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
#cloudHint.show { opacity: 1; }

/* Приз — единственный абзац на первом экране, который что-то обещает, а не
   описывает. Он закрывает правую колонку, потому что читается последним:
   сначала что можно спроектировать, потом что за это будет. */
.prize {
  margin: 0;
  max-width: 48ch;
  padding-top: clamp(8px, 1.5vh, 18px);
  border-top: 1px solid var(--line-2);
  font-size: clamp(11.5px, min(1.02vw, 1.65vh), 16px);
  line-height: 1.45;
  color: var(--muted);
}
.prize b { font-weight: 400; color: var(--tan); }

/* Below this the two columns stack, and the quietest tier is the first thing
   to go — a screen that fits is worth more than the last eight words. */
@media (max-width: 900px) {
  .one { grid-template-columns: minmax(0, 1fr); align-content: center; gap: clamp(16px, 2.6vh, 30px); }
  .tag:not(.tag--lg):not(.tag--md) { display: none; }
}
@media (max-width: 900px) and (max-height: 720px) {
  .tag--md { display: none; }
  .lead__line { display: none; }
}

/* ── footer ─────────────────────────────────────────────────────────────── */

.foot {
  display: flex; flex-wrap: wrap; gap: 8px 32px;
  align-items: center; justify-content: space-between;
  padding-block: clamp(12px, 2vh, 24px);
  border-top: 1px solid var(--line-2);
  font-size: clamp(8.5px, 0.7vw, 10px);
  color: var(--muted-2);
}
.foot a { text-decoration: none; transition: color 0.35s var(--ease); }
.foot a:hover { color: var(--bone); }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot .hint { color: var(--muted); }
.foot .hint b { font-weight: 400; color: var(--tan); }

/* ── registration — the page that is allowed to scroll ──────────────────── */

.reg {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(36px, 6vw, 100px);
  padding-block: clamp(30px, 5vh, 70px) clamp(56px, 9vh, 120px);
}
@media (max-width: 900px) { .reg { grid-template-columns: minmax(0, 1fr); } }

.brief { position: sticky; top: 36px; align-self: start; display: grid; gap: 20px; }
@media (max-width: 900px) { .brief { position: static; } }
.brief h1 {
  margin: 0;
  font-weight: 200;
  font-size: clamp(32px, 4.6vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.042em;
}
.brief h1 em { font-style: normal; color: var(--tan); }
.brief p { margin: 0; color: var(--muted); max-width: 38ch; }
.brief dl { margin: 0; display: grid; gap: 1px; background: var(--line-2); border-block: 1px solid var(--line-2); }
.brief dl > div { background: var(--void); padding: 13px 0; display: grid; grid-template-columns: 7rem 1fr; gap: 14px; }
.brief dt { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em;
            text-transform: uppercase; color: var(--muted-2); padding-top: 0.3em; }
.brief dd { margin: 0; font-size: 0.97em; }

.form { display: grid; gap: clamp(26px, 3.2vw, 40px); }
.q { display: grid; gap: 13px; }
.q__ask { margin: 0; font-weight: 300; font-size: clamp(17px, 1.6vw, 24px);
          letter-spacing: -0.018em; line-height: 1.25; }
.q__ask span { color: var(--tan); font-family: var(--mono); font-size: 10px;
               letter-spacing: 0.16em; vertical-align: 0.55em; margin-right: 0.9em; }
.q__why { margin: -5px 0 0; font-size: 0.86em; color: var(--muted-2); max-width: 52ch; }

.q input, .q textarea {
  width: 100%;
  padding: 0.65em 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  border-radius: 0;
  font-size: clamp(15px, 1.15vw, 18px);
  font-weight: 300;
  color: var(--bone);
  transition: border-color 0.4s var(--ease);
}
.q textarea { resize: vertical; min-height: 5em; line-height: 1.5; }
.q input:focus, .q textarea:focus { outline: none; border-bottom-color: var(--tan); }
.q input::placeholder, .q textarea::placeholder { color: var(--muted-2); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 32px); }
@media (max-width: 620px) { .pair { grid-template-columns: 1fr; } }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; display: inline-block; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; pointer-events: none; }
.opt span {
  display: inline-block;
  padding: 0.6em 1.05em;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease), background 0.35s var(--ease);
}
.opt:hover span { border-color: var(--muted-2); color: var(--bone); }
.opt input:checked + span { background: var(--bone); border-color: var(--bone); color: var(--void); }
.opt input:focus-visible + span { outline: 1px solid var(--tan); outline-offset: 3px; }

.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
              padding-top: 14px; border-top: 1px solid var(--line-2); }
.form__note { margin: 0; font-size: 0.85em; color: var(--muted-2); max-width: 38ch; }
.form__status { margin: 0; min-height: 1.4em; font-size: 0.9em; color: var(--tan); }
.form__status[data-error] { color: #d4795e; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ── поддержать ─────────────────────────────────────────────────────────── */

/* Кнопка Buy Me a Coffee — их собственная, из фирменного набора, векторная и
   без текстовых элементов: значит не зависит ни от шрифта, ни от растра. Её
   не перекрашиваем — чужой знак остаётся чужим знаком, а жёлтый на чёрном
   и так единственное пятно, которое здесь нужно заметить. */
.support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin: clamp(26px, 3.2vw, 40px) 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line-2);
}
.support span {
  font-size: 0.85em;
  color: var(--muted-2);
  max-width: 36ch;
}
.bmc {
  display: inline-flex;
  border-radius: 12px;
  transition: transform 0.4s var(--ease), filter 0.4s var(--ease);
}
.bmc:hover { transform: translateY(-2px); filter: brightness(1.06); }
.bmc img { display: block; width: auto; height: clamp(42px, 4vw, 52px); }

.done { display: grid; gap: 20px; justify-items: start; padding-top: clamp(16px, 4vw, 34px); }
.done h2 { margin: 0; font-weight: 200; font-size: clamp(26px, 3.6vw, 46px);
           letter-spacing: -0.035em; line-height: 1.02; }
.done p { margin: 0; color: var(--muted); max-width: 44ch; }
.done a.inline { color: var(--tan); text-decoration: none; border-bottom: 1px solid var(--tan-dk); }

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

/* ── окно «вступите в канал» ─────────────────────────────────────────────── */

/* Нативный <dialog>: он сам держит фокус внутри, закрывается по Esc и рисует
   подложку. Самодельная модалка — это те же полтора экрана кода, только с
   ошибками в доступности, которых здесь просто нет. */

.join {
  border: 0;
  padding: 0;
  max-width: min(30rem, calc(100vw - 2 * var(--gut)));
  width: 100%;
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 88% -10%, rgba(198,154,101,0.18), transparent 58%),
    linear-gradient(180deg, #17150f, #100f0c);
  box-shadow: inset 0 1px 0 rgba(242,239,232,0.14), 0 40px 90px rgba(0,0,0,0.6);
  color: var(--fg);
}
.join::backdrop { background: rgba(8, 7, 6, 0.72); backdrop-filter: blur(6px); }
.join__body { display: grid; gap: clamp(10px, 1.6vh, 16px); padding: clamp(24px, 3.4vw, 38px); }
.join__title { margin: 0; font-weight: 200; font-size: clamp(24px, 3.4vw, 38px);
               line-height: 1.04; letter-spacing: -0.035em; }
.join__title em { font-style: normal; color: var(--wood); }
.join__text { margin: 0; color: var(--muted); }
.join__cta { justify-content: center; width: 100%; margin-top: 6px; }
.join__alt { margin: 0; color: var(--muted-2); font-size: 0.9em; }
.join__alt a { color: var(--wood); text-decoration: none; border-bottom: 1px solid rgba(198,154,101,0.4); }
.join__alt a:hover { color: var(--fg); border-bottom-color: var(--fg); }
/* Отказ доступен, но не соревнуется с главным действием. */
.join__later { justify-content: center; width: 100%; }

.done__acts { display: flex; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .join[open] { animation: join-in 0.32s var(--ease); }
  @keyframes join-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
  }
}

/* ── знак, который складывается при поздравлении ─────────────────────────── */

/* Восемь досок съезжаются каждая со своей стороны и сплетаются в знак. Смысл
   буквальный: человек только что стал частью плетения. Играет один раз при
   открытии окна — это событие, а не фон, и повторять его незачем. */

.weave {
  width: clamp(48px, 9vw, 66px);
  height: auto;
  color: var(--tan);
  margin-bottom: 2px;
}
.wv {
  fill: currentColor;
  opacity: 0;
  animation: wv-in 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.06s + var(--n) * 0.07s);
}
.wv--l { transform: translateX(-46px); }
.wv--r { transform: translateX(46px); }
.wv--t { transform: translateY(-46px); }
.wv--b { transform: translateY(46px); }

@keyframes wv-in {
  to { opacity: 1; transform: none; }
}

/* Когда все доски на месте — короткая тёплая вспышка: сплелось. */
.join[open] .weave { animation: wv-glow 1.1s ease-out 0.72s both; }
@keyframes wv-glow {
  0%   { filter: none; }
  35%  { filter: drop-shadow(0 0 16px rgba(240, 214, 170, 0.75)); }
  100% { filter: none; }
}

/* Просьбу о меньшем движении уважаем: знак просто стоит собранным. */
@media (prefers-reduced-motion: reduce) {
  .wv { animation: none; opacity: 1; transform: none; }
  .join[open] .weave { animation: none; }
}

/* Текст для поисковиков и экранных дикторов: в разметке есть, глазу не виден. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
