/* ============================================================
   هم‌تماشا — Design system «نِبولا» (single source of truth)
   Loaded before every other stylesheet. The page skin (nebula.css)
   and page layouts read colors, type, spacing, radii, shadows and
   motion from these tokens; personal themes override them inline.

   Direction: galactic cinema. Deep indigo space, blurple + nitro
   pink, glass panels, glowing gradient edges, rounded squircles.

   Breakpoints: 480 (small phone), 640 (phone), 768 (tablet),
   1024 (small desktop), 1280 (desktop shell max width).
   ============================================================ */
@font-face{
  font-family:"Vazirmatn";
  src:url("../fonts/vazirmatn-var.woff2") format("woff2-variations");
  font-weight:100 900;
  font-style:normal;
  font-display:swap;
}
:root{
  color-scheme:dark;

  /* ----- color: brand (blurple + nitro pink) ----- */
  --accent:#6c5cff;
  --accent-2:#ff4fd2;
  --accent-strong:#5646f0;
  --accent-contrast:#ffffff;
  --brand-rgb:108,92,255;
  --brand-2-rgb:255,79,210;
  --grad:linear-gradient(135deg,#6c5cff 0%,#ff4fd2 100%);

  /* ----- color: helpers ----- */
  --nx-cyan:#3be8ff;
  --nx-green:#3ef0a0;
  --nx-yellow:#ffd84d;
  --nx-red:#ff4d6d;

  /* ----- color: surfaces & text (space, default) ----- */
  --bg:#0c0b1d;
  --bg-2:#12112a;
  --panel:#1a1934;
  --panel-strong:#232244;
  --border:#2c2a52;
  --border-strong:#423f74;
  --text:#f1efff;
  --text-dim:#b4b0d9;
  --text-faint:#7f7aa8;
  --ink:#0c0b1d;
  --paper:#f4f2ff;

  /* ----- color: semantic aliases ----- */
  --surface-0:var(--bg);
  --surface-1:var(--bg-2);
  --surface-2:var(--panel);
  --surface-3:var(--panel-strong);
  --stroke-subtle:var(--border);
  --stroke-strong:var(--border-strong);
  --text-1:var(--text);
  --text-2:var(--text-dim);
  --text-3:var(--text-faint);
  --note-error:#ff8fa3;
  --link:#a99eff;
  --focus-ring:rgba(var(--brand-rgb),.85);
  --focus-width:2px;
  --focus-offset:3px;

  /* ----- color: status & information ----- */
  --success:#3ef0a0;
  --warn:#ffd84d;
  --danger:#ff4d6d;
  --info:#3be8ff;
  --success-bg:rgba(62,240,160,.12);
  --warn-bg:rgba(255,216,77,.12);
  --danger-bg:rgba(255,77,109,.12);
  --info-bg:rgba(59,232,255,.12);

  /* ----- interaction state layers ----- */
  --state-hover:rgba(241,239,255,.06);
  --state-pressed:rgba(241,239,255,.11);
  --state-selected:rgba(var(--brand-rgb),.2);
  --state-unavailable:rgba(241,239,255,.03);
  --disabled-opacity:.45;

  /* ----- typography ----- */
  --font:"Vazirmatn",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-display:"Vazirmatn",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --fs-xs:11px;
  --fs-sm:12.5px;
  --fs-base:14px;
  --fs-md:14.5px;
  --fs-lg:16px;
  --fs-xl:20px;
  --fs-2xl:28px;
  --fs-3xl:40px;
  --fs-display:clamp(36px,5.4vw,72px);
  --lh-tight:1.15;
  --lh-snug:1.55;
  --lh-body:1.85;
  --weight-light:300;
  --weight-regular:400;
  --weight-medium:500;
  --weight-semibold:600;
  --weight-bold:700;
  --weight-heavy:900;
  --tracking-label:.06em;
  --tracking-display:-.01em;

  /* ----- layout & spacing (4px base) ----- */
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:56px;
  --sp-10:80px;
  --topbar-h:62px;
  --side-w:372px;
  --content-w:1200px;
  --header-w:1320px;
  --rail-w:76px;

  /* ----- radii: soft squircles ----- */
  --r-xs:8px;
  --r-sm:10px;
  --r-md:14px;
  --r-lg:20px;
  --r-xl:28px;
  --r-pill:999px;

  /* ----- shadows, glows & elevation ----- */
  --shadow:0 30px 70px -30px rgba(3,2,15,.85);
  --shadow-sm:0 10px 26px -14px rgba(3,2,15,.7);
  --shadow-md:0 20px 46px -22px rgba(3,2,15,.8);
  --shadow-lg:var(--shadow);
  --shadow-brand:0 14px 36px -12px rgba(var(--brand-rgb),.65);
  --shadow-offset:0 0 0 1px rgba(var(--brand-rgb),.35),0 18px 50px -20px rgba(var(--brand-rgb),.6);
  --glow:0 0 0 1px rgba(var(--brand-rgb),.4),0 0 28px -4px rgba(var(--brand-rgb),.55);
  --glow-2:0 0 0 1px rgba(var(--brand-2-rgb),.4),0 0 28px -4px rgba(var(--brand-2-rgb),.5);
  --elev-0:none;
  --elev-1:var(--shadow-sm);
  --elev-2:var(--shadow-md);
  --elev-3:var(--shadow-lg);

  /* ----- glass ----- */
  --glass-bg:color-mix(in srgb,var(--panel) 62%,transparent);
  --glass-bg-strong:color-mix(in srgb,var(--panel) 84%,transparent);
  --glass-edge:rgba(255,255,255,.09);
  --glass-sheen:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,0) 42%);

  /* ----- icons ----- */
  --icon-sm:16px;
  --icon-md:20px;
  --icon-lg:24px;

  /* ----- motion: lively but controllable ----- */
  --ease-standard:cubic-bezier(.2,.7,.3,1);
  --ease-emphasized:cubic-bezier(.22,1,.36,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
  --dur-fast:140ms;
  --dur-mid:240ms;
  --dur-slow:420ms;

  /* ----- layering ----- */
  --z-base:0;
  --z-sticky:10;
  --z-header:20;
  --z-dropdown:50;
  --z-menu:60;
  --z-drawer:80;
  --z-modal:100;
  --z-popover:120;
  --z-tooltip:130;
  --z-toast:200;
}

