/* The look follows site/prototype/index.html, the owner's design. Sizes are in rem so that the
   browser's text size setting scales the page; 1rem is 16px of the prototype. */

@font-face {
  font-family: "Onest";
  src: url("/fonts/onest.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f3f2f0;
  --panel-2: #eae8e4;
  --line: #e3e0db;
  --ink: #121214;
  --mute: #75726d;
  --key: #ffffff;
  --key-edge: #d9d5ce;
  --star: #8b6bc2;
  --lilac: #d9c1f0;
  --lilac-ink: #4e2f86;
  --lilac-soft: #f4ecfc;
  --btn: #121214;
  --btn-ink: #ffffff;
  --scrim: rgb(0 0 0 / 0.35);

  /* The chat on the first screen uses the app's light theme. */
  --app-bg: #e9e6e1;
  --app-in: #d7d3cd;
  --app-out: #252528;
  --app-out-ink: #f4f4f4;
  --app-field: color-mix(in srgb, #ffffff 55%, var(--app-bg));

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --wrap: 70rem;
  --gut: clamp(16px, 4.5vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e0e10;
    --panel: #19191c;
    --panel-2: #222226;
    --line: #2b2b30;
    --ink: #f2f2f3;
    --mute: #9c9ba2;
    --key: #222226;
    --key-edge: #0a0a0b;
    --star: #d9c1f0;
    --lilac-ink: #d9c1f0;
    --lilac-soft: #2a2236;
    --btn: #f2f2f3;
    --btn-ink: #0e0e10;
    --scrim: rgb(0 0 0 / 0.55);
    --app-bg: #16171a;
    --app-in: #26272b;
    --app-out: #e9e7e3;
    --app-out-ink: #141414;
    --app-field: #26272b;
  }
}

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

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

html {
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font: 400 1.125rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  color: inherit;
}

img,
svg {
  display: block;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gut);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 50;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-ink);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

[hidden] {
  display: none !important;
}

/* Pieces */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.2s ease;
}

.pill:active {
  transform: scale(0.97);
}

.pill.dark {
  background: var(--btn);
  color: var(--btn-ink);
}

.pill.soft {
  background: var(--panel);
  color: var(--ink);
}

.pill.soon {
  background: var(--lilac-soft);
  color: var(--lilac-ink);
  box-shadow: inset 0 0 0 1.5px var(--lilac);
  cursor: default;
}

.pill.soon:active {
  transform: none;
}

