/* =========================================================
   The glass look (November 2026)

   A page opts in with <html class="glass"> and loads this file. Every page
   does, the order page included; that page keeps its own styles and cannot
   load brand.css, which is why the look's colours and frame live here.

   What it is: soft green and gold light behind the page, and frosted panels
   over it. Light or dark follows the visitor's device, or the button that
   assets/theme.js puts in the corner; the script sets data-theme on <html>,
   and everything below reads its colours from the tokens in these two blocks.

   Three rules it keeps:
   - Anything typed, or read as a figure, sits on a nearly solid surface.
     Glass is for the frame around it.
   - No panel depends on blur to be readable: where the browser can't blur,
     or the visitor has asked for less transparency, panels turn solid.
   - Nothing here needs an image, a font or a script from anywhere new.
   ========================================================= */
html.glass {
  color-scheme: light;
  --radius:        14px;
  --radius-lg:     26px;
  --wrap:          1080px;    /* the page width; the order page has no brand.css to give it */
  --on-brand:      #eef1ea;   /* text on the dark green panels, in both looks */
  --gold-fill-top: #b08644;   /* the order button, in both looks */
  --gold-fill:     #96712f;

  --page:          #eef1ea;
  --glow-1:        rgba(46, 125, 101, .46);
  --glow-2:        rgba(201, 160, 92, .56);
  --glow-3:        rgba(120, 170, 150, .46);

  --glass:         rgba(255, 255, 255, .52);
  --glass-solid:   rgba(255, 255, 255, .95);
  --glass-edge:    rgba(255, 255, 255, .85);
  --glass-shadow:  0 24px 60px rgba(22, 48, 42, .14);
  --glass-shine:   inset 0 1px 0 rgba(255, 255, 255, .55);
  --blur:          blur(22px) saturate(170%);

  --panel:         rgba(22, 48, 42, .86);   /* menu pill, result card, footer */
  --panel-solid:   #16302a;
  --panel-edge:    rgba(255, 255, 255, .14);
  --panel-shadow:  0 22px 54px rgba(8, 20, 17, .28);
  --result-edge:   rgba(255, 255, 255, .14);

  --field:         rgba(255, 255, 255, .92); /* typing boxes, and text that must stay easy to read */
  --field-edge:    #d0d6ca;
  --line:          rgba(22, 48, 42, .09);
  --line-strong:   rgba(22, 48, 42, .11);
  --focus:         #16302a;
  --warn-bg:       #fdf6e6;
  --warn-edge:     #e6d3a8;
  --error:         #8a3a2f;
  --ok:            #2f6b45;
  --paper:         rgba(255, 255, 255, .80);  /* behind long text */
  --menu:          rgba(255, 255, 255, .97);
  --tint-a:        rgba(247, 241, 228, .82);
  --tint-b:        rgba(255, 255, 255, .50);
  --ink-btn:       linear-gradient(180deg, #23483e, #16302a);
  --ink-btn-edge:  rgba(255, 255, 255, .14);
}
html.glass[data-theme="dark"] {
  color-scheme: dark;
  /* the site's own tokens, turned over */
  --bg:            #0b1a16;
  --white:         #13261f;
  --ink:           #eef1ea;
  --soft:          #a9bdb1;
  --border:        rgba(255, 255, 255, .16);
  --brand:         #1d3d34;
  --gold:          #c9a05c;
  --gold-dark:     #dcbb7e;
  --gold-tint:     rgba(201, 160, 92, .10);
  --vault:         #1d3d34;   /* the order page's name for --brand */
  --red:           #f2a593;

  --page:          #0b1a16;
  --glow-1:        rgba(34, 140, 106, .48);
  --glow-2:        rgba(201, 160, 92, .32);
  --glow-3:        rgba(20, 96, 84, .55);

  --glass:         rgba(255, 255, 255, .075);
  --glass-solid:   #152a23;
  --glass-edge:    rgba(255, 255, 255, .17);
  --glass-shadow:  0 24px 60px rgba(0, 0, 0, .38);
  --glass-shine:   inset 0 1px 0 rgba(255, 255, 255, .14);

  --panel:         rgba(255, 255, 255, .10);
  --panel-solid:   #1a342c;
  --panel-edge:    rgba(255, 255, 255, .18);
  --panel-shadow:  0 22px 54px rgba(0, 0, 0, .40);
  --result-edge:   rgba(201, 160, 92, .50);

  --field:         rgba(6, 18, 15, .62);
  --field-edge:    rgba(255, 255, 255, .18);
  --line:          rgba(255, 255, 255, .09);
  --line-strong:   rgba(255, 255, 255, .13);
  --focus:         #c9a05c;
  --warn-bg:       rgba(201, 160, 92, .15);
  --warn-edge:     rgba(201, 160, 92, .45);
  --error:         #f2a593;
  --ok:            #86d3a6;
  --paper:         rgba(10, 24, 20, .70);
  --menu:          rgba(19, 38, 31, .98);
  --tint-a:        rgba(201, 160, 92, .16);
  --tint-b:        rgba(255, 255, 255, .06);
  --ink-btn:       linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .10));
  --ink-btn-edge:  rgba(255, 255, 255, .26);
}
/* No blur available, or less transparency asked for: the same panels, solid. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html.glass, html.glass[data-theme="dark"] { --glass: var(--glass-solid); --panel: var(--panel-solid); }
}
@media (prefers-reduced-transparency: reduce) {
  html.glass, html.glass[data-theme="dark"] { --glass: var(--glass-solid); --panel: var(--panel-solid); --blur: none; }
}

/* ---------- the light behind the page ---------- */
html.glass { background: var(--page); }
html.glass body { background: transparent; color: var(--ink); }
html.glass body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(min(40rem, 120vw) min(40rem, 120vw) at 2% 18%, var(--glow-1) 0%, var(--glow-1) 14%, transparent 72%),
    radial-gradient(min(36rem, 110vw) min(36rem, 110vw) at 99% 48%, var(--glow-2) 0%, var(--glow-2) 12%, transparent 70%),
    radial-gradient(min(42rem, 120vw) min(42rem, 120vw) at 38% 104%, var(--glow-3) 0%, var(--glow-3) 12%, transparent 72%);
}

