/*
 * fd-theme.css: the Forum's one place for colour and material (lane U,
 * 2026-11-07). Loaded right after her stylesheets and before fd-motion.css
 * and fd-app.css (replacements.mjs html-styles), so its :root overrides her
 * tokens. Every other overlay stylesheet uses these tokens, never a raw
 * colour; tune the look here.
 *
 * OWNER DECISIONS
 *   D21  the member portal's ground and surfaces replace her cream paper
 *        (src/app/(hub)/hub.css): canvas #f3f7f9, white cards, sunk wells
 *        #e8eef1, lines #d7e0e6 / #7e8f9b, ink #141a20, soft ink #4a5560,
 *        the portal's status colours and its seven icon-circle accents.
 *   D22  Apple's glass look, only on floating layers over content or
 *        imagery (header, menus, the room's drawer, dialogs, the room's
 *        control bar and the stage caption); cards stay solid. Values
 *        informed by Apple's macOS 27 UI kit tokens (numbers only; no Apple
 *        asset, font or symbol is used): Regular glass rgba(255,255,255,.70)
 *        over a .10 wash, Menus rgba(230,230,230,.55), Notification,
 *        Dock, the Material thickness scale (rgba(236,236,236,.38 to .88)),
 *        over-glass bordered buttons (rgba(0,0,0,.07) / .12). Each tint is
 *        raised where the worst case behind it is dark (the Join hero, the
 *        room) so text on glass keeps 4.5:1 (recorded per token below).
 *   D23  the Dunkelblau accent set: Midnight #0C2842 (her --ink role:
 *        headings, the top bar, dark panels, primary buttons), Dunkelblau
 *        Nr. 50 #3A4F5E (her --accent role: links, eyebrows, active
 *        underline, secondary buttons, icon strokes, focus ring), Mint
 *        #90F6BD (highlight, always with dark text: the active row as a plain
 *        soft tint, no edge (2026-11-09); full mint only on small highlights).
 *        Her rust #b65231 and the earlier teal are no longer interface
 *        colours (the room palette keeps Rust as a choice a room can make).
 *
 * Fonts stay hers: Libre Caslon Display and DM Sans (fd-fonts.css).
 */

