/* Ariospico — Design tokens */
@font-face {
  font-family: "YekanBakh";
  src: url("../fonts/YekanBakhFaNum-Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "YekanBakh";
  src: url("../fonts/YekanBakhFaNum-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "YekanBakh";
  src: url("../fonts/YekanBakhFaNum-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "YekanBakh";
  src: url("../fonts/YekanBakhFaNum-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "YekanBakh";
  src: url("../fonts/YekanBakhFaNum-ExtraBold.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "YekanBakh";
  src: url("../fonts/YekanBakhFaNum-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ═══════════════════════════════════════════════════════════════
   Colour themes
   ---------------------------------------------------------------
   :root holds the dark theme (the brand default). The light theme
   overrides it under [data-theme="light"], which the inline script
   in header.php sets before first paint from the saved preference
   or the operating-system setting.

   Colours that are composited with transparency are stored as bare
   "r, g, b" triplets so a rule can write rgb(var(--accent-rgb) / 12%)
   and stay correct in both themes.
   ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* Charcoal */
  --char-950: #09120e;
  --char-900: #0d1712;
  --char-850: #111e17;
  --char-800: #17261d;
  --char-700: #203126;
  --char-600: #31453a;
  --char-500: #506158;

  /* Lime accent */
  --lime-300: #dce9a7;
  --lime-400: #c8dc79;
  --lime-500: #b4cf5b;
  --lime-600: #9fba48;
  --lime-700: #78952e;
  --lime-glow: rgba(180, 207, 91, 0.28);

  /* Forest green */
  --forest-800: #114d2b;
  --forest-500: #1f8a50;

  /* Neutrals */
  --white: #ffffff;
  --ink-200: #d9ded9;
  --ink-300: #adb9b1;
  --ink-400: #8e9d94;

  /* Composition channels */
  --accent-rgb:     180, 207, 91;   /* accent tints and glows        */
  --glass-rgb:      9, 18, 14;      /* translucent panels over media */
  --on-surface-rgb: 255, 255, 255;  /* highlight overlays            */
  --shadow-rgb:     0, 0, 0;

  /* Semantic surfaces */
  --bg-page:        var(--char-900);
  --surface-card:   var(--char-800);
  --surface-raised: var(--char-700);
  --surface-input:  var(--char-700);
  --surface-band:   var(--char-850);
  --surface-deep:   var(--char-950);

  --accent:         var(--lime-500);
  --accent-hover:   var(--lime-600);
  --accent-contrast: #13200d;

  --text-strong:    var(--white);
  --text-body:      var(--ink-200);
  --text-muted:     var(--ink-300);
  --text-faint:     var(--ink-400);

  --border-subtle:  rgba(231,239,233,0.08);
  --border-default: rgba(231,239,233,0.14);
  --border-strong:  rgba(231,239,233,0.25);

  /* Status */
  --danger:         #e05340;
  --danger-text:    #f0a095;
  --danger-bg:      rgba(224,83,64,0.08);
  --danger-border:  rgba(224,83,64,0.45);

  /* Decorative treatments */
  --aurora-1:       rgba(180,207,91,0.055);
  --aurora-2:       rgba(35,132,87,0.055);
  --orb-1:          rgba(180,211,53,0.55);
  --orb-2:          rgba(31,138,80,0.42);
  --orb-3:          rgba(180,211,53,0.20);
  --orb-opacity:    0.5;
  --dotgrid:        rgba(255,255,255,0.05);
  --noise-opacity:  0.5;
  --photo-frame:    linear-gradient(150deg, #3c3c3c 0%, #2c2c2c 48%, #1a1a1a 100%);
  --photo-sheen:    rgba(255,255,255,0.15);
  --photo-shade:    rgba(0,0,0,0.62);
  --photo-inset:    inset 0 0 90px rgba(0,0,0,0.45);
  --photo-filter:   saturate(0.72) contrast(1.04) brightness(0.9);
  --photo-filter-hover: saturate(0.95) contrast(1.06) brightness(1);
  --process-bg-filter: grayscale(0.9) brightness(0.55);
  --scrim-top:      rgba(0,0,0,0.05);
  --scrim-bottom:   rgba(22,22,22,0.55);

  --grad-lime: linear-gradient(120deg, var(--lime-500), var(--lime-600));
  --grad-blob: radial-gradient(120% 120% at 30% 20%, var(--lime-400), var(--lime-600));

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --radius-blob: 42% 58% 62% 38% / 48% 42% 58% 52%;

  --shadow-sm:   0 1px 2px rgba(0,0,0,0.28);
  --shadow-md:   0 12px 28px rgba(0,0,0,0.28);
  --shadow-lg:   0 28px 80px rgba(0,0,0,0.38);
  --shadow-card: 0 20px 54px rgba(0,0,0,0.30);
  --shadow-header: 0 2px 20px rgba(0,0,0,0.35);

  /* Latin (en) by default — YekanBakh is RTL/Persian-only (overridden under [dir="rtl"]) */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-display-xl: clamp(42px, 6.3vw, 76px);
  --fs-display-lg: clamp(32px, 5vw, 58px);
  --fs-display-md: clamp(28px, 4vw, 44px);
  --fs-h1: clamp(28px, 3.5vw, 36px);
  --fs-h2: clamp(22px, 2.8vw, 28px);
  --fs-h3: clamp(18px, 2.2vw, 22px);
  --fs-title: 18px;
  --fs-body-lg: 18px;
  --fs-body: 16px;
  --fs-body-sm: 14px;
  --fs-caption: 13px;

  --ls-display: -0.02em;
  --ls-tight: -0.01em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --container: 1180px;
  --container-wide: 1400px;
  --header-h: 82px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-base: 200ms;
  --dur-slow: 360ms;

  --bw-thick: 2px;
  --bw-frame: 3px;
}

/* ── Light theme ───────────────────────────────────────────────────
   The lime ramp is re-cut into deep greens: the same tokens drive
   text, icons, rules and button fills, and pale lime fails contrast
   on a light page. Ordering is preserved (300 lightest → 700
   darkest) so hover states still move in the expected direction.   */
:root[data-theme="light"] {
  color-scheme: light;

  --char-950: #e7ebe2;
  --char-900: #f5f7f1;
  --char-850: #eceee6;
  --char-800: #ffffff;
  --char-700: #e2e7da;
  --char-600: #cdd5c4;
  --char-500: #9aa792;

  --lime-300: #5b7d20;
  --lime-400: #52701c;
  --lime-500: #486419;
  --lime-600: #3b5314;
  --lime-700: #2e410f;
  --lime-glow: rgba(72, 100, 25, 0.22);

  --white: #ffffff;
  --ink-200: #26332c;
  --ink-300: #48574e;
  --ink-400: #6a7a70;

  --text-strong:    #0d1712;

  --accent-rgb:     72, 100, 25;
  --glass-rgb:      255, 255, 255;
  --on-surface-rgb: 13, 23, 18;
  --shadow-rgb:     31, 45, 36;

  --accent-contrast: #ffffff;
  --surface-input:  #f5f7f2;

  --border-subtle:  rgba(13,23,18,0.10);
  --border-default: rgba(13,23,18,0.17);
  --border-strong:  rgba(13,23,18,0.32);

  --danger:         #c0392b;
  --danger-text:    #8e2a1f;
  --danger-bg:      rgba(192,57,43,0.07);
  --danger-border:  rgba(192,57,43,0.38);

  --aurora-1:       rgba(120,149,46,0.10);
  --aurora-2:       rgba(31,138,80,0.08);
  --orb-1:          rgba(150,182,60,0.40);
  --orb-2:          rgba(31,138,80,0.26);
  --orb-3:          rgba(150,182,60,0.18);
  --orb-opacity:    0.38;
  --dotgrid:        rgba(13,23,18,0.07);
  --noise-opacity:  0.22;
  --photo-frame:    linear-gradient(150deg, #e3e8dc 0%, #d2dac9 48%, #c0cab5 100%);
  --photo-sheen:    rgba(255,255,255,0.55);
  --photo-shade:    rgba(31,45,36,0.20);
  --photo-inset:    inset 0 0 60px rgba(31,45,36,0.10);
  --photo-filter:   saturate(0.94) contrast(1.02);
  --photo-filter-hover: saturate(1.05) contrast(1.04);
  --process-bg-filter: grayscale(0.85) brightness(1.05) opacity(0.55);
  --scrim-top:      rgba(0,0,0,0.02);
  --scrim-bottom:   rgba(20,28,22,0.42);

  --shadow-sm:   0 1px 2px rgba(31,45,36,0.08);
  --shadow-md:   0 12px 28px rgba(31,45,36,0.10);
  --shadow-lg:   0 22px 60px rgba(31,45,36,0.14);
  --shadow-card: 0 16px 44px rgba(31,45,36,0.10);
  --shadow-header: 0 2px 20px rgba(31,45,36,0.09);
}

/* Persian (fa) uses YekanBakh; Latin pages fall back to the system stack above. */
[dir="rtl"] {
  --font-sans: "YekanBakh", ui-sans-serif, system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-display: "YekanBakh", ui-sans-serif, sans-serif;
}

/* Suppress the cross-fade while the theme switches, so only colours
   animate and layout-driven transitions do not double-fire. */
:root.theme-switching *,
:root.theme-switching *::before,
:root.theme-switching *::after {
  transition: background-color 260ms ease, border-color 260ms ease, color 260ms ease !important;
  animation-play-state: paused !important;
}
