@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700&display=swap');

/* ── Saans (brand display) ─────────────────────────────────────────── */
@font-face {
  font-family: 'Saans';
  src: url('/assets/fonts/saans-medium.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Saans';
  src: url('/assets/fonts/saans-semibold.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── typography ────────────────────────────────────────────── */
  --font-display: 'Saans', 'Schibsted Grotesk', sans-serif;
  --font-sans: 'Schibsted Grotesk', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  --font-weight-display: 500;
  --line-height-display: 1.12;
  --tracking-display: -0.02em;
  --font-weight-body: 400;
  --line-height-body: 1.5;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── brand raw palette ─────────────────────────────────────── */
  --stencil-ink: #0c0c0c;
  --stencil-white: #ffffff;
  --stencil-sand: #f4f1ea;
  --stencil-cobalt: #2a53c8;
  --stencil-green: #22301e;
  --stencil-lime: #c6ee5c;
  --stencil-marigold: #eecd5c;
  --stencil-orange: #eb7524;
  --stencil-pink: #f2a7cd;

  /* ── shadcn base tokens ────────────────────────────────────── */
  --background: #ffffff;
  --foreground: #0c0c0c;
  --card: #ffffff;
  --card-foreground: #0c0c0c;
  --popover: #ffffff;
  --popover-foreground: #0c0c0c;
  --primary: #2a53c8;
  --primary-foreground: #ffffff;
  --secondary: #f4f1ea;
  --secondary-foreground: #0c0c0c;
  --muted: #f4f1ea;
  --muted-foreground: #6b6b6b;
  --accent: color-mix(in srgb, var(--stencil-cobalt) 8%, var(--background));
  --accent-foreground: var(--stencil-cobalt);
  --destructive: #cf3d2e;
  --destructive-foreground: #ffffff;
  --border: #e6e1d6;
  --input: #ddd7ca;
  --ring: #2a53c8;
  --success: #1f7a45;
  --warning: #eecd5c;

  /* ── sidebar ───────────────────────────────────────────────── */
  --sidebar: #f4f1ea;
  --sidebar-foreground: #0c0c0c;
  --sidebar-primary: #2a53c8;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: color-mix(in srgb, var(--stencil-cobalt) 10%, var(--sidebar));
  --sidebar-accent-foreground: var(--stencil-cobalt);
  --sidebar-border: color-mix(in srgb, var(--stencil-ink) 9%, var(--sidebar));
  --sidebar-ring: color-mix(in srgb, var(--primary) 45%, var(--sidebar));

  /* ── surface hierarchy ─────────────────────────────────────── */
  --background-secondary: #f7f5ef;
  --surface-hover: color-mix(in srgb, var(--stencil-ink) 4%, var(--background));
  --surface-active: color-mix(in srgb, var(--stencil-ink) 7%, var(--background));
  --surface-elevated: #ffffff;

  /* ── border hierarchy ──────────────────────────────────────── */
  --border-subtle: color-mix(in srgb, var(--stencil-ink) 6%, var(--background));
  --border-muted: color-mix(in srgb, var(--stencil-ink) 10%, var(--background));
  --border-strong: color-mix(in srgb, var(--stencil-ink) 20%, var(--background));

  /* ── text hierarchy ────────────────────────────────────────── */
  --foreground-secondary: #3a3a3a;

  /* ── primary depth ─────────────────────────────────────────── */
  --primary-hover: color-mix(in srgb, var(--primary) 88%, #000000);
  --primary-muted: color-mix(in srgb, var(--primary) 16%, var(--background));
  --primary-soft: color-mix(in srgb, var(--primary) 9%, var(--background));
  --primary-tint: color-mix(in srgb, var(--primary) 5%, var(--background));

  /* ── focus & error ─────────────────────────────────────────── */
  --focus-ring: color-mix(in srgb, var(--primary) 35%, transparent);
  --error: #cf3d2e;
  --error-foreground: #ffffff;

  /* ── radius ────────────────────────────────────────────────── */
  --radius: 0.5rem;
  --radius-none: 0rem;
  --radius-sm: 0.3125rem;
  --radius-lg: 0.625rem;
  --radius-xl: 0.875rem;
  --radius-full: 9999px;

  /* ── shadows (warm-ink cast; flat surfaces, lifted overlays) ─── */
  --shadow-sm: 0 1px 2px 0 rgb(12 12 12 / 0.04);
  --shadow-md: 0 6px 16px -6px rgb(12 12 12 / 0.10), 0 2px 6px -2px rgb(12 12 12 / 0.06);
  --shadow-lg: 0 18px 40px -12px rgb(12 12 12 / 0.16), 0 6px 14px -6px rgb(12 12 12 / 0.10);

  /* ── motion ────────────────────────────────────────────────── */
  --duration-fast: 75ms;
  --duration-normal: 150ms;
  --duration-slow: 250ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ───────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

/* ── Dark theme ──────────────────────────────────────────────────
   Warm charcoal, not pure black — the night-side of the sand palette.
   Cobalt is brightened for contrast; borders/surfaces are mixed from
   sand (light) into the dark base rather than from ink. */
.dark {
  --background: #17150f;
  --foreground: #f2efe6;
  --card: #201d15;
  --card-foreground: #f2efe6;
  --popover: #201d15;
  --popover-foreground: #f2efe6;
  --primary: #6488ee;
  --primary-foreground: #0c0c0c;
  --secondary: #201d15;
  --secondary-foreground: #f2efe6;
  --muted: #201d15;
  --muted-foreground: #948e7e;
  --accent: color-mix(in srgb, var(--primary) 20%, var(--background));
  --accent-foreground: #b6c6f6;
  --destructive: #e2574a;
  --destructive-foreground: #ffffff;
  --border: #322e24;
  --input: #3a352a;
  --ring: #6488ee;
  --success: #45b071;
  --warning: #eecd5c;

  /* ── sidebar ───────────────────────────────────────────────── */
  --sidebar: #131109;
  --sidebar-foreground: #f2efe6;
  --sidebar-primary: #6488ee;
  --sidebar-primary-foreground: #0c0c0c;
  --sidebar-accent: color-mix(in srgb, var(--primary) 18%, var(--sidebar));
  --sidebar-accent-foreground: #b6c6f6;
  --sidebar-border: color-mix(in srgb, var(--stencil-sand) 10%, var(--sidebar));
  --sidebar-ring: color-mix(in srgb, var(--primary) 45%, var(--sidebar));

  /* ── surface hierarchy ─────────────────────────────────────── */
  --background-secondary: #1c1a13;
  --surface-hover: color-mix(in srgb, var(--stencil-sand) 6%, var(--background));
  --surface-active: color-mix(in srgb, var(--stencil-sand) 11%, var(--background));
  --surface-elevated: #262218;

  /* ── border hierarchy (mixed from sand, so lighter than base) ─ */
  --border-subtle: color-mix(in srgb, var(--stencil-sand) 8%, var(--background));
  --border-muted: color-mix(in srgb, var(--stencil-sand) 14%, var(--background));
  --border-strong: color-mix(in srgb, var(--stencil-sand) 28%, var(--background));

  /* ── text hierarchy ────────────────────────────────────────── */
  --foreground-secondary: #cbc6b8;

  /* ── primary depth (hover brightens on dark) ───────────────── */
  --primary-hover: color-mix(in srgb, var(--primary) 82%, #ffffff);
  --primary-muted: color-mix(in srgb, var(--primary) 22%, var(--background));
  --primary-soft: color-mix(in srgb, var(--primary) 13%, var(--background));
  --primary-tint: color-mix(in srgb, var(--primary) 7%, var(--background));

  /* ── focus & error ─────────────────────────────────────────── */
  --focus-ring: color-mix(in srgb, var(--primary) 45%, transparent);
  --error: #e2574a;
  --error-foreground: #ffffff;

  /* ── shadows (deeper on dark surfaces) ─────────────────────── */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.40);
  --shadow-md: 0 6px 16px -6px rgb(0 0 0 / 0.55), 0 2px 6px -2px rgb(0 0 0 / 0.45);
  --shadow-lg: 0 20px 44px -12px rgb(0 0 0 / 0.65), 0 6px 14px -6px rgb(0 0 0 / 0.50);
}
