/* ============================================================================
   Brand theme — ATB Expert. VALUES ONLY (token contract: brand-configuration
   spec §2.4). Structure (shadcn mapping, @theme, base, utilities) lives in each
   app's index.css and reads these variables.
   Palette: Noir #0d0d0f · Rouge #cd2c24 · Gris #dfdbda · Beige #f9f7f2.
   Typography: Zalando Sans Expanded (display) + Lexend (body) + mono (refs).
   ============================================================================ */

@font-face {
  font-family: "Zalando Sans Expanded";
  src: url("/brand/fonts/ZalandoSansExpanded-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zalando Sans Expanded";
  src: url("/brand/fonts/ZalandoSansExpanded-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zalando Sans Expanded";
  src: url("/brand/fonts/ZalandoSansExpanded-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zalando Sans Expanded";
  src: url("/brand/fonts/ZalandoSansExpanded-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("/brand/fonts/Lexend-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("/brand/fonts/Lexend-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("/brand/fonts/Lexend-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("/brand/fonts/Lexend-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("/brand/fonts/Lexend-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ----- Core ----- */
  --brand-primary: #cd2c24;
  --brand-primary-light: #e04039;
  --brand-primary-dark: #a82319;
  --brand-primary-tint: #fdeeec;
  --brand-primary-tint-2: #f8dcd9;
  --brand-ink: #0d0d0f;
  --brand-ink-soft: #2d2d2f;

  /* ----- Neutrals (warm paper) ----- */
  --paper: #f9f7f2;
  --paper-2: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink-900: #0d0d0f;
  --ink-700: #3a3837;
  --ink-500: #6b7178;
  --ink-400: #9a9695;
  --line: #e7e3dd;
  --line-strong: #d6d1c8;
  --footer-bg: #0d0d0f;
  --footer-text: #cbc7c0;
  --footer-text-muted: #a8a39b;
  --footer-text-faint: #8b8780;
  --topbar-text: #f4f1ea;

  /* ----- Extra palette values (not in the required contract) ----- */
  --gris: #dfdbda;
  --gris-text: #6b7178;
  --beige: #f9f7f2;
  --blanc: #ffffff;
  --line-ink: #0d0d0f;

  /* ----- Semantic ----- */
  --success: #1f8f57;
  --success-bg: #e7f4ec;
  /* Darker green for small bold text on --success-bg (AA at 11-13px). */
  --success-strong: #166540;
  --success-deep: #145a39;
  --success-border: #c5e6d2;
  --success-on-dark: #7fd4a3;
  --warning: #b4730d;
  --warning-bg: #fbf0dd;
  --warning-light: #d99a2b;
  /* Small text on --warning-bg (partial-stock band): --warning there is 3.4:1, below AA. */
  --warning-strong: #875a0b;
  --danger: #cd2c24;
  --danger-bg: #fdeeec;
  --info: #2563a8;
  --info-bg: #e7eff8;

  /* ----- Typography families ----- */
  --font-display: "Zalando Sans Expanded", system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --font-body: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Consolas",
    monospace;

  /* ----- Surface ----- */
  --radius: 0.5rem;
  --shadow-xs: 0 1px 2px rgba(13, 13, 15, 0.05);
  --shadow-sm: 0 2px 6px rgba(13, 13, 15, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(13, 13, 15, 0.14);
  --shadow-lg: 0 24px 48px -16px rgba(13, 13, 15, 0.2);
  /* Relief of cards and panels on the paper ground (warm-brown tint): at rest, and lifted on hover / focus. */
  --shadow-rest: 0 1px 2px rgba(13, 13, 15, 0.05), 0 8px 20px -12px rgba(46, 32, 18, 0.22);
  --shadow-lift: 0 2px 4px rgba(13, 13, 15, 0.06), 0 22px 40px -18px rgba(46, 32, 18, 0.38);
  /* Page ground « Encre flottante »: a fine paper grain (repeating 160 px tile) over a warm paper
     gradient that runs the full height of the page. */
  --page-bg-image:
    url("/brand/ground-grain.svg"),
    linear-gradient(180deg, #f7f2ea, #efe6d9);

  /* ----- Ink surface: header, navigation, page-head panels, home hero, catalogue rail ----- */
  --ink-surface: #141210;
  --on-ink: #f6efe4; /* titles and active text on the ink surface (16.4:1) */
  --on-ink-muted: #cbbfad; /* secondary text on the ink surface (10.3:1) */
  --on-ink-faint: #a99d8b; /* tertiary text on ink: role, counts (7.0:1) */
  --on-ink-accent: #ffb8b0; /* brand-red accents on ink (≥ 9.3:1) */
  /* Secondary text that sits directly on the page ground (6.0–7.0:1 on its darkest pixels). */
  --ink-on-ground: #4f4a42;

  /* ----- Design v5 « Le comptoir » (docs/guidelines/BOUTIQUE_DESIGN.md) ----- */
  --brand-primary-text: #b3241c; /* brand red as TEXT on surfaces and tints (6.7:1 on white) */
  --on-primary: #ffffff; /* text and icons on a --brand-primary fill */
  --danger-strong: #8a2a22; /* small text on --danger-bg */
  --inverse: #0d0d0f; /* strongest fill: selected toggle, active chip, compatibility tag */
  --on-inverse: #ffffff;
  --ink-surface-2: #221f1c; /* hover and raised controls on the ink surface */
  --ink-line: #35312c; /* dividers on the ink surface */
  /* The header search control (« comptoir »): a light slab on the ink surface, in both themes. */
  --counter-surface: #f6efe4;
  --counter-text: #141210;
  --counter-muted: #6a6156;
  --counter-line: #d9d0c2;
  --counter-hover: #ece3d5;
  --counter-active: #ffffff;
  --photo-ground: #ffffff; /* behind product photos; they are shot on white */
  --overlay: rgba(0, 0, 0, 0.45); /* behind drawers, sheets and popovers */
  --shadow-pop: 0 24px 60px -18px rgba(13, 13, 15, 0.45); /* popovers, sheets, toasts */
  --dark-theme: available; /* this brand ships the dark block below; remove both to opt out */
}

/* ============================================================================
   Dark theme — design v5. Same variable names, dark values. Applied when the
   boutique sets data-theme="dark" on <html>; the admin never does. Unlisted
   variables keep their light value on purpose: --brand-primary / --on-primary
   (the primary button is the same red in both themes), --brand-ink (a constant
   brand black, never a text colour), the on-ink and counter sets (the header is
   an ink surface in both themes), --photo-ground (photos are shot on white).
   ============================================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-primary-text: #ff9289;
  --brand-primary-tint: #3b1714;
  --brand-primary-tint-2: #4a1d19;

  --paper: #0e0d0c;
  --paper-2: #171513;
  --surface: #1a1816;
  --surface-2: #211e1b;
  --ink-900: #f6efe4;
  --ink-700: #ddd3c4;
  --ink-500: #a99d8b;
  --ink-400: #938979;
  --line: #2f2b27;
  --line-strong: #4a453e;
  --gris: #2f2b27;
  --gris-text: #a99d8b;
  --ink-on-ground: #cbbfad;
  --inverse: #f6efe4;
  --on-inverse: #141210;

  --ink-surface: #1a1816;
  --ink-surface-2: #26221f;
  --ink-line: #38332d;
  --footer-bg: #080707;

  --success: #4fb783;
  --success-bg: #12301f;
  --success-strong: #7fd4a3;
  --success-deep: #9be0b9;
  --success-border: #1f4a31;
  --warning: #d99a2b;
  --warning-bg: #37280d;
  --warning-strong: #e8b765;
  /* --danger stays the brand red: it is a FILL (white text on it 5.3:1). Text uses --danger-strong. */
  --danger-bg: #3b1714;
  --danger-strong: #ff9f96;
  --info: #7fb0e6;
  --info-bg: #14263b;

  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-xs: 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-md: 0 10px 28px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.8);
  --shadow-rest: 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-lift: 0 14px 32px -14px rgba(0, 0, 0, 0.75);
  --shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, 0.85);
  --page-bg-image: linear-gradient(180deg, #100f0e, #0c0b0a);
}
