/* viaxchat.com home page.
 *
 * Strictly monochrome - black, white and greys, hairline borders, white pill
 * buttons. No colour accents, no gradient fills, no tinted panels: the only
 * colour on the page comes from the product screenshots themselves.
 *
 * One stylesheet drives both locales. Anything directional uses logical
 * properties (margin-inline, inset-inline) so the Farsi page needs `dir="rtl"`
 * and little else; the few real mirrorings live in the [dir="rtl"] block at the
 * bottom.
 */

/* ---------------------------------------------------------------- fonts -- */

@font-face {
  font-family: 'Inter';
  src: url('/assets/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Vazirmatn covers Latin as well as Persian, so a mixed string ("Viaxchat" in
   a Farsi sentence) stays in one typeface instead of falling back mid-word. */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------- tokens -- */

:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #101010;
  --border: #1a1a1a;
  --border-strong: #262626;
  --fg: #ffffff;
  --muted: #8f8f8f;
  --muted-2: #5f5f5f;

  --maxw: 1200px;
  --gutter: 32px;
  --radius: 14px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

[lang='fa'] { font-family: 'Vazirmatn', 'Inter', Tahoma, sans-serif; }

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

/* height:auto is load-bearing. Every <img> carries width/height attributes so
   the browser reserves the right box before the file lands; once CSS sets
   width:100% those attributes would otherwise still supply the height and the
   image renders stretched to its intrinsic pixel height. */
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------ typography - */

h1, h2, h3 { margin: 0; letter-spacing: -0.035em; font-weight: 800; text-wrap: balance; }

.h-hero { font-size: clamp(44px, 6.4vw, 84px); line-height: 0.98; }
.h-section { font-size: clamp(30px, 4.2vw, 54px); line-height: 1.02; }
.h-card { font-size: 17.5px; line-height: 1.3; font-weight: 650; letter-spacing: -0.015em; }

/* Farsi has no uppercase and taller ascenders; Latin-tuned negative tracking
   and sub-1 leading clip the diacritics. */
[dir='rtl'] h1, [dir='rtl'] h2, [dir='rtl'] h3 { letter-spacing: 0; }
[dir='rtl'] .h-hero { line-height: 1.2; font-size: clamp(36px, 5.4vw, 68px); }
[dir='rtl'] .h-section { line-height: 1.3; font-size: clamp(27px, 3.8vw, 46px); }

.lede {
  font-size: clamp(16px, 1.3vw, 18.5px);
  line-height: 1.6;
  color: var(--muted);
  margin: 22px 0 0;
  max-width: 56ch;
}
[dir='rtl'] .lede { line-height: 1.9; }

/* A plain typographic label - no pill, no border, no fill. */
.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
[dir='rtl'] .label { letter-spacing: 0; text-transform: none; }

/* ----------------------------------------------------------------- nav --- */

.nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 60;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Once past the hero the gradient has nothing to fade into, so it firms up
   into a flat glass bar with a hairline. */
.nav.is-scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo img {
  height: 26px; width: 26px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.nav-logo span { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 13.5px; color: var(--muted); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--fg); }

.nav-spacer { flex: 1; }
.nav-right { display: flex; align-items: center; gap: 10px; }

/* --------------------------------------------------------------- buttons - */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding-inline: 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease,
              border-color 0.15s ease, opacity 0.15s ease;
}

.btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.btn:active { transform: scale(0.97); }

