/* Feen? design tokens: the light and dark themes of md/Feen — Design System.md, sections 3 to 6.
   Written by hand, never by an agent. ui_check.py compares the ramps, the colour roles,
   the spacing and the type scale with the Design System's tables: change the Design
   System first, then this file. 1dp = 1sp = 1px. */
@import url("https://fonts.googleapis.com/css2?family=Alexandria:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap");
@import url("https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.2/src/regular/style.css");
@import url("https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.2/src/fill/style.css");

:root {
  /* Brand ramps (§3). Limestone 0, 25, 850 and 950 are the extra steps listed under the table. */
  --nile-50: #E8F3F1;
  --nile-100: #CFE6E2;
  --nile-200: #A3CFC8;
  --nile-300: #6FB2A8;
  --nile-400: #3F9488;
  --nile-500: #1F786D;
  --nile-600: #0F5E57;
  --nile-700: #0B4A45;
  --nile-800: #083935;
  --nile-900: #052724;
  --saffron-50: #FBF3E6;
  --saffron-100: #F6E3C2;
  --saffron-200: #EDC98A;
  --saffron-300: #E2AC55;
  --saffron-400: #D4922F;
  --saffron-500: #B8741A;
  --saffron-600: #955C12;
  --saffron-700: #74470E;
  --saffron-800: #53330A;
  --saffron-900: #362106;
  --clay-50: #FBEDEA;
  --clay-100: #F5D4CD;
  --clay-200: #EDB1A4;
  --clay-300: #E08A77;
  --clay-400: #CC6450;
  --clay-500: #B3402E;
  --clay-600: #93321F;
  --clay-700: #72271A;
  --clay-800: #521C13;
  --clay-900: #34110B;
  --limestone-0: #FFFFFF;
  --limestone-25: #F9FAF8;
  --limestone-50: #F2F4F1;
  --limestone-100: #E6E9E5;
  --limestone-200: #D3D8D3;
  --limestone-300: #B5BCB6;
  --limestone-400: #8C948E;
  --limestone-500: #69716B;
  --limestone-600: #4F5752;
  --limestone-700: #39403C;
  --limestone-800: #252B28;
  --limestone-850: #1E2522;
  --limestone-900: #161B19;
  --limestone-950: #0D1110;

  /* Semantic roles, light (§3). */
  --color-background: #F2F4F1;
  --color-surface: #FFFFFF;
  --color-surface-sunken: #D3D8D3;
  --color-surface-raised: #FFFFFF;
  --color-surface-brand: #083935;
  --color-on-brand: #F2F4F1;
  --color-surface-brand-raised: #0B4A45;
  --color-ink: #161B19;
  --color-ink-muted: #4F5752;
  --color-ink-subtle: #5E6660;
  --color-outline: #D3D8D3;
  --color-outline-control: #7A827C;
  --color-outline-strong: #083935;
  --color-primary: #0F5E57;
  --color-on-primary: #FFFFFF;
  --color-accent: #D4922F;
  --color-on-accent: #161B19;
  --color-accent-text: #955C12;
  --color-error: #B3402E;
  --color-on-error: #FFFFFF;
  --color-error-container: #FBEDEA;
  --color-on-error-container: #72271A;
  /* Three roles added 27 Oct 2026 with dark mode, for raw ramp steps components used on light surfaces. */
  --color-surface-brand-tint: #E8F3F1; /* Nile 50: the level-0 identity band (city wall, outing band, notif band, category tag) */
  --color-error-on-ink: #EDB1A4; /* Clay 200: the error icon on the ink snackbar */
  --color-launch: #0F5E57; /* Nile 600: the launch screen (splash) */
  --color-district-fill: color-mix(in srgb, var(--color-surface-brand) 12%, transparent); /* the district tint: city map, map window, the slider's district band */
  --color-district-edge: var(--nile-300); /* city and district edges on the map; the same in dark */

  /* The three values outside the roles table (§3): the scrim, and onBrand at 50% and 12% on surfaceBrand. */
  --color-scrim: rgb(22 27 25 / 0.45);
  --color-on-brand-line: rgb(242 244 241 / 0.5);
  --color-on-brand-fill: rgb(242 244 241 / 0.12);

  /* Spacing, 4dp base (§5) */
  --space-2xs: 2px;
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 12px;
  --space-l: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 48px;

  /* Shape (§5): radii grow with the size of the thing. */
  --shape-xs: 6px;
  --shape-s: 8px;
  --shape-m: 12px;
  --shape-control: 14px;
  --shape-card: 16px;
  --shape-l: 18px;
  --shape-xl: 22px;
  --shape-2xl: 28px;
  --shape-full: 9999px;

  /* Elevation (§5) is flat: cards take a 1px var(--color-outline) edge, never a shadow. */

  /* States (§8): pressed fills drop to 90% opacity; outlines and text buttons get a 6% Nile 800 wash. */
  --state-pressed-opacity: 0.9;
  --state-wash: rgb(8 57 53 / 0.06);

  /* Motion (§7) */
  --duration-track: 80ms;
  --duration-quick: 150ms;
  --duration-standard: 250ms;
  --duration-emphasized: 400ms;
  --easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --easing-decelerate: cubic-bezier(0, 0, 0, 1); /* things entering (added 29 Sep 2026) */
  --easing-accelerate: cubic-bezier(0.3, 0, 1, 1); /* things leaving (added 29 Sep 2026) */
  /* spring.pick (dampingRatio 0.75, stiffness 400) has no CSS form; Compose only. */
  /* Since 14 Oct 2026 the app moves on springs (§7): track 5317, quick 1512, standard 544, emphasized 213, all dampingRatio 1,
     settling in the durations above. --easing-spring is that critically damped curve sampled for CSS; run it ~15% past the
     duration (quick 173ms, standard 288ms, emphasized 460ms) so the tail lands. */
  --easing-spring: linear(0, 0.0089 2.1%, 0.0325 4.2%, 0.0668 6.3%, 0.1086 8.3%, 0.1554 10.4%, 0.2051 12.5%, 0.2563 14.6%, 0.3076 16.7%, 0.3582 18.8%, 0.4073 20.8%, 0.4546 22.9%, 0.4996 25%, 0.5422 27.1%, 0.5821 29.2%, 0.6194 31.3%, 0.6541 33.3%, 0.6863 35.4%, 0.7159 37.5%, 0.7431 39.6%, 0.7681 41.7%, 0.7909 43.8%, 0.8117 45.8%, 0.8307 47.9%, 0.8479 50%, 0.8635 52.1%, 0.8776 54.2%, 0.8903 56.3%, 0.9019 58.3%, 0.9122 60.4%, 0.9216 62.5%, 0.93 64.6%, 0.9375 66.7%, 0.9443 68.8%, 0.9503 70.8%, 0.9558 72.9%, 0.9606 75%, 0.965 77.1%, 0.9688 79.2%, 0.9723 81.3%, 0.9754 83.3%, 0.9781 85.4%, 0.9806 87.5%, 0.9828 89.6%, 0.9847 91.7%, 0.9865 93.8%, 0.988 95.8%, 0.9894 97.9%, 1);
  /* spring.land (dampingRatio 0.6, stiffness 288) sampled for CSS; run it 403ms. */
  --easing-land: linear(0, 0.0096 2.1%, 0.036 4.2%, 0.0763 6.3%, 0.1274 8.3%, 0.1867 10.4%, 0.2519 12.5%, 0.3207 14.6%, 0.3913 16.7%, 0.4622 18.8%, 0.5319 20.8%, 0.5994 22.9%, 0.6638 25%, 0.7243 27.1%, 0.7804 29.2%, 0.8318 31.3%, 0.8782 33.3%, 0.9197 35.4%, 0.9561 37.5%, 0.9876 39.6%, 1.0144 41.7%, 1.0367 43.8%, 1.0548 45.8%, 1.0691 47.9%, 1.0798 50%, 1.0874 52.1%, 1.0921 54.2%, 1.0944 56.3%, 1.0946 58.3%, 1.093 60.4%, 1.0899 62.5%, 1.0856 64.6%, 1.0804 66.7%, 1.0746 68.8%, 1.0682 70.8%, 1.0616 72.9%, 1.0549 75%, 1.0482 77.1%, 1.0417 79.2%, 1.0354 81.3%, 1.0294 83.3%, 1.0239 85.4%, 1.0187 87.5%, 1.0141 89.6%, 1.0098 91.7%, 1.0061 93.8%, 1.0029 95.8%, 1.0001 97.9%, 1);

  /* Type families (§4) */
  --font-display: "Alexandria", sans-serif;
  --font-text: "IBM Plex Sans Arabic", sans-serif;

  /* matchRankHero (§4): the one type step above displayLarge, the match's featured rank, Alexandria 700, size and line
     both 120, set in dp and never scaled with font size. The rest of the scale lives in components.css (.type-*). */
  --match-rank-hero: 120px;
}