/* The brand key: the star sitting in a physical capsule that presses down. */
.key {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 52px;
  border-radius: 18px;
  background: var(--key);
  box-shadow: inset 0 0 0 1.5px var(--key-edge), 0 4px 0 var(--key-edge);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.key:active {
  transform: translateY(3px);
  box-shadow: inset 0 0 0 1.5px var(--key-edge), 0 1px 0 var(--key-edge);
}

.key svg {
  width: 30px;
  height: 30px;
}

.key path {
  fill: var(--star);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.small-note {
  margin: 14px 0 0;
  font-size: 0.875rem;
  color: var(--mute);
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}

.top .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
}

.burger {
  justify-self: start;
  display: grid;
  place-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.burger i {
  display: block;
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
}

.top .pill {
  justify-self: end;
  min-height: 46px;
  padding: 0 20px;
  font-size: 1rem;
}

/* First screen */

.hero {
  padding: clamp(28px, 6vh, 72px) 0 clamp(40px, 7vh, 80px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(3.25rem, 8.4vw, 6.5rem);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

/* «мессенджер.» has to fit the text column next to the chat, otherwise it runs under the chat. */
.hero h1 {
  font-size: clamp(3.25rem, 6.6vw, 5.5rem);
  overflow-wrap: normal;
}

@media (max-width: 860px) {
  .hero h1 {
    font-size: clamp(3.25rem, 12vw, 6.5rem);
  }
}

.lead {
  margin: 22px 0 0;
  max-width: 30ch;
  color: var(--mute);
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
}

/* The chat: a real piece of the app. */
.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 420px;
  margin: 0;
  padding: 18px 16px 16px;
  border-radius: 36px;
  background: var(--app-bg);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
}

.ava {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #a9d8ee;
  color: #10222c;
  font-weight: 700;
  font-size: 1.125rem;
}

.ava::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 2px solid transparent;
  border-radius: 50%;
  border-top-color: rgb(255 255 255 / 0.95);
  border-left-color: rgb(255 255 255 / 0.6);
  transform: rotate(-20deg);
}

.who b {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
}

.who span {
  font-size: 0.875rem;
  color: var(--mute);
}

.lock {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  opacity: 0.6;
}

.msgs {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
}

.m {
  position: relative;
  max-width: 78%;
  margin: 0;
  padding: 11px 16px;
  border-radius: 22px;
  font-size: 1rem;
  line-height: 1.35;
}

.m.in {
  align-self: flex-start;
  background: var(--app-in);
}

.m.out {
  align-self: flex-end;
  background: var(--app-out);
  color: var(--app-out-ink);
}

/* Messages of one author stick together into a column. */
.m.in + .m.in {
  border-top-left-radius: 8px;
}

.m.in:has(+ .m.in) {
  border-bottom-left-radius: 8px;
}

.m.out + .m.out {
  border-top-right-radius: 8px;
}

.m.out:has(+ .m.out) {
  border-bottom-right-radius: 8px;
}

.m.in + .m.out,
.m.out + .m.in {
  margin-top: 10px;
}

.m .r {
  position: absolute;
  left: 12px;
  bottom: -14px;
  padding: 1px 9px;
  border: 3px solid var(--app-bg);
  border-radius: 999px;
  background: var(--app-in);
  font-size: 0.8125rem;
}

.m.has-r {
  margin-bottom: 14px;
}

.m.pop {
  animation: pop 0.42s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.m.out.pop {
  transform-origin: 100% 100%;
}

.m.in.pop {
  transform-origin: 0 100%;
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

.composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  background: var(--app-field);
}

.composer p {
  flex: 1;
  margin: 0;
  color: var(--mute);
  font-size: 1rem;
}

.send {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--app-out);
  color: var(--app-out-ink);
  cursor: pointer;
}

.send svg {
  width: 20px;
  height: 20px;
}

.send:active {
  transform: scale(0.92);
}

/* Sections */

.block {
  padding: clamp(56px, 10vh, 110px) 0;
}

h2 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.sub {
  margin: 16px 0 0;
  max-width: 46ch;
  color: var(--mute);
}

/* What's inside: chips and a table of facts for the chosen one */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.chip {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--panel);
  font-weight: 600;
  font-size: 1.0625rem;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.chip[aria-selected="true"] {
  background: var(--lilac-soft);
  color: var(--lilac-ink);
  box-shadow: inset 0 0 0 1.5px var(--lilac);
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-top: 30px;
}

/* Without the script every feature is listed one after another. */
.detail + .detail {
  margin-top: 56px;
}

[data-tabs]:not([hidden]) ~ .detail {
  margin-top: 30px;
}

.detail h3 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.detail p {
  margin: 12px 0 0;
  max-width: 40ch;
  color: var(--mute);
}

.detail.fade > * {
  animation: fadein 0.3s ease both;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.rows {
  margin: 0;
  border-top: 1px solid var(--line);
}

.rows div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.rows dt {
  color: var(--mute);
}

.rows dd {
  margin: 0;
  min-width: 0;
}

/* Download card */

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  margin-top: 34px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 36px;
  background: var(--panel);
}

.card h3 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.card .rows {
  margin-top: 24px;
  border-top-color: var(--panel-2);
}

.card .rows div {
  border-bottom-color: var(--panel-2);
}

.cta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.card .pill.soft {
  background: var(--bg);
}

.cta .sub,
.cta .actions {
  margin: 0;
}

.qr {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
}

.qr img {
  width: 128px;
  height: 128px;
  padding: 8px;
  border-radius: 18px;
  background: #ffffff;
}

.qr figcaption {
  max-width: 18ch;
  color: var(--mute);
  font-size: 0.9375rem;
}

/* Questions */

.faq {
  margin-top: 34px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--panel);
}

.faq details + details {
  border-top: 1px solid var(--bg);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(20px, 3vw, 34px);
  font-size: clamp(1.1875rem, 2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  list-style: none;
  cursor: pointer;
}

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

.faq summary svg {
  flex: none;
  width: 26px;
  height: 26px;
  transition: transform 0.25s ease;
}

.faq details[open] summary svg {
  transform: rotate(180deg);
}

.faq .a {
  max-width: 64ch;
  padding: 0 clamp(20px, 3vw, 34px) 26px;
  color: var(--mute);
}

.faq .a p {
  margin: 0;
}

/* Footer */

footer {
  padding: 56px 0 40px;
}

.cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.cols h2 {
  margin: 0 0 12px;
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--mute);
}

.cols ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cols a {
  display: block;
  padding: 7px 0;
  text-decoration: none;
}

.cols a:hover {
  text-decoration: underline;
}

.sign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 44px;
  padding: 28px clamp(20px, 3vw, 34px);
  border-radius: 32px;
  background: var(--panel);
}

