/*
 * Styling for the public pages: the landing page and the web copies of the
 * legal documents.
 *
 * The layout, type scale, section rhythm and component language follow the
 * Clearwave template the owner picked as the reference. The palette does
 * not: Clearwave is mint/teal, and a teal site in front of a purple app
 * reads as two products. The token *roles* are kept exactly as Clearwave
 * uses them (ground, alt ground, two surfaces, three accent steps, three
 * text steps) and refilled from the app's own purple
 * (flutter/lib/core/theme/app_colors.dart -> glowPurple #7C5CFC), so the
 * page keeps the reference's light, airy feel and still matches the app.
 *
 * Fonts come from Google Fonts, declared in each page's <head>:
 *   Vazirmatn — everything (the app bundles this exact family)
 *   DM Sans   — Latin fragments (version numbers, MB)
 *
 * Clearwave sets the second line of each headline in Playfair Display
 * italic. That was first matched here with a naskh face, since Arabic
 * script has no italic — but two Arabic typefaces inside one sentence read
 * as a mistake rather than as emphasis, so the owner asked for one family
 * throughout. The emphasis line now carries the accent colour alone, which
 * is enough to set it apart without breaking the line in two.
 */

:root {
  --bg:            #F1EEF9;
  --bg-alt:        #E7E2F4;
  --surface:       #F9F7FD;
  --surface-2:     #FFFFFF;

  --accent:        #5B3FBF;
  --accent-mid:    #7C5CFC;
  --accent-light:  #A98CFF;
  --accent-ghost:  rgba(91, 63, 191, 0.08);
  --accent-border: rgba(91, 63, 191, 0.16);

  --text-1:        #17122A;
  --text-2:        #4A4266;
  --text-3:        #7B738F;

  --border:        rgba(23, 18, 42, 0.09);
  --shadow-sm:     0 2px 12px rgba(23, 18, 42, 0.06);
  --shadow-md:     0 8px 32px rgba(23, 18, 42, 0.10);
  --shadow-lg:     0 24px 64px rgba(23, 18, 42, 0.14);

  --silk:          cubic-bezier(0.16, 1, 0.3, 1);
  --radius:        16px;
  --radius-lg:     24px;

  --body:    'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --latin:   'DM Sans', 'Vazirmatn', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.85;
  direction: rtl;
  text-align: right;
  /* Two very soft accent washes, the reference's "atmosphere without
     ornament" — fixed so they don't smear while scrolling. */
  background-image:
    radial-gradient(56rem 40rem at 88% -8%, rgba(124, 92, 252, .16), transparent 60%),
    radial-gradient(48rem 34rem at 4% 32%, rgba(169, 140, 255, .13), transparent 62%);
  background-attachment: fixed;
}

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 1.5rem; }
.narrow { max-width: 760px; }

a { color: var(--accent); }

:where(a, button, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------------- header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(241, 238, 249, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-1);
  text-decoration: none;
}

.brand img { width: 32px; height: 32px; }

.site-header nav {
  display: none;
  gap: 1.75rem;
  /* auto on both sides centres the nav between the brand and the CTA, the
     way the reference sets it out. */
  margin-inline: auto;
}

.site-header nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: .95rem;
}

.site-header nav a:hover { color: var(--accent); }

/* Below 900px the nav is hidden, so nothing separates the brand from the
   CTA — the button takes the free space itself. `nav ~ .btn` would not do:
   a display:none sibling still matches, so the rule has to be swapped by
   the same breakpoint that reveals the nav. */
.site-header .btn { margin-inline-start: auto; }

@media (min-width: 900px) {
  .site-header nav { display: flex; }
  .site-header .btn { margin-inline-start: 0; }
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .3s var(--silk), box-shadow .3s var(--silk), background .3s var(--silk);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: #4E34A8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-1);
  border-color: var(--border);
}

.btn-ghost:hover { border-color: var(--accent-border); color: var(--accent); }

.btn-lg { padding: 1rem 2.1rem; font-size: 1.08rem; }

/* ---------------- hero ---------------- */

.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 940px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem 1rem .4rem .5rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: .9rem;
  color: var(--text-2);
}

.eyebrow .dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  flex: none;
}

.eyebrow b { color: var(--text-1); font-weight: 700; }

