/* Aegis design tokens. The only file with raw values: every other stylesheet uses var(--ag-*). Dark only.
   Values follow REBRAND.md ("Tokens"). */

/* 1. FONTS: Geist and Geist Mono (SIL Open Font License 1.1, /fonts/geist/OFL.txt), self-hosted variable
   fonts (weight 100 to 900), each split into a Latin and a Latin Extended file so a page loads only the
   ranges it shows. Chinese and Korean fall back to the system's own faces. */
@font-face { font-family: "Geist"; src: url("/fonts/geist/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("/fonts/geist/geist-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist/geist-mono-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;

  /* 2. NEUTRALS: a short ladder of greys; depth comes from these and 1px lines, not from shadows. */
  --ag-canvas: #080808;          /* page background */
  --ag-sunken: #0D0D0D;          /* input wells inside panels */
  --ag-panel: #141414;           /* panels, cards, menus */
  --ag-raised: #1B1B1B;          /* rows on hover, fields, chips */
  --ag-overlay: #262626;         /* secondary buttons, selected segment, popovers */
  --ag-overlay-hover: #313131;   /* hover on overlay */
  --ag-line-faint: #1F1F1F;      /* dividers inside panels */
  --ag-line: #2A2A2A;            /* panel and field borders */
  --ag-line-strong: #3D3D3D;     /* outline buttons, focused rows, dashed separators */
  --ag-line-heavy: #EDEDED;      /* selected row outline */
  --ag-text: #F2F2F2;            /* primary text and figures */
  --ag-text-2: #C2C2C2;          /* secondary */
  --ag-text-3: #939393;          /* tertiary, labels */
  --ag-text-4: #7A7A7A;          /* quaternary, placeholders */
  --ag-text-off: #585858;        /* disabled */

  /* 3. ACCENT AND STATUS: one blue for the primary action, selection and live data. Green, red and
     yellow only for status (gain, loss, caution), as tinted chips or text. */
  --ag-blue: #1F5EFF;
  --ag-blue-hover: #3A72FF;
  --ag-blue-press: #1748CC;
  --ag-blue-text: #7EA4FF;
  --ag-blue-select-bg: #12295F;
  --ag-blue-select-text: #AFC3EE;
  --ag-green: #3DDC84;
  --ag-green-bg: #0F2A1C;
  --ag-red: #F0706C;
  --ag-red-bg: #3A1513;
  --ag-red-strong: #E0393C;
  --ag-yellow: #E4D33A;
  --ag-yellow-bg: #2A280F;
  --ag-orange: #EB7A12;
  --ag-on-accent: var(--ag-text);                                   /* text on blue and danger fills */
  --ag-danger-hover: color-mix(in srgb, var(--ag-red-strong) 86%, var(--ag-text));
  --ag-scrim: rgba(0, 0, 0, .5);                                    /* behind the drawer and dialogs */

  /* TYPE: Geist for text and figures, Geist Mono for small uppercase labels. */
  --ag-font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ag-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ag-w-regular: 400;           /* body */
  --ag-w-medium: 500;            /* headings, figures, buttons, labels */
  --ag-w-logo: 700;              /* the logo only */
  /* size / line-height */
  --ag-fs-label: 11px;   --ag-lh-label: 14px;     /* mono label */
  --ag-fs-caption: 12px; --ag-lh-caption: 16px;
  --ag-fs-small: 13px;   --ag-lh-small: 18px;
  --ag-fs-body: 15px;    --ag-lh-body: 21px;
  --ag-fs-large: 17px;   --ag-lh-large: 24px;
  --ag-fs-read: 17px;    --ag-lh-read: 28px;      /* long-form reading column */
  --ag-fs-h4: 20px;      --ag-lh-h4: 26px;
  --ag-fs-h3: 25px;      --ag-lh-h3: 30px;
  --ag-fs-h2: 30px;      --ag-lh-h2: 36px;
  --ag-fs-h1: 40px;      --ag-lh-h1: 46px;        /* h1 and big figures */
  --ag-track-label: .06em;       /* mono uppercase labels */
  --ag-track-heading: -.01em;
  --ag-track-h1: -.02em;
  /* font shorthands */
  --ag-t-label: 500 var(--ag-fs-label)/var(--ag-lh-label) var(--ag-mono);
  --ag-t-caption: 400 var(--ag-fs-caption)/var(--ag-lh-caption) var(--ag-font);
  --ag-t-small: 400 var(--ag-fs-small)/var(--ag-lh-small) var(--ag-font);
  --ag-t-small-m: 500 var(--ag-fs-small)/var(--ag-lh-small) var(--ag-font);
  --ag-t-body: 400 var(--ag-fs-body)/var(--ag-lh-body) var(--ag-font);
  --ag-t-body-m: 500 var(--ag-fs-body)/var(--ag-lh-body) var(--ag-font);
  --ag-t-large: 400 var(--ag-fs-large)/var(--ag-lh-large) var(--ag-font);
  --ag-t-large-m: 500 var(--ag-fs-large)/var(--ag-lh-large) var(--ag-font);
  --ag-t-read: 400 var(--ag-fs-read)/var(--ag-lh-read) var(--ag-font);
  --ag-t-h4: 500 var(--ag-fs-h4)/var(--ag-lh-h4) var(--ag-font);
  --ag-t-h3: 500 var(--ag-fs-h3)/var(--ag-lh-h3) var(--ag-font);
  --ag-t-h2: 500 var(--ag-fs-h2)/var(--ag-lh-h2) var(--ag-font);
  --ag-t-h1: 500 var(--ag-fs-h1)/var(--ag-lh-h1) var(--ag-font);
  --ag-t-figure: 500 var(--ag-fs-h1)/var(--ag-lh-h1) var(--ag-font);
  --ag-t-code: 400 var(--ag-fs-small)/var(--ag-lh-small) var(--ag-mono);

  /* SHAPE */
  --ag-r-flag: 3px;              /* BETA-style mono badge */
  --ag-r-chip: 6px;              /* chips, tags, quick picks */
  --ag-r-button: 8px;            /* buttons xs to m, inner segment */
  --ag-r-button-l: 10px;         /* l buttons, segmented track, selected list row */
  --ag-r-cta: 12px;              /* xl and full-width form CTA */
  --ag-r-field: 12px;            /* inputs, input wells, inset fields, popovers */
  --ag-r-panel: 14px;            /* panels and cards */
  --ag-r-modal: 16px;            /* dialogs and sheets */
  --ag-r-card: 20px;             /* the centred action card (swap / send style) */
  --ag-r-seg: 10px;              /* segmented control track */
  --ag-r-seg-item: 8px;          /* its selected item */
  --ag-r-row: 10px;              /* selected list row */
  --ag-r-pill: 999px;            /* token pills, filter chips */
  --ag-r-round: 50%;             /* avatars and token icons */

  /* SPACE: 4px grid */
  --ag-s-1: 4px; --ag-s-2: 8px; --ag-s-3: 12px; --ag-s-4: 16px; --ag-s-5: 20px; --ag-s-6: 24px;
  --ag-s-8: 32px; --ag-s-10: 40px; --ag-s-12: 48px; --ag-s-16: 64px;
  --ag-panel-pad: 20px;          /* 16 on phones (below) */
  --ag-section: 56px;            /* space between page sections (40 to 64) */

  /* CONTROL HEIGHTS */
  --ag-h-xs: 28px;
  --ag-h-s: 32px;
  --ag-h-m: 36px;
  --ag-h-cta: 48px;              /* CTA and inputs */
  --ag-h-row: 42px;              /* selectable list row */
  --ag-h-row-l: 56px;            /* picker / index row */

  /* LAYOUT */
  --ag-header-h: 64px;           /* 56 on phones (below) */
  --ag-page-w: 1200px;           /* content width of .ui-page */
  --ag-page-pad: 24px;           /* its side padding; 16 on phones */
  --ag-read-w: 720px;            /* long-form reading column */
  --ag-card-w: 440px;            /* centred action card */
  --ag-drawer-w: 380px;          /* menu drawer; full width on phones */

  /* DEPTH: shadows only on floating layers (menus, popovers, toasts, dialogs). */
  --ag-shadow-float: 0 8px 24px rgba(0, 0, 0, .45);
  --ag-z-sticky: 10;
  --ag-z-header: 100;
  --ag-z-popover: 110;
  --ag-z-modal: 1000;
  --ag-z-toast: 1100;

  /* MOTION: calm, 120 to 160ms ease; no bounce, no glow. */
  --ag-dur-fast: 120ms;
  --ag-dur: 140ms;
  --ag-dur-slow: 160ms;
  --ag-ease: ease;
  --ag-ease-out: cubic-bezier(.2, 0, 0, 1);

  /* FOCUS: 2px blue outline, 2px offset, on :focus-visible only. */
  --ag-focus: 2px solid var(--ag-blue);
  --ag-focus-offset: 2px;
}
@media (max-width: 600px) {
  :root { --ag-header-h: 56px; --ag-page-pad: 16px; --ag-panel-pad: 16px; --ag-section: 40px; }
}

/* Breakpoints (custom properties can't be used in @media; copy the px values):
   phone-max 600px · tablet-max 1023px · desktop-min 1024px */
