Guides

React Native

Every component and block, for Expo: system Liquid Glass on iOS 27, generated themes, and the same parts on Android and the web.

Native Liquid Glass starts untinted and follows the system appearance. Regular glass carries floating controls; clear glass belongs over media. Content cards use standard material. System switches, sliders, pickers, menus and sheets use Expo’s native UI components. The same source renders on Android and react-native-web with platform materials and generated theme tokens.

pnpm dlx shadcn@latest add https://glasscn.app/r/native-tokens.json https://glasscn.app/r/native-glass.json https://glasscn.app/r/native-aurora.json https://glasscn.app/r/native-press.json https://glasscn.app/r/native-ui.json

Needs a components.json in the Expo project (as react-native-reusables uses) so the CLI knows your aliases. Files land in components/glass/native/.

Run the Apple-inspired examples

pnpm dlx shadcn@latest add https://glasscn.app/r/native-liquid-glass-01.json

Choose Photos, Music, Maps, Safari, Mail or Controls. The native sandbox has all six scenes, separate material examples, and sibling glass merging.

pnpm dlx shadcn@latest add https://glasscn.app/r/native-liquid-glass-02.json

For Landmarks, Notes, Search and Materials, use LiquidGlass02 from native/liquid-glass-02 with the matching lowercase scene name. These add image extension, identified badges, prioritized toolbar overflow, editable nonmodal formatting and scoped search tokens.

app/index.tsx
import { GestureHandlerRootView } from "react-native-gesture-handler"
import { KeyboardProvider } from "react-native-keyboard-controller"
import { SafeAreaProvider } from "react-native-safe-area-context"
import { LiquidGlass01 } from "@/components/glass/native/liquid-glass-01"

export default function Screen() {
  return (
    <SafeAreaProvider>
      <GestureHandlerRootView style={{ flex: 1 }}>
        <KeyboardProvider>
          <LiquidGlass01 scene="music" style={{ flex: 1 }} />
        </KeyboardProvider>
      </GestureHandlerRootView>
    </SafeAreaProvider>
  )
}

Preserve the system effect

Keep opacity at one on native glass and its ancestors. Animate position, size or the optical effect instead (canFade() from native-glass tells you when).

Use materialized for optical presentation exits; visible hides the entire surface. Reduce Motion stops elastic/effect animation. GText and GIcon supply dynamic neutral foregrounds so labels stay readable when regular glass changes appearance.

Leave palette and scheme unset to preserve system defaults. Set them explicitly in GlassThemeProvider to theme a subtree. Android can opt into a blur target with GlassBlurTarget; otherwise the material uses a readable fill. Bright media can use a dim behind clear controls; dark media needs none.

Components

Every web component and block has a native twin under the same name with a native- prefix: the same parts and props, one file that renders on iOS, Android and the web (react-native-web). Each installs on its own and brings what it needs:

pnpm dlx shadcn@latest add https://glasscn.app/r/native-button.json https://glasscn.app/r/native-dialog.json https://glasscn.app/r/native-activity-rings.json

Foundation source

components/glass/native/tokens.tsx
import * as React from "react"
import { Platform, useColorScheme } from "react-native"

import { useHighContrast } from "@/components/glass/native/a11y"
import { PALETTES, PRESETS, type DensityName, type MaterialName, type MotionName, type PaletteName, type ShapeName, type TypeName } from "@/components/glass/native/tokens.generated"

/**
 * glasscn tokens for React Native — generated from the web theme engine
 * (`toNativeTheme` in glass-theme.ts → tokens.generated.ts), so every palette and
 * material, shape, motion, density and type preset matches the web. Wrap your app in
 * <GlassThemeProvider> to pick them or force a scheme; read with useGlassTheme().
 */

export type { DensityName, MaterialName, MotionName, PaletteName, ShapeName, TypeName }
export type Scheme = "light" | "dark"

/** One scheme as plain values: sRGB colours, points, ms. Mirrors `NativeScheme` in glass-theme.ts. */
export interface NativeScheme {
  primary: string
  primaryForeground: string
  ring: string
  destructive: string
  destructiveForeground: string
  success: string
  successForeground: string
  warning: string
  warningForeground: string
  info: string
  infoForeground: string
  chart: [string, string, string, string, string, string, string, string]
  aurora: [string, string, string]
  auroraBase: string
  foreground: string
  label: string
  labelSecondary: string
  labelTertiary: string
  labelQuaternary: string
  frost: string
  glassSubtle: string
  glass: string
  glassStrong: string
  glassThick: string
  glassLiquid: string
  glassLiquidClear: string
  glassClearDim: string
  glassSolid: string
  glassBorder: string
  glassHighlight: string
  glassShadow: string
  shadowY: number
  shadowBlur: number
  dim: string
  fill: string
  fillStrong: string
  separator: string
  thumb: string
  knob: string
  blur: number
  liquidBlur: number
  clearBlur: number
  saturate: number
  liquidSaturate: number
  brightness: number
  specular: number
  edgeShade: number
  illumination: number
  clarity: number
  radius: { surface: number; control: number; button: number; badge: number }
  density: number
  hitMin: number
  ringWidth: number
  motion: { duration: number; pressScale: number; pressStretch: number; pressGrow: number; knobLensScale: number; auroraSpeed: number }
  type: { scale: number; ratio: number; leading: number; headingLeading: number; bodyWeight: number; headingWeight: number; displayWeight: number; tracking: number; headingTracking: number; displayTracking: number }
  fonts: { sans?: string; heading?: string; display?: string; mono?: string }
}
export type NativeHighContrast = Pick<NativeScheme, "glassBorder" | "separator" | "labelSecondary" | "labelTertiary" | "fill" | "fillStrong" | "primary" | "ring">
/** Clear media controls use bright labels independently of the app's scheme. */
export const CLEAR_MEDIA_LABELS: Partial<NativeScheme> = { label: "#fafafa", labelSecondary: "#e5e5e5", labelTertiary: "#d4d4d4", foreground: "#fafafa" }
export const NativeGlassLabelsContext = React.createContext<GlassTheme | null>(null)
export interface NativeTheme {
  light: NativeScheme
  dark: NativeScheme
  highContrast: { light: NativeHighContrast; dark: NativeHighContrast }
}

export const PALETTE_NAMES = Object.keys(PALETTES) as PaletteName[]

export interface GlassTheme extends NativeScheme {
  scheme: Scheme
  palette: PaletteName
  /** Increase Contrast is on (OS or forced): borders, separators and secondary text are firmer. */
  highContrast: boolean
  /** Secondary text — the label-secondary tier. */
  mutedForeground: string
  /** Frost color for content fills and outlines. Native Liquid Glass has no default tint. */
  glassTint: string
}

export interface ThemeOptions {
  palette?: PaletteName
  material?: MaterialName
  shape?: ShapeName
  motion?: MotionName
  density?: DensityName
  type?: TypeName
  /** Force Increase Contrast on or off; omit to follow the OS. */
  highContrast?: boolean
  /** Raw overrides, applied last. */
  tokens?: Partial<NativeScheme>
}

// System on iOS is the OS's own appearance: the iOS 27 system colours (HIG Color,
// Specifications). systemBlue carries white at 3.5:1, which the HIG allows for bold text, so
// labels on it are semibold. The web's System palette uses Apple's web blue (#0071E3) instead.
const IOS_SYSTEM: Record<"light" | "dark" | "lightHC" | "darkHC", Partial<NativeScheme>> = {
  light: { primary: "#0088ff", primaryForeground: "#ffffff", ring: "#0088ff", destructive: "#ff383c", destructiveForeground: "#ffffff", chart: ["#0088ff", "#34c759", "#ff8d28", "#cb30e0", "#ff2d55", "#6155f5", "#00c3d0", "#8e8e93"] },
  dark: { primary: "#0091ff", primaryForeground: "#ffffff", ring: "#0091ff", destructive: "#ff4245", destructiveForeground: "#ffffff", chart: ["#0091ff", "#30d158", "#ff9230", "#db34f2", "#ff375f", "#6d7cff", "#00d2e0", "#98989d"] },
  lightHC: { primary: "#1e6ef4", ring: "#1e6ef4", destructive: "#e9152d" },
  darkHC: { primary: "#5cb8ff", ring: "#5cb8ff", destructive: "#ff6165" },
}

/** The theme for a scheme and presets, as the web's createGlassTheme would make it. Pure. */
export function buildGlassTheme(scheme: Scheme, palette: PaletteName = "system", options: Omit<ThemeOptions, "palette"> = {}): GlassTheme {
  const p = PALETTES[palette] ?? PALETTES.dusk
  const s: NativeScheme = { ...p[scheme] }
  for (const group of ["material", "shape", "motion", "density", "type"] as const) {
    const key = options[group]
    const diff = key ? (PRESETS[group] as Record<string, { light: Partial<NativeScheme>; dark: Partial<NativeScheme> }>)[key]?.[scheme] : undefined
    if (diff) Object.assign(s, diff)
  }
  if (options.highContrast) Object.assign(s, p.highContrast[scheme])
  if (palette === "system" && Platform.OS === "ios") Object.assign(s, IOS_SYSTEM[scheme], options.highContrast ? IOS_SYSTEM[`${scheme}HC`] : null)
  Object.assign(s, options.tokens)
  return {
    ...s,
    scheme,
    palette: PALETTES[palette] ? palette : "system",
    highContrast: !!options.highContrast,
    // text on glass: the label tier, so `foreground` reads inside panes as on the web
    foreground: s.label,
    mutedForeground: s.labelSecondary,
    glassTint: s.glassLiquid,
  }
}

