/* Glass look and transitions (branding.json "glass": true, or a "home" section). Active under html.jvGlass.
   Frosted panels over a soft colour field, and iOS-style glass transitions between screens: the old view blurs and
   sinks back while the new one comes forward out of the blur (View Transitions API; plain fade elsewhere). */

html.jvGlass {
  --gl-bg: rgba(16, 26, 43, .58);
  --gl-bg-strong: rgba(20, 33, 56, .72);
  --gl-line: rgba(255, 255, 255, .09);
  --gl-hi: rgba(255, 255, 255, .10);
  --gl-shadow: 0 18px 50px rgba(0, 0, 0, .38);
  --gl-blur: blur(22px) saturate(175%);
  --gl-ease: cubic-bezier(.32, .72, 0, 1);
  background: var(--bg);
}
html.jvGlass[data-theme="light"] {
  --gl-bg: rgba(255, 255, 255, .62);
  --gl-bg-strong: rgba(255, 255, 255, .78);
  --gl-line: rgba(15, 30, 55, .10);
  --gl-hi: rgba(255, 255, 255, .85);
  --gl-shadow: 0 18px 50px rgba(20, 40, 80, .14);
}
html.jvGlass body { background: transparent; }
/* the colour field the glass blurs */
html.jvGlass body::before {
  content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 18% 12%, rgba(255, 122, 0, .16), transparent 70%),
    radial-gradient(42vmax 34vmax at 85% 18%, rgba(39, 135, 255, .20), transparent 70%),
    radial-gradient(40vmax 36vmax at 60% 95%, rgba(20, 200, 244, .12), transparent 70%),
    var(--bg);
  animation: jvAurora 26s ease-in-out infinite alternate;
}
html.jvGlass[data-theme="light"] body::before {
  background:
    radial-gradient(38vmax 30vmax at 18% 12%, rgba(255, 122, 0, .12), transparent 70%),
    radial-gradient(42vmax 34vmax at 85% 18%, rgba(39, 135, 255, .14), transparent 70%),
    radial-gradient(40vmax 36vmax at 60% 95%, rgba(20, 200, 244, .10), transparent 70%),
    var(--bg);
}
@keyframes jvAurora { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-3vmax, 2vmax, 0) scale(1.06); } }