/* ----- light theme: frost ----- */
html[data-theme="light"]{
  color-scheme:light;
  --accent:#5b4cf0;
  --accent-2:#d9389f;
  --accent-strong:#4536d6;
  --accent-contrast:#ffffff;
  --brand-rgb:91,76,240;
  --brand-2-rgb:217,56,159;
  --grad:linear-gradient(135deg,#5b4cf0 0%,#d9389f 100%);
  --bg:#f4f2ff;
  --bg-2:#ebe8fc;
  --panel:#ffffff;
  --panel-strong:#f1eefe;
  --border:#dedaf5;
  --border-strong:#c3bdea;
  --text:#17152e;
  --text-dim:#4f4b72;
  --text-faint:#7a759c;
  --note-error:#c2183f;
  --link:#4c3de0;
  --success:#0d9c63;
  --warn:#a87a00;
  --danger:#d91c45;
  --info:#0789a8;
  --success-bg:rgba(13,156,99,.1);
  --warn-bg:rgba(168,122,0,.1);
  --danger-bg:rgba(217,28,69,.08);
  --info-bg:rgba(7,137,168,.09);
  --state-hover:rgba(23,21,46,.05);
  --state-pressed:rgba(23,21,46,.09);
  --state-selected:rgba(var(--brand-rgb),.13);
  --state-unavailable:rgba(23,21,46,.03);
  --shadow:0 26px 56px -30px rgba(52,40,140,.32);
  --shadow-sm:0 8px 22px -14px rgba(52,40,140,.28);
  --shadow-md:0 16px 38px -22px rgba(52,40,140,.32);
  --shadow-brand:0 14px 30px -14px rgba(var(--brand-rgb),.5);
  --glass-bg:color-mix(in srgb,var(--panel) 72%,transparent);
  --glass-bg-strong:color-mix(in srgb,var(--panel) 90%,transparent);
  --glass-edge:rgba(91,76,240,.14);
  --glass-sheen:linear-gradient(180deg,rgba(255,255,255,.7),rgba(255,255,255,0) 45%);
}

/* ----- global interaction states ----- */
:focus-visible{
  outline:var(--focus-width) solid var(--focus-ring);
  outline-offset:var(--focus-offset);
}
:where(button,input,select,textarea,summary):disabled,
:where([aria-disabled="true"]){
  opacity:var(--disabled-opacity);
  cursor:not-allowed;
}
:where(button,input,select,textarea)[aria-busy="true"],
:where([aria-busy="true"]){cursor:progress}
::selection{background:rgba(var(--brand-rgb),.38);color:var(--text)}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
    scroll-behavior:auto!important;
  }
}