.mark {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 800;
  font-size: 2.125rem;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.sign p {
  margin: 0;
  max-width: 46ch;
  color: var(--mute);
  font-size: 0.875rem;
}

/* Menu: a bottom sheet with the same sections as the footer */

.sheet {
  position: fixed;
  inset: auto 10px 10px;
  width: auto;
  max-width: 640px;
  max-height: calc(100% - 20px);
  margin: 0 auto;
  padding: 0 26px 30px;
  overflow: auto;
  border: 0;
  border-radius: 32px;
  background: var(--bg);
  color: var(--ink);
}

.sheet[open] {
  animation: sheet-in 0.35s cubic-bezier(0.3, 1.1, 0.4, 1) both;
}

.sheet.is-closing {
  animation: sheet-out 0.25s ease both;
}

.sheet::backdrop {
  background: var(--scrim);
}

@keyframes sheet-in {
  from {
    transform: translateY(110%);
  }
}

@keyframes sheet-out {
  to {
    transform: translateY(110%);
  }
}

.grab {
  display: block;
  width: 100%;
  height: 40px;
  margin-bottom: 4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.grab::before {
  content: "";
  display: block;
  width: 44px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: var(--line);
}

.sheet .cols a {
  font-size: 1.1875rem;
}

/* Inner pages */

.page {
  padding: 28px 0 80px;
}

.page .wrap {
  max-width: calc(760px + 2 * var(--gut));
}

.page h1 {
  font-size: clamp(2.75rem, 7vw, 4.75rem);
}

.page h2 {
  margin-top: 48px;
  font-size: clamp(1.625rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.page h3 {
  margin: 32px 0 0;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

.page p,
.page li {
  max-width: 62ch;
  color: var(--mute);
}

.page strong {
  color: var(--ink);
  font-weight: 600;
}

.page ol,
.page ul {
  padding-left: 1.2em;
}

.page li + li {
  margin-top: 6px;
}

.page .rows {
  margin-top: 18px;
}

.page .actions + ol {
  margin-top: 34px;
}

.page .lead + .note {
  margin-top: 22px;
}

.note {
  padding: 18px 22px;
  border-radius: 24px;
  background: var(--panel);
}

.page .note {
  color: var(--ink);
}

.fine {
  font-size: 0.9375rem;
}

pre {
  margin: 12px 0 0;
  padding: 14px 18px;
  overflow-x: auto;
  border-radius: 18px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.875rem;
}

@media (max-width: 860px) {
  .hero .wrap,
  .detail,
  .card {
    grid-template-columns: 1fr;
  }

  .chat {
    min-height: 380px;
  }

  .cols {
    grid-template-columns: 1fr 1fr;
  }

  .qr {
    display: none;
  }
}

@media (max-width: 420px) {
  .rows div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

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