/* ============================================================
   Next Core Labs — Colors & Type
   Dark-mode-first foundations. Import this file as the base
   for any prototype, slide, or production build.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-ThinItalic.ttf") format("truetype");
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-ExtraLightItalic.ttf") format("truetype");
  font-weight: 200;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-LightItalic.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-SemiBoldItalic.ttf") format("truetype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-ExtraBoldItalic.ttf") format("truetype");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Neutiva";
  src: url("./fonts/Neutiva-BlackItalic.ttf") format("truetype");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ---------- Brand colors (from identity guide) ---------- */
  --core-purple:   #5b21b6;   /* PANTONE 14-0827 TCX — the load-bearing brand color */
  --next-violet:   #915cf3;   /* lighter accent, used for hover, highlights, gradient terminus */
  --cloud-gray:    #ececec;   /* off-white tint, used on dark grounds as a soft white */
  --carbon-black:  #000000;   /* deep ground, body of dark mode */
  --pure-white:    #ffffff;

  /* ---------- Purple ramp (derived from the two brand purples) ---------- */
  --purple-50:  #f3eefd;
  --purple-100: #e4d8fb;
  --purple-200: #c8b1f7;
  --purple-300: #ac8af3;
  --purple-400: #915cf3;   /* Next Violet */
  --purple-500: #7b3cea;
  --purple-600: #5b21b6;   /* Core Purple — primary action */
  --purple-700: #4a1a96;
  --purple-800: #381472;
  --purple-900: #260d4f;
  --purple-950: #14062a;

  /* ---------- Neutral ramp (warm-leaning so it sits with the purple) ---------- */
  --neutral-0:    #000000;
  --neutral-50:   #0a0712;
  --neutral-100:  #110b1c;
  --neutral-200:  #1a1226;
  --neutral-300:  #251a36;
  --neutral-400:  #3a2b4f;
  --neutral-500:  #6b5b85;
  --neutral-600:  #9d8fb5;
  --neutral-700:  #c4bbd4;
  --neutral-800:  #e0dae8;
  --neutral-900:  #ececec;   /* Cloud Gray */
  --neutral-1000: #ffffff;

  /* ---------- Semantic surfaces (DARK MODE — the default for Next Core) ---------- */
  --bg:           var(--neutral-50);    /* page ground */
  --bg-elevated:  var(--neutral-100);   /* cards, modals */
  --bg-raised:    var(--neutral-200);   /* nested surfaces */
  --bg-sunken:    var(--neutral-0);     /* full-bleed sections */
  --bg-brand:     var(--core-purple);   /* full-bleed purple sections */
  --bg-brand-soft: rgba(91, 33, 182, 0.12);

  /* ---------- Foregrounds ---------- */
  --fg:        var(--neutral-900);  /* primary text on dark */
  --fg-strong: var(--neutral-1000); /* headings, emphasis */
  --fg-muted:  var(--neutral-700);  /* secondary text */
  --fg-dim:    var(--neutral-600);  /* tertiary, captions, metadata */
  --fg-faint:  var(--neutral-500);  /* hairline, placeholder */
  --fg-on-brand: var(--neutral-1000);

  /* ---------- Borders / lines ---------- */
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-brand:  rgba(145, 92, 243, 0.35);

  /* ---------- Action / interactive ---------- */
  --action:           var(--purple-600);
  --action-hover:     var(--purple-500);
  --action-pressed:   var(--purple-700);
  --action-fg:        var(--neutral-1000);
  --action-soft:      rgba(91, 33, 182, 0.18);
  --action-soft-hover:rgba(91, 33, 182, 0.28);
  --focus-ring:       rgba(145, 92, 243, 0.55);

  /* ---------- Semantic feedback (used sparingly) ---------- */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    var(--next-violet);

  /* ---------- Signature gradients ---------- */
  --grad-brand:        linear-gradient(135deg, var(--purple-600) 0%, var(--purple-400) 100%);
  --grad-brand-deep:   linear-gradient(135deg, #14062a 0%, var(--purple-600) 60%, var(--purple-400) 100%);
  --grad-hero:         radial-gradient(120% 80% at 20% 0%, rgba(145, 92, 243, 0.35) 0%, transparent 55%),
                       radial-gradient(80% 60% at 90% 100%, rgba(91, 33, 182, 0.45) 0%, transparent 60%),
                       var(--neutral-50);
  --grad-mark-aura:    radial-gradient(60% 60% at 50% 50%, rgba(145, 92, 243, 0.45), transparent 70%);

  /* ---------- Radii ---------- */
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --radius-pill: 999px;

  /* ---------- Spacing scale (4px base) ---------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* ---------- Shadows (dark-mode-tuned; very subtle) ---------- */
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55), 0 8px 16px rgba(0, 0, 0, 0.35);
  --shadow-brand: 0 14px 40px rgba(91, 33, 182, 0.45);
  --shadow-brand-glow: 0 0 0 1px rgba(145, 92, 243, 0.35), 0 12px 32px rgba(91, 33, 182, 0.4);

  /* ---------- Motion ---------- */
  --ease-out:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-instant:   80ms;
  --dur-fast:      150ms;
  --dur-base:      240ms;
  --dur-slow:      420ms;
  --dur-slower:    700ms;

  /* ---------- Typography — families ---------- */
  --font-sans:    "Neutiva", "Inter", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-arabic:  "Neutiva", "IBM Plex Sans Arabic", "Noto Sans Arabic", "Tajawal", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* ---------- Typography — type scale (mobile-first; clamp to scale up) ---------- */
  --fz-12: 12px;
  --fz-13: 13px;
  --fz-14: 14px;
  --fz-15: 15px;
  --fz-16: 16px;
  --fz-18: 18px;
  --fz-20: 20px;
  --fz-24: 24px;
  --fz-28: 28px;
  --fz-32: 32px;
  --fz-40: 40px;
  --fz-48: 48px;
  --fz-56: 56px;
  --fz-64: 64px;
  --fz-72: 72px;
  --fz-96: 96px;

  --lh-tight:  1.05;
  --lh-snug:   1.18;
  --lh-base:   1.45;
  --lh-relaxed:1.65;

  --tracking-tighter: -0.03em;
  --tracking-tight:   -0.015em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-wider:   0.12em;

  --fw-thin: 100;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 900;

  /* ---------- Semantic type roles ---------- */
  /* display: used once per page, hero only */
  --display-size: clamp(48px, 9vw, 96px);
  --display-weight: var(--fw-bold);
  --display-lh: var(--lh-tight);
  --display-tracking: var(--tracking-tighter);

  /* h1 — page title */
  --h1-size: clamp(36px, 5.5vw, 64px);
  --h1-weight: var(--fw-bold);
  --h1-lh: var(--lh-tight);
  --h1-tracking: var(--tracking-tight);

  /* h2 — section title */
  --h2-size: clamp(28px, 4vw, 48px);
  --h2-weight: var(--fw-semibold);
  --h2-lh: var(--lh-snug);
  --h2-tracking: var(--tracking-tight);

  /* h3 — subsection */
  --h3-size: clamp(22px, 2.5vw, 32px);
  --h3-weight: var(--fw-semibold);
  --h3-lh: var(--lh-snug);
  --h3-tracking: var(--tracking-tight);

  /* h4 — card title */
  --h4-size: 20px;
  --h4-weight: var(--fw-medium);
  --h4-lh: var(--lh-snug);

  /* body */
  --body-size: var(--fz-16);
  --body-weight: var(--fw-regular);
  --body-lh: var(--lh-relaxed);

  --body-lg-size: var(--fz-18);
  --body-lg-lh: var(--lh-relaxed);

  --body-sm-size: var(--fz-14);
  --body-sm-lh: var(--lh-base);

  /* eyebrow / kicker — used above section titles, ALL CAPS */
  --eyebrow-size: var(--fz-13);
  --eyebrow-weight: var(--fw-medium);
  --eyebrow-tracking: var(--tracking-wider);
  --eyebrow-transform: uppercase;

  /* mono / code */
  --code-size: var(--fz-14);
  --code-weight: var(--fw-regular);
}

