/* Al Ustool design tokens (generated from design/tokens.css with the prefix --ry- renamed to --au-, see docs/DECISIONS.md D-001). Single source of truth for colour, type, spacing, motion.
   Do not hard-code these values elsewhere.
   Redesign "Night Crossing" (design/redesign-brief.md): every original --au-* name is kept with the same meaning;
   new tokens are added inside each group and marked NEW. */

:root {
  /* Brand constants (same in both themes) */
  --au-petrol-950: #041516; /* NEW: deepest night (footer, scene sky top) */
  --au-petrol-900: #072B2C;
  --au-petrol-800: #0B3B3C;
  --au-petrol-700: #0E4F50; /* NEW: active drawer item, raised night tiles */
  --au-petrol-600: #12686A;
  --au-petrol-400: #2E9C9A;
  --au-petrol-200: #7FD1CB;
  --au-amber-300: #FFC873;  /* NEW: glow core and highlights on night surfaces only, never text on light */
  --au-amber-500: #F2A33A;
  --au-amber-600: #D98A1E;
  --au-amber-ink: #3A2203;
  --au-sand-50: #FBF9F4;
  --au-sand-100: #F6F2EA;
  --au-sand-200: #EFE9DD;
  --au-sand-300: #E1DACB;
  --au-sand-400: #CDBFA5;   /* NEW: hairlines on sand */

  /* Hero panel: always dark petrol, in both themes (used by /track, login) */
  --au-hero-bg: #0B3B3C;
  --au-hero-bg-2: #0F4A4B;
  --au-hero-ink: #F3F7F6;
  --au-hero-ink-2: #A9CFCB;
  --au-hero-line: rgba(255, 255, 255, 0.16);

  /* NEW: "night" surfaces of the redesign (landing hero, departures board, CTA, footer, admin drawer, dashboard deck).
     Always dark in both themes. Text on them uses --au-night-ink / -ink-2 / -ink-3 / --au-night-accent only. */
  --au-night: #061E1F;          /* ink #F3F7F6 ~16:1, ink-2 #A9CFCB ~10:1, amber #F2A33A ~8.5:1 */
  --au-night-2: #0B3132;        /* raised night card (boarding pass, board panel) */
  --au-night-3: #0E4F50;        /* hover / active on night */
  --au-night-deep: #041516;     /* footer, scene sky top */
  --au-night-sea: #031112;
  --au-night-ink: #F3F7F6;
  --au-night-ink-2: #A9CFCB;
  --au-night-ink-3: #86A9A5;    /* ~6.5:1 on --au-night, small labels only */
  --au-night-accent: #F2A33A;   /* amber text allowed on night surfaces */
  --au-night-line: rgba(255, 255, 255, 0.12);
  --au-night-line-strong: rgba(255, 255, 255, 0.32); /* input borders on night, >= 3:1 */
  --au-night-focus: #FFC873;    /* focus ring on night surfaces */
  --au-glow: rgba(242, 163, 58, 0.38);
  --au-glow-soft: rgba(242, 163, 58, 0.16);
  --au-lane: #2E9C9A;           /* route strokes on light surfaces (UI 3:1) */
  --au-lane-night: rgba(255, 255, 255, 0.2); /* untravelled dashed route on night */

  /* NEW: plate (licence-plate look; identical in both themes on purpose) */
  --au-plate-bg: #FBF9F4;
  --au-plate-ink: #10201F;
  --au-plate-band: #F2A33A;

  /* Semantic (light theme) */
  --au-bg: #F6F2EA;
  --au-surface: #FFFFFF;
  --au-surface-2: #EFE9DD;
  --au-ink: #10201F;
  --au-ink-2: #4A5B59;
  --au-ink-3: #5C6B68; /* design #7C8B88 darkened to reach WCAG AA 4.5:1 on bg, surface and surface-2 (D-047) */
  --au-line: #E1DACB;
  --au-line-strong: #958A75;    /* NEW: input/control borders, >= 3:1 on surface and bg */
  --au-brand: #0B3B3C;          /* brand-coloured text and icons */
  --au-brand-fill: #0B3B3C;     /* primary button background */
  --au-brand-tint: rgba(18, 104, 106, 0.10); /* NEW: icon chips, avatar circles */
  --au-on-brand: #F3F7F6;
  --au-accent: #F2A33A;         /* fills only */
  --au-accent-text: #8A5005;    /* amber as text on light surfaces (AA) */
  --au-on-accent: #3A2203;
  --au-success: #1B7F5C;
  --au-warning: #B56F0E;
  --au-danger: #B3372F;
  --au-success-tint: rgba(27, 127, 92, 0.10);  /* NEW */
  --au-warning-tint: rgba(181, 111, 14, 0.12); /* NEW */
  --au-danger-tint: rgba(179, 55, 47, 0.09);   /* NEW */
  --au-focus: #12686A;
  --au-shadow: 0 1px 2px rgba(16, 32, 31, 0.06), 0 8px 24px rgba(16, 32, 31, 0.06);
  --au-shadow-sm: 0 1px 2px rgba(16, 32, 31, 0.06);                                          /* NEW */
  --au-shadow-lg: 0 2px 4px rgba(16, 32, 31, 0.04), 0 24px 60px -12px rgba(7, 43, 44, 0.22); /* NEW */
  --au-ring: 0 0 0 4px color-mix(in srgb, var(--au-focus) 25%, transparent);                /* NEW */

  /* NEW: glass (public bar, admin app bar). Fallback when backdrop-filter is unsupported: solid --au-surface. */
  --au-glass: rgba(251, 249, 244, 0.80);
  --au-glass-line: rgba(16, 32, 31, 0.08);
  --au-glass-night: rgba(4, 21, 22, 0.42);
  --au-glass-night-line: rgba(255, 255, 255, 0.12);

  /* Typography */
  --au-font: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  --au-font-display: "Alexandria", "Readex Pro", "Segoe UI", Tahoma, sans-serif; /* NEW: h1/h2, stats, KPIs */
  --au-font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --au-text-xs: 0.75rem;
  --au-text-sm: 0.875rem;
  --au-text-md: 1rem;
  --au-text-lg: 1.125rem;
  --au-text-xl: 1.375rem;
  --au-text-2xl: 1.75rem;
  --au-text-3xl: clamp(2rem, 6vw, 3rem);
  --au-text-hero: clamp(2.25rem, 8vw, 4.25rem);
  --au-text-kicker: 0.8125rem;                              /* NEW: eyebrows */
  --au-text-4xl: clamp(2rem, 1.2rem + 3vw, 3.5rem);         /* NEW: landing section h2 */
  --au-text-stat: clamp(2.25rem, 1.4rem + 3.2vw, 4rem);     /* NEW: manifest numbers */
  --au-text-display: clamp(2.5rem, 1.2rem + 5.4vw, 5.5rem); /* NEW: landing h1 */
  --au-text-kpi: clamp(2rem, 1.6rem + 1.2vw, 2.5rem);       /* NEW: dashboard KPI values */
  --au-leading-tight: 1.2;
  --au-leading-display: 1.06;   /* NEW: Latin display */
  --au-leading-display-ar: 1.3; /* NEW: Arabic display (diacritics clip below this) */
  --au-leading: 1.65;           /* Arabic needs generous line height */

  /* Spacing (4px base) */
  --au-1: 0.25rem;
  --au-2: 0.5rem;
  --au-3: 0.75rem;
  --au-4: 1rem;
  --au-5: 1.5rem;
  --au-6: 2rem;
  --au-7: 3rem;
  --au-8: 4.5rem;
  --au-9: 6rem;                                     /* NEW */
  --au-section: clamp(4.5rem, 3rem + 6vw, 8.75rem); /* NEW: landing band padding-block */
  --au-gutter: clamp(16px, 4vw, 40px);              /* NEW: .wrap padding-inline */

  /* Shape */
  --au-radius-sm: 8px;
  --au-radius: 14px;
  --au-radius-md: 20px;  /* NEW: KPI tiles, boarding pass */
  --au-radius-lg: 24px;
  --au-radius-xl: 28px;  /* NEW: bento tiles */
  --au-radius-2xl: 32px; /* NEW: CTA panel */
  --au-radius-pill: 999px;
  --au-container: 1120px;
  --au-wrap: 1240px;     /* NEW: landing band content width */
  --au-tap: 44px;        /* NEW: minimum touch target */
  --au-bar-h: 64px;      /* NEW: public bar height (56px when scrolled) */

  /* Motion */
  --au-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --au-ease-out: cubic-bezier(0.16, 1, 0.3, 1);     /* NEW: entrances (expo-out) */
  --au-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* NEW: morphs */
  --au-dur-instant: 120ms; /* NEW */
  --au-dur-fast: 150ms;
  --au-dur: 300ms;
  --au-dur-slow: 600ms;    /* NEW */
  --au-dur-route: 2400ms;  /* vehicle travelling along the route */
  --au-dur-scene: 2400ms;  /* NEW: hero choreography */
}