/** Labels for untinted system surfaces must not inherit a content-material tint's label color. */
export function nativeGlassLabels(theme: GlassTheme, overrides?: Partial<NativeScheme>): Partial<NativeScheme> {
  const base = buildGlassTheme(theme.scheme, theme.palette, { highContrast: theme.highContrast })
  const keys = ["label", "labelSecondary", "labelTertiary", "labelQuaternary", "foreground"] as const
  return Object.fromEntries(keys.map((key) => [key, overrides?.[key] ?? base[key]]))
}

/** Omitted provider options leave system controls at their platform defaults. */
export function nativeControlTheme(theme: GlassTheme, options: ThemeOptions & { scheme?: Scheme }) {
  return {
    colorScheme: options.scheme,
    // the System palette is the OS's own appearance: system controls keep their native tints
    // (a green iOS switch, the user's accent), unless a raw accent is set
    seedColor: (options.palette !== undefined && options.palette !== "system") || options.tokens?.primary !== undefined ? theme.primary : undefined,
  }
}

type Ctx = ThemeOptions & { scheme?: Scheme }
const GlassThemeContext = React.createContext<Ctx | null>(null)

/**
 * Pick a palette, presets or a scheme for everything inside. Nested providers merge
 * with the outer one: unset props inherit (a nested `palette` keeps an outer forced `scheme`).
 */
export function GlassThemeProvider({ children, ...props }: Ctx & { children: React.ReactNode }) {
  const parent = React.useContext(GlassThemeContext)
  const { palette, scheme, material, shape, motion, density, type, highContrast, tokens } = props
  const value = React.useMemo<Ctx>(() => {
    const own = Object.fromEntries(Object.entries({ palette, scheme, material, shape, motion, density, type, highContrast }).filter(([, v]) => v !== undefined))
    return { ...parent, ...own, tokens: parent?.tokens || tokens ? { ...parent?.tokens, ...tokens } : undefined }
  }, [parent, palette, scheme, material, shape, motion, density, type, highContrast, tokens])
  return <GlassThemeContext.Provider value={value}>{children}</GlassThemeContext.Provider>
}

/** The provider's options, merged up the tree (for scopes that re-provide). */
export const useGlassThemeOptions = () => React.useContext(GlassThemeContext) ?? {}

/** The current tokens: the provider's palette, presets and scheme, else System and the system scheme; Increase Contrast from the OS. */
export function useGlassTheme(): GlassTheme {
  const ctx = React.useContext(GlassThemeContext)
  const system = useColorScheme()
  const osContrast = useHighContrast()
  const scheme: Scheme = ctx?.scheme ?? (system === "dark" ? "dark" : "light")
  const highContrast = ctx?.highContrast ?? osContrast
  return React.useMemo(
    () => buildGlassTheme(scheme, ctx?.palette ?? "system", { ...ctx, highContrast }),
    [scheme, ctx, highContrast]
  )
}
components/glass/native/tokens.generated.ts
// Generated by scripts/generate.mjs from src/lib/glass-theme.ts (toNativeTheme) — do not edit.
import type { NativeHighContrast, NativeScheme, NativeTheme } from "@/components/glass/native/tokens"

export type { NativeHighContrast, NativeScheme, NativeTheme }
export type PaletteName = "system" | "dusk" | "ocean" | "rose" | "sage" | "amber" | "graphite" | "lavender" | "mint" | "cherry" | "lagoon" | "sand" | "midnight"
export type MaterialName = "frosted" | "vivid" | "crystal" | "smoked" | "matte" | "vapor" | "neon"
export type ShapeName = "round" | "soft" | "sharp" | "square"
export type MotionName = "spring" | "smooth" | "snappy" | "still"
export type DensityName = "compact" | "default" | "comfortable"
export type TypeName = "default" | "system" | "modern" | "editorial" | "friendly" | "technical" | "classic" | "grotesk"
type Diff = { light: Partial<NativeScheme>; dark: Partial<NativeScheme> }

