/*
  Veil Docs Portal — design tokens.
  Palette sourced verbatim from ../img/veil_logo_en.svg (verified against the file, not
  eyeballed from a screenshot — see CLAUDE.md's "Brand Reference"). Hand-written, no
  utility-CSS framework, matching Veil Analytics' own frontend convention.
*/

:root {
  /* ---- Brand palette (exact hex from the logo SVG) ---- */
  --brand-900: #085041; /* darkest — wordmark, gradient shadow end */
  --brand-600: #1D9E75; /* "ANALYTICS" label, accent rules, gradient */
  --brand-400: #5DCAA5; /* gradient highlight */
  --brand-200: #9FE1CB; /* lightest — translucent panel, thin accent lines */
  --brand-tagline: #0F6E56;

  /* ---- Light theme (default) ---- */
  --color-bg: #FFFFFF;
  --color-bg-subtle: #F6F8F7;
  --color-surface: #FFFFFF;
  --color-surface-raised: #FFFFFF;
  --color-border: #E1E7E4;
  --color-border-strong: #C7D2CD;
  --color-text: #10201B;
  --color-text-secondary: #3E5A51;
  --color-text-muted: #6B8079;
  --color-accent: var(--brand-600);
  --color-accent-hover: var(--brand-900);
  --color-accent-subtle: #E7F6EF;
  --color-on-accent: #FFFFFF;
  --color-link: var(--brand-600);
  --color-link-hover: var(--brand-900);
  --color-focus-ring: var(--brand-400);
  --color-success: #1D9E75;
  --color-warning: #B7791F;
  --color-danger: #C0392B;
  --color-code-bg: #F1F4F2;
  --color-shadow: rgba(8, 80, 65, 0.10);

  /* ---- Spacing scale (rem, 4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* ---- Type scale — fluid, mobile-first via clamp() ---- */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-family-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;

  --font-size-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --font-size-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --font-size-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --font-size-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  --font-size-3xl: clamp(1.875rem, 1.5rem + 1.8vw, 2.5rem);
  --font-size-4xl: clamp(2.25rem, 1.7rem + 2.7vw, 3.25rem);

  --line-height-tight: 1.2;
  --line-height-base: 1.6;
  --line-height-loose: 1.8;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* ---- Radius / motion ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-full: 999px;
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;

  /* ---- Layout ---- */
  --content-max-width: 72rem;
  --prose-max-width: 42rem;
}

/*
  Breakpoints — documented here as the single source of truth, but CSS custom properties
  cannot be referenced inside @media conditions, so component CSS repeats these literal
  values directly in its own @media queries:
    --breakpoint-sm: 640px   (large phones landscape)
    --breakpoint-md: 768px   (tablets)
    --breakpoint-lg: 1024px  (small desktops / nav switches to full header)
    --breakpoint-xl: 1280px  (wide desktops)
*/

/* ---- Dark theme — system preference only for v1, no manual toggle yet ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0B1512;
    --color-bg-subtle: #0F1D19;
    --color-surface: #12211C;
    --color-surface-raised: #16281F;
    --color-border: #223A32;
    --color-border-strong: #2E4E43;
    --color-text: #EAF3F0;
    --color-text-secondary: #B7CBC3;
    --color-text-muted: #85A398;
    --color-accent: var(--brand-400);
    --color-accent-hover: var(--brand-200);
    --color-accent-subtle: #16342A;
    --color-on-accent: #06140F;
    --color-link: var(--brand-400);
    --color-link-hover: var(--brand-200);
    --color-focus-ring: var(--brand-400);
    --color-code-bg: #16281F;
    --color-shadow: rgba(0, 0, 0, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-link);
}

a:hover {
  color: var(--color-link-hover);
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

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

img {
  max-width: 100%;
  height: auto;
}
