/* ═══════════════════════════════════════════════════════════════
   کافه‌دانش — بازطراحی استاتیک (نسخه پیش‌نمایش)
   سیستم طراحی:
   • رنگ‌بندی و تایپوگرافی: بازسازی از atillai.ir (تم تیره + اکسنت طلایی)
   • ساختار و چیدمان: الهام از webart-real.com
   • فونت: وزیرمتن (نزدیک‌ترین جایگزین آزاد به فونت مرجع)
   ═══════════════════════════════════════════════════════════════ */

/* ─── فونت‌ها ─────────────────────────────────────────────── */
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }

/* ─── توکن‌های طراحی ──────────────────────────────────────── */
:root {
  /* پالت از مرجع اول — atillai.ir */
  /* بدنه بنفش روشن‌تر برای تفاوت واضح با کادرهای مشکی */
  --bg-0: #2e2455;
  --bg-1: #0a0a0d;
  --bg-2: #0e0e13;
  --panel: #101016;
  --card: #101016;
  --card-2: #17171f;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);

  --gold: #e3b953;
  --gold-2: #f2d488;
  --gold-3: #c99a37;
  --gold-ink: #221903;
  --gold-soft: rgba(227, 185, 83, .12);

  --txt: #f4f3ef;
  --mut: #b3b1b9;
  --faint: #83828b;

  --ok: #58c98b;
  --warn: #e8c268;
  --err: #e5766a;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  --shadow-1: 0 14px 40px -18px rgba(0, 0, 0, .65);
  --shadow-gold: 0 12px 30px -10px rgba(227, 185, 83, .42);

  --ff: 'Vazirmatn', 'Tahoma', sans-serif;
  --wrap: 1240px;
  --header-h: 72px;
}

/* ─── بازنشانی و پایه ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 110px; overflow-x: clip; }

body {
  font-family: var(--ff);
  font-size: 17px;
  line-height: 2;
  color: var(--txt);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(900px 480px at 12% -6%, rgba(124, 77, 255, .16), transparent 62%),
    radial-gradient(860px 460px at 88% -8%, rgba(227, 185, 83, .07), transparent 62%);
  background-repeat: no-repeat;
  text-align: right;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; }

::selection { background: var(--gold); color: var(--gold-ink); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* اسکرول‌بار */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: #4a3f6e; border-radius: 99px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-3); }
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(227, 185, 83, .35); border: 0; }

/* ─── چیدمان پایه ─────────────────────────────────────────── */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: 96px; position: relative; }
.section-tight { padding-block: 64px; }

.section-head { max-width: 740px; margin-inline: auto; text-align: center; margin-bottom: 56px; }
.section-head.side { margin-inline: 0; text-align: right; }

.h1 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; line-height: 1.5; letter-spacing: -.5px; }
.h2 { font-size: clamp(24px, 3.1vw, 38px); font-weight: 800; line-height: 1.55; }
.h3 { font-size: clamp(19px, 2vw, 23px); font-weight: 700; line-height: 1.65; }
.lead { font-size: clamp(16px, 1.4vw, 18.5px); color: var(--mut); line-height: 2.05; }
.muted { color: var(--mut); }
.small { font-size: 13.5px; }
.gold { color: var(--gold); }

/* برچسب بالای تیترها — سبک atillai */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(227, 185, 83, .35);
  background: rgba(227, 185, 83, .08);
  color: var(--gold);
  font-size: 13px; font-weight: 600; line-height: 1.6;
  margin-bottom: 20px;
}
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

/* ─── دکمه‌ها ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 27px; border-radius: 999px;
  font-size: 15px; font-weight: 700; line-height: 1.6;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease, color .22s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 52%, #d0a13c);
  color: var(--gold-ink);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -12px rgba(227, 185, 83, .55); }
.btn-gold:active { transform: translateY(0); }

.btn-ghost { border-color: var(--line-2); color: var(--txt); background: rgba(255, 255, 255, .02); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

.btn-dark { background: #171208; color: var(--gold-2); border-color: rgba(34, 25, 3, .25); }
.btn-dark:hover { background: #201809; transform: translateY(-2px); }

.btn-lg { padding: 16px 34px; font-size: 16px; }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* چیپ و نشان */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card);
  font-size: 12.5px; font-weight: 500; color: var(--mut); line-height: 1.7;
}
.chip-gold { border-color: rgba(227, 185, 83, .4); background: var(--gold-soft); color: var(--gold); }

.badge-demo {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(232, 194, 104, .12); border: 1px solid rgba(232, 194, 104, .35);
  color: var(--warn); font-size: 12.5px; font-weight: 600;
}