/* Dark theme (§3 Semantic roles, Dark column; added 27 Oct 2026). The app follows the phone's setting;
   a render sets data-theme="dark" on <html> (ui_shot.mjs --theme dark). Ramps never change, only roles. */
[data-theme="dark"] {
  color-scheme: dark;
  --color-background: #0D1110;
  --color-surface: #161B19;
  --color-surface-sunken: #39403C;
  --color-surface-raised: #1E2522;
  --color-surface-brand: #0B4A45;
  --color-on-brand: #E6E9E5;
  --color-surface-brand-raised: #0F5E57;
  --color-ink: #E6E9E5; /* Limestone 100: #EEF1EE smeared Arabic body on OLED (8 Nov 2026) */
  --color-ink-muted: #B5BCB6;
  --color-ink-subtle: #8C948E;
  --color-outline: #39403C;
  --color-outline-control: #8C948E;
  --color-outline-strong: #A3CFC8;
  --color-primary: #6FB2A8;
  --color-on-primary: #052724;
  --color-accent: #E2AC55;
  --color-on-accent: #362106;
  --color-accent-text: #E2AC55;
  --color-error: #E08A77;
  --color-on-error: #34110B;
  --color-error-container: #521C13;
  --color-on-error-container: #F5D4CD;
  --color-surface-brand-tint: #052724; /* Nile 900: Nile 800 left inkSubtle at 4.1:1 */
  --color-error-on-ink: #B3402E; /* Clay 500: the snackbar is light in dark */
  --color-launch: #0B4A45; /* Nile 700, the dark surfaceBrand */
  --color-district-fill: color-mix(in srgb, var(--nile-300) 14%, transparent);
  --color-scrim: rgb(0 0 0 / 0.6);
  --color-on-brand-line: rgb(230 233 229 / 0.5);
  --color-on-brand-fill: rgb(230 233 229 / 0.12);
  --state-wash: rgb(230 233 229 / 0.06);
  /* The middle rating tier in dark (8 Nov 2026): Nile 700 sat 1.05:1 from the low tier; Nile 500 with Nile 50 ink, 4.7:1. */
  --color-tier-middle: #1F786D;
  --color-on-tier-middle: #E8F3F1;
}

