/* ===================================================================
   GrooHub Studio OS — Design Tokens & Base Components
   مبني بالكامل على Brand Guideline المعتمد: Navy / Orange / Teal + Alexandria
   =================================================================== */

:root {
  /* ---- Brand Colors (مصدر الحقيقة الوحيد) ---- */
  --orange: #F15F23;
  --orange-600: #d6501a;
  --orange-100: rgba(241, 95, 35, .12);
  --navy: #1B2B49;
  --navy-900: #0e1626;
  --navy-800: #16223b;
  --navy-700: #1f2f4f;
  --navy-600: #2a3f63;
  --teal: #45BB8A;
  --teal-100: rgba(69, 187, 138, .14);
  --white: #FFFFFF;
  --black: #000000;
  --ink-200: #c9d2e2;
  --ink-400: #8c98b3;

  /* ---- Type ---- */
  --font: "Alexandria", "Segoe UI", sans-serif;
  --fs-hero: clamp(2.4rem, 5.2vw, 4.5rem);
  --fs-section: clamp(1.9rem, 3.4vw, 3rem);
  --fs-card: clamp(1.25rem, 1.8vw, 1.6rem);
  --fs-body: clamp(1.05rem, 1.3vw, 1.2rem);
  --fs-small: .95rem;

  /* ---- Radius ---- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;

  /* ---- Layout ---- */
  --max-w: 1440px;
  --read-w: 900px;
  --gap: clamp(1rem, 2vw, 2rem);
  --section-pad: clamp(64px, 9vw, 120px);

  /* ---- Motion ---- */
  --ease: cubic-bezier(.22, .8, .25, 1);
  --dur: .6s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--navy-900);
  color: var(--white);
  direction: rtl;
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--orange); color: var(--white); }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

.read-w { max-width: var(--read-w); margin-inline: auto; }

.section { padding: var(--section-pad) 0; position: relative; }
.section--alt { background: var(--navy-800); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--orange);
  letter-spacing: .04em;
  margin: 0 0 16px;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.section-title {
  font-size: var(--fs-section);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 18px;
}
.section-desc {
  font-size: var(--fs-body);
  color: var(--ink-200);
  margin: 0 0 8px;
  max-width: var(--read-w);
}
.section-head { text-align: center; max-width: var(--read-w); margin: 0 auto 56px; }
.section-head.is-start { text-align: start; margin-inline: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  font-size: clamp(.95rem, 1vw, 1.05rem);
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-600); }
.btn-secondary { background: transparent; color: var(--white); border-color: rgba(255,255,255,.35); }
.btn-secondary:hover { border-color: var(--white); background: rgba(255,255,255,.06); }
.btn-ghost { background: transparent; color: var(--orange); padding: 10px 4px; }
.btn-sm { padding: 10px 18px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 34px);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--navy-600);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.55);
}
.card-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: var(--orange-100);
  color: var(--orange);
  margin-bottom: 18px;
}
.card-title { font-size: var(--fs-card); font-weight: 700; margin: 0 0 10px; }
.card-desc { color: var(--ink-200); margin: 0; font-size: .98rem; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .8rem; font-weight: 700;
  background: var(--orange); color: var(--white);
}
.badge--teal { background: var(--teal); }
.pill {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--navy-600);
  background: transparent;
  color: var(--ink-200);
  font-size: .9rem; font-weight: 600;
  transition: all .25s var(--ease);
}
.pill.is-active, .pill:hover { background: var(--orange); color: var(--white); border-color: var(--orange); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: .05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .12s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .19s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .26s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .33s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: .4s; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4, .grid-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; } }

/* ---------- Forms (shared) ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink-200); }
.field input, .field textarea, .field select {
  background: var(--navy-700);
  border: 1px solid var(--navy-600);
  color: var(--white);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: .95rem;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--orange); outline: none; }
.field textarea { resize: vertical; min-height: 90px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--navy-600);
  position: relative; transition: background .25s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--white);
  transition: transform .25s var(--ease);
}
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { transform: translateX(-18px); }

/* ---------- Toast ---------- */
.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--navy-700); border: 1px solid var(--navy-600);
  color: var(--white); padding: 12px 22px; border-radius: var(--r-md);
  font-size: .92rem; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  animation: toastIn .25s var(--ease);
}
.toast.success { border-color: var(--teal); }
.toast.error { border-color: var(--orange); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--navy-900); }
::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 10px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
