/* ============================================================================
   base.css — ریشه‌ی طراحی سایت ونوس
   - متغیرهای تم (دارک/لایت با CSS variables)
   - reset و تایپوگرافی
   - المان‌های پایه: container، دکمه‌ها، فرم‌ها، فوتر، نوار بالا
   تم: فقط مشکی / سفید / خاکستری — بدون رنگ تاکیدی
   فونت‌ها: Vazirmatn (فارسی) + Inter (انگلیسی) + IBM Plex Mono (کد)
   ========================================================================== */

/* ---------- متغیرهای تم ---------- */
:root {
  /* دارک (پیش‌فرض) */
  --bg: #000;
  --bg-soft: #0a0a0a;
  --surface: #111;
  --surface-hover: #1a1a1a;
  --text: #f5f5f5;
  --text-dim: #9a9a9a;
  --text-faint: #6a6a6a;
  --border: #262626;
  --border-strong: #3d3d3d;
  --line: rgba(255, 255, 255, 0.08);
  --font-fa: "Vazirmatn", "Tahoma", sans-serif;
  --font-en: "Inter", "Vazirmatn", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --radius: 2px;
  --maxw: 1180px;
  --transition: 0.22s cubic-bezier(0.2, 0.6, 0.2, 1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

/* لایت مود — با attribute روی body اعمال می‌شه */
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --surface: #fafafa;
  --surface-hover: #f0f0f0;
  --text: #0a0a0a;
  --text-dim: #454545;
  --text-faint: #777777;
  --border: #e2e2e2;
  --border-strong: #b8b8b8;
  --line: rgba(0, 0, 0, 0.1);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-fa);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
  /* زمانی که زبان انگلیسی است فونت Inter در اولویت است */
}

html[lang="en"] body {
  font-family: var(--font-en);
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

h1, h2, h3, h4 {
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* انگلیسی وقتی ltr است تایپوگرافی جسورتر دیده بشه */
html[lang="en"] h1, html[lang="en"] h2 { letter-spacing: -0.03em; }

::selection {
  background: var(--text);
  color: var(--bg);
}

/* ---------- Layout ---------- */
.container {
  width: min(var(--maxw), 100% - 3rem);
  margin-inline: auto;
}

.container--narrow {
  max-width: 720px;
}

.section {
  padding-block: clamp(4.5rem, 9vw, 8rem);
  border-top: 1px solid var(--border);
}

.section--alt {
  background: var(--bg-soft);
}

/* ---------- Topbar (نوار بالا: تم + زبان) ---------- */
.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  font-size: 0.8rem;
}

.topbar__version {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 0.75rem;
}

.topbar__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar__sep {
  width: 1px;
  height: 14px;
  background: var(--border-strong);
}

/* سوییچ تم */
.topbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.topbar__btn:hover { color: var(--text); }

.topbar__btn-icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}

/* آیکون خورشید/ماه با یک دایره داخل */
.topbar__btn-icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
  transition: transform var(--transition);
}

html[data-theme="light"] .topbar__btn-icon::after {
  transform: translateX(150%);
}

/* سوییچ زبان */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-switch__link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-dim);
  transition: all var(--transition);
}

.lang-switch__link:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.lang-switch__link.is-active {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}

/* ---------- Header / نویگیشن ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 40px;
  z-index: 40;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-weight: 500;
}

.brand__logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  transition: transform var(--transition);
}

.brand:hover .brand__logo { transform: rotate(-8deg); }

.brand__name {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand__dot {
  color: var(--text-faint);
}

/* منوی دسکتاپ */
.main-nav {
  display: flex;
  gap: 0.25rem;
  margin-inline: auto;
}

.main-nav__link {
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
  color: var(--text-dim);
  position: relative;
  transition: color var(--transition);
}

.main-nav__link:hover { color: var(--text); }

.main-nav__link::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 2px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition);
}

.main-nav__link:hover::after,
.main-nav__link.is-active::after {
  transform: scaleX(1);
}

.main-nav__link.is-active { color: var(--text); }

/* برگر موبایل */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}

.nav-burger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition);
}

/* دراپ‌داون موبایل */
.nav-dropdown {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding-block: 0.5rem;
}

.nav-dropdown__link {
  display: block;
  padding: 0.7rem 1.5rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}

.nav-dropdown__link:hover { color: var(--text); }

/* ---------- زمینه‌ی main ---------- */
#main {
  min-height: 50vh;
}

/* ---------- فوتر ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding-block: 3.5rem 2rem;
  margin-top: 2rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.site-footer__tagline {
  margin-top: 0.9rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 30ch;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.site-footer__heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 0.35rem;
}

.site-footer__col a {
  color: var(--text-dim);
  font-size: 0.92rem;
  transition: color var(--transition);
  width: fit-content;
}

.site-footer__col a:hover { color: var(--text); }

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.site-footer__mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ---------- فرم‌ها ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.field__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: lowercase;
}

.field__input {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.8rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), background var(--transition);
  width: 100%;
}

.field__input:focus {
  outline: none;
  border-color: var(--text);
}

.field__input::placeholder { color: var(--text-faint); }

textarea.field__input {
  resize: vertical;
  min-height: 120px;
}

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--small {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn--lg {
  padding: 1rem 2.2rem;
  font-size: 1.05rem;
}

.btn--block { width: 100%; }

.btn--primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

html[data-theme="light"] .btn--primary:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--text);
  background: var(--surface);
}

.btn.is-active { border-color: var(--text); }

/* ---------- انیمیشن ورود ملایم ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* برای ورود قابل اسکرول — کلاس reveal توسط JS اضافه می‌شه */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-burger { display: flex; }
  .site-header__inner { gap: 0.75rem; }
  .site-header__inner .btn { display: none; }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .container { width: calc(100% - 2rem); }
  .topbar__btn-label { display: none; }
  .topbar__sep { display: none; }
}
