/* Échelle globale de l'interface (essai staging : -20 %) */
html { zoom: .8; }

:root {
  color-scheme: light dark;

  /* UX lot 5: this file is the only source of colours, radii, shadows and type sizes.
     Spacing stays on the --kor-space-* scale below. Dark mode redefines the --f41-* set only. */
  --f41-ink: #142b45;
  --f41-ink-2: #334155;
  --f41-muted: #475569;
  --f41-bg: #f7f9fc;
  --f41-surface: #ffffff;
  --f41-surface-soft: #f3f7fc;
  --f41-media-bg: #eef3f8;
  --f41-media-ink: #475569;
  --f41-frame: #ffffff;
  --f41-line: #e2e8f0;
  --f41-control: #64748b;
  --f41-primary: #1d5db6;
  --f41-primary-strong: #174e99;
  --f41-action: #1d5db6;
  --f41-on-primary: #ffffff;
  --f41-tint: #e4f0fa;
  --f41-keep: #0f766e;
  --f41-keep-bg: #e7f5f1;
  --f41-replace: #a9580e;
  --f41-replace-bg: #fff3e5;
  --f41-replace-ink: #5b3a12;
  --f41-replace-line: #f1d9bd;
  --f41-check-bg: #f1f5f9;
  /* Visual polish: neutral information and caution are distinct from the "replace" verdict colour. */
  --f41-info-bg: #eaf2fc;
  --f41-info-line: #bcd3f2;
  --f41-info-ink: #142b45;
  --f41-caution-bg: #fdf6e3;
  --f41-caution-line: #ead49a;
  --f41-caution-ink: #6b4a06;
  --f41-control-line: #778599;
  --f41-primary-hover: #174e99;
  --f41-surface-raised: #ffffff;
  --f41-line-strong: #cbd5e1;
  --f41-focus: #174e99;
  --f41-footer-bg: #142b45;
  --f41-footer-ink: #ffffff;
  --f41-footer-muted: #e2e8f0;
  --f41-support: #1d5db6;
  --f41-repair: #0f766e;
  --f41-durability: #0a6c96;
  --f41-specs: #5b6b86;
  --f41-veil: #f7f9fcf2;
  --f41-shadow-sm: 0 1px 2px #142b4510;
  --f41-shadow-card: 0 8px 28px -8px #142b4511;
  --f41-shadow-lift: 0 8px 24px #142b4514;
  --f41-shadow-pop: 0 12px 32px #142b4524;

  --f41-r-xs: 4px;
  --f41-r-sm: 8px;
  --f41-r-md: 12px;
  --f41-r-lg: 16px;
  --f41-r-xl: 24px;
  --f41-r-pill: 999px;

  /* Seven text sizes. */
  --f41-fs-xs: .75rem;
  --f41-fs-sm: .875rem;
  --f41-fs-base: 1rem;
  --f41-fs-lg: 1.125rem;
  --f41-fs-xl: 1.375rem;
  --f41-fs-2xl: clamp(1.75rem, 3vw, 2.25rem);
  --f41-fs-3xl: clamp(2.5rem, 5vw, 3.75rem);

  /* Legacy names kept as aliases so older markup keeps working. */
  --color-text: var(--f41-ink);
  --color-primary: var(--f41-primary);
  --color-text-muted: var(--f41-muted);
  --color-brand-dark: var(--f41-footer-bg);
  --color-background: var(--f41-bg);
  --color-surface: var(--f41-surface);
  --color-border: var(--f41-line);
  --color-keep: var(--f41-keep);
  --color-keep-bg: var(--f41-keep-bg);
  --color-replace: var(--f41-replace);
  --color-replace-bg: var(--f41-replace-bg);
  --color-check: var(--f41-muted);
  --color-check-bg: var(--f41-check-bg);
  --color-focus: var(--f41-focus);

  --kor-space-0: 0px;
  --kor-space-4: 4px;
  --kor-space-6: 6px;
  --kor-space-8: 8px;
  --kor-space-10: 10px;
  --kor-space-12: 12px;
  --kor-space-14: 14px;
  --kor-space-16: 16px;
  --kor-space-20: 20px;
  --kor-space-24: 24px;
  --kor-space-28: 28px;
  --kor-space-32: 32px;
  --kor-space-36: 36px;
  --kor-space-38: 38px;
  --kor-space-40: 40px;
  --kor-space-44: 44px;
  --kor-space-48: 48px;
  --kor-space-56: 56px;
  --kor-space-64: 64px;
  --kor-space-72: 72px;

  --kor-radius-0: 0px;
  --kor-radius-4: var(--f41-r-xs);
  --kor-radius-12: var(--f41-r-md);
  --kor-radius-16: var(--f41-r-lg);
  --kor-radius-20: 20px; /* Figma token, unused by the shared 4-step radius scale */
  --kor-radius-24: var(--f41-r-xl);
  --kor-radius-999: var(--f41-r-pill);

  --kor-text-eyebrow: 600 var(--f41-fs-xs)/18px Inter, sans-serif;
  --kor-text-label: 600 var(--f41-fs-sm)/20px Inter, sans-serif;
  --kor-text-small: 400 var(--f41-fs-sm)/21px Inter, sans-serif;
  --kor-text-body: 400 var(--f41-fs-base)/25px Inter, sans-serif;
  --kor-text-body-large: 400 var(--f41-fs-lg)/30px Inter, sans-serif;
  --kor-text-h1: 700 var(--f41-fs-3xl)/1.08 Inter, sans-serif;
  --kor-text-h2: 700 var(--f41-fs-2xl)/1.25 Inter, sans-serif;
  --kor-text-h3: 600 var(--f41-fs-xl)/30px Inter, sans-serif;
  --kor-shadow-card-soft: var(--f41-shadow-card);

  --kor-container-max: 1296px;
  --kor-page-max: 1440px;
  --kor-header-height: 96px;
  --kor-nav-height: 54px;
  --kor-mobile-gutter: 16px;
  --kor-grid-gap: 24px;
  --kor-header-gap: 32px;
  --kor-footer-gap: 40px;
  --kor-icon-size: 18px;
  --kor-border-width: 1px;
  --kor-focus-width: 3px;
  --kor-width-context-menu: 240px;
  --kor-width-mobile-menu: 208px;
  --kor-width-mobile-context: 100px;
  --kor-width-confidence: 72px;
  --kor-width-confidence-bar: 20px;
  --kor-brand-name-width: 300px;
  --kor-footer-min-height: 148px;
  --kor-body-line-height: 1.55;
  --kor-brand-letter-spacing: .08em;
  --kor-brand-line-height: 1.1;
  --kor-brand-name-size: 25px;
  --kor-brand-name-size-mobile: 20px;
  --kor-search-icon-size: 20px;
  --kor-header-brand-width: 300px;
  --kor-header-search-width: 298px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --f41-ink: #e6edf6;
    --f41-ink-2: #cbd5e1;
    --f41-muted: #a9b7c9;
    --f41-bg: #0c1522;
    --f41-surface: #14233a;
    --f41-surface-soft: #101d30;
    --f41-line: #2b3d57;
    --f41-control: #8193ab;
    --f41-primary: #7fb0f5;
    --f41-action: #6aa1f4;
    --f41-primary-strong: #a8c8f8;
    --f41-on-primary: #0c1522;
    --f41-tint: #17304f;
    --f41-keep: #5ad1bf;
    --f41-keep-bg: #0f2f2d;
    --f41-replace: #f2a764;
    --f41-replace-bg: #3a2410;
    --f41-replace-ink: #fbd9b3;
    --f41-replace-line: #5c3b1c;
    --f41-check-bg: #1b2b42;
    --f41-info-bg: #17304f;
    --f41-info-line: #2b4a72;
    --f41-info-ink: #e6edf6;
    --f41-caution-bg: #2e2510;
    --f41-caution-line: #5a4719;
    --f41-caution-ink: #f3dca2;
    --f41-control-line: #5b7193;
    --f41-primary-hover: #8db8f7;
    --f41-surface-raised: #182a45;
    --f41-line-strong: #3d5577;
    --f41-focus: #a8c8f8;
    --f41-footer-bg: #070d16;
    --f41-footer-ink: #e6edf6;
    --f41-footer-muted: #b6c3d4;
    --f41-support: #7fb0f5;
    --f41-repair: #5ad1bf;
    --f41-durability: #5cc0ec;
    --f41-specs: #9fb0c9;
    --f41-veil: #0c1522f2;
    --f41-shadow-sm: 0 1px 2px #00000066;
    --f41-shadow-card: 0 8px 28px -8px #00000099;
    --f41-shadow-lift: 0 8px 24px #00000080;
    --f41-shadow-pop: 0 12px 32px #000000b3;
  }
}

