/* Swangz design tokens — warm architectural glass.
   Near-black neutral surfaces (no blue cast), champagne gold as the brand, and a bright mint,
   sky and coral for states and data, so the dark UI reads rich rather than dull.
   Dark is the default; a light "Porcelain" theme is available on html[data-theme="light"].
   Shared by the staff app (portal.css), the control room (admin.css) and their common
   components (ui.css). Colour never carries meaning alone: every state has a word or an icon too. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/PlusJakartaSans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Surfaces — page, card, raised, hover, pressed. Neutral blacks, a trace of warmth. */
  --ink-0: #0A0A0B;
  --ink-1: #121214;
  --ink-2: #17171A;
  --ink-3: #1F1F23;
  --ink-4: #2B2B31;
  --line: #2A2A2F;
  --line-hi: #35353C;
  --line-soft: rgba(255, 255, 255, .045);

  /* Text */
  --tx-1: #F6F6F4;   /* 17.4:1 on ink-1 */
  --tx-2: #CEC6BD;
  --tx-3: #B5ADA5;   /* readable even over the brightest scrimmed scene */
  --tx-4: #5E5E66;   /* rules and disabled marks only */
  --tx-inv: #0A0A0B;

  /* Glass foundation. The scene scrim bounds contrast even over a white photo.
     Dense text uses strong glass; nested wells never add another blur layer. */
  --glass-bg: rgba(28, 24, 22, .52);
  --glass-bg-strong: rgba(22, 19, 17, .68);
  --glass-bg-accent: linear-gradient(160deg, rgba(245, 179, 43, .38), rgba(120, 72, 24, .30));
  --glass-rim: rgba(255, 255, 255, .10);
  --glass-rim-hover: rgba(255, 255, 255, .24);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .08);
  --glass-shadow: 0 20px 50px -20px rgba(0, 0, 0, .55);
  --glass-blur: blur(22px) saturate(140%);
  --scene-image: url("/static/admin-welcome.webp");
  --scene-scrim: rgba(12, 10, 9, .78);
  --radius-card: 22px;
  --radius-pill: 999px;   /* round things only: avatars, dots, the bell's number (BRIEF 10.10.2) */
  --radius-control: 4px; --radius-control-sm: 3px; --radius-chip: 3px;   /* crisp rectangles (BRIEF 10.10.6) */
  --radius-tabbar: 14px; --radius-tab: 9px;
  --scroll-thumb: rgba(255, 255, 255, .22); --scroll-thumb-hover: rgba(255, 255, 255, .40);
  --lift: translateY(-5px);
  --ease-out: cubic-bezier(.2, .7, .3, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;

  /* Buttons (BRIEF 10.10.6). The label on a solid button must pass 4.5:1 on --btn-solid and on both ends of --btn-sweep. */
  --btn-solid: #F2F2F2; --btn-on-solid: #0D0D0D; --btn-sweep: linear-gradient(180deg, #F7AE62, #EE8F3E);
  --btn-rim: rgba(255, 255, 255, .22); --btn-rim-hi: rgba(255, 255, 255, .42); --btn-fill: rgba(255, 255, 255, .08);
  --btn-glass: rgba(13, 13, 13, .55); --btn-glass-ink: #F2F2F2; --btn-glass-rim: rgba(242, 242, 242, .28);
  --btn-glass-wash: rgba(13, 13, 13, .56); --btn-glass-rim-hi: rgba(242, 242, 242, .55);
  --stage-light: rgba(255, 255, 255, .16);

  /* Brand: champagne gold, bright enough to carry buttons on black */
  --primary: #F5B32B;
  --primary-hi: #FFC54D;
  --on-primary: #1A1200;
  --accent: #E5BE78;
  --accent-tx: #E5C48C;   /* champagne for brand and selection */
  --focus: var(--accent);  /* the keyboard ring; its own token so light can darken it without touching button fills */
  --accent-soft: rgba(229, 190, 120, .10);
  --accent-dim: rgba(229, 190, 120, .34);

  /* States: a fill, a bright text tone, and a soft wash. Gold = brand and selection, mint = healthy
     and allowed, sky = information and system, coral = blocked, revoked and failed. */
  --ok: #2FD99A;   --ok-hi: #5CE4B4;   --ok-soft: rgba(47, 217, 154, .14);
  --info: #43B9F5; --info-hi: #78CEF9; --info-soft: rgba(67, 185, 245, .14);
  --warn: #F5B32B; --warn-hi: #F7C45C; --warn-soft: rgba(245, 179, 43, .14);
  --bad: #FF5D52;  --bad-hi: #FF8A82;  --bad-soft: rgba(255, 93, 82, .14);
  --on-bad: #1F0705;   /* text on a solid --bad fill — 6.4:1 */
  --agent: #B79CFF; --agent-soft: rgba(183, 156, 255, .14);
  --live: var(--ok);

  /* Data — validated for the chart surface in each theme (adjacent ΔE ≥ 23 under colour-blind
     simulation, ≥ 3:1 against the card). Marks only: labels and values stay in text tokens. */
  --viz-1: #C08A1C;   /* spend */
  --viz-2: #2B95D0;   /* activity */
  --viz-muted: #3A3A42;
  --viz-grid: #222226;
  --viz-axis: var(--tx-3);

  /* Elevation — on black, light comes from a hairline, not a drop shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .5), 0 28px 70px rgba(0, 0, 0, .66);
  --glass: rgba(10, 10, 11, .82);
  --scrim: rgba(0, 0, 0, .66);
  --grid-line: rgba(245, 179, 43, .055);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0));
  --focus-ring: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--focus);

  /* One self-hosted variable face for UI and headings; stable tabular figures. */
  --font: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --t-display: clamp(2.5rem, 6vw, 4.75rem);
  --t-hero: clamp(2.4rem, 4.2vw, 3.25rem);   /* the one headline figure on a page */
  --t-h1: clamp(1.9rem, 3.2vw, 2.6rem);
  --t-h2: 1.375rem;
  --t-h3: 1.0625rem;
  --t-num: 1.75rem;
  --t-body: 0.9375rem;
  --t-small: 0.8125rem;
  --t-micro: 0.6875rem;
  --track-label: .14em;

  /* Space — 4px base */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* Legacy names remain aliases so existing components share the new foundation. */
  --r-xs: var(--radius-control); --r-sm: 12px; --r-md: 16px;
  --r-lg: var(--radius-card); --r-xl: 24px; --r-full: var(--radius-pill);

  /* Motion — fast and explanatory; a live request breathes, nothing flashes */
  --e-out: var(--ease-out);
  --e-in-out: cubic-bezier(.4, 0, .2, 1);
  --d-fast: var(--dur-1); --d-base: var(--dur-2); --d-slow: var(--dur-3); --d-breathe: 2.8s;

  /* Layers */
  --z-sticky: 10; --z-nav: 30; --z-sheet: 40; --z-cmd: 50; --z-toast: 60; --z-tip: 70;

  --shell: 1280px;
  --gutter: clamp(16px, 4.5vw, 56px);
  color-scheme: dark;
}

