/*
  Dialed design tokens (#45).

  Colours: not defined here. Fluent UI generates a light and a dark brand theme from the espresso-brown
  key colour (body[data-theme-color] in index.html) and exposes it as --color* variables
  (--colorBrandBackground, --colorNeutralForeground1, ...). Use those, never raw hex values, so both modes
  and any future brand change work everywhere. Fallbacks in other CSS files are only for first paint.

  This file adds what Fluent doesn't: spacing, radii, type scale, touch targets and coffee semantics.
*/

:root {
    /* Spacing: 4 px grid */
    --dialed-space-1: 4px;
    --dialed-space-2: 8px;
    --dialed-space-3: 12px;
    --dialed-space-4: 16px;
    --dialed-space-5: 24px;
    --dialed-space-6: 32px;
    --dialed-space-7: 48px;

    /* Radii */
    --dialed-radius-s: 6px;
    --dialed-radius-m: 12px;
    --dialed-radius-l: 20px;
    --dialed-radius-xl: 24px;
    --dialed-radius-pill: 999px;

    /* Minimum touch target on iPhone and iPad (Apple HIG: 44 x 44 pt) */
    --dialed-touch-target: 44px;

    /* Type scale in rem: it follows the root font size, which follows the iOS text size setting (below) */
    --dialed-text-xs: 0.75rem;
    --dialed-text-s: 0.875rem;
    --dialed-text-m: 1rem;
    --dialed-text-l: 1.125rem;
    --dialed-text-xl: 1.375rem;
    --dialed-text-2xl: 1.75rem;
    --dialed-text-3xl: 2.25rem;

    --dialed-weight-regular: 400;
    --dialed-weight-semibold: 600;
    --dialed-weight-bold: 700;

    /* Roast colours (light to dark): one brown scale, so brown stays the default and only its depth tells the roast. A gradient start and end per level and the text colour that reads on it. Coffee semantics, like the roast thumbnails. */
    --dialed-roast-light-start: #b89674;
    --dialed-roast-light-end: #e6d3bb;
    --dialed-roast-light-fg: #2b1d14;
    --dialed-roast-mediumlight-start: #a47d58;
    --dialed-roast-mediumlight-end: #d8bf9f;
    --dialed-roast-mediumlight-fg: #2b1d14;
    --dialed-roast-medium-start: #7f5a3c;
    --dialed-roast-medium-end: #bc9672;
    --dialed-roast-medium-fg: #fff;
    --dialed-roast-mediumdark-start: #5a3a26;
    --dialed-roast-mediumdark-end: #8d6747;
    --dialed-roast-mediumdark-fg: #fff;
    --dialed-roast-dark-start: #2a1a12;
    --dialed-roast-dark-end: #5b3a28;
    --dialed-roast-dark-fg: #f3e6d6;

    /* Flavour wheel branches (same order as FlavorCategory): fruity, floral, sweet, nutty and cocoa, spices, roasted, green, sour */
    --dialed-flavor-0: #b5483b;
    --dialed-flavor-1: #b9739a;
    --dialed-flavor-2: #c9923f;
    --dialed-flavor-3: #8a5a3b;
    --dialed-flavor-4: #a85f2c;
    --dialed-flavor-5: #5b4030;
    --dialed-flavor-6: #6f8f4a;
    --dialed-flavor-7: #b8a63a;

    /* Elevation: a soft, warm lift (roasted-brown tinted, not grey) */
    --dialed-shadow-card: 0 1px 2px rgb(60 35 20 / 0.08), 0 6px 16px rgb(90 56 37 / 0.12);
    --dialed-shadow-raised: 0 8px 22px rgb(90 56 37 / 0.2);


    /* Titles get a touch of character */
    --dialed-font-display: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}

/*
  Dynamic Type: on iPhone and iPad Safari (also as a home-screen app) "-apple-system-body" is the size the
  user picked in Settings > Display & Brightness > Text Size / Accessibility. Everything in rem scales with it.
*/
@supports (font: -apple-system-body) {
    html {
        font: -apple-system-body;
        font-family: var(--fontFamilyBase, -apple-system, BlinkMacSystemFont, sans-serif);
    }
}

/* Let iOS text-size and browser zoom win over an automatic enlargement of text in landscape. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Warm surfaces: derived from the brand colour, so they follow light and dark mode. Fluent's colour variables live on body, so these do too. */
body {
    --dialed-surface: color-mix(in srgb, var(--colorBrandBackground, #6f4e37) 15%, var(--colorNeutralBackground2, #fafafa));
    --dialed-surface-tray: color-mix(in srgb, var(--colorBrandBackground, #6f4e37) 16%, var(--colorNeutralBackground1, #fff));
}
