/* ─── FONT FACES (Doran, Persian) ─── */
@import url('../fonts/fonts.css');

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

/* ─── DESIGN TOKENS ─── */
:root{
  /* Semantic tokens (the source of truth — flipped per theme) */
  --bg:      #080808;
  --bg-2:    #111113;
  --bg-3:    #161618;
  --text:    #f0f0f2;
  --text-2:  #c8c8d0;
  --text-3:  #a8a8b4;
  --gold:      #c9a063;
  --gold-dim:  #8a6a3a;
  --gold-soft: rgba(201,160,99,0.15);

  --surface-1: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.05);
  --surface-3: rgba(255,255,255,0.07);
  --surface-4: rgba(255,255,255,0.09);

  --line-1: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.10);
  --line-3: rgba(255,255,255,0.15);
  --line-4: rgba(255,255,255,0.25);

  /* Backwards-compat aliases — every page already uses these names */
  --black: var(--bg);
  --dark:  var(--bg-2);
  --card-dark: var(--bg-3);
  --silver:    var(--text-2);
  --silver-dim:var(--text-3);
  --white:     var(--text);
  --glass-bg:        var(--surface-2);
  --glass-border:    var(--line-2);
  --glass-highlight: var(--line-3);

  --font-sans:    'Doran', 'Tahoma', sans-serif;
  --font-display: 'Doran Classic Dots', 'Doran', 'Tahoma', sans-serif;
}

/* ─── LIGHT THEME ─── */
:root[data-theme="light"]{
  --bg:      #f5f5f7;
  --bg-2:    #ffffff;
  --bg-3:    #ffffff;
  --text:    #0a0a0c;
  --text-2:  #3c3c44;
  --text-3:  #6c6c78;
  --gold:      #b88a4a;
  --gold-dim:  #8a6a3a;
  --gold-soft: rgba(184,138,74,0.12);

  --surface-1: rgba(0,0,0,0.025);
  --surface-2: rgba(0,0,0,0.04);
  --surface-3: rgba(0,0,0,0.06);
  --surface-4: rgba(0,0,0,0.08);

  --line-1: rgba(0,0,0,0.06);
  --line-2: rgba(0,0,0,0.10);
  --line-3: rgba(0,0,0,0.15);
  --line-4: rgba(0,0,0,0.25);
}

html{ scroll-behavior: smooth; }

body{
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  text-align: right;
  direction: rtl;
}

/* ─── NOISE TEXTURE OVERLAY ─── */
#noise-overlay{
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999; opacity: 0.35;
}