/* ---------- header: a floating pill ---------- */
html.glass .site-header {
  position: sticky; top: 0; z-index: 70; padding: 14px 16px 0;
  background: transparent; color: var(--on-brand);
}
html.glass .site-header .wrap {
  max-width: calc(var(--wrap) - 48px); height: 60px; padding: 0 10px 0 22px; gap: 22px; border-radius: 999px;
  background: var(--panel);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--panel-edge);
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255, 255, 255, .16);
}
html.glass .site-header .wordmark,
html.glass .site-footer .wordmark,
html.glass .site-nav a,
html.glass .site-nav .nm-trigger,
html.glass .site-nav .nm-top { color: var(--on-brand); }
html.glass .site-nav .nm-trigger:not(.is-current),
html.glass .site-nav .nm-top:not([aria-current="page"]),
html.glass .nm-hl { border-radius: 999px; }
/* The drop-down holds words to read, so it is nearly solid rather than glass. */
html.glass .nm-box {
  background: var(--menu); border-color: var(--line-strong); border-radius: 20px;
  box-shadow: var(--glass-shadow);
}
html.glass .site-nav .nm-item { color: var(--ink); border-radius: 14px; }

/* The menu follows you down the page, so anything scrolled to stops below it. */
html.glass :target, html.glass .scroll-stop { scroll-margin-top: 96px; }

/* ---------- footer: one dark panel ---------- */
html.glass .site-footer { background: transparent; color: var(--on-brand); padding: 0 16px 84px; }
html.glass .site-footer .wrap {
  max-width: calc(var(--wrap) - 48px); padding: 38px 34px 30px; border-radius: var(--radius-lg);
  background: var(--panel);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--panel-edge); box-shadow: var(--panel-shadow);
}
html.glass .footer-col h4,
html.glass .site-footer a:hover { color: var(--on-brand); }

/* ---------- things other scripts draw ---------- */
/* Typing boxes are animated by an overlay that copies the box's colour once;
   this keeps it right when the look changes under it. */
html.glass .ai-text { color: var(--ink) !important; }
html.glass .ip-list {
  top: calc(100% + 6px); padding: 6px; border-color: var(--field-edge); border-radius: 16px;
  background: var(--menu); box-shadow: var(--glass-shadow);
}
html.glass .ip-opt { border-radius: 10px; }
html.glass .bw-chat-launch {
  background: var(--panel);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--panel-edge);
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255, 255, 255, .16);
}
html.glass .bw-chat { border-radius: 22px; }

/* ---------- the light / dark button (assets/theme.js) ---------- */
.bw-theme {
  position: fixed; left: 18px; bottom: 18px; z-index: 80;
  width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--on-brand); background: var(--panel);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--panel-edge);
  box-shadow: var(--panel-shadow), inset 0 1px 0 rgba(255, 255, 255, .16);
  transition: transform .18s ease;
}
.bw-theme:hover { transform: translateY(-2px); }
.bw-theme:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.bw-theme svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bw-theme-sun { display: none; }
[data-theme="dark"] .bw-theme-sun { display: block; }
[data-theme="dark"] .bw-theme-moon { display: none; }

@media (max-width: 640px) {
  /* Two rows of menu would cover a third of a phone's screen if it followed you down. */
  html.glass .site-header { position: static; padding: 10px 10px 0; }
  html.glass :target, html.glass .scroll-stop { scroll-margin-top: 14px; }
  html.glass .site-header .wrap { height: auto; padding: 12px 16px; gap: 10px; border-radius: 24px; }
  html.glass .site-footer { padding: 0 10px 84px; }
  html.glass .site-footer .wrap { padding: 28px 22px 24px; }
}
@media (max-width: 520px) {
  .bw-theme { left: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html.glass .btn, .bw-theme { transition: none; }
  html.glass .btn:hover, .bw-theme:hover { transform: none; }
}
@media print {
  .bw-theme { display: none !important; }
  html.glass body::before { display: none; }
  /* Paper is white. A package printed from the dark look would otherwise come
     out as pale text on a white sheet, so printing always uses the light inks. */
  html.glass, html.glass[data-theme="dark"] {
    color-scheme: light; background: #fff;
    --bg: #eef1ea; --white: #ffffff; --ink: #16241d; --soft: #5c6a5f; --border: #c9cec1;
    --brand: #16302a; --vault: #16302a; --gold: #a9803f; --gold-dark: #8a6830; --gold-tint: #f7f1e4; --red: #a23b32;
    --page: #ffffff; --paper: #ffffff; --field: #ffffff; --field-edge: #c9cec1; --line: #d5d9cf; --line-strong: #c9cec1;
  }
}

/* The two-step breadcrumb (valuation, CIM, order). */
html.glass .funnel { background: transparent; border: 0; }
html.glass .funnel .wrap { padding-top: 26px; padding-bottom: 0; }
html.glass .funnel-rule { background: var(--line-strong); }