.btn-fill { background: #ffffff; color: #000000; }
.btn-fill:hover { opacity: 0.85; }

.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: #4d4d4d; }

.btn-lg { height: 44px; padding-inline: 22px; font-size: 14.5px; }

/* ------------------------------------------------------- language switch - */

.lang { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.lang a {
  font-size: 12px; font-weight: 600; padding: 6px 11px; color: var(--muted-2);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang a:hover { color: var(--fg); }
.lang a.is-active { background: rgba(255, 255, 255, 0.1); color: var(--fg); }

/* ------------------------------------------------------- mobile nav panel- */

.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 36px; height: 36px;
  background: transparent; border: none; cursor: pointer; padding: 0;
}
.nav-burger span {
  display: block; width: 20px; height: 1.5px; background: var(--fg);
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}
.nav-burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  z-index: 64; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

.nav-panel {
  position: fixed;
  inset-block: 0; inset-inline-end: 0;
  width: min(290px, 80vw);
  background: #0a0a0a;
  border-inline-start: 1px solid var(--border-strong);
  z-index: 65;
  display: flex; flex-direction: column;
  padding: 90px 24px 26px;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
}
[dir='rtl'] .nav-panel { transform: translateX(-100%); }
.nav-panel.open { transform: translateX(0); }

.nav-panel > a { padding: 14px 0; font-size: 15px; border-bottom: 1px solid var(--border); }
.nav-panel-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.nav-panel-actions .btn { width: 100%; }

/* ---------------------------------------------------------------- hero --- */
/* Restored from the original page: full-height, the mark sitting behind and to
   the side of a two-line slogan that cycles. */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px var(--gutter) 0;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
}

.hero-copy { animation: rise 0.8s var(--ease) both; }

.hero-copy h1 {
  margin: 0 0 28px;
  /* Reserves both lines' height so a shorter slogan does not jump the CTAs. */
  min-height: 2.05em;
}

.hero-copy h1 .line { display: block; }

.hero-copy h1.swap .line { animation: lineIn 0.6s var(--ease) both; }
.hero-copy h1.swap .line:nth-child(2) { animation-delay: 0.06s; }

@keyframes lineIn {
  from { opacity: 0; transform: translateY(20px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-cta {
  display: flex;
  gap: 12px;
  animation: rise 0.8s var(--ease) 0.06s both;
}

/* Anchored to .hero-inner (the capped, centred content column), not .hero -
   against the full-bleed section "left: 62%" drifts far past the content on
   wide viewports. */
.mark-stage {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 62%;
  transform: translate(-50%, -50%);
  width: 620px; height: 620px;
  z-index: 1;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
[dir='rtl'] .mark-stage { transform: translate(50%, -50%); }

.mark { width: 176px; height: 176px; border-radius: 50%; animation: rise 1s var(--ease) 0.2s both; }

/* -------------------------------------------------------- feature strip -- */

.strip {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 26px var(--gutter) 32px;
}

.strip-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 14px 40px;
}

.strip-item { font-size: 13px; font-weight: 500; color: var(--muted-2); letter-spacing: 0.01em; }

/* ------------------------------------------------------- product frames -- */

.frame {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

.frame-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.frame-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a2a2a; display: block; }
.frame-bar .addr {
  margin-inline-start: 12px;
  font-size: 11.5px;
  color: var(--muted-2);
  direction: ltr;
  unicode-bidi: isolate;
}

.frame img { width: 100%; }

/* -------------------------------------------------------------- sections - */

.section { padding-block: clamp(76px, 9vw, 124px); position: relative; }

.section + .section { border-top: 1px solid var(--border); }

.section-head { max-width: 720px; }
.section-head .h-section { margin-top: 16px; }

.feature {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.feature.reverse .feature-copy { order: 2; }
.feature.reverse .feature-shot { order: 1; }

.feature-copy .h-section { margin-top: 16px; }

.feature-list { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }

.feature-list li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 14.5px; line-height: 1.5; color: var(--muted);
}
.feature-list svg { flex-shrink: 0; margin-top: 3px; color: var(--fg); opacity: 0.7; }

/* ---------------------------------------------------------------- phones - */

.phones {
  display: flex; justify-content: center; align-items: flex-end;
  gap: clamp(16px, 3vw, 38px);
  margin-top: 62px;
}

.phone {
  flex: 0 1 262px;
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  padding: 8px;
  background: #0a0a0a;
}

.phone img { border-radius: 23px; width: 100%; }

/* The outer two sit back so the middle one reads as the focus. */
.phone:nth-child(1), .phone:nth-child(3) { transform: scale(0.94) translateY(12px); }

/* ---------------------------------------------------------------- cards -- */

.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 52px;
         background: var(--border); border: 1px solid var(--border); border-radius: var(--radius);
         overflow: hidden; }

/* Hairline dividers come from the 1px grid gap showing the container through,
   which keeps every seam exactly one pixel with no doubled borders. */
.card {
  background: var(--bg);
  padding: 30px 26px 32px;
  transition: background 0.22s ease;
}
.card:hover { background: var(--surface); }

.card-icon { color: var(--fg); opacity: 0.55; margin-bottom: 16px; }

.card p { margin: 9px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
[dir='rtl'] .card p { line-height: 1.85; }

/* ------------------------------------------------------------ sub-pages -- */

/* Sub-pages have no hero, so the first block has to clear the fixed nav
   itself. */
.page-head { padding-block: 160px 0; }
.page-head .h-section { margin-top: 16px; }
.page-head .lede { font-size: clamp(17px, 1.5vw, 21px); max-width: 62ch; }

/* The measure is set on the text elements, not the container: a card grid
   inside a 72ch column comes out cramped, and it has no reason to obey a
   reading measure. */
.prose { padding-block: 12px 0; }
.prose h2, .prose p, .prose ul { max-width: 72ch; }

.prose h2 {
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1.2;
  margin: 56px 0 0;
}
[dir='rtl'] .prose h2 { line-height: 1.5; }

.prose p {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 16px 0 0;
}
[dir='rtl'] .prose p { line-height: 2; }

.prose ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }

.prose li {
  position: relative;
  padding-inline-start: 20px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
}
[dir='rtl'] .prose li { line-height: 2; }

/* A hairline dash rather than a bullet glyph - it sits on the baseline grid and
   does not import a second shape language into the page. */
.prose li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.72em;
  width: 9px;
  height: 1px;
  background: var(--border-strong);
}

.prose strong { color: var(--fg); font-weight: 600; }

.prose a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px;
           text-decoration-color: var(--border-strong); }
.prose a:hover { text-decoration-color: var(--fg); }

.prose .note { font-size: 13.5px; color: var(--muted-2); margin-top: 40px; }

/* The sub-page card grid reuses .bento/.card but sits inside prose width. */
.prose .bento { margin-top: 34px; }

.card-link { display: block; margin-top: 14px; font-size: 14px; }
.card-link a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border-strong); padding-bottom: 2px; }
.card-link a:hover { border-bottom-color: var(--fg); }

