// Generated by scripts/gen-tokens.mjs — DO NOT EDIT. Edit tokens/tokens.source.mjs and re-run.
// Ristra brand palette (Figma: Ristra-branding). Names match the web CSS custom
// properties. Per the Liquid Glass rules in decisions.md: brand lives in TINT +
// typography — never opaque custom chrome fighting the system materials.

import SwiftUI
import UIKit

extension Color {
    /// Dynamic color from light/dark hex values.
    private static func dynamic(light: UInt32, dark: UInt32) -> Color {
        Color(UIColor { traits in
            UIColor(hex: traits.userInterfaceStyle == .dark ? dark : light)
        })
    }

    // Semantic tokens (names match the web's CSS custom properties).
    static let appBackground = dynamic(light: 0xFCF6ED, dark: 0x0F0A06)     // --bg (earth-50 / earth-975)
    static let surface = dynamic(light: 0xFFFFFF, dark: 0x231A11)           // --surface (#ffffff / earth-950)
    static let surfaceSunken = dynamic(light: 0xFFEED6, dark: 0x18130D)     // --surface-sunken (earth-100 / earth tone)
    static let appBorder = dynamic(light: 0xE2D2BB, dark: 0x3F362D)         // --border (earth-200 / earth tone)
    static let appText = dynamic(light: 0x362C21, dark: 0xFFEED6)           // --text (earth-900 / earth-100)
    static let textMuted = dynamic(light: 0x7C6F60, dark: 0xC8B8A4)         // --text-muted (earth-600 / earth-300)
    static let textFaint = dynamic(light: 0xAE9F8C, dark: 0x7C6F60)         // --text-faint (earth-400 / earth-600)
    static let accent = dynamic(light: 0xD7391D, dark: 0xF37860)            // --accent (terra-600 / terra-400)
    static let accentStrong = dynamic(light: 0xA71C00, dark: 0xFF9C88)      // --accent-strong (terra-700 / terra-300)
    static let onAccent = dynamic(light: 0xFFFFFF, dark: 0x0F0A06)          // --on-accent (#ffffff / earth-975)
    static let title = dynamic(light: 0x0A9C81, dark: 0x20DBBA)             // --title (turquoise-500 / turquoise-300)
    static let pillBackground = dynamic(light: 0xFFEED6, dark: 0x352C23)    // --pill-bg (earth-100 / earth tone)
    static let statusInCart = dynamic(light: 0x0A9C81, dark: 0x17BB9D)      // --status-incart (turquoise-500 / turquoise-400)
    static let statusUnavailable = dynamic(light: 0x804D00, dark: 0xBF7600) // --status-unavailable (ochre-700 / ochre-500)
    static let tripWash = dynamic(light: 0xF1FAEB, dark: 0x24331B)          // --trip-wash (sage-50 / sage-900)
    static let tripBorder = dynamic(light: 0xCADAC1, dark: 0x3A4B2F)        // --trip-border (sage-200 / sage-800)
    static let tripText = dynamic(light: 0x4E6242, dark: 0xAEC2A3)          // --trip-text (sage-700 / sage-300)
    static let tripDot = dynamic(light: 0x809971, dark: 0x93AA86)           // --trip-dot (sage-500 / sage-400)
}

private extension UIColor {
    convenience init(hex: UInt32) {
        self.init(
            red: CGFloat((hex >> 16) & 0xFF) / 255,
            green: CGFloat((hex >> 8) & 0xFF) / 255,
            blue: CGFloat(hex & 0xFF) / 255,
            alpha: 1
        )
    }
}
