/* ===========================================================
   راویار — Persian Stories × AI  ·  Design tokens & ornament
   Visual DNA: lapis night · turquoise · gold · ochre · parchment
   =========================================================== */

:root {
  /* — Night / surfaces — */
  --night-900: #04121d;
  --night-850: #06182a;
  --night-800: #0a2236;
  --night-750: #0e2c44;
  --panel:     #0f2740;
  --panel-2:   #143350;
  --panel-line: rgba(212,169,76,0.16);
  --hairline:  rgba(231,222,201,0.10);

  /* — Lapis / azure — */
  --lapis-700: #14306e;
  --lapis-600: #1c4392;
  --lapis-500: #2a5fc0;
  --lapis-400: #4d82dd;

  /* — Turquoise / firouzeh — */
  --turq-600: #11968f;
  --turq-500: #1cb7ac;
  --turq-400: #45d6c8;
  --turq-glow: rgba(69,214,200,0.35);

  /* — Gold / tala — */
  --gold-700: #9d7a22;
  --gold-600: #b88c2e;
  --gold-500: #d4a94c;
  --gold-400: #e7c673;
  --gold-200: #f3e0a8;
  --gold-glow: rgba(212,169,76,0.30);

  /* — Ochre / akhra (warm clay) — */
  --ochre-600: #a8552a;
  --ochre-500: #c4703a;
  --ochre-400: #d98a52;

  /* — Parchment / text — */
  --cream:   #f4ecda;
  --cream-2: #e7dcc1;
  --muted:   #a8b2d4;
  --muted-2: #717ea8;

  /* — Semantic — */
  --bg: var(--night-850);
  --text: var(--cream);
  --accent: var(--gold-500);

  /* — Type — */
  --fa: 'Vazirmatn', system-ui, sans-serif;
  --display: 'Lalezar', 'Vazirmatn', cursive;
  --serif-en: 'Cormorant Garamond', 'Vazirmatn', serif;
  --verse: 'Amiri', 'Vazirmatn', serif;

  /* — Radius / shadow — */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-card: 0 18px 50px -22px rgba(0,0,0,0.7);
  --shadow-pop: 0 24px 70px -20px rgba(0,0,0,0.75);

  --maxw: 1240px;
}
:root { --gold-700: #9d7a22; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
  font-family: var(--fa);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
}
[dir="ltr"] { font-family: var(--serif-en), var(--fa); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--gold-500); color: var(--night-900); }

/* ── Night canvas: layered radial glows + arabesque texture ── */
.canvas-bg {
  position: absolute; inset: 0; overflow: hidden; z-index: 0;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(28,183,172,0.26), transparent 60%),
    radial-gradient(900px 600px at 10% 8%, rgba(42,95,192,0.22), transparent 58%),
    radial-gradient(1000px 800px at 50% 120%, rgba(17,150,143,0.18), transparent 60%),
    linear-gradient(180deg, var(--night-900), var(--night-850) 40%, var(--night-800));
}
.canvas-bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image: var(--arabesque);
  background-size: 360px 360px;
  mix-blend-mode: soft-light;
}

/* ── Gold hairline frame (قاب طلایی) ── */
.gold-frame { position: relative; }
.gold-frame::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold-400), rgba(212,169,76,0.12) 35%, rgba(69,214,200,0.25) 70%, var(--gold-400));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ── Glass panel ── */
.panel {
  background: linear-gradient(180deg, rgba(24,42,86,0.66), rgba(13,24,60,0.72));
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #2a1d05;
  box-shadow: 0 10px 26px -10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-gold:hover { box-shadow: 0 14px 32px -8px var(--gold-glow); }
.btn-ghost {
  background: rgba(231,222,201,0.06); color: var(--cream);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { background: rgba(231,222,201,0.12); }
.btn-turq {
  background: linear-gradient(135deg, var(--turq-400), var(--turq-600));
  color: #042a27; box-shadow: 0 10px 26px -12px var(--turq-glow);
}

/* ── Chips / badges ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: rgba(231,222,201,0.06); border: 1px solid var(--hairline); color: var(--cream-2);
  transition: all .16s ease; white-space: nowrap;
}
.chip.is-active { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: #2a1d05; border-color: transparent; }
.chip:hover:not(.is-active) { border-color: var(--panel-line); background: rgba(231,222,201,0.1); }

.badge-ai {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: linear-gradient(135deg, rgba(69,214,200,0.22), rgba(42,95,192,0.22));
  border: 1px solid rgba(69,214,200,0.4); color: var(--turq-400); white-space: nowrap;
}

/* ── Section heading with shamseh tick ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; letter-spacing: .04em; color: var(--gold-400); font-weight: 600;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-500)); }

h1,h2,h3 { font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: 0; }

/* ── Scrollbars ── */
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(212,169,76,0.25); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Utility ── */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 18px; } .gap-4 { gap: 26px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.gold { color: var(--gold-400); }
.turq { color: var(--turq-400); }

.fa-num { font-feature-settings: "ss01"; }

/* ── Entrance ── */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes glowpulse { 0%,100% { opacity: .5; } 50% { opacity: .85; } }
@keyframes spinslow { to { transform: rotate(360deg); } }
.rise { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* ── ریسپانسیوِ موبایل (افزودهٔ وبکستینگ — جلوگیری از شکستِ چیدمانِ دسکتاپ‌محور) ── */
@media (max-width: 820px){
  html, body{ overflow-x:hidden; max-width:100vw; }
  header > div{ flex-wrap:wrap !important; gap:10px !important; row-gap:8px !important; }
  header nav{ display:none !important; }
  header button[style*="280px"]{ width:auto !important; flex:1 1 auto !important; min-width:120px !important; }
  /* هیرو: ارتفاع و عنوانِ کوچک‌تر */
  section[style*="540px"]{ height:auto !important; min-height:380px !important; }
  section[style*="540px"] h1{ font-size:34px !important; line-height:1.12 !important; }
  section[style*="540px"] > div[style*="56px"]{ padding:26px 22px !important; }
  /* گریدهای چندستونه → ۲ ستون، فوتر → ۱-۲ ستون */
  section.panel > div[style*="repeat(3"]{ grid-template-columns:1fr 1fr !important; }
  footer > div[style*="grid"]{ grid-template-columns:1fr 1fr !important; gap:20px !important; }
}
@media (max-width: 480px){
  footer > div[style*="grid"]{ grid-template-columns:1fr !important; }
  section.panel > div[style*="repeat(3"]{ grid-template-columns:1fr !important; }
}
