/* ==========================================================================
   ABRAK — Site chrome: header, footer, hero, customizer
   ========================================================================== */

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: var(--s-5); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-md); letter-spacing: -.02em; }
.brand .logo-mark { width: 32px; height: 32px; flex: none; }
.brand-name { color: var(--text); }
.brand-name b { color: var(--brand); }

.nav { display: flex; align-items: center; gap: 2px; margin-inline-start: var(--s-4); }
.nav a {
  padding: 8px 14px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600;
  color: var(--text-secondary); transition: background var(--transition), color var(--transition);
}
.nav a:hover { background: var(--surface-hover); color: var(--text); }
.nav a.active { color: var(--brand); }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: transparent;
  border: 1px solid transparent; color: var(--text-secondary);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 20px; height: 20px; }

/* language menu */
.lang-wrap { position: relative; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 150px; z-index: 60;
  display: none; flex-direction: column; gap: 2px;
}
.lang-menu.open { display: flex; }
.lang-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm); border: 0; background: transparent;
  color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600; text-align: start;
}
.lang-menu button:hover { background: var(--surface-hover); color: var(--text); }
.lang-menu button.active { color: var(--brand); background: var(--brand-tint); }
.lang-menu .flag { font-size: 16px; }

/* mobile menu toggle */
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-toggle { display: grid; }
  .nav.mobile-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: var(--header-h); inset-inline: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: var(--s-3); box-shadow: var(--shadow-lg); margin: 0;
  }
  .nav.mobile-open a { padding: 12px 14px; }
}

/* ---------- HERO ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 10vw, 120px); }
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(58% 46% at 78% -6%, color-mix(in oklab, var(--brand) 12%, transparent), transparent 68%);
}
[dir="rtl"] .hero-bg { transform: scaleX(-1); }
.hero-grid-lines {
  position: absolute; inset: 0; z-index: 0; opacity: .5;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(75% 75% at 50% 30%, #000, transparent 75%);
          mask-image: radial-gradient(75% 75% at 50% 30%, #000, transparent 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(36px, 6.5vw, var(--fs-4xl)); margin-bottom: var(--s-4); }
.hero h1 .grad { color: var(--brand); }
.hero .lead { max-width: 580px; font-size: clamp(16px, 2.4vw, var(--fs-lg)); }
.hero-cta { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-6); }

/* dashboard mock used in hero/marketing */
.mock {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.mock-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-bar .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.mock-body { padding: var(--s-5); display: grid; gap: var(--s-4); }

/* ---------- LOGO STRIP ---------- */
.logos { display: flex; flex-wrap: wrap; gap: var(--s-6); align-items: center; justify-content: center; opacity: .65; }
.logos span { font-weight: 800; font-size: var(--fs-lg); color: var(--text-muted); letter-spacing: -.02em; }

/* ---------- STAT ---------- */
.stat .num { font-size: var(--fs-3xl); font-weight: 900; color: var(--brand); letter-spacing: -.02em; }
.stat .label { color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- CTA BANNER ---------- */
.cta-banner {
  position: relative; overflow: hidden;
  background: var(--brand-700);
  border-radius: var(--r-xl); padding: clamp(36px, 6vw, 72px);
  color: #fff; text-align: center;
}
.cta-banner h2 { font-size: clamp(26px, 4vw, var(--fs-2xl)); color: #fff; }
.cta-banner p { color: rgba(255,255,255,.85); margin-top: var(--s-3); }
.cta-banner .btn-secondary { background: rgba(255,255,255,.14); color:#fff; border-color: rgba(255,255,255,.3); }
.cta-banner .btn-secondary:hover { background: rgba(255,255,255,.22); }
.cta-banner .btn-primary { background:#fff; color: var(--brand-700); }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--bg-subtle); border-top: 1px solid var(--border); padding-block: var(--s-8) var(--s-6); margin-top: var(--s-8); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s-6); }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: var(--s-3); font-weight: 700; }
[dir="rtl"] .footer-col h4 { letter-spacing: 0; }
.footer-col a { display: block; padding: 5px 0; color: var(--text-secondary); font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--fs-sm); }

/* ==========================================================================
   CUSTOMIZER (Tweaks) PANEL
   ========================================================================== */
.tweak-fab {
  position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 80;
  width: 52px; height: 52px; border-radius: var(--r-pill);
  background: var(--brand); color: var(--on-brand); border: none;
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
  transition: transform var(--transition);
}
.tweak-fab:hover { transform: scale(1.06) rotate(45deg); }
.tweak-fab svg { width: 24px; height: 24px; }

.tweak-panel {
  position: fixed; inset-inline-end: 20px; bottom: 84px; z-index: 81;
  width: 320px; max-width: calc(100vw - 40px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: var(--s-5); display: none; flex-direction: column; gap: var(--s-4);
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.tweak-panel.open { display: flex; }
.tweak-panel header { display: flex; align-items: center; justify-content: space-between; }
.tweak-panel h3 { font-size: var(--fs-md); }
.tweak-group { display: flex; flex-direction: column; gap: 9px; }
.tweak-group > label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
[dir="rtl"] .tweak-group > label { letter-spacing: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: var(--r-sm); border: 2px solid var(--border); cursor: pointer; transition: transform var(--transition); }
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; }
.seg { display: flex; background: var(--bg-inset); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 7px 8px; border: 0; background: transparent; border-radius: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tweak-panel input[type="range"] { width: 100%; accent-color: var(--brand); }