/* ─── BACKGROUND BLOBS ─── */
.bg-blobs{ position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob{
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.18;
  animation: blobFloat 20s ease-in-out infinite;
}
.blob-1{ width: 700px; height: 700px; top: -200px; right: -200px;
  background: radial-gradient(circle, #3a3a50, #1a1a2a); animation-delay: 0s; }
.blob-2{ width: 500px; height: 500px; top: 40%; left: -150px;
  background: radial-gradient(circle, #2a2a1a, #1a1500); animation-delay: -7s; opacity: 0.12; }
.blob-3{ width: 400px; height: 400px; bottom: -100px; right: 30%;
  background: radial-gradient(circle, #c9a063, #3a2a10); animation-delay: -14s; opacity: 0.08; }

[data-theme="light"] .blob-1{ background: radial-gradient(circle, #d8d8e8, #f0f0f6); opacity: 0.6 }
[data-theme="light"] .blob-2{ background: radial-gradient(circle, #f0e6d0, #faf3e2); opacity: 0.55 }
[data-theme="light"] .blob-3{ background: radial-gradient(circle, #f0d8a8, #fff1d8); opacity: 0.45 }
[data-theme="light"] #noise-overlay{ opacity: 0.10 }

@keyframes blobFloat{
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.05); }
  66%      { transform: translate(-40px, 60px) scale(0.95); }
}

/* ─── NAV ─── */
nav.bs-nav{
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 5%; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(8,8,8,0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.4s ease;
}
nav.bs-nav.scrolled{ background: rgba(8,8,8,0.92); }
[data-theme="light"] nav.bs-nav{ background: rgba(245,245,247,0.7); border-bottom-color: var(--line-1); }
[data-theme="light"] nav.bs-nav.scrolled{ background: rgba(245,245,247,0.92); }

.nav-logo{
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--white);
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-icon{
  height: 32px; width: auto;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0; /* swallow the legacy "B" text fallback if an image fails */
}
.logo-icon img{
  height: 100%; width: auto; display: block;
  -webkit-user-drag: none; user-select: none;
}
.logo-icon .logo-img-light{ display: none; }
.logo-icon .logo-img-dark{ display: block; }
[data-theme="light"] .logo-icon .logo-img-light{ display: block; }
[data-theme="light"] .logo-icon .logo-img-dark{ display: none; }

.nav-links{ display: flex; gap: 36px; list-style: none; }
.nav-links a{
  color: var(--silver-dim); font-size: 0.875rem; letter-spacing: 0.04em;
  text-decoration: none; transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.active{ color: var(--white); }

.nav-cta{
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #000; font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.06em;
  padding: 10px 24px; border-radius: 50px;
  border: none; cursor: pointer; text-decoration: none;
  transition: opacity 0.3s, transform 0.2s;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.nav-cta:hover{ opacity: 0.85; transform: translateY(-1px); }

.nav-mobile-toggle{ display: none; background: none; border: none; cursor: pointer; color: var(--white); }
.nav-mobile-menu{
  display: none; position: fixed; top: 72px; left: 0; right: 0;
  background: rgba(8,8,8,0.98);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  padding: 20px 5%; flex-direction: column; gap: 16px;
  z-index: 999;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-mobile-menu.open{ display: flex; }
.nav-mobile-menu a{
  color: var(--silver); font-size: 1rem; text-decoration: none;
  padding: 8px 0; border-bottom: 1px solid var(--line-1);
}
[data-theme="light"] .nav-mobile-menu{ background: rgba(245,245,247,0.98); border-bottom-color: var(--line-1); }

@media (max-width: 768px){
  .nav-links, .nav-cta{ display: none; }
  .nav-mobile-toggle{ display: block; }
}

/* ─── BUTTONS ─── */
.btn-primary{
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #000; font-weight: 600; font-size: 0.9rem; letter-spacing: 0.04em;
  padding: 15px 36px; border-radius: 50px;
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
  font-family: var(--font-sans);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 16px 40px rgba(201,160,99,0.3); }

.btn-ghost{
  color: var(--silver); font-size: 0.9rem; letter-spacing: 0.04em;
  padding: 15px 28px; border-radius: 50px;
  border: 1px solid var(--line-3);
  cursor: pointer; background: transparent; text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
  font-family: var(--font-sans);
}
.btn-ghost:hover{ border-color: var(--line-4); color: var(--white); background: var(--surface-2); }

/* ─── COMMON SECTION HELPERS ─── */
.section-label{
  font-size: 0.78rem; letter-spacing: 0.16em;
  color: var(--gold); margin-bottom: 16px;
}
.section-title{
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.25; font-weight: 500;
  letter-spacing: 0;
  color: var(--white); margin-bottom: 20px;
}
.section-sub{
  font-size: 1rem; line-height: 1.85;
  color: var(--silver-dim);
  max-width: 500px; font-weight: 300;
}
.glass-divider{
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  margin: 0 5%;
}

/* ─── REVEAL ─── */
.reveal{
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible{ opacity: 1; transform: none; }

/* ─── DECORATIVE ACCENT (replaces italic display text) ─── */
.accent{
  background: linear-gradient(135deg, #e8d5b0, var(--gold), #8a6a3a);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── FOOTER ─── */
footer.bs-footer{
  padding: 60px 5% 40px;
  border-top: 1px solid var(--line-1);
  position: relative; z-index: 1;
}
.footer-grid{
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px; margin-bottom: 60px;
}
@media (max-width: 768px){ .footer-grid{ grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 480px){ .footer-grid{ grid-template-columns: 1fr; } }

.footer-brand p{
  font-size: 0.85rem; color: var(--silver-dim); line-height: 1.85;
  max-width: 260px; margin-top: 16px;
}
.footer-col h4{
  font-size: 0.8rem; letter-spacing: 0.1em;
  color: var(--silver-dim); margin-bottom: 20px;
}
.footer-col ul{ list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col ul a{
  font-size: 0.85rem; color: var(--silver-dim);
  text-decoration: none; transition: color 0.3s;
}
.footer-col ul a:hover{ color: var(--white); }

.footer-bottom{
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; border-top: 1px solid var(--line-1);
  flex-wrap: wrap; gap: 16px;
}
.footer-bottom p{ font-size: 0.78rem; color: var(--silver-dim); }

/* ─── RTL FIX-UPS ─── */
/* The original blob positions used left/right; for RTL we mirror them in tokens above already.
   Components that explicitly use border-left should be checked per-page. */

/* ─── THEME TOGGLE ─── */
.theme-toggle{
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover{
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--line-3);
  transform: translateY(-1px);
}
.theme-toggle .icon-sun{ display: none; }
.theme-toggle .icon-moon{ display: block; }
[data-theme="light"] .theme-toggle .icon-sun{ display: block; }
[data-theme="light"] .theme-toggle .icon-moon{ display: none; }

/* ─── LIGHT MODE COMPONENT OVERRIDES ───
   Many per-page <style> blocks hardcode rgba(255,255,255,X). Override
   the most visible patterns here so light mode reads correctly. */

/* Glass surfaces and elevated cards used across pages */
[data-theme="light"] .benefit-card,
[data-theme="light"] .step,
[data-theme="light"] .value-card,
[data-theme="light"] .cta-glass-card,
[data-theme="light"] .manifesto-inner,
[data-theme="light"] .hero-badge,
[data-theme="light"] .left-badge,
[data-theme="light"] .info-card,
[data-theme="light"] .floating-pill{
  background: rgba(255,255,255,0.65) !important;
  border-color: var(--line-2) !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

[data-theme="light"] .card-item,
[data-theme="light"] .team-card,
[data-theme="light"] .mission-card,
[data-theme="light"] .vendor-card{
  background: #ffffff !important;
  border-color: var(--line-1) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
[data-theme="light"] .card-item:hover,
[data-theme="light"] .team-card:hover{
  box-shadow: 0 24px 48px rgba(0,0,0,0.10), 0 0 0 1px var(--line-2);
}

/* Stats grid uses gridded "cells" with rgba lines + dark cell bg */
[data-theme="light"] .stats-inner{
  background: var(--line-2) !important;
  border-color: var(--line-1) !important;
}
[data-theme="light"] .stat-box{ background: rgba(255,255,255,0.85) !important; }
[data-theme="light"] .stat-box:hover{ background: rgba(255,255,255,0.95) !important; }

/* Stat-box gradient text uses dark→silver gradient; in light mode our
   tokens already flip those vars to dark text, so the original cascade
   gives us a dark→mid gradient. We must NOT use the `background` shorthand
   here — that would reset background-clip and the digits would render as
   solid blocks. Use background-image instead. */
[data-theme="light"] .stat-box-num{
  background-image: linear-gradient(135deg, #16161a, #4a4a55) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Ticker strip uses gold-tinted bg/border */
[data-theme="light"] .ticker-strip{
  background: rgba(184,138,74,0.06);
  border-top-color: rgba(184,138,74,0.18);
  border-bottom-color: rgba(184,138,74,0.18);
}

/* Hero-stat divider line */
[data-theme="light"] .hero-stat-item{ border-inline-start-color: var(--line-2) !important; }

/* Hero card-main inset highlight (dark only) */
[data-theme="light"] .card-main{
  box-shadow:
    0 24px 64px rgba(0,0,0,0.18),
    0 0 0 1px var(--line-2),
    inset 0 1px 0 rgba(255,255,255,0.6) !important;
}

/* Top decorative seams that draw a faint white line — flip to dark */
[data-theme="light"] .benefit-card::before,
[data-theme="light"] .step::before,
[data-theme="light"] .value-card::before,
[data-theme="light"] .cta-glass-card::before,
[data-theme="light"] .manifesto-inner::before{
  background: linear-gradient(90deg, transparent, var(--line-3), transparent) !important;
}

/* Card item tier label, section labels etc. inherit --gold which already flips. */

/* Form fields used across contact/login pages */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="search"],
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea{
  background: rgba(0,0,0,0.025) !important;
  border-color: var(--line-2) !important;
  color: var(--text) !important;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder{ color: var(--text-3) !important; opacity: 0.7 }
[data-theme="light"] .form-select option{ background: #ffffff !important; color: var(--text) !important; }

/* Pill/segmented controls that reuse rgba(255,255,255) chrome */
[data-theme="light"] .topic-btn,
[data-theme="light"] .priority-btn,
[data-theme="light"] .social-btn,
[data-theme="light"] .filter-chip,
[data-theme="light"] .pager-btn{
  background: rgba(0,0,0,0.025) !important;
  border-color: var(--line-2) !important;
  color: var(--text-2) !important;
}
[data-theme="light"] .topic-btn:hover,
[data-theme="light"] .social-btn:hover,
[data-theme="light"] .filter-chip:hover{
  background: rgba(0,0,0,0.05) !important;
  color: var(--text) !important;
}

/* FAQ rows and similar list items */
[data-theme="light"] .faq-item{ background: #ffffff !important; border-color: var(--line-1) !important; }
[data-theme="light"] .faq-item:hover{ background: rgba(0,0,0,0.025) !important; }

/* Avatars used as decorative gradient circles — keep dark for visual contrast */
/* (intentionally not flipped) */

/* Mission/about decorative dark overlays sit on top of card images, leave as is. */