/* frosted surfaces */
html.jvGlass .topShell,
html.jvGlass .leftRail,
html.jvGlass .filterWorkspace,
html.jvGlass #assistantSide,
html.jvGlass .modal .box,
html.jvGlass .loginCard {
  background: var(--gl-bg) !important;
  -webkit-backdrop-filter: var(--gl-blur); backdrop-filter: var(--gl-blur);
  border-color: var(--gl-line) !important;
  box-shadow: inset 0 1px 0 var(--gl-hi), var(--gl-shadow);
}
html.jvGlass .filterWorkspace { border-left-color: var(--accent) !important; }
html.jvGlass .topShell { box-shadow: inset 0 -1px 0 var(--gl-line); }
html.jvGlass .leftRail { box-shadow: inset -1px 0 0 var(--gl-line); }
html.jvGlass .execKpiCard,
html.jvGlass .chartCard,
html.jvGlass .card {
  background: var(--gl-bg) !important;
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  border-color: var(--gl-line) !important;
  box-shadow: inset 0 1px 0 var(--gl-hi);
}
html.jvGlass .modal { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html.jvGlass .loginScreen { background: transparent !important; }

/* motion for things that slide or press */
html.jvGlass #assistantSide { view-transition-name: jvSide; }
html.jvGlass .railBtn, html.jvGlass .btn, html.jvGlass .topChatBtn, html.jvGlass .topIconBtn, html.jvGlass .jvSites a {
  transition: transform .25s var(--gl-ease), background-color .25s var(--gl-ease), color .25s var(--gl-ease), box-shadow .25s var(--gl-ease);
}
html.jvGlass .railBtn:active, html.jvGlass .btn:active, html.jvGlass .topChatBtn:active, html.jvGlass .topIconBtn:active { transform: scale(.94); }
html.jvGlass .modal.on .box { animation: jvGlassIn .5s var(--gl-ease) both; }

/* ------------------------------------------------ glass transitions between screens */
@view-transition { navigation: auto; }                         /* SALES <-> STOCK (same site) */
html.jvGlass .topShell { view-transition-name: jvTop; }
html.jvGlass .leftRail { view-transition-name: jvRail; }
::view-transition-group(*) { animation-duration: .58s; animation-timing-function: cubic-bezier(.32, .72, 0, 1); }
::view-transition-old(root) { animation: jvGlassOut .5s cubic-bezier(.32, .72, 0, 1) both; }
::view-transition-new(root) { animation: jvGlassIn .62s cubic-bezier(.32, .72, 0, 1) both; }
::view-transition-old(jvTop), ::view-transition-new(jvTop), ::view-transition-old(jvRail), ::view-transition-new(jvRail) { animation-duration: .35s; }
@keyframes jvGlassOut {
  from { opacity: 1; transform: scale(1); filter: blur(0) saturate(1); }
  to   { opacity: 0; transform: scale(.955); filter: blur(18px) saturate(1.6); }
}
@keyframes jvGlassIn {
  from { opacity: 0; transform: scale(1.045); filter: blur(20px) saturate(1.6); }
  to   { opacity: 1; transform: scale(1); filter: blur(0) saturate(1); }
}
::view-transition-new(jvSide) { animation: jvSideIn .6s cubic-bezier(.32, .72, 0, 1) both; }
::view-transition-old(jvSide) { animation: jvSideOut .42s cubic-bezier(.32, .72, 0, 1) both; }
::view-transition-group(jvBrandLogo) { animation-duration: .7s; z-index: 10; }
@keyframes jvSideIn { from { opacity: 0; transform: translateX(70px) scale(.98); filter: blur(14px); } }
@keyframes jvSideOut { to { opacity: 0; transform: translateX(70px) scale(.98); filter: blur(14px); } }
/* browsers without View Transitions: the new screen still comes out of the blur */
html.jvGlass .jvFallbackIn { animation: jvGlassIn .55s cubic-bezier(.32, .72, 0, 1) both; }

/* ------------------------------------------------ home: the two brand screens */
html.jvGlass.jvOnHome .filterWorkspace { display: none; }
.jvHome { padding: 6px 0 30px; }
.jvHero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 16px 8px; }
.jvHeroLogos { display: flex; align-items: center; gap: 22px; padding: 14px 26px; border-radius: 22px;
  background: rgba(255, 255, 255, .94); box-shadow: 0 12px 40px rgba(0, 0, 0, .28), inset 0 1px 0 #fff; }
.jvHeroLogos img { height: 64px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.jvHeroLogos i { width: 1px; height: 46px; background: #d9e1e8; }
.jvWordmark { font: 800 34px/1 var(--font, sans-serif); letter-spacing: .02em; color: #111; }
.jvHero h1 { margin: 10px 0 0; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.05; letter-spacing: -.01em; font-weight: 800; }
.jvHero h1 span { background: linear-gradient(100deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jvHero p { margin: 0; color: var(--muted); font-size: 15px; }
.jvBrandGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-top: 26px; }
.jvBrandCard {
  position: relative; overflow: hidden; text-align: left; cursor: pointer; border-radius: 28px; padding: 26px;
  border: 1px solid var(--gl-line, var(--line)); color: var(--text); font: inherit;
  background: var(--gl-bg-strong, var(--panel));
  -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--gl-hi, transparent), var(--gl-shadow, none);
  transition: transform .45s cubic-bezier(.32, .72, 0, 1), box-shadow .45s cubic-bezier(.32, .72, 0, 1);
}
.jvBrandCard::before {   /* moving glass highlight */
  content: ""; position: absolute; inset: -40% -60%; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .13) 48%, transparent 58%);
  transform: translateX(-40%); transition: transform 1.1s cubic-bezier(.32, .72, 0, 1);
}
.jvBrandCard:hover { transform: translateY(-4px) scale(1.012); }
.jvBrandCard:hover::before { transform: translateX(40%); }
.jvBrandCard:active { transform: scale(.985); }
.jvBrandCard:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.jvBrandHead { display: flex; align-items: center; gap: 16px; }
.jvBrandDisc { width: 82px; height: 82px; border-radius: 22px; background: #fff; display: grid; place-items: center; flex: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25), inset 0 1px 0 #fff; }
.jvBrandDisc img { width: 64px; height: 64px; object-fit: contain; }
.jvBrandDisc .jvWordmark { font-size: 20px; }
.jvBrandName { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.jvBrandTag { color: var(--muted); font-size: 13px; margin-top: 2px; }
.jvBrandKpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.jvBrandKpis div { padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--gl-line, var(--line)); min-width: 0; }
html[data-theme="light"] .jvBrandKpis div { background: rgba(255, 255, 255, .55); }
.jvBrandKpis small { display: block; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jvBrandKpis b .jvCur { font-style: normal; }
.jvBrandKpis b { display: block; font-size: 17px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jvBrandFoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.jvSpark { flex: 1; height: 42px; min-width: 0; }
.jvSpark path.l { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.jvSpark path.a { fill: url(#jvSparkFill); opacity: .35; }
.jvDelta { font-size: 12px; font-weight: 700; white-space: nowrap; }
.jvDelta.up { color: var(--good); } .jvDelta.down { color: var(--bad); }
.jvOpen { font-size: 12px; font-weight: 800; letter-spacing: .1em; padding: 9px 14px; border-radius: 999px; background: var(--accent); color: #1b0d00; white-space: nowrap; }
.jvHomeNote { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* header chip: the brand you are looking at (click = home) */
.jvBrandChip { display: flex; align-items: center; gap: 8px; height: 40px; padding: 4px 12px 4px 5px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--gl-line, var(--line)); background: var(--gl-bg-strong, var(--panel2)); color: var(--text); font: inherit; font-weight: 800; letter-spacing: .06em; flex: none; }
.jvBrandChip[hidden] { display: none !important; }
html.jvGlass .topTitle { min-width: 120px; }
html.jvGlass .topTitle span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jvBrandChip .disc { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; }
.jvBrandChip img { width: 24px; height: 24px; object-fit: contain; }
.jvBrandChip .jvWordmark { font-size: 9px; }
.jvBrandChip .x { color: var(--muted); font-weight: 600; margin-left: 2px; }
.jvHomeTop { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; flex: none;
  border: 1px solid var(--gl-line, var(--line)); background: var(--gl-bg-strong, var(--panel2)); color: var(--text); font-size: 18px; }
@media (max-width: 900px) {
  .jvHeroLogos img { height: 46px; } .jvHeroLogos { gap: 14px; padding: 10px 16px; }
  .jvBrandGrid { grid-template-columns: 1fr; gap: 16px; }
  .jvBrandCard { padding: 20px; border-radius: 24px; }
  .jvBrandKpis b { font-size: 15px; }
  .jvBrandChip { height: 34px; padding: 3px 9px 3px 3px; font-size: 11px; }
  .jvBrandChip[hidden] { display: none !important; }
html.jvGlass .topTitle { min-width: 120px; }
html.jvGlass .topTitle span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jvBrandChip .disc { width: 26px; height: 26px; } .jvBrandChip img { width: 20px; height: 20px; }
  .jvHomeTop { width: 34px; height: 34px; font-size: 16px; }
}
@media (max-width: 560px) { .jvBrandKpis b .jvCur { display: block; font-size: 10.5px; font-style: normal; color: var(--muted); } .jvBrandChip .label { display: none; } .jvBrandKpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .jvBrandKpis div { padding: 9px; } }

@media (prefers-reduced-motion: reduce) {
  html.jvGlass body::before { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(*) { animation: none !important; }
  .jvBrandCard, .jvBrandCard::before, html.jvGlass .modal.on .box, html.jvGlass .jvFallbackIn { transition: none; animation: none; }
}