/* Reset. An artboard is one phone screen, 360 dp wide. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; text-align: inherit; }
.artboard { width: 360px; min-height: 800px; position: relative; overflow: hidden; display: flex; flex-direction: column; background: var(--color-background); color: var(--color-ink); font-family: var(--font-text); font-weight: 400; font-size: 16px; line-height: 24px; }

/* App type scale (§4). Arabic lines are taller, and Arabic never gets letter-spacing. */
.type-displayLarge { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 48px; letter-spacing: -0.01em; }
.type-displayLarge:lang(ar) { line-height: 56px; letter-spacing: 0; }
.type-headlineMedium { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 36px; letter-spacing: -0.01em; }
.type-headlineMedium:lang(ar) { line-height: 42px; letter-spacing: 0; }
.type-headlineSmall { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 32px; letter-spacing: -0.01em; }
.type-headlineSmall:lang(ar) { line-height: 38px; letter-spacing: 0; }
.type-titleLarge { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 26px; letter-spacing: -0.01em; }
.type-titleLarge:lang(ar) { line-height: 32px; letter-spacing: 0; }
.type-titleMedium { font-family: var(--font-text); font-weight: 600; font-size: 16px; line-height: 24px; }
.type-titleMedium:lang(ar) { line-height: 26px; }
.type-titleSmall { font-family: var(--font-text); font-weight: 600; font-size: 14px; line-height: 20px; }
.type-titleSmall:lang(ar) { line-height: 22px; }
.type-bodyLarge { font-family: var(--font-text); font-weight: 400; font-size: 16px; line-height: 24px; }
.type-bodyLarge:lang(ar) { line-height: 26px; }
.type-bodyMedium { font-family: var(--font-text); font-weight: 400; font-size: 14px; line-height: 20px; }
.type-bodyMedium:lang(ar) { line-height: 22px; }
.type-bodySmall { font-family: var(--font-text); font-weight: 400; font-size: 12px; line-height: 16px; }
.type-bodySmall:lang(ar) { line-height: 18px; }
.type-labelLarge { font-family: var(--font-text); font-weight: 600; font-size: 15px; line-height: 20px; }
.type-labelLarge:lang(ar) { line-height: 22px; }
.type-labelMedium { font-family: var(--font-text); font-weight: 500; font-size: 13px; line-height: 16px; }
.type-labelMedium:lang(ar) { line-height: 18px; }
.type-labelSmall { font-family: var(--font-text); font-weight: 500; font-size: 11px; line-height: 16px; }
.type-labelSmall:lang(ar) { line-height: 16px; }
.type-rating { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 20px; }
.type-rating:lang(ar) { line-height: 20px; }

/* Icons (§6): Phosphor (MIT), named by ligature. A span with class icon holds the icon's
   kebab-case name, such as navigation-arrow. Regular weight at 24px by default and 20px inside
   chips and buttons; a selected state adds icon-filled and writes the name with -fill
   (bookmark-simple-fill). Directional icons (arrow-left, caret-right) mirror in Arabic.
   A glyph Phosphor lacks comes from Lucide (ISC) as inline SVG, stroke currentColor. */
.icon { display: inline-block; flex: none; font-family: "Phosphor"; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; letter-spacing: 0; white-space: nowrap; direction: ltr; font-feature-settings: "liga"; font-variant-ligatures: discretionary-ligatures; }
.icon-20 { font-size: 20px; }
.icon-filled { font-family: "Phosphor-Fill"; }
[dir="rtl"] .icon-mirror { transform: scaleX(-1); }
