/* Safak Future — safakgroup.om */
:root {
  --night: #070915;
  --ink: #0d1024;
  --ink-2: #151a36;
  --line: rgba(255, 236, 214, 0.12);
  --ivory: #f6efe4;
  --muted: #b9b2c4;
  --amber: #ffb547;
  --ember: #ff6a3d;
  --rose: #e8436b;
  --glow: linear-gradient(100deg, #ffd58a 0%, #ffb547 30%, #ff6a3d 65%, #e8436b 100%);
  --radius: 22px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", "Alexandria", system-ui, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ivory);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="en"] body { line-height: 1.65; }

a { color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--ember); color: #fff; }

/* Language: every bilingual text has both spans; the page shows one. */
html[data-lang="ar"] [lang="en"]:not(html),
html[data-lang="en"] [lang="ar"]:not(html) { display: none !important; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-head.is-solid {
  background: rgba(7, 9, 21, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.brand-name small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; }
.nav { display: flex; gap: 6px; margin-inline-start: auto; }
.nav a {
  text-decoration: none;
  font-size: 0.93rem;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--ivory); background: rgba(255, 255, 255, 0.06); }
.lang-btn {
  font: 600 0.85rem/1 var(--display);
  color: var(--ivory);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.lang-btn:hover { border-color: var(--amber); background: rgba(255, 181, 71, 0.08); }
.lang-btn:active { transform: scale(0.96); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 70% at 50% 92%, #ff7a3d 0%, #c8435a 18%, #4a2150 38%, transparent 62%),
    linear-gradient(180deg, #05060f 0%, #0b0d22 40%, #1c1338 62%, #3b1a3f 78%, #0d0a18 100%);
}
#stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.scene { position: absolute; inset: auto 0 0 0; height: 100%; z-index: -1; pointer-events: none; }
.scene svg { position: absolute; bottom: 0; left: 50%; width: max(100%, 1600px); height: auto; transform: translateX(-50%); }
.layer { will-change: transform; }
.sun { transform-box: fill-box; transform-origin: center; animation: sunrise 3.2s var(--ease-out) both; }
.sun-glow { animation: breathe 7s ease-in-out 3s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sunrise { from { transform: translateY(46%); opacity: 0.2; } to { transform: none; opacity: 1; } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: 0.8; } }

.trail { fill: none; stroke-linecap: round; filter: url(#trailGlow); }
/* pathLength="100" on every trail: dash 7 + gap 93 = one car per lap */
.trail.out { stroke: #ff4d4d; stroke-dasharray: 5 95; animation: drive 4.6s linear infinite; }
.trail.in { stroke: #fff2d6; stroke-dasharray: 9 91; animation: drive 3.6s linear infinite; }
.trail.d2 { animation-delay: -1.5s; }
.trail.d3 { animation-delay: -2.9s; }
@keyframes drive { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

.hero-inner { position: relative; padding-block: 140px 220px; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 0.82rem/1 var(--display);
  letter-spacing: 0.08em;
  color: #ffd9a8;
  border: 1px solid rgba(255, 213, 138, 0.28);
  background: rgba(255, 181, 71, 0.07);
  padding: 9px 16px;
  border-radius: 999px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 11vw, 8.6rem);
  line-height: 1.05;
  margin: 26px 0 8px;
  letter-spacing: -0.01em;
}
html[lang="en"] .hero h1 { letter-spacing: -0.035em; }
.glow-text {
  background: var(--glow);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 9s ease-in-out infinite;
}
@keyframes sheen { 50% { background-position: 100% 0; } }
.hero .tag {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: #fbe6cf;
  margin: 0 auto 14px;
}
.hero .lead { max-width: 640px; margin: 0 auto; color: #d9cfdc; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.btn {
  --b: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 0.98rem/1 var(--display);
  text-decoration: none;
  padding: 16px 24px;
  border-radius: 999px;
  border: 1px solid var(--b);
  transition: transform 0.2s var(--ease-out), box-shadow 0.3s, background 0.3s, border-color 0.3s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--glow); color: #1a0b10; box-shadow: 0 10px 40px -10px rgba(255, 106, 61, 0.7); }
.btn-primary:hover { box-shadow: 0 14px 50px -8px rgba(255, 106, 61, 0.9); transform: translateY(-2px); }
.btn-ghost { --b: rgba(255, 236, 214, 0.25); color: var(--ivory); background: rgba(255, 255, 255, 0.04); backdrop-filter: blur(6px); }
.btn-ghost:hover { --b: var(--amber); transform: translateY(-2px); }

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  width: 26px;
  height: 42px;
  border: 1.5px solid rgba(255, 236, 214, 0.4);
  border-radius: 14px;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--amber);
  translate: -50% 0;
  animation: cue 2s var(--ease-out) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Entrance: words rise in, staggered */
.rise { opacity: 0; transform: translateY(26px); filter: blur(8px); animation: rise 1.1s var(--ease-out) forwards; animation-delay: calc(0.5s + var(--i, 0) * 0.12s); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding-block: clamp(90px, 13vw, 160px); }
.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 500 0.82rem/1 var(--display);
  letter-spacing: 0.12em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.kicker b { font-weight: 700; color: var(--ivory); opacity: 0.5; }
.kicker::after { content: ""; flex: 0 0 60px; height: 1px; background: linear-gradient(90deg, var(--amber), transparent); }
html[dir="rtl"] .kicker::after { background: linear-gradient(270deg, var(--amber), transparent); }
.h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.15;
  margin: 0 0 22px;
  max-width: 820px;
}
html[lang="en"] .h2 { letter-spacing: -0.025em; }
.h2 em { font-style: normal; background: var(--glow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro { font-size: 1.12rem; color: var(--muted); max-width: 700px; margin: 0; }

/* About */
.about { background: linear-gradient(180deg, #0d0a18 0%, var(--night) 40%); }
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: end; }
.legal-name { font-family: var(--display); color: var(--ivory); font-weight: 500; }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pillars li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.pillars li:last-child { border-bottom: 1px solid var(--line); }
.pillars .num { font: 300 1.9rem/1 var(--display); color: var(--amber); }
.pillars h3 { font: 600 1.12rem/1.4 var(--display); margin: 0 0 4px; }
.pillars p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* Activities */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  padding: 34px 30px 32px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), border-color 0.4s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 140, 70, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover { border-color: rgba(255, 181, 71, 0.35); transform: translateY(-6px); }
.card:hover::before { opacity: 1; }
.card .icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 181, 71, 0.1);
  border: 1px solid rgba(255, 181, 71, 0.25);
  color: var(--amber);
  margin-bottom: 26px;
}
.card .icon svg { width: 28px; height: 28px; }
.card h3 { font: 600 1.3rem/1.35 var(--display); margin: 0 0 10px; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.card .tagline { display: block; margin-top: 22px; font: 500 0.8rem/1 var(--display); letter-spacing: 0.06em; color: #ffd9a8; opacity: 0.8; }

/* Platform */
.platform { overflow: hidden; }
.platform::before {
  content: "";
  position: absolute;
  inset: 10% -20% auto auto;
  width: 900px;
  height: 900px;
  background: radial-gradient(closest-side, rgba(232, 67, 107, 0.16), transparent);
  pointer-events: none;
}
.platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 70px); align-items: center; }
.panel {
  position: relative;
  border-radius: 28px;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 213, 138, 0.55), rgba(232, 67, 107, 0.25) 40%, rgba(255, 255, 255, 0.06) 70%);
}
.panel-in { border-radius: 27px; background: linear-gradient(180deg, #12152e, #0b0d1f); padding: clamp(26px, 4vw, 40px); }
.drive-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.drive-row .icon { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: #fff; }
.drive-row .icon svg { width: 28px; height: 28px; }
.drive-row h3 { margin: 0; font: 600 1.2rem/1.35 var(--display); }
.panel p { color: var(--muted); margin: 0 0 14px; font-size: 0.98rem; }
.scope {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  margin: 10px 0;
  font-size: 0.93rem;
}
.scope code { font: 500 0.85rem/1.4 ui-monospace, "Cascadia Code", monospace; color: #ffd9a8; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.scope span { color: var(--muted); }
.check { flex: none; width: 20px; height: 20px; color: #7ee0a6; margin-top: 3px; }
.text-link { color: var(--amber); text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(255, 181, 71, 0.35); transition: border-color 0.2s; }
.text-link:hover { border-color: var(--amber); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.platform .cta-row { justify-content: flex-start; }

/* Contact */
.contact { padding-bottom: 60px; }
.contact-box {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  padding: clamp(40px, 7vw, 90px) clamp(24px, 6vw, 80px);
  background:
    radial-gradient(90% 120% at 50% 120%, rgba(255, 106, 61, 0.55), transparent 60%),
    linear-gradient(180deg, #121633, #0b0d1f);
  border: 1px solid var(--line);
  text-align: center;
}
.contact-box .h2 { margin-inline: auto; }
.contact-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 44px; text-align: start; }
.contact-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(7, 9, 21, 0.55);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
  min-width: 0;
}
.contact-item:hover { border-color: rgba(255, 181, 71, 0.5); transform: translateY(-3px); }
.contact-item svg { flex: none; width: 22px; height: 22px; color: var(--amber); }
.contact-item small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.contact-item strong { display: block; font: 600 1rem/1.4 var(--display); overflow-wrap: anywhere; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 34px 40px; color: var(--muted); font-size: 0.9rem; }
.site-foot .wrap { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { text-decoration: none; transition: color 0.2s; }
.foot-links a:hover { color: var(--amber); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--d, 0) * 110ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Legal pages ---------- */
.legal-page { background: #f7f2ea; color: #1a1726; color-scheme: light; }
.legal-page ::selection { background: #ffb547; color: #1a0b10; }
.legal-hero {
  position: relative;
  overflow: hidden;
  padding: 150px 0 80px;
  color: var(--ivory);
  background:
    radial-gradient(90% 90% at 50% 130%, #ff7a3d 0%, #c8435a 22%, #3b1a3f 50%, transparent 75%),
    linear-gradient(180deg, #05060f, #151033);
}
.legal-hero h1 { font: 800 clamp(2.4rem, 6vw, 4.2rem)/1.1 var(--display); margin: 18px 0 10px; }
html[lang="en"] .legal-hero h1 { letter-spacing: -0.03em; }
.legal-hero p { margin: 0; color: #e6d9e0; }
.legal-body { padding-block: 64px 100px; }
.legal-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: 100px; font-size: 0.9rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-inline-start: 2px solid #e4dbcd; }
.toc a { display: block; padding: 6px 14px; text-decoration: none; color: #5b5568; margin-inline-start: -2px; border-inline-start: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.toc a:hover { color: #c2410c; border-color: #ff6a3d; }
.doc { max-width: 760px; }
.doc h2 { font: 700 1.5rem/1.35 var(--display); margin: 52px 0 14px; scroll-margin-top: 100px; color: #120f1d; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { font: 600 1.12rem/1.4 var(--display); margin: 28px 0 8px; color: #120f1d; }
.doc p, .doc li { color: #3b3647; }
.doc ul { padding-inline-start: 1.3em; }
.doc li { margin-bottom: 8px; }
.doc a { color: #c2410c; font-weight: 600; }
.doc code { font: 500 0.88em ui-monospace, "Cascadia Code", monospace; background: #efe6d8; padding: 2px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
.callout { border-radius: 18px; padding: 22px 24px; background: #fff; border: 1px solid #eadfcf; box-shadow: 0 1px 0 #fff inset, 0 12px 30px -20px rgba(60, 30, 10, 0.35); margin: 22px 0; }
.callout strong { color: #120f1d; }
.callout.key { border-inline-start: 4px solid #ff6a3d; }
.legal-page .site-foot { border-top-color: #e4dbcd; color: #5b5568; }
.legal-page .foot-links a:hover { color: #c2410c; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about-grid, .platform-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .contact-list { grid-template-columns: 1fr; }
  .legal-grid { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .brand { margin-inline-end: auto; }
  .hero-inner { padding-block: 120px 190px; }
  .btn { padding: 15px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .rise, .reveal { opacity: 1; transform: none; filter: none; }
  .trail { display: none; }
}
