/* Daydan design system (D35 brand: blues and white only; nothing borrowed from WhatsApp).
   Shared by the landing page (site/index.html) and the dashboard prototype (site/demo/). */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Tajawal:wght@800&display=swap");

:root {
  /* Colour: one navy family + neutrals; amber and red only carry meaning (attention, danger). */
  --ink: #0b1f33;
  --ink-2: #33475b;
  --ink-3: #5b6b7c;
  --navy: #0c447c;
  --navy-2: #185fa5;
  --blue: #378add;
  --sky: #85b7eb;
  --mist: #e8f1fb;
  --mist-2: #f3f7fc;
  --paper: #fbfcfe;
  --white: #ffffff;
  --line: #dce6f2;
  --line-2: #c6d6e8;
  --ok: #0f6e56;
  --ok-bg: #e3f4ee;
  --attn: #9a5b12;
  --attn-bg: #fbf0df;
  --danger: #a32d2d;
  --danger-bg: #fcebeb;

  /* Type */
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-logo: "Tajawal", var(--font);
  --fs-xs: 0.8125rem;   /* 13 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-md: 1rem;        /* 16 */
  --fs-lg: 1.125rem;    /* 18 */
  --fs-xl: 1.375rem;    /* 22 */
  --fs-2xl: 1.75rem;    /* 28 */
  --fs-3xl: clamp(2rem, 1.2rem + 3vw, 3.25rem);
  --lh: 1.75;
  --lh-tight: 1.3;

  /* Space (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* Shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(11, 31, 51, 0.06), 0 1px 1px rgba(11, 31, 51, 0.04);
  --shadow-2: 0 12px 32px -12px rgba(12, 68, 124, 0.22), 0 2px 6px rgba(11, 31, 51, 0.06);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms;
  --t-med: 320ms;
  --t-slow: 700ms;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: var(--lh); font-size: var(--fs-md); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

.logo { font-family: var(--font-logo); font-weight: 800; letter-spacing: 0; line-height: 1; color: var(--navy); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5); border-radius: var(--r-pill); border: 1px solid transparent; font-weight: 600; font-size: var(--fs-md); text-decoration: none; cursor: pointer; transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--navy-2); background: var(--mist-2); }

/* Chips and pills */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--white); font-size: var(--fs-sm); color: var(--ink-2); }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-attn { background: var(--attn-bg); color: var(--attn); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-info { background: var(--mist); color: var(--navy); }

/* Conversation bubbles (brand-coloured, not WhatsApp's) */
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: var(--fs-sm); line-height: 1.7; box-shadow: var(--shadow-1); }
.bubble-in { background: var(--white); color: var(--ink); border-top-right-radius: 4px; margin-left: auto; }
.bubble-out { background: var(--navy); color: var(--white); border-top-left-radius: 4px; margin-right: auto; }
.bubble-meta { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.reply-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reply-btns span { padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--mist-2); color: var(--navy); font-size: var(--fs-xs); font-weight: 600; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--white); border-radius: 16px; border-top-right-radius: 4px; box-shadow: var(--shadow-1); margin-left: auto; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--sky); animation: dd-typing 1s infinite var(--ease); }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dd-typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Reveal on scroll (set .reveal; JS adds .is-in) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
