/*
 * The app's look for theposter.app (ticket 344): every colour, shape and type size the web pages use.
 * landing.css and public-pages.css use only these variables; no colour lives anywhere else.
 *
 * Taken from Poster origin/dev @ 61572cb85:
 *   colours  common/ui/compose/src/commonMain/kotlin/app/pstr/common/compose/theme/Color.kt
 *   shapes   common/ui/compose/src/commonMain/kotlin/app/pstr/common/compose/theme/PosterShapes.kt
 *   type     common/ui/compose/src/commonMain/kotlin/app/pstr/common/compose/theme/Type.kt (Material 3 scale in Nunito)
 *   font     common/ui/resources/src/commonMain/composeResources/font/nunito_variablefont_wght.ttf (fonts/nunito.css)
 *   avatar   common/ui/compose/src/commonMain/kotlin/app/pstr/common/compose/components/Avatar.kt (initial on grey)
 *   pins     ui/map/src/commonMain/kotlin/app/pstr/map/PosterMapClusterItem.kt, MapPins.kt, CarouselCardSize.kt
 *   buttons  ui/profile/src/commonMain/kotlin/app/pstr/profile/public/PublicProfile.kt (ProfileButton)
 * Dark follows the system, like the app (prefers-color-scheme).
 */
:root {
    color-scheme: light dark;

    /* Colours, light (Color.kt *Light). */
    --primary: #171717;
    --on-primary: #FFFFFF;
    --primary-container: #363636;
    --on-primary-container: #C8C6C5;
    --secondary-container: #E9E6E5;
    --on-secondary-container: #4B4A4A;
    --error: #BA1A1A;
    --on-error: #FFFFFF;
    --error-container: #FFDAD6;
    --on-error-container: #410002;
    --surface: #FDFDFD;
    --on-surface: #1C1B1B;
    --surface-variant: #E0E3E3;
    --on-surface-variant: #444748;
    --outline: #747878;
    --outline-variant: #C4C7C7;
    --surface-container-lowest: #FFFFFF;
    --surface-container-low: #F7F3F2;
    --surface-container: #F1EDEC;
    --surface-container-high: #EBE7E7;
    --surface-container-highest: #E5E2E1;
    --inverse-surface: #313030;
    --inverse-on-surface: #F4F0EF;
    --mention: #1A6FD6;
    --like: #E5304A;

    /* The app's tonal button and chip: onSurface at 8 % (PublicProfile.kt TONAL_ALPHA). */
    --tonal: rgba(28, 27, 27, 0.08);
    --tonal-hover: rgba(28, 27, 27, 0.14);
    /* The author pill and floating bars: surface, a little see-through, over the photo or the map. */
    --surface-glass: rgba(253, 253, 253, 0.92);
    --scrim: rgba(0, 0, 0, 0.32);
    /* Text over a photo (the landing's photo grid, ticket 931): white on a dark fade, the same in both themes. */
    --photo-scrim: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7));
    /* The landing's pixel-art scene (ticket 938): its sky, shown while the picture loads. */
    --scene-sky: #c9d4ec;
    /* The landing's polaroid (ticket 938): a printed photo, white paper and dark ink in both themes. */
    --polaroid-paper: #FFFFFF;
    --polaroid-ink: #1B1B1B;
    --polaroid-ink-variant: #444748;
    --polaroid-ink-faint: #6F7979;
    --polaroid-pin: #E5304A;
    --on-photo: #FFFFFF;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.16);
    /* An avatar with no photo: the initial on one of the app's muted greys (Avatar.kt mutedColors). */
    --avatar-fallback: #90A4AE;
    --on-avatar-fallback: #000000;

    /* Shapes (PosterShapes.kt).
       Nested corners (ticket 991): inner radius = outer radius − the gap between the two edges, never larger, so the
       curves are concentric. When the gap is as large as the outer radius or larger, the inner element takes a small
       radius of its own scale (12 px or less), never one close to the outer. Examples on the landing: the 24 px brand
       pill holds a round 36 px logo at a 6 px inset (24 − 6 = 18); the 28 px hero card has 12 px buttons (16 px gap on
       a phone: 28 − 16 = 12); the 16 px polaroid has a 4 px photo at a 12 px inset; a 16 px grid photo has an 8 px
       chip at an 8 px inset. */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 28px;
    --radius-pill: 24px;
    --radius-thumb: 6px;
    --radius-card: var(--radius-lg);
    --radius-chip: var(--radius-pill);

    /* Type: Material 3's scale in Nunito (Type.kt), with its weights; a page bolds a name where the app does. */
    --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --headline-large: 400 2rem/2.5rem var(--font);
    --headline-small: 400 1.5rem/2rem var(--font);
    --title-large: 400 1.375rem/1.75rem var(--font);
    --title-medium: 500 1rem/1.5rem var(--font);
    --title-small: 500 0.875rem/1.25rem var(--font);
    --body-large: 400 1rem/1.5rem var(--font);
    --body-medium: 400 0.875rem/1.25rem var(--font);
    --body-small: 400 0.75rem/1rem var(--font);
    --label-large: 500 0.875rem/1.25rem var(--font);
    --label-medium: 500 0.75rem/1rem var(--font);
    --label-small: 500 0.6875rem/1rem var(--font);
    --tracking-body: 0.03em;
    --tracking-label: 0.01em;

    /* Sizes of the app's parts. */
    --button-height: 40px;
    --avatar-post: 40px;
    --avatar-comment: 32px;
    --avatar-profile: 64px;
    --pin-width: 38px;
    --pin-height: 56px;
    --pin-edge: 1.5px;

    /* Ticket 1557: the profile's text tiles (Poster textTileTint), the spark, the map card until it has a map (1563). */
    --tile-tint-0: #F3EFE6;
    --tile-tint-1: #E8F0F7;
    --tile-tint-2: #EAF2E8;
    --tile-tint-3: #F4EAEE;
    --spark: #F5B700;
    --map-placeholder: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.5), transparent 40%),
        linear-gradient(160deg, #E8EADF 0%, #DFE6D6 45%, #D7E2EA 100%);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Colours, dark (Color.kt *Dark). */
        --primary: #FDFDFD;
        --on-primary: #303030;
        --primary-container: #202020;
        --on-primary-container: #ACABAA;
        --secondary-container: #3E3D3D;
        --on-secondary-container: #D3D0CF;
        --error: #FFB4AB;
        --on-error: #690005;
        --error-container: #93000A;
        --on-error-container: #FFDAD6;
        --surface: #141313;
        --on-surface: #E5E2E1;
        --surface-variant: #444748;
        --on-surface-variant: #C4C7C7;
        --outline: #8E9192;
        --outline-variant: #444748;
        --surface-container-lowest: #0E0E0E;
        --surface-container-low: #1C1B1B;
        --surface-container: #201F1F;
        --surface-container-high: #2B2A2A;
        --surface-container-highest: #353434;
        --inverse-surface: #E5E2E1;
        --inverse-on-surface: #313030;
        --mention: #5EA6F7;
        --like: #FF4D63;
        --scene-sky: #1d2140;

        --tonal: rgba(229, 226, 225, 0.08);
        --tonal-hover: rgba(229, 226, 225, 0.14);
        --surface-glass: rgba(20, 19, 19, 0.88);
        --scrim: rgba(0, 0, 0, 0.5);
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
        --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.6);
        --avatar-fallback: #546E7A;
        --on-avatar-fallback: #FFFFFF;
        --tile-tint-0: #2E2B25;
        --tile-tint-1: #242A31;
        --tile-tint-2: #252C25;
        --tile-tint-3: #2E2629;
        --map-placeholder: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.06), transparent 40%),
            linear-gradient(160deg, #2A2D2A 0%, #262B27 45%, #23292E 100%);
    }
}
