/* ==========================================================================
   Bariatric Istanbul — Design tokens (T-020)
   Single source of truth for colour, type, spacing, radius, shadow, layout.
   No imports, no external fonts, no build step.
   Usage rules and contrast ratios: docs/DESIGN_SYSTEM.md
   ========================================================================== */

:root {
    color-scheme: light;

    /* ----------------------------------------------------------------------
       Brand palette
       Brand red/teal are decorative accents only. Normal text and button
       backgrounds MUST use the -strong variants (WCAG AA 4.5:1).
       ---------------------------------------------------------------------- */
    --bi-color-white: #ffffff;

    /* V2-A (§13.2): Ink is the brand navy, not near-black. Mist is the cool
       clinical section surface, Line the hairline colour. Warm beige is gone. */
    --bi-color-ink: #062c38;
    --bi-color-ink-muted: #5a6e73;

    --bi-color-paper: #ffffff;
    --bi-color-mist: #f1f6f6;
    --bi-color-line: #d8e3e3;

    /* Strait = information, Signal = action. Both are the -strong values:
       they are the only teal/red that meet 4.5:1 as text/button background. */
    --bi-color-strait: #0b6f6f;
    --bi-color-signal: #c4201d;

    --bi-color-neutral-25: var(--bi-color-mist);

    --bi-color-neutral-50: #f7f7f7;
    --bi-color-neutral-100: #efefec;
    --bi-color-neutral-200: var(--bi-color-line);
    --bi-color-neutral-300: #d9d6d1;
    --bi-color-neutral-400: #b9b6b1;
    --bi-color-neutral-500: #8a8f94;
    --bi-color-neutral-600: #6b7075;
    --bi-color-neutral-700: #5b5f63;
    --bi-color-neutral-800: #3a3d40;
    --bi-color-neutral-900: #262626;

    --bi-color-navy: #062c38;
    --bi-color-navy-soft: #0f4a5c;

    /* Brand accents — decorative/large-display only (see DESIGN_SYSTEM.md). */
    --bi-color-red: #e62d29;
    /* Signal: actions only (primary button/link). */
    --bi-color-red-strong: var(--bi-color-signal);
    --bi-color-red-dark: #9e1715;

    /* Brand accents — decorative only (2.79:1 on white, fails AA text). */
    --bi-color-teal: #14acac;
    /* Strait: information (key points, steps, icons, secondary links). */
    --bi-color-teal-strong: var(--bi-color-strait);
    --bi-color-teal-dark: #085c5c;

    /* ----------------------------------------------------------------------
       V2-A tint surfaces (callouts, key points, icon backgrounds)
       -50 tints carry body text (text/heading 13:1+, link 4.5:1+); muted text
       is only allowed on the -50 tints (4.5:1+), never on -100 (3.9–4.1:1).
       The -100 tints are decorative (icon backgrounds) only.
       Contrast table: docs/DESIGN_SYSTEM.md §5.7.
       ---------------------------------------------------------------------- */
    --bi-color-red-50: #fdf1f0;
    --bi-color-red-100: #fadcda;
    --bi-color-teal-50: #ecf8f8;
    --bi-color-teal-100: #cfeeee;
    --bi-color-navy-50: #eef3f5;

    /* T-145: canvas behind the home page's white panels (cool Bosphorus mist),
       WhatsApp action green (white text 5.4:1, AA) and the larger panel radius
       for page-level panels; inner elements keep --bi-radius-panel. */
    --bi-color-canvas: #e8eff2;
    --bi-color-whatsapp: #0d7a3e;
    --bi-color-whatsapp-dark: #0a5f30;
    --bi-radius-sheet: 1.75rem;
    --bi-color-rating: #b87400; /* review star, 4.6:1 on white */

    /* Status colours */
    --bi-color-danger: #b3261e;
    --bi-color-danger-bg: #fff1f0;
    --bi-color-success: #0b7a4b;
    --bi-color-success-bg: #eaf7ef;
    --bi-color-warning: #8a5a00;
    --bi-color-warning-bg: #fff6e5;

    /* ----------------------------------------------------------------------
       Semantic colour roles
       These are the tokens components should consume; raw palette tokens are
       for exceptional cases only.
       ---------------------------------------------------------------------- */
    --bi-color-bg: var(--bi-color-paper);
    --bi-color-bg-subtle: var(--bi-color-mist);
    --bi-color-bg-muted: var(--bi-color-neutral-100);
    --bi-color-surface-dark: var(--bi-color-navy);
    --bi-color-surface-dark-soft: var(--bi-color-navy-soft);
    /* T-045: Mist panel surface (DESIGN_SPEC_V2 §13.2 — clinical grey). */
    --bi-color-surface-mist: #f1f6f6;

    /* Frosted glass (header, language popover, consent card). */
    --bi-color-surface-glass: rgba(255, 255, 255, 0.82);
    --bi-color-surface-glass-strong: rgba(255, 255, 255, 0.86);
    --bi-blur-glass: saturate(180%) blur(20px);

    --bi-color-text: var(--bi-color-ink);
    --bi-color-text-muted: var(--bi-color-ink-muted);
    --bi-color-text-inverse: var(--bi-color-white);
    --bi-color-text-inverse-muted: var(--bi-color-neutral-50);

    --bi-color-heading: var(--bi-color-ink);
    --bi-color-link: var(--bi-color-signal);
    --bi-color-link-hover: var(--bi-color-red-dark);

    --bi-color-border: var(--bi-color-line);
    --bi-color-border-subtle: var(--bi-color-line);
    --bi-color-border-control: var(--bi-color-neutral-600);
    /* Inset hairline around flag icons so white flags stay visible. */
    --bi-color-flag-ring: rgba(0, 0, 0, 0.16);

    /* ----------------------------------------------------------------------
       Typography
       System stack only (D-030: no webfont). Character comes from scale,
       weight, tracking and spacing, not from a downloaded typeface.
       Sizes use a fluid clamp() scale; line-height tokens are unitless.
       ---------------------------------------------------------------------- */
    --bi-font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji";
    --bi-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;

    --bi-font-size-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
    --bi-font-size-sm: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
    --bi-font-size-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
    --bi-font-size-lg: clamp(1.125rem, 1.08rem + 0.22vw, 1.25rem);
    --bi-font-size-xl: clamp(1.25rem, 1.18rem + 0.35vw, 1.5rem);
    --bi-font-size-2xl: clamp(1.5rem, 1.38rem + 0.6vw, 1.875rem);
    --bi-font-size-3xl: clamp(1.875rem, 1.65rem + 1.1vw, 2.5rem);
    --bi-font-size-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3.25rem);
    --bi-font-size-5xl: clamp(2.75rem, 2.2rem + 2.75vw, 4.25rem);
    /* Landing hero: 40–72 px, tight tracking and leading (T-026 round 3). */
    --bi-font-size-hero: clamp(2.5rem, 6vw, 4.5rem);
    --bi-font-size-button: 1.0625rem;

    --bi-font-weight-regular: 400;
    --bi-font-weight-medium: 500;
    --bi-font-weight-semibold: 600;
    --bi-font-weight-bold: 700;
    --bi-font-weight-black: 800;
    /* Headings use 600–700, not 800 (Apple-inspired type scale). */
    --bi-font-weight-heading: var(--bi-font-weight-semibold);

    --bi-line-height-tight: 1.1;
    --bi-line-height-heading: 1.05;
    --bi-line-height-snug: 1.25;
    --bi-line-height-normal: 1.5;
    --bi-line-height-body: 1.47;
    --bi-line-height-relaxed: 1.65;

    --bi-letter-spacing-tight: -0.02em;
    /* §13.2: large, tight headings; body text keeps 0. */
    --bi-letter-spacing-display: -0.02em;
    --bi-letter-spacing-heading: -0.01em;
    --bi-letter-spacing-normal: 0;
    --bi-letter-spacing-wide: 0.04em;

    /* ----------------------------------------------------------------------
       Spacing — 4px base scale
       ---------------------------------------------------------------------- */
    --bi-space-0: 0;
    --bi-space-1: 0.25rem;
    --bi-space-1-5: 0.375rem;
    --bi-space-2: 0.5rem;
    --bi-space-3: 0.75rem;
    --bi-space-4: 1rem;
    --bi-space-5: 1.25rem;
    --bi-space-6: 1.5rem;
    --bi-space-8: 2rem;
    --bi-space-10: 2.5rem;
    --bi-space-12: 3rem;
    --bi-space-16: 4rem;
    --bi-space-20: 5rem;
    --bi-space-24: 6rem;

    --bi-space-gutter: clamp(1rem, 4vw, 2.5rem);
    --bi-space-section: clamp(3rem, 6vw, 5rem); /* L0 2026-11-16: was 4–7.5rem, too airy around tinted bands */

    /* ----------------------------------------------------------------------
       Radius hierarchy (§13.4): input 6 px · panel 14 px · primary pill 980 px
       · list row 0. No global "card" radius: surfaces differ by role.
       ---------------------------------------------------------------------- */
    --bi-radius-xs: 0.25rem;
    --bi-radius-input: 0.375rem;
    --bi-radius-sm: 0.375rem;
    --bi-radius-md: 0.5rem;
    --bi-radius-lg: 0.875rem;
    --bi-radius-xl: 0.875rem;
    --bi-radius-panel: 0.875rem;
    --bi-radius-card: var(--bi-radius-panel);
    --bi-radius-popover: var(--bi-radius-panel);
    --bi-radius-button: 980px;
    --bi-radius-pill: 999px;
    --bi-radius-circle: 50%;
    --bi-radius-row: 0;

    /* ----------------------------------------------------------------------
       Shadow
       ---------------------------------------------------------------------- */
    --bi-shadow-sm: 0 1px 2px rgba(6, 44, 56, 0.08),
        0 1px 3px rgba(6, 44, 56, 0.06);
    --bi-shadow-md: 0 10px 24px rgba(6, 44, 56, 0.1),
        0 2px 6px rgba(6, 44, 56, 0.06);
    --bi-shadow-lg: 0 24px 48px rgba(6, 44, 56, 0.14),
        0 6px 16px rgba(6, 44, 56, 0.08);

    /* ----------------------------------------------------------------------
       Layout & interaction
       ---------------------------------------------------------------------- */
    --bi-container: 1180px;
    --bi-container-narrow: 760px;
    --bi-touch-target: 44px;
    /* Header: compact height while scrolled; taller at the top of the page.
       The layout footprint stays constant (layout.css §8), so the change is
       CLS-free. */
    --bi-header-height: 4rem;
    --bi-header-height-top: 4.75rem;
    /* Fixed mobile contact bar: buttons (44) + 2 x 8 padding + hairline. */
    --bi-mobile-cta-height: 3.875rem;
    /* Sticky section offset: header + breathing room. */
    --bi-anchor-offset: calc(var(--bi-header-height) + var(--bi-space-6));

    /* Two-tone focus ring: navy outer ring + white inner ring. */
    --bi-focus-color: var(--bi-color-navy);
    --bi-focus-color-inner: var(--bi-color-white);
    --bi-focus-width: 3px;
    --bi-focus-offset: 2px;

    /* Motion — base.css disables these under prefers-reduced-motion. */
    --bi-duration-fast: 120ms;
    --bi-duration-base: 200ms;
    --bi-duration-slow: 320ms;
    --bi-ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --bi-ease-out: cubic-bezier(0, 0, 0.2, 1);
}
