/* =====================================================================
   QdesignSkill — base: theme-independent scales + base layer
   Load order:  base.css → flavor-orbit.css | flavor-ghaf.css → components.css
   The flavour file supplies every colour token (light + dark) and may override the
   type, display-voice and layout defaults below.
   ===================================================================== */
/* Wrapped in a cascade layer so Tailwind utilities and your own unlayered CSS win over the kit. */
@layer base {


/* ---- Theme-independent scales ---- */
:root {
  /* Type: a serif display face for moments, a geometric/grotesk sans for UI, mono for keys & IDs.
     Arabic gets its own face; it never inherits Latin tracking. */
  --type-sans: "Geist", "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --type-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --type-mono: "Geist Mono", ui-monospace, "Cascadia Mono", "IBM Plex Sans Arabic", monospace;
  --type-ar: "IBM Plex Sans Arabic", "Geist", system-ui, sans-serif;

  /* Display voice (flavours override): editorial = serif 400 + italic gradient phrase;
     confident = sans 800, tracking -0.035em, upright gradient. */
  --display-weight: 400;
  --display-tracking: -0.02em;
  --display-leading: 0.96;
  --grad-text-style: italic;

  /* Radius: one ascending scale. Controls 6–12, cards 16–20, heroes/sheets 24–28. */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing: 4px grid. Card padding 20, page gutter 28–32 (16 on phones), grid gap 18. */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-7: 28px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;

  /* Motion: ease-out for everything that arrives; durations scale with distance travelled. */
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-ease-in: cubic-bezier(0.55, 0, 0.75, 0);   /* leaving only */
  --dur-1: 120ms;   /* tooltips, pressed state */
  --dur-2: 180ms;   /* hovers, menus, colour */
  --dur-3: 250ms;   /* cards lifting, dialogs */
  --dur-4: 400ms;   /* drawers, view enter */
  --dur-5: 900ms;   /* accent cross-fades, meters filling */

  /* Layout */
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --page-max: 1400px;      /* every header and standard page */
  --page-max-wide: 1800px; /* boards, timelines */
  --read-max: 760px;       /* prose, page subtitles */

  /* Layers */
  --z-sticky: 30; --z-sidebar: 40; --z-popover: 60; --z-scrim: 90; --z-modal: 91; --z-toast: 120; --z-tip: 130;
}

/* Registered colour so the section accent cross-fades between areas. */
@property --area-accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #7b6bff;
}

/* =====================================================================
   Base layer
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; border-color: var(--line); }
[hidden] { display: none !important; }   /* components set display; `hidden` must still win */
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--type-sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg);
  /* Fixed-size glows: percentage sizes stretch into streaks on narrow screens. */
  background:
    radial-gradient(var(--aurora-1-size, 680px 520px) at var(--aurora-1-at, 12% -8%), var(--aurora-1), transparent 70%),
    radial-gradient(var(--aurora-2-size, 620px 480px) at var(--aurora-2-at, 92% -6%), var(--aurora-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
/* Phones and touch devices: a fixed background repaints on every scroll; let it scroll. Opt out of grain with --grain: 0. */
@media (max-width: 760px), (pointer: coarse) { body { background-attachment: scroll; } }
/* Film grain: the texture that stops flat colour looking digital. */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 200;
  opacity: var(--grain); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[lang="ar"] body { font-family: var(--type-ar); font-size: 15px; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
html[lang="ar"] :is(h1, h2, h3, h4) { letter-spacing: 0; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* The one focus indicator, for every control. */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--brand-glow); }

/* Lucide (or any stroke icon set) at a light, consistent stroke. */
svg.lucide { stroke-width: 1.5; flex: none; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Motion is opt-out: frozen, not fast-forwarded. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Print: light ink on white in either theme, no glass, glow or grain. */
@media print {
  :root, [data-theme] {
    color-scheme: light;
    --bg: #ffffff; --surface: #ffffff; --surface-2: #f6f4ee; --surface-solid: #ffffff; --glass: #ffffff;
    --fg: #16161d; --fg-muted: #4f4f5a; --fg-faint: #6f6c78; --line: #e4ded0;
    --elev-sm: none; --elev-md: none; --elev-lg: none; --elev-xl: none;
  }
  body { background: #fff !important; }
  body::after { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; backdrop-filter: none !important; }
}

} /* @layer base */