:root {
  /* ---------------------------------------------- ground and surfaces (D21) */
  --fd-canvas: #f3f7f9;
  --fd-surface: #ffffff;
  --fd-sunk: #e8eef1;
  --fd-line: #d7e0e6; /* decorative separators */
  --fd-line-strong: #7e8f9b; /* control boundaries, 3.1:1 on the canvas */

  /* ---------------------------------------------- text (D21, D23) */
  --fd-ink: #141a20; /* body text: 16.6:1 on the canvas */
  --fd-ink-soft: #4a5560; /* secondary text: 7.06:1 on the canvas, 6.50:1 on the sunk well */
  --fd-heading: #0c2842; /* Midnight: headings, 13.9:1 on the canvas */

  /* ---------------------------------------------- the Dunkelblau set (D23) */
  --fd-midnight: #0c2842; /* white on it 15.0:1 */
  --fd-midnight-raised: #173a5c; /* hover of a Midnight control; white on it 11.7:1 */
  --fd-midnight-deep: #08192b; /* the room's ground */
  --fd-anchor: #3a4f5e; /* Dunkelblau Nr. 50: white on it 8.5:1; on the canvas 7.9:1 */
  --fd-anchor-hover: #0c2842;
  --fd-mint: #90f6bd; /* only with --fd-ink on it (13.4:1); never text on light */
  --fd-mint-soft: #dff9ea; /* the active row's tint */
  --fd-on-dark: #f3f7f9; /* text on Midnight */
  --fd-on-dark-soft: #b9c7d1; /* secondary text on Midnight: 8.7:1 (6.3:1 at the hero gradient's light end) */
  --fd-dark-line: rgba(255, 255, 255, 0.14);
  --fd-hero: linear-gradient(135deg, #0c2842 0%, #163f63 100%); /* dark panels: white 10.9:1 at the light end */

  /* ---------------------------------------------- status (the portal's, D21) */
  --fd-ok: #1f6b4f;
  --fd-ok-bg: #e6f3ec;
  --fd-warn: #8a5a00;
  --fd-warn-bg: #fdf4e3;
  --fd-err: #a3232f;
  --fd-err-bg: #fbecee;
  --fd-info-bg: #eaf2f6;
  --fd-brand-red: #e32636; /* the 360 brand mark and destructive confirms only */

  /* ---------------------------------------------- the portal's icon circles (D21: benefit rows, membership levels) */
  --fd-dot-green: #4b9b6e;
  --fd-dot-blue: #4a86b8;
  --fd-dot-amber: #d08a26;
  --fd-dot-coral: #d4676b;
  --fd-dot-olive: #7d8f5a;
  --fd-dot-purple: #8b6bb1;
  --fd-dot-teal: #3f8f96;
  --fd-wash-green: #dcefe3;
  --fd-wash-blue: #dde9f2;
  --fd-wash-amber: #f7ecd6;
  --fd-wash-coral: #f7dfe0;
  --fd-wash-olive: #e8edd9;
  --fd-wash-purple: #e9e1f2;
  --fd-wash-teal: #d9ecee;

  /* ---------------------------------------------- the room accents (gate TD4, design item 9)
     Each carries white text at 4.5:1 or better and reads as text at 4.5:1 or
     better on the canvas and on white (fd-room-model.js PALETTE, tested). The
     Forum demo's avatar palette (scripts/forum-demo/avatars.mjs) names this file. */
  --fd-accent-blue: #2a5879;
  --fd-accent-teal: #2c666d;
  --fd-accent-slate: #637174;
  --fd-accent-indigo: #404482;
  --fd-accent-plum: #87456a;
  --fd-accent-brick: #a14036;
  --fd-accent-rust: #b65231;

  /* ---------------------------------------------- the map (shapes, never the accent) */
  --fd-map-fill: #dbe5eb;
  --fd-map-fill-hover: #b9cdd9;
  --fd-map-stroke: #ffffff;

  /* ---------------------------------------------- the glass material (D22) */
  --glass-blur: 24px;
  --glass-saturate: 180%;
  --glass-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  --glass-menu-filter: blur(30px) saturate(var(--glass-saturate));
  /* Regular (header): Apple's .70 white raised to .80, so soft ink stays 4.5:1 with the Join hero under it. */
  --glass-tint: rgba(255, 255, 255, 0.8);
  --glass-wash: rgba(12, 40, 66, 0.035); /* D23: the header's Midnight tint (Apple's grey .10 wash, in our hue) */
  --glass-bg: linear-gradient(var(--glass-wash), var(--glass-wash)), var(--glass-tint);
  /* Thick (the room's drawer, dialogs): over the dark room or backdrop, .88 keeps soft ink at 5.0:1. */
  --glass-thick: rgba(255, 255, 255, 0.88);
  --glass-thick-bg: linear-gradient(var(--glass-wash), var(--glass-wash)), var(--glass-thick);
  /* Menus: Apple's .55 grey raised to .86 on our canvas hue: ink 10:1 over the darkest page behind. */
  --glass-menu-bg: rgba(243, 247, 249, 0.86);
  /* Notification (the toast): Apple's .25 is too clear over a busy page; .9 keeps ink at 12:1. */
  --glass-note-bg: rgba(243, 247, 249, 0.9);
  /* Dock (the room's control bar), over the room's dark ground. */
  --glass-dock-bg: linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)), rgba(8, 25, 43, 0.62);
  /* Ultra Thick material (the stage caption over the busy room image): .88, soft ink 5.0:1 over black. */
  --glass-caption-bg: rgba(236, 236, 236, 0.88);
  /* The room's bar, over the room's ground. */
  --glass-dark-bg: rgba(12, 40, 66, 0.72);
  --glass-edge: rgba(12, 40, 66, 0.1); /* a 0.5 to 1 px hairline ring */
  --glass-edge-dark: rgba(255, 255, 255, 0.14);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6); /* the light inner top edge */
  --glass-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-edge), 0 18px 46px rgba(8, 25, 43, 0.16);
  --glass-bar-shadow: var(--glass-highlight), 0 1px 0 var(--glass-edge), 0 8px 24px rgba(8, 25, 43, 0.06);
  --glass-menu-shadow: var(--glass-highlight), 0 0 0 0.5px rgba(0, 0, 0, 0.2), 0 4px 24px rgba(8, 25, 43, 0.24);
  --glass-note-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-edge), 0 4px 16px rgba(0, 0, 0, 0.1);
  --glass-dock-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.25), 0 12px 28px rgba(0, 0, 0, 0.35);
  /* Over-glass bordered controls (Apple's .07 fill, .12 edge), and their dark-surface twins. */
  --glass-control-bg: rgba(12, 40, 66, 0.06);
  --glass-control-edge: rgba(12, 40, 66, 0.14);
  --glass-control-dark-bg: rgba(255, 255, 255, 0.08);
  --glass-control-dark-edge: rgba(255, 255, 255, 0.18);
  --fd-scrim: rgba(8, 25, 43, 0.5);

  /* ---------------------------------------------- solid surfaces: depth with an offset, scaled well down from Apple's panel */
  --shadow-card: 0 1px 2px rgba(8, 25, 43, 0.05), 0 6px 18px rgba(8, 25, 43, 0.05);
  --shadow-raised: 0 2px 4px rgba(8, 25, 43, 0.06), 0 14px 32px rgba(8, 25, 43, 0.1);

  /* ---------------------------------------------- radii: continuous and large on surfaces, pills on controls */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* ---------------------------------------------- focus (D23: Dunkelblau ring with a soft halo; mint on dark) */
  --fd-focus: 0 0 0 2px var(--fd-anchor), 0 0 0 6px rgba(58, 79, 94, 0.25);
  --fd-focus-dark: 0 0 0 2px var(--fd-mint), 0 0 0 6px rgba(144, 246, 189, 0.28);
  /* D24: the header's tabs and menu: a mint ring held by a Midnight edge, so it reads on white glass and on the Midnight Join pill */
  --fd-focus-mint: 0 0 0 3px var(--fd-mint), 0 0 0 5px var(--fd-midnight);
  --fd-selection: rgba(58, 79, 94, 0.2);

  /* ---------------------------------------------- her tokens, remapped (styles.css :root) */
  --ink: var(--fd-heading);
  --text: var(--fd-ink);
  --muted: var(--fd-ink-soft);
  --paper: var(--fd-canvas);
  --line: var(--fd-line);
  --white: var(--fd-surface);
  --accent: var(--fd-anchor);
  --green: var(--fd-anchor);
  --soft: var(--fd-sunk);
}