:root[data-theme="dark"] {
  --au-hero-bg: #0D2A2B;
  --au-hero-bg-2: #123637;

  --au-night: #061A1B;
  --au-night-2: #0B2A2B;
  --au-night-deep: #030F10;

  --au-bg: #081414;
  --au-surface: #0F2221;
  --au-surface-2: #142D2C;
  --au-ink: #E8F0EE;
  --au-ink-2: #A9BDBA;
  --au-ink-3: #8AA19E; /* raised from #7A918E: ~5.3:1 on surface-2 (was ~4.3:1) */
  --au-line: #1F3B39;
  --au-line-strong: #4F716E;
  --au-brand: #7FD1CB;
  --au-brand-fill: #12686A;
  --au-brand-tint: rgba(127, 209, 203, 0.12);
  --au-on-brand: #F3F7F6;
  --au-accent-text: #F5B65E;
  --au-success: #5DCAA5;
  --au-warning: #F2A33A;
  --au-danger: #F08A80;
  --au-success-tint: rgba(93, 202, 165, 0.12);
  --au-warning-tint: rgba(242, 163, 58, 0.12);
  --au-danger-tint: rgba(240, 138, 128, 0.12);
  --au-focus: #7FD1CB;
  --au-lane: #3FB5B1;
  --au-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --au-shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --au-shadow-lg: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 60px -16px rgba(0, 0, 0, 0.6);

  --au-glass: rgba(8, 20, 20, 0.74);
  --au-glass-line: rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --au-dur-instant: 0ms;
    --au-dur-fast: 0ms;
    --au-dur: 0ms;
    --au-dur-slow: 0ms;
    --au-dur-route: 0ms;
    --au-dur-scene: 0ms;
  }
}
