/* Hallmark · v2.0.0 · theme: Cobalt, third pass — future layer · deal: manual · genre: modern-minimal · scope: app · shape: app screen · redesign: full · pass: 3 (fresh, futuristic, interactive) · signature: a lit surface — hairline glass over an ambient grid, one cobalt light that follows the pointer and the figure it lands on */
/* critique: pass 2 was clean but still a document on a page. This pass adds depth and response: glass chrome, a light that tracks the cursor across a card, figures that acknowledge a change, and a keyboard-first command palette. Nothing loops, nothing autoplays, everything stops for prefers-reduced-motion. */

/* ==========================================================================
   1. TOKENS — a little more light and depth, same paper and cobalt
   ========================================================================== */
:root,
[data-theme="light"] {
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(16, 32, 45, .08);
  --grid-line: rgba(16, 60, 100, .055);
  --glow: rgba(0, 85, 150, .10);
  --spot: rgba(0, 85, 150, .10);
  --edge: rgba(0, 85, 150, .28);
  --sheen: rgba(255, 255, 255, .55);
}
[data-theme="dark"] {
  --glass: rgba(21, 33, 44, .68);
  --glass-line: rgba(255, 255, 255, .08);
  --grid-line: rgba(120, 180, 235, .06);
  --glow: rgba(111, 176, 236, .12);
  --spot: rgba(111, 176, 236, .14);
  --edge: rgba(111, 176, 236, .38);
  --sheen: rgba(255, 255, 255, .06);
}

/* ==========================================================================
   2. AMBIENT — a grid barely there, two lights, no colour recipe
   ========================================================================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 12% -8%, var(--glow), transparent 70%),
    radial-gradient(680px 380px at 92% 4%, var(--glow), transparent 72%);
}
[data-theme="light"] body { background: linear-gradient(180deg, #fbfdff 0, var(--ground) 420px); }
.appheader,
main.container { position: relative; z-index: 1; }
.sr-app { position: relative; z-index: 1; }

/* ==========================================================================
   3. CHROME — glass, sticky, and it shrinks when the page moves
   ========================================================================== */
.appheader {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--glass-line);
  transition: box-shadow var(--dur-short) ease, background-color var(--dur-short) ease;
}
.appheader.is-scrolled {
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(9, 30, 50, .08);
}
.welcomebar { background: transparent; border-bottom: 1px solid var(--glass-line); }
.topbar { background: transparent; border-bottom: 0; height: 62px; transition: height var(--dur-short) ease; }
.appheader.is-scrolled .topbar { height: 54px; }
.topbar .brand .logo { box-shadow: 0 6px 16px rgba(0, 85, 150, .28), inset 0 1px 0 rgba(255, 255, 255, .25); }

/* nav: a moving underline under the hovered item, a pill for the current one */
nav.tabs a,
.nav-dd-btn { position: relative; }
nav.tabs a::after,
.nav-dd-btn::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-short) ease;
  opacity: .9;
}
nav.tabs a:hover::after,
.nav-dd-btn:hover::after,
nav.tabs a.active::after,
.nav-dd-btn.active::after { transform: scaleX(1); }
nav.tabs a.active::after { opacity: 0; }

/* ==========================================================================
   4. SURFACES — a lit sheet: hairline, inner sheen, pointer spotlight
   ========================================================================== */
.card,
.kpi,
.issue-card,
.news,
.sr-panel,
.sr-kpi,
.sr-ticker,
.toolbar.card {
  position: relative;
  isolation: isolate;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 32, 45, .05), 0 1px 3px rgba(16, 32, 45, .04);
  transition: box-shadow var(--dur-short) ease, border-color var(--dur-short) ease, transform var(--dur-short) ease;
}
/* the light that follows the pointer, set by future.js as --mx / --my */
.card::after,
.kpi::after,
.issue-card::after,
.sr-panel::after,
.sr-kpi::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(280px 220px at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 70%);
  transition: opacity var(--dur-short) ease;
}
@media (pointer: fine) {
  .card:hover::after,
  .kpi:hover::after,
  .issue-card:hover::after,
  .sr-panel:hover::after,
  .sr-kpi:hover::after { opacity: 1; }
  .card:hover,
  .kpi:hover,
  .issue-card:hover { border-color: var(--edge); }
  .kpi.link:hover { transform: translateY(-2px); }
}

/* the figure a KPI carries acknowledges its own change (future.js adds .is-bumped) */
.kpi .value { transition: color var(--dur-short) ease; }
.kpi.is-bumped .value { color: var(--accent); }
.kpi.is-bumped { border-color: var(--edge); }

/* ==========================================================================
   5. CONTROLS — a lit primary, a trail on hover
   ========================================================================== */