/* ---------------------------------------------- fallbacks: a solid surface where glass cannot be, or is not wanted */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-bg: var(--fd-surface);
    --glass-thick-bg: var(--fd-surface);
    --glass-menu-bg: var(--fd-surface);
    --glass-note-bg: var(--fd-surface);
    --glass-dock-bg: var(--fd-midnight);
    --glass-caption-bg: var(--fd-surface);
    --glass-dark-bg: var(--fd-midnight);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-filter: none;
    --glass-menu-filter: none;
    --glass-bg: var(--fd-surface);
    --glass-thick-bg: var(--fd-surface);
    --glass-menu-bg: var(--fd-surface);
    --glass-note-bg: var(--fd-surface);
    --glass-dock-bg: var(--fd-midnight);
    --glass-caption-bg: var(--fd-surface);
    --glass-dark-bg: var(--fd-midnight);
  }
}
/* Phones: blur is costly; the stage caption and the room bar go solid, so at most three layers blur at once. */
@media (max-width: 760px) {
  :root {
    --glass-menu-bg: rgba(243, 247, 249, 0.95); /* a long list over a busy page: less of the page shows through */
    --glass-caption-bg: rgba(243, 247, 249, 0.96);
    --glass-dark-bg: var(--fd-midnight);
  }
}
