/* =========================================================================
   Circly — landing page only. Scoped under .landing-body. Type scale and
   spacing here are landing-specific and do not leak into the app shell;
   the shared palette is consumed only through var(--d-*) from tokens.css.
   ========================================================================= */

.landing-body {
  /* type scale (landing-only) */
  --lp-fs-label: 0.875rem;
  --lp-fs-body: 1rem;
  --lp-fs-heading: 1.5rem;
  --lp-fs-display: clamp(32px, 6vw, 44px);
  --lp-fs-lead: clamp(18px, 4vw, 20px);

  /* spacing scale (landing-only) */
  --lp-sp-4: 4px;
  --lp-sp-8: 8px;
  --lp-sp-16: 16px;
  --lp-sp-24: 24px;
  --lp-sp-32: 32px;
  --lp-sp-48: 48px;
  --lp-sp-64: 64px;

  margin: 0;
  background: var(--d-main);
  color: var(--d-text);
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  font-size: var(--lp-fs-body);
  font-weight: 400;
  line-height: 1.7;
  /* .lp-shot::before's ambient glow bleeds past the viewport edge by design
     (inset:-10% on a decorative pseudo-element) -- clip it site-wide so a
     bleed like that can never grow document.scrollWidth / create a
     horizontal scrollbar, without touching normal vertical scrolling. */
  overflow-x: hidden;
}

.lp-hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  place-items: center;
  text-align: center;
  padding-block: var(--lp-sp-64);
  padding-inline: var(--lp-sp-24);
}

@media (min-width: 640px) {
  .lp-hero {
    padding-inline: var(--lp-sp-32);
  }
}

/* Brand lockup. Width/height are on the <img> too, so the hero never reflows
   while it decodes (the CLS guard in test-landing.mjs asserts this). */
.lp-mark {
  display: block;
  inline-size: 170px;
  block-size: auto;
  aspect-ratio: 340 / 374;
  filter: drop-shadow(0 10px 30px rgba(124, 92, 255, .35));
  margin-block-end: var(--lp-sp-48);
}

.lp-tagline {
  font-size: var(--lp-fs-display);
  font-weight: 700;
  line-height: 1.3;
  margin-block: 0;
  margin-block-end: var(--lp-sp-16);
  max-width: 16ch;
}

.lp-lead {
  font-size: var(--lp-fs-lead);
  font-weight: 400;
  line-height: 1.6;
  color: var(--d-dim);
  max-inline-size: 42ch;
  margin-inline: auto;
  margin-block: 0;
  margin-block-end: var(--lp-sp-24);
}

.lp-cta {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: var(--lp-sp-16);
  border-radius: 10px;
  background: var(--d-accent);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--lp-fs-body);
  text-decoration: none;
  transition: background-color .15s, transform .12s;
}

.lp-cta:hover {
  background: var(--d-accent-hover);
}

.lp-cta:focus-visible {
  outline: 2px solid var(--d-accent);
  outline-offset: 3px;
}

.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--lp-sp-16);
}

.lp-cta--ghost {
  background: transparent;
  color: var(--d-dim);
  font-weight: 400;
  border: 1px solid color-mix(in srgb, var(--d-text) 16%, transparent);
}

.lp-cta--ghost:hover {
  border-color: var(--d-accent);
  color: var(--d-text);
  background: transparent; /* D-11: never a filled second CTA, even on hover */
}

.lp-cta--ghost:focus-visible {
  outline: 2px solid var(--d-accent);
  outline-offset: 3px;
}

.lp-cta:active,
.lp-cta--ghost:active {
  transform: translateY(1px);
}

@media (max-width: 479px) {
  .lp-cta-row {
    flex-direction: column;
    inline-size: 100%;
  }
  .lp-cta-row .lp-cta {
    inline-size: 100%;
  }
}

.lp-shot {
  position: relative;
  inline-size: 100%; /* .lp-hero is a flex column with align-items:center, so
    a flex item with no explicit width sizes via fit-content on the cross
    axis -- its width stays indefinite pre-load, collapsing the
    inline-size:100% image chain below to ~0 until the image's own natural
    size resolves it (a real CLS regression, not theoretical). A definite
    width is required to fix it; align-self:stretch alone does NOT work here
    because margin-inline:auto's auto margins take priority over stretch
    per the flexbox spec and suppress it entirely. */
  max-inline-size: 880px;
  margin-inline: auto;
  margin-block-start: var(--lp-sp-32);
}

.lp-shot::before {
  content: '';
  position: absolute;
  /* Fixed px, not a percentage: at 390px .lp-shot is ~342px wide, so a -10%
     inset bled ~34px past each edge (68px total) -- comfortably wider than
     .lp-hero's own 24px mobile padding-inline, producing real horizontal
     page overflow (document.documentElement.scrollWidth > clientWidth).
     16px stays inside that padding at every viewport width the blur(48px)
     already does the visual softening, so the fixed amount reads the same. */
  inset: -16px;
  background: radial-gradient(circle, color-mix(in srgb, var(--d-accent) 35%, transparent), transparent 70%);
  filter: blur(48px);
  z-index: -1;
}