.btn,
.sr-btn {
  position: relative;
  overflow: hidden;
}
.btn::before,
.sr-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--sheen), transparent 60%);
  opacity: .9;
  pointer-events: none;
}
.btn.primary::before { background: linear-gradient(180deg, rgba(255, 255, 255, .22), transparent 70%); }
.btn:focus-visible,
.sr-btn:focus-visible { outline-offset: 3px; }

.field input,
.field select { transition: border-color var(--dur-micro) ease, box-shadow var(--dur-micro) ease, background-color var(--dur-micro) ease; }

/* ==========================================================================
   6. REVEAL — one stagger on first paint, never again, never without script
   ========================================================================== */
html.js-reveal .view:not(.hidden) > * {
  opacity: 0;
  transform: translateY(6px);
  animation: hallReveal 460ms cubic-bezier(.22, .61, .36, 1) forwards;
}
html.js-reveal .view:not(.hidden) > *:nth-child(1) { animation-delay: 0ms; }
html.js-reveal .view:not(.hidden) > *:nth-child(2) { animation-delay: 45ms; }
html.js-reveal .view:not(.hidden) > *:nth-child(3) { animation-delay: 90ms; }
html.js-reveal .view:not(.hidden) > *:nth-child(4) { animation-delay: 130ms; }
html.js-reveal .view:not(.hidden) > *:nth-child(5) { animation-delay: 165ms; }
html.js-reveal .view:not(.hidden) > *:nth-child(n+6) { animation-delay: 195ms; }
@keyframes hallReveal {
  to { opacity: 1; transform: none; }
}

.sr-kpi,
.sr-panel { animation: hallReveal 420ms cubic-bezier(.22, .61, .36, 1) both; }
html:not(.js-reveal) .sr-kpi,
html:not(.js-reveal) .sr-panel { animation: none; }

/* ==========================================================================
   7. COMMAND PALETTE (⌘K / Ctrl+K), built by future.js
   ========================================================================== */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 12vh 16px 16px;
  background: rgba(8, 18, 28, .38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cmdk[hidden] { display: none; }
.cmdk-box {
  width: min(560px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 80px rgba(6, 20, 34, .38), 0 0 0 1px var(--glass-line);
  overflow: hidden;
  animation: hallReveal 200ms ease both;
}
.cmdk-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 500 15px/1 var(--font);
  padding: 16px 18px;
  outline: none;
}
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow: auto; }
.cmdk-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.cmdk-list li[aria-selected="true"],
.cmdk-list li:hover { background: var(--accent-soft); color: var(--accent); }
.cmdk-list li .k {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.cmdk-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; }
.cmdk-hint {
  display: flex;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
kbd.cap {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--ink-2);
  background: var(--paper-2);
}

/* the small hint that the shortcut exists, in the top bar */
.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  margin-right: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--display);
  cursor: pointer;
  transition: color var(--dur-micro) ease, border-color var(--dur-micro) ease, background-color var(--dur-micro) ease;
}
.cmdk-trigger:hover { color: var(--accent); border-color: var(--edge); background: var(--accent-soft); }
.cmdk-trigger svg { fill: none; stroke: currentColor; stroke-width: 1.8; width: 15px; height: 15px; }
@media (max-width: 900px) { .cmdk-trigger span { display: none; } }

/* ==========================================================================
   8. LOGIN — the same light, one still frame
   ========================================================================== */
.auth-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 50% -10%, var(--glow), transparent 70%),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px) 0 0 / 34px 34px;
  mask-image: radial-gradient(80% 70% at 50% 20%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 20%, #000 20%, transparent 80%);
}
.auth-card { position: relative; z-index: 1; backdrop-filter: blur(2px); }

/* ==========================================================================
   9. SITREP — the light on the console too
   ========================================================================== */
.sr-top {
  position: sticky;
  top: 8px;
  z-index: 30;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-color: var(--glass-line);
}
.sr-prov { transition: fill var(--dur-micro) ease, stroke var(--dur-micro) ease, filter var(--dur-micro) ease; }
@media (pointer: fine) {
  .sr-prov:hover { filter: drop-shadow(0 0 10px var(--spot)); }
}
.sr-threads li { transition: background-color var(--dur-micro) ease, padding-left var(--dur-micro) ease; }
@media (pointer: fine) {
  .sr-threads li:hover { padding-left: 18px; }
}

/* ==========================================================================
   10. MOTION OFF, EVERYTHING VISIBLE
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .view:not(.hidden) > *,
  .sr-kpi,
  .sr-panel,
  .cmdk-box { animation: none !important; opacity: 1 !important; transform: none !important; }
  .card::after, .kpi::after, .issue-card::after, .sr-panel::after, .sr-kpi::after { display: none; }
  .appheader, .topbar { transition: none; }
}
