/* The landing page (S-LAND). Same style pack as the app, `router`, and only its tokens.
 *
 * Three rules this file keeps, each for a reason the app already paid for:
 *   - logical properties only (`inline`, `block`), so Arabic needs no `[dir="rtl"]` twin —
 *     every twin is a place the two directions drift (S-WEB-9's RTL pass);
 *   - every control clears 44px under a finger, and a smaller LOOK never means a smaller
 *     hit area;
 *   - the chat-list preview is Telegram's, not ours (`preview.css`): inside `.tg` the
 *     colours are the client's, and the avatars below are the one addition.
 * A marketing page reads at 16px, not the app's 14: the app is a tool somebody works in,
 * this is something they read once before deciding.
 */

.lp {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-card);
  font-weight: var(--w-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

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

.lp a {
  color: var(--accent);
}

.lp :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

.lp-wrap {
  max-inline-size: var(--lp-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.lp-skip {
  position: absolute;
  inset-inline-start: var(--space-3);
  inset-block-start: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r-control);
}

.lp-skip:focus {
  inset-block-start: var(--space-3);
}

/* ── top bar ─────────────────────────────────────────────────────────────── */

.lp-top {
  position: sticky;
  inset-block-start: 0;
  z-index: 5;
  background: var(--panel);
  border-block-end: 1px solid var(--border);
}

.lp-top__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-block-size: var(--lp-header-height);
}

.lp-brand {
  margin: 0;
  font-weight: var(--w-bold);
  font-size: var(--t-card);
  letter-spacing: var(--track-tight);
  color: var(--ink);
  text-decoration: none;
}

.lp .lp-brand {
  color: var(--ink);
}

a.lp-brand,
.lp-foot__link {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--lp-hit);
}

.lp-nav {
  display: flex;
  gap: var(--space-5);
  margin-inline-start: auto;
}

.lp-nav a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--lp-hit);
  color: var(--muted);
  font-size: var(--t-body);
  font-weight: var(--w-med);
  text-decoration: none;
}

.lp-nav a:hover {
  color: var(--ink);
}

.lp-top__signin {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: 0;
}

/* On a phone the anchors are the page itself, one scroll away; the bar keeps the brand and
   the way in. */
@media (max-width: 1100px) {
  .lp-nav {
    display: none;
  }
  .lp-top__signin {
    margin-inline-start: auto;
  }
}

/* ── buttons ─────────────────────────────────────────────────────────────── */

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: var(--lp-hit);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--edge);
  border-radius: var(--r-control);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-body);
  font-weight: var(--w-semi);
  text-align: center;
  text-decoration: none;
  transition: background-color var(--dur-hover) var(--motion-ease);
}

.lp a.lp-btn {
  color: var(--ink);
}

.lp-btn:hover {
  background: var(--panel-2);
}

.lp-btn--primary,
.lp a.lp-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.lp-btn--primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}

.lp-btn--quiet {
  border-color: transparent;
  background: transparent;
}

.lp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: var(--space-5) var(--space-3);
}

/* ── type ────────────────────────────────────────────────────────────────── */

.lp-kicker,
.lp-label {
  margin: 0 0 var(--space-3);
  font-size: var(--t-meta);
  font-weight: var(--w-semi);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--muted);
}

.lp-h2 {
  margin: 0 0 var(--space-4);
  font-size: var(--lp-section-heading);
  line-height: 1.25;
  letter-spacing: var(--track-tight);
  font-weight: var(--w-bold);
}

.lp-h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--t-title);
  line-height: 1.3;
  font-weight: var(--w-semi);
}

.lp-lead {
  margin: 0;
  font-size: var(--lp-lead);
  color: var(--ink);
  max-inline-size: 52ch;
}

.lp-body {
  margin: 0 0 var(--space-3);
  max-inline-size: 70ch;
}

.lp-note {
  margin: var(--space-2) 0 0;
  font-size: var(--t-body);
  color: var(--muted);
  max-inline-size: 70ch;
}

/* ── hero ────────────────────────────────────────────────────────────────── */

.lp-hero {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--lp-hero-space);
  align-items: center;
}

