/* cVPN — the public page.
 *
 * One stylesheet for both languages. No web fonts, no CDN, no third-party
 * script: this page is read from networks where fonts.googleapis.com is a
 * gamble, and a page that waits on a blocked host is a page nobody sees.
 * System fonts render instantly and carry Persian correctly on every phone.
 */
:root {
  --bg: #0a0c0f;
  --surface: #12161c;
  --surface-high: #171c23;
  --border: #232a34;
  --text: #ffffff;
  --dim: #98a3b2;
  --faint: #6c7684;
  --accent: #5fd97a;
  --accent-ink: #06210e;
  --bad: #ff6b6b;
  --radius: 20px;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Vazirmatn, Tahoma, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 12, 15, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.brand svg { display: block; }
.nav { display: flex; gap: 22px; margin-inline-start: auto; align-items: center; }
.nav a { color: var(--dim); font-size: 14px; }
.nav a:hover { color: var(--text); }

/* Language switcher.
 *
 * A <details> element, so it opens, closes and takes keyboard focus with no
 * JavaScript at all — the script below only adds closing on click-outside and
 * Escape. On a page whose whole point is loading on a bad network, a menu that
 * depends on a script is a menu that can arrive broken.
 */
.langsel {
  position: relative;
  /* This page owns its own look: no border, no fill, whatever else is loaded. */
  border: 0; background: none; padding: 0;
}
.langsel > summary {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 2px; font-size: 13px; color: var(--dim);
  cursor: pointer; list-style: none; user-select: none;
}
.langsel > summary::-webkit-details-marker { display: none; }
.langsel > summary::after {
  content: ""; width: 0; height: 0; margin-inline-start: 2px; color: inherit;
  border-inline-start: 4px solid transparent; border-inline-end: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.langsel[open] > summary, .langsel > summary:hover { color: var(--text); }
/* Clicking a <summary> focuses it, and the browser then draws its own box —
   which is the second box. Keyboard users still get a ring; a tap does not. */
.langsel > summary:focus { outline: none; }
.langsel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.langsel .menu, .menubtn .menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  min-width: 168px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  z-index: 30;
}
.langsel .menu a, .menubtn .menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  font-size: 14px; color: var(--dim); white-space: nowrap;
}
.langsel .menu a:hover, .menubtn .menu a:hover { background: var(--surface-high); color: var(--text); }
.langsel .menu a[aria-current="true"] { color: var(--accent); }
.langsel .menu .tick { width: 14px; text-align: center; opacity: 0; }
.langsel .menu a[aria-current="true"] .tick { opacity: 1; }
@media (max-width: 720px) { .nav .hide-sm { display: none; } }

/* Hero */
.hero { padding: 72px 0 56px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--dim);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1 {
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.25; margin: 22px 0 0; letter-spacing: -0.5px;
}
h1 .on { color: var(--accent); }
.lede { color: var(--dim); font-size: clamp(15px, 2.4vw, 18px); max-width: 620px; margin: 18px auto 0; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 16px; padding: 14px 22px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--faint); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn small { display: block; font-size: 11px; font-weight: 500; color: inherit; opacity: .75; }
.note { color: var(--faint); font-size: 13px; margin-top: 14px; }

/* Sections */
section {
  padding: 64px 0; border-top: 1px solid var(--border);
  /* The header is sticky, so an anchor link would otherwise land with the
     heading hidden underneath it. */
  scroll-margin-top: 72px;
}
h2 { font-size: clamp(22px, 3.6vw, 30px); margin: 0 0 10px; letter-spacing: -0.3px; }
.sub { color: var(--dim); margin: 0 0 34px; max-width: 640px; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.card h3 { margin: 14px 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--dim); font-size: 14px; }
.ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-high); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}

/* Steps */
.steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(95, 217, 122, .14); color: var(--accent);
  font-weight: 700; font-size: 14px; margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; }
.step p { margin: 0; color: var(--dim); font-size: 14px; }

/* Honesty block */
.plain { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.plain ul { margin: 0; padding-inline-start: 20px; color: var(--dim); }
.plain li { margin-bottom: 10px; }
.plain li strong { color: var(--text); font-weight: 600; }

/* FAQ. Scoped to the section: unscoped `details` rules also caught the
   language switcher, which then wore the FAQ's plus and minus signs. */
#faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 18px; margin-bottom: 10px;
}
#faq details[open] { border-color: var(--faint); }
#faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
#faq summary::-webkit-details-marker { display: none; }
#faq summary::after { content: "+"; float: inline-end; color: var(--accent); font-weight: 700; }
#faq details[open] summary::after { content: "–"; }
#faq details p { color: var(--dim); font-size: 14px; margin: 12px 0 0; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 40px 0 56px; color: var(--faint); font-size: 13px; }
.foot { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--text); }
.foot .spacer { margin-inline-start: auto; }

/* Plans. The prices are not written into this page: they are read from the
   control plane at load, because a price typed into HTML is a price that goes
   stale the first time the operator changes one. */
.plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.plan.best { border-color: rgba(95, 217, 122, .45); }
.plan .tag {
  position: absolute; top: -10px; inset-inline-start: 20px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.plan .term { color: var(--dim); font-size: 14px; }
.plan .price { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.plan .price span { font-size: 14px; font-weight: 600; color: var(--dim); margin-inline-start: 4px; }
.plan .per { color: var(--faint); font-size: 12px; min-height: 18px; }
.plan .quota { color: var(--dim); font-size: 14px; margin-top: 6px; }
.plan .buy {
  margin-top: auto; padding-top: 16px;
}
.plan .buy a {
  display: block; text-align: center; border-radius: 14px; padding: 11px;
  background: var(--surface-high); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.plan.best .buy a { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.plan .buy a:hover { border-color: var(--faint); }
.plans-note { color: var(--faint); font-size: 13px; margin-top: 18px; }
.plans-empty {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; color: var(--dim); font-size: 14px;
}


/* Header menu button.
 *
 * The same <details> mechanics as the language switcher, for the same reason:
 * it opens with no JavaScript at all. It appears only where the inline links
 * are hidden, so the header never shows two ways to reach the same four links.
 */
.menubtn { position: relative; border: 0; background: none; padding: 0; display: none; }
.menubtn > summary {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--dim); cursor: pointer; list-style: none; user-select: none;
}
.menubtn > summary::-webkit-details-marker { display: none; }
.menubtn > summary:focus { outline: none; }
.menubtn > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.menubtn[open] > summary, .menubtn > summary:hover { color: var(--text); border-color: var(--faint); }
@media (max-width: 720px) { .menubtn { display: block; } }

/* Install badges.
 *
 * Three badges of identical size, in the shape people already read as "this
 * installs the app": a small line over the name, an icon beside it. Only the
 * third one links anywhere — the App Store and Play Store badges carry no href
 * because the app ships on neither store yet, so they are marked disabled for
 * assistive technology even though all three are styled alike.
 */
.store { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.badge {
  display: inline-flex; align-items: center; gap: 11px;
  min-height: 56px; padding: 9px 18px;
  border-radius: 13px; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.badge .b-ico { flex: none; display: flex; }
.badge .b-txt { text-align: start; }
.badge .b-txt small { display: block; font-size: 11px; font-weight: 600; line-height: 1.45; opacity: .68; }
.badge .b-txt strong { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -.3px; }

.badge-store {
  width: 150px; height: 52px; min-height: 0; padding: 0 12px; gap: 9px;
  justify-content: flex-start; border-radius: 9px;
  /* Store badges keep their own direction on the RTL page: mirrored, the icon
     lands on the wrong side of a name that is Latin text either way. */
  direction: ltr;
  background: #ffffff; color: #0a0c0f; border-color: #0a0c0f;
}
.badge-store .b-ico svg { width: 24px; height: 24px; }
.badge-store .b-txt small { font-size: 9px; line-height: 1.35; opacity: .8; }
.badge-store .b-txt strong { font-size: 15px; letter-spacing: -.2px; }
/* Both lines are one line each: a wrapped "App Store" turns the badge into a
   two-line block that no longer matches the one beside it. */
.badge-store .b-txt small, .badge-store .b-txt strong { white-space: nowrap; }
.badge-store:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 255, 255, .13); }
.badge[aria-disabled="true"] { cursor: not-allowed; }
.badge[aria-disabled="true"]:hover { transform: none; }

/* On a phone the row wraps on its own: the two store badges sit side by side
   and the download badge centres under them. Below 360px even two no longer
   fit at full size, so they give up a little width rather than the pairing. */
@media (max-width: 359px) {
  .store { gap: 8px; }
  .badge-store { width: 132px; padding: 0 8px; gap: 6px; }
  .badge-store .b-ico svg { width: 20px; height: 20px; }
  .badge-store .b-txt small { font-size: 8px; }
  .badge-store .b-txt strong { font-size: 13px; }
}

/* A slow glow behind the hero. Pure CSS: nothing to download, nothing to
   block, and it costs no layout work. */
.hero { position: relative; overflow: hidden; }
.hero > .wrap { position: relative; z-index: 1; }
.hero::before {
  content: ""; position: absolute; inset: -55% 0 auto; height: 560px;
  background: radial-gradient(46% 58% at 50% 0%, rgba(95, 217, 122, .17), transparent 72%);
  pointer-events: none; animation: glow 9s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { opacity: .72; transform: translateY(0) scale(1); }
  50%      { opacity: 1;   transform: translateY(16px) scale(1.04); }
}

/* Reveal on scroll.
 *
 * Guarded by the `js` class the page sets on <html> before anything renders:
 * with scripting off, nothing is ever hidden, so the page cannot arrive blank.
 */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity .55s cubic-bezier(.2, .7, .3, 1), transform .55s cubic-bezier(.2, .7, .3, 1);
}

/* Cards lift with light, not movement: a transform here would fight the one
   the reveal owns. */
.card, .step, .plan { transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.card:hover, .step:hover, .plan:hover {
  border-color: var(--faint); box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}
.ico { transition: transform .2s ease; }
.card:hover .ico { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .hero::before { animation: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