.lp-shot picture,
.lp-shot img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--d-text) 12%, transparent);
  box-shadow: 0 32px 64px -24px color-mix(in srgb, var(--d-accent) 45%, transparent);
}

@media (min-width: 640px) {
  .lp-shot {
    margin-block-start: var(--lp-sp-48);
  }
}

/* =========================================================================
   Below the fold. Everything here uses logical properties, so the whole page
   mirrors for the English/LTR toggle without a single direction-specific rule.
   ========================================================================= */

/* Keyboard users land here first; invisible until focused. */
.lp-skip {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: var(--lp-sp-16);
  z-index: 20;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--d-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.lp-skip:focus { inset-block-start: 0; }

/* ---- top bar ---- */
.lp-topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lp-sp-16);
  padding: 12px var(--lp-sp-24);
  background: color-mix(in srgb, var(--d-main) 82%, transparent);
  backdrop-filter: blur(12px);
  border-block-end: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
}
.lp-topbrand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--d-text);
  text-decoration: none;
  font-weight: 700;
}
.lp-topnav { display: flex; align-items: center; gap: var(--lp-sp-8); }
.lp-topnav a {
  color: var(--d-dim);
  text-decoration: none;
  font-size: var(--lp-fs-label);
  padding: 8px 10px;
  border-radius: 8px;
}
.lp-topnav a:hover { color: var(--d-text); }
.lp-topcta {
  background: color-mix(in srgb, var(--d-accent) 18%, transparent);
  color: var(--d-text) !important;
  font-weight: 700;
}
.lp-topcta:hover { background: var(--d-accent); }
:where(.landing-body) a:focus-visible {
  outline: 2px solid var(--d-accent);
  outline-offset: 3px;
  border-radius: 6px;
}
/* The hero is 100dvh; a sticky bar would otherwise cover the anchor target. */
:where(.landing-body) [id] { scroll-margin-block-start: 72px; }
@media (max-width: 560px) {
  .lp-topnav a:not(.lp-topcta) { display: none; }
}

/* ---- generic section ---- */
.lp-section {
  max-inline-size: 1080px;
  margin-inline: auto;
  padding-block: var(--lp-sp-64);
  padding-inline: var(--lp-sp-24);
}
@media (min-width: 640px) {
  .lp-section { padding-inline: var(--lp-sp-32); }
}
.lp-eyebrow {
  margin: 0 0 var(--lp-sp-8);
  color: var(--d-accent);
  font-size: var(--lp-fs-label);
  font-weight: 700;
  letter-spacing: .06em;
}
.lp-h2 {
  margin: 0 0 var(--lp-sp-16);
  font-size: clamp(24px, 4.2vw, 34px);
  font-weight: 700;
  line-height: 1.35;
  max-inline-size: 22ch;
}
.lp-sub {
  margin: 0 0 var(--lp-sp-32);
  color: var(--d-dim);
  max-inline-size: 56ch;
  line-height: 1.8;
}

/* ---- feature cards ---- */
.lp-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: var(--lp-sp-16);
}
.lp-grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.lp-card {
  background: var(--d-side);
  border: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
  border-radius: 14px;
  padding: var(--lp-sp-24);
  transition: border-color .15s, transform .15s;
}
.lp-card:hover {
  border-color: color-mix(in srgb, var(--d-accent) 45%, transparent);
  transform: translateY(-2px);
}
.lp-card h3 {
  margin: 0 0 var(--lp-sp-8);
  font-size: var(--lp-fs-heading);
  font-weight: 700;
  line-height: 1.4;
}
.lp-card p { margin: 0; color: var(--d-dim); line-height: 1.85; }
.lp-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 42px;
  block-size: 42px;
  border-radius: 11px;
  margin-block-end: var(--lp-sp-16);
  background: color-mix(in srgb, var(--d-accent) 16%, transparent);
  color: var(--d-accent);
}
.lp-ic svg { inline-size: 22px; block-size: 22px; }

/* ---- steps ---- */
.lp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--lp-sp-24);
  counter-reset: step;
}
.lp-steps li { position: relative; padding-block-start: 6px; }
.lp-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 50%;
  margin-block-end: var(--lp-sp-16);
  background: var(--d-accent);
  color: #fff;
  font-weight: 700;
}
.lp-steps h3 { margin: 0 0 var(--lp-sp-8); font-size: var(--lp-fs-heading); font-weight: 700; }
.lp-steps p { margin: 0; color: var(--d-dim); line-height: 1.85; }

