:root{
  --bg:#0b0f17;
  --bg2:#070a10;

  --text:#e8eefc;
  --muted:#aab6d6;
  --accent:#6ea8fe;

  --border: rgba(255,255,255,.10);
  --card1: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.025);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  min-height:100%;
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  color: var(--text);
  line-height:1.8;

  /* GUARANTEED seam-free background */
  background: #070a10;
}

/* Subtle texture overlay (no gradients, no seams) */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  opacity:.18;

  /* pure solid + tiny noise-like pattern using repeating linear gradients */
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.03) 0px,
      rgba(255,255,255,.03) 1px,
      rgba(0,0,0,0) 1px,
      rgba(0,0,0,0) 6px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,.02) 0px,
      rgba(255,255,255,.02) 1px,
      rgba(0,0,0,0) 1px,
      rgba(0,0,0,0) 10px
    );
}

/* Safe defaults */
img{ max-width:100%; height:auto; display:block; }
a{ color:inherit; text-decoration:none; }

.container{
  max-width:1040px;
  margin:0 auto;
  padding:22px;
}

/* Header */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 22px;

  position:sticky;
  top:0;
  z-index:10;

  background: rgba(11,15,23,.92);
  border-bottom:1px solid var(--border);
}

.brand{
  display:flex;
  align-items:center;
  padding:0;
  margin:0;
  background:none;
  border:none;
  flex:0 0 auto;
}

.logo-box{
  display:flex;
  align-items:center;

  height:53px;
  max-width:250px;
  overflow:hidden;

  padding:4px 6px;
  border-radius:10px;

  background: rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.06);
}

.logo-box img{
  height:100%;
  width:auto;
  max-width:100%;
  object-fit:contain;
}

/* Nav */
.nav{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:wrap;
  flex: 1 1 auto;
}

.nav a{
  font-size:13px;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid transparent;
  opacity:.92;
  white-space:nowrap;
}

.nav a:hover{
  opacity:1;
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
}

/* Language */
.lang{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  color: var(--muted);
  flex:0 0 auto;
}

.lang a{ color: var(--text); opacity:.9; }
.lang a:hover{ opacity:1; text-decoration:underline; }

/* Main */
.main{ padding:36px 22px 56px; }

h1{
  margin:0 0 14px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height:1.2;
  letter-spacing:-0.4px;
}

p{ margin:0 0 14px;
  font-size:16px;

  text-align: justify;        /* تراز دوطرفه */
  text-justify: inter-word;   /* پخش فاصله بین کلمات */ }

/* Cards */
.card{
  background: linear-gradient(180deg, var(--card1), var(--card2));
  border:1px solid rgba(255,255,255,.10);
  border-radius:20px;
  padding:22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.card a{ color: var(--accent); }
.card a:hover{ text-decoration:underline; }

.footer{
  margin-top:22px;
  font-size:14px;
  color: var(--muted);
}

/* Contact grid */
.kv{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:12px 16px;
  margin-top:6px;
}

.kv div{
  padding:12px 14px;
  border-radius:14px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
}

/* Mobile */
@media (max-width: 820px){

  /* Header becomes vertical so nav never goes off-screen */
  .header{
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 12px;
  }

  /* Logo centered (full row) */
  .brand{
    width: 100%;
    justify-content: center;
  }

  .logo-box{
    height: 48px;      /* اگر 10% بزرگ کردی، این خوبه */
    max-width: 286px;  /* هماهنگ با بزرگ شدن لوگو */
    padding: 8px 10px;
    margin: 0 auto;
  }

  /* Nav centered and visible */
  .nav{
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .nav a{
    font-size: 14px;
    padding: 10px 12px;
  }

  /* Language centered */
  .lang{
    width: 100%;
    justify-content: center;
    font-size: 14px;
    gap: 12px;
  }

  /* Layout spacing */
  .container{ padding: 16px; }
  .main{ padding: 22px 16px 40px; }
  p{ font-size: 16px; }

  .kv{
    grid-template-columns: 1fr;
    gap: 10px 12px;
  }

  h1{
    font-size: clamp(24px, 6vw, 34px);
  }
}
/* =========================
   Language selection page
========================= */
.lang-page{
  text-align:center;
}

.lang-page p,
.lang-page a{
  text-align:center;
}
.kv > .muted{
  font-weight: 650 !important;
}

.lang-page .cvr{
  font-size: 15px;
  color: var(--muted);
  text-align: center;
  margin-top: -3px;
  margin-bottom: 12px;
}
/* Reduce logo spacing only on language page */
.lang-page .logo-box{
  margin-bottom: -33px;
}
/* =========================
   Persian page tweaks (/persian/)
========================= */
html[lang="fa"] .persian-page{
  text-align: right;
}

html[lang="fa"] .persian-page p{
  text-align: right;  /* برای فارسی بهتر از justify است */
}

html[lang="fa"] .persian-page h1{
  text-align: right;
}

html[lang="fa"] .h2-fa{
  margin: 0 0 10px;
  font-size: 18px;
}

html[lang="fa"] .cvr-inline{
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
}

html[lang="fa"] .home-link{
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

html[lang="fa"] .home-logo{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

html[lang="fa"] .home-logo .logo-box{
  /* لوگوی پایین صفحه کمی کوچکتر از هدر باشد */
  height: 42px;
  max-width: 220px;
}

html[lang="fa"] .small{
  font-size: 13px;
}