/* Explicit choice from the header toggle; must stay identical to the system dark block above. */
:root[data-theme="dark"] {
  --f41-ink: #e6edf6;
  --f41-ink-2: #cbd5e1;
  --f41-muted: #a9b7c9;
  --f41-bg: #0c1522;
  --f41-surface: #14233a;
  --f41-surface-soft: #101d30;
  --f41-line: #2b3d57;
  --f41-control: #8193ab;
  --f41-primary: #7fb0f5;
  --f41-action: #6aa1f4;
  --f41-primary-strong: #a8c8f8;
  --f41-on-primary: #0c1522;
  --f41-tint: #17304f;
  --f41-keep: #5ad1bf;
  --f41-keep-bg: #0f2f2d;
  --f41-replace: #f2a764;
  --f41-replace-bg: #3a2410;
  --f41-replace-ink: #fbd9b3;
  --f41-replace-line: #5c3b1c;
  --f41-check-bg: #1b2b42;
  --f41-info-bg: #17304f;
  --f41-info-line: #2b4a72;
  --f41-info-ink: #e6edf6;
  --f41-caution-bg: #2e2510;
  --f41-caution-line: #5a4719;
  --f41-caution-ink: #f3dca2;
  --f41-control-line: #5b7193;
  --f41-primary-hover: #8db8f7;
  --f41-surface-raised: #182a45;
  --f41-line-strong: #3d5577;
  --f41-focus: #a8c8f8;
  --f41-footer-bg: #070d16;
  --f41-footer-ink: #e6edf6;
  --f41-footer-muted: #b6c3d4;
  --f41-support: #7fb0f5;
  --f41-repair: #5ad1bf;
  --f41-durability: #5cc0ec;
  --f41-specs: #9fb0c9;
  --f41-veil: #0c1522f2;
  --f41-shadow-sm: 0 1px 2px #00000066;
  --f41-shadow-card: 0 8px 28px -8px #00000099;
  --f41-shadow-lift: 0 8px 24px #00000080;
  --f41-shadow-pop: 0 12px 32px #000000b3;
}