.lp-hero__title {
  margin: 0 0 var(--space-4);
  font-size: var(--lp-heading);
  line-height: 1.15;
  letter-spacing: var(--track-tight);
  font-weight: var(--w-bold);
  text-wrap: balance;
}

.lp-hero__preview {
  margin: 0;
  min-inline-size: 0;
}

.lp-hero__text { min-inline-size: 0; }
.lp-hero__title { max-inline-size: 20ch; }
.lp-kicker { color: var(--accent); }
.lp-hero .lp-actions { margin-block-start: var(--space-6); }
.lp-actions .lp-btn { min-block-size: var(--lp-cta-height); }

.lp-placement {
  padding: var(--space-5);
  background: var(--accent-weak);
  border: var(--lp-rule) solid var(--border);
  border-radius: var(--r-card);
}

.lp-placement__brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block-end: var(--space-4);
  color: var(--ink);
  font-weight: var(--w-bold);
  font-size: var(--t-title);
}

.lp-placement__brand span {
  font-size: var(--t-meta);
  font-weight: var(--w-med);
  color: var(--muted);
}

.lp-hero__preview > .lp-note { padding-inline: var(--space-1); }
.lp [id] { scroll-margin-block-start: calc(var(--lp-header-height) + var(--space-4)); }

@media (min-width: 900px) {
  .lp-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--lp-column-gap);
    padding-block: var(--lp-hero-space);
  }
}

/* The avatars the preview needs and the app's preview does not draw: there, the avatar is
   the advertiser's own image. Here they are initials on Telegram's own avatar colours, so
   the three rows read as three chats. */
.lp-avatar {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.lp-avatar--a {
  background: linear-gradient(180deg, #ff885e, #ff516a);
}

.lp-avatar--b {
  background: linear-gradient(180deg, #72d5fd, #2a9ef1);
}

.lp-avatar--ad {
  background: linear-gradient(180deg, #a0de7e, #54cb68);
}

/* ── reach ───────────────────────────────────────────────────────────────── */

.lp-band {
  background: var(--panel);
  border-block: 1px solid var(--border);
  padding-block: var(--lp-section-space);
}

.lp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-5);
}

/* The figure first to the eye, the label first to a screen reader: a `<dt>` names the
   `<dd>` it precedes, and reading a bare number before its name helps nobody. */
.lp-stat {
  display: flex;
  flex-direction: column-reverse;
  /* In a reversed column `flex-end` is the top: the figures line up across tiles however
     many lines each label takes. */
  justify-content: flex-end;
  gap: var(--space-2);
  padding-inline: var(--space-4);
  border-inline-start: var(--lp-rule) solid var(--border-strong);
}

.lp-stat__value {
  margin: 0;
  font-family: var(--font-data);
  /* Ten digits and three separators must fit the narrowest tile (~200px of content at four
     across) without breaking: a figure split over two lines reads as two figures. */
  font-size: var(--lp-value);
  white-space: nowrap;
  font-weight: var(--w-semi);
  letter-spacing: var(--track-tight);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.lp-stat__label {
  font-size: var(--t-body);
  color: var(--muted);
}

/* ── sections ────────────────────────────────────────────────────────────── */

.lp-section {
  padding-block: var(--lp-section-space) var(--space-2);
}

.lp-prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
  padding: 0;
  list-style: none;
}

.lp-price,
.lp-card {
  padding: var(--space-5);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.lp-price__title {
  margin: 0;
  font-size: var(--t-body);
  font-weight: var(--w-semi);
  color: var(--muted);
}

/* A price is a figure the reader compares, so it is set in the data face. */
.lp-price__value {
  margin: var(--space-2) 0;
  font-family: var(--font-data);
  font-size: var(--lp-price);
  font-weight: var(--w-semi);
  letter-spacing: var(--track-tight);
  line-height: 1.1;
}

.lp-price__note {
  margin: 0;
  font-size: var(--t-body);
  color: var(--muted);
}

.lp-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.lp-step {
  counter-increment: step;
  padding-block-start: var(--space-4);
  border-block-start: 2px solid var(--accent);
}

.lp-step::before {
  content: counter(step);
  display: block;
  margin-block-end: var(--space-2);
  font-family: var(--font-data);
  font-size: var(--t-body);
  color: var(--accent);
}

.lp-step__title {
  margin: 0 0 var(--space-2);
  font-size: var(--t-card);
  font-weight: var(--w-semi);
}

.lp-step p,
.lp-card p {
  margin: 0 0 var(--space-2);
  font-size: 15px;
}

.lp-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-4);
}

.lp-list {
  margin: 0;
  padding-inline-start: 1.2em;
  max-inline-size: 75ch;
}

.lp-list li {
  margin-block-end: var(--space-2);
}

.lp-card--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.lp-card--row > div {
  flex: 1 1 320px;
}

/* ── questions ───────────────────────────────────────────────────────────── */

.lp-faq {
  border-block-start: 1px solid var(--border);
  max-inline-size: 820px;
}

.lp-faq__item {
  border-block-end: 1px solid var(--border);
}

.lp-faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-block-size: 56px;
  padding-block: var(--space-3);
  cursor: pointer;
  list-style: none;
}

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

