/* ==========================================================================
   Capla Cloud tokens — the portal's own layer over the intranet's tokens.

   The colours, grounds, shadows, the surface radius and the motion curve are
   the intranet's, copied into capla-tokens.css by scripts/design-tokens.mjs
   (CaplaIntranet docs/design-system.md → "Using it in another portal"). They
   are HSL triplets, written the way the intranet writes them:

     color: hsl(var(--primary));               a token
     background: hsl(var(--primary) / 0.1);    the same token as a 10 % tint

   This file adds what a no-build portal needs on top: the three typefaces,
   the type, spacing and duration scales, the field radius, and the old names
   earlier Connect stylesheets still use, each pointed at an intranet token so
   they follow light and dark.
   ========================================================================== */

/* ---------- Typefaces: vendored, never fetched (SIL Open Font License) ---------- */
@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---------- Type ---------- */
  --font-display: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --font-size:           16px;
  --text-xs:             0.75rem;
  --text-sm:             0.875rem;
  --text-body:           0.9375rem;   /* 15px: body and controls, as in the intranet */
  --text-base:           1rem;
  --text-lg:             1.125rem;
  --text-xl:             1.25rem;
  --text-2xl:            1.5rem;
  --text-3xl:            1.875rem;
  --text-4xl:            2.25rem;
  --text-5xl:            3rem;
  --text-6xl:            3.75rem;
  --text-7xl:            4.5rem;

  --leading-tight:       1.25;
  --leading-snug:        1.375;
  --leading-normal:      1.5;
  --leading-relaxed:     1.625;

  --tracking-tight:      -0.025em;
  --tracking-normal:     0;
  --tracking-wider:      0.05em;
  --tracking-widest:     0.1em;
  --tracking-eyebrow:    0.16em;

  --weight-normal:       400;
  --weight-medium:       500;
  --weight-semibold:     600;
  --weight-bold:         700;
  --weight-extrabold:    800;

  /* ---------- Spacing & sizing ---------- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --container-sm:   24rem;
  --container-md:   28rem;
  --container-lg:   32rem;
  --container-2xl:  42rem;
  --container-4xl:  56rem;
  --container-7xl:  80rem;

  /* The shell (layout.css): the rail beside the page and the bar above it. */
  --rail-width:            252px;
  --rail-width-collapsed:  68px;
  --bar-height:            4rem;
  --ink-rail:              hsl(217 72% 7%);
  --ink-bar:               hsl(217 72% 9%);

  /* ---------- Radius ----------
     --radius (22 px) is the intranet's surface corner, from capla-tokens.css.
     Fields are 12 px (rounded-xl there), buttons and pills are capsules, a
     notice inside a card is 2 px under the surface. The small steps stay for
     chips and marks inside a surface. */
  --radius-field: 0.75rem;
  --radius-notice: calc(var(--radius) - 2px);
  --radius-xs:  0.125rem;
  --radius-sm:  0.375rem;
  --radius-md:  0.5rem;
  --radius-lg:  0.75rem;
  --radius-2xl: var(--radius);
  --radius-3xl: var(--radius);
  --radius-full: 9999px;

  /* ---------- Elevation: the intranet's scale, wide and blue-black ---------- */
  --shadow-sm:  0 8px 24px rgba(7, 34, 61, 0.05);
  --shadow:     var(--shadow-light-card);
  --shadow-lg:  var(--shadow-light-card-hover);
  --shadow-xl:  0 30px 80px rgba(1, 10, 24, 0.34);

  /* ---------- Motion: one curve ---------- */
  --ease:        var(--ease-capla);
  --ease-out:    var(--ease-capla);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   120ms;
  --duration:        200ms;
  --duration-slow:   320ms;

  /* ---------- Earlier names, now pointing at the intranet's tokens ----------
     Kept so page stylesheets written for the dark-only portal still resolve.
     New CSS uses the tokens themselves. */
  --capla-brand-gradient: linear-gradient(90deg, hsl(var(--brand-from)), hsl(var(--brand-mid)) 55%, hsl(var(--brand-to)));
  --capla-cyan-accent:   hsl(var(--primary));
  --capla-blue-400:      hsl(var(--primary));
  --capla-blue-500:      hsl(var(--primary));
  --capla-blue-600:      hsl(var(--primary));
  --capla-blue-700:      hsl(var(--primary));
  --capla-medium-blue:   hsl(var(--primary));
  --capla-teal-accent:   hsl(var(--primary));
  --capla-navy:          hsl(var(--secondary-foreground));
  --capla-fg:            hsl(var(--foreground));
  --capla-fg-muted:      hsl(var(--muted-foreground));
  --capla-fg-dim:        hsl(var(--muted-foreground));
  --capla-bg-0:          hsl(var(--background));
  --capla-bg-1:          hsl(var(--background));
  --capla-bg-2:          hsl(var(--muted));
  --capla-bg-3:          hsl(var(--card));
  --capla-bg-4:          hsl(var(--secondary));
  --capla-border:        hsl(var(--border));
  --capla-danger:        hsl(var(--destructive));
  --danger:              hsl(var(--destructive));
  --shadow-glow-cyan:    var(--shadow-light-card-hover);
  --shadow-glow-blue:    var(--shadow-light-card-hover);
}
