/* =====================================================================
   hairline.css - the GSMcall portal card standard.

   One card, defined once, loaded by every portal page. Changing a value here
   changes it everywhere; that is the entire point of this file existing.
   Do not copy these rules into a page's inline <style> - a second copy is how
   the portal ended up running three different corner radii on one screen.

   Dark mode keys off the .dark class the pages already set, not a media query,
   so the existing theme toggle keeps working.

   Versioned by query string in the <link>. Bump ?v= on every change or
   browsers will keep serving the old file.
   ===================================================================== */

/* -- Hairline: the portal card standard -------------------------------
   One card, defined once, so a tile, a panel and a chart all read as the
   same object at different sizes. Replaces the copy-pasted utility
   strings that had three different radii running on one screen.
   Dark mode keys off the .dark class the page already sets rather than a
   media query, so the existing theme toggle keeps working untouched. */
:root {
  --hl-surface:#FFFFFF; --hl-surface-2:#FAFBFD;
  --hl-hairline:#E1E6EE; --hl-hairline-strong:#C9D2E0;
  --hl-ink:#080E1A; --hl-muted:#67738A; --hl-faint:#95A1B5;
  --hl-accent:#2563EB; --hl-accent-soft:rgba(37,99,235,.09);
  --hl-live:#02875A; --hl-alert:#C4123A; --hl-live-soft:rgba(2,135,90,.10);
  --hl-edge:inset 0 1px 0 rgba(255,255,255,.9);
  --hl-rest:0 .5px 1px rgba(8,14,26,.055), 0 2px 4px -2px rgba(8,14,26,.05), 0 0 0 .5px rgba(8,14,26,.045);
  --hl-hover:0 1px 2px rgba(8,14,26,.05), 0 16px 32px -12px rgba(8,14,26,.2), 0 4px 10px -4px rgba(8,14,26,.09), 0 0 0 .5px rgba(8,14,26,.07);
  --hl-sheen:rgba(255,255,255,.9);
  /* Hues are raw triplets so intensity can be tuned without touching the
     colour. Each is tied to what its card measures: green is live, blue
     is a session, violet is reach, amber is return. */
  --hl-hue-live:2,135,90; --hl-hue-session:37,99,235;
  --hl-hue-reach:99,63,218; --hl-hue-return:176,88,12;
  --hl-i-mult:1; --hl-glow:.34;
  --hl-r:15px; --hl-r-sm:11px;
  --hl-sunk:#EAEEF4;
  --hl-spring:cubic-bezier(.34,1.56,.64,1);
  --hl-ease:cubic-bezier(.22,.61,.36,1);
}
.dark {
  --hl-surface:#101623; --hl-surface-2:#0C111C;
  --hl-hairline:rgba(255,255,255,.07); --hl-hairline-strong:rgba(255,255,255,.15);
  --hl-ink:#EEF2F8; --hl-muted:#8895AB; --hl-faint:#5D6A80;
  --hl-accent:#5D9DFF; --hl-accent-soft:rgba(93,157,255,.13);
  --hl-live:#2FD39B; --hl-alert:#FB7185; --hl-live-soft:rgba(47,211,155,.13);
  --hl-edge:inset 0 1px 0 rgba(255,255,255,.055);
  --hl-rest:0 1px 2px rgba(0,0,0,.5), 0 0 0 .5px rgba(255,255,255,.035);
  --hl-hover:0 1px 2px rgba(0,0,0,.5), 0 22px 44px -16px rgba(0,0,0,.8), 0 4px 12px -4px rgba(0,0,0,.5), 0 0 0 .5px rgba(255,255,255,.07);
  --hl-sheen:rgba(255,255,255,.085);
  --hl-sunk:#0A0E18;
  --hl-hue-live:47,211,155; --hl-hue-session:93,157,255;
  --hl-hue-reach:167,139,250; --hl-hue-return:251,191,36;
  --hl-i-mult:1.35; --hl-glow:.42;
}

/* The surface, defined once. A panel and a metric tile are the same object;
   only their contents and whether they respond to a click differ. */
.panel, .metric-card {
  background:var(--hl-surface); border:1px solid var(--hl-hairline);
  border-radius:var(--hl-r);
  box-shadow:var(--hl-rest), var(--hl-edge);
}

/* The lift, defined once. .hl-lift makes any surface a clickable one - use it
   only where a click actually does something, because a surface that moves
   under the cursor is a promise. */
.hl-lift, .metric-card {
  transition:transform .38s var(--hl-spring), box-shadow .38s var(--hl-ease), border-color .38s var(--hl-ease);
  will-change:transform;
}
.hl-lift { cursor:pointer; }
.hl-lift:focus-visible {
  outline:2px solid var(--hl-accent); outline-offset:3px;
  border-color:var(--hl-hairline-strong);
}

.metric-card {
  position:relative; overflow:hidden; isolation:isolate;
  padding:16px 17px 17px;
}
/* Corner tint plus a faint surface gradient. Negative z-index keeps both
   layers above the card background but below its text. */
