/* Mercury Trade on the web: the frosted look's page glows and its plain version (Conor, 26 Nov 2026; Mercury Apps'
   components/bundle.css, "Frosted glass"). Loaded after mercury-tokens.css, which `npm run build-tokens` makes from
   the design system's tokens: every colour here is one of its custom properties, never typed in.

   The components draw the glass themselves (src/theme.js). Each frosted part carries a mark this file finds it by:
     data-m="glass"     a card, a menu tile ("glass tile") or the sections bar ("glass sections")
     data-m="row"       a table row on a PC
     data-m="on-brand"  the see-through Sign out pill on the band
     data-m="band"      the red band
   react-native-web's own classes come later in the page, so the rules that override them say !important.
   Don't make the glows or the glass stronger than the tokens: they're set so text still passes contrast at a
   glow's centre. */

/* The page: three soft glows, red at the left, blue at the right, a faint red under the band. CSS gradients,
   not pictures, so older phones stay smooth. They stay put as the page scrolls. */
body {
  background:
    radial-gradient(circle 520px at 0% 62%, var(--glow-red), transparent 70%),
    radial-gradient(circle 480px at 100% 46%, var(--glow-blue), transparent 70%),
    radial-gradient(circle 420px at 50% 10%, var(--glow-soft), transparent 70%),
    var(--bg);
}

/* On a phone the sections bar scrolls sideways: a fade at its right edge shows there are more. */
@media (max-width: 999px) {
  [data-m~="sections"] {
    -webkit-mask-image: linear-gradient(90deg, black calc(100% - 24px), transparent);
            mask-image: linear-gradient(90deg, black calc(100% - 24px), transparent);
  }
}

/* A section's own menu (SubMenu.js, 30 Nov 2026) scrolls sideways too, and may start part way along to show the
   current one: a short fade at both ends. */
@media (max-width: 999px) {
  [data-m~="sub-menu"] {
    -webkit-mask-image: linear-gradient(90deg, transparent, black 16px, black calc(100% - 16px), transparent);
            mask-image: linear-gradient(90deg, transparent, black 16px, black calc(100% - 16px), transparent);
  }
}

/* A menu tile lifts 3px when hovered, but not for people who ask for less motion. */
[data-m~="tile"] { transition: transform 0.15s, box-shadow 0.15s; }
@media (prefers-reduced-motion: reduce) {
  [data-m~="tile"] { transform: none !important; transition: none !important; }
}

/* ---------- The plain version ---------- */

/* A browser that can't blur: frosted surfaces are solid. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  [data-m~="glass"] { background-color: var(--surface) !important; }
}

/* The person's device asks for less transparency: solid surfaces, a plain page and no glows. */
@media (prefers-reduced-transparency: reduce) {
  body { background: var(--bg); }
  [data-m~="glass"] {
    background-color: var(--surface) !important;
    -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
  }
  [data-m~="row"] { background-color: var(--surface) !important; }
  [data-m~="on-brand"] { background-color: var(--brand-deep) !important; }
}

/* High contrast, asked for: solid surfaces with real borders, as strong as a field's outline (3 to 1). */
@media (prefers-contrast: more) {
  [data-m~="glass"] {
    background-color: var(--surface) !important;
    -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
    border-color: var(--field) !important;
  }
  [data-m~="row"] { background-color: var(--surface) !important; border-color: var(--field) !important; }
}

/* Windows' high-contrast themes (forced colours): the system's own colours, and real borders. */
@media (forced-colors: active) {
  [data-m~="band"] { border-bottom: 1px solid CanvasText !important; }
  [data-m~="glass"], [data-m~="row"] { border-color: CanvasText !important; }
}