.lp-faq__item summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-data);
  font-size: 20px;
  color: var(--muted);
}

.lp-faq__item[open] summary::after {
  content: "−";
}

.lp-faq__q {
  margin: 0;
  font-size: var(--t-card);
  font-weight: var(--w-semi);
}

.lp-faq__item p {
  margin: 0 0 var(--space-4);
  max-inline-size: 70ch;
  color: var(--ink);
}

/* ── close ───────────────────────────────────────────────────────────────── */

.lp-final {
  margin-block-start: 64px;
}

.lp-foot {
  padding-block: var(--space-6) 48px;
}

.lp-foot__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-5);
}

.lp-langs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  max-inline-size: 520px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-langs a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--lp-hit);
  font-size: var(--t-body);
  color: var(--muted);
  text-decoration: none;
}

.lp-langs a[aria-current="page"] {
  color: var(--ink);
  font-weight: var(--w-semi);
}

@media (forced-colors: active) {
  .lp-btn--primary {
    border: 2px solid ButtonText;
  }
}

/* A jump to `#prices` lands under the sticky bar unless the target leaves room for it. */
.lp section[id] {
  scroll-margin-block-start: 72px;
}

/* The header keeps both doors on small screens, without squeezing their labels. */
@media (max-width: 900px) {
  .lp-top__inner { gap: var(--space-3); }
  .lp-nav { gap: var(--space-3); }
  .lp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
}
@media (max-width: 540px) {
  .lp-top__inner { flex-wrap: wrap; padding-block: var(--space-2); }
  .lp-brand { flex: 1 0 100%; justify-content: center; }
  .lp-top__signin { width: 100%; justify-content: center; flex-wrap: wrap; }
  .lp-top { position: static; }
  .lp [id] { scroll-margin-block-start: var(--space-4); }
  .lp-actions { flex-direction: column; align-items: stretch; }
  .lp-placement { padding: var(--space-3); }
  .lp-stats { grid-template-columns: minmax(0, 1fr); }
  .lp-stat { padding-block: var(--space-2); }
}

/* Audience and actual client placements, rendered without a chart dependency. */
.lp-stats--audience { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lp-stats--audience .lp-stat__value { font-size: var(--lp-heading); color: var(--accent); }
.lp-geography { display: grid; grid-template-columns: 1fr 1fr; gap: var(--lp-column-gap); margin-block-start: var(--space-6); }
.lp-countries { inline-size: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lp-countries th, .lp-countries td { padding-block: var(--space-2); border-block-end: var(--lp-rule) solid var(--border); }
.lp-countries th { text-align: start; font-weight: var(--w-body); }
.lp-countries td { text-align: end; font-weight: var(--w-bold); }
.lp-placement-grid { margin-block-start: var(--space-5); }
.lp-placement-grid figure { margin: 0; min-inline-size: 0; }
.lp-pinned { display: grid; padding: var(--space-3); border-inline-start: 3px solid var(--accent); background: var(--panel); }
.lp-pinned strong { color: var(--accent); }
.lp-pinned span { color: var(--ink); font-size: var(--t-body); }
.lp-message { margin: var(--space-4); padding: var(--space-3); background: var(--panel); border-radius: var(--r-control); color: var(--ink); }
@media (max-width: 700px) {
  .lp-geography { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .lp-stats--audience .lp-stat__value { font-size: var(--lp-section-heading); }
}
