@font-face {
  font-family: "Inter Tight";
  src: url("fonts/InterTight.9358bbade2f2.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Medium.bb3f07028aee.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #121212;
  --paper: #f4f1ec;
  --rec: #e5322d;
  --haze: #6e6a66;
  --frame: #2b2a29;
  --muted: #b4aea7;
  --corner: rgba(244, 241, 236, 0.55);
  --axis: clamp(24px, 8vw, 160px);
  --edge: max(20px, env(safe-area-inset-top));
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 18px/1.55 "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

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

a {
  color: var(--paper);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

img {
  display: block;
}

/* The viewfinder corners: the frame of the viewport and the frame of the paid block. */
.corners {
  background:
    linear-gradient(var(--corner), var(--corner)) top left / 28px 1.5px no-repeat,
    linear-gradient(var(--corner), var(--corner)) top left / 1.5px 28px no-repeat,
    linear-gradient(var(--corner), var(--corner)) top right / 28px 1.5px no-repeat,
    linear-gradient(var(--corner), var(--corner)) top right / 1.5px 28px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom left / 28px 1.5px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom left / 1.5px 28px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom right / 28px 1.5px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom right / 1.5px 28px no-repeat;
}

.frame {
  position: fixed;
  inset: var(--edge) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  z-index: 50;
  pointer-events: none;
}

/* The numbers and REC belong to the first screen and scroll away with it. */
.counts,
.rec {
  position: absolute;
  top: calc(var(--edge) + 14px);
  z-index: 60;
  margin: 0;
  background: var(--ink);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.counts {
  left: calc(max(20px, env(safe-area-inset-left)) + 14px);
  max-width: calc(100vw - 190px);
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  font-variant-numeric: tabular-nums;
}

.count {
  white-space: nowrap;
}

/* A number that rolls its digits: a column of 0 to 9 and 0 again, moved by transform only. */
.odo {
  display: inline-block;
  white-space: nowrap;
}

.digit {
  display: inline-block;
  height: 1.3em;
  overflow: hidden;
  vertical-align: top;
}

.digit__col {
  display: flex;
  flex-direction: column;
  transition: transform 500ms var(--ease);
  will-change: transform;
}

.digit__col span {
  height: 1.3em;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rec {
  right: calc(max(20px, env(safe-area-inset-right)) + 14px);
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  white-space: nowrap;
}

.rec__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rec);
}

.rec__time {
  font-variant-numeric: tabular-nums;
}

section {
  padding: clamp(72px, 12vh, 140px) var(--axis) 0;
}

h2 {
  font-size: clamp(32px, 4vw, 40px);
  font-weight: 560;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 22px;
  font-weight: 560;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

small,
.small {
  font-size: 15px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: 0;
  overflow: hidden;
}

.hero__text {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: clamp(48px, 7vh, 96px) 0 clamp(36px, 6vh, 72px);
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(20px, 4vh, 40px);
}

.quiet {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 15px;
  text-decoration-color: var(--haze);
}

.quiet:hover {
  color: var(--paper);
}

h1 {
  font-size: clamp(44px, 7vw, 92px);
  font-weight: 560;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 52ch;
  margin-top: 20px;
  color: var(--muted);
}

.focus {
  margin-top: 28px;
}

.focus__form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.focus__form fieldset:last-child {
  flex-basis: 100%;
}

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

legend,
.field label {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
}

.part {
  white-space: nowrap;
}

.short {
  display: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle,
.input {
  min-height: 44px;
  border: 1px solid var(--frame);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 16px;
}

.toggle {
  padding: 0 18px;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease),
    color 200ms var(--ease);
}

.toggle[aria-pressed="true"] {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

.input {
  width: 7em;
  padding: 0 14px;
}

.input::placeholder {
  color: var(--haze);
}

.result {
  min-height: 3.1em;
  margin-top: 14px;
  max-width: 44ch;
  font-size: 15px;
  color: var(--muted);
}

.cta {
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 28px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 560;
  text-decoration: none;
}

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

.button--quiet {
  border: 1px solid var(--frame);
  background: transparent;
  color: var(--paper);
  font-weight: 500;
  transition: border-color 200ms var(--ease);
}

.button--quiet:hover {
  border-color: var(--paper);
}

.button:focus-visible {
  outline-color: var(--paper);
  outline-offset: 4px;
}

/* The stream of role lines: on the right of the hero, a band under the controls on a phone. */
.stream {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  width: 46vw;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
}

.stream__track {
  animation: drift 75s linear infinite;
  will-change: transform;
}

.stream:hover .stream__track {
  animation-play-state: paused;
}

.stream__list {
  min-height: 100svh;
  padding: 0 var(--axis) 0 2vw;
  list-style: none;
}

@keyframes drift {
  to {
    transform: translateY(-50%);
  }
}

.line {
  position: relative;
  margin: 0 0 0.7em;
  padding-left: 0.7em;
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--paper);
  transition:
    filter 700ms var(--ease),
    color 700ms var(--ease),
    opacity 700ms var(--ease);
}

.line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.28em;
  height: 0.28em;
  border-radius: 50%;
  background: var(--rec);
  opacity: 0;
  transition: opacity 700ms var(--ease);
}

@media (scripting: enabled) {
  .line {
    filter: blur(5px);
    color: var(--haze);
    opacity: 0.55;
  }

  .line.is-focus {
    filter: blur(0);
    color: var(--paper);
    opacity: 1;
  }

  .line.is-focus::before {
    opacity: 1;
  }
}

@media (scripting: none) {
  .focus {
    display: none;
  }
}

@media (max-width: 419px) {
  .long {
    display: none;
  }

  .short {
    display: inline;
  }
}

@media (max-width: 767px) {
  /* On a phone only the top corners stay, over the first screen: fixed or bottom ones covered the text. */
  .frame {
    position: absolute;
    bottom: auto;
    height: 40px;
    background:
      linear-gradient(var(--corner), var(--corner)) top left / 28px 1.5px no-repeat,
      linear-gradient(var(--corner), var(--corner)) top left / 1.5px 28px no-repeat,
      linear-gradient(var(--corner), var(--corner)) top right / 28px 1.5px no-repeat,
      linear-gradient(var(--corner), var(--corner)) top right / 1.5px 28px no-repeat;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 88px var(--axis) 24px;
  }

  .brandrow {
    width: 100%;
    margin-bottom: 4px;
  }

  .brand img {
    width: auto;
    height: 36px;
  }

  h1 {
    font-size: clamp(38px, 9.8vw, 56px);
  }

  .lead {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.5;
  }

  legend,
  .field label {
    margin-bottom: 4px;
    font-size: 14px;
  }

  .toggle {
    padding: 0 12px;
    font-size: 15px;
  }

  .input {
    width: 5.5em;
  }

  .hero__text,
  .focus {
    display: contents;
  }

  .focus__form {
    gap: 10px 16px;
    margin-top: 18px;
  }

  .stream {
    position: relative;
    inset: auto;
    order: 1;
    flex: none;
    width: 100%;
    height: 170px;
    margin-top: 14px;
  }

  .stream__list {
    min-height: 170px;
    padding: 0;
  }

  .result {
    order: 2;
    min-height: 0;
    margin-top: 8px;
  }

  .cta {
    order: 3;
    margin-top: 12px;
  }

  .cta--pair {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cta--pair .button {
    min-height: 44px;
  }
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 48px;
  max-width: 1080px;
  margin-top: 56px;
  border-top: 1px solid var(--frame);
  list-style: none;
}

.steps li {
  position: relative;
  padding-top: 28px;
}

.steps li::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  width: 1px;
  height: 11px;
  background: var(--paper);
}

.steps__n {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.steps p {
  max-width: 34ch;
  margin-top: 10px;
  color: var(--muted);
}

/* The sample card, drawn as a message of the Telegram dark theme: the text and the buttons of the
   real card of the bot (tests/test_site.py keeps the markup equal to the card builder). */
.sample {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px 48px;
}

.tg {
  width: min(100%, 420px);
  font-size: 16px;
  line-height: 1.4;
}

.tg__bubble {
  padding: 8px 14px 10px;
  border-radius: 16px 16px 16px 4px;
  background: #182533;
  color: #e9eef3;
}

.tg__p + .tg__p {
  margin-top: 10px;
}

.tg__quote {
  margin: 4px 0 0;
  padding-left: 10px;
  border-left: 2px solid #6ab2f2;
  color: #c4ced8;
  font-size: 15px;
}

.tg__keys {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.tg__row {
  display: flex;
  gap: 4px;
}

.tg__key {
  flex: 1;
  padding: 9px 6px;
  border-radius: 6px;
  background: #223244;
  color: #e9eef3;
  font-size: 15px;
  text-align: center;
}

.tg__key--primary {
  background: #2b5278;
}

.caption {
  max-width: 30ch;
  color: var(--muted);
  font-size: 15px;
}

/* The cabinet */
.cabinet {
  max-width: 70ch;
}

.plain {
  margin-top: 28px;
  list-style: none;
}

.plain li {
  padding: 10px 0;
  color: var(--muted);
}

.cabinet__link {
  margin-top: 12px;
}

/* Plans */
.plans {
  max-width: 1080px;
}

.free {
  max-width: 60ch;
  margin-top: 40px;
}

.free p {
  margin-top: 8px;
  color: var(--muted);
}

.paid {
  max-width: 64ch;
  margin-top: 56px;
  padding: 40px clamp(24px, 4vw, 48px);
}

.paid > p {
  margin-top: 14px;
}

.perks {
  margin-top: 24px;
}

.perks div {
  padding: 12px 0;
  border-top: 1px solid var(--frame);
}

.perks dt {
  font-weight: 560;
}

.perks dd {
  color: var(--muted);
}

.paid .trial {
  margin-top: 24px;
  font-size: 22px;
  font-weight: 560;
}

.paid .terms {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

/* Questions */
.faq {
  max-width: 800px;
}

.faq h2 {
  margin-bottom: 32px;
}

details {
  border-top: 1px solid var(--frame);
}

details:last-of-type {
  border-bottom: 1px solid var(--frame);
}

summary {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 0;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  width: 1.4em;
  color: var(--muted);
}

details[open] summary::before {
  content: "−";
}

details p {
  max-width: 64ch;
  padding: 0 0 20px 1.4em;
  color: var(--muted);
}

code {
  color: var(--paper);
  font-family: inherit;
}

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 40px;
  padding: clamp(72px, 12vh, 140px) var(--axis) calc(48px + env(safe-area-inset-bottom));
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
}

.foot__links a,
.foot__mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.foot__links a {
  font-size: 15px;
}

.foot__copy {
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 899px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 36px 0;
    border-top: 0;
    border-left: 1px solid var(--frame);
  }

  .steps li {
    padding: 0 0 0 28px;
  }

  .steps li::before {
    top: 12px;
    left: -6px;
    width: 11px;
    height: 1px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }

  .toggle {
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stream__track {
    animation: none;
  }

  .line,
  .line::before,
  .toggle,
  .digit__col {
    transition: none;
  }
}
