/* Aristotle UI token sheet. Values are ported from the mobile app
   (mobile/packages/design-system/src/tokens.ts) under the ds-components (shadcn)
   contract names; mobile-only roles are extension tokens beside the contract.

   PORT NOTE: keep this a separate stylesheet from the `@theme inline` block in
   index.html. Those mappings are self-referential (`--text-body:
   var(--text-body)`) and resolve against this sheet; folding these tokens into
   `@theme` would make every one of them circular. The Dioxus entry keeps the
   same two-file split.

   CASCADE: everything lives in `@layer app`, declared last, so recipes here win
   over Tailwind utilities without `!important`. */

@layer theme, base, components, utilities, app;

@layer app {
  /* React Native renders unset line heights at the font's natural metrics */
  html {
    background: var(--background);
    line-height: normal;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* mobile's <Text> defaults: the body role in the primary ink */
  body {
    font-family: var(--font-sans);
    font-size: var(--text-body);
    font-weight: var(--text-body--font-weight);
    color: var(--foreground);
  }

  /* !important so no later `display:` recipe in this layer can unhide it */
  [hidden] {
    display: none !important;
  }

  /* the UA gives buttons/selects `default`, and Tailwind v4 preflight no longer
     restores pointer */
  button:not(:disabled),
  [role="button"]:not(:disabled),
  [role="option"]:not([aria-disabled="true"]),
  [role="menuitem"]:not([aria-disabled="true"]),
  [role="tab"]:not([aria-disabled="true"]),
  summary,
  select:not(:disabled),
  label:has(> input[type="checkbox"], > input[type="radio"]),
  input:is(
      [type="checkbox"],
      [type="radio"],
      [type="range"],
      [type="submit"],
      [type="button"],
      [type="reset"]
    ):not(:disabled) {
    cursor: pointer;
  }

  :where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
  }

  /* ================================================================
     TOKENS — primitives
     ================================================================ */
  :root {
    /* ---- typography — mobile ships no font: it renders the platform face ---- */
    --font-sans:
      system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, Menlo, monospace;

    /* ---- type roles — mobile tokens.type, kebab-cased. Sizes and line heights
       keep mobile's point values over a 16px rem; tracking keeps mobile's points
       as a fraction of the size, so it scales with the text. A role without a
       line height inherits `normal`, as on native. ---- */
    --text-display: calc(32rem / 16);
    --text-display--font-weight: 700;
    --text-display--letter-spacing: calc(-0.7em / 32);
    --text-question: calc(28rem / 16);
    --text-question--font-weight: 600;
    --text-question--letter-spacing: calc(-0.3em / 28);
    --text-question-large: calc(36rem / 16);
    --text-question-large--font-weight: 600;
    --text-question-large--letter-spacing: calc(-0.5em / 36);
    --text-code: calc(14rem / 16);
    --text-code--font-weight: 500;
    --text-code--letter-spacing: calc(0.5em / 14);
    --text-title: calc(20rem / 16);
    --text-title--font-weight: 700;
    --text-title--letter-spacing: calc(-0.4em / 20);
    --text-hero-title: calc(29rem / 16);
    --text-hero-title--font-weight: 700;
    --text-hero-title--letter-spacing: calc(-0.7em / 29);
    --text-section-title: calc(18rem / 16);
    --text-section-title--font-weight: 700;
    --text-section-title--letter-spacing: calc(-0.3em / 18);
    --text-headline: calc(17rem / 16);
    --text-headline--font-weight: 600;
    --text-headline--letter-spacing: calc(-0.2em / 17);
    --text-sidebar-item: calc(20rem / 16);
    --text-sidebar-item--font-weight: 600;
    --text-sidebar-item--letter-spacing: calc(-0.4em / 20);
    --text-choice-title: calc(26rem / 16);
    --text-choice-title--font-weight: 700;
    --text-choice-title--letter-spacing: calc(-0.5em / 26);
    --text-choice-title--line-height: calc(32 / 26);
    --text-overline: calc(13rem / 16);
    --text-overline--font-weight: 600;
    --text-overline--line-height: calc(18 / 13);
    --text-detail: calc(14rem / 16);
    --text-detail--font-weight: 500;
    --text-detail--line-height: calc(19 / 14);
    --text-field-label: calc(14rem / 16);
    --text-field-label--font-weight: 500;
    --text-field-label--line-height: calc(19 / 14);
    --text-field-value: calc(16rem / 16);
    --text-field-value--font-weight: 500;
    --text-field-value--line-height: calc(21 / 16);
    --text-chip-label: calc(14rem / 16);
    --text-chip-label--font-weight: 600;
    --text-chip-label--line-height: calc(18 / 14);
    --text-tag: calc(12rem / 16);
    --text-tag--font-weight: 600;
    --text-tag--line-height: calc(16 / 12);
    --text-year-label: calc(15rem / 16);
    --text-year-label--font-weight: 700;
    --text-year-label--line-height: calc(20 / 15);
    --text-quarter-label: calc(13rem / 16);
    --text-quarter-label--font-weight: 700;
    --text-quarter-label--letter-spacing: calc(0.2em / 13);
    --text-tile-title: calc(16rem / 16);
    --text-tile-title--font-weight: 600;
    --text-tile-title--letter-spacing: calc(-0.2em / 16);
    --text-code-badge: calc(12rem / 16);
    --text-code-badge--font-weight: 700;
    --text-code-badge--letter-spacing: calc(1em / 12);
    --text-card-title: calc(15rem / 16);
    --text-card-title--font-weight: 600;
    --text-card-title--letter-spacing: calc(-0.2em / 15);
    --text-body: calc(15rem / 16);
    --text-body--font-weight: 500;
    --text-paragraph: calc(14.5rem / 16);
    --text-paragraph--font-weight: 400;
    --text-paragraph--line-height: calc(20.5 / 14.5);
    --text-answer: calc(16rem / 16);
    --text-answer--font-weight: 400;
    --text-answer--line-height: calc(24 / 16);
    --text-subtext: calc(13rem / 16);
    --text-subtext--font-weight: 500;
    --text-caption: calc(11rem / 16);
    --text-caption--font-weight: 600;
    --text-eyebrow: calc(10rem / 16);
    --text-eyebrow--font-weight: 700;
    --text-eyebrow--letter-spacing: calc(0.8em / 10);
    --text-metric-small: calc(17rem / 16);
    --text-metric-small--font-weight: 700;
    --text-metric-small--letter-spacing: calc(-0.2em / 17);
    --text-metric: calc(22rem / 16);
    --text-metric--font-weight: 700;
    --text-metric--letter-spacing: calc(-0.4em / 22);
    --text-metric-large: calc(28rem / 16);
    --text-metric-large--font-weight: 700;
    --text-metric-large--letter-spacing: calc(-0.7em / 28);
    --text-amount-entry: calc(36rem / 16);
    --text-amount-entry--font-weight: 700;
    --text-amount-entry--letter-spacing: calc(-1.2em / 36);
    --text-amount-hero: calc(44rem / 16);
    --text-amount-hero--font-weight: 700;
    --text-amount-hero--letter-spacing: calc(-1.6em / 44);
    --text-feature-number: calc(88rem / 16);
    --text-feature-number--font-weight: 700;
    --text-feature-number--letter-spacing: calc(-3em / 88);
    --text-data-value: calc(13rem / 16);
    --text-data-value--font-weight: 600;
    --text-identifier: calc(11rem / 16);
    --text-identifier--font-weight: 600;
    --text-identifier--letter-spacing: calc(0.4em / 11);
    --text-axis-label: calc(10rem / 16);
    --text-axis-label--font-weight: 500;
    --text-button-label-small: calc(13rem / 16);
    --text-button-label-small--font-weight: 600;
    --text-button-label-medium: calc(15rem / 16);
    --text-button-label-medium--font-weight: 600;
    --text-button-label-large: calc(17rem / 16);
    --text-button-label-large--font-weight: 600;
    --text-badge: calc(10rem / 16);
    --text-badge--font-weight: 700;
    --text-otp-digit: calc(20rem / 16);
    --text-otp-digit--font-weight: 700;

    /* ---- spacing — one unit, the whole numeric scale multiplies it ---- */
    --space-unit: 0.25rem;
    --space-0-5: calc(var(--space-unit) * 0.5);
    --space-1: calc(var(--space-unit) * 1);
    --space-1-5: calc(var(--space-unit) * 1.5);
    --space-2: calc(var(--space-unit) * 2);
    --space-2-5: calc(var(--space-unit) * 2.5);
    --space-3: calc(var(--space-unit) * 3);
    --space-3-5: calc(var(--space-unit) * 3.5);
    --space-4: calc(var(--space-unit) * 4);
    --space-4-5: calc(var(--space-unit) * 4.5);
    --space-5: calc(var(--space-unit) * 5);
    --space-6: calc(var(--space-unit) * 6);
    --space-7: calc(var(--space-unit) * 7);
    --space-8: calc(var(--space-unit) * 8);
    --space-9: calc(var(--space-unit) * 9);
    --space-10: calc(var(--space-unit) * 10);
    --space-11: calc(var(--space-unit) * 11);
    --space-12: calc(var(--space-unit) * 12);
    --space-13: calc(var(--space-unit) * 13);
    --space-14: calc(var(--space-unit) * 14);
    --space-16: calc(var(--space-unit) * 16);
    --space-20: calc(var(--space-unit) * 20);
    --space-24: calc(var(--space-unit) * 24);
    --space-32: calc(var(--space-unit) * 32);
    --space-40: calc(var(--space-unit) * 40);
    --space-48: calc(var(--space-unit) * 48);
    --space-64: calc(var(--space-unit) * 64);
    --space-80: calc(var(--space-unit) * 80);
    --space-96: calc(var(--space-unit) * 96);

    /* ---- rhythm — mobile's semantic spacing ---- */
    --screen-horizontal: var(--space-5);
    --screen-section-gap: calc(var(--space-unit) * 5.5);
    --card-padding: var(--space-4-5);
    --card-gap: var(--space-3-5);
    --card-gutter: var(--space-3);
    --tile-padding: var(--space-3-5);
    /* a compact standings list: under its header, and across a row */
    --standings-gap: var(--space-2-5);

    /* ---- component metrics — mobile tokens.size (general controls only) ---- */
    --touch-target: var(--space-11);
    --control-small: var(--space-8);
    --control-medium: var(--space-10);
    --control-large: var(--space-12);
    --icon-button-small: var(--space-7);
    --icon-button-medium: var(--space-9);
    --icon-button-large: var(--space-10);
    --avatar-small: var(--space-7);
    --avatar-medium: var(--space-9);
    --avatar-large: calc(var(--space-unit) * 10.5);
    --avatar-x-large: var(--space-14);
    --filter-pill-height: calc(var(--space-unit) * 7.5);
    --badge-dot: calc(var(--space-unit) * 1.25);
    --floating-bar: var(--space-14);
    --standings-row: calc(var(--space-unit) * 10.5);

    /* ---- web shell — desktop layout with no mobile counterpart; widths and
       gutters follow Wealthsimple's two-column web shell ---- */
    --nav-rail: calc(var(--space-unit) * 22.5);
    /* nav destination: the pill behind its icon (Material's rail indicator) */
    --nav-pill-width: var(--space-14);
    --nav-pill-height: var(--space-8);
    /* the page column centres on the whole viewport (the rail floats over
       its left gutter): 1472px floor, 100px of air, 1528px cap */
    --page-max: clamp(
      calc(var(--space-unit) * 368),
      100% - calc(var(--space-unit) * 25),
      calc(var(--space-unit) * 382)
    );
    --page-gutter: var(--space-8);
    /* clears the rail where the column meets the viewport edge */
    --page-gutter-start: calc(var(--space-unit) * 24);
    /* home sidebar: 340px from lg, 393px from 1440 with its wider gap */
    --aside: calc(var(--space-unit) * 85);
    --aside-wide: 393px;
    --column-gap: var(--space-8);
    --column-gap-wide: 83px;
    --aside-gap: var(--space-6);
    --leaderboard-card: calc(var(--space-unit) * 76);
    --watermark: calc(var(--space-unit) * 35);
    /* home trend chart: Wealthsimple's 272px plot, shorter on phones */
    --trend-chart: calc(var(--space-unit) * 68);
    --trend-chart-compact: calc(var(--space-unit) * 48);
    /* mobile FeatureCard CARD.minHeight */
    --feature-card: calc(var(--space-unit) * 50);
    --feature-pill-mix: 10%;
    /* card deck: how far the next card peeks above the front one, and how much
       smaller it is drawn */
    --stack-peek: var(--space-2-5);
    --stack-scale: 0.92;
    /* the full logo (mobile AuthBrand's artwork, assets/aristotle-logo.png) */
    --brand-logo-ratio: 500 / 355;
    /* mobile TrendChart: both lines 1.5pt, the context series at 45% of its
       tint, dashed as Wealthsimple draws its reference line; the stipple
       under the line in the line's full tint, faded by the plot */
    --chart-line-width: 1.5px;
    --chart-context-opacity: 0.45;
    --chart-dash: 3px;
    --chart-stipple-opacity: 1;

    /* ---- radius — mobile values; xxs → 2xs, xxl → 2xl, pill → full ---- */
    --radius-2xs: 2px;
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-field: 12px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 22px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    --radius: var(--radius-field);
    /* the card surface (.card-surface) */
    --radius-card: 16px;
    /* mobile ChartTooltip RADIUS */
    --radius-tooltip: 10px;

    /* ---- stroke ---- */
    --stroke-glass-border: 0.5px;
    --stroke-hairline: 1px;
    --stroke-field: 1.5px;
    --stroke-field-rest: 1px;
    --stroke-thick: 2px;
    --stroke-ring-current: 3px;
    /* lit glass rim, top and bottom (and the inner rim inside it). Sub-pixel,
       so .glass-lit draws it with inset shadows; dark thins it */
    --stroke-glass-lit-top: 2px;
    --stroke-glass-lit-bottom: 1.66px;
    --stroke-glass-lit-inner: 0px;

    /* ---- motion ---- */
    --duration-disclosure: 260ms;
    --duration-spotlight: 420ms;
    --duration-rise: 500ms;
    --duration-rise-row: 360ms;
    --duration-page-slide: 420ms;
    --duration-flash: 1600ms;
    --duration-chart-enter: 500ms;
    --duration-chart-update: 300ms;
    --duration-chart-compact-enter: 350ms;
    --duration-chart-fade: 180ms;
    --duration-chart-row-stagger: 35ms;
    --duration-chart-max-stagger: 140ms;
    --duration-hover: 150ms;
    --ease-settle: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.58, 1);
    /* ambient art (.panel-art): a slow sway and a breath on periods that never
       line up, so the loop doesn't read as a loop. Sine easing: no stall at
       either turn. */
    --duration-sway: 16s;
    --duration-breathe: 11s;
    --ease-in-out: cubic-bezier(0.37, 0, 0.63, 1);
    --art-sway: 1.5deg;
    --art-breathe: 1.02;
    /* how far the art runs past its panel's right and bottom edges; must
       outrun the sway, so the artwork's cropped edges never swing into view */
    --art-bleed: var(--space-12);

    /* ---- field contract — mobile's framed field. The face never tints by
       state; focus moves the edge to primary and adds the halo ring. ---- */
    /* Wealthsimple's field corner, the card's 16px */
    --field-radius: var(--radius-card);
    --field-height: var(--space-13);
    --field-bg-hover: var(--field-bg);
    --field-bg-focus: var(--field-bg);
    --field-bg-disabled: var(--muted);
    --field-border-width: var(--stroke-field-rest);
    --field-border-color: var(--input);
    --field-border-focus: var(--primary);
    --field-border-invalid: var(--destructive);
    --field-halo-width: var(--space-1);
    --field-well: none;

    /* ---- depth — mobile shadow.ts; dark cards cast nothing (transparent
       --shadow-color) ---- */
    --shadow-soft: 0 2px 6px var(--shadow-color);
    --shadow-tooltip: 0 3px 6px var(--shadow-color);
    --shadow-float:
      0 10px 28px var(--shadow-color), 0 2px 6px var(--shadow-color);
    --shadow-hero: 0 10px 26px var(--shadow-hero-color);
    --shadow-brand: 0 10px 30px -12px var(--shadow-brand-color);
    --shadow-card: 0 8px 24px var(--shadow-card-color);
    /* lit glass: a .5px shaded sliver down each side (the -.83px spread pulls
       it off the top and bottom), the .5px ring, a faint drop */
    --shadow-glass-lit:
      -1.33px 0 0 -0.83px var(--glass-lit-edge),
      1.33px 0 0 -0.83px var(--glass-lit-edge),
      0 0 0 var(--stroke-glass-border) var(--glass-lit-ring),
      0 6.5px 6px 0.5px var(--glass-lit-drop);
    --focus-ring:
      0 0 0 var(--field-border-width) var(--ring),
      0 0 0 calc(var(--field-border-width) + var(--field-halo-width))
        var(--field-halo);
    /* the same ring drawn inward, for a control flush to a clipping edge */
    --focus-ring-inset:
      inset 0 0 0 var(--field-border-width) var(--ring),
      inset 0 0 0 calc(var(--field-border-width) + var(--field-halo-width))
        var(--field-halo);
  }

  /* ================================================================
     TOKENS — color (light). Hex values are mobile's, verbatim.
     ================================================================ */
  :root {
    color-scheme: light;
    /* contract. Page, ink and card follow Wealthsimple's web palette
       (bg-app, fg-primary/secondary/tertiary, card primary) over mobile's */
    --background: #f2f2f2;
    --foreground: #000000;
    --card: #f9f9f9;
    --popover: #fbfbfb;
    --primary: #1745b1;
    --muted: #eae9e9;
    --muted-foreground: #000000b3;
    --destructive: #d93025;
    --success: #1e9e4c;
    --warning: #e08a00;
    --border: #e4e2e1;
    /* the field follows Wealthsimple's filled field over mobile's white one:
       edge and face are faint tints of the ink, so they read on page or card */
    --input: #00000014;
    /* field */
    --field-bg: #00000008;
    --field-halo: #1745b129;
    --field-halo-invalid: #d9302524;
    /* glass */
    --glass-rim: #e0e0e0;
    --glass-hi: #ffffff;
    --glass-hair: #32302f1f;
    /* lit glass — a capsule lit from above: bright rim, shaded sides, a
       vertical sheen on the face; hover brightens the face */
    --glass-lit-rim: #ffffff;
    --glass-lit-inner-rim: transparent;
    --glass-lit-edge: #a0a0a0;
    --glass-lit-ring: #d7d7d7;
    --glass-lit-drop: #00000004;
    --glass-lit-hover: #ffffff29;
    --glass-lit-face: linear-gradient(
      #fdfdfd, #fafafa 2%, #f8f8f8 4.5%, #f6f6f6 8.5%, #f4f4f4 13%,
      #f2f2f2 18%, #f2f2f2 35%, #f4f4f4 43%, #f6f6f6 55%, #f6f6f6 83%,
      #f8f8f8 92%, #fafafa 96%, #fdfdfd 99%, #fefefe);
    /* brand */
    --primary-soft: #1745b11a;
    --primary-deep: #103491;
    --primary-band: #1745b11f;
    --primary-hairline: #1745b124;
    --on-primary-subtle: #ffffffc7;
    /* a silhouette drawn behind copy (mobile's swatch `tone` art): a brand
       wash faint enough that text reads over it */
    --art-tint: #1745b114;
    /* the full logo's ink: the artwork's own blue */
    --brand-mark: #0f529b;
    /* card surface: a solid white rim; links lift to white on hover */
    --card-hover: #ffffff;
    --card-ring: linear-gradient(#ffffff, #ffffff);
    /* ink */
    --faint-foreground: #00000080;
    --navigation-foreground: #111111;
    --ink: #32302f;
    /* status */
    --success-soft: #1e9e4c1a;
    --warning-soft: #e08a001a;
    --warning-strong: #b86e00;
    --destructive-soft: #d930251a;
    --status-lapsed: #dc2626;
    --status-submitted: #007aff;
    --status-paid: #af52de;
    /* surfaces */
    --surface-raised: #fafafa;
    --tab-indicator: #f1f0f0;
    --scrim: #00000066;
    /* gold */
    --gold: #c9a24b;
    --gold-soft: #c9a24b1a;
    --gold-hairline: #c9a24b6b;
    --medal-gold: #c9a24b;
    --medal-silver: #c7cdd9;
    --medal-bronze: #c9906b;
    --on-medal: #32302f;
    /* hero */
    --hero-top: #2454c2;
    --hero-mid: #1745b1;
    --hero-bottom: #103491;
    --on-hero: #ffffff;
    --on-hero-secondary: #ffffffa6;
    --on-hero-fill: #ffffff2e;
    /* art */
    --art-sky: #1a8be0;
    --art-amber: #eb950c;
    --art-indigo: #4f46e5;
    --art-gray: #8f8d8a;
    /* system */
    --system-blue: #007aff;
    --system-orange: #ff9500;
    --system-purple: #af52de;
    /* swatch — mobile tokens.swatch: FeatureCard fills, each with the ink that
       reads on it. Fixed across themes; a card names one swatch per theme. */
    --swatch-stone: #edece7;
    --swatch-stone-ink: #000000;
    --swatch-sage: #e4e8d5;
    --swatch-sage-ink: #000000;
    --swatch-mist: #dfe7ed;
    --swatch-mist-ink: #000000;
    --swatch-blush: #f4e3d9;
    --swatch-blush-ink: #000000;
    --swatch-onyx: #080808;
    --swatch-onyx-ink: #ffffff;
    --swatch-graphite: #1c1c1e;
    --swatch-graphite-ink: #ffffff;
    --swatch-moss: #23271c;
    --swatch-moss-ink: #ffffff;
    --swatch-slate: #1d242b;
    --swatch-slate-ink: #ffffff;
    --swatch-clay: #2c221d;
    --swatch-clay-ink: #ffffff;
    --swatch-sand: #f3e6cf;
    --swatch-sand-ink: #000000;
    --swatch-lagoon: #cdeae6;
    --swatch-lagoon-ink: #000000;
    --swatch-coral: #f9d7c9;
    --swatch-coral-ink: #000000;
    --swatch-dusk: #e3dcf3;
    --swatch-dusk-ink: #000000;
    --swatch-dune: #2b2416;
    --swatch-dune-ink: #ffffff;
    --swatch-reef: #0e2c2a;
    --swatch-reef-ink: #ffffff;
    --swatch-ember: #35201a;
    --swatch-ember-ink: #ffffff;
    --swatch-twilight: #221d36;
    --swatch-twilight-ink: #ffffff;
    /* shadow */
    --shadow-color: #32302f14;
    --shadow-hero-color: #060d1f47;
    --shadow-brand-color: #10349173;
    /* cast in both themes, as on the web reference */
    --shadow-card-color: #0000000d;

    /* contract partners — aliases, so they follow the theme */
    --card-foreground: var(--foreground);
    --popover-foreground: var(--foreground);
    --primary-foreground: var(--on-hero);
    --secondary: var(--muted);
    --secondary-foreground: var(--foreground);
    --accent: var(--muted);
    --accent-foreground: var(--foreground);
    --destructive-foreground: var(--primary-foreground);
    --success-foreground: var(--primary-foreground);
    --warning-foreground: var(--primary-foreground);
    --ring: var(--primary);

    /* web has no blur, as on mobile: glass falls back to the card face */
    --glass-fill: var(--card);
    /* mobile ChartTooltip face: primaryDark at 94% */
    --tooltip: color-mix(in srgb, var(--primary-deep) 94%, transparent);
    /* LinearProgress fills by state: brand is reserved for a met target; an
       open one is a brand tint; a closed, missed period greys out */
    --progress-met: var(--primary);
    --progress-active: color-mix(in srgb, var(--primary) 40%, transparent);
    --progress-missed: var(--faint-foreground);
  }

  /* ================================================================
     TOKENS — color (dark)
     ================================================================ */
  .dark {
    color-scheme: dark;
    /* contract */
    --background: #0d0d0d;
    --foreground: #ffffff;
    --card: #1c1c1c;
    --popover: #2c2c2e;
    --primary: #4778eb;
    --muted: #ffffff1a;
    --muted-foreground: #ffffffb3;
    --destructive: #ff6961;
    --success: #30d158;
    --warning: #ffb340;
    --border: #ffffff24;
    --input: #ffffff29;
    /* field */
    --field-bg: #ffffff0d;
    --field-halo: #4778eb47;
    --field-halo-invalid: #ff69613d;
    /* glass */
    --glass-rim: #ffffff1f;
    --glass-hi: #ffffff0a;
    --glass-hair: #ffffff14;
    /* lit glass: a thin grey rim over a darker inner rim, nothing cast
       outside; hover dims the face */
    --stroke-glass-lit-top: 0.34px;
    --stroke-glass-lit-bottom: 0.34px;
    --stroke-glass-lit-inner: 0.67px;
    --glass-lit-rim: #5c5c5c;
    --glass-lit-inner-rim: #464646;
    --glass-lit-edge: transparent;
    --glass-lit-ring: transparent;
    --glass-lit-drop: transparent;
    --glass-lit-hover: #00000014;
    --glass-lit-face: linear-gradient(
      #2d2d2d, #282828 3%, #232323 10%, #212121 20%, #212121 35%,
      #202020 60%, #202020 85%, #232323 93%, #272727 98%, #2b2b2b);
    /* brand */
    --primary-soft: #4778eb29;
    --primary-deep: #1745b1;
    --primary-band: #4778eb38;
    --primary-hairline: #4778eb24;
    --art-tint: #4778eb1a;
    /* the logo's blue sinks into the dark page; it reverses to white */
    --brand-mark: #ffffff;
    /* card surface: a lit gradient ring instead of a solid rim */
    --card-hover: #272727;
    --card-ring: linear-gradient(
      336.4deg, #3e3f4080 14.76%, #3e3f4026 51.14%, #3e3f4080 93.14%);
    /* ink */
    --faint-foreground: #ffffff80;
    --navigation-foreground: #ffffff;
    --ink: #dce3f6;
    /* status */
    --success-soft: #30d15829;
    --warning-soft: #ffb34029;
    --warning-strong: #ffb340;
    --destructive-soft: #ff696129;
    --status-lapsed: #ff6961;
    --status-submitted: #0a84ff;
    --status-paid: #bf5af2;
    /* surfaces */
    --surface-raised: #1c1c1c;
    --tab-indicator: #7878803d;
    --scrim: #00000080;
    /* gold */
    --gold: #d6b266;
    --gold-soft: #d6b26629;
    --gold-hairline: #d6b2666b;
    --medal-gold: #d6b266;
    --medal-silver: #aeb6c6;
    --medal-bronze: #d19e77;
    --on-medal: #1c1c1c;
    /* hero */
    --hero-top: #103491;
    --hero-mid: #0a246b;
    --hero-bottom: #060d1f;
    /* art */
    --art-sky: #5aaef5;
    --art-amber: #ffb340;
    --art-indigo: #8b8ff8;
    --art-gray: #8e8e93;
    /* system */
    --system-blue: #0a84ff;
    --system-orange: #ff9f0a;
    --system-purple: #bf5af2;
    /* shadow */
    --shadow-color: #00000000;
    --shadow-brand-color: #00000000;
  }

  /* ================================================================
     RECIPES — multi-property surfaces utilities can't express; tokens only
     ================================================================ */

  /* the card surface: the face over a 1px ring (the border box shows through
     a transparent border: solid white in light, a lit gradient in dark) and
     a wide soft drop. A card that is a link lifts its face on hover. */
  .card-surface {
    --card-face: var(--card);
    border: var(--stroke-hairline) solid transparent;
    background:
      linear-gradient(var(--card-face), var(--card-face)) padding-box,
      var(--card-ring) border-box;
    box-shadow: var(--shadow-card);
  }
  @media (hover: hover) {
    a.card-surface:hover {
      --card-face: var(--card-hover);
    }
  }
  /* a glass capsule control: the rim without GlassSurface's lit line */
  .glass-capsule {
    box-shadow:
      inset 0 0 0 var(--stroke-glass-border) var(--glass-rim),
      var(--shadow-soft);
  }
  .focus-inset:focus-visible {
    box-shadow: var(--focus-ring-inset);
  }
  /* a lit glass capsule: the sheen as the face, the rim as top and bottom
     crescents (an inset shadow offset vertically thins to nothing at the
     ends), the inner rim just inside it, and --shadow-glass-lit outside.
     Hover tints the face only; the rim stays lit. */
  .glass-lit {
    background: var(--glass-lit-face);
    box-shadow:
      inset 0 var(--stroke-glass-lit-top) var(--glass-lit-rim),
      inset 0 calc(-1 * var(--stroke-glass-lit-bottom)) var(--glass-lit-rim),
      inset 0 calc(var(--stroke-glass-lit-top) + var(--stroke-glass-lit-inner))
        var(--glass-lit-inner-rim),
      inset 0
        calc(-1 * (var(--stroke-glass-lit-bottom) + var(--stroke-glass-lit-inner)))
        var(--glass-lit-inner-rim),
      var(--shadow-glass-lit);
  }
  @media (hover: hover) {
    .glass-lit:hover {
      background:
        linear-gradient(var(--glass-lit-hover), var(--glass-lit-hover)),
        var(--glass-lit-face);
    }
  }
  /* mobile's framed field (BaseField + FieldFrame): the field face with a 1px
     edge drawn inside it, so the text never moves; focus anywhere in the frame
     (the input or its reveal toggle) turns the edge primary and rings it with
     the halo. The input inside draws no ring of its own. */
  .field-frame {
    background: var(--field-bg);
    border-radius: var(--field-radius);
    box-shadow: inset 0 0 0 var(--field-border-width) var(--field-border-color);
    transition: box-shadow var(--duration-hover) var(--ease-out);
  }
  .field-frame:focus-within {
    box-shadow:
      inset 0 0 0 var(--field-border-width) var(--field-border-focus),
      0 0 0 var(--field-halo-width) var(--field-halo);
  }
  .field-frame input:focus-visible {
    box-shadow: none;
  }

  /* the full logo: one colour on transparency, so it is drawn as a mask over
     --brand-mark and follows the theme */
  .brand-logo {
    aspect-ratio: var(--brand-logo-ratio);
    background: var(--brand-mark);
    mask: url("../assets/aristotle-logo.png") center / contain no-repeat;
  }

  /* a background silhouette (mobile's announcement art: white on
     transparency, cropped for a corner). Drawn as a mask over --art-tint, as
     mobile tints it. The element fills its panel and takes the silhouette as
     an inline mask-image (set from data, so its url resolves against the page,
     not this sheet). Scaled up from the bottom-right corner so the leaf sits
     mid-panel; the element bleeds past that corner so the artwork's cropped
     edges stay outside the panel while the leaf sways from its base there. */
  .panel-art {
    position: absolute;
    inset: 0 calc(-1 * var(--art-bleed)) calc(-1 * var(--art-bleed)) 0;
    background: var(--art-tint);
    mask-position: right bottom;
    mask-size: 120% auto;
    mask-repeat: no-repeat;
    transform-origin: right bottom;
    animation:
      art-sway var(--duration-sway) var(--ease-in-out) infinite alternate,
      art-breathe var(--duration-breathe) var(--ease-in-out) infinite alternate;
  }
  @keyframes art-sway {
    from {
      rotate: calc(-1 * var(--art-sway));
    }
    to {
      rotate: var(--art-sway);
    }
  }
  @keyframes art-breathe {
    from {
      scale: 1;
    }
    to {
      scale: var(--art-breathe);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .panel-art {
      animation: none;
    }
  }

  /* floating chrome over content, e.g. a rail's scroll arrows */
  .glass-float {
    box-shadow:
      inset 0 0 0 var(--stroke-glass-border) var(--glass-rim),
      var(--shadow-float);
  }

  /* horizontal snap row; the padding/margin bleed keeps card shadows unclipped */
  .snap-rail {
    display: flex;
    gap: var(--card-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: var(--space-2) var(--space-2) var(--space-4);
    margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2))
      calc(-1 * var(--space-4));
    scroll-padding-inline: var(--space-2);
  }
  .snap-rail::-webkit-scrollbar {
    display: none;
  }
  .snap-rail > * {
    flex: none;
    scroll-snap-align: start;
  }

  /* scrolls with no scrollbar taking width, e.g. the nav rail in a short window */
  .scrollbar-none {
    scrollbar-width: none;
  }
  .scrollbar-none::-webkit-scrollbar {
    display: none;
  }

  /* card deck: every card shares one grid cell. The next card peeks out above
     the front one, and any further cards wait unseen behind it */
  .card-stack {
    display: grid;
    padding-top: var(--stack-peek);
  }
  .card-stack > * {
    grid-area: 1 / 1;
    transform-origin: top;
    transition:
      translate var(--duration-page-slide) var(--ease-settle),
      scale var(--duration-page-slide) var(--ease-settle),
      opacity var(--duration-page-slide) var(--ease-settle);
  }
  .stack-front {
    z-index: 2;
  }
  .stack-next,
  .stack-behind {
    translate: 0 calc(-1 * var(--stack-peek));
    scale: var(--stack-scale);
  }
  .stack-next {
    z-index: 1;
  }
  .stack-behind {
    opacity: 0;
  }
  @media (prefers-reduced-motion: reduce) {
    .card-stack > * {
      transition: none;
    }
  }

  /* FeatureCard: the swatch pair is set inline (`--swatch-fill`, `--swatch-ink`);
     pills are the fill pushed toward the ink, opaque so they read over the art */
  .feature-card {
    background: var(--swatch-fill);
    color: var(--swatch-ink);
  }
  .feature-pill {
    background: color-mix(
      in srgb,
      var(--swatch-fill),
      var(--swatch-ink) var(--feature-pill-mix)
    );
  }

  .chart-line,
  .chart-context {
    fill: none;
    stroke: var(--primary);
    stroke-width: var(--chart-line-width);
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .chart-context {
    stroke-opacity: var(--chart-context-opacity);
    stroke-width: var(--stroke-hairline);
    stroke-dasharray: var(--chart-dash);
    stroke-linecap: butt;
  }
  .chart-stipple {
    fill: var(--primary);
    fill-opacity: var(--chart-stipple-opacity);
  }
  .chart-baseline {
    stroke: var(--border);
    stroke-width: var(--stroke-hairline);
  }
  .chart-rule {
    stroke: var(--glass-hair);
    stroke-width: var(--stroke-hairline);
  }

  /* ChartLegend swatches teach each series' mark: a solid bar, or the thin
     faded, dashed context line */
  .legend-line {
    height: var(--stroke-ring-current);
    background: var(--primary);
  }
  .legend-context {
    height: var(--stroke-hairline);
    background: repeating-linear-gradient(
      to right,
      var(--primary) 0 var(--chart-dash),
      transparent var(--chart-dash) calc(var(--chart-dash) * 2)
    );
    opacity: var(--chart-context-opacity);
  }

  /* home: main column + aside from lg (340px, 393px from 1440 with a wider
     gap); below, the aside wraps under the main column, the news deck full
     width over the two trackers */
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-10) var(--column-gap);
    align-items: start;
  }
  .home-aside {
    display: grid;
    gap: var(--aside-gap);
    align-content: start;
  }
  @media (min-width: 768px) and (max-width: 1023px) {
    .home-aside {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-aside > :first-child {
      grid-column: 1 / -1;
    }
  }
  @media (min-width: 1024px) {
    .home-grid {
      grid-template-columns: minmax(0, 1fr) var(--aside);
    }
  }
  @media (min-width: 1440px) {
    .home-grid {
      grid-template-columns: minmax(0, 1fr) var(--aside-wide);
      column-gap: var(--column-gap-wide);
    }
  }
}
