/* ==========================================================
   Muhammed Dervis: shared tokens, type and animation system
   Used by the presentation (index.html) and the profile (profile.html)
   ========================================================== */
@import url("fonts.css");

:root {
  --bg: #080d1c;
  --bg-2: #0d1530;
  --card: #111b3a;
  --card-2: #16224a;
  --line: #263463;
  --text: #edf2ff;
  --muted: #94a3c9;
  --cyan: #18bfff;
  --green: #2ee6a6;
  --magenta: #ff4fd8;
  --violet: #8b6cff;
  --amber: #ffc24b;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --body: "Readex Pro", system-ui, sans-serif;
  --display: "Alexandria", "Readex Pro", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

/* English terms inside Arabic text */
.en {
  font-family: "Readex Pro", sans-serif;
  direction: ltr;
  unicode-bidi: isolate;
  letter-spacing: 0;
}

.c-cyan { color: var(--cyan); }
.c-green { color: var(--green); }
.c-magenta { color: var(--magenta); }
.c-violet { color: var(--violet); }
.c-amber { color: var(--amber); }
.c-muted { color: var(--muted); }

/* ---------- SVG helpers ---------- */
svg text { font-family: var(--body); }
.svg-label { fill: var(--text); font-size: 22px; font-weight: 500; }
.svg-small { fill: var(--muted); font-size: 17px; }

/* Every animated SVG part transforms around its own box */
.pop, .growx, .growy, .spin, .ripple { transform-box: fill-box; }

/* ==========================================================
   Animation library
   Elements start hidden and play when their slide becomes
   .active. Stagger with style="--d:.3s".
   ========================================================== */

/* draw: a stroke draws itself. Paths carry pathLength="1" */
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.active .draw { animation: draw 1.1s var(--ease) var(--d, 0s) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* growx: a bar grows along its width (from the right, RTL) */
.growx { transform: scaleX(0); transform-origin: right center; }
.growx.from-left { transform-origin: left center; }
.active .growx { animation: growx .9s var(--ease) var(--d, 0s) forwards; }
@keyframes growx { to { transform: scaleX(1); } }

/* growy: same idea, vertical */
.growy { transform: scaleY(0); transform-origin: center bottom; }
.active .growy { animation: growy .9s var(--ease) var(--d, 0s) forwards; }
@keyframes growy { to { transform: scaleY(1); } }

/* pop: appears with a small bounce */
.pop { opacity: 0; transform-origin: center; }
.active .pop { animation: pop .6s var(--ease) var(--d, 0s) forwards; }
@keyframes pop {
  0% { opacity: 0; transform: scale(.6); }
  70% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

/* fade and up */
.fade { opacity: 0; }
.active .fade { animation: fade .8s ease var(--d, 0s) forwards; }
@keyframes fade { to { opacity: 1; } }

.up { opacity: 0; transform: translateY(26px); }
.active .up { animation: up .8s var(--ease) var(--d, 0s) forwards; }
@keyframes up { to { opacity: 1; transform: none; } }

/* flow: data moving along a line, runs forever */
.flow { stroke-dasharray: 4 14; animation: flow 1.1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -18; } }

/* ripple: pulse around a point */
.ripple { transform-origin: center; animation: ripple 2.4s ease-out var(--d, 0s) infinite; opacity: 0; }
@keyframes ripple {
  0% { transform: scale(.5); opacity: .8; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* spin */
.spin { transform-origin: center; animation: spin 18s linear infinite; }
.spin.fast { animation-duration: 8s; }
.spin.rev { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================
   Static mode: print, PDF export, and reduced motion.
   Everything shows in its final state.
   ========================================================== */
.static .draw { stroke-dashoffset: 0; animation: none !important; }
.static .growx, .static .growy { transform: none; animation: none !important; }
.static .pop, .static .fade, .static .up { opacity: 1; transform: none; animation: none !important; }
.static .ripple { display: none; }
.static .spin { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .draw { stroke-dashoffset: 0; animation: none !important; }
  .growx, .growy { transform: none; animation: none !important; }
  .pop, .fade, .up { opacity: 1; transform: none; animation: none !important; }
  .flow, .ripple, .spin { animation: none !important; }
}