/* ============================================================
   Base resets & semantic element styles
   ============================================================ */

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[dir="rtl"] body, .rtl {
  font-family: var(--font-arabic);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--fg-strong);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--h1-size);
  font-weight: var(--h1-weight);
  line-height: var(--h1-lh);
  letter-spacing: var(--h1-tracking);
}
h2 {
  font-size: var(--h2-size);
  font-weight: var(--h2-weight);
  line-height: var(--h2-lh);
  letter-spacing: var(--h2-tracking);
}
h3 {
  font-size: var(--h3-size);
  font-weight: var(--h3-weight);
  line-height: var(--h3-lh);
  letter-spacing: var(--h3-tracking);
}
h4 {
  font-size: var(--h4-size);
  font-weight: var(--h4-weight);
  line-height: var(--h4-lh);
}

p { margin: 0; text-wrap: pretty; }

.display {
  font-size: var(--display-size);
  font-weight: var(--display-weight);
  line-height: var(--display-lh);
  letter-spacing: var(--display-tracking);
  color: var(--fg-strong);
}

.eyebrow {
  font-size: var(--eyebrow-size);
  font-weight: var(--eyebrow-weight);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: var(--eyebrow-transform);
  color: var(--purple-400);
}

.muted   { color: var(--fg-muted); }
.dim     { color: var(--fg-dim); }
.faint   { color: var(--fg-faint); }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: var(--code-size);
}

::selection {
  background: var(--purple-600);
  color: var(--neutral-1000);
}

/* Brand text gradient — use sparingly, on key headlines only */
.text-gradient-brand {
  background: linear-gradient(90deg, var(--purple-400) 0%, var(--neutral-1000) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