export const PALETTES: Record<PaletteName, NativeTheme> = {
  system: {
    light: {"primary":"#006bd9","primaryForeground":"#ffffff","ring":"#006bd9","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#007781","infoForeground":"#fcfcfc","chart":["#006bd9","#35c759","#ff8d28","#cb30e0","#ff2e55","#6155f5","#00c3d0","#8e8e93"],"aurora":["#f2f2f7","#f2f2f7","#f2f2f7"],"auroraBase":"#f2f2f7","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#006bd9","primaryForeground":"#ffffff","ring":"#006bd9","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#04c1d0","infoForeground":"#001b1e","chart":["#006bd9","#30d158","#ff9230","#db34f2","#ff385f","#6d7cff","#01d2e0","#98989d"],"aurora":["#000000","#000000","#000000"],"auroraBase":"#000000","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#0055af","ring":"#0055af"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#2a85f4","ring":"#2a85f4"}},
  },
  dusk: {
    light: {"primary":"#ca370c","primaryForeground":"#fcfcfc","ring":"#ca370c","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#ca370c","#a77bff","#ffaa32","#867000","#f6b6e7","#295f9b","#a3b37a","#92827e"],"aurora":["#ffb199","#c7b2ff","#ffd9ae"],"auroraBase":"#eef0f5","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#ff7a55","primaryForeground":"#190e0c","ring":"#ff7a55","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#ff7a55","#a77bff","#ffaa32","#ab901c","#f9b9ea","#5289c8","#d6e7ab","#8c7c78"],"aurora":["#9a3a2a","#4a2f96","#7a4a1c"],"auroraBase":"#050507","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#a62700","ring":"#a62700"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#ffa68d","ring":"#ffa68d"}},
  },
  ocean: {
    light: {"primary":"#0c67e2","primaryForeground":"#fcfcfc","ring":"#0c67e2","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#007781","infoForeground":"#fcfcfc","chart":["#0c67e2","#2dcfc2","#8e7cff","#9156a0","#7be1e5","#5a6500","#d097b6","#7f8793"],"aurora":["#9cc6ff","#a6eee4","#c7bcff"],"auroraBase":"#eef0f5","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#4ea3ff","primaryForeground":"#0c121a","ring":"#4ea3ff","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#04c1d0","infoForeground":"#001b1e","chart":["#4ea3ff","#2dcfc2","#8e7cff","#b477c4","#7ee4e9","#828f38","#ffcde8","#79818c"],"aurora":["#14408a","#0f5e66","#33298a"],"auroraBase":"#050507","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#0051bb","ring":"#0051bb"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#83bdff","ring":"#83bdff"}},
  },
  rose: {
    light: {"primary":"#ca2c5a","primaryForeground":"#fcfcfc","ring":"#ca2c5a","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#ca2c5a","#b57bff","#ff9467","#9d6300","#e1bdfd","#006787","#baab70","#928183"],"aurora":["#ffb3c8","#e2b8ff","#ffd3de"],"auroraBase":"#eef0f5","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#ff6b8e","primaryForeground":"#190e10","ring":"#ff6b8e","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#ff6b8e","#b57bff","#ff9467","#c38229","#e4c1ff","#2293bb","#eedfa2","#8c7c7d"],"aurora":["#8a2346","#5e2c86","#4a1f66"],"auroraBase":"#050507","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#ad0044","ring":"#ad0044"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#ff9cae","ring":"#ff9cae"}},
  },
  sage: {
    light: {"primary":"#007d4c","primaryForeground":"#fcfcfc","ring":"#007d4c","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#677000","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#007d4c","#93cc3f","#32b2d6","#007f98","#decf84","#923f48","#7fb1da","#7d8a82"],"aurora":["#b2eacb","#dcf2a8","#a9dfea"],"auroraBase":"#eef0f5","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#4cd08f","primaryForeground":"#0a140e","ring":"#4cd08f","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#a8b532","successForeground":"#161802","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#4cd08f","#93cc3f","#32b2d6","#04a3c2","#e1d288","#c0686f","#c2e3ff","#77847c"],"aurora":["#1c6644","#466620","#145a66"],"auroraBase":"#050507","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#00633b","ring":"#00633b"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#6aeba8","ring":"#6aeba8"}},
  },
  amber: {
    light: {"primary":"#9d5e01","primaryForeground":"#fcfcfc","ring":"#9d5e01","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#bbc93c","warningForeground":"#161802","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#9d5e01","#ff6f4f","#e8c21b","#5f7e1b","#ffb7c5","#57539a","#85ba92","#8f847a"],"aurora":["#ffd899","#ffbba3","#fff0b4"],"auroraBase":"#eef0f5","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#ffb340","primaryForeground":"#181008","ring":"#ffb340","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#bbc93c","warningForeground":"#161802","info":"#47b5fa","infoForeground":"#031826","chart":["#ffb340","#ff6f4f","#e8c21b","#7fa042","#ffbcc9","#7e7cc7","#b7eec4","#897e74"],"aurora":["#7a520e","#7a321f","#5e5613"],"auroraBase":"#050507","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#7e4a00","ring":"#7e4a00"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#ffd7a3","ring":"#ffd7a3"}},
  },
  graphite: {
    light: {"primary":"#1c1c1e","primaryForeground":"#fcfcfc","ring":"#1c1c1e","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#1c1c1e","#7c7c84","#aeaeb4","#796e73","#c6d0d4","#596059","#b1a8a9","#858592"],"aurora":["#d3d8e2","#e4def0","#ccdfe8"],"auroraBase":"#eef0f5","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#f2f2f7","primaryForeground":"#0b0b0b","ring":"#f2f2f7","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#f2f2f7","#7c7c84","#aeaeb4","#9a8e94","#c9d3d7","#818881","#e4dbdc","#7f7f8c"],"aurora":["#30343f","#3a3446","#24343e"],"auroraBase":"#050507","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#0a0a0c","ring":"#0a0a0c"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#ffffff","ring":"#ffffff"}},
  },
  lavender: {
    light: {"primary":"#8059bb","primaryForeground":"#fcfcfc","ring":"#8059bb","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#8059bb","#cb6ab2","#96b6ff","#a8506f","#9cd6ff","#146f46","#d69992","#888491"],"aurora":["#d2bff9","#efb1dc","#cfdeff"],"auroraBase":"#f1eef7","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#b895f5","primaryForeground":"#140e1d","ring":"#b895f5","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#b895f5","#e07dc5","#a9c3ff","#cd718f","#a3d8ff","#47996e","#ffd2cc","#827e8b"],"aurora":["#5d4089","#6c1b5b","#364b7e"],"auroraBase":"#060509","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#6941a1","ring":"#6941a1"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#ceb5ff","ring":"#ceb5ff"}},
  },
  mint: {
    light: {"primary":"#017a58","primaryForeground":"#fcfcfc","ring":"#017a58","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#677000","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#017a58","#b078c9","#f699a0","#017d9f","#d5d196","#466932","#99b58b","#7c8a83"],"aurora":["#9edabf","#dbb9eb","#ffd1d3"],"auroraBase":"#e9f3ee","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#54c398","primaryForeground":"#04160e","ring":"#54c398","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#a8b532","successForeground":"#161802","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#54c398","#c38adc","#ffa9af","#3b9fc2","#d8d499","#6e935a","#cce8bd","#76847d"],"aurora":["#006245","#592a6c","#713a3f"],"auroraBase":"#030705","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#006144","ring":"#006144"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#70ddb1","ring":"#70ddb1"}},
  },
  cherry: {
    light: {"primary":"#d02a3a","primaryForeground":"#fcfcfc","ring":"#d02a3a","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#d02a3a","#02a6af","#ff9968","#926a01","#f3b3fc","#9d3438","#67bf9c","#928281"],"aurora":["#ffb4b1","#50dee8","#ffd3bf"],"auroraBase":"#f8edec","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#ff7e7d","primaryForeground":"#1d0c0b","ring":"#ff7e7d","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#ff7e7d","#05bbc5","#ffae88","#bb8800","#f5b7ff","#cd5f5f","#9bf4cf","#8c7c7b"],"aurora":["#961c28","#004c51","#7f3200"],"auroraBase":"#090404","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#b10025","ring":"#b10025"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#ffaaa7","ring":"#ffaaa7"}},
  },
  lagoon: {
    light: {"primary":"#03767b","primaryForeground":"#fcfcfc","ring":"#03767b","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#03767b","#1b9ddd","#61d0a6","#4971b2","#b1dca8","#864e1c","#a6a5d6","#798a8b"],"aurora":["#8cdade","#93d0f8","#baebd5"],"auroraBase":"#e7f3f3","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#08c2ca","primaryForeground":"#001517","ring":"#08c2ca","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#08c2ca","#39b0f1","#6fddb2","#6992d7","#b4dfab","#b27747","#dadaff","#738485"],"aurora":["#005f63","#00486a","#085b42"],"auroraBase":"#020707","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#005d61","ring":"#005d61"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#41dce4","ring":"#41dce4"}},
  },
  sand: {
    light: {"primary":"#87663f","primaryForeground":"#fcfcfc","ring":"#87663f","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#bbc93c","warningForeground":"#161802","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#87663f","#aa8d61","#d4af90","#677856","#e8c3c7","#4c5f79","#93b2ac","#8e8479"],"aurora":["#cebaa3","#e7d5b9","#f3e1d1"],"auroraBase":"#f6efe8","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#c5a47f","primaryForeground":"#1a0f03","ring":"#c5a47f","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#bbc93c","warningForeground":"#161802","info":"#47b5fa","infoForeground":"#031826","chart":["#c5a47f","#bda072","#e1bc9d","#879a75","#ebc6cb","#7487a4","#c6e6e0","#887e74"],"aurora":["#664d30","#553e17","#5e4835"],"auroraBase":"#080503","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#704f28","ring":"#704f28"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#dfbe97","ring":"#dfbe97"}},
  },
  midnight: {
    light: {"primary":"#545edc","primaryForeground":"#fcfcfc","ring":"#545edc","destructive":"#e30117","destructiveForeground":"#ffffff","success":"#017f38","successForeground":"#fcfcfc","warning":"#f3b01d","warningForeground":"#1f1401","info":"#0070a6","infoForeground":"#fcfcfc","chart":["#545edc","#ef5b36","#4cd588","#a54994","#68e1fc","#00697b","#99a6e7","#828593"],"aurora":["#bbc7ff","#ffb19d","#b4eec7"],"auroraBase":"#edf0f8","foreground":"#0a0a0a","label":"#000000","labelSecondary":"#3f3f46","labelTertiary":"#68686f","labelQuaternary":"#b0b1b4","frost":"#ffffff","glassSubtle":"rgba(255,255,255,0.28)","glass":"rgba(255,255,255,0.52)","glassStrong":"rgba(255,255,255,0.74)","glassThick":"rgba(255,255,255,0.86)","glassLiquid":"rgba(255,255,255,0.58)","glassLiquidClear":"rgba(255,255,255,0.1)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(255,255,255,0.92)","glassBorder":"rgba(255,255,255,0.85)","glassHighlight":"rgba(255,255,255,0.92)","glassShadow":"rgba(0,0,0,0.12)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.15)","fill":"rgba(120,120,128,0.12)","fillStrong":"rgba(120,120,128,0.2)","separator":"rgba(0,0,0,0.12)","thumb":"#ffffff","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.88,"edgeShade":0.22,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    dark: {"primary":"#93a3ff","primaryForeground":"#0e101f","ring":"#93a3ff","destructive":"#ff6668","destructiveForeground":"#ffffff","success":"#5ac576","successForeground":"#071b0c","warning":"#f3b01d","warningForeground":"#1f1401","info":"#47b5fa","infoForeground":"#031826","chart":["#93a3ff","#ff7553","#5be295","#c96bb7","#6ee4ff","#0396af","#d4dcff","#7c808d"],"aurora":["#3e45a2","#7a1a00","#005d33"],"auroraBase":"#05050a","foreground":"#fafafa","label":"#ffffff","labelSecondary":"#d6d7de","labelTertiary":"#919198","labelQuaternary":"#54555b","frost":"#1c1c1e","glassSubtle":"rgba(28,28,30,0.24)","glass":"rgba(28,28,30,0.45)","glassStrong":"rgba(28,28,30,0.72)","glassThick":"rgba(28,28,30,0.84)","glassLiquid":"rgba(28,28,30,0.48)","glassLiquidClear":"rgba(28,28,30,0.08)","glassClearDim":"rgba(0,0,0,0.35)","glassSolid":"rgba(28,28,30,0.94)","glassBorder":"rgba(255,255,255,0.12)","glassHighlight":"rgba(255,255,255,0.14)","glassShadow":"rgba(0,0,0,0.45)","shadowY":10,"shadowBlur":30,"dim":"rgba(0,0,0,0.45)","fill":"rgba(120,120,128,0.24)","fillStrong":"rgba(120,120,128,0.36)","separator":"rgba(255,255,255,0.16)","thumb":"rgba(255,255,255,0.2)","knob":"#ffffff","blur":28,"liquidBlur":18,"clearBlur":4,"saturate":1.8,"liquidSaturate":1.6,"brightness":1,"specular":0.65,"edgeShade":0.32,"illumination":0.22,"clarity":0.5,"radius":{"surface":24,"control":12,"button":999,"badge":999},"density":1,"hitMin":44,"ringWidth":3,"motion":{"duration":200,"pressScale":0.97,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1},"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":-0.02,"displayTracking":-0.03},"fonts":{}},
    highContrast: {"light":{"glassBorder":"rgba(0,0,0,0.4)","separator":"rgba(0,0,0,0.32)","labelSecondary":"#212127","labelTertiary":"#3c3c42","fill":"rgba(120,120,128,0.216)","fillStrong":"rgba(120,120,128,0.36)","primary":"#4144c0","ring":"#4144c0"},"dark":{"glassBorder":"rgba(255,255,255,0.5)","separator":"rgba(255,255,255,0.4)","labelSecondary":"#f1f1f8","labelTertiary":"#b6b7be","fill":"rgba(120,120,128,0.432)","fillStrong":"rgba(120,120,128,0.648)","primary":"#b3c0ff","ring":"#b3c0ff"}},
  },
}