/* ─── هدر شناور (سبک webart، رنگ atillai) ─────────────────── */
.site-header {
  position: fixed; top: 14px; inset-inline: 0; z-index: 120;
  display: flex; justify-content: center;
  padding-inline: 18px; pointer-events: none;
}
.nav-pill {
  pointer-events: auto;
  width: 100%; max-width: var(--wrap);
  display: flex; align-items: center; gap: 26px;
  height: var(--header-h);
  padding-inline: 20px;
  background: rgba(9, 9, 13, .62);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.nav-pill.scrolled {
  background: rgba(7, 7, 10, .93);
  border-color: var(--line-2);
  box-shadow: var(--shadow-1);
}

.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: none;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 16px -6px rgba(227, 185, 83, .5);
}
.brand-mark img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.brand-name { font-size: 18.5px; font-weight: 800; line-height: 1.4; }
.brand-name small { display: block; font-size: 10px; font-weight: 500; color: var(--faint); letter-spacing: 2.5px; line-height: 1; margin-top: 2px; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 6px; }
.main-nav > li { position: relative; }
.main-nav > li > a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; border-radius: 12px;
  font-size: 14.5px; font-weight: 500; color: var(--mut);
  transition: color .2s, background .2s;
}
.main-nav > li > a:hover, .main-nav > li > a.active { color: var(--txt); background: rgba(255, 255, 255, .06); }
.main-nav > li > a.active { color: var(--gold); background: var(--gold-soft); }
.main-nav .caret { width: 13px; height: 13px; transition: transform .25s; }
.has-mega.open > a > .caret { transform: rotate(180deg); }

.nav-actions { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }

/* همبرگر */
.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line-2); align-items: center; justify-content: center; }
.menu-toggle span { display: block; width: 19px; height: 2px; background: var(--txt); border-radius: 2px; position: relative; transition: .3s; }
.menu-toggle span::before { content: ''; position: absolute; inset-inline: 0; top: -6px; height: 2px; background: var(--txt); border-radius: 2px; transition: .3s; }
.menu-toggle span::after { content: ''; position: absolute; inset-inline: 0; top: 6px; height: 2px; background: var(--txt); border-radius: 2px; transition: .3s; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* ─── مگامنوی خدمات ───────────────────────────────────────── */
.mega {
  position: fixed; top: calc(14px + var(--header-h) + 12px);
  left: 50%; transform: translateX(-50%) translateY(8px);
  width: min(980px, 94vw);
  background: rgba(10, 10, 15, .97);
  backdrop-filter: blur(24px);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  padding: 26px;
  display: grid; grid-template-columns: 1fr 1fr 1fr 250px; gap: 22px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 110;
}
.has-mega.open .mega, .has-mega:focus-within .mega { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }

.mega-col > b { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700; color: var(--gold); padding: 4px 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.mega-col > b svg { width: 16px; height: 16px; }
.mega-item { display: block; padding: 10px 12px; border-radius: 14px; transition: background .2s; }
.mega-item:hover { background: rgba(255, 255, 255, .05); }
.mega-item b { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.mega-item:hover b { color: var(--gold); }
.mega-item span { display: block; font-size: 12.5px; color: var(--faint); line-height: 1.8; }

.mega-rail { border-inline-start: 1px solid var(--line); padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; }
.mega-rail > b { font-size: 13.5px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.mega-rail a { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 12px; font-size: 14px; color: var(--mut); transition: .2s; }
.mega-rail a:hover { background: rgba(255, 255, 255, .05); color: var(--txt); }
.mega-rail a svg { width: 14px; height: 14px; opacity: .5; }
.mega-card {
  margin-top: 14px; padding: 16px; border-radius: 16px;
  background: linear-gradient(140deg, rgba(227, 185, 83, .16), rgba(227, 185, 83, .05));
  border: 1px solid rgba(227, 185, 83, .3);
}
.mega-card b { display: block; font-size: 13.5px; margin-bottom: 4px; color: var(--txt); }
.mega-card p { font-size: 12px; color: var(--mut); line-height: 1.8; margin-bottom: 10px; }

/* ─── منوی موبایل ─────────────────────────────────────────── */
.drawer-veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); z-index: 130; opacity: 0; visibility: hidden; transition: .3s; }
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 140;
  width: min(360px, 88vw);
  background: #0a0a0e; border-left: 1px solid var(--line);
  padding: 26px 24px; overflow-y: auto;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.32, .72, .28, 1);
}
body.drawer-open .drawer-veil { opacity: 1; visibility: visible; }
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open { overflow: hidden; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.drawer-close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.drawer-group > b { display: block; font-size: 12.5px; font-weight: 700; color: var(--gold); margin: 18px 0 6px; }
.drawer-group a { display: block; padding: 11px 12px; border-radius: 12px; font-size: 15px; color: var(--mut); }
.drawer-group a:hover { background: rgba(255, 255, 255, .05); color: var(--txt); }
.drawer .btn { margin-top: 22px; }

/* ─── فوتر (ساختار webart × رنگ atillai) ──────────────────── */
.footer {
  margin-top: 110px;
  background: linear-gradient(170deg, #0d0b07, #070605);
  border-radius: 48px 48px 0 0;
  border-top: 1px solid rgba(227, 185, 83, .18);
  position: relative; overflow: hidden;
  padding-top: 72px;
}
.footer-mark {
  position: absolute; bottom: -18px; inset-inline: 0;
  text-align: center; pointer-events: none; user-select: none;
  font-size: clamp(70px, 15vw, 190px); font-weight: 800; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgba(227, 185, 83, .1);
}
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1.15fr; gap: 44px; position: relative; }
.footer-brand p { color: var(--mut); font-size: 14.5px; margin: 14px 0 22px; max-width: 340px; }
.footer-col > b { display: block; font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 14px; color: var(--mut); transition: color .2s, padding .2s; }
.footer-col a:hover { color: var(--gold); }
.footer-note { font-size: 12.5px; color: var(--faint); line-height: 1.9; margin-top: 12px; }

.social-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.social-chips a {
  padding: 8px 17px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2);
  font-size: 13px; color: var(--txt); transition: .2s;
}
.social-chips a:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }

.footer-contact {
  margin-top: 56px; padding: 20px 0;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--mut);
  position: relative;
}
.footer-contact a { color: var(--txt); }
.footer-contact a:hover { color: var(--gold); }
.footer-contact .fc-links { display: flex; gap: 20px; }
.footer-copy { padding: 16px 0 22px; text-align: center; font-size: 12.5px; color: var(--faint); border-top: 1px solid var(--line); position: relative; }

/* دکمه بازگشت به بالا */
.to-top {
  position: fixed; bottom: 26px; inset-inline-start: 26px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(14, 14, 18, .9); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: .3s; backdrop-filter: blur(10px);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--gold); color: var(--gold); }
.to-top svg { width: 19px; height: 19px; }

/* ─── ظاهر عمومی فرم‌ها ───────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13.5px; font-weight: 600; }
.field label i { color: var(--gold); font-style: normal; }
.control {
  width: 100%; padding: 13px 17px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-2); border-radius: 14px;
  color: var(--txt); font-size: 14.5px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.control::placeholder { color: var(--faint); }
.control:focus { outline: none; border-color: var(--gold); background: rgba(227, 185, 83, .05); box-shadow: 0 0 0 4px rgba(227, 185, 83, .1); }
textarea.control { resize: vertical; min-height: 130px; }
select.control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%); background-position: calc(0% + 18px) 50%, calc(0% + 23px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
/* رفع مشکل منوی کشویی: فهرست بازِ select در مرورگر سفید بود و متن سفید دیده نمی‌شد */
select.control { color-scheme: dark; }
select.control option, select.control optgroup {
  background: #17171f; color: var(--txt);
  font-family: inherit; font-size: 14px;
}
select.control option:checked, select.control option:hover { background: rgba(227, 185, 83, .18); color: var(--gold-2); }
.control-error { border-color: var(--err) !important; }
.field-err { font-size: 12px; color: var(--err); display: none; }
.field.invalid .field-err { display: block; }

/* ─── انیمیشن ظهور (فقط وقتی JS فعال است) ─────────────────── */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .12s; }
.reveal[data-delay="2"] { transition-delay: .24s; }
.reveal[data-delay="3"] { transition-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ─── واکنش‌گرایی هدر/مگامنو/فوتر ─────────────────────────── */
@media (max-width: 1080px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .nav-actions .btn { display: none; }
  .mega { display: none; }
}

@media (max-width: 900px) {
  .section { padding-block: 72px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 560px) {
  .wrap { padding-inline: 18px; }
  .section { padding-block: 60px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer { border-radius: 32px 32px 0 0; margin-top: 72px; }
  .footer-contact { justify-content: center; text-align: center; }
  .brand-name { font-size: 16.5px; }
  .nav-pill { gap: 14px; height: 64px; }
  :root { --header-h: 64px; }
}