/* ---- desktop split ---- */
.lp-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--lp-sp-32);
  align-items: center;
}
@media (min-width: 880px) {
  .lp-split { grid-template-columns: 1.05fr .95fr; gap: var(--lp-sp-48); }
}
.lp-list { margin: 0 0 var(--lp-sp-24); padding: 0; list-style: none; display: grid; gap: 12px; }
.lp-list li {
  position: relative;
  padding-inline-start: 26px;
  color: var(--d-dim);
  line-height: 1.8;
}
.lp-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 4px;
  inset-block-start: .72em;
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--d-accent);
}
.lp-note { margin: 0 0 var(--lp-sp-24); color: var(--d-faint); font-size: var(--lp-fs-label); }
.lp-keys {
  background: var(--d-side);
  border: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
  border-radius: 14px;
  padding: var(--lp-sp-24);
  display: grid;
  gap: 14px;
}
.lp-key-row { display: flex; align-items: center; justify-content: space-between; gap: var(--lp-sp-16); }
.lp-key-row span { color: var(--d-dim); font-size: var(--lp-fs-label); }
.lp-key-row kbd {
  background: var(--d-rail);
  border: 1px solid color-mix(in srgb, var(--d-text) 14%, transparent);
  border-radius: 7px;
  padding: 5px 10px;
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: .8rem;
  color: var(--d-text);
  white-space: nowrap;
}

/* ---- FAQ ---- */
.lp-faq-list { display: grid; gap: 10px; max-inline-size: 760px; }
.lp-faq details {
  background: var(--d-side);
  border: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
  border-radius: 12px;
  padding: 2px var(--lp-sp-24);
}
.lp-faq summary {
  cursor: pointer;
  padding-block: 16px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lp-sp-16);
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after {
  content: '+';
  color: var(--d-accent);
  font-size: 1.3rem;
  line-height: 1;
  flex: 0 0 auto;
}
.lp-faq details[open] summary::after { content: '−'; }
.lp-faq summary:focus-visible { outline: 2px solid var(--d-accent); outline-offset: 3px; border-radius: 8px; }
.lp-faq details p {
  margin: 0;
  padding-block-end: 18px;
  color: var(--d-dim);
  line-height: 1.9;
}

/* ---- closing ---- */
.lp-closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: var(--lp-sp-64);
  padding-inline: var(--lp-sp-24);
  border-block-start: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
}
.lp-closing .lp-h2 { max-inline-size: none; }
.lp-closing .lp-sub { margin-block-end: var(--lp-sp-24); }

@media (min-width: 640px) {
  .lp-closing {
    padding-inline: var(--lp-sp-32);
  }
}

/* ---- changelog (D-10) — reuses the landing shell + tokens, no new colours ---- */
.cl-main { padding-block-end: var(--lp-sp-32); }
.cl-hero { padding-block-end: var(--lp-sp-32); }
.cl-list { display: flex; flex-direction: column; gap: var(--lp-sp-24); padding-block-start: 0; }
.cl-entry {
  background: var(--d-side);
  border: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
  border-radius: 14px;
  padding: var(--lp-sp-24);
}
.cl-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--lp-sp-8) var(--lp-sp-16);
  margin-block-end: var(--lp-sp-16);
  padding-block-end: var(--lp-sp-16);
  border-block-end: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
}
.cl-version { margin: 0; font-size: var(--lp-fs-heading); font-weight: 700; }
.cl-date { color: var(--d-dim); font-size: var(--lp-fs-label); }
.cl-product {
  margin-inline-start: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--d-accent) 16%, transparent);
  color: var(--d-accent);
  font-size: var(--lp-fs-label);
  font-weight: 700;
}
.cl-group + .cl-group { margin-block-start: var(--lp-sp-16); }
.cl-group-h { margin: 0 0 var(--lp-sp-8); font-size: var(--lp-fs-label); font-weight: 700; color: var(--d-dim); }
.cl-lines { margin: 0; padding-inline-start: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.cl-lines li { color: var(--d-dim); line-height: 1.8; }

/* ---- footer ---- */
.lp-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--lp-sp-16);
  max-inline-size: 1080px;
  margin-inline: auto;
  padding: var(--lp-sp-32) var(--lp-sp-24) var(--lp-sp-48);
  border-block-start: 1px solid color-mix(in srgb, var(--d-text) 8%, transparent);
}
.lp-foot-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.lp-foot-links { display: flex; flex-wrap: wrap; gap: var(--lp-sp-16); }
.lp-foot-links a { color: var(--d-dim); text-decoration: none; font-size: var(--lp-fs-label); }
.lp-foot-links a:hover { color: var(--d-accent); }
.lp-foot-note { margin: 0; inline-size: 100%; color: var(--d-faint); font-size: var(--lp-fs-label); }

@media (prefers-reduced-motion: reduce) {
  .lp-cta,
  .lp-cta--ghost,
  .lp-card {
    transition: none;
  }
  .lp-card:hover { transform: none; }
}
