/* ============================================================================
   glass.css — the "liquid glass" layer on top of skin-b.css
   Adds: a drifting aurora the panels can refract, deeper glass with a
   specular edge, pointer-tracked highlight, springy nav pill, value ticks,
   press feedback. Anything that moves is disabled under
   prefers-reduced-motion and softened on narrow screens.
   ========================================================================== */

:root{
  --dim-fix:#5f646d;
  --glass-a: rgba(255,255,255,.52);
  --glass-b: rgba(255,255,255,.26);
  --glass-border: rgba(255,255,255,.78);
  --spec: rgba(255,255,255,.95);
  --ease-spring: cubic-bezier(.22,1.2,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ---------- the moving light behind everything ---------- */
/* skin-b painted the canvas on <body>; a negative-z pseudo element sits *behind*
   that background, so the canvas moves to <html> and body goes transparent. */
html{background:#e8eaf1}
body{background:none}
body .wrap{border-left:0;border-right:0}

body::before{
  content:"";
  position:fixed; inset:-25vh -10vw; z-index:-1; pointer-events:none;
  background:
    radial-gradient(38vw 34vw at 18% 22%, rgba(122,162,255,.55), rgba(122,162,255,0) 62%),
    radial-gradient(34vw 30vw at 82% 12%, rgba(150,255,214,.5), rgba(150,255,214,0) 60%),
    radial-gradient(40vw 36vw at 68% 84%, rgba(214,170,255,.45), rgba(214,170,255,0) 62%),
    radial-gradient(30vw 28vw at 12% 88%, rgba(255,214,170,.42), rgba(255,214,170,0) 60%);
  filter:blur(10px) saturate(120%);
  animation:aurora 46s ease-in-out infinite alternate;
  will-change:transform;
}
body::after{
  content:"";
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.55'/></svg>"),
    radial-gradient(1200px 700px at 50% -12%, rgba(255,255,255,.55), rgba(255,255,255,0) 58%);
  background-size:140px 140px, auto;
  opacity:.30;
  mix-blend-mode:soft-light;
}
@keyframes aurora{
  0%   {transform:translate3d(0,0,0) scale(1)}
  33%  {transform:translate3d(-3vw,2vh,0) scale(1.06)}
  66%  {transform:translate3d(2vw,-3vh,0) scale(.97)}
  100% {transform:translate3d(3vw,1vh,0) scale(1.04)}
}

/* glass costs contrast: darken the secondary text one step */
body .card .hint,
body .tile .note,
body .card .right,
body .srow .k,
body .calc-hint,
body footer,
body .stamp,
body .label{color:var(--dim-fix)}

/* ---------- glass surfaces ---------- */
body .top,
body .tile,
body .card,
body .aside,
body .calc-card,
body .calc,
body .bigsearch,
body .chartbox{
  background:linear-gradient(150deg, var(--glass-a), var(--glass-b));
  border:1px solid var(--glass-border);
  -webkit-backdrop-filter:blur(30px) saturate(190%);
  backdrop-filter:blur(30px) saturate(190%);
  box-shadow:
    0 1px 0 var(--spec) inset,
    0 0 0 1px rgba(255,255,255,.45) inset,
    0 -1px 0 rgba(255,255,255,.30) inset,
    0 1px 2px rgba(16,17,20,.04),
    0 24px 50px -28px rgba(18,22,38,.42);
  position:relative;
  isolation:isolate;
  transition:transform .42s var(--ease-out), box-shadow .42s var(--ease-out), border-color .3s ease;
}

/* specular sweep across the top-left of every glass panel */
body .top::before,
body .tile::before,
body .card::before,
body .aside::before,
body .calc-card::before{
  content:"";
  position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:1;
  background:linear-gradient(128deg, rgba(255,255,255,.85) 0%, rgba(255,255,255,.24) 26%, rgba(255,255,255,0) 46%);
  opacity:.85;
  mix-blend-mode:soft-light;
}

/* pointer highlight — liquid, follows the cursor */
body .tile,
body .card,
body .aside,
body .calc-card{
  background-image:
    radial-gradient(220px 220px at var(--mx,50%) var(--my,0%), rgba(255,255,255,.75), rgba(255,255,255,0) 60%),
    linear-gradient(150deg, var(--glass-a), var(--glass-b));
}
body .tile:hover,
body .card:hover,
body .aside:hover,
body .calc-card:hover{
  transform:translateY(-2px);
  box-shadow:
    0 1px 0 var(--spec) inset,
    0 -1px 0 rgba(255,255,255,.32) inset,
    0 2px 4px rgba(16,17,20,.05),
    0 34px 64px -30px rgba(18,22,38,.5);
}

/* terminal: dark glass, not a flat plate */
body .term{
  background:linear-gradient(160deg, rgba(28,30,36,.86), rgba(16,17,21,.92));
  -webkit-backdrop-filter:blur(22px) saturate(150%); backdrop-filter:blur(22px) saturate(150%);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 1px 0 rgba(255,255,255,.18) inset, 0 -1px 0 rgba(255,255,255,.05) inset, 0 30px 60px -32px rgba(12,14,22,.65);
}

/* ---------- buttons: liquid press ---------- */
body .top nav a,
body .lang button,
body .top .search button,
body .bigsearch button,
body .ranges button,
body a.more,
body a.site{
  transition:transform .3s var(--ease-spring), background-color .25s ease, color .2s ease, border-color .2s ease, box-shadow .3s ease;
}
body .top nav a:active,
body .lang button:active,
body .top .search button:active,
body .bigsearch button:active,
body .ranges button:active,
body a.more:active,
body a.site:active{transform:scale(.955)}

/* nav: one pill glides between items */
body .top nav{position:relative}
body .nav-pill{
  position:absolute; z-index:0; border-radius:999px;
  background:linear-gradient(180deg, rgba(30,32,38,.88), rgba(12,13,17,.92));
  -webkit-backdrop-filter:blur(10px) saturate(160%); backdrop-filter:blur(10px) saturate(160%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.22) inset,
    0 10px 22px -12px rgba(16,17,20,.9);
  transition:transform .46s var(--ease-spring), width .46s var(--ease-spring), height .3s ease;
  pointer-events:none;
}
body .top nav a{position:relative; z-index:1}
body .top nav a.on{background:none; box-shadow:none}
body .top nav a.on:hover{color:#fff}

/* ---------- live numbers tick ---------- */
@keyframes tick{
  0%{transform:translateY(2px); opacity:.55}
  60%{opacity:1}
  100%{transform:none; opacity:1}
}
body .tick{animation:tick .34s var(--ease-out) both}
body .tile .v,body .srow .sv,body .co .v,body .price{
  transition:color .3s ease;
  will-change:transform,opacity;
}

/* ---------- charts draw themselves ----------
   the keyframes live here, but liquid.js owns the timing: it measures each
   path and sets dasharray/dashoffset itself (a CSS-only animation guesses the
   length and leaves a visible gap on paths of a different size). */
@keyframes draw{to{stroke-dashoffset:0}}

/* ---------- scroll reveal ---------- */
body .rv{opacity:0; transform:translateY(14px) scale(.995)}
body .rv.in{opacity:1; transform:none; transition:opacity .7s var(--ease-out), transform .7s var(--ease-out)}

/* ---------- mobile: cheaper glass, no aurora drift ---------- */
@media(max-width:820px){
  body::before{animation:none; filter:blur(6px)}
  body .top,
  body .tile,
  body .card,
  body .aside,
  body .calc-card{
    -webkit-backdrop-filter:blur(18px) saturate(160%);
    backdrop-filter:blur(18px) saturate(160%);
  }
  body .tile:hover,
  body .card:hover,
  body .aside:hover{transform:none}
}

/* ---------- honour reduced motion ---------- */
@media(prefers-reduced-motion:reduce){
  body::before{animation:none}
  body .top,body .tile,body .card,body .aside,body .calc-card,body .term{transition:none}
  body .tile:hover,body .card:hover,body .aside:hover,body .calc-card:hover{transform:none}
  body .nav-pill{transition:none}
  body .tick{animation:none}
  body .chart .line,body .chartbox path[stroke]{animation:none}
  body .rv{opacity:1;transform:none}
}


/* ---------- slow sheen on the top bar (one full pass every 9 s) ---------- */
@media(min-width:821px){body .top{overflow:hidden}}
body .top::after{
  content:"";
  position:absolute; top:0; bottom:0; width:38%; left:-45%;
  background:linear-gradient(100deg, rgba(255,255,255,0), rgba(255,255,255,.55) 45%, rgba(255,255,255,0));
  transform:skewX(-14deg); pointer-events:none; z-index:0;
  animation:sheen 9s ease-in-out infinite;
}
@keyframes sheen{
  0%,55%{left:-45%}
  85%{left:112%}
  100%{left:112%}
}
@media(prefers-reduced-motion:reduce){body .top::after{display:none}}