.metric-card::before {
  content:""; position:absolute; inset:0; z-index:-2;
  background:
    radial-gradient(130% 100% at 0% 0%, rgba(var(--hl-hue), calc(var(--hl-i) * var(--hl-i-mult))) 0%, transparent 58%),
    linear-gradient(177deg, var(--hl-surface) 0%, var(--hl-surface-2) 100%);
}
/* Hue distinguishes different kinds of measurement, never different
   instances of the same one - which is why the five feature tiles all
   share one hue while the four presence tiles each get their own. */
.metric-card { --hl-hue:0,0,0; --hl-i:.18; }
.hl-lift { --hl-hue:var(--hl-hue-session); }
[data-hue="live"]    { --hl-hue:var(--hl-hue-live); }
[data-hue="session"] { --hl-hue:var(--hl-hue-session); }
[data-hue="reach"]   { --hl-hue:var(--hl-hue-reach); }
[data-hue="return"]  { --hl-hue:var(--hl-hue-return); }
[data-hue="accent"]  { --hl-hue:var(--hl-hue-session); }
/* Specular sheen, positioned from the pointer by the listener below. */
.metric-card::after {
  content:""; position:absolute; inset:0; z-index:-1; opacity:0; pointer-events:none;
  background:radial-gradient(320px circle at var(--hl-mx,50%) var(--hl-my,0%), var(--hl-sheen) 0%, transparent 45%);
  transition:opacity .4s var(--hl-ease);
}
/* The lift casts light in the card's own colour. The neutral shadow still
   does the depth work; the hue is a second, softer bloom sitting under it,
   so it reads as coloured light rather than a coloured box. The specular
   sheen stays white on purpose - a real light source is not green. */
.hl-lift:hover, .metric-card:hover {
  transform:translateY(-5px);
  box-shadow:
    var(--hl-hover),
    0 20px 34px -16px rgba(var(--hl-hue), var(--hl-glow)),
    var(--hl-edge);
  border-color:var(--hl-hairline-strong);
}
.metric-card:hover::after { opacity:.42; }

.metric-label {
  font-size:10px; font-weight:600; letter-spacing:.11em; text-transform:uppercase;
  color:var(--hl-muted); display:flex; align-items:center; gap:7px; line-height:1;
}
.metric-value {
  font-size:36px; font-weight:600; letter-spacing:-.032em; line-height:1.04;
  margin-top:11px; color:var(--hl-ink); font-variant-numeric:tabular-nums;
}
.metric-value .metric-sub { font-size:20px; font-weight:500; color:var(--hl-faint); letter-spacing:-.02em; }
.metric-value.is-live { color:var(--hl-live); }
.metric-value.is-accent { color:var(--hl-accent); }
.metric-foot { font-size:11.5px; color:var(--hl-faint); margin-top:8px; line-height:1.4; }

.metric-card-sm { padding:13px 14px 14px; }
.metric-card-sm .metric-value { font-size:27px; margin-top:9px; }
.metric-card-sm .metric-foot { margin-top:5px; }

.metric-pulse { width:6px; height:6px; border-radius:50%; background:var(--hl-live); position:relative; flex:none; }
.metric-pulse::after {
  content:""; position:absolute; inset:-3.5px; border-radius:50%;
  border:1px solid var(--hl-live); animation:hl-ring 2.6s var(--hl-ease) infinite;
}
@keyframes hl-ring { 0%{transform:scale(.55);opacity:.7;} 65%{transform:scale(1.55);opacity:0;} 100%{opacity:0;} }

/* The numeral treatment, so every figure in the portal is set the same way.
   Tabular figures are the point: a number must not change width as it ticks,
   or a row of live metrics jitters on every refresh. Colour is deliberately
   absent here - a figure takes the ink colour unless it carries genuine state,
   which is what .hl-good and .hl-alert are for. */
.hl-num {
  font-weight:600; letter-spacing:-.032em; font-variant-numeric:tabular-nums;
}
.hl-good { color:var(--hl-live); }
.hl-alert { color:var(--hl-alert); }

/* A table header is a surface too - defining it here means the call table, the
   user table and every table added later agree without anyone re-deciding. */
.hl-thead {
  background:var(--hl-sunk);
  color:var(--hl-muted);
  border-bottom:1px solid var(--hl-hairline);
}

/* An elevated surface: modals and anything that floats above the page. Kept
   here so every dialog in the portal sits at the same height. */
.hl-raised { box-shadow:0 32px 64px -24px rgba(8,14,26,.28), var(--hl-edge); }
.dark .hl-raised { box-shadow:0 32px 64px -24px rgba(0,0,0,.8), var(--hl-edge); }

/* A card whose state deserves an edge - a connected integration, say - takes
   its hue on the border. Without this, .panel would quietly overwrite a
   state colour set by a utility class, because it loads later. */
.hl-featured { border-color:rgba(var(--hl-hue), .5); }

/* Containers share the surface above and never lift on their own. */

@media (prefers-reduced-motion:reduce) {
  .panel, .metric-card, .hl-lift { transition:none; }
  .metric-card:hover, .hl-lift:hover { transform:none; }
  .metric-pulse::after { animation:none; }
}
