:root {
  --site-header-height: 4.75rem;
  --header-top-row: var(--site-header-height);
  --header-gutter: clamp(.55rem, 2.8vw, 2.5rem);
  --header-control-size: 2.25rem;
  --header-actions-gap: .38rem;
}

.site-header {
  --header-art-height: 1.125rem;
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  pointer-events: none;
}

.header-inner {
  min-height: var(--site-header-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .5rem var(--header-gutter);
}

.header-actions {
  position: fixed;
  inset: 0 var(--header-gutter) auto auto;
  min-height: var(--header-top-row);
  display: flex;
  align-items: center;
  gap: var(--header-actions-gap);
}

.site-header .glass-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .44);
  border-radius: 999px;
  background: rgba(14, 14, 16, .64);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  backdrop-filter: blur(12px) saturate(125%);
  color: #fff;
  box-shadow: 0 .15rem .8rem rgba(10, 10, 12, .15);
  width: var(--header-control-size);
  height: var(--header-control-size);
  flex: none;
  padding: 0;
  pointer-events: auto;
  transition: background .18s ease, border-color .18s ease;
}

.site-header .glass-control:hover {
  background: rgba(14, 14, 16, .85);
  border-color: #fff;
}

.site-header a:focus-visible,
.site-header button:focus-visible {
  outline-color: #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(14, 14, 16, .78);
}

.header-mark {
  grid-column: 1;
  justify-self: start;
  max-width: 100%;
  min-height: var(--header-control-size);
  display: flex;
  align-items: center;
  pointer-events: auto;
  filter: drop-shadow(0 1px 2px #111b);
}

body:not(:has(.site-main[data-page="home"])) .header-mark {
  display: none;
}

.header-mark img,
.header-icon svg {
  display: block;
  width: auto;
  height: var(--header-art-height);
}

.header-mark img {
  max-width: 100%;
  object-fit: contain;
}

.start-countdown {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 3px #111b;
}

#start-countdown-value {
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.site-main:not([data-page="home"]):not([data-page="unavailable"]) {
  padding-top: calc(var(--site-header-height) + .75rem);
}

body.is-gated :is(.site-header, #demo-mark, .footer-brand) {
  display: none;
}

.site-footer {
  background: #1E1E1E;
  color: #f4f3ef;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .55rem 1.2rem;
  align-items: center;
  padding-block: clamp(.65rem, 1vw, .85rem);
  font-size: .86rem;
}

.footer-brand {
  display: grid;
  /* The Telegram artwork occupies 134 px of its 160 px canvas. */
  grid-template-columns: minmax(0, 28.65fr) minmax(0, 195fr);
  align-items: center;
  justify-self: start;
  gap: .55rem;
  width: min(100%, 18rem);
}

.footer-telegram {
  border-radius: 50%;
}

.footer-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.footer-admin {
  justify-self: center;
  font-weight: 700;
}

.footer-contacts {
  display: grid;
  justify-self: end;
  gap: .1rem;
  font-style: normal;
  line-height: 1.1;
}

.footer-contact {
  display: grid;
  grid-template-columns: 2.55rem auto;
  align-items: baseline;
  gap: .45rem;
}

.footer-contact-label {
  color: #c2c0bb;
}

.footer-contacts a {
  white-space: nowrap;
  overflow-wrap: normal;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer a:focus-visible {
  outline-color: #fff;
}

body.is-gated .site-footer {
  background: transparent;
  color: var(--ink);
}

body.is-gated .footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .65rem clamp(1.25rem, 3vw, 3rem);
  padding-block: 1rem clamp(1.25rem, 3vw, 2.5rem);
}

body.is-gated .footer-contact-label {
  color: var(--muted);
}

body.is-gated .site-footer a:focus-visible {
  outline-color: #a5000a;
}

@media (max-width: 740px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .footer-contacts {
    grid-column: 1 / -1;
  }
}

@media (max-width: 415px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-brand,
  .footer-contacts {
    justify-self: center;
  }
}

@media (max-width: 620px) {
  :root {
    --site-header-height: 4.6rem;
    --header-top-row: 2.8rem;
    --header-control-size: 2rem;
    --header-actions-gap: .25rem;
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) calc(var(--header-control-size) * 2 + var(--header-actions-gap));
    grid-template-rows: var(--header-top-row) auto;
    gap: 0 .6rem;
    padding-block: 0;
  }

  .start-countdown {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: start;
    flex-direction: row;
    justify-content: center;
    gap: .4rem;
    font-size: .72rem;
    line-height: 1.25;
  }

  #start-countdown-value {
    font-size: .9rem;
  }

  .footer-inner {
    font-size: clamp(.74rem, 3.2vw, .86rem);
  }
}