/* ------------------------------------------------------------------ cta -- */

.cta-band { text-align: center; }
.cta-band .lede { margin-inline: auto; }
.cta-band .hero-cta { justify-content: center; margin-top: 30px; animation: none; }

/* --------------------------------------------------------------- footer -- */

.site-footer { border-top: 1px solid var(--border); padding-block: 56px 44px; }

.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 40px 28px; }

.footer-brand .nav-logo { margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; line-height: 1.65; color: var(--muted-2); margin: 0; max-width: 30ch; }

.footer-col h4 {
  margin: 0 0 13px;
  font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 650;
}
[dir='rtl'] .footer-col h4 { letter-spacing: 0; text-transform: none; }

.footer-col a { display: block; color: var(--muted); padding: 5px 0; font-size: 13.5px; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--fg); }

.footer-bottom {
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted-2); font-size: 13px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ------------------------------------------------------ scroll reveal ---- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

.reveal-shot {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal-shot.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 1040px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 940px) {
  :root { --gutter: 22px; }

  .nav-links, .nav-right .btn, .nav-right .lang { display: none; }
  .nav-burger { display: flex; }

  .hero { padding-top: 96px; text-align: center; min-height: auto; padding-bottom: 40px; }
  .hero-inner { gap: 22px; justify-items: center; }

  /* The mark comes out of the absolute layer and leads the stack. */
  .mark-stage {
    position: relative;
    inset-inline-start: auto; inset-block-start: auto;
    transform: none;
    width: 260px; height: 260px;
    order: 1;
  }
  [dir='rtl'] .mark-stage { transform: none; }
  .mark { width: 128px; height: 128px; }

  .hero-copy { order: 2; }
  .hero-copy h1 { text-align: center; }
  .hero-cta { order: 3; justify-content: center; flex-wrap: wrap; }

  .strip-inner { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; gap: 28px; }
  .strip-item { flex-shrink: 0; }

  .feature { grid-template-columns: 1fr; gap: 32px; }
  /* Reset the desktop alternation - on one column the copy always leads. */
  .feature.reverse .feature-copy, .feature.reverse .feature-shot { order: unset; }

  .bento { grid-template-columns: 1fr 1fr; }

  .phones { flex-wrap: wrap; gap: 18px; }
  .phone { flex-basis: 44%; }
  .phone:nth-child(1), .phone:nth-child(3) { transform: none; }
  .phone:nth-child(3) { flex-basis: 60%; }
}

@media (max-width: 620px) {
  .bento { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-cta .btn { width: 100%; }
  .phone, .phone:nth-child(3) { flex-basis: 78%; }
  .frame-bar .addr { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-shot { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-copy, .hero-cta, .mark { animation: none !important; }
  .hero-copy h1.swap .line { animation: none !important; }
}

/* ------------------------------------------------------------------ rtl -- */

[dir='rtl'] .nav-panel { border-inline-start: none; border-inline-end: 1px solid var(--border-strong); }

/* The frame's traffic-light dots are a window affordance and stay left in
   every locale, so the bar opts out of the RTL flip. */
[dir='rtl'] .frame-bar { direction: ltr; }
