/* ============================================================================
   glass.css: frosted-glass header + cards (2026-11-27).
   Header: full-width glass (below). Cards: see "Glass cards" at the end.
   Loaded after each page's inline <style>, so these rules override the
   inline .site-header / submenu / mobile-menu rules. Height stays 74px.
   At the very top the bar is clear; as the page scrolls it fades into a
   light-tint glass so content stays visible, blurred, behind it.
   The fade is CSS-only (scroll-driven animation). Browsers without it
   (Firefox today) just show the glass state all the time.
   The blur sits on ::before, not on the header itself: a backdrop-filter on
   the header would trap the fixed mobile menu inside it and stop the
   dropdowns from blurring the page behind them.
   ========================================================================= */
:root{
  --glass-bg:rgba(14,14,15,.38);
  --glass-menu-bg:rgba(26,26,28,.78);
  --glass-line:rgba(255,255,255,.10);
  --glass-blur:blur(16px) saturate(170%);
}
:root[data-theme="light"]{
  --glass-bg:rgba(247,245,241,.42);
  --glass-menu-bg:rgba(255,255,255,.82);
  --glass-line:rgba(20,20,22,.08);
}

.site-header{
  background:none;
  -webkit-backdrop-filter:none;backdrop-filter:none;
  border-bottom:1px solid var(--glass-line);
}
.site-header::before{
  content:"";position:absolute;inset:0;z-index:-1;
  background:var(--glass-bg);
  -webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);
}

/* Clear at the top, glass after ~80px of scroll. */
@supports (animation-timeline:scroll()){
  @keyframes glass-in{from{opacity:0}to{opacity:1}}
  @keyframes glass-line-in{from{border-bottom-color:transparent}}
  .site-header::before{animation:glass-in linear both;animation-timeline:scroll(root);animation-range:0 80px}
  .site-header{animation:glass-line-in linear both;animation-timeline:scroll(root);animation-range:0 80px}
}

/* Desktop dropdowns: same glass, more opaque so links stay readable. */
@media(min-width:861px){
  .site-header .submenu{
    background:var(--glass-menu-bg);border-color:var(--glass-line);
    -webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);
  }
}

/* Mobile menu: full-width glass panel under the bar. */
@media(max-width:860px){
  .site-header .nav-links{
    background:var(--glass-menu-bg);
    -webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);
    max-height:calc(100svh - 74px);overflow-y:auto;
  }
  /* Menu open at the top of the page: show the bar so it does not float alone. */
  .site-header:has(.nav-links.open)::before{animation:none;opacity:1}
}

/* No blur support, or the visitor asked for less transparency: solid bar. */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .site-header::before,.site-header .submenu,.site-header .nav-links{background:var(--header-bg)}
}
@media(prefers-reduced-transparency:reduce){
  .site-header::before,.site-header .submenu,.site-header .nav-links{background:var(--header-bg)}
}

/* ============ Glass cards ============
   Service cards, process steps, FAQ panels, format/channel cards and the
   sample dashboard frame. Tint is kept high (.62 light / .55 dark) so body
   text stays AA on the busiest part of the mesh; raise --card-glass if a
   section ever sits on a louder background. Inner tiles stay solid on
   purpose: a blur inside a blur only sees its parent, not the page. */
:root{
  --card-glass:rgba(26,26,28,.55);
  --card-glass-line:rgba(255,255,255,.10);
  --card-glass-hi:rgba(255,255,255,.06);
  --card-blur:blur(14px) saturate(160%);
}
:root[data-theme="light"]{
  --card-glass:rgba(255,255,255,.62);
  --card-glass-line:rgba(255,255,255,.75);
  --card-glass-hi:rgba(255,255,255,.9);
}
.card,.info .card,.step,.faq-panel,.type-card,.chan,.dash-shell{
  background:var(--card-glass);
  border-color:var(--card-glass-line);
  -webkit-backdrop-filter:var(--card-blur);backdrop-filter:var(--card-blur);
  box-shadow:inset 0 1px 0 var(--card-glass-hi),0 18px 40px -28px rgba(40,24,120,.35);
}
/* Keep the violet hover border the cards already use. */
.card:hover,.type-card:hover,.chan:hover{border-color:var(--accent-text)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .card,.step,.faq-panel,.type-card,.chan,.dash-shell{background:var(--bg-2)}
}
@media(prefers-reduced-transparency:reduce){
  .card,.step,.faq-panel,.type-card,.chan,.dash-shell{background:var(--bg-2)}
}