h1.display {
  margin: 1.5rem 0 1.25rem;
  font-size: clamp(2.4rem, 6.2vw, 4.2rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.015em;
  text-wrap: balance;
}

/* The reference's second headline line — same family and weight as the
   first, set apart by the accent colour only. */
h1.display .em {
  display: block;
  color: var(--accent);
}

.lede {
  margin: 0;
  max-width: 34rem;
  color: var(--text-2);
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 2rem;
}

.meta {
  margin: .9rem 0 0;
  color: var(--text-3);
  font-size: .9rem;
  font-family: var(--latin);
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.6rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: .9rem;
}

.trust span { display: inline-flex; align-items: center; gap: .45rem; }
.trust svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* hero visual: one phone plus a floating stat card */

.hero-visual { position: relative; display: grid; place-items: center; }

.hero-visual img.phone {
  width: min(280px, 72vw);
  height: auto;
  filter: drop-shadow(0 28px 56px rgba(23, 18, 42, .28));
}

.float-card {
  position: absolute;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .8rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  line-height: 1.5;
}

.float-card .n {
  font-family: var(--latin);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--accent);
}

.float-card .k { font-size: .8rem; color: var(--text-3); }

.float-card.top { top: 8%; inset-inline-start: -4%; }
.float-card.bottom { bottom: 10%; inset-inline-end: -4%; }

@media (max-width: 620px) {
  .float-card.top { inset-inline-start: 0; }
  .float-card.bottom { inset-inline-end: 0; }
}

/* ---------------- sections ---------------- */

section.band { padding: clamp(3.5rem, 7vw, 6rem) 0; }
section.band.alt { background: var(--bg-alt); }

.sec-head { max-width: 42rem; margin-bottom: 3rem; }

.sec-head .kicker {
  margin: 0 0 .75rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.sec-head h2 {
  margin: 0 0 .85rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.sec-head h2 .em {
  display: block;
  color: var(--accent);
}

.sec-head p { margin: 0; color: var(--text-2); }

/* ---------------- screenshot rail ---------------- */

.shot-rail {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .5rem 0 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-border) transparent;
}

.shot-rail::-webkit-scrollbar { height: 6px; }
.shot-rail::-webkit-scrollbar-thumb { background: var(--accent-border); border-radius: 999px; }

.shot-rail figure { margin: 0; flex: none; scroll-snap-align: start; }

.shot-rail img {
  display: block;
  width: 216px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(23, 18, 42, .22));
}

@media (min-width: 760px) { .shot-rail img { width: 244px; } }

.rail-hint { margin: 0; color: var(--text-3); font-size: .88rem; }

/* ---------------- feature cards ---------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform .4s var(--silk), box-shadow .4s var(--silk);
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card .ico {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--accent-ghost);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
}

.card .ico svg { width: 22px; height: 22px; }

.card h3 { margin: 0 0 .45rem; font-size: 1.1rem; font-weight: 700; }
.card p { margin: 0; color: var(--text-2); font-size: .96rem; }

/* ---------------- source chips ---------------- */

.chips { display: flex; flex-wrap: wrap; gap: .6rem; }

.chip {
  padding: .45rem 1.05rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: .93rem;
  white-space: nowrap;
}

/* ---------------- faq ---------------- */

.faq { display: flex; flex-direction: column; gap: .75rem; }

.faq details {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq summary {
  padding: 1.1rem 1.4rem;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  margin-inline-start: auto;
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  flex: none;
  transition: transform .3s var(--silk);
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq .answer { padding: 0 1.4rem 1.3rem; color: var(--text-2); font-size: .97rem; }
.faq .answer p { margin: 0 0 .8rem; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------------- closing call to action ---------------- */

.cta-band {
  background: var(--accent);
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3.5rem);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cta-band h2 {
  margin: 0 0 .75rem;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.45;
  text-wrap: balance;
}

.cta-band h2 .em { display: block; color: var(--accent-light); }
.cta-band p { margin: 0 0 2rem; color: rgba(255, 255, 255, .82); }

.cta-band .btn-primary {
  background: #fff;
  color: var(--accent);
}

.cta-band .btn-primary:hover { background: #F3F0FF; }

.cta-band .note { margin: 1rem 0 0; font-size: .88rem; color: rgba(255, 255, 255, .7); }

/* ---------------- install note ---------------- */

.note-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  color: var(--text-2);
  font-size: .95rem;
}

.note-box b { color: var(--text-1); }

/* ---------------- legal documents ---------------- */

.doc { padding: clamp(2.5rem, 6vw, 4rem) 0 4rem; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); font-weight: 700; margin: 0 0 .4rem; line-height: 1.4; }
.doc .updated { color: var(--text-3); font-size: .9rem; margin: 0 0 2.5rem; }
.doc h2 { font-size: 1.15rem; margin: 2.4rem 0 .6rem; color: var(--accent); font-weight: 700; }
.doc p { margin: 0 0 1rem; white-space: pre-line; color: var(--text-2); }

/* ---------------- footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2.5rem 0 3rem;
  color: var(--text-3);
  font-size: .92rem;
}

.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: center;
}

.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .copy { margin-inline-start: auto; }

@media (max-width: 620px) {
  .site-footer .copy { margin-inline-start: 0; width: 100%; }
}
