/* =====================================================
   TYPOGRAPHY SYSTEM — baseline grid 4px, modular scale,
   RU microtypography. Palette untouched (V3 Swiss).
   Global: only safe rendering rules. Rhythm/scale/measure
   are scoped to the landing (.lead-screen-shell) so the
   tuned app UI keeps its own compact sizes.
   ===================================================== */

:root {
  --tg-grid: 4px;
  --tg-lh-text: calc(var(--tg-grid) * 6);  /* 24px — body copy */
  --tg-lh-small: calc(var(--tg-grid) * 5); /* 20px — captions/descs */
}

/* --- 5. Rendering quality: ligatures, kerning, smoothing (global, safe) --- */
body {
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 6. Orphans/widows + balanced headings (global, safe) --- */
p {
  orphans: 3;
  widows: 3;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* =====================================================
   LANDING SCOPE
   ===================================================== */

/* --- 4. Heading rhythm: tight leading, heading sticks to its text --- */
.lead-screen-shell h1 {
  line-height: 1.08 !important;
  letter-spacing: -0.015em;
}

.lead-screen-shell h2 {
  line-height: 1.15 !important;
}

.lead-screen-shell h3 {
  line-height: 1.2 !important;
}

.lead-screen-shell .lead-sell-title {
  line-height: 1.12 !important;
}

/* --- 1 + 2. Baseline rhythm + measure for running text --- */
.lead-screen-shell .lead-premium-offer-note,
.lead-screen-shell .lead-premium-subtitle,
.lead-screen-shell .lead-premium-note,
.lead-screen-shell .lead-sell-sub {
  line-height: var(--tg-lh-text) !important; /* 24px = 6 × grid */
  max-width: 65ch;
  hanging-punctuation: first last;
}

.lead-screen-shell .lead-premium-value-desc,
.lead-screen-shell .lead-premium-step-desc,
.lead-screen-shell .lead-premium-feature-desc,
.lead-screen-shell .lead-sell-pt-desc {
  line-height: var(--tg-lh-small) !important; /* 20px = 5 × grid */
  max-width: 55ch;
}

/* --- 3. Hyphenation for narrow columns (mobile) --- */
@media (max-width: 640px) {
  .lead-screen-shell .lead-premium-value-desc,
  .lead-screen-shell .lead-premium-step-desc,
  .lead-screen-shell .lead-premium-feature-desc,
  .lead-screen-shell .lead-sell-pt-desc,
  .lead-screen-shell .lead-premium-offer-note,
  .lead-screen-shell .lead-sell-sub {
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}

/* =====================================================
   ACCESSIBILITY — visible keyboard focus
   Only fires for keyboard nav (:focus-visible), never on
   mouse click, so it doesn't fight the existing click UX.
   ===================================================== */
:focus-visible {
  outline: 2px solid #0B57D0 !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #0B57D0 !important;
  outline-offset: 2px !important;
}