export const PRESETS: { material: Record<MaterialName, Diff>; shape: Record<ShapeName, Diff>; motion: Record<MotionName, Diff>; density: Record<DensityName, Diff>; type: Record<TypeName, Diff> } = {
  material: {
    "frosted": {"light":{},"dark":{}},
    "vivid": {"light":{"glassSubtle":"rgba(255,255,255,0.14)","glass":"rgba(255,255,255,0.28)","glassStrong":"rgba(255,255,255,0.55)","glassThick":"rgba(255,255,255,0.7)","blur":16,"saturate":2.4},"dark":{"glassSubtle":"rgba(28,28,30,0.12)","glass":"rgba(28,28,30,0.26)","glassStrong":"rgba(28,28,30,0.55)","glassThick":"rgba(28,28,30,0.7)","blur":16,"saturate":2.4}},
    "crystal": {"light":{"glass":"rgba(255,255,255,0.38)","glassBorder":"#ffffff","glassHighlight":"#ffffff","blur":10,"saturate":1.5},"dark":{"glass":"rgba(28,28,30,0.34)","glassBorder":"rgba(255,255,255,0.28)","glassHighlight":"rgba(255,255,255,0.3)","blur":10,"saturate":1.5}},
    "smoked": {"light":{"label":"#fafafa","labelSecondary":"#d5d7de","frost":"#14161b","glassSubtle":"rgba(20,22,27,0.68)","glass":"rgba(20,22,27,0.72)","glassStrong":"rgba(20,22,27,0.86)","glassThick":"rgba(20,22,27,0.94)","glassLiquid":"rgba(20,22,27,0.72)","glassLiquidClear":"rgba(20,22,27,0.1)","glassSolid":"rgba(20,22,27,0.92)","glassBorder":"rgba(255,255,255,0.16)","glassHighlight":"rgba(255,255,255,0.18)","glassShadow":"rgba(0,0,0,0.3)","fill":"rgba(127,127,134,0.24)","fillStrong":"rgba(127,127,134,0.36)","separator":"rgba(250,250,250,0.12)","thumb":"rgba(255,255,255,0.2)","blur":30,"saturate":1.4,"brightness":0.85},"dark":{"frost":"#14161b","glassSubtle":"rgba(20,22,27,0.24)","glass":"rgba(20,22,27,0.6)","glassStrong":"rgba(20,22,27,0.84)","glassThick":"rgba(20,22,27,0.92)","glassLiquid":"rgba(20,22,27,0.48)","glassLiquidClear":"rgba(20,22,27,0.08)","glassSolid":"rgba(20,22,27,0.94)","blur":30,"saturate":1.4,"brightness":0.85}},
    "matte": {"light":{"glassSubtle":"rgba(255,255,255,0.75)","glass":"rgba(255,255,255,0.9)","glassStrong":"rgba(255,255,255,0.96)","glassThick":"#ffffff","blur":0,"liquidBlur":0,"clearBlur":0,"saturate":1},"dark":{"glassSubtle":"rgba(28,28,30,0.75)","glass":"rgba(28,28,30,0.9)","glassStrong":"rgba(28,28,30,0.96)","glassThick":"#1c1c1e","blur":0,"liquidBlur":0,"clearBlur":0,"saturate":1}},
    "vapor": {"light":{"glass":"rgba(255,255,255,0.4)","glassBorder":"rgba(255,255,255,0.35)","glassHighlight":"rgba(255,255,255,0.5)","shadowBlur":60,"blur":56,"saturate":2},"dark":{"glass":"rgba(28,28,30,0.35)","glassBorder":"rgba(255,255,255,0.06)","glassHighlight":"rgba(255,255,255,0.08)","shadowBlur":60,"blur":56,"saturate":2}},
    "neon": {"light":{"glass":"rgba(255,255,255,0.48)","glassBorder":"rgba(255,255,255,0.7)","blur":24,"saturate":2.2},"dark":{"glass":"rgba(28,28,30,0.4)","glassBorder":"rgba(255,255,255,0.22)","blur":24,"saturate":2.2}},
  },
  shape: {
    "round": {"light":{},"dark":{}},
    "soft": {"light":{"radius":{"surface":16,"control":10,"button":12,"badge":8}},"dark":{"radius":{"surface":16,"control":10,"button":12,"badge":8}}},
    "sharp": {"light":{"radius":{"surface":8,"control":6,"button":6,"badge":4}},"dark":{"radius":{"surface":8,"control":6,"button":6,"badge":4}}},
    "square": {"light":{"radius":{"surface":0,"control":0,"button":0,"badge":0}},"dark":{"radius":{"surface":0,"control":0,"button":0,"badge":0}}},
  },
  motion: {
    "spring": {"light":{},"dark":{}},
    "smooth": {"light":{"motion":{"duration":220,"pressScale":0.98,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1}},"dark":{"motion":{"duration":220,"pressScale":0.98,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1}}},
    "snappy": {"light":{"motion":{"duration":160,"pressScale":0.94,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1}},"dark":{"motion":{"duration":160,"pressScale":0.94,"pressStretch":0.04,"pressGrow":1.04,"knobLensScale":1.15,"auroraSpeed":1}}},
    "still": {"light":{"motion":{"duration":0,"pressScale":1,"pressStretch":0,"pressGrow":1,"knobLensScale":1,"auroraSpeed":0.0001}},"dark":{"motion":{"duration":0,"pressScale":1,"pressStretch":0,"pressGrow":1,"knobLensScale":1,"auroraSpeed":0.0001}}},
  },
  density: {
    "compact": {"light":{"density":0.85},"dark":{"density":0.85}},
    "default": {"light":{},"dark":{}},
    "comfortable": {"light":{"density":1.15},"dark":{"density":1.15}},
  },
  type: {
    "default": {"light":{"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":650,"displayWeight":700,"tracking":0,"headingTracking":-0.015,"displayTracking":-0.03}},"dark":{"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":650,"displayWeight":700,"tracking":0,"headingTracking":-0.015,"displayTracking":-0.03}}},
    "system": {"light":{},"dark":{}},
    "modern": {"light":{"type":{"scale":1,"ratio":1.2,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":600,"displayWeight":700,"tracking":0,"headingTracking":-0.025,"displayTracking":-0.04},"fonts":{"sans":"Geist","heading":"Geist","mono":"Geist Mono"}},"dark":{"type":{"scale":1,"ratio":1.2,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":600,"displayWeight":700,"tracking":0,"headingTracking":-0.025,"displayTracking":-0.04},"fonts":{"sans":"Geist","heading":"Geist","mono":"Geist Mono"}}},
    "editorial": {"light":{"type":{"scale":1,"ratio":1.333,"leading":1.7,"headingLeading":1.05,"bodyWeight":400,"headingWeight":400,"displayWeight":400,"tracking":0,"headingTracking":-0.01,"displayTracking":-0.02},"fonts":{"sans":"Inter","heading":"Instrument Serif","display":"Instrument Serif","mono":"JetBrains Mono"}},"dark":{"type":{"scale":1,"ratio":1.333,"leading":1.7,"headingLeading":1.05,"bodyWeight":400,"headingWeight":400,"displayWeight":400,"tracking":0,"headingTracking":-0.01,"displayTracking":-0.02},"fonts":{"sans":"Inter","heading":"Instrument Serif","display":"Instrument Serif","mono":"JetBrains Mono"}}},
    "friendly": {"light":{"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":500,"headingWeight":800,"displayWeight":900,"tracking":0,"headingTracking":-0.01,"displayTracking":-0.03},"fonts":{"sans":"Nunito","heading":"Nunito","display":"Nunito"}},"dark":{"type":{"scale":1,"ratio":1.25,"leading":1.6,"headingLeading":1.15,"bodyWeight":500,"headingWeight":800,"displayWeight":900,"tracking":0,"headingTracking":-0.01,"displayTracking":-0.03},"fonts":{"sans":"Nunito","heading":"Nunito","display":"Nunito"}}},
    "technical": {"light":{"type":{"scale":1,"ratio":1.2,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":600,"displayWeight":500,"tracking":0,"headingTracking":0.04,"displayTracking":-0.02},"fonts":{"sans":"IBM Plex Sans","heading":"Space Grotesk","display":"JetBrains Mono","mono":"JetBrains Mono"}},"dark":{"type":{"scale":1,"ratio":1.2,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":600,"displayWeight":500,"tracking":0,"headingTracking":0.04,"displayTracking":-0.02},"fonts":{"sans":"IBM Plex Sans","heading":"Space Grotesk","display":"JetBrains Mono","mono":"JetBrains Mono"}}},
    "classic": {"light":{"type":{"scale":1.06,"ratio":1.414,"leading":1.75,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":0,"displayTracking":-0.03},"fonts":{"sans":"Newsreader","heading":"Playfair Display","display":"Playfair Display","mono":"IBM Plex Mono"}},"dark":{"type":{"scale":1.06,"ratio":1.414,"leading":1.75,"headingLeading":1.15,"bodyWeight":400,"headingWeight":700,"displayWeight":700,"tracking":0,"headingTracking":0,"displayTracking":-0.03},"fonts":{"sans":"Newsreader","heading":"Playfair Display","display":"Playfair Display","mono":"IBM Plex Mono"}}},
    "grotesk": {"light":{"type":{"scale":1,"ratio":1.333,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":750,"displayWeight":800,"tracking":0,"headingTracking":-0.035,"displayTracking":-0.05},"fonts":{"sans":"DM Sans","heading":"Bricolage Grotesque","display":"Bricolage Grotesque","mono":"DM Mono"}},"dark":{"type":{"scale":1,"ratio":1.333,"leading":1.6,"headingLeading":1.15,"bodyWeight":400,"headingWeight":750,"displayWeight":800,"tracking":0,"headingTracking":-0.035,"displayTracking":-0.05},"fonts":{"sans":"DM Sans","heading":"Bricolage Grotesque","display":"Bricolage Grotesque","mono":"DM Mono"}}},
  },
}
components/glass/native/glass.tsx
import * as React from "react"
import { Platform, StyleSheet, View, useColorScheme, type StyleProp, type ViewProps, type ViewStyle } from "react-native"
import { BlurTargetView, BlurView, type BlurTint } from "expo-blur"
import { GlassContainer, GlassView, isGlassEffectAPIAvailable, isLiquidGlassAvailable } from "expo-glass-effect"

import { useReducedMotion, useReduceTransparency } from "@/components/glass/native/a11y"
import { CLEAR_MEDIA_LABELS, GlassThemeProvider, NativeGlassLabelsContext, nativeGlassLabels, useGlassTheme, useGlassThemeOptions, type GlassTheme } from "@/components/glass/native/tokens"

export { useReduceTransparency }

let liquid: boolean | null = null
/**
 * Liquid Glass (iOS 26+) when the OS has it. Checked once. Both checks: some
 * iOS 26 betas report Liquid Glass but lack the API and crash on GlassView.
 */
export function hasLiquidGlass() {
  if (liquid === null) {
    try {
      liquid = Platform.OS === "ios" && isLiquidGlassAvailable() && isGlassEffectAPIAvailable()
    } catch {
      liquid = false
    }
  }
  return liquid
}

/**
 * Liquid Glass doesn't render when it, or any ancestor, has opacity 0 (Expo's
 * known issue), so never fade it: entrances on iOS 26 move (translate, scale)
 * or materialise (`Glass materialized`); a `Press` around liquid glass passes `dim={canFade()}`.
 */
export const canFade = () => !hasLiquidGlass()

// ---- Android blur tier: BlurView needs a target view holding what it blurs ----

const BlurTargetContext = React.createContext<React.RefObject<View | null> | null>(null)

/**
 * Android blur tier (NAT-83): wrap the content that glass floats over — usually the
 * screen background and its scroll view — and every `Glass` above it inside this
 * tree blurs it (expo-blur `dimezisBlurViewSdk31Plus`, Android 12+). Without it,
 * Android glass is a translucent fill. A plain View on iOS and the web.
 */
export function GlassBlurTarget({ style, children, ...props }: ViewProps) {
  const ref = React.useRef<View | null>(null)
  if (Platform.OS !== "android") {
    return (
      <View style={style} {...props}>
        {children}
      </View>
    )
  }
  return (
    <BlurTargetContext.Provider value={ref}>
      <BlurTargetView ref={ref} style={style} {...props}>
        {children}
      </BlurTargetView>
    </BlurTargetContext.Provider>
  )
}

export type GlassVariant = "material" | "liquid" | "liquid-clear"
export type GlassIntensity = "ultraThin" | "thin" | "regular" | "thick" | "subtle" | "default" | "strong"

export type GlassProps = ViewProps & {
  /**
   * `material` (default): the content layer — cards, panes, lists; a system material, never Liquid Glass.
   * `liquid`: the control layer — floating bars, buttons, menus, sheets; Liquid Glass on iOS 26.
   * `liquid-clear`: liquid over media. Dim bright media behind the surface with `Backdrop dim`.
   * Omitted with `interactive` → `liquid`.
   */
  variant?: GlassVariant
  /** Standard material thickness. Aliases: subtle=ultraThin, default=thin, strong=regular. System Liquid Glass owns its thickness. */
  intensity?: GlassIntensity
  radius?: number
  /** An accent wash mixed into the frost (never an opaque background). */
  tint?: string
  /** Omit to follow the OS, or the provider's explicitly forced scheme. */
  colorScheme?: "auto" | "light" | "dark"
  /** A soft drop shadow (the frost carries its own depth on iOS 26 liquid). */
  raised?: boolean
  /** Liquid Glass reacts to touch — buttons, tab bars. Implies `liquid`. */
  interactive?: boolean
  /** Top chrome that fades with scroll: a chrome material, never Liquid Glass. */
  bar?: boolean
  /** Hide the surface, its children and accessibility when false. Never changes opacity. */
  visible?: boolean
  /** Animate only the system effect. Use while an overlay remains mounted through its exit. */
  materialized?: boolean
}

const MATERIAL_TINT: Record<GlassIntensity, [BlurTint, BlurTint]> = {
  ultraThin: ["systemUltraThinMaterialLight", "systemUltraThinMaterialDark"],
  thin: ["systemThinMaterialLight", "systemThinMaterialDark"],
  regular: ["systemMaterialLight", "systemMaterialDark"],
  thick: ["systemThickMaterialLight", "systemThickMaterialDark"],
  subtle: ["systemUltraThinMaterialLight", "systemUltraThinMaterialDark"],
  default: ["systemThinMaterialLight", "systemThinMaterialDark"],
  strong: ["systemMaterialLight", "systemMaterialDark"],
}

/** Frost colour for a variant/intensity where the platform has no material of its own. */
function frostOf(t: GlassTheme, variant: GlassVariant, intensity: GlassIntensity) {
  if (variant === "liquid") return t.glassLiquid
  if (variant === "liquid-clear") return t.glassLiquidClear
  return intensity === "subtle" || intensity === "ultraThin" ? t.glassSubtle : intensity === "thick" ? t.glassThick : intensity === "strong" || intensity === "regular" ? t.glassStrong : t.glass
}

/** `#rrggbb` → rgba at alpha; other formats pass through. */
const wash = (c: string, a: number) => {
  if (!/^#[0-9a-f]{6}$/i.test(c)) return c
  const n = parseInt(c.slice(1), 16)
  return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${a})`
}

function shadowOf(t: GlassTheme): ViewStyle {
  return Platform.select<ViewStyle>({
    web: { boxShadow: `0 ${t.shadowY}px ${t.shadowBlur}px ${t.glassShadow}` } as ViewStyle,
    // translucent fill + elevation draws a dark halo on Android (NAT-17); RN 0.76+ boxShadow doesn't
    android: { boxShadow: `0 ${Math.round(t.shadowY / 2)}px ${Math.round(t.shadowBlur / 2)}px ${t.glassShadow}` } as ViewStyle,
    default: { shadowColor: t.glassShadow.startsWith("rgba") ? t.glassShadow.replace(/,[\d.]+\)$/, ",1)") : t.glassShadow, shadowOpacity: alphaOf(t.glassShadow), shadowRadius: t.shadowBlur / 2, shadowOffset: { width: 0, height: t.shadowY } },
  }) as ViewStyle
}
const alphaOf = (c: string) => {
  const m = c.match(/,([\d.]+)\)$/)
  return m ? Number(m[1]) : 1
}

/**
 * Glass for React Native — two layers, like Apple's:
 *
 * - **material** (content): iOS → UIVisualEffect system material · web → token backdrop-filter ·
 *   Android → blur tier inside `GlassBlurTarget`, else a translucent fill.
 * - **liquid** (controls): iOS 26 → Liquid Glass (`GlassView`) · elsewhere → the liquid frost tokens.
 *
 * Reduce Transparency → an opaque fill with a firm border on every path.
 * Never put another effect inside liquid, and never animate opacity on or above it.
 */
export function Glass(props: GlassProps) {
  const onLiquid = React.useContext(OnLiquidContext)
  const variant: GlassVariant = props.bar ? "material" : (props.variant ?? (props.interactive ? "liquid" : "material"))
  const resolved: GlassProps = props.visible === false ? {
    ...props,
    style: [props.style, { display: "none" }],
    pointerEvents: "none",
    accessibilityElementsHidden: true,
    importantForAccessibility: "no-hide-descendants",
    "aria-hidden": true,
  } : props
  // Glass can't sample glass; nested surfaces keep only their shape and tint.
  if (onLiquid) return <ClearGlass {...resolved} />
  const surface = <GlassSurface {...resolved} variant={variant} />
  return variant === "material" ? surface : <OnLiquidContext.Provider value={true}>{surface}</OnLiquidContext.Provider>
}

const GLASS_KEYS = new Set(["variant", "intensity", "radius", "tint", "colorScheme", "raised", "interactive", "bar", "visible", "materialized", "style", "children"])
/** The plain View props of a GlassProps. */
const viewPropsOf = (p: GlassProps) => Object.fromEntries(Object.entries(p).filter(([k]) => !GLASS_KEYS.has(k))) as ViewProps

/** True under a liquid `Glass`: controls there are fills, and nested liquid renders clear. */
const OnLiquidContext = React.createContext(false)
export const useOnLiquid = () => React.useContext(OnLiquidContext)

function ClearGlass(props: GlassProps) {
  const { radius, tint, style, children, visible = true } = props
  const rest = viewPropsOf(props)
  const t = useGlassTheme()
  const shape: ViewStyle = { borderRadius: radius ?? t.radius.surface, borderCurve: "continuous" }
  return (
    <View style={[shape, tint ? { backgroundColor: wash(tint, t.scheme === "dark" ? 0.32 : 0.22) } : null, visible ? null : { transform: [{ scale: 0.96 }], pointerEvents: "none" }, style]} {...rest}>
      {children}
    </View>
  )
}

function GlassSurface({ variant: variantProp, intensity = "default", radius, tint, colorScheme, raised = true, interactive, bar, visible = true, materialized = true, style, children, ...rest }: GlassProps) {
  const t = useGlassTheme()
  const options = useGlassThemeOptions()
  const solid = useReduceTransparency() || (t.blur === 0 && t.liquidBlur === 0 && t.clearBlur === 0)
  const still = useReducedMotion() || t.motion.duration === 0
  const blurTarget = React.useContext(BlurTargetContext)
  const variant = variantProp as GlassVariant
  const shape: ViewStyle = { borderRadius: radius ?? t.radius.surface, borderCurve: "continuous" }
  const dark = t.scheme === "dark"
  const nativeLiquid = variant !== "material" && hasLiquidGlass() && !solid
  const labels = variant === "liquid-clear" && !solid ? CLEAR_MEDIA_LABELS : nativeLiquid ? nativeGlassLabels(t, options.tokens) : null
  const content = labels ? <GlassThemeProvider tokens={labels}>{children}</GlassThemeProvider> : children
  // Visibility is already display:none; no branch uses opacity to hide the effect.
  const hidden: ViewStyle | null = visible ? null : { transform: [{ scale: 0.96 }], pointerEvents: "none" }

  // Keep the system's untinted material and timing unless the caller makes an explicit choice.
  if (nativeLiquid) {
    const glassStyle = variant === "liquid-clear" ? "clear" : "regular"
    return (
      <GlassView
        glassEffectStyle={{ style: visible && materialized ? glassStyle : "none", animate: !still }}
        colorScheme={colorScheme ?? options.scheme ?? "auto"}
        tintColor={tint}
        isInteractive={interactive}
        style={[shape, style]}
        {...rest}
      >
        <NativeGlassLabelsContext.Provider value={variant === "liquid" && tint === undefined ? t : null}>{content}</NativeGlassLabelsContext.Provider>
      </GlassView>
    )
  }

  const tintLayer = tint ? <View style={[StyleSheet.absoluteFill, shape, { pointerEvents: "none", backgroundColor: wash(tint, dark ? 0.32 : 0.22) }]} /> : null
  const border: ViewStyle = { borderWidth: StyleSheet.hairlineWidth, borderColor: t.glassBorder }

  // Reduce Transparency: no blur — the solid fill, a border that holds its edge
  if (solid) {
    return (
      <View style={[shape, { backgroundColor: t.frost, borderWidth: 1, borderColor: t.fillStrong }, raised ? shadowOf(t) : null, hidden, style]} {...rest}>
        {tintLayer}
        {children}
      </View>
    )
  }

  const frost = frostOf(t, variant, intensity)
  const liquidish = variant !== "material"

  if (Platform.OS === "web") {
    const blur = variant === "liquid-clear" ? t.clearBlur : liquidish ? t.liquidBlur : t.blur
    const filter = `blur(${blur}px) saturate(${liquidish ? t.liquidSaturate : t.saturate}) brightness(${t.brightness})`
    const rim = liquidish ? `inset 0 1px 0 ${t.glassHighlight}, inset 0 -1px 0 ${wash("#000000", t.edgeShade)}` : `inset 0 1px 0 ${t.glassHighlight}`
    return (
      <View
        style={[
          shape,
          {
            backgroundColor: frost,
            backgroundImage: tint ? `linear-gradient(${wash(tint, dark ? 0.32 : 0.22)}, ${wash(tint, dark ? 0.32 : 0.22)})` : undefined,
            // liquid glass has no uniform stroke; its inset rim lights one edge and shades the other
            borderWidth: 1,
            borderColor: liquidish ? "transparent" : t.glassBorder,
            backdropFilter: filter,
            WebkitBackdropFilter: filter,
            boxShadow: raised ? `0 ${t.shadowY}px ${t.shadowBlur}px ${t.glassShadow}, ${rim}` : rim,
            transitionProperty: "transform",
            transitionDuration: `${t.motion.duration}ms`,
          } as ViewStyle,
          hidden,
          style,
        ]}
        {...rest}
      >
        {content}
      </View>
    )
  }

  if (Platform.OS === "android") {
    // blur tier when a GlassBlurTarget holds the backdrop; a fill otherwise (stronger, since nothing blurs behind it)
    const fill = blurTarget ? frost : liquidish ? t.glassStrong : t.glassSolid
    return (
      <View style={[shape, raised ? shadowOf(t) : null, hidden, style]} {...rest}>
        <View style={[StyleSheet.absoluteFill, shape, { overflow: "hidden" }]}>
          {blurTarget ? <BlurView blurTarget={blurTarget} blurMethod="dimezisBlurViewSdk31Plus" intensity={liquidish ? 40 : 70} tint={dark ? "dark" : "light"} style={StyleSheet.absoluteFill} /> : null}
          <View style={[StyleSheet.absoluteFill, { backgroundColor: fill }, border, shape]} />
          {tintLayer}
        </View>
        {content}
      </View>
    )
  }

  // iOS material (every version), and liquid below iOS 26: UIVisualEffect blur.
  // The shadow sits on the outer view; the blur clips in an inner one (NAT-16).
  const material = bar ? (dark ? "systemChromeMaterialDark" : "systemChromeMaterialLight") : MATERIAL_TINT[liquidish ? "subtle" : intensity][dark ? 1 : 0]
  return (
    <View style={[shape, raised ? shadowOf(t) : null, hidden, style]} {...rest}>
      <View style={[StyleSheet.absoluteFill, shape, { overflow: "hidden", pointerEvents: "none" }]}>
        <BlurView tint={material} intensity={liquidish ? 60 : 90} style={StyleSheet.absoluteFill} />
        <View style={[StyleSheet.absoluteFill, shape, border]} />
        {tintLayer}
      </View>
      {content}
    </View>
  )
}

/**
 * Apple's GlassEffectContainer: Liquid Glass children within `spacing` of each other
 * merge and morph as one. iOS 26: `GlassContainer`; elsewhere a plain View.
 */
export function GlassEffectGroup({ spacing = 8, merge = false, style, children, ...props }: ViewProps & {
  spacing?: number
  style?: StyleProp<ViewStyle>
  /** Keep the system container even when the theme forces the other scheme: clear controls over media, where merging matters more than appearance. */
  merge?: boolean
}) {
  const t = useGlassTheme()
  const options = useGlassThemeOptions()
  const system = useColorScheme()
  const solid = useReduceTransparency() || (t.blur === 0 && t.liquidBlur === 0 && t.clearBlur === 0)
  // GlassContainer renders its children's effects with the window's appearance and takes no
  // colorScheme. When a theme forces the other scheme, separate effects (which do take one) keep
  // the glass in the app's scheme; they lose only the merging.
  const forcedOther = !merge && !!options.scheme && !!system && options.scheme !== system
  if (hasLiquidGlass() && !solid && !forcedOther)
    return (
      <GlassContainer spacing={spacing} style={style} {...props}>
        {children}
      </GlassContainer>
    )
  return (
    <View style={style} {...props}>
      {children}
    </View>
  )
}
components/glass/native/aurora.tsx
import * as React from "react"
import { StyleSheet, View, useWindowDimensions, type LayoutChangeEvent } from "react-native"
import Animated, { cancelAnimation, Easing, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from "react-native-reanimated"
import { Circle, Defs, RadialGradient, Stop, Svg } from "react-native-svg"

import { useReducedMotion } from "@/components/glass/native/a11y"
import { useGlassTheme } from "@/components/glass/native/tokens"

const BLOBS = [
  { x: -0.25, y: -0.12, size: 1.25, dx: 40, dy: 30, ms: 17000 },
  { x: 0.45, y: 0.12, size: 1.05, dx: -36, dy: 44, ms: 21000 },
  { x: -0.1, y: 0.62, size: 1.2, dx: 30, dy: -38, ms: 19000 },
]

function Blob({ color, i, w, h, dark, still, speed }: { color: string; i: number; w: number; h: number; dark: boolean; still: boolean; speed: number }) {
  const id = React.useId().replace(/:/g, "")
  const t = useSharedValue(0)
  const b = BLOBS[i]
  const size = Math.max(w, 380) * b.size
  const ms = b.ms / Math.max(0.1, speed)
  React.useEffect(() => {
    if (still) {
      // Reduce Motion or paused: hold where it is
      cancelAnimation(t)
      return
    }
    t.set(withRepeat(withTiming(1, { duration: ms, easing: Easing.inOut(Easing.sin) }), -1, true))
    return () => cancelAnimation(t)
  }, [t, still, ms])
  const drift = useAnimatedStyle(() => ({
    transform: [{ translateX: t.value * b.dx }, { translateY: t.value * b.dy }, { scale: 1 + t.value * 0.08 }],
  }))
  return (
    <Animated.View style={[{ pointerEvents: "none", position: "absolute", left: b.x * w, top: b.y * h, width: size, height: size }, drift]}>
      <Svg width={size} height={size}>
        <Defs>
          <RadialGradient id={`a${id}`} cx="50%" cy="50%" r="50%">
            <Stop offset="0" stopColor={color} stopOpacity={dark ? 0.9 : 0.95} />
            <Stop offset="0.45" stopColor={color} stopOpacity={dark ? 0.45 : 0.55} />
            <Stop offset="1" stopColor={color} stopOpacity={0} />
          </RadialGradient>
        </Defs>
        <Circle cx={size / 2} cy={size / 2} r={size / 2} fill={`url(#a${id})`} />
      </Svg>
    </Animated.View>
  )
}

/**
 * The living ground behind glass: three palette blobs drifting over the base. Fills its parent and
 * sizes the blobs to it (onLayout — NAT-26). Reanimated on the UI thread; still under Reduce Motion
 * or a zero motion preset. `animate={false}` holds it still — e.g. while a ScrollView over it is dragged.
 */
export function Aurora({ animate = true }: { animate?: boolean } = {}) {
  const t = useGlassTheme()
  const still = useReducedMotion() || !animate || t.motion.duration === 0 || t.motion.auroraSpeed === 0
  const win = useWindowDimensions()
  const [box, setBox] = React.useState<{ width: number; height: number } | null>(null)
  const { width, height } = box ?? win
  return (
    <View
      onLayout={(e: LayoutChangeEvent) => {
        const { width: w, height: h } = e.nativeEvent.layout
        if (w && h && (w !== box?.width || h !== box?.height)) setBox({ width: w, height: h })
      }}
      style={[StyleSheet.absoluteFill, { pointerEvents: "none", backgroundColor: t.auroraBase, overflow: "hidden" }]}
    >
      {t.aurora.map((color, i) => (
        <Blob key={i} i={i} color={color} w={width} h={height} dark={t.scheme === "dark"} still={still} speed={t.motion.auroraSpeed || 1} />
      ))}
    </View>
  )
}
components/glass/native/press.tsx
import * as React from "react"
import { Platform, Pressable, StyleSheet, type GestureResponderEvent, type PressableProps, type StyleProp, type ViewStyle } from "react-native"
import Animated, { useAnimatedStyle, useSharedValue, withSpring, withTiming } from "react-native-reanimated"
import * as Haptics from "expo-haptics"

import { useReducedMotion } from "@/components/glass/native/a11y"
import { useUI } from "@/components/glass/native/ui"

const APressable = Animated.createAnimatedComponent(Pressable)

// ---- haptics: one switch for the app, no-op on the web ----

let hapticsOn = true
/** Turn every glasscn haptic off (e.g. from a settings screen). */
export function setHapticsEnabled(on: boolean) {
  hapticsOn = on
}
const can = () => hapticsOn && Platform.OS !== "web"

/** Typed haptics (NAT-20): selection changes, impacts, notifications. Never on scroll or press-in. */
export const haptics = {
  selection: () => can() && Haptics.selectionAsync().catch(() => {}),
  impact: (style: "light" | "medium" | "heavy" | "soft" | "rigid" = "light") =>
    can() && Haptics.impactAsync({ light: Haptics.ImpactFeedbackStyle.Light, medium: Haptics.ImpactFeedbackStyle.Medium, heavy: Haptics.ImpactFeedbackStyle.Heavy, soft: Haptics.ImpactFeedbackStyle.Soft, rigid: Haptics.ImpactFeedbackStyle.Rigid }[style]).catch(() => {}),
  notify: (type: "success" | "warning" | "error") =>
    can() && Haptics.notificationAsync({ success: Haptics.NotificationFeedbackType.Success, warning: Haptics.NotificationFeedbackType.Warning, error: Haptics.NotificationFeedbackType.Error }[type]).catch(() => {}),
}
export const useHaptics = () => haptics

/** Pressable's style-callback state, with hover (RN's own type lacks it in some versions). */
export type PressState = { pressed: boolean; hovered?: boolean }

export type PressProps = Omit<PressableProps, "style"> & {
  /** A selection haptic when the press lands (not on press-in, so scrolls never buzz). */
  haptic?: boolean
  /** Solid press squash; defaults to the theme's `pressScale`. */
  squash?: number
  /** Hover lift for pointers (web, iPad). */
  hover?: number
  /** Liquid glass grows on press (`pressGrow`) instead of squashing. */
  liquid?: boolean
  /**
   * Dim on press. Off by default; pass `dim={canFade()}` only when the Press doesn't
   * wrap Liquid Glass — glass stops rendering under a fading ancestor on iOS 26.
   */
  dim?: boolean
  style?: StyleProp<ViewStyle> | ((state: PressState) => StyleProp<ViewStyle>)
  /**
   * Radix's `asChild`: render the single child (a Button, a custom pressable) instead of a
   * Press of its own, merging onPress / onLongPress and accessibility props into it — so a
   * trigger wrapping a Button doesn't nest two pressables (the inner one would swallow the tap).
   */
  asChild?: boolean
}

type Pressish = { onPress?: (e: GestureResponderEvent) => void; onLongPress?: (e: GestureResponderEvent) => void; style?: unknown }
const chain =
  <E,>(a?: (e: E) => void, b?: (e: E) => void) =>
  (e: E) => {
    a?.(e)
    b?.(e)
  }

/**
 * Every tappable thing: an elastic spring press (solid squashes wider-and-shorter,
 * liquid grows), an optional dim, a selection haptic when asked, and a hover lift.
 * Reanimated on the UI thread; none of it under Reduce Motion.
 */
export function Press(props: PressProps) {
  // triggers map string children into text first, so the single child may arrive in an array
  const only = props.asChild && typeof props.children !== "function" ? React.Children.toArray(props.children) : []
  if (only.length === 1 && React.isValidElement<Pressish>(only[0])) return <PressSlot {...props}>{only[0]}</PressSlot>
  return <PressView {...props} />
}

function PressSlot({ children, onPress, onLongPress, haptic, style, asChild: _a, squash: _s, hover: _h, liquid: _l, dim: _d, ...rest }: PressProps) {
  void [_a, _s, _h, _l, _d]
  const child = children as React.ReactElement<Pressish>
  const own = typeof style === "function" ? style({ pressed: false, hovered: false }) : style
  return React.cloneElement(child, {
    // accessibility and state props from the trigger (aria-expanded, aria-haspopup…), the child's own win
    ...(rest as object),
    ...child.props,
    onPress: chain<GestureResponderEvent>(child.props.onPress, (e) => {
      if (haptic) haptics.selection()
      onPress?.(e)
    }),
    onLongPress: onLongPress || child.props.onLongPress ? chain(child.props.onLongPress, onLongPress ?? undefined) : undefined,
    style: own ? [own, child.props.style as StyleProp<ViewStyle>] : child.props.style,
  })
}

function PressView({ haptic = false, squash, hover = 1, liquid = false, dim = false, style, onPress, onPressIn, onPressOut, onHoverIn, onHoverOut, disabled, accessibilityRole = "button", asChild: _asChild, ...props }: PressProps) {
  void _asChild
  const ui = useUI()
  const still = useReducedMotion() || ui.motion.duration === 0
  const sx = useSharedValue(1)
  const sy = useSharedValue(1)
  const fade = useSharedValue(1)
  const [pressed, setPressed] = React.useState(false)
  const [hovered, setHovered] = React.useState(false)
  const spring = ui.motion.springConfig
  React.useEffect(() => {
    if (still) {
      sx.set(1)
      sy.set(1)
      fade.set(1)
    }
  }, [still, sx, sy, fade])

  const to = (x: number, y: number) => {
    if (still) return
    sx.set(withSpring(x, spring))
    sy.set(withSpring(y, spring))
  }
  const down = () => {
    if (liquid) to(ui.motion.pressGrow, ui.motion.pressGrow)
    else {
      const s = squash ?? ui.motion.pressScale
      const k = ui.motion.pressStretch
      to(s * (1 + k), s * (1 - k))
    }
    if (dim && !still) fade.set(withTiming(0.72, { duration: 80 }))
  }
  const up = () => {
    to(hovered ? hover : 1, hovered ? hover : 1)
    if (dim) fade.set(still ? 1 : withTiming(1, { duration: 160 }))
  }

  const resolved = typeof style === "function" ? style({ pressed, hovered }) : style
  // a caller's resting opacity (a disabled dim) composes with the press dim
  const flat = StyleSheet.flatten(resolved)?.opacity
  const resting = typeof flat === "number" ? flat : 1
  const animated = useAnimatedStyle(() => (dim ? { transform: [{ scaleX: sx.value }, { scaleY: sy.value }], opacity: fade.value * resting } : { transform: [{ scaleX: sx.value }, { scaleY: sy.value }] }))

  return (
    <APressable
      disabled={disabled}
      accessibilityRole={accessibilityRole}
      aria-disabled={disabled || undefined}
      onPress={(e: GestureResponderEvent) => {
        if (haptic && !disabled) haptics.selection()
        onPress?.(e)
      }}
      onPressIn={(e: GestureResponderEvent) => {
        setPressed(true)
        down()
        onPressIn?.(e)
      }}
      onPressOut={(e: GestureResponderEvent) => {
        setPressed(false)
        up()
        onPressOut?.(e)
      }}
      onHoverIn={(e) => {
        setHovered(true)
        if (hover !== 1 && !disabled) to(hover, hover)
        onHoverIn?.(e)
      }}
      onHoverOut={(e) => {
        setHovered(false)
        if (hover !== 1) to(1, 1)
        onHoverOut?.(e)
      }}
      style={[resolved, animated]}
      {...props}
    />
  )
}
components/glass/native/ui.tsx
import * as React from "react"
import { DynamicColorIOS, Platform, PlatformColor, StyleSheet, Text as RNText, type ColorValue, type TextProps, type TextStyle } from "react-native"

import { MAX_FONT_SCALE, useBoldText } from "@/components/glass/native/a11y"
import { buildGlassTheme, NativeGlassLabelsContext, useGlassTheme, useGlassThemeOptions, type GlassTheme } from "@/components/glass/native/tokens"

/**
 * The React Native port of glasscn's CSS variables (glass-theme.ts TOKENS) as plain
 * numbers and colours. Every ported component reads this through useUI() — no
 * Tailwind, no CSS variables, so it runs the same on iOS, Android and web.
 */

export interface UI extends Omit<GlassTheme, "motion"> {
  /** Eight chart series — the web's --chart-1..8. */
  charts: [string, string, string, string, string, string, string, string]
  /** Quiet text: placeholders, unavailable items (label-tertiary). */
  muted: string
  /** Control heights (h-control*) × density. Tappable controls also get hitSlop to 44pt. */
  control: { xs: number; sm: number; default: number; lg: number }
  pad: { xs: number; sm: number; default: number; lg: number }
  /** Type steps in pt: the theme's ratio and base scale, like the web's type-step-*. */
  text: { xs: number; sm: number; base: number; lg: number; xl: number; "2xl": number; "3xl": number; "4xl": number; "5xl": number }
  weight: { body: TextStyle["fontWeight"]; heading: TextStyle["fontWeight"]; display: TextStyle["fontWeight"] }
  motion: GlassTheme["motion"] & {
    /** Reanimated `withSpring` config from the motion tokens (duration-based, so it matches the web's linear() spring). */
    springConfig: { duration: number; dampingRatio: number }
    /** Legacy RN Animated spring, for the few parts still on Animated. */
    spring: { friction: number; tension: number }
  }
}

const SYSTEM_FONTS = {
  display: Platform.select({ ios: "ui-rounded", web: 'ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif', default: undefined }),
  mono: Platform.select({ ios: "Menlo", web: "ui-monospace, Menlo, monospace", default: "monospace" }),
}

const weight = (n: number) => String(Math.round(n / 100) * 100) as TextStyle["fontWeight"]

export function buildUI(t: GlassTheme): UI {
  const d = t.density
  const step = (n: number) => Math.round(16 * t.type.scale * t.type.ratio ** n)
  const still = t.motion.duration === 0
  return {
    ...t,
    charts: t.chart,
    muted: t.labelTertiary,
    control: { xs: Math.round(28 * d), sm: Math.round(32 * d), default: Math.round(40 * d), lg: Math.round(48 * d) },
    pad: { xs: Math.round(10 * d), sm: Math.round(12 * d), default: Math.round(16 * d), lg: Math.round(22 * d) },
    // iOS sizes are Apple's default text-style sizes for the ramp each step maps to (Caption 1,
    // Subheadline, Body, Title 3, Title 2, Title 1, Large Title); other platforms keep the web's
    // modular scale. Both follow the type preset's scale.
    text: Platform.OS === "ios"
      ? { xs: Math.round(12 * t.type.scale), sm: Math.round(15 * t.type.scale), base: Math.round(17 * t.type.scale), lg: Math.round(20 * t.type.scale), xl: Math.round(22 * t.type.scale), "2xl": Math.round(28 * t.type.scale), "3xl": Math.round(34 * t.type.scale), "4xl": Math.max(Math.round(40 * t.type.scale), step(5)), "5xl": Math.max(Math.round(48 * t.type.scale), step(6)) }
      : { xs: Math.round(12 * t.type.scale), sm: step(-1) < 14 ? Math.round(14 * t.type.scale) : step(-1), base: step(0), lg: step(1), xl: step(2), "2xl": step(3), "3xl": step(4), "4xl": step(5), "5xl": step(6) },
    fonts: { sans: t.fonts.sans, heading: t.fonts.heading ?? t.fonts.sans, display: t.fonts.display ?? t.fonts.heading ?? SYSTEM_FONTS.display, mono: t.fonts.mono ?? SYSTEM_FONTS.mono },
    weight: { body: weight(t.type.bodyWeight), heading: weight(t.type.headingWeight), display: weight(t.type.displayWeight) },
    motion: {
      ...t.motion,
      springConfig: { duration: Math.max(1, t.motion.duration * 2.2), dampingRatio: still ? 1 : 0.78 },
      spring: { friction: 8, tension: still ? 1000 : 380 },
    },
  }
}

/** glasscn tokens for the ported components. */
export function useUI(): UI {
  const t = useGlassTheme()
  return React.useMemo(() => buildUI(t), [t])
}

/** `#RRGGBB` + alpha → rgba(). Leaves rgba()/named colours untouched. */
export function alpha(color: string, a: number): string {
  if (!color.startsWith("#") || (color.length !== 7 && color.length !== 4)) return color
  const hex = color.length === 4 ? color.replace(/^#(.)(.)(.)$/, "#$1$1$2$2$3$3") : color
  const n = parseInt(hex.slice(1), 16)
  return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${a})`
}

/** Web-only style keys (boxShadow, backdropFilter, cursor…) typed loosely so RN accepts them. */
export const web = (s: Record<string, unknown>) => (Platform.OS === "web" ? (s as object) : {})

/** Dynamic colors let UIKit apply the glass contentView's contrast and vibrancy. */
export function useGlassForeground(color?: ColorValue): ColorValue {
  const theme = useGlassTheme()
  const options = useGlassThemeOptions()
  const dynamic = React.useContext(NativeGlassLabelsContext)
  const accent = React.useMemo(() => Platform.OS === "ios" ? DynamicColorIOS({
    light: buildGlassTheme("light", theme.palette).primary,
    dark: buildGlassTheme("dark", theme.palette).primary,
    highContrastLight: buildGlassTheme("light", theme.palette, { highContrast: true }).primary,
    highContrastDark: buildGlassTheme("dark", theme.palette, { highContrast: true }).primary,
  }) : theme.primary, [theme.palette, theme.primary])
  const requested = color ?? theme.foreground
  if (!dynamic || Platform.OS !== "ios") return requested
  if (requested === theme.foreground || requested === theme.label || requested === dynamic.foreground || requested === dynamic.label) return PlatformColor("label")
  if (requested === theme.labelSecondary || requested === theme.mutedForeground || requested === dynamic.labelSecondary || requested === dynamic.mutedForeground) return PlatformColor("secondaryLabel")
  if (requested === theme.labelTertiary || requested === dynamic.labelTertiary) return PlatformColor("tertiaryLabel")
  if (requested === theme.labelQuaternary || requested === dynamic.labelQuaternary) return PlatformColor("quaternaryLabel")
  if (requested === theme.primary && options.tokens?.primary === undefined) return accent
  return requested
}

export function GIcon({ children, color, size }: { children: React.ReactElement<{ color?: ColorValue; size?: number }>; color?: ColorValue; size?: number }) {
  const foreground = useGlassForeground(children.props.color ?? color)
  return React.cloneElement(children, { color: foreground, size: children.props.size ?? size })
}

export type TextSize = keyof UI["text"]
const TYPE_RAMPS: Record<TextSize, TextProps["dynamicTypeRamp"]> = {
  xs: "caption1",
  sm: "subheadline",
  base: "body",
  lg: "title3",
  xl: "title2",
  "2xl": "title1",
  "3xl": "largeTitle",
  "4xl": "largeTitle",
  "5xl": "largeTitle",
}
export type TextTone = "default" | "muted" | "subtle" | "primary" | "destructive" | "onPrimary"
export type TextFont = "sans" | "heading" | "display" | "mono"

export type GTextProps = TextProps & {
  size?: TextSize
  tone?: TextTone
  font?: TextFont
  weight?: TextStyle["fontWeight"]
  /** Raw colour, wins over tone. */
  color?: string
  align?: TextStyle["textAlign"]
}

export function toneColor(ui: UI, tone: TextTone = "default") {
  switch (tone) {
    case "muted":
      return ui.mutedForeground
    case "subtle":
      return ui.muted
    case "primary":
      return ui.primary
    case "destructive":
      return ui.destructive
    case "onPrimary":
      return ui.primaryForeground
    default:
      return ui.foreground
  }
}

/** The base text every ported glasscn component sets type with. */
export function GText({ size = "base", tone = "default", font = "sans", weight, color, align, style, maxFontSizeMultiplier, dynamicTypeRamp, ...rest }: GTextProps) {
  const ui = useUI()
  const bold = useBoldText()
  const fontSize = ui.text[size]
  const fontWeight = weight ?? (font === "heading" ? ui.weight.heading : font === "display" ? ui.weight.display : ui.weight.body)
  const restingWeight = StyleSheet.flatten(style)?.fontWeight ?? fontWeight
  const numericWeight = Number(restingWeight) || (restingWeight === "bold" ? 700 : 400)
  const accessibleWeight = String(Math.min(900, Math.max(600, numericWeight + 100))) as TextStyle["fontWeight"]
  const foreground = useGlassForeground(StyleSheet.flatten(style)?.color ?? color ?? toneColor(ui, tone))
  return (
    <RNText
      dynamicTypeRamp={dynamicTypeRamp ?? (Platform.OS === "ios" ? TYPE_RAMPS[size] : undefined)}
      maxFontSizeMultiplier={maxFontSizeMultiplier ?? (font === "display" || fontSize >= 31 ? MAX_FONT_SCALE.display : font === "heading" ? MAX_FONT_SCALE.heading : MAX_FONT_SCALE.body)}
      style={[
        {
          color: color ?? toneColor(ui, tone),
          fontSize,
          lineHeight: Math.round(fontSize * (font === "heading" || font === "display" ? ui.type.headingLeading : Math.min(ui.type.leading, 1.5))),
          fontFamily: ui.fonts[font],
          fontWeight,
          letterSpacing: (font === "display" ? ui.type.displayTracking : font === "heading" ? ui.type.headingTracking : ui.type.tracking) * fontSize,
          fontVariant: font === "display" ? ["tabular-nums"] : undefined,
          textAlign: align,
        },
        style,
        bold ? { fontWeight: accessibleWeight } : null,
        { color: foreground },
      ]}
      {...rest}
    />
  )
}