/* Porcelain — the light alternative. Warm off-white, ink-black type, the same gold. Not an
   inversion: its own steps, its own chart hues, softer shadows doing what hairlines do on black. */
:root[data-theme="light"] {
  --scroll-thumb: rgba(0, 0, 0, .25); --scroll-thumb-hover: rgba(0, 0, 0, .40);
  --glass-bg: rgba(245, 240, 234, .55);
  --glass-bg-strong: rgba(250, 247, 242, .82);
  --glass-bg-accent: linear-gradient(160deg, rgba(245, 179, 43, .30), rgba(229, 190, 120, .18));
  --glass-rim: rgba(255, 255, 255, .72);
  --glass-rim-hover: rgba(120, 86, 15, .38);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .85);
  --glass-shadow: 0 20px 50px -20px rgba(65, 42, 24, .20);
  --scene-scrim: rgba(245, 240, 234, .88);
  --ink-0: #F4F2ED;
  --ink-1: #FFFFFF;
  --ink-2: #FAF9F6;
  --ink-3: #F0EDE6;
  --ink-4: #E3DED3;
  --line: #E6E1D7;
  --line-hi: #D5CEC0;
  --line-soft: rgba(20, 20, 25, .05);

  --tx-1: #15151A;
  --tx-2: #4D4D55;
  --tx-3: #5F5953;
  --tx-4: #A9A9B1;
  --tx-inv: #FFFFFF;

  --primary: #1A1A1F;
  --primary-hi: #2C2C33;
  --on-primary: #FFFFFF;
  --accent: #C9962A;
  --accent-tx: #78560F;
  --btn-solid: #0D0D0D; --btn-on-solid: #F2F2F2; --btn-sweep: linear-gradient(180deg, #A35600, #8F4B00);
  --btn-rim: rgba(13, 13, 13, .28); --btn-rim-hi: rgba(13, 13, 13, .5); --btn-fill: rgba(13, 13, 13, .06);
  --btn-glass: rgba(250, 247, 244, .72); --btn-glass-ink: #0D0D0D; --btn-glass-rim: rgba(13, 13, 13, .28);
  --btn-glass-wash: rgba(250, 247, 244, .7); --btn-glass-rim-hi: rgba(13, 13, 13, .55);
  --stage-light: rgba(13, 13, 13, .13);
  --focus: var(--accent-tx);  /* --accent is 2.4:1 on the light page, under the 3:1 a ring needs */
  --accent-soft: #FAF2DF;
  --accent-dim: #E6D3A1;

  --ok: #1D9B6C;   --ok-hi: #15774F;   --ok-soft: #E4F5EE;
  --info: #1E7FC2; --info-hi: #15618F; --info-soft: #E6F1FA;
  --warn: #B5831A; --warn-hi: #78560F; --warn-soft: #FBF2DD;
  --bad: #CE4136;  --bad-hi: #A93228;  --bad-soft: #FBE9E7;
  --on-bad: #FFFFFF;   /* 4.7:1 on --bad */
  --agent: #6B4FC4; --agent-soft: #EFEAFB;

  --viz-1: #B07D12;
  --viz-2: #1E7FC2;
  --viz-muted: #D9D3C7;
  --viz-grid: #EEEAE2;

  --shadow-sm: 0 1px 2px rgba(20, 20, 25, .05);
  --shadow: 0 1px 2px rgba(20, 20, 25, .04), 0 4px 16px rgba(20, 20, 25, .07);
  --shadow-lg: 0 2px 6px rgba(20, 20, 25, .06), 0 24px 60px rgba(20, 20, 25, .16);
  --glass: rgba(255, 255, 255, .8);
  --scrim: rgba(20, 20, 25, .4);
  --grid-line: rgba(20, 20, 25, .05);
  --sheen: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink-0); color: var(--tx-1); }
body { font: 400 var(--t-body)/1.55 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, .mono { font-family: var(--mono); }
html { scroll-padding-top: 80px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-dim); color: var(--tx-1); }
[hidden] { display: none !important; }

/* a tool's logo, or its monogram on its brand colour */
.logo { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  background: #FFFFFF; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.logo img { width: 70%; height: 70%; object-fit: contain; }
.logo.mono { border: 0; color: #FFFFFF; font-weight: 750; font-stretch: 108%; font-size: 15px; letter-spacing: .01em; }
.logo.xs { width: 22px; height: 22px; border-radius: 6px; font-size: 9px; }
.logo.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.logo.lg { width: 56px; height: 56px; border-radius: 15px; font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .logo.mono { border: 1px solid CanvasText; }
}